openMSX
|
#include <TemporaryString.hh>
Public Member Functions | |
TemporaryString (size_t n_, std::invocable< char * > auto fillOp) | |
TemporaryString (const TemporaryString &)=delete | |
TemporaryString (TemporaryString &&)=delete | |
TemporaryString & | operator= (const TemporaryString &)=delete |
TemporaryString & | operator= (TemporaryString &&)=delete |
char * | data () |
const char * | c_str () const |
operator std::string_view () const | |
operator zstring_view () const | |
Static Public Attributes | |
static constexpr size_t | BUFSIZE = 127 |
This a type meant to store temporary strings. Typically it stores the string in the object itself. Except when the string is too large, then it falls back to heap-allocation. So it's more or less like a std::string but with a relatively large (127 character) "small-string-buffer". (Typical std::string implementations only have a buffer for 15 or 23 characters).
Because of this internal buffer, TemporaryString objects are quite large. The intention is that they are only used as local variable (so stored on the stack). Not as member variables.
The API of this type is still very minimal. It can be extended when needed.
Definition at line 26 of file TemporaryString.hh.
|
inline |
Definition at line 30 of file TemporaryString.hh.
References allocate_string_storage(), and BUFSIZE.
|
delete |
|
delete |
|
inline |
Definition at line 48 of file TemporaryString.hh.
|
inline |
Definition at line 47 of file TemporaryString.hh.
|
inline |
Definition at line 50 of file TemporaryString.hh.
|
inline |
Definition at line 51 of file TemporaryString.hh.
|
delete |
|
delete |
|
staticconstexpr |
Definition at line 28 of file TemporaryString.hh.
Referenced by TemporaryString().