PoDoFo 1.2.0
Loading...
Searching...
No Matches
PdfBaseDataTypes.h
1// SPDX-FileCopyrightText: 2006 Dominik Seichter <domseichter@web.de>
2// SPDX-FileCopyrightText: 2020 Francesco Pretto <ceztko@gmail.com>
3// SPDX-License-Identifier: LGPL-2.0-or-later OR MPL-2.0
4
5#ifndef PDF_BASE_DATA_TYPES_H
6#define PDF_BASE_DATA_TYPES_H
7
8#include "PdfDeclarations.h"
9#include <podofo/auxiliary/StreamDevice.h>
10
11namespace PoDoFo {
12
13class OutputStream;
14class PdfStatefulEncrypt;
15
17class PODOFO_API PdfDataMember
18{
19 friend class PdfString;
20 friend class PdfName;
21 friend class PdfReference;
22public:
24public:
25 inline PdfDataType GetDataType() const { return m_DataType; }
26private:
27 PdfDataType m_DataType;
28};
29
34template <typename T>
36{
37 friend class PdfDataContainer;
38 friend class PdfData;
39 friend class PdfString;
40 friend class PdfName;
41 friend class PdfReference;
42
43private:
44 PdfDataProvider() { }
45
46public:
50 std::string ToString(PdfWriteFlags flags = PdfWriteFlags::None) const
51 {
52 std::string ret;
54 return ret;
55 }
56
57 void ToString(std::string& str, PdfWriteFlags flags = PdfWriteFlags::None) const
58 {
59 str.clear();
62 static_cast<const T&>(*this).Write(device, flags, nullptr, buffer);
63 }
64};
65
66}
67
68#endif // PDF_BASE_DATA_TYPES_H
This file should be included as the FIRST file in every header of PoDoFo lib.
A PdfDataProvider object with a PdfObject owner, specialized in holding objects.
Definition PdfDataContainer.h:18
A class to inherit for classes that are stored as union members in a PdfVariant.
Definition PdfBaseDataTypes.h:18
An helper class to inherit to provide common serialization methods.
Definition PdfBaseDataTypes.h:36
std::string ToString(PdfWriteFlags flags=PdfWriteFlags::None) const
Converts the current object into a string representation which can be written directly to a PDF file ...
Definition PdfBaseDataTypes.h:50
A datatype that allows to write arbitrary data to a PDF file.
Definition PdfData.h:20
This class represents a PdfName.
Definition PdfName.h:21
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:20
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
PdfDataType
Every PDF datatype that can occur in a PDF file is referenced by an own enum (e.g.
Definition PdfDeclarations.h:152
PdfWriteFlags
Specify additional options for writing the PDF.
Definition PdfDeclarations.h:136