PoDoFo  1.0.0-dev
Public Member Functions | Protected Member Functions | List of all members
PoDoFo::PdfNameTreeOperations Class Referenceabstract

A low level interface with operations to handle document name trees stored in the /Names element. More...

#include <PdfNameTreeOperations.h>

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

Public Member Functions

virtual void AddValue (PdfKnownNameTree tree, const PdfString &key, const PdfObject &value)=0
 Insert a key and value in one of the dictionaries of the name tree. More...
 
virtual void AddValue (const PdfName &treeName, const PdfString &key, const PdfObject &value)=0
 
virtual const PdfObjectGetValue (PdfKnownNameTree tree, const std::string_view &key) const =0
 Get the object referenced by a string key in one of the dictionaries of the name tree. More...
 
virtual const PdfObjectGetValue (const std::string_view &treeName, const std::string_view &key) const =0
 
virtual PdfObjectGetValue (PdfKnownNameTree tree, const std::string_view &key)=0
 
virtual PdfObjectGetValue (const std::string_view &treeName, const std::string_view &key)=0
 
virtual bool HasKey (PdfKnownNameTree tree, const std::string_view &key) const =0
 Tests whether a certain nametree has a value. More...
 
virtual bool HasKey (const std::string_view &treeName, const std::string_view &key) const =0
 
virtual void ToDictionary (PdfKnownNameTree tree, PdfStringMap< PdfObject > &dict, bool skipClear=false) const =0
 Adds all keys and values from a name tree to a dictionary. More...
 
virtual void ToDictionary (const std::string_view &treeName, PdfStringMap< PdfObject > &dict, bool skipClear=false) const =0
 

Protected Member Functions

 PdfNameTreeOperations (const PdfNameTreeOperations &)=default
 
PdfNameTreeOperationsoperator= (const PdfNameTreeOperations &)=default
 

Detailed Description

A low level interface with operations to handle document name trees stored in the /Names element.

Remarks
Implemented by PdfNameTrees

Member Function Documentation

◆ AddValue()

virtual void PoDoFo::PdfNameTreeOperations::AddValue ( PdfKnownNameTree  tree,
const PdfString key,
const PdfObject value 
)
pure virtual

Insert a key and value in one of the dictionaries of the name tree.

Parameters
treename of the tree to search for the key.
keythe key to insert. If it exists, it will be overwritten.
valuethe value to insert.

◆ GetValue()

virtual const PdfObject* PoDoFo::PdfNameTreeOperations::GetValue ( PdfKnownNameTree  tree,
const std::string_view &  key 
) const
pure virtual

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.

Implemented in PoDoFo::PdfNameTrees.

◆ HasKey()

virtual bool PoDoFo::PdfNameTreeOperations::HasKey ( PdfKnownNameTree  tree,
const std::string_view &  key 
) const
pure virtual

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.

Implemented in PoDoFo::PdfNameTrees.

◆ ToDictionary()

virtual void PoDoFo::PdfNameTreeOperations::ToDictionary ( PdfKnownNameTree  tree,
PdfStringMap< PdfObject > &  dict,
bool  skipClear = false 
) const
pure virtual

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

Implemented in PoDoFo::PdfNameTrees.


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