Zth (libzth)
|
Copy-on-write string. More...
#include <util.h>
Public Member Functions | |
cow_string () | |
cow_string (char const *s) | |
cow_string (string const &s) | |
cow_string (cow_string const &s) | |
cow_string & | operator= (cow_string const &s) |
cow_string & | operator= (char const *s) |
cow_string & | operator= (string const &s) |
cow_string (cow_string &&s)=default | |
cow_string & | operator= (cow_string &&s)=default |
cow_string (string &&s) | |
cow_string & | operator= (string &&s) |
string | str () && |
string const & | str () const & |
char const * | c_str () const |
operator string const & () const | |
char const & | at (size_t pos) const |
char | operator[] (size_t pos) const |
char & | operator[] (size_t pos) |
char const * | data () const |
bool | empty () const noexcept |
size_t | size () const noexcept |
size_t | length () const noexcept |
void | clear () noexcept |
bool | isConst () const noexcept |
bool | isLocal () const noexcept |
Protected Member Functions | |
string const & | local () const |
string & | local () |
Copy-on-write string.
It holds either a pointer to the a const
char
array, or a string instance. So, it is cheap for string literals, avoids duplicating these into std::string, but still allows to do so when required.
|
inline |
|
default |
|
inlineprotected |
|
inline |
|
default |
|
inline |
|
inline |
|
inline |