PoDoFo  1.0.0-dev
Public Member Functions | Friends | List of all members
PoDoFo::PdfNameTrees Class Referencefinal

Interface to access names trees in the document. More...

#include <PdfNameTrees.h>

Inheritance diagram for PoDoFo::PdfNameTrees:
PoDoFo::PdfNameTreeOperations

Public Member Functions

template<typename TNameTree >
TNameTree * GetTree ()
 
template<typename TNameTree >
const TNameTree * GetTree () const
 
template<typename TNameTree >
TNameTree & MustGetTree ()
 
template<typename TNameTree >
const TNameTree & MustGetTree () const
 
template<typename TNameTree >
TNameTree & GetOrCreateTree ()
 
const PdfObjectGetValue (PdfKnownNameTree tree, const std::string_view &key) const override
 Get the object referenced by a string key in one of the dictionaries of the name tree. More...
 
PdfObjectGetValue (PdfKnownNameTree tree, const std::string_view &key) override
 
bool HasKey (PdfKnownNameTree tree, const std::string_view &key) const override
 Tests whether a certain nametree has a value. More...
 
void ToDictionary (PdfKnownNameTree tree, PdfStringMap< PdfObject > &dict, bool skipClear=false) const override
 Adds all keys and values from a name tree to a dictionary. More...
 

Friends

class PdfDocument
 

Additional Inherited Members

- Protected Member Functions inherited from PoDoFo::PdfNameTreeOperations
 PdfNameTreeOperations (const PdfNameTreeOperations &)=default
 
PdfNameTreeOperationsoperator= (const PdfNameTreeOperations &)=default
 

Detailed Description

Interface to access names trees in the document.

Remarks
Prefer accessing trees through GetNameTree<TNameTree> or similars. You can cast the instance to PdfNameTreeOperations to access low level mutable operations

Member Function Documentation

◆ GetValue()

const PdfObject* PoDoFo::PdfNameTrees::GetValue ( PdfKnownNameTree  tree,
const std::string_view &  key 
) const
overridevirtual

Get the object referenced by a string key in one of the dictionaries of the name tree.

Parameters
treename of the tree to search for the key.
keythe key to search for
Returns
the value of the key or nullptr if the key was not found. if the value is a reference, the object referenced by this reference is returned.

Implements PoDoFo::PdfNameTreeOperations.

◆ HasKey()

bool PoDoFo::PdfNameTrees::HasKey ( PdfKnownNameTree  tree,
const std::string_view &  key 
) const
overridevirtual

Tests whether a certain nametree has a value.

It is generally faster to use GetValue and check for nullptr as return value.

Parameters
treename of the tree to search for the key.
keyname of the key to look for
Returns
true if the dictionary has such a key.

Implements PoDoFo::PdfNameTreeOperations.

◆ ToDictionary()

void PdfNameTrees::ToDictionary ( PdfKnownNameTree  tree,
PdfStringMap< PdfObject > &  dict,
bool  skipClear = false 
) const
overridevirtual

Adds all keys and values from a name tree to a dictionary.

Removes all keys that have been previously in the dictionary.

Parameters
treethe name of the tree to convert into a dictionary
dictadd all keys and values to this dictionary
skipClearskip clearing the output dictionary

Implements PoDoFo::PdfNameTreeOperations.


The documentation for this class was generated from the following files: