CartoType C++ API 8.8-7-gb35e4dc71
for Windows, Linux, Qt and other platforms supporting C++ development
|
#include <cartotype_stream.h>
Public Member Functions | |
FileInputStream (const std::string &aFileName, size_t aBufferSize=KDefaultBufferSize, size_t aMaxBuffers=KDefaultMaxBuffers) | |
std::unique_ptr< InputStream > | Copy () override |
Public Member Functions inherited from CartoTypeCore::FileInputStreamBase | |
void | StreamRead (const uint8_t *&aPointer, size_t &aLength) override |
bool | StreamEnd () const override |
void | StreamSeek (int64_t aPosition) override |
int64_t | StreamPosition () override |
int64_t | StreamLength () override |
std::string | StreamName () override |
FileInputStreamBase (const FileInputStreamBase &)=delete | |
FileInputStreamBase (FileInputStreamBase &&)=delete | |
void | operator= (const FileInputStreamBase &)=delete |
void | operator= (FileInputStreamBase &&)=delete |
Public Member Functions inherited from CartoTypeCore::InputStream | |
virtual | ~InputStream () |
virtual std::unique_ptr< InputStream > | Copy ()=0 |
virtual int64_t | StreamLength ()=0 |
virtual std::string | StreamName () |
void | Seek (int64_t aPosition) |
int64_t | Position () const |
bool | EndOfData () const |
uint8_t | ReadUint8 () |
uint16_t | ReadUint16 () |
uint16_t | ReadUint16LE () |
uint32_t | ReadUint32 () |
uint32_t | ReadUint32LE () |
uint64_t | ReadUint40 () |
int64_t | ReadFilePos () |
int64_t | ReadFilePosWithDegreeSquare () |
int32_t | FilePosBytes () const |
void | SetFilePosBytes (int32_t aBytes) |
uint32_t | ReadUintOfSize (int32_t aSize) |
uint32_t | ReadUintOfSizeLE (int32_t aSize) |
uint64_t | ReadUint () |
int64_t | ReadInt () |
uint32_t | ReadUintMax32 () |
int32_t | ReadIntMax32 () |
float | ReadFloat () |
float | ReadFloatLE () |
double | ReadDouble () |
double | ReadDoubleLE () |
void | ReadLine (uint8_t *aBuffer, size_t aMaxBytes, size_t &aActualBytes) |
void | ReadBytes (uint8_t *aBuffer, size_t aMaxBytes, size_t &aActualBytes) |
void | Read (const uint8_t *&aPointer, size_t &aLength) |
String | ReadNullTerminatedString () |
String | ReadUtf8StringWithLength () |
std::string | ReadUtf8StringWithLengthToStdString () |
std::string | ReadUtf8StringToStdString () |
String | ReadString (size_t *aBytesRead=nullptr) |
void | SkipUtf8String (size_t *aBytesRead=nullptr) |
void | Skip (int64_t aBytes) |
const uint8_t * | Read (size_t aBytes) |
uint64_t | ReadUint48 () |
uint64_t | ReadUint56 () |
Static Public Member Functions | |
static std::unique_ptr< FileInputStream > | New (Result &aError, const std::string &aFileName, size_t aBufferSize=KDefaultBufferSize, size_t aMaxBuffers=KDefaultMaxBuffers) |
Static Public Attributes | |
static constexpr size_t | KDefaultBufferSize = 64 * 1024 |
static constexpr size_t | KDefaultMaxBuffers = 32 |
Static Public Attributes inherited from CartoTypeCore::FileInputStreamBase | |
static constexpr size_t | KDefaultBufferSize = 64 * 1024 |
static constexpr size_t | KDefaultMaxBuffers = 32 |
Protected Member Functions | |
void | ReadBuffer (CBuffer &aBuffer, int64_t aPos) override |
Protected Member Functions inherited from CartoTypeCore::FileInputStreamBase | |
void | Construct (size_t aBufferSize, size_t aMaxBuffers) |
virtual void | ReadBuffer (CBuffer &aBuffer, int64_t aPos)=0 |
Protected Attributes | |
BinaryInputFile | iFile |
int64_t | iPositionInFile = 0 |
Protected Attributes inherited from CartoTypeCore::FileInputStreamBase | |
CBufferList | iBuffers |
size_t | iBufferSize = KDefaultBufferSize |
int64_t | iLogicalPosition = 0 |
int64_t | iLength = 0 |
std::string | iName |
Additional Inherited Members | |
Protected Types inherited from CartoTypeCore::FileInputStreamBase | |
using | CBufferList = std::list< CBuffer > |
An input stream for reading from files.
CartoTypeCore::FileInputStream::FileInputStream | ( | const std::string & | aFileName, |
size_t | aBufferSize = KDefaultBufferSize , |
||
size_t | aMaxBuffers = KDefaultMaxBuffers |
||
) |
Creates a InputStream to read from the file aFileName. Throws an exception if the file cannot be opened.
|
overridevirtual |
Returns a copy of this InputStream.
Implements CartoTypeCore::InputStream.
|
static |
Creates a InputStream to read from the file aFileName. Returns the result in aError.
|
overrideprotectedvirtual |
Override this function to read a buffer at a certain position in the file.
Implements CartoTypeCore::FileInputStreamBase.
|
protected |
The file.
|
protected |
The physical position in the file.
|
staticconstexpr |
The default size of each buffer in bytes.
|
staticconstexpr |
The default maximum number of buffers.