CartoType C++ API 7.8.2, 2022-03-25
for Windows, Linux, Qt and other platforms supporting C++ development
Public Member Functions | List of all members
CartoType::TMemoryInputStream Class Reference

#include <cartotype_stream.h>

Inheritance diagram for CartoType::TMemoryInputStream:

Public Member Functions

 TMemoryInputStream (const uint8_t *aData, size_t aLength)
 TMemoryInputStream (const std::string &aString)
void Set (const uint8_t *aData, size_t aLength)
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
- 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 ()

Detailed Description

An input stream for a contiguous piece of memory.

Constructor & Destructor Documentation

◆ TMemoryInputStream() [1/2]

CartoType::TMemoryInputStream::TMemoryInputStream ( const uint8_t *  aData,
size_t  aLength 

Creates a memory input stream to read from data of aLength bytes starting at aData.

◆ TMemoryInputStream() [2/2]

CartoType::TMemoryInputStream::TMemoryInputStream ( const std::string &  aString)

Creates a memory input stream to read from a std::string.

Member Function Documentation

◆ EndOfStream()

bool CartoType::TMemoryInputStream::EndOfStream ( ) const

Return whether the end of the stream has been reached.

Implements CartoType::MInputStream.

◆ Length()

int64_t CartoType::TMemoryInputStream::Length ( )

Return the number of bytes in the stream.

Implements CartoType::MInputStream.

◆ Position()

int64_t CartoType::TMemoryInputStream::Position ( )

Return the current position.

Implements CartoType::MInputStream.

◆ Read()

void CartoType::TMemoryInputStream::Read ( const uint8_t *&  aPointer,
size_t &  aLength 

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.

◆ Seek()

void CartoType::TMemoryInputStream::Seek ( int64_t  aPosition)

Seek to the specified position.

Implements CartoType::MInputStream.

◆ Set()

void CartoType::TMemoryInputStream::Set ( const uint8_t *  aData,
size_t  aLength 

Resets this memory input stream to read from data of aLength bytes starting at aData.

The documentation for this class was generated from the following files: