class HexaPDF::NameTreeNode

Implementation of PDF name trees.

Name trees are used in a similar fashion as dictionaries, however, the key in a name tree is always a string instead of a symbol. Another difference is that the keys in a name tree are always sorted to allow fast lookup of a specific key.

A name tree consists of one or more NameTreeNodes. If there is only one node, it contains all stored associations in the /Names entry. Otherwise the root node needs to have a /Kids entry that points to one or more intermediate or leaf nodes. An intermediate node contains a /Kids entry whereas a leaf node contains a /Names entry.

Since this is a complex structure that must follow several restrictions, it is not advised to build a name tree manually. Instead, use the provided convenience methods (see HexaPDF::Utils::SortedTreeNode) to add or retrieve entries. They ensure that the name tree stays valid.

See: PDF1.7 s7.9.6

Private Instance Methods

key_type() click to toggle source

Defines the class that is used for the keys in the name tree (String).

# File lib/hexapdf/name_tree_node.rb, line 74
def key_type
  String
end
leaf_node_container_name() click to toggle source

Defines the dictionary entry name that contains the leaf node entries.

# File lib/hexapdf/name_tree_node.rb, line 69
def leaf_node_container_name
  :Names
end