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 number of characters that can be held in currently allocated memory. |
|
Return a const iterator to the first element. |
|
Return a const iterator past the last element. |
|
Clear the contents. |
|
Compare a string with the string. |
|
Copy a substring to another string. |
|
Return a const reverse iterator to the first element of the reversed container. |
|
Return a const 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. |
|
Check if the string ends with given suffix. |
|
Remove characters from the string. |
|
Find the first occurrence of characters within the string. |
|
Find the first character missing from the specified string. |
|
Find the first character present in the specified string. |
|
Find the last character missing from the specified string. |
|
Find the last character present in the specified string. |
|
Return the first character. |
|
Return the associated allocator. |
|
Increase size without changing capacity. |
|
Insert characters at the specified index. |
|
Convert to |
|
Convert to a |
|
Append characters to the string. |
|
Assignment operators. |
|
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 another 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 another string. |
|
Return the associated memory resource. |
|
|
Constructors. |
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 Data Members
Name | Description |
---|---|
A special index. |
Friends
Name | Description |
---|---|
Serialize a |
|
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>.