clan::DataBuffer Class Reference - ClanLib SDK
Description: clan::DataBuffer Class Reference

Public Member Functions | List of all members
clan::DataBuffer Class Reference
clanCore System

General purpose data buffer. More...

`#include <databuffer.h>`

## Public Member Functions
| DataBuffer ()
| Constructs a data buffer of 0 size.
| DataBuffer (const DataBuffer &copy)
| DataBuffer (const DataBuffer &data, size_t pos, size_t size)
| DataBuffer (const void *data, size_t size)
| DataBuffer (size_t size)
| ~DataBuffer ()
size_t | get_capacity () const
| Returns the capacity of the data buffer object.
char * | get_data ()
| Returns a pointer to the data.
template<typename Type >
Type * | get_data ()
const char * | get_data () const
template<typename Type >
const Type * | get_data () const
size_t | get_size () const
| Returns the size of the data.
bool | is_null () const
| Returns true if the buffer is 0 in size.
DataBuffer & | operator= (const DataBuffer &copy)
char & | operator[] (size_t i)
| Returns a char in the buffer.
const char & | operator[] (size_t i) const
void | set_capacity (size_t capacity)
| Preallocate enough memory.
void | set_size (size_t size)
| Resize the buffer.

## Detailed Description

General purpose data buffer.

## Constructor & Destructor Documentation

## ◆ DataBuffer() [1/5]

clan::DataBuffer::DataBuffer | ( |  | ) |

Constructs a data buffer of 0 size.

## ◆ DataBuffer() [2/5]

clan::DataBuffer::DataBuffer | ( | size_t | size | ) |

## ◆ DataBuffer() [3/5]

clan::DataBuffer::DataBuffer | ( | const DataBuffer & | copy | ) |

## ◆ DataBuffer() [4/5]

clan::DataBuffer::DataBuffer | ( | const void * | data,
|  | size_t | size )

## ◆ DataBuffer() [5/5]

clan::DataBuffer::DataBuffer | ( | const DataBuffer & | data,
|  | size_t | pos,
|  | size_t | size )

## ◆ ~DataBuffer()

clan::DataBuffer::~DataBuffer | ( |  | ) |

## Member Function Documentation

## ◆ get_capacity()

size_t clan::DataBuffer::get_capacity | ( |  | ) | const

Returns the capacity of the data buffer object.

## ◆ get_data() [1/4]

char * clan::DataBuffer::get_data | ( |  | ) |

Returns a pointer to the data.

## ◆ get_data() [2/4]

template<typename Type >

Type * clan::DataBuffer::get_data | ( |  | ) |
| inline

References get_data().

Referenced by get_data().

## ◆ get_data() [3/4]

const char * clan::DataBuffer::get_data | ( |  | ) | const

## ◆ get_data() [4/4]

template<typename Type >

const Type * clan::DataBuffer::get_data | ( |  | ) | const
| inline

References get_data().

Referenced by get_data().

## ◆ get_size()

size_t clan::DataBuffer::get_size | ( |  | ) | const

Returns the size of the data.

## ◆ is_null()

bool clan::DataBuffer::is_null | ( |  | ) | const

Returns true if the buffer is 0 in size.

## ◆ operator=()

DataBuffer & clan::DataBuffer::operator= | ( | const DataBuffer & | copy | ) |

## ◆ operator[]() [1/2]

char & clan::DataBuffer::operator[] | ( | size_t | i | ) |

Returns a char in the buffer.

## ◆ operator[]() [2/2]

const char & clan::DataBuffer::operator[] | ( | size_t | i | ) | const

## ◆ set_capacity()

void clan::DataBuffer::set_capacity | ( | size_t | capacity | ) |

Preallocate enough memory.

## ◆ set_size()

void clan::DataBuffer::set_size | ( | size_t | size | ) |

Resize the buffer.

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

- databuffer.h