This is the basic_string replacement. For conformity, basic_fbstring takes the same template parameters, plus the last one which is the core.
Synopsis
Declared in <folly/FBString.h>
template<
typename E,
class T = std::char_traits<E>,
class A = std::allocator<E>,
class Storage = fbstring_core<E>>
class basic_fbstring;
Type Aliases
Name |
Description |
Marks the string as trivially relocatable. |
|
The allocator type. |
|
A const random‐access iterator over the characters. |
|
A const pointer to a character. |
|
A const reference to a character. |
|
A const reverse iterator over the characters. |
|
The signed integer type used for differences between iterators. |
|
A random‐access iterator over the characters. |
|
A pointer to a character. |
|
A reference to a character. |
|
A reverse iterator over the characters. |
|
The unsigned integer type used for sizes and indices. |
|
The character traits type. |
|
The character type stored in the string. |
Member Functions
Name |
Description |
|
Constructors |
|
Destroys the string, releasing any allocated storage. |
Assignment operators |
|
|
|
|
|
Returns a reference to the character at a given position, bounds‐checked. |
|
Returns a reference to the last character. |
|
|
|
Returns a pointer to a null‐terminated version of the string. |
|
Returns the number of characters the string can hold without reallocation. |
|
Returns a const iterator to the first character. |
|
Returns a const iterator past the last character. |
|
Removes all characters, leaving an empty string. |
|
|
|
Copies up to |
|
Returns a const reverse iterator to the last character. |
|
Returns a const reverse iterator past the first character. |
|
|
|
Returns whether the string contains no characters. |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Returns a reference to the first character. |
|
Returns the allocator associated with the string. |
|
|
|
Returns whether the string uses reference‐counted storage. |
|
Returns the number of characters in the string. |
|
Returns the maximum number of characters the string can hold. |
|
Addition assignment operators |
|
Returns a reference to the character at a given position. |
|
Removes the last character from the string. |
|
Appends a single character. |
|
|
|
|
|
|
|
Ensures capacity for at least |
|
Resizes the string to contain |
|
|
|
Reduces capacity to fit the current size where worthwhile. |
|
Returns the number of characters in the string. |
|
|
|
Swaps the contents of this string with another. |
|
Converts the string to a |
|
Returns the reference count of this string's underlying data. |
|
Converts the string to a string view. |
Static Data Members
Name |
Description |
Sentinel value indicating "not found" or "until the end". |
Friends
Name |
Description |
Three‐way compares a string with a |
|
Three‐way compares a string with a null‐terminated array. |
|
Three‐way compares two strings. |
|
Reads characters from a stream into a string until a newline. |
|
Reads characters from a stream into a string until a delimiter. |
Non-Member Functions
Name |
Description |
Compares an fbstring and a |
|
Inequality comparison against |
|
Compares two strings for inequality. |
|
Compares a string and a null‐terminated array for inequality. |
|
Concatenates a single character and a string. |
|
Concatenates a single character and a string, reusing its storage. |
|
Concatenates a null‐terminated array and a string, reusing its storage. |
|
Concatenates a string and a single character. |
|
Concatenates two strings, reusing the right operand's storage. |
|
Concatenates two strings. |
|
Concatenates a string and a null‐terminated array. |
|
Concatenates two strings, reusing either operand's storage. |
|
Concatenates a string and a single character, reusing its storage. |
|
Concatenates two strings, reusing the left operand's storage. |
|
Concatenates a string and a null‐terminated array, reusing its storage. |
|
Concatenates a null‐terminated array and a string. |
|
Orders an fbstring before a |
|
Orders an fbstring at or before a |
|
Three‐way comparison against |
|
Compares a string and a null‐terminated array for equality. |
|
Equality comparison against |
|
Compares two strings for equality. |
|
Compares an fbstring and a |
|
Orders an fbstring after a |
|
Orders an fbstring at or after a |
|
Swaps the contents of two strings. |
Created with MrDocs