7#ifndef PDF_NAME_TREES_H
8#define PDF_NAME_TREES_H
10#include "PdfNameTree.h"
11#include "PdfNameTreeOperations.h"
40 template <
typename TNameTree>
46 template <
typename TNameTree>
52 template <
typename TNameTree>
58 template <
typename TNameTree>
64 template <
typename TNameTree>
72 PdfObject* GetValue(PdfKnownNameTree
tree,
const std::string_view&
key)
override;
73 bool HasKey(PdfKnownNameTree
tree,
const std::string_view&
key)
const override;
79 const PdfObject* GetValue(
const std::string_view&
treeName,
const std::string_view&
key)
const override;
81 bool HasKey(
const std::string_view&
treeName,
const std::string_view&
key)
const override;
105 PdfObject* getValue(
const std::string_view& name,
const std::string_view&
key)
const;
107 PdfNameTreeBase* getNameTree(PdfKnownNameTree
tree)
const;
109 PdfNameTreeBase& mustGetNameTree(PdfKnownNameTree
tree)
const;
111 PdfNameTreeBase& getOrCreateNameTree(PdfKnownNameTree
tree);
113 template <
typename TNameTree>
114 static constexpr PdfKnownNameTree getType()
116 if (std::is_same_v<TNameTree, PdfEmbeddedFiles>)
117 return PdfKnownNameTree::EmbeddedFiles;
118 else if (std::is_same_v<TNameTree, PdfDestinations>)
119 return PdfKnownNameTree::Dests;
121 return PdfKnownNameTree::Unknown;
PdfDocument is the core interface for working with PDF documents.
Definition PdfDocument.h:111
A low level interface with operations to handle document name trees stored in the /Names element.
Definition PdfNameTreeOperations.h:18
Interface to access names trees in the document.
Definition PdfNameTrees.h:22
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:24
This class represents a PDF indirect Object in memory.
Definition PdfObject.h:35
A string that can be written to a PDF document.
Definition PdfString.h:24
Convenient type for char array storage and/or buffer with std::string compatibility.
Definition basetypes.h:38
SPDX-FileCopyrightText: (C) 2022 Francesco Pretto ceztko@gmail.com SPDX-License-Identifier: LGPL-2....
Definition basetypes.h:16