#include <NameTree.h>
Public Member Functions | |
NameTree (Obj name_tree) | |
NameTree (const NameTree &d) | |
NameTree & | operator= (const NameTree &d) |
bool | IsValid () |
NameTreeIterator | GetIterator (const UChar *key, int key_sz) |
NameTreeIterator | GetIterator () |
Obj | GetValue (const UChar *key, int key_sz) |
void | Put (const UChar *key, int key_sz, Obj value) |
void | Erase (const UChar *key, int key_sz) |
void | Erase (DictIterator &pos) |
Obj | GetSDFObj () const |
Static Public Member Functions | |
static NameTree | Create (class SDFDoc &doc, const std::string &name) |
static NameTree | Find (class SDFDoc &doc, const std::string &name) |
Protected Member Functions | |
NameTree () | |
Protected Attributes | |
TRN_NameTree | mp_obj |
A NameTree is a common data structure in PDF. See section 3.8.5 'Name Trees' in PDF Reference Manual for more details.
A name tree serves a similar purpose to a dictionary - associating keys and values - but by different means. NameTrees allow efficient storage of very large association collections (string/Obj* maps). A NameTree can have many more entries than a SDF/Cos dictionary can.
NameTree-s use SDF/Cos-style strings (not null-terminated C strings), which may use Unicode encoding etc.
Definition at line 47 of file NameTree.h.
pdftron::SDF::NameTree::NameTree | ( | Obj | name_tree | ) |
pdftron::SDF::NameTree::NameTree | ( | const NameTree & | d | ) |
Copy constructor
|
inlineprotected |
Definition at line 180 of file NameTree.h.
|
static |
Retrieves the NameTree inside the '/Root/Names' dictionary with the specified key name, or creates it if it does not exist.
doc | - The document in which the name tree is created. |
name | - The name of the NameTree to create. |
void pdftron::SDF::NameTree::Erase | ( | const UChar * | key, |
int | key_sz | ||
) |
Removes the specified object from the tree. Does nothing if no object with that name exists.
key | data buffer representing the key of the entry to be removed. |
key_sz | The size (in bytes) of the key. |
void pdftron::SDF::NameTree::Erase | ( | DictIterator & | pos | ) |
|
static |
Retrieves a name tree, with the given key name, from the '/Root/Names' dictionary of the doc.
doc | - The document in which to search for the name. |
name | - The name of the name tree to find. |
NameTreeIterator pdftron::SDF::NameTree::GetIterator | ( | const UChar * | key, |
int | key_sz | ||
) |
Search for the specified key in the NameTree.
key | data buffer representing the key to be found. |
key_sz | The size (in bytes) of the key. |
NameTreeIterator pdftron::SDF::NameTree::GetIterator | ( | ) |
Obj pdftron::SDF::NameTree::GetSDFObj | ( | ) | const |
Search the NameTree for a given key.
key | - a key to search for in the dictionary |
key_sz | - the buffer size used to store the key. |
bool pdftron::SDF::NameTree::IsValid | ( | ) |
Puts a new entry in the name tree. If an entry with this key is already in the tree, it is replaced.
key | data buffer representing the key of the new entry. |
key_sz | The size (in bytes) of the key. |
value | the value associated with the key. It can be any SDF::Obj. |
|
protected |
Definition at line 180 of file NameTree.h.