| GL Studio C++ Runtime API

Public Member Functions | Protected Attributes | List of all members
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

  initialSize | The 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

  incrementalSize | Increase by this size in bytes.

## ◆ Resize()

void Resize | ( | const unsigned int | minimumSize | ) |

Ensure the buffer is at least the specified size.

Parameters

  minimumSize | The 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

  data | Pointer to the data to write.
  size | The 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

  data | Pointer to the data to write.
  size | The number of bytes to write.
  offset | The position in the buffer to write to.

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

- gls_glo_file.h