openMSX
|
#include <TemporaryString.hh>
Public Member Functions | |
TemporaryString () | |
TemporaryString (const char *s) | |
TemporaryString (zstring_view s) | |
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 |
~TemporaryString ()=default | |
auto | size () const |
auto | empty () const |
const char * | data () const |
const char * | c_str () const |
std::string_view | view () const |
operator std::string_view () const | |
operator zstring_view () const | |
bool | starts_with (std::string_view s) const |
bool | starts_with (char c) const |
bool | starts_with (const char *s) const |
bool | ends_with (std::string_view s) const |
bool | ends_with (char c) const |
bool | ends_with (const char *s) 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.
|
inlineexplicit |
Definition at line 30 of file TemporaryString.hh.
|
inlineexplicit |
Definition at line 37 of file TemporaryString.hh.
|
inlineexplicit |
Definition at line 39 of file TemporaryString.hh.
|
inlineexplicit |
Definition at line 42 of file TemporaryString.hh.
References allocate_string_storage(), and BUFSIZE.
|
delete |
|
delete |
|
default |
|
inline |
Definition at line 67 of file TemporaryString.hh.
Referenced by openmsx::ImGuiSymbols::paint().
|
inline |
Definition at line 66 of file TemporaryString.hh.
|
inline |
Definition at line 64 of file TemporaryString.hh.
|
inline |
Definition at line 77 of file TemporaryString.hh.
References view().
|
inline |
Definition at line 78 of file TemporaryString.hh.
References view().
|
inline |
Definition at line 76 of file TemporaryString.hh.
References view().
|
inline |
Definition at line 70 of file TemporaryString.hh.
|
inline |
Definition at line 71 of file TemporaryString.hh.
|
delete |
|
delete |
|
inline |
Definition at line 63 of file TemporaryString.hh.
|
inline |
Definition at line 74 of file TemporaryString.hh.
References view().
|
inline |
Definition at line 75 of file TemporaryString.hh.
References view().
|
inline |
Definition at line 73 of file TemporaryString.hh.
References view().
|
inline |
Definition at line 69 of file TemporaryString.hh.
Referenced by ends_with(), ends_with(), ends_with(), starts_with(), starts_with(), and starts_with().
|
staticconstexpr |
Definition at line 28 of file TemporaryString.hh.
Referenced by TemporaryString().