|
CoreComponents 3.0.0
A Modern C++ Toolkit
|
Byte encoding sink. More...
#include <cc/ByteSink>
Public Member Functions | |
| ByteSink (const Stream &sink, const Bytes &buffer, ByteOrder endian=ByteOrder::LittleEndian) | |
| Open a new ByteSink. | |
| ByteSink (const Stream &sink, ByteOrder endian=ByteOrder::LittleEndian) | |
| Open a new ByteSink. | |
| ByteSink (const Bytes &buffer, ByteOrder endian=ByteOrder::LittleEndian) | |
| Open a new ByteSink. | |
| void | write (char ch) |
| Write character ch. | |
| void | write (const char *s) |
| Write all characters of s. | |
| void | write (const Bytes &s) |
| Write string s. | |
| void | writeUInt8 (uint8_t x) |
| Write byte x. | |
| void | writeUInt16 (uint16_t x) |
| Write 2-byte word x. | |
| void | writeUInt32 (uint32_t x) |
| Write 4-byte word x. | |
| void | writeUInt64 (uint64_t x) |
| Write 8-byte word x. | |
| void | writeInt8 (int8_t x) |
| Write signed byte x. | |
| void | writeInt16 (int16_t x) |
| Write signed 2-byte word x. | |
| void | writeInt32 (int32_t x) |
| Write signed 4-byte word x. | |
| void | writeInt64 (int64_t x) |
| Write signed 8-byte word x. | |
| void | flush () |
| Flush the output buffer and write cached bytes to the output sink. | |
| Stream | sink () const |
| The output sink. | |
| const Bytes & | buffer () const |
| The output buffer. | |
| ByteOrder | endian () const |
| Byte-order for encoding multi-byte words. | |
| void | setEndian (ByteOrder endian) |
| Set byte-order | |
| long long | currentOffset () const |
| Total number of bytes written. | |
Byte encoding sink.
| OutputExhaustion |
| ByteSink | ( | const Stream & | sink, |
| const Bytes & | buffer, | ||
| ByteOrder | endian = ByteOrder::LittleEndian ) |
Open a new ByteSink.
| sink | Datra sink to write bytes to |
| buffer | Output buffer |
| endian | Endianess for writing multi-byte words |
| ByteSink | ( | const Stream & | sink, |
| ByteOrder | endian = ByteOrder::LittleEndian ) |
Open a new ByteSink.
| sink | Sink to write bytes to |
| endian | Endianess for writing multi-byte words |
| ByteSink | ( | const Bytes & | buffer, |
| ByteOrder | endian = ByteOrder::LittleEndian ) |
Open a new ByteSink.
| buffer | Output buffer |
| endian | Endianess for writing multi-byte words |
| void write | ( | char | ch | ) |
Write character ch.
| void write | ( | const char * | s | ) |
Write all characters of s.
| void write | ( | const Bytes & | s | ) |
Write string s.
| void writeUInt8 | ( | uint8_t | x | ) |
Write byte x.
| void writeUInt16 | ( | uint16_t | x | ) |
Write 2-byte word x.
| void writeUInt32 | ( | uint32_t | x | ) |
Write 4-byte word x.
| void writeUInt64 | ( | uint64_t | x | ) |
Write 8-byte word x.
| void writeInt8 | ( | int8_t | x | ) |
Write signed byte x.
| void writeInt16 | ( | int16_t | x | ) |
Write signed 2-byte word x.
| void writeInt32 | ( | int32_t | x | ) |
Write signed 4-byte word x.
| void writeInt64 | ( | int64_t | x | ) |
Write signed 8-byte word x.
| void flush | ( | ) |
Flush the output buffer and write cached bytes to the output sink.
| Stream sink | ( | ) | const |
The output sink.
| const Bytes & buffer | ( | ) | const |
The output buffer.
| ByteOrder endian | ( | ) | const |
Byte-order for encoding multi-byte words.
| void setEndian | ( | ByteOrder | endian | ) |
Set byte-order
| long long currentOffset | ( | ) | const |
Total number of bytes written.