nidas  v1.2-1520
Public Member Functions | Private Member Functions | Private Attributes | List of all members
CharBuffer Class Reference

Simple char buffer class to provide memory into which C strings can be written. More...

Public Member Functions

 CharBuffer ()
 
void clear ()
 
char * get ()
 Return a pointer to the beginning of the buffer. More...
 
char * getSpace (unsigned int length=0)
 Get a pointer to the end of the buffer with room for at least length more bytes, but do not change the length of space used in the buffer yet. More...
 
bool empty ()
 

Private Member Functions

 CharBuffer (const CharBuffer &rhs)
 
CharBufferoperator= (const CharBuffer &rhs)
 

Private Attributes

vector< char > _buffer
 
unsigned int _buflen
 

Detailed Description

Simple char buffer class to provide memory into which C strings can be written.

Memory grows as necessary and is not reclaimed, and the length of the buffer is tracked so strings can be written right at the end instead of appended to a long string.

Constructor & Destructor Documentation

CharBuffer::CharBuffer ( )
inline
CharBuffer::CharBuffer ( const CharBuffer rhs)
inlineprivate

References VLOG.

Member Function Documentation

void CharBuffer::clear ( )
inline

Referenced by dataToInfluxDB().

bool CharBuffer::empty ( )
inline
char* CharBuffer::get ( )
inline

Return a pointer to the beginning of the buffer.

Referenced by dataToInfluxDB().

char* CharBuffer::getSpace ( unsigned int  length = 0)
inline

Get a pointer to the end of the buffer with room for at least length more bytes, but do not change the length of space used in the buffer yet.

The returned pointer can be used to print or copy up to length bytes into the buffer, beginning at the pointer returned by getSpace(). A null terminator is automatically added at the new length, so the caller does not need to add a null terminator if it writes exactly length bytes into the buffer.

Referenced by writeInfluxResult().

CharBuffer& CharBuffer::operator= ( const CharBuffer rhs)
inlineprivate

References _buffer, _buflen, and VLOG.

Member Data Documentation

vector<char> CharBuffer::_buffer
private

Referenced by operator=().

unsigned int CharBuffer::_buflen
private

Referenced by operator=().


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