...one of the most highly
regarded and expertly designed C++ library projects in the
world.
— Herb Sutter and Andrei
Alexandrescu, C++
Coding Standards
Boost.Nowide
|
A class that allows to create a temporary wide or narrow UTF strings from wide or narrow UTF source. More...
#include <boost/nowide/stackstring.hpp>
Public Types | |
using | output_char = CharOut |
Type of the output character (converted to) | |
using | input_char = CharIn |
Type of the input character (converted from) | |
Public Member Functions | |
basic_stackstring () | |
Creates a NULL stackstring. | |
basic_stackstring (const input_char *input) | |
basic_stackstring (const input_char *begin, const input_char *end) | |
basic_stackstring (const basic_stackstring &other) | |
Copy construct from other. | |
basic_stackstring & | operator= (const basic_stackstring &other) |
Copy assign from other. | |
output_char * | convert (const input_char *input) |
output_char * | convert (const input_char *begin, const input_char *end) |
output_char * | get () |
Return the converted, NULL-terminated string or NULL if no string was converted. | |
const output_char * | get () const |
Return the converted, NULL-terminated string or NULL if no string was converted. | |
void | clear () |
Reset the internal buffer to NULL. | |
Static Public Attributes | |
static const size_t | buffer_size = BufferSize |
Size of the stack buffer. | |
Protected Member Functions | |
bool | uses_stack_memory () const |
True if the stack memory is used. | |
size_t | length () const |
Friends | |
void | swap (basic_stackstring &lhs, basic_stackstring &rhs) |
Swap lhs with rhs. | |
A class that allows to create a temporary wide or narrow UTF strings from wide or narrow UTF source.
It uses a stack buffer if the string is short enough otherwise allocates a buffer on the heap.
Invalid UTF characters are replaced by the substitution character, see BOOST_NOWIDE_REPLACEMENT_CHARACTER
If a NULL pointer is passed to the constructor or convert method, NULL will be returned by c_str. Similarly a default constructed stackstring will return NULL on calling c_str.
|
inlineexplicit |
Convert the NULL terminated string input and store in internal buffer If input is NULL, nothing will be stored
|
inline |
Convert the sequence [begin, end) and store in internal buffer If begin is NULL, nothing will be stored
|
inline |
Convert the sequence [begin, end) and store in internal buffer If begin is NULL, the current buffer will be reset to NULL
|
inline |
Convert the NULL terminated string input and store in internal buffer If input is NULL, the current buffer will be reset to NULL
|
inlineprotected |
Return the current length of the string excluding the NULL terminator If NULL is stored returns NULL