...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. Append a string to the string. Append a range of characters. |
|
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. Return whether the string ends with a character. |
|
Erase characters from the string. Erase a character from the string. Erase a range from the string. |
|
Find the first occurrence of a string within the string. Find the first occurrence of a character within the string. |
|
Find the first occurrence of any of the characters not within the string.
Find the first occurrence of a character not equal to |
|
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 a character not equal to |
|
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. Insert a character. Insert a range of characters. |
|
Convert to a |
|
Append characters from a string. Append a character. |
|
Copy assignment. Move assignment. Assign a value to the string. |
|
Return a character without bounds checking. |
|
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. Replace a range with a string. Replace a range with a range. Replace a substring with copies of a character. Replace a range with copies of a character. |
|
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. Find the last occurrence of a character 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 whether the string begins with a character. |
|
Return the associated |
|
Default constructor. Pilfer constructor. Constructor. Copy constructor. Move constructor. |
|
Return a substring. |
|
Swap the contents. |
|
Destructor. |
Name |
Description |
---|---|
Return the maximum number of characters any string can hold. |
Name |
Description |
---|---|
A special index. |
Name |
Description |
---|---|
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. 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>