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 tryGetNextBuffer();
29 bool tryPopNextBuffer();
30 void setEOF();
33 void enableBuffer();
37 size_t getPos() const;
38 void setPos(size_t pos);
39protected:
40 size_t readBuffer(char* buffer, size_t size, bool& eof) override;
41 bool readChar(char& ch) override;
42 bool peek(char& ch) const override;
43private:
44 bool m_eof;
45 std::list<const PdfObject*> m_contents;
46 charbuff m_buffer;
47 bool m_deviceSwitchOccurred;
48};
49
50}
51
52#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