100 void Write(int32_t valueA, int32_t valueB);
132 void Write(
char* srcBuffer,
size_t length);
@ Native
Platform is little-endian; Native resolves to Little.
Sequential binary writer with configurable byte-order support.
Definition BinaryWriter.h:30
void Write(uint64_t value)
Writes an unsigned 64-bit integer, applying the configured byte order.
uint64_t GetLength()
Returns the total number of bytes written to the stream.
void Write(const std::string &str)
Writes a length-prefixed UTF-8 string.
void Seek(int32_t offset, SeekOffsetType seekType)
Moves the stream write position.
void Write(float value)
Writes a 32-bit IEEE 754 float, applying the configured byte order.
void Close()
Closes the underlying stream and flushes any buffered data.
std::shared_ptr< Stream > GetStream()
Returns the underlying stream (e.g. to pass to a BinaryReader after writing).
void Write(int8_t value)
Writes a signed 8-bit integer.
BinaryWriter(std::shared_ptr< Stream > nStream)
Constructs a BinaryWriter over a shared Stream.
std::vector< char > ToVector()
Returns the entire stream contents as a vector of chars.
void SetEndianness(Endianness endianness)
Sets the byte order used for all subsequent multi-byte writes.
void Write(uint16_t value)
Writes an unsigned 16-bit integer, applying the configured byte order.
void Write(uint8_t value)
Writes an unsigned 8-bit integer.
std::shared_ptr< Stream > mStream
Underlying byte stream.
Definition BinaryWriter.h:140
void Write(int32_t valueA, int32_t valueB)
Writes two signed 32-bit integers sequentially, applying the configured byte order.
void Write(char *srcBuffer, size_t length)
Writes length raw bytes from srcBuffer.
Endianness mEndianness
Active byte order for multi-byte writes.
Definition BinaryWriter.h:141
void Write(int16_t value)
Writes a signed 16-bit integer, applying the configured byte order.
void Write(int64_t value)
Writes a signed 64-bit integer, applying the configured byte order.
void Write(double value)
Writes a 64-bit IEEE 754 double, applying the configured byte order.
BinaryWriter()
Constructs a BinaryWriter backed by a new, empty, growable MemoryStream.
void Write(int32_t value)
Writes a signed 32-bit integer, applying the configured byte order.
void Write(uint32_t value)
Writes an unsigned 32-bit integer, applying the configured byte order.
BinaryWriter(Stream *nStream)
Constructs a BinaryWriter over a raw (non-owning) Stream pointer.
uint64_t GetBaseAddress()
Returns the current absolute write position.
Abstract base class for sequential byte streams (read/write).
Definition Stream.h:26
Core namespace for the libultraship engine framework.
Definition gfx_direct3d_common.h:14
SeekOffsetType
Identifies the reference point for a seek operation.
Definition Stream.h:10