5#ifndef PDF_NAME_TREES_H
6#define PDF_NAME_TREES_H
8#include "PdfNameTree.h"
9#include "PdfNameTreeOperations.h"
34 template <
typename TNameTree>
40 template <
typename TNameTree>
46 template <
typename TNameTree>
52 template <
typename TNameTree>
58 template <
typename TNameTree>
66 PdfObject* GetValue(PdfKnownNameTree
tree,
const std::string_view&
key)
override;
67 bool HasKey(PdfKnownNameTree
tree,
const std::string_view&
key)
const override;
73 const PdfObject* GetValue(
const std::string_view&
treeName,
const std::string_view&
key)
const override;
75 bool HasKey(
const std::string_view&
treeName,
const std::string_view&
key)
const override;
98 PdfObject* getValue(
const std::string_view&
name,
const std::string_view&
key)
const;
100 PdfNameTreeBase* getNameTree(PdfKnownNameTree
tree)
const;
102 PdfNameTreeBase& mustGetNameTree(PdfKnownNameTree
tree)
const;
104 PdfNameTreeBase& getOrCreateNameTree(PdfKnownNameTree
tree);
106 template <
typename TNameTree>
107 static constexpr PdfKnownNameTree getType()
109 if (std::is_same_v<TNameTree, PdfEmbeddedFiles>)
110 return PdfKnownNameTree::EmbeddedFiles;
111 else if (std::is_same_v<TNameTree, PdfDestinations>)
112 return PdfKnownNameTree::Dests;
114 return PdfKnownNameTree::Unknown;
PdfDocument is the core interface for working with PDF documents.
Definition PdfDocument.h:108
A low level interface with operations to handle document name trees stored in the /Names element.
Definition PdfNameTreeOperations.h:15
Interface to access names trees in the document.
Definition PdfNameTrees.h:18
bool HasKey(PdfKnownNameTree tree, const std::string_view &key) const override
Tests whether a certain nametree has a value.
const PdfObject * GetValue(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.
This class represents a PdfName.
Definition PdfName.h:21
This class represents a PDF indirect Object in memory.
Definition PdfObject.h:31
A string that can be written to a PDF document.
Definition PdfString.h:21
Convenient type for char array storage and/or buffer with std::string compatibility.
Definition basetypes.h:30
All classes, functions, types and enums of PoDoFo are members of these namespace.
Definition basetypes.h:13