CartoType C++ API 8.8-7-gb35e4dc71
for Windows, Linux, Qt and other platforms supporting C++ development
|
#include <cartotype_stream.h>
Public Member Functions | |
virtual | ~OutputStream () |
virtual void | Write (const uint8_t *aBuffer, size_t aBytes)=0 |
void | WriteString (const char *aString) |
void | WriteString (const std::string &aString) |
void | WriteString (const MString &aString) |
void | WriteXmlText (const MString &aString) |
void | WriteUint8 (uint8_t aValue) |
void | WriteUint16 (uint16_t aValue) |
void | WriteUint16LE (uint16_t aValue) |
void | WriteUint32 (uint32_t aValue) |
void | WriteUint32LE (uint32_t aValue) |
void | WriteUint (uint32_t aValue, int32_t aSize) |
void | WriteUintLE (uint32_t aValue, int32_t aSize) |
void | WriteUint (uint64_t aValue) |
void | WriteInt (int64_t aValue) |
void | WriteFloat (float aValue) |
void | WriteFloatLE (float aValue) |
void | WriteDouble (double aValue) |
void | WriteDoubleLE (double aValue) |
void | WriteUtf8StringWithLength (const MString &aString) |
void | WriteUtf8StringWithLength (const std::string &aString) |
void | WriteNullTerminatedString (const MString &aString) |
The output stream base class. The byte order for integers, floats and doubles is big-endian unless functions suffixed LE are used. Implementations must define a single function, Write.
|
inlinevirtual |
Virtual destructor.
|
pure virtual |
Writes aBytes bytes from aBuffer to the stream.
Implemented in CartoTypeCore::OpenFileOutputStream, and CartoTypeCore::MemoryOutputStream.
void CartoTypeCore::OutputStream::WriteDouble | ( | double | aValue | ) |
Writes a double-precision float as a big-endian 64-bit value.
void CartoTypeCore::OutputStream::WriteDoubleLE | ( | double | aValue | ) |
Writes a double-precision float as a little-endian 64-bit value.
void CartoTypeCore::OutputStream::WriteFloat | ( | float | aValue | ) |
Writes a single-precision float as a big-endian 32-bit value.
void CartoTypeCore::OutputStream::WriteFloatLE | ( | float | aValue | ) |
Writes a single-precision float as a little-endian 32-bit value.
void CartoTypeCore::OutputStream::WriteInt | ( | int64_t | aValue | ) |
Writes a signed integer of a size determined by the value.
void CartoTypeCore::OutputStream::WriteNullTerminatedString | ( | const MString & | aString | ) |
Writes a null terminated string in UTF-8.
|
inline |
Writes a null-terminated string to the stream. Does not write the final null.
void CartoTypeCore::OutputStream::WriteString | ( | const MString & | aString | ) |
Writes a string to the stream, converting aString from UTF-16 to UTF-8 then writing the resulting bytes.
|
inline |
Writes a std::string to the stream.
void CartoTypeCore::OutputStream::WriteUint | ( | uint32_t | aValue, |
int32_t | aSize | ||
) |
Writes an integer of size aSize, big-endian. aSize must be 1, 2 or 4.
void CartoTypeCore::OutputStream::WriteUint | ( | uint64_t | aValue | ) |
Writes an unsigned integer of a size determined by the value.
void CartoTypeCore::OutputStream::WriteUint16 | ( | uint16_t | aValue | ) |
Writes a 2 byte integer, big-endian.
void CartoTypeCore::OutputStream::WriteUint16LE | ( | uint16_t | aValue | ) |
Writes a 2 byte integer, little-endian.
void CartoTypeCore::OutputStream::WriteUint32 | ( | uint32_t | aValue | ) |
Writes a 4 byte integer, big-endian.
void CartoTypeCore::OutputStream::WriteUint32LE | ( | uint32_t | aValue | ) |
Write a 4 byte integer, little-endian.
void CartoTypeCore::OutputStream::WriteUint8 | ( | uint8_t | aValue | ) |
Writes a single byte integer.
void CartoTypeCore::OutputStream::WriteUintLE | ( | uint32_t | aValue, |
int32_t | aSize | ||
) |
Writes an integer of size aSize, little-endian. aSize must be 1, 2 or 4.
void CartoTypeCore::OutputStream::WriteUtf8StringWithLength | ( | const MString & | aString | ) |
Write a UTF-8 string preceded by its length as a variable-length unsigned integer.
void CartoTypeCore::OutputStream::WriteUtf8StringWithLength | ( | const std::string & | aString | ) |
Write a UTF-8 string preceded by its length as a variable-length unsigned integer.
void CartoTypeCore::OutputStream::WriteXmlText | ( | const MString & | aString | ) |
Writes a string, converting single and double quotes, less than and greater than, and ampersand, into XML entity references.