AUI Framework  develop
Cross-platform base for C++ UI apps
Loading...
Searching...
No Matches
AByteBuffer Class Referencefinal

std::vector-like growing array for byte storage.

#include <AUI/Common/AByteBuffer.h>

Member Function Documentation

> All members, including inherited

◆ at() [1/2]

template<typename T>
T & AByteBuffer::at ( size_t byteIndex)
inline
Template Parameters
Tdata type
Parameters
byteIndexbyte offset realtive to the beginning of internal buffer
Returns
data

◆ at() [2/2]

template<typename T>
const T & AByteBuffer::at ( size_t byteIndex) const
inline
Template Parameters
Tdata type
Parameters
byteIndexbyte offset realtive to the beginning of internal buffer
Returns
data

◆ capacity()

size_t AByteBuffer::capacity ( ) const
inlinenoexcept
Returns
size of whole buffer (including possibly invalid data)

◆ data()

char * AByteBuffer::data ( ) const
inline
Returns
Internal buffer.

◆ empty()

bool AByteBuffer::empty ( ) const
inlinenoexcept
Returns
true if size == 0

◆ getAvailableToWrite()

size_t AByteBuffer::getAvailableToWrite ( ) const
inline
Returns
delta between internal buffer size and payload size.

◆ getReserved()

size_t AByteBuffer::getReserved ( ) const
inlinenoexcept
Returns
size of internal buffer. Must be greater that getSize()

◆ getSize()

size_t AByteBuffer::getSize ( ) const
inlinenoexcept
Returns
size of payload (valid data)

◆ increaseSize()

void AByteBuffer::increaseSize ( size_t s)
inline

Forces new size of the buffer.

Sneaky assert:
Assert fails when new size is greater that reserved buffer size. Use AByteBuffer::resize to avoid this.
Parameters
snew size of the payload

◆ reallocate()

void AByteBuffer::reallocate ( size_t s)
inline

Resizes the buffer WITHOUT keeping it's contents. When reserved buffer size is differs from the new size, buffer is reallocated with new size.

Parameters
snew size of the payload

◆ resize()

void AByteBuffer::resize ( size_t s)
inline

Resizes the buffer keeping it's contents. When reserved buffer size is less than the new size, buffer is reallocated with new size.

Parameters
snew size of the payload

◆ setSize()

void AByteBuffer::setSize ( size_t s)
inline

Forces new size of the buffer.

Sneaky assert:
Assert fails when new size is greater that reserved buffer size. Use AByteBuffer::resize to avoid this.
Parameters
snew size of the payload

◆ size()

size_t AByteBuffer::size ( ) const
inlinenoexcept
Returns
size of payload (valid data)

◆ write() [1/2]

void AByteBuffer::write ( const char * src,
size_t size )
overridevirtual
Sneaky exceptions
An implementation can throw any exception that subclasses AIOException.
Parameters
srcsource buffer
sizesource buffer's size. > 0

Implements IOutputStream.

◆ write() [2/2]

void AByteBuffer::write ( IInputStream & stream,
size_t size )

Reads exact size bytes from stream.

Parameters
stream
size