|
|
|
This is a block of data that receives the results of DCPacker.
More...
#include "dcPackData.h"
List of all members.
Public Member Functions |
| void | append_data (const char *buffer, size_t size) |
| | Adds the indicated bytes to the end of the data.
|
| void | append_junk (size_t size) |
| | Adds some uninitialized bytes to the end of the data.
|
| void | clear () |
| | Empties the contents of the data (without necessarily freeing its allocated memory).
|
| const char * | get_data () const |
| | Returns the beginning of the data buffer.
|
| size_t | get_length () const |
| | Returns the current length of the buffer.
|
| char * | get_rewrite_pointer (size_t position, size_t size) |
| | Returns a pointer into the middle of the data at the indicated point.
|
| string | get_string () const |
| | Returns the data buffer as a string.
|
| char * | get_write_pointer (size_t size) |
| | Adds the indicated number of bytes to the end of the data without initializing them, and returns a pointer to the beginning of the new data.
|
| void | rewrite_data (size_t position, const char *buffer, size_t size) |
| | Changes the data at the indicated position to the given value.
|
| char * | take_data () |
| | Returns the pointer to the beginning of the data buffer, and transfers ownership of the buffer to the caller.
|
Detailed Description
This is a block of data that receives the results of DCPacker.
Definition at line 25 of file dcPackData.h.
Member Function Documentation
Adds the indicated bytes to the end of the data.
Definition at line 57 of file dcPackData.I.
Referenced by DCPacker::append_data(), DCPacker::end_repack(), DCArrayParameter::pack_default_value(), DCSimpleParameter::pack_default_value(), DCSwitch::pack_default_value(), DCField::pack_default_value(), DCPacker::pack_literal_value(), DCArrayParameter::pack_string(), DCSimpleParameter::pack_string(), DCPacker::raw_pack_string(), and DCPacker::seek().
Adds the indicated number of bytes to the end of the data without initializing them, and returns a pointer to the beginning of the new data.
Definition at line 70 of file dcPackData.I.
Referenced by DCPacker::get_write_pointer(), DCSimpleParameter::pack_double(), DCSimpleParameter::pack_int(), DCSimpleParameter::pack_int64(), DCArrayParameter::pack_string(), DCSimpleParameter::pack_string(), DCSimpleParameter::pack_uint(), DCSimpleParameter::pack_uint64(), DCPacker::raw_pack_float64(), DCPacker::raw_pack_int16(), DCPacker::raw_pack_int32(), DCPacker::raw_pack_int64(), DCPacker::raw_pack_int8(), DCPacker::raw_pack_string(), DCPacker::raw_pack_uint16(), DCPacker::raw_pack_uint32(), DCPacker::raw_pack_uint64(), and DCPacker::raw_pack_uint8().
Changes the data at the indicated position to the given value.
It is an error if there are not at least position + size bytes in the data.
Definition at line 93 of file dcPackData.I.
Returns the pointer to the beginning of the data buffer, and transfers ownership of the buffer to the caller.
The caller is now responsible for ultimately freeing the returned pointer with delete[], if it is non-NULL. This may (or may not) return NULL if the buffer is empty.
This also empties the DCPackData structure, and sets its length to zero (so you should call get_length() before calling this method).
Definition at line 164 of file dcPackData.I.
Referenced by DCPacker::seek(), and DCPacker::take_data().
The documentation for this class was generated from the following files:
| | |