#include <kanzi/core/util/memory_writer.hpp>
|
void | alignToOffset (ptrdiff_t alignBytes) |
| Skip to next alignment of given bytes, relative to the beginning of the parsed data.
|
|
void | copy (ConstByteSpan source) |
| Write the data to the current position in the memory buffer.
|
|
size_t | getCapacity () const |
| Gets the current capacity of the memory buffer.
|
|
size_t | getSize () const |
| Gets the current size of the written memory.
|
|
| MemoryWriter (ByteSpan memory) |
| Constructor.
|
|
void | skip (size_t sizeBytes) |
| Skip bytes from current location in the memory buffer.
|
|
void | write (float value) |
| Write a 32-bit floating point value to the current position in the memory buffer.
|
|
void | write (int16_t value) |
| Write a 16-bit integer value to the current position in the memory buffer.
|
|
void | write (int32_t value) |
| Write a 32-bit integer value to the current position in the memory buffer.
|
|
void | write (int64_t value) |
| Write a 8-bit integer value to the current position in the memory buffer.
|
|
void | write (int8_t value) |
| Write a 8-bit integer value to the current position in the memory buffer.
|
|
void | write (uint16_t value) |
| Write a 16-bit unsigned integer value to the current position in the memory buffer.
|
|
void | write (uint32_t value) |
| Write a 32-bit unsigned integer value to the current position in the memory buffer.
|
|
void | write (uint64_t value) |
| Write a 64-bit unsigned integer value to the current position in the memory buffer.
|
|
void | write (uint8_t value) |
| Write a 8-bit unsigned integer value to the current position in the memory buffer.
|
|
◆ MemoryWriter()
kanzi::MemoryWriter::MemoryWriter |
( |
ByteSpan | memory | ) |
|
|
inlineexplicit |
Constructor.
- Parameters
-
memory | Span representing the location of the writable memory buffer. |
◆ write() [1/9]
Write a 64-bit unsigned integer value to the current position in the memory buffer.
- Parameters
-
value | A 64-bit unsigned integer value. |
◆ write() [2/9]
Write a 8-bit integer value to the current position in the memory buffer.
- Parameters
-
value | A 8-bit integer value. |
◆ write() [3/9]
Write a 32-bit unsigned integer value to the current position in the memory buffer.
- Parameters
-
value | A 32-bit unsigned integer value. |
◆ write() [4/9]
Write a 32-bit integer value to the current position in the memory buffer.
- Parameters
-
value | A 32-bit integer value. |
◆ write() [5/9]
Write a 16-bit unsigned integer value to the current position in the memory buffer.
- Parameters
-
value | A 16-bit unsigned integer value. |
◆ write() [6/9]
Write a 16-bit integer value to the current position in the memory buffer.
- Parameters
-
value | A 16-bit integer value. |
◆ write() [7/9]
Write a 8-bit unsigned integer value to the current position in the memory buffer.
- Parameters
-
value | A 8-bit unsigned integer value. |
◆ write() [8/9]
Write a 8-bit integer value to the current position in the memory buffer.
- Parameters
-
value | A 8-bit integer value. |
◆ write() [9/9]
void kanzi::MemoryWriter::write |
( |
float | value | ) |
|
|
inline |
Write a 32-bit floating point value to the current position in the memory buffer.
- Parameters
-
value | A 32-bit floating point value. |
◆ copy()
Write the data to the current position in the memory buffer.
- Parameters
-
◆ alignToOffset()
Skip to next alignment of given bytes, relative to the beginning of the parsed data.
If alignment is already correct, the position is not moved.
- Parameters
-
alignBytes | Alignment to skip to. |
◆ skip()
void kanzi::MemoryWriter::skip |
( |
size_t | sizeBytes | ) |
|
|
inline |
Skip bytes from current location in the memory buffer.
- Parameters
-
◆ getSize()
size_t kanzi::MemoryWriter::getSize |
( |
| ) |
const |
|
inline |
Gets the current size of the written memory.
- Returns
- Size in bytes
◆ getCapacity()
size_t kanzi::MemoryWriter::getCapacity |
( |
| ) |
const |
|
inline |
Gets the current capacity of the memory buffer.
- Returns
- Capacity in bytes
The documentation for this class was generated from the following file: