PoDoFo 1.2.0
Loading...
Searching...
No Matches
PdfData.h
1// SPDX-FileCopyrightText: 2007 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_DATA_H
6#define PDF_DATA_H
7
8#include "PdfDeclarations.h"
9
10#include "PdfBaseDataTypes.h"
11
12namespace PoDoFo {
13
19class PODOFO_API PdfData final : public PdfDataProvider<PdfData>
20{
21public:
22 PdfData();
23 PdfData(const PdfData&) = default;
24 PdfData(PdfData&&) noexcept = default;
25
34 PdfData(charbuff&& data, std::shared_ptr<size_t> writeBeacon = { });
35
44 PdfData(const bufferview& data, std::shared_ptr<size_t> writeBeacon = { });
45
47 const PdfStatefulEncrypt* encrypt, charbuff& buffer) const;
48
49 PdfData& operator=(const PdfData& rhs) = default;
50 PdfData& operator=(PdfData&& rhs) = default;
51 PdfData& operator=(const bufferview& data);
52
55 inline const charbuff& GetBuffer() const { return m_data; }
56
57private:
58 charbuff m_data;
59 std::shared_ptr<size_t> m_writeBeacon;
60};
61
62}
63
64#endif // PDF_DATA_H
65
This file should be included as the FIRST file in every header of PoDoFo lib.
An interface for writing blocks of data to a data source.
Definition OutputStream.h:15
An helper class to inherit to provide common serialization methods.
Definition PdfBaseDataTypes.h:36
A datatype that allows to write arbitrary data to a PDF file.
Definition PdfData.h:20
PdfData(charbuff &&data, std::shared_ptr< size_t > writeBeacon={ })
Create a new PdfData object with valid PdfData.
PdfData(const bufferview &data, std::shared_ptr< size_t > writeBeacon={ })
Create a new PdfData object with valid PdfData.
const charbuff & GetBuffer() const
Access the data as a std::string.
Definition PdfData.h:55
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
PdfWriteFlags
Specify additional options for writing the PDF.
Definition PdfDeclarations.h:136
cspan< char > bufferview
Convenient read-only char buffer span.
Definition basetypes.h:15