PoDoFo  1.0.0-dev
PdfNameTreeOperations.h
1 
7 #ifndef PDF_NAME_TREE_OPERATIONS_H
8 #define PDF_NAME_TREE_OPERATIONS_H
9 
10 #include "PdfObject.h"
11 
12 namespace PoDoFo {
13 
17 class PODOFO_API PdfNameTreeOperations
18 {
19 protected:
21 
22 public:
28  virtual void AddValue(PdfKnownNameTree tree, const PdfString& key, const PdfObject& value) = 0;
29  virtual void AddValue(const PdfName& treeName, const PdfString& key, const PdfObject& value) = 0;
30 
39  virtual const PdfObject* GetValue(PdfKnownNameTree tree, const std::string_view& key) const = 0;
40  virtual const PdfObject* GetValue(const std::string_view& treeName, const std::string_view& key) const = 0;
41  virtual PdfObject* GetValue(PdfKnownNameTree tree, const std::string_view& key) = 0;
42  virtual PdfObject* GetValue(const std::string_view& treeName, const std::string_view& key) = 0;
43 
53  virtual bool HasKey(PdfKnownNameTree tree, const std::string_view& key) const = 0;
54  virtual bool HasKey(const std::string_view& treeName, const std::string_view& key) const = 0;
55 
64  virtual void ToDictionary(PdfKnownNameTree tree, PdfStringMap<PdfObject>& dict, bool skipClear = false) const = 0;
65  virtual void ToDictionary(const std::string_view& treeName, PdfStringMap<PdfObject>& dict, bool skipClear = false) const = 0;
66 
67 protected:
69  PdfNameTreeOperations& operator=(const PdfNameTreeOperations&) = default;
70 };
71 
72 };
73 
74 #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:18
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: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
SPDX-FileCopyrightText: (C) 2022 Francesco Pretto ceztko@gmail.com SPDX-License-Identifier: LGPL-2....
Definition: basetypes.h:16