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
20{
21public:
23public:
24 size_t GetLength() const override;
25 size_t GetPosition() const override;
26 bool Eof() const override { return m_eof; }
27private:
28 bool tryGetNextDevice(InputStreamDevice*& device);
29 bool tryPopNextDevice();
30 void setEOF();
31protected:
32 size_t readBuffer(char* buffer, size_t size, bool& eof) override;
33 bool readChar(char& ch) override;
34 bool peek(char& ch) const override;
35private:
36 bool m_eof;
37 std::list<const PdfObject*> m_contents;
38 charbuff m_buffer;
39 std::unique_ptr<InputStreamDevice> m_currDevice;
40 bool m_deviceSwitchOccurred;
41};
42
43}
44
45#endif // PDF_CANVAS_INPUT_DEVICE_H
This class represents an input device It optionally supports peeking.
Definition InputDevice.h:19
There are Pdfs spanning delimiters or begin/end tags into contents streams.
Definition PdfCanvasInputDevice.h:20
An interface that provides the necessary features for a painter to draw onto a PdfObject.
Definition PdfCanvas.h:25
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