|
roo_collections
API Documentation for roo_collections
|
Fixed-capacity string stored inline (no heap allocation). More...
#include <small_string.h>
Public Member Functions | |
| SmallString () | |
| Creates an empty string. | |
| SmallString (const char *str) | |
| Constructs from a C string. | |
| SmallString (const std::string &str) | |
Constructs from std::string. | |
| SmallString (const roo::string_view &str) | |
Constructs from roo::string_view. | |
| SmallString (const SmallString &other) | |
| Copy constructor. | |
| SmallString & | operator= (const SmallString &other) |
| Copy assignment. | |
| SmallString & | operator= (const char *other) |
| Assigns from C string. | |
| SmallString & | operator= (roo::string_view other) |
Assigns from roo::string_view. | |
| size_t | length () const |
| Returns the string length. | |
| const char * | c_str () const |
| Returns pointer to null-terminated character data. | |
| bool | empty () const |
| Checks whether the string is empty. | |
| bool | operator== (const SmallString &other) const |
| Equality comparison. | |
| bool | operator!= (const SmallString &other) const |
| Inequality comparison. | |
| operator roo::string_view () const | |
Implicit conversion to roo::string_view. | |
Static Public Attributes | |
| static constexpr size_t | kCapacity = N |
| Maximum storage capacity (including the trailing '\0'). | |
Fixed-capacity string stored inline (no heap allocation).
Intended for short, bounded identifiers and other small keys/values where a constant memory footprint is preferred over unbounded growth.
| N | Capacity of the internal storage buffer, in bytes. |
Definition at line 26 of file small_string.h.
|
inline |
Creates an empty string.
Definition at line 32 of file small_string.h.
|
inline |
Constructs from a C string.
| str | Null-terminated source string. |
Definition at line 36 of file small_string.h.
|
inline |
Constructs from std::string.
| str | Source string. |
Definition at line 40 of file small_string.h.
|
inline |
Constructs from roo::string_view.
| str | Source view. |
Definition at line 44 of file small_string.h.
|
inline |
Copy constructor.
Definition at line 49 of file small_string.h.
|
inline |
Returns pointer to null-terminated character data.
Definition at line 74 of file small_string.h.
|
inline |
Checks whether the string is empty.
true when empty. Definition at line 78 of file small_string.h.
|
inline |
Returns the string length.
Definition at line 71 of file small_string.h.
Referenced by roo_collections::SmallString< N >::operator roo::string_view().
|
inline |
Implicit conversion to roo::string_view.
Definition at line 89 of file small_string.h.
References roo_collections::SmallString< N >::length().
|
inline |
Inequality comparison.
Definition at line 86 of file small_string.h.
References roo_collections::SmallString< N >::operator==().
|
inline |
Assigns from C string.
Definition at line 58 of file small_string.h.
|
inline |
Copy assignment.
Definition at line 52 of file small_string.h.
|
inline |
Assigns from roo::string_view.
Definition at line 64 of file small_string.h.
|
inline |
Equality comparison.
Definition at line 81 of file small_string.h.
Referenced by roo_collections::SmallString< N >::operator!=().
|
staticconstexpr |
Maximum storage capacity (including the trailing '\0').
Definition at line 29 of file small_string.h.