PoDoFo 1.2.0
Loading...
Searching...
No Matches
PdfCanvasInputDevice.h
1// SPDX-FileCopyrightText: 2022 Francesco Pretto <ceztko@gmail.com>
2// SPDX-License-Identifier: LGPL-2.0-or-later OR MPL-2.0
3
4#ifndef PDF_CANVAS_INPUT_DEVICE_H
5#define PDF_CANVAS_INPUT_DEVICE_H
6
7#include <podofo/auxiliary/InputDevice.h>
8
9#include <list>
10
11namespace PoDoFo {
12
13class PdfCanvas;
14class PdfObject;
15
22{
23public:
25public:
26 size_t GetLength() const override;
27 size_t GetPosition() const override;
28 bool Eof() const override { return m_eof; }
29private:
30 bool tryGetNextDevice(InputStreamDevice*& device);
31 bool tryPopNextDevice();
32 void setEOF();
33protected:
34 size_t readBuffer(char* buffer, size_t size, bool& eof) override;
35 bool readChar(char& ch) override;
36 bool peek(char& ch) const override;
37private:
38 bool m_eof;
39 std::list<const PdfObject*> m_contents;
40 charbuff m_buffer;
41 std::unique_ptr<InputStreamDevice> m_currDevice;
42 bool m_deviceSwitchOccurred;
43};
44
45}
46
47#endif // PDF_CANVAS_INPUT_DEVICE_H
This class represents an input device It optionally supports peeking.
Definition InputDevice.h:20
There are Pdfs spanning delimiters or begin/end tags into contents streams.
Definition PdfCanvasInputDevice.h:22
An interface that provides the necessary features for a painter to draw onto a PdfObject.
Definition PdfCanvas.h:26
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