GL Studio C++ Runtime API
GlsGloFile::WriteBuffer Class Reference

#include <gls_glo_file.h>

Public Member Functions

 WriteBuffer (const unsigned int initialSize)
 
void Resize (const unsigned int minimumSize)
 
void Enlarge (const unsigned int incrementalSize)
 
unsigned char * Buffer ()
 
unsigned int Size ()
 
void WriteData (const void *data, const unsigned int size)
 
void WriteData (const void *data, const unsigned int size, const unsigned int offset)
 
void Rewind ()
 Rewind to beginning of buffer.
 

Protected Attributes

unsigned int _current
 Total size of the params for the current object.
 
unsigned int _bufSize
 Size of the param buffer.
 
unsigned char * _buf
 Buffer containing the params for the current object.
 

Detailed Description

The WriteBuffer class. A resizable binary stream.

Constructor & Destructor Documentation

◆ WriteBuffer()

WriteBuffer ( const unsigned int  initialSize)

Constructor

Parameters
initialSizeThe initial size of the buffer in bytes.

Member Function Documentation

◆ Buffer()

unsigned char * Buffer ( )
Returns
The buffer pointer.

◆ Enlarge()

void Enlarge ( const unsigned int  incrementalSize)

Enlarge buffer by at least incrementalSize

Parameters
incrementalSizeIncrease by this size in bytes.

◆ Resize()

void Resize ( const unsigned int  minimumSize)

Ensure the buffer is at least the specified size.

Parameters
minimumSizeThe minimum size in bytes.

◆ Size()

unsigned int Size ( )
Returns
The current buffer size.

◆ WriteData() [1/2]

void WriteData ( const void *  data,
const unsigned int  size 
)

Write data to the buffer at the current offset, moving the current write position.

Parameters
dataPointer to the data to write.
sizeThe number of bytes to write.

◆ WriteData() [2/2]

void WriteData ( const void *  data,
const unsigned int  size,
const unsigned int  offset 
)

Write data to the buffer at a specific offset, not moving the current write position.

Parameters
dataPointer to the data to write.
sizeThe number of bytes to write.
offsetThe position in the buffer to write to.

The documentation for this class was generated from the following file: