|
| | BufferStream (size_t size) |
| | Creates a new instance of BufferStream.
|
| void | Read (DataField *field) const override |
| | Reads data from the stream into the specified field.
|
| void | Read (DataStructure *structure) const override |
| | Reads data from stream into the specified data structure.
|
| std::shared_ptr< ChunkHeader > | FindNextChunk (std::string id) const override |
| | Finds the next chunk header with the specified ID.
|
| void | Write (const DataField *field) override |
| | Writes data to the stream from the specified field.
|
| void | Write (const DataStructure *structure) override |
| | Writes the specified structure to the stream.
|
| size_t | Position () const override |
| | Gets the current position in the stream.
|
| void | SetPosition (size_t position) const override |
| | Sets the current position in the stream.
|
| size_t | Beginning () const override |
| | Gets the beginning position of the file.
|
| size_t | End () const override |
| | Gets the end position of the file.
|
| | RawField (size_t size) |
| | Constructor; creates a new instance of Field.
|
| | RawField (const RawField &other) |
| | Copy constructor; creates a deep copy of the field.
|
| size_t | Size () const override |
| | Gets the size of the data in the field.
|
| char * | RawData () override |
| | Provides access to the field's raw data via pointer.
|
| const char * | RawData () const override |
| | Provides access to the field's raw data via const pointer.
|
| std::string | ToString () const override |
| | Converts the field's data to a string representation.
|
| std::string | ToString (StringFormat format) const override |
| | Converts the field's data to a string representation.
|
| RawField & | operator= (const RawField &other) |
| | Assignment operator for RawField.
|
| virtual | ~DataField ()=default |
| | Default destructor; properly destroys the instance.
|
| virtual void | CopyRawDataTo (DataField *other) |
| | Copies the raw data to another DataField.
|
| virtual | ~Stream ()=default |
| | Default destructor; properly destroys the instance.
|
Represents a memory buffer that can be used as a stream.
Rather than reading or writing individual fields or structures to a file, you can use this class to read or write a large block of data to or from memory, which can improve performance. Individual fields and structures can then be read from or written to the buffer as needed.
- Invariant
- Size must be greater than 0.
-
Position must be between 0 and Size, inclusive.
-
Buffer memory must always be valid and allocated to size.
-
Reading advances the position by field or structure size.
-
Reading does not modify the buffer's contents.
-
Writing both advances the position and modifies buffer.