...one of the most highly
regarded and expertly designed C++ library projects in the
world.
— Herb Sutter and Andrei
Alexandrescu, C++
Coding Standards
The native type of string values.
Defined in header <boost/json/string.hpp>
class string
Name |
Description |
---|---|
The type of Allocator returned by |
|
A random access const iterator to an element. |
|
A const pointer to an element. |
|
A const reference to an element. |
|
A reverse random access const iterator to an element. |
|
The type used to represent signed integers. |
|
A random access iterator to an element. |
|
A pointer to an element. |
|
A reference to an element. |
|
A reverse random access iterator to an element. |
|
The type used to represent unsigned integers. |
|
The type of a character. |
Name |
Description |
---|---|
Append characters to the string. |
|
Assign characters to a string. |
|
Return a character with bounds checking. |
|
Return the last character. |
|
Return an iterator to the beginning. |
|
Return the underlying character array directly. |
|
Return the number of characters that can be held without a reallocation. |
|
Return an iterator to the beginning. |
|
Return an iterator to the end. |
|
Clear the contents. |
|
Compare a string with the string. |
|
Copy a substring to another string. |
|
Return a reverse iterator to the first character of the reversed container. |
|
Return a reverse iterator to the character following the last character of the reversed container. |
|
Return the underlying character array directly. |
|
Check if the string has no characters. |
|
Return an iterator to the end. |
|
Return whether the string end with a string. |
|
Erase characters from the string. |
|
Find the first occurrence of a string within the string. |
|
Find the first occurrence of any of the characters not within the
string. |
|
Find the first occurrence of any of the characters within the string. |
|
Find the last occurrence of a character not within the string.
|
|
Find the last occurrence of any of the characters within the string. |
|
Return the first character. |
|
Return the associated |
|
Increase size without changing capacity. |
|
Insert a string. |
|
Copy assignment. |
|
Return a character without bounds checking. |
|
Append characters from a string. |
|
Convert to a |
|
Convert to a |
|
Remove the last character. |
|
Append a character. |
|
Return a reverse iterator to the first character of the reversed container. |
|
Return a reverse iterator to the character following the last character of the reversed container. |
|
Replace a substring with a string. |
|
Increase the capacity to at least a certain amount. |
|
Change the size of the string. |
|
Find the last occurrence of a string within the string. |
|
Request the removal of unused capacity. |
|
Return the number of characters in the string. |
|
Return whether the string begins with a string. |
|
Return the associated |
|
string [constructor] |
Default constructor. |
Return a view. |
|
Swap the contents. |
|
~string [destructor] |
Destructor. |
Name |
Description |
---|---|
Return a character with bounds checking. |
|
Return the maximum number of characters any string can hold. |
Name |
Description |
---|---|
Serialize |
|
Exchange the given values. |
Instances of string store and manipulate sequences of char
using the UTF-8 encoding. The elements of a string are stored contiguously.
A pointer to any character in a string may be passed to functions that expect
a pointer to the first element of a null-terminated char
array. The type uses small buffer optimisation to avoid allocations for small
strings. String iterators are regular char
pointers.
string
member functions do
not validate any UTF-8 byte sequences passed to them.
Non-const member functions may not be called concurrently with any other member functions.
ContiguousContainer, ReversibleContainer, and SequenceContainer.
Convenience header <boost/json.hpp>