Simple char buffer class to provide memory into which C strings can be written.
More...
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.
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().