10 #include "PdfReference.h"
12 #include "PdfString.h"
20 class PdfDataContainer;
38 PODOFO_PRIVATE_FRIEND(
class PdfParserObject);
116 std::string_view GetDataTypeString()
const;
124 bool IsNumber()
const;
130 bool IsRealStrict()
const;
134 bool IsNumberOrReal()
const;
138 bool IsString()
const;
146 bool IsArray()
const;
150 bool IsDictionary()
const;
154 bool IsRawData()
const;
162 bool IsReference()
const;
168 std::string ToString(
PdfWriteFlags writeFlags = PdfWriteFlags::None)
const;
169 void ToString(std::string& str,
PdfWriteFlags writeFlags = PdfWriteFlags::None)
const;
174 bool GetBool()
const;
175 bool TryGetBool(
bool& value)
const;
182 int64_t GetNumberLenient()
const;
183 bool TryGetNumberLenient(int64_t& value)
const;
190 int64_t GetNumber()
const;
191 bool TryGetNumber(int64_t& value)
const;
198 double GetReal()
const;
199 bool TryGetReal(
double& value)
const;
206 double GetRealStrict()
const;
207 bool TryGetRealStrict(
double& value)
const;
213 bool TryGetString(
const PdfString*& str)
const;
217 const PdfName& GetName()
const;
218 bool TryGetName(
PdfName& name)
const;
219 bool TryGetName(
const PdfName*& name)
const;
232 bool TryGetArray(
const PdfArray*& arr)
const;
249 void SetBool(
bool value);
257 void SetNumber(int64_t value);
265 void SetReal(
double value);
273 void SetName(
const PdfName& name);
292 const PdfStatefulEncrypt* encrypt,
charbuff& buffer)
const;
322 const PdfArray& GetArrayUnsafe()
const;
329 bool tryGetArray(
PdfArray*& arr)
const;
330 bool tryGetName(
const PdfName*& name)
const;
331 bool tryGetString(
const PdfString*& str)
const;
365 template <
typename T>
369 PrimitiveMember(T value)
374 if (std::is_same_v<T, int64_t>)
376 else if (std::is_same_v<T, double>)
378 else if (std::is_same_v<T, bool>)
380 else if (std::is_same_v<T, PdfDictionary*>)
382 else if (std::is_same_v<T, PdfArray*>)
384 else if (std::is_same_v<T, PdfData*>)
412 PrimitiveMember<int64_t> m_Number;
413 PrimitiveMember<double> m_Real;
414 PrimitiveMember<bool> m_Bool;
415 PrimitiveMember<PdfDictionary*> m_Dictionary;
416 PrimitiveMember<PdfArray*> m_Array;
417 PrimitiveMember<PdfData*> m_Data;
An interface for writing blocks of data to a data source.
Definition: OutputStream.h:18
This class represents a PdfArray Use it for all arrays that are written to a PDF file.
Definition: PdfArray.h:81
A class to inherit for classes that are stored as union members in a PdfVariant.
Definition: PdfBaseDataTypes.h:21
A datatype that allows to write arbitrary data to a PDF file.
Definition: PdfData.h:23
The PDF dictionary data type of PoDoFo (inherits from PdfDataContainer, the base class for such repre...
Definition: PdfDictionary.h:82
This class represents a PdfName.
Definition: PdfName.h:24
This class represents a PDF indirect Object in memory.
Definition: PdfObject.h:35
A reference is a pointer to a object in the PDF file of the form "4 0 R", where 4 is the object numbe...
Definition: PdfReference.h:24
A string that can be written to a PDF document.
Definition: PdfString.h:24
A simple tokenizer for PDF files and PDF content streams.
Definition: PdfTokenizer.h:53
A variant data type which supports all data types supported by the PDF standard.
Definition: PdfVariant.h:33
PdfString m_String
Holds references, strings, names, dictionaries and arrays.
Definition: PdfVariant.h:409
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
PdfDataType
Every PDF datatype that can occur in a PDF file is referenced by an own enum (e.g.
Definition: PdfDeclarations.h:155
@ Dictionary
A dictionary associates keys with values. A key can have another dictionary as value.
@ Array
An array of other PDF data types.
@ Real
Real datatype for floating point numbers.
@ Unknown
The Datatype is unknown. The value is chosen to enable value storage in 8-bit unsigned integer.
@ Number
Number datatype for integer values.
@ Null
The null datatype is always null.
@ Bool
Boolean datatype: Accepts the values "true" and "false".
PdfWriteFlags
Specify additional options for writing the PDF.
Definition: PdfDeclarations.h:137