13#include "roo_backport.h"
14#include "roo_backport/string_view.h"
74 const char*
c_str()
const {
return data_; }
78 bool empty()
const {
return data_[0] == 0; }
89 operator roo::string_view()
const {
90 return roo::string_view(data_,
length());
Fixed-capacity string stored inline (no heap allocation).
bool operator==(const SmallString &other) const
Equality comparison.
SmallString(const std::string &str)
Constructs from std::string.
SmallString(const char *str)
Constructs from a C string.
size_t length() const
Returns the string length.
bool empty() const
Checks whether the string is empty.
SmallString(const roo::string_view &str)
Constructs from roo::string_view.
static constexpr size_t kCapacity
Maximum storage capacity (including the trailing '\0').
SmallString(const SmallString &other)
Copy constructor.
const char * c_str() const
Returns pointer to null-terminated character data.
SmallString & operator=(const SmallString &other)
Copy assignment.
SmallString & operator=(const char *other)
Assigns from C string.
SmallString()
Creates an empty string.
bool operator!=(const SmallString &other) const
Inequality comparison.
SmallString & operator=(roo::string_view other)
Assigns from roo::string_view.
Hashing utilities used by roo_collections containers.