PoDoFo  1.0.0-dev
PdfMemoryObjectStream.h
1 
7 #ifndef PDF_MEMORY_OBJECT_STREAM_H
8 #define PDF_MEMORY_OBJECT_STREAM_H
9 
10 #include "PdfDeclarations.h"
11 
12 #include "PdfObjectStreamProvider.h"
13 
14 namespace PoDoFo {
15 
26 class PODOFO_API PdfMemoryObjectStream final : public PdfObjectStreamProvider
27 {
28  friend class PdfObject;
29  friend class PdfIndirectObjectList;
30  PODOFO_PRIVATE_FRIEND(class PdfImmediateWriter);
31 
32 private:
34 
35 public:
36  void Init(PdfObject& obj) override;
37 
38  void Clear() override;
39 
40  bool TryCopyFrom(const PdfObjectStreamProvider& rhs) override;
41 
42  bool TryMoveFrom(PdfObjectStreamProvider&& rhs) override;
43 
44  std::unique_ptr<InputStream> GetInputStream(PdfObject& obj) override;
45 
46  std::unique_ptr<OutputStream> GetOutputStream(PdfObject& obj) override;
47 
48  void Write(OutputStream& stream, const PdfStatefulEncrypt* encrypt) override;
49 
50  size_t GetLength() const override;
51 
52  const charbuff& GetBuffer() const { return m_buffer; }
53 
54  private:
55  charbuff m_buffer;
56 };
57 
58 };
59 
60 #endif // PDF_MEMORY_OBJECT_STREAM_H
SPDX-FileCopyrightText: (C) 2005 Dominik Seichter domseichter@web.de SPDX-FileCopyrightText: (C) 2020...
An interface for writing blocks of data to a data source.
Definition: OutputStream.h:18
A list of PdfObjects that constitutes the indirect object list of the document The PdfParser will rea...
Definition: PdfIndirectObjectList.h:30
A PDF stream can be appended to any PdfObject and can contain arbitrary data.
Definition: PdfMemoryObjectStream.h:27
This class represents a PDF indirect Object in memory.
Definition: PdfObject.h:35
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