PoDoFo 1.1.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
18class PODOFO_API PdfDataMember
19{
20 friend class PdfString;
21 friend class PdfName;
22 friend class PdfReference;
23public:
25public:
26 inline PdfDataType GetDataType() const { return m_DataType; }
27private:
28 PdfDataType m_DataType;
29};
30
36template <typename T>
38{
39 friend class PdfDataContainer;
40 friend class PdfData;
41 friend class PdfString;
42 friend class PdfName;
43 friend class PdfReference;
44
45private:
46 PdfDataProvider() { }
47
48public:
53 std::string ToString(PdfWriteFlags flags = PdfWriteFlags::None) const
54 {
55 std::string ret;
57 return ret;
58 }
59
60 void ToString(std::string& str, PdfWriteFlags flags = PdfWriteFlags::None) const
61 {
62 str.clear();
65 static_cast<const T&>(*this).Write(device, flags, nullptr, buffer);
66 }
67};
68
69}
70
71#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:20
A class to inherit for classes that are stored as union members in a PdfVariant.
Definition PdfBaseDataTypes.h:19
An helper class to inherit to provide common serialization methods.
Definition PdfBaseDataTypes.h:38
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:53
A datatype that allows to write arbitrary data to a PDF file.
Definition PdfData.h:21
This class represents a PdfName.
Definition PdfName.h:22
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:22
A string that can be written to a PDF document.
Definition PdfString.h:22
Convenient type for char array storage and/or buffer with std::string compatibility.
Definition basetypes.h:35
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:165
PdfWriteFlags
Specify additional options for writing the PDF.
Definition PdfDeclarations.h:147