PoDoFo 1.2.0
Loading...
Searching...
No Matches
PdfNameTreeOperations.h
1// SPDX-FileCopyrightText: 2006 Dominik Seichter <domseichter@web.de>
2// SPDX-FileCopyrightText: 2024 Francesco Pretto <ceztko@gmail.com>
3// SPDX-License-Identifier: LGPL-2.0-or-later OR MPL-2.0
4
5#ifndef PDF_NAME_TREE_OPERATIONS_H
6#define PDF_NAME_TREE_OPERATIONS_H
7
8#include "PdfObject.h"
9
10namespace PoDoFo {
11
14class PODOFO_API PdfNameTreeOperations
15{
16protected:
18
19public:
24 virtual void AddValue(PdfKnownNameTree tree, const PdfString& key, const PdfObject& value) = 0;
25 virtual void AddValue(const PdfName& treeName, const PdfString& key, const PdfObject& value) = 0;
26
34 virtual const PdfObject* GetValue(PdfKnownNameTree tree, const std::string_view& key) const = 0;
35 virtual const PdfObject* GetValue(const std::string_view& treeName, const std::string_view& key) const = 0;
36 virtual PdfObject* GetValue(PdfKnownNameTree tree, const std::string_view& key) = 0;
37 virtual PdfObject* GetValue(const std::string_view& treeName, const std::string_view& key) = 0;
38
47 virtual bool HasKey(PdfKnownNameTree tree, const std::string_view& key) const = 0;
48 virtual bool HasKey(const std::string_view& treeName, const std::string_view& key) const = 0;
49
56 virtual void ToDictionary(PdfKnownNameTree tree, PdfStringMap<PdfObject>& dict, bool skipClear = false) const = 0;
57 virtual void ToDictionary(const std::string_view& treeName, PdfStringMap<PdfObject>& dict, bool skipClear = false) const = 0;
58
59protected:
61 PdfNameTreeOperations& operator=(const PdfNameTreeOperations&) = default;
62};
63
64};
65
66#endif // PDF_NAME_TREE_OPERATIONS_H
A low level interface with operations to handle document name trees stored in the /Names element.
Definition PdfNameTreeOperations.h:15
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.
virtual bool HasKey(PdfKnownNameTree tree, const std::string_view &key) const =0
Tests whether a certain nametree has a value.
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.
virtual const PdfObject * GetValue(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.
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