|
pdfmm 0.9.20
|
#include <PdfInputDevice.h>
Public Member Functions | |
| PdfInputDevice (const std::string_view &filename) | |
| PdfInputDevice (const char *buffer, size_t len) | |
| PdfInputDevice (std::istream &stream) | |
| virtual | ~PdfInputDevice () |
| virtual void | Close () |
| virtual size_t | Tell () |
| int | GetChar () |
| virtual bool | TryGetChar (char &ch) |
| virtual int | Look () |
| void | Seek (std::streamoff off, std::ios_base::seekdir dir=std::ios_base::beg) |
| virtual size_t | Read (char *buffer, size_t size) |
| virtual bool | Eof () const |
| virtual bool | IsSeekable () const |
This class provides an Input device which operates either on a file, a buffer in memory or any arbitrary std::istream
This class is suitable for inheritance to provide input devices of your own for pdfmm. Just override the required virtual methods.
|
explicit |
Construct a new PdfInputDevice that reads all data from a file.
| filename | path to a file that will be opened and all data is read from this file. |
| PdfInputDevice::PdfInputDevice | ( | const char * | buffer, |
| size_t | len | ||
| ) |
Construct a new PdfInputDevice that reads all data from a memory buffer. The buffer will not be owned by this object - it is COPIED.
| buffer | a buffer in memory |
| len | the length of the buffer in memory |
|
explicit |
Construct a new PdfInputDevice that reads all data from a std::istream.
| pInStream | read from this std::istream |
|
virtual |
Destruct the PdfInputDevice object and close any open files.
|
virtual |
Close the input device. No further operations may be performed on this device after calling this function.
|
virtual |
Reimplemented in mm::PdfCanvasInputDevice.
| int PdfInputDevice::GetChar | ( | ) |
Get next char from stream.
|
inlinevirtual |
Reimplemented in mm::PdfCanvasInputDevice.
|
virtual |
Peek at next char in stream. /returns the next char in the stream
Reimplemented in mm::PdfCanvasInputDevice.
|
virtual |
Read a certain number of bytes from the input device.
| buffer | store bytes in this buffer. The buffer has to be large enough. |
| size | number of bytes to read. |
Reimplemented in mm::PdfCanvasInputDevice.
| void PdfInputDevice::Seek | ( | std::streamoff | off, |
| std::ios_base::seekdir | dir = std::ios_base::beg |
||
| ) |
Seek the device to the position offset from the beginning
| off | from the beginning of the file |
| dir | where to start (start, cur, end) |
A non-seekable input device will throw an InvalidDeviceOperation.
|
virtual |
Get the current position in file. /returns the current position in the file
Reimplemented in mm::PdfCanvasInputDevice.
|
virtual |
Get next char from stream.
Reimplemented in mm::PdfCanvasInputDevice.