PoDoFo 1.2.0
Loading...
Searching...
No Matches
PdfResourceOperations.h
1// SPDX-FileCopyrightText: 2007 Dominik Seichter <domseichter@web.de>
2// SPDX-FileCopyrightText: 2021 Francesco Pretto <ceztko@gmail.com>
3// SPDX-License-Identifier: LGPL-2.0-or-later OR MPL-2.0
4
5#ifndef PDF_RESOURCE_OPERATIONS_H
6#define PDF_RESOURCE_OPERATIONS_H
7
8#include "PdfDictionary.h"
9
10namespace PoDoFo {
11
14class PODOFO_API PdfResourceOperations
15{
16protected:
18
19public:
21 virtual PdfName AddResource(PdfResourceType type, const PdfObject& obj) = 0;
22
24 virtual void AddResource(PdfResourceType type, const PdfName& key, const PdfObject& obj) = 0;
25
27 virtual PdfObject* GetResource(PdfResourceType type, const std::string_view& key) = 0;
28
30 virtual const PdfObject* GetResource(PdfResourceType type, const std::string_view& key) const = 0;
31
34
37
40 virtual void RemoveResource(PdfResourceType type, const std::string_view& key) = 0;
41
44 virtual void RemoveResources(PdfResourceType type) = 0;
45
46 // Generic functions to access resources by arbitrary type
47 // name. They shouldn't be generally needed, they are provided
48 // for custom use
49
51 virtual PdfName AddResource(const PdfName& type, const PdfObject& obj) = 0;
52
54 virtual void AddResource(const PdfName& type, const PdfName& key, const PdfObject& obj) = 0;
55
57 virtual PdfObject* GetResource(const std::string_view& type, const std::string_view& key) = 0;
58
60 virtual const PdfObject* GetResource(const std::string_view& type, const std::string_view& key) const = 0;
61
63 virtual PdfDictionaryIndirectIterable GetResourceIterator(const std::string_view& type) = 0;
64
66 virtual PdfDictionaryConstIndirectIterable GetResourceIterator(const std::string_view& type) const = 0;
67
69 virtual PdfDictionary* GetResourceDictionary(PdfResourceType type) = 0;
70 virtual const PdfDictionary* GetResourceDictionary(PdfResourceType type) const = 0;
71 virtual PdfDictionary* GetResourceDictionary(const std::string_view& type) = 0;
72 virtual const PdfDictionary* GetResourceDictionary(const std::string_view& type) const = 0;
73
76 virtual void RemoveResource(const std::string_view& type, const std::string_view& key) = 0;
77
80 virtual void RemoveResources(const std::string_view& type) = 0;
81
82protected:
84 PdfResourceOperations& operator=(const PdfResourceOperations&) = default;
85};
86
87};
88
89#endif // PDF_RESOURCE_OPERATIONS_H
The PDF dictionary data type of PoDoFo (inherits from PdfDataContainer, the base class for such repre...
Definition PdfDictionary.h:77
This class represents a PdfName.
Definition PdfName.h:21
This class represents a PDF indirect Object in memory.
Definition PdfObject.h:31
Low level interface for resource handling operations Inherited by PdfResources.
Definition PdfResourceOperations.h:15
virtual PdfDictionary * GetResourceDictionary(PdfResourceType type)=0
Get resource dictionary.
virtual const PdfObject * GetResource(PdfResourceType type, const std::string_view &key) const =0
Get resource by type and key.
virtual PdfDictionaryConstIndirectIterable GetResourceIterator(const std::string_view &type) const =0
Get resource iterator by type name string.
virtual void RemoveResource(const std::string_view &type, const std::string_view &key)=0
Remove resource by type name string and key.
virtual void AddResource(const PdfName &type, const PdfName &key, const PdfObject &obj)=0
Add resource by type name string and key.
virtual void AddResource(PdfResourceType type, const PdfName &key, const PdfObject &obj)=0
Add resource by type and key.
virtual PdfObject * GetResource(const std::string_view &type, const std::string_view &key)=0
Get resource by type name string and key.
virtual void RemoveResources(const std::string_view &type)=0
Remove resources by type name string.
virtual PdfName AddResource(PdfResourceType type, const PdfObject &obj)=0
Add resource by type generating a new unique identifier.
virtual void RemoveResource(PdfResourceType type, const std::string_view &key)=0
Remove resource by type and key.
virtual PdfObject * GetResource(PdfResourceType type, const std::string_view &key)=0
Get resource by type and key.
virtual PdfDictionaryIndirectIterable GetResourceIterator(const std::string_view &type)=0
Get resource iterator by type name string.
virtual PdfName AddResource(const PdfName &type, const PdfObject &obj)=0
Add resource by type name string generating a new unique identifier.
virtual PdfDictionaryIndirectIterable GetResourceIterator(PdfResourceType type)=0
Get resource iterator by type.
virtual void RemoveResources(PdfResourceType type)=0
Remove resources by type.
virtual PdfDictionaryConstIndirectIterable GetResourceIterator(PdfResourceType type) const =0
Get resource iterator by type.
virtual const PdfObject * GetResource(const std::string_view &type, const std::string_view &key) const =0
Get resource by type name string and key.
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