string
The native type of string values.
Synopsis
Defined in header <boost/json/string.hpp>.
class string;
Types
Name | Description |
---|---|
Associated Allocator |
|
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. |
Member Functions
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 allocator. |
|
Increase size without changing capacity. |
|
Insert a string. |
|
Convert to a |
|
Convert to a |
|
Append characters from a string. |
|
Copy assignment. |
|
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. |
|
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 memory resource. |
|
|
Default constructor. |
Return a view. |
|
Swap the contents. |
|
Return a character with bounds checking. |
|
|
Destructor. |
Static Member Functions
Name | Description |
---|---|
Return the maximum number of characters any string can hold. |
Static Members
Name | Description |
---|---|
A special index. |
Friends
Name | Description |
---|---|
Serialize |
|
Exchange the given values. |
Description
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.
|
Thread Safety
Non-const member functions may not be called concurrently with any other member functions.
Satisfies
Convenience header <boost/json.hpp>.