openMSX
|
Go to the source code of this file.
Classes | |
struct | FreeStringStorage |
StringStorage: Acts like a 'const char*', but in addition calls free() when the pointer goes out of scope. More... | |
Typedefs | |
using | StringStorage = std::unique_ptr< char, FreeStringStorage > |
Functions | |
StringStorage | allocate_string_storage (size_t size) |
Allocate a 'StringStorage' large enough for 'size' characters. | |
StringStorage | allocate_c_string (std::string_view s) |
Allocate memory for and copy a c-string (zero-terminated string). | |
using StringStorage = std::unique_ptr<char, FreeStringStorage> |
Definition at line 17 of file StringStorage.hh.
|
inline |
Allocate memory for and copy a c-string (zero-terminated string).
This function is similar to strdup(), except that this function:
Definition at line 32 of file StringStorage.hh.
References allocate_string_storage(), and ranges::copy().
|
inline |
Allocate a 'StringStorage' large enough for 'size' characters.
Definition at line 22 of file StringStorage.hh.
Referenced by allocate_c_string(), make_string_storage(), and TemporaryString::TemporaryString().