PDF SDK Documentation

Comprehensive Guide for Developers: Features, Integration, and API Reference

Loading...
Searching...
No Matches
object.h
1// Copyright (c) 2009-2025 Avanquest Software. All rights reserved.
2
3#ifndef PDFSDK_CXX_PDF_OBJECT_H_INCLUDED_
4#define PDFSDK_CXX_PDF_OBJECT_H_INCLUDED_
5
6#include <cassert>
7#include <string>
8
10
11#include "forward_declarations.h"
12
13namespace PDF {
14
20class Object {
21public:
22 ~Object();
23
29 Object() noexcept;
30
36 Object(PDObject obj, bool adopt = false) noexcept;
37
42 Object(const Object& that) noexcept;
43
48 Object(Object&& that) noexcept;
49
55 Object& operator=(const Object& rhs) noexcept;
56
62 Object& operator=(Object&& rhs) noexcept;
63
69 void reset(PDObject obj, bool adopt = false) noexcept;
70
75 PDObject* operator&() noexcept;
76
81 PDObject get() const noexcept;
82
87 PDObject detach() noexcept;
88
93 explicit operator bool() const noexcept;
94
100 bool operator==(const Object& rhs) const noexcept;
101
107 bool operator!=(const Object& rhs) const noexcept;
108
109public:
115
120 bool IsIndirect() const;
121
126 uint32_t GetObjNumber() const;
127
132 uint16_t GetGenNumber() const;
133
138 bool GetBoolValue() const;
139
144 int64_t GetIntValue() const;
145
150 float GetRealValue() const;
151
156 std::wstring GetUnicodeString() const;
157
162 std::string GetStringValue() const;
163
168 PDAtom GetNameValue() const;
169
174 void ArrayAdd(const Object& object);
175
181 Object ArrayGet(size_t index) const;
182
187 void ArrayRemove(size_t index);
188
194
200 void DictPut(PDAtom name, const Object& object);
201
207 void DictPutName(PDAtom name, PDAtom value);
208
214 Object DictFind(PDAtom name) const;
215
221 PDAtom DictFindName(PDAtom name) const;
222
227 void DictRemove(PDAtom name);
228
236 template<class Func>
237 void DictEnum(Func&& func) const;
238
244
250 ReadStream StreamOpen(PDObjectStreamOpenMode openMode = kPDObjectStreamOpenFiltered);
251
257 bool DeepEquals(const Object& that);
258
259private:
260 void Acquire() noexcept;
261 void Release() noexcept;
262
263protected:
264 PDObject m_obj;
265};
266
267} // namespace PDF
268
269#include "object_impl.inl"
270
271#endif // PDFSDK_CXX_PDF_OBJECT_H_INCLUDED_
Represents a PDF object.
Definition object.h:20
ReadStream StreamOpen(PDObjectStreamOpenMode openMode=kPDObjectStreamOpenFiltered)
void DictRemove(PDAtom name)
PDObjectType GetObjectType() const
size_t GetArrayLength()
Object GetStreamDict() const
void DictPutName(PDAtom name, PDAtom value)
bool IsIndirect() const
void ArrayAdd(const Object &object)
float GetRealValue() const
Object ArrayGet(size_t index) const
uint32_t GetObjNumber() const
Object() noexcept
Object DictFind(PDAtom name) const
std::wstring GetUnicodeString() const
bool DeepEquals(const Object &that)
PDAtom DictFindName(PDAtom name) const
void ArrayRemove(size_t index)
int64_t GetIntValue() const
bool GetBoolValue() const
uint16_t GetGenNumber() const
void DictEnum(Func &&func) const
void reset(PDObject obj, bool adopt=false) noexcept
PDObject get() const noexcept
std::string GetStringValue() const
PDAtom GetNameValue() const
PDObject detach() noexcept
void DictPut(PDAtom name, const Object &object)
Represents a read stream for reading data.
Definition read_stream.h:15
Objects API.
PDObjectType
Definition objects.h:22
Definition objects.h:80