Owned UTF-8 text. More...
#include <StormByte/safe/string.hxx>

Public Types | |
| using | value_type = char |
| Byte type. | |
| using | size_type = Size |
| Byte count and position type. | |
| using | difference_type = std::ptrdiff_t |
| Iterator distance type. | |
| using | pointer = char* |
| Mutable buffer pointer. | |
| using | const_pointer = const char* |
| Read-only buffer pointer. | |
| using | reference = char& |
| Mutable character reference. | |
| using | const_reference = const char& |
| Read-only character reference. | |
| using | iterator = char* |
| Mutable contiguous iterator. | |
| using | const_iterator = const char* |
| Contiguous observer. | |
| using | reverse_iterator = std::reverse_iterator<iterator> |
| Mutable reverse observer. | |
| using | const_reverse_iterator = std::reverse_iterator<const_iterator> |
| Reverse observer. | |
Public Member Functions | |
| void | swap (String &other) noexcept |
Swaps storage with other. | |
Life | |
| String () noexcept | |
| Empty text. | |
| String (const char *str) | |
| Copies a C string. | |
| String (std::string_view str) | |
| Copies a view into owned storage. | |
| String (size_type count, char character) | |
Construct count copies of character. | |
| String (const String &other, size_type pos, size_type count=npos) | |
Copy a slice of other. | |
| template<std::input_iterator InputIt> | |
| String (InputIt first, InputIt last) | |
| Copy the byte range [first, last). | |
| String (const WString &other) | |
| UTF-8 from wide text. | |
| String (const String &other) | |
| Copy constructor. | |
| String (String &&other) noexcept | |
| Move constructor. | |
| ~String () noexcept | |
| Releases a long SDS buffer. | |
| String & | operator= (const String &other) |
| Copy assignment. | |
| String & | operator= (String &&other) noexcept |
| Move assignment. | |
| String & | operator= (std::string_view text) |
| Copy text from a caller-owned view. | |
Conversions | |
| operator std::string_view () const noexcept | |
| Non-owning view of the text. | |
| STORMBYTE_FORCE_INLINE | operator std::string () const |
| Copy of the text in the caller’s heap. | |
| operator const char * () const noexcept | |
| View of the owned buffer. | |
| operator WString () const | |
| Wide text (UTF-8 decoded in the module). | |
| const char * | Bytes () const noexcept |
| Non-owning view of the owned bytes. | |
Comparison | |
| bool | operator== (const String &other) const noexcept |
| Content equality. | |
| bool | operator!= (const String &other) const noexcept |
| Content inequality. | |
| bool | operator== (const char *str) const noexcept |
| Content equality with a C string. | |
| bool | operator!= (const char *str) const noexcept |
| Content inequality with a C string. | |
| STORMBYTE_FORCE_INLINE std::strong_ordering | operator<=> (const String &other) const noexcept |
| Content order. | |
| STORMBYTE_FORCE_INLINE std::strong_ordering | operator<=> (const char *str) const noexcept |
| Content order against a C string. | |
Static Public Attributes | |
| static constexpr std::size_t | SSO_CAPACITY = 32 |
| Short-text capacity, excluding the trailing NUL. | |
Lookup | |
| static constexpr size_type | npos {~0ull} |
| Not found. | |
| bool | starts_with (std::string_view text) const noexcept |
Whether the text begins with text. | |
| bool | starts_with (char ch) const noexcept |
Whether the text begins with ch. | |
| bool | ends_with (std::string_view text) const noexcept |
Whether the text ends with text. | |
| bool | ends_with (char ch) const noexcept |
Whether the text ends with ch. | |
| bool | contains (std::string_view text) const noexcept |
Whether text occurs. | |
| bool | contains (char ch) const noexcept |
Whether ch occurs. | |
| Size | find (std::string_view text, Size pos={}) const noexcept |
First occurrence of text at or after pos. | |
| Size | find (char ch, Size pos={}) const noexcept |
First occurrence of ch at or after pos. | |
| Size | find (const char *text, Size pos, Size count) const noexcept |
First occurrence of count bytes of text. | |
| Size | rfind (std::string_view text, Size pos=npos) const noexcept |
Last occurrence of text at or before pos. | |
| Size | rfind (char ch, Size pos=npos) const noexcept |
Last occurrence of ch at or before pos. | |
| Size | rfind (const char *text, Size pos, Size count) const noexcept |
Last occurrence of count bytes of text. | |
| Size | find_first_of (std::string_view text, Size pos={}) const noexcept |
First byte that is in text, at or after pos. | |
| Size | find_first_of (char ch, Size pos={}) const noexcept |
First ch at or after pos. | |
| Size | find_last_of (std::string_view text, Size pos=npos) const noexcept |
Last byte that is in text, at or before pos. | |
| Size | find_last_of (char ch, Size pos=npos) const noexcept |
Last ch at or before pos. | |
| Size | find_first_not_of (std::string_view text, Size pos={}) const noexcept |
First byte that is not in text, at or after pos. | |
| Size | find_first_not_of (char ch, Size pos={}) const noexcept |
First byte other than ch, at or after pos. | |
| Size | find_last_not_of (std::string_view text, Size pos=npos) const noexcept |
Last byte that is not in text, at or before pos. | |
| Size | find_last_not_of (char ch, Size pos=npos) const noexcept |
Last byte other than ch, at or before pos. | |
| String | substr (Size pos={}, Size count=npos) const noexcept |
| Copy of a slice. | |
| int | compare (std::string_view text) const noexcept |
| Same order as std::string_view::compare. | |
| int | compare (size_type pos, size_type count, std::string_view text) const noexcept |
Compare a slice with text. | |
| char & | front () noexcept |
| First byte. | |
| char | front () const noexcept |
| Read the first byte. | |
| char & | back () noexcept |
| Last byte. | |
| char | back () const noexcept |
| Read the last byte. | |
Range | |
| iterator | begin () noexcept |
| First character. | |
| const_iterator | begin () const noexcept |
| First character. | |
| iterator | end () noexcept |
| One past the last character. | |
| const_iterator | end () const noexcept |
| One past the last character. | |
| const_iterator | cbegin () const noexcept |
| First character. | |
| const_iterator | cend () const noexcept |
| One past the last character. | |
| reverse_iterator | rbegin () noexcept |
| Reverse begin. | |
| const_reverse_iterator | rbegin () const noexcept |
| Reverse begin. | |
| reverse_iterator | rend () noexcept |
| Reverse end. | |
| const_reverse_iterator | rend () const noexcept |
| Reverse end. | |
| const_reverse_iterator | crbegin () const noexcept |
| Reverse begin. | |
| const_reverse_iterator | crend () const noexcept |
| Reverse end. | |
| char * | data () noexcept |
| Contiguous pointer to the first byte, or to the trailing NUL when empty. | |
| const char * | data () const noexcept |
| Read-only contiguous pointer to the first byte, or to the trailing NUL when empty. | |
| const char * | c_str () const noexcept |
| Same pointer as data. | |
| Size | size () const noexcept |
| Byte count, excluding the trailing NUL. | |
| Size | capacity () const noexcept |
| Allocated byte capacity, excluding the trailing NUL. | |
| Size | max_size () const noexcept |
| Largest representable byte count. | |
| Size | length () const noexcept |
| Same as Size. | |
| bool | empty () const noexcept |
| Whether Size is zero. | |
| String & | append (std::string_view text) |
| Append UTF-8 bytes. | |
| String & | append (size_type count, char character) |
| Append count copies of a byte. | |
| template<std::input_iterator InputIt> | |
| String & | append (InputIt first, InputIt last) |
| Append the byte range [first, last). | |
| template<std::ranges::input_range R> | |
| String & | append_range (R &&range) |
Append a copy of range. | |
| String & | assign (std::string_view text) |
| Replace the contents with a text view. | |
| String & | assign (size_type count, char character) |
| Replace the contents with count copies of a byte. | |
| template<std::input_iterator InputIt> | |
| String & | assign (InputIt first, InputIt last) |
| Replace the contents with [first, last). | |
| template<std::ranges::input_range R> | |
| String & | assign_range (R &&range) |
Replace the contents with a copy of range. | |
| String & | operator+= (std::string_view text) |
| Append a view. | |
| String & | operator+= (char character) |
| Append one byte. | |
| void | push_back (char character) |
| Append one byte. | |
| void | pop_back () |
| Remove the final byte. | |
| void | clear () |
| Replace the contents with an empty string, retaining long-path capacity. | |
| void | reserve (size_type new_capacity) |
Reserve storage for at least new_capacity UTF-8 bytes. | |
| void | shrink_to_fit () |
| Drop unused long-path capacity. | |
| void | resize (size_type count, char character=char{}) |
| Resize the byte sequence, filling new bytes with character. | |
| String & | insert (size_type position, std::string_view text) |
| Insert bytes at a byte position. | |
| String & | insert (size_type position, size_type count, char character) |
Insert count copies of character at position. | |
| template<std::input_iterator InputIt> | |
| iterator | insert (const_iterator pos, InputIt first, InputIt last) |
Insert [first, last) before pos. | |
| iterator | insert (const_iterator pos, std::initializer_list< char > values) |
Insert an initializer list before pos. | |
| template<std::ranges::input_range R> | |
| iterator | insert_range (const_iterator pos, R &&range) |
Insert a copy of range before pos. | |
| String & | erase (size_type position={}, size_type count=npos) |
| Erase bytes starting at position. | |
| iterator | erase (const_iterator pos) |
Erase the byte at pos. | |
| iterator | erase (const_iterator first, const_iterator last) |
| Erase [first, last). | |
| String & | replace (size_type position, size_type count, std::string_view text) |
| Replace a byte range with text. | |
| String & | replace (const_iterator first, const_iterator last, std::string_view text) |
Replace [first, last) with text. | |
| char & | operator[] (const Size &index) noexcept |
Character at index. | |
| char | operator[] (const Size &index) const noexcept |
Read-only character at index. | |
| char & | at (size_type index) |
Byte at index. | |
| const char & | at (size_type index) const |
Read-only byte at index. | |
| size_type | copy (char *dest, size_type count, size_type pos={}) const |
Copy at most count bytes into dest, starting at pos. | |
| operator bool () const noexcept | |
| Whether the text is non-empty. | |
| template<class... Args> requires (sizeof...(Args) >= 1) | |
| static String | ReplaceToken (std::string_view text, Args &&... args) |
Copy text with each field replaced, in order, by one argument. | |
Helpers | |
| String | ToLower () const |
| ASCII-letter lower case of this text. | |
| String | ToUpper () const |
| ASCII-letter upper case of this text. | |
| String | SanitizeNewlines () const |
| CR LF to LF on this text. | |
| String | RemoveWhitespace () const |
| Drops isspace bytes from this text. | |
| bool | IsInteger () const noexcept |
| Whether this text is an integer token. | |
| Vector< String > | Split () const |
| Whitespace-separated tokens of this text. | |
| Queue< String > | Explode (char delimiter) const |
Tokens of this text on delimiter, including empty ones. | |
| static String | ToLower (std::string_view str) |
| ASCII-letter lower case; UTF-8 otherwise copied. | |
| static String | ToUpper (std::string_view str) |
| ASCII-letter upper case; UTF-8 otherwise copied. | |
| static String | SanitizeNewlines (std::string_view str) |
| Turns CR LF into LF. | |
| static String | RemoveWhitespace (std::string_view str) |
| Drops isspace bytes. | |
| static bool | IsInteger (std::string_view str) noexcept |
| Optional sign plus ASCII digits. | |
| static Vector< String > | Split (std::string_view str) |
| Whitespace-separated tokens. | |
| static Vector< String > | Split (const std::vector< String > &parts) |
| Copy caller-owned tokens into Base storage. | |
| static Queue< String > | Explode (std::string_view str, char delimiter) |
Tokens on delimiter, including empty ones. | |
| static String | Implode (const Vector< String > &parts, std::string_view delimiter) |
Join parts with delimiter. | |
| static String | Implode (const Queue< String > &parts, std::string_view delimiter) |
Join parts with delimiter, in queue order. | |
Owned UTF-8 text.
Not a std::string. Up to 32 bytes live in the object, NUL-terminated, with an explicit size. Longer text is an SDS buffer freed in Base. There is no null state: a moved-from string is empty. data() and c_str() are never null.
Classic and ranges algorithms can read or modify existing bytes; they cannot change the owned size. operator std::string_view is implicit and inline. operator std::string is explicit and STORMBYTE_FORCE_INLINE (caller heap).
Conversion to WString is explicit and runs in the module (UTF-8 to wide). Conversion from WString copies UTF-8 in the module.
ToUpper / ToLower map only ASCII A–Z / a–z. Other well-formed UTF-8 code points are copied. Ill-formed bytes are copied one-by-one so a sequence is never split in the middle of a valid character.
Observers follow std::string_view. Size-changing modifiers follow std::string value semantics. capacity() and reserve(Size) count UTF-8 bytes excluding NUL; reserve never shrinks. size_type is Size. There is no allocator.
Text construction, copying, conversion and transformations may allocate and throw. Default construction, moves and observers do not allocate and remain noexcept.
| using StormByte::Safe::String::const_iterator = const char* |
Contiguous observer.
| using StormByte::Safe::String::const_pointer = const char* |
Read-only buffer pointer.
| using StormByte::Safe::String::const_reference = const char& |
Read-only character reference.
| using StormByte::Safe::String::const_reverse_iterator = std::reverse_iterator<const_iterator> |
Reverse observer.
| using StormByte::Safe::String::difference_type = std::ptrdiff_t |
Iterator distance type.
| using StormByte::Safe::String::iterator = char* |
Mutable contiguous iterator.
| using StormByte::Safe::String::pointer = char* |
Mutable buffer pointer.
| using StormByte::Safe::String::reference = char& |
Mutable character reference.
| using StormByte::Safe::String::reverse_iterator = std::reverse_iterator<iterator> |
Mutable reverse observer.
Byte count and position type.
| using StormByte::Safe::String::value_type = char |
Byte type.
|
noexcept |
Empty text.
Not null.
| StormByte::Safe::String::String | ( | const char * | str | ) |
Copies a C string.
A null pointer becomes empty.
| str | Source; may be null. |
| StormByte::Safe::String::String | ( | std::string_view | str | ) |
Copies a view into owned storage.
| str | Source. Embedded NUL counts. |
| StormByte::Safe::String::String | ( | size_type | count, |
| char | character ) |
Construct count copies of character.
| count | Byte count. |
| character | Fill byte. |
| AllocationError | The long path could not be allocated. |
Copy a slice of other.
| other | Source text. |
| pos | Start, in bytes. |
| count | Length. npos means through the end. |
| OutOfBoundsError | pos is past other.size(). |
| AllocationError | The long path could not be allocated. |
|
inline |
Copy the byte range [first, last).
| InputIt | Input iterator of bytes. |
| first | Start. |
| last | End. |
| AllocationError | The long path could not be allocated. |
|
explicit |
UTF-8 from wide text.
| other | Wide source. |
| StormByte::Safe::String::String | ( | const String & | other | ) |
Copy constructor.
| other | Text to copy. |
|
noexcept |
Move constructor.
| other | Text to take. other becomes empty. |
|
noexcept |
Releases a long SDS buffer.
A short string has nothing to free.
|
inline |
Append the byte range [first, last).
| InputIt | Input iterator of bytes. |
| first | Start. |
| last | End. |
| AllocationError | The long path could not be allocated. |
Append count copies of a byte.
| count | Number of copies. |
| character | Byte to append. |
| String & StormByte::Safe::String::append | ( | std::string_view | text | ) |
Append UTF-8 bytes.
| text | Text to append. |
|
inline |
Append a copy of range.
| R | Input range of bytes. |
| range | Source range. |
| AllocationError | The long path could not be allocated. |
|
inline |
Replace the contents with [first, last).
| InputIt | Input iterator of bytes. |
| first | Start. |
| last | End. |
| AllocationError | The long path could not be allocated. |
Replace the contents with count copies of a byte.
| count | Number of copies. |
| character | Byte to assign. |
| String & StormByte::Safe::String::assign | ( | std::string_view | text | ) |
Replace the contents with a text view.
| text | Source bytes. |
|
inline |
Replace the contents with a copy of range.
| R | Input range of bytes. |
| range | Source range. |
| AllocationError | The long path could not be allocated. |
| char & StormByte::Safe::String::at | ( | size_type | index | ) |
Byte at index.
| index | Byte offset. |
| OutOfBoundsError | index is not less than Size. |
| const char & StormByte::Safe::String::at | ( | size_type | index | ) | const |
Read-only byte at index.
| index | Byte offset. |
| OutOfBoundsError | index is not less than Size. |
|
inlinenoexcept |
Read the last byte.
|
inlinenoexcept |
Last byte.
|
inlinenoexcept |
First character.
|
inlinenoexcept |
First character.
|
inlinenoexcept |
Non-owning view of the owned bytes.
|
inlinenoexcept |
|
noexcept |
Allocated byte capacity, excluding the trailing NUL.
|
inlinenoexcept |
First character.
|
inlinenoexcept |
One past the last character.
| void StormByte::Safe::String::clear | ( | ) |
Replace the contents with an empty string, retaining long-path capacity.
|
inlinenoexcept |
Compare a slice with text.
| pos | Start, in bytes. |
| count | Slice length. |
| text | Other text. |
|
inlinenoexcept |
Same order as std::string_view::compare.
| text | Other text. |
|
inlinenoexcept |
Whether ch occurs.
| ch | Byte. |
|
inlinenoexcept |
Whether text occurs.
| text | Needle. |
Copy at most count bytes into dest, starting at pos.
| dest | Caller buffer. |
| count | Buffer capacity. |
| pos | Start, in bytes. |
| OutOfBoundsError | pos is past Size. |
|
inlinenoexcept |
Reverse begin.
|
inlinenoexcept |
Reverse end.
|
noexcept |
Read-only contiguous pointer to the first byte, or to the trailing NUL when empty.
|
noexcept |
Contiguous pointer to the first byte, or to the trailing NUL when empty.
|
inlinenoexcept |
Whether Size is zero.
|
inlinenoexcept |
One past the last character.
|
inlinenoexcept |
One past the last character.
|
inlinenoexcept |
Whether the text ends with ch.
| ch | Suffix byte. |
|
inlinenoexcept |
Whether the text ends with text.
| text | Suffix. |
| iterator StormByte::Safe::String::erase | ( | const_iterator | first, |
| const_iterator | last ) |
Erase [first, last).
| first | Start. |
| last | End. |
| OutOfBoundsError | The range is outside this string. |
| iterator StormByte::Safe::String::erase | ( | const_iterator | pos | ) |
Erase the byte at pos.
| pos | Byte to erase. |
| OutOfBoundsError | pos is outside this string. |
Erase bytes starting at position.
| position | First byte to erase. |
| count | Maximum bytes to erase. |
Tokens of this text on delimiter, including empty ones.
| delimiter | Separator. |
Tokens on delimiter, including empty ones.
Nodes are allocated in Base.
| str | Source. |
| delimiter | Separator. |
First occurrence of ch at or after pos.
| ch | Byte. |
| pos | Start, in bytes. |
First occurrence of count bytes of text.
| text | Needle. May be null when count is zero. |
| pos | Start, in bytes. |
| count | Bytes of text to use. |
First occurrence of text at or after pos.
| text | Needle. |
| pos | Start, in bytes. |
First byte other than ch, at or after pos.
| ch | Byte. |
| pos | Start, in bytes. |
Last byte other than ch, at or before pos.
| ch | Byte. |
| pos | Highest index. Default is the end. |
Last ch at or before pos.
| ch | Byte. |
| pos | Highest index. Default is the end. |
|
inlinenoexcept |
Read the first byte.
|
inlinenoexcept |
First byte.
|
static |
Join parts with delimiter, in queue order.
| parts | Tokens. Not modified. |
| delimiter | Separator inserted between tokens. Not copied. |
parts is empty.
|
static |
Join parts with delimiter.
Parts are not copied before the result is built.
| parts | Tokens. Not modified. |
| delimiter | Separator inserted between tokens. Not copied. Empty joins them directly. |
parts is empty. A short result stays in SSO.
|
inline |
Insert [first, last) before pos.
| InputIt | Input iterator of bytes. |
| pos | Insertion point. |
| first | Start. |
| last | End. |
pos when the range is empty. | OutOfBoundsError | pos is outside this string. |
| AllocationError | The long path could not be allocated. |
| iterator StormByte::Safe::String::insert | ( | const_iterator | pos, |
| std::initializer_list< char > | values ) |
Insert an initializer list before pos.
| pos | Insertion point. |
| values | Bytes to insert. |
| OutOfBoundsError | pos is outside this string. |
| AllocationError | The long path could not be allocated. |
Insert count copies of character at position.
| position | Insertion position. |
| count | Copy count. |
| character | Fill byte. |
| OutOfBoundsError | position is past Size. |
| AllocationError | The long path could not be allocated. |
Insert bytes at a byte position.
| position | Insertion position. |
| text | Bytes to insert. |
|
inline |
Insert a copy of range before pos.
| R | Input range of bytes. |
| pos | Insertion point. |
| range | Source range. |
| OutOfBoundsError | pos is outside this string. |
| AllocationError | The long path could not be allocated. |
|
inlinenoexcept |
Whether this text is an integer token.
|
staticnoexcept |
|
inlinenoexcept |
Same as Size.
|
noexcept |
Largest representable byte count.
|
inlineexplicitnoexcept |
Whether the text is non-empty.
|
inlineexplicitnoexcept |
|
inlineexplicit |
Copy of the text in the caller’s heap.
|
inlinenoexcept |
Non-owning view of the text.
|
explicit |
Wide text (UTF-8 decoded in the module).
|
inlinenoexcept |
Content inequality with a C string.
| str | May be null. |
|
inlinenoexcept |
Content inequality.
| other | Other text. |
| String & StormByte::Safe::String::operator+= | ( | char | character | ) |
Append one byte.
| character | Byte to append. |
| String & StormByte::Safe::String::operator+= | ( | std::string_view | text | ) |
|
inlinenoexcept |
Content order against a C string.
A null pointer compares as empty.
| str | May be null. |
|
inlinenoexcept |
Content order.
| other | Other text. |
Copy assignment.
| other | Text to copy. |
| String & StormByte::Safe::String::operator= | ( | std::string_view | text | ) |
Copy text from a caller-owned view.
| text | Source bytes. |
Move assignment.
| other | Text to take. other becomes empty. |
|
inlinenoexcept |
Content equality with a C string.
A null pointer compares equal to empty.
| str | May be null. |
|
inlinenoexcept |
Content equality.
| other | Other text. |
|
inlinenoexcept |
|
inlinenoexcept |
| void StormByte::Safe::String::pop_back | ( | ) |
Remove the final byte.
Empty use follows std::string preconditions.
| void StormByte::Safe::String::push_back | ( | char | character | ) |
Append one byte.
| character | Byte to append. |
|
inlinenoexcept |
Reverse begin.
|
inlinenoexcept |
Reverse begin.
|
inline |
Drops isspace bytes from this text.
|
static |
Drops isspace bytes.
| str | Source. |
|
inlinenoexcept |
Reverse end.
|
inlinenoexcept |
Reverse end.
| String & StormByte::Safe::String::replace | ( | const_iterator | first, |
| const_iterator | last, | ||
| std::string_view | text ) |
Replace [first, last) with text.
| first | Start. |
| last | End. |
| text | Replacement. |
| OutOfBoundsError | The range is outside this string. |
| AllocationError | The long path could not be allocated. |
| String & StormByte::Safe::String::replace | ( | size_type | position, |
| size_type | count, | ||
| std::string_view | text ) |
Replace a byte range with text.
| position | First byte to replace. |
| count | Maximum bytes to erase. |
| text | Replacement bytes. |
|
inlinestatic |
Copy text with each field replaced, in order, by one argument.
| Args | Text, a bool, a number, a pointer, or a type that converts to std::string. A view is not copied. A bool is true or false. A char* is text. Any other raw pointer is its address (0x and hex). Safe::Unique and Safe::Shared print the address of the object they hold, or 0x0 when empty. Size and ByteSize use their text conversion for {} (digits, or the IEC length) and their integer count for a numeric field. A number with a bare {} uses std::to_string. A field may be {:[0][width][.precision][type]} with type d, f, g, G, x or X. |
| text | Pattern. A long pattern is not stored; only the result is owned. |
| args | Replacements. At least one. Extra arguments are ignored. A leftover field stays. A brace run that is not a supported field stays literal and does not consume an argument. |
text. | AllocationError | The result could not be allocated. |
| void StormByte::Safe::String::reserve | ( | size_type | new_capacity | ) |
Reserve storage for at least new_capacity UTF-8 bytes.
| new_capacity | Requested byte capacity, excluding the NUL. |
| OutOfBoundsError | The request cannot be represented, including a trailing NUL. |
| AllocationError | The size is representable but the SDS allocation failed. |
| void StormByte::Safe::String::resize | ( | size_type | count, |
| char | character = char{} ) |
Resize the byte sequence, filling new bytes with character.
| count | New byte count. |
| character | Fill byte, default initialized to NUL. |
Last occurrence of ch at or before pos.
| ch | Byte. |
| pos | Highest start, in bytes. Default is the end. |
|
inlinenoexcept |
Last occurrence of count bytes of text.
| text | Needle. May be null when count is zero. |
| pos | Highest start, in bytes. |
| count | Bytes of text to use. |
Last occurrence of text at or before pos.
| text | Needle. |
| pos | Highest start, in bytes. Default is the end. |
|
inline |
CR LF to LF on this text.
|
static |
Turns CR LF into LF.
| str | Source. |
| void StormByte::Safe::String::shrink_to_fit | ( | ) |
Drop unused long-path capacity.
A short string is unchanged.
|
noexcept |
Byte count, excluding the trailing NUL.
Whitespace-separated tokens of this text.
Copy caller-owned tokens into Base storage.
| parts | Source. Not modified. |
Whitespace-separated tokens.
Nodes are allocated in Base.
| str | Source. |
|
inlinenoexcept |
Whether the text begins with ch.
| ch | Prefix byte. |
|
inlinenoexcept |
Whether the text begins with text.
| text | Prefix. |
|
noexcept |
Swaps storage with other.
| other | Other text. |
|
inline |
ASCII-letter lower case of this text.
|
static |
ASCII-letter lower case; UTF-8 otherwise copied.
| str | Source. |
|
inline |
ASCII-letter upper case of this text.
|
static |
ASCII-letter upper case; UTF-8 otherwise copied.
| str | Source. |
|
staticconstexpr |
Not found.
|
staticconstexpr |
Short-text capacity, excluding the trailing NUL.