CppCMS
|
Very simple output stream buffer that uses stack for small chunks of text and then allocates memory of the default buffer is too small. More...
#include <cppcms/steal_buf.h>
Public Member Functions | |
char * | begin () |
char * | end () |
char * | c_str () |
std::string | str () |
Protected Member Functions | |
int | overflow (int c) |
Very simple output stream buffer that uses stack for small chunks of text and then allocates memory of the default buffer is too small.
It is something like std::stringbuf with small string optimization, it also allows to access the memory without actually creating the string itself.
The template parameter defines how many characters should be allocated on stack by default before heap is used.
char* cppcms::util::stackbuf< OnStackSize >::begin | ( | ) | [inline] |
get the pointer to the beginning of the output buffer
Referenced by cppcms::util::stackstream< Size >::begin(), cppcms::util::stackbuf< Size >::c_str(), and cppcms::util::stackbuf< Size >::str().
char* cppcms::util::stackbuf< OnStackSize >::c_str | ( | ) | [inline] |
get the 0 terminated string from the buffer.
Referenced by cppcms::util::stackstream< Size >::c_str().
char* cppcms::util::stackbuf< OnStackSize >::end | ( | ) | [inline] |
get the pointer to the end of the output buffer
Referenced by cppcms::util::stackstream< Size >::end(), and cppcms::util::stackbuf< Size >::str().
std::string cppcms::util::stackbuf< OnStackSize >::str | ( | ) | [inline] |
get the std::string from the buffer.
Referenced by cppcms::util::stackstream< Size >::str().