nidas v1.2.3
|
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. | |
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. | |
bool | empty () |
Private Member Functions | |
CharBuffer (const CharBuffer &rhs) | |
CharBuffer & | operator= (const CharBuffer &rhs) |
Private Attributes | |
vector< char > | _buffer |
unsigned int | _buflen |
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.
|
inline |
References clear().
|
inlineprivate |
References VLOG.
|
inline |
References _buffer, and _buflen.
Referenced by CharBuffer(), dataToInfluxDB(), InfluxDB::handleResult(), and InfluxDB::sendData().
|
inline |
References get(), and getSpace().
Referenced by InfluxDB::handleResult(), and InfluxDB::sendData().
|
inline |
Return a pointer to the beginning of the buffer.
References _buffer.
Referenced by dataToInfluxDB(), empty(), getSpace(), InfluxDB::handleResult(), and InfluxDB::sendData().
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.
References _buffer, _buflen, get(), and nidas::core::getSample().
Referenced by InfluxDB::addMeasurement(), and empty().
|
inlineprivate |
|
private |
Referenced by clear(), get(), getSpace(), and operator=().
Referenced by clear(), getSpace(), and operator=().