1 #ifndef STRINGSTORAGE_HH
2 #define STRINGSTORAGE_HH
36 char* p = result.get();
37 memcpy(p, s.data(),
size);
std::unique_ptr< char, FreeStringStorage > StringStorage
StringStorage allocate_c_string(std::string_view s)
Allocate memory for and copy a c-string (zero-terminated string).
StringStorage allocate_string_storage(size_t size)
Allocate a 'StringStorage' large enough for 'size' characters.
size_t size(std::string_view utf8)
StringStorage: Acts like a 'const char*', but in addition calls free() when the pointer goes out of s...