CartoType C++ API 7.8.2, 2022-03-25
for Windows, Linux, Qt and other platforms supporting C++ development
|
#include <cartotype_stream.h>
Public Member Functions | |
CSimpleFileInputStream (const std::string &aFileName, size_t aBufferSize=64 *1024) | |
void | Read (const uint8_t *&aPointer, size_t &aLength) override |
bool | EndOfStream () const override |
void | Seek (int64_t aPosition) override |
int64_t | Position () override |
int64_t | Length () override |
std::string | Name () override |
Public Member Functions inherited from CartoType::MInputStream | |
virtual | ~MInputStream () |
virtual void | Read (const uint8_t *&aPointer, size_t &aLength)=0 |
virtual bool | EndOfStream () const =0 |
virtual void | Seek (int64_t aPosition)=0 |
virtual int64_t | Position ()=0 |
virtual int64_t | Length ()=0 |
virtual std::string | Name () |
Static Public Member Functions | |
static std::unique_ptr< CSimpleFileInputStream > | New (TResult &aError, const std::string &aFileName, size_t aBufferSize=64 *1024) |
A simple file input stream that does not use seek when reading sequentially. If the first part of the filename, before any extensions, is '-', it reads from standard input.
CartoType::CSimpleFileInputStream::CSimpleFileInputStream | ( | const std::string & | aFilename, |
size_t | aBufferSize = 64 * 1024 |
||
) |
Creates a CSimpleFileInputStream to read from the file aFileName. Throws an exception if the file cannot be opened.
Creates a stream to read from the file aFilename, optionally supplying a buffer size in bytes.
|
overridevirtual |
Return whether the end of the stream has been reached.
Implements CartoType::MInputStream.
|
overridevirtual |
Return the number of bytes in the stream.
Implements CartoType::MInputStream.
|
inlineoverridevirtual |
Return the file name or URI associated with the stream if any. Return the empty string is there is no file name or URI.
Reimplemented from CartoType::MInputStream.
|
static |
Creates a CSimpleFileInputStream to read from the file aFileName. Returns the result in aError.
|
overridevirtual |
Return the current position.
Implements CartoType::MInputStream.
|
overridevirtual |
Read some data into a buffer owned by the MInputStream object and return a pointer to it in aPointer. Return the number of bytes of data in aLength. This function will return at least one byte if there are bytes remaining in the stream. The pointer is valid until the next call to Read.
Implements CartoType::MInputStream.
|
overridevirtual |
Seek to the specified position.
Implements CartoType::MInputStream.