xentara-utils v2.0.4
The Xentara Utility Library
|
The name of a member of a JSON object. More...
#include <xentara/utils/json/decoder/Name.hpp>
Public Types | |
Standard library compliant type aliases | |
using | traits_type = std::string::traits_type |
The char traits. | |
using | value_type = std::string::value_type |
The character type. | |
using | pointer = std::string::pointer |
A pointer to a character. | |
using | const_pointer = std::string::const_pointer |
A const pointer to a character. | |
using | reference = std::string::reference |
A reference to a character. | |
using | const_reference = std::string::const_reference |
A const reference to a character. | |
using | const_iterator = std::string::const_iterator |
A const iterator. | |
using | iterator = const_iterator |
Same as a const iterator. | |
using | const_reverse_iterator = std::string::const_reverse_iterator |
A const reverse iterator. | |
using | reverse_iterator = const_reverse_iterator |
Same as a const reverse iterator. | |
using | size_type = std::string::size_type |
The size type. | |
using | difference_type = std::string::difference_type |
The difference type. | |
Public Member Functions | |
Construction | |
Name ()=default | |
Default constructor. | |
conversion operators | |
operator std::string_view () const | |
Conversion to an std::string_view. | |
operator const std::string & () const & | |
Conversion to an std::string reference. | |
operator std::string && () && | |
Conversion to an std::string rvalue reference. | |
Iterators | |
auto | begin () const -> const_iterator |
Gets the begin iterator. | |
auto | cbegin () const -> const_iterator |
Gets the begin iterator. | |
auto | end () const -> const_iterator |
Gets the end iterator. | |
auto | cend () const -> const_iterator |
Gets the end iterator. | |
auto | rbegin () const -> const_reverse_iterator |
Gets the reverse begin iterator. | |
auto | crbegin () const -> const_reverse_iterator |
Gets the reverse begin iterator. | |
auto | rend () const -> const_reverse_iterator |
Gets the reverse end iterator. | |
auto | crend () const -> const_reverse_iterator |
Gets the reverse end iterator. | |
Element Access | |
auto | at (size_type position) const -> const_reference |
Gets the element at a certain position. | |
auto | operator[] (size_type position) const -> const_reference |
Gets the element at a certain position without bounds checking. | |
auto | front () const noexcept -> const_reference |
Gets the first element. | |
auto | back () const noexcept -> const_reference |
Gets the last element. | |
auto | data () const noexcept -> const_pointer |
Gets the data. | |
auto | c_str () const noexcept -> const char * |
Gets the name as a null terminated string. | |
Size | |
auto | size () const noexcept -> size_type |
Gets the size of the name. | |
auto | length () const noexcept -> size_type |
Gets the length of the name, which is the same as the size. | |
auto | empty () const noexcept -> bool |
Determines if the name is empty. | |
Operations | |
auto | copy (char *destination, size_type count, size_type position=0) const -> size_type |
Equivalent to std::string_view::copy() | |
auto | substr (size_type position=0, size_type count=std::string::npos) const -> std::string_view |
Returns a substring. | |
auto | compare (std::string_view string) const noexcept -> int |
Compares the name to a string view. | |
auto | compare (size_type thisPosition, size_type thisCount, std::string_view string) const -> int |
Compares part of the name to a string view. | |
auto | compare (size_type thisPosition, size_type thisCount, std::string_view string, size_type thatPosition, size_type thatCount) const -> int |
Compares part of the name to part of a string view. | |
auto | compare (const char *string) const -> int |
Compares the name to a null terminated string. | |
auto | compare (size_type thisPosition, size_type thisCount, const char *string) const -> int |
Compares part of the name to a null terminated string. | |
auto | compare (size_type thisPosition, size_type thisCount, const char *string, size_type stringSize) const -> int |
Compares part of the name to a string. | |
auto | starts_with (std::string_view prefix) const noexcept -> bool |
Determines whether the name starts with a certain prefix. | |
auto | starts_with (char character) const noexcept -> bool |
Determines whether the name starts with a certain character. | |
auto | starts_with (const char *prefix) const -> bool |
Determines whether the name starts with a certain prefix. | |
auto | ends_with (std::string_view suffix) const noexcept -> bool |
Determines whether the name ends with a certain suffix. | |
auto | ends_with (char character) const noexcept -> bool |
Determines whether the name ends with a certain character. | |
auto | ends_with (const char *suffix) const -> bool |
Determines whether the name ends with a certain suffix. | |
auto | find (std::string_view string, size_type position=0) const noexcept -> size_type |
Searches for a sub string. | |
auto | find (char character, size_type position=0) const noexcept -> size_type |
Searches for a character. | |
auto | find (const char *string, size_type position, size_type stringSize) const -> size_type |
Searches for a sub string. | |
auto | find (const char *string, size_type position=0) const -> size_type |
Searches for a sub string. | |
auto | rfind (std::string_view string, size_type position=npos) const noexcept -> size_type |
Searches for the last occurrence of a sub string. | |
auto | rfind (char character, size_type position=npos) const noexcept -> size_type |
Searches for the last occurrence of a character. | |
auto | rfind (const char *string, size_type position, size_type stringSize) const -> size_type |
Searches for the last occurrence of a sub string. | |
auto | rfind (const char *string, size_type position=npos) const -> size_type |
Searches for the last occurrence of a sub string. | |
auto | find_first_of (std::string_view string, size_type position=0) const noexcept -> size_type |
Searches for the first character matching any character in a string view. | |
auto | find_first_of (char character, size_type position=0) const noexcept -> size_type |
Searches for the first occurrence of a character. | |
auto | find_first_of (const char *characters, size_type position, size_type characterCount) const -> size_type |
Searches for the first character matching any character in a character array. | |
auto | find_first_of (const char *string, size_type position=0) const -> size_type |
Searches for the first character matching any character in a null terminated string. | |
auto | find_last_of (std::string_view string, size_type position=npos) const noexcept -> size_type |
Searches for the last character matching any character in a string view. | |
auto | find_last_of (char character, size_type position=npos) const noexcept -> size_type |
Searches for the last occurrence of a character. | |
auto | find_last_of (const char *characters, size_type position, size_type characterCount) const -> size_type |
Searches for the last character matching any character in a character array. | |
auto | find_last_of (const char *string, size_type position=npos) const -> size_type |
Searches for the last character matching any character in a null terminated string. | |
auto | find_first_not_of (std::string_view string, size_type position=0) const noexcept -> size_type |
Searches for the first character not matching any character in a string view. | |
auto | find_first_not_of (char character, size_type position=0) const noexcept -> size_type |
Searches for the first character not matching a character. | |
auto | find_first_not_of (const char *characters, size_type position, size_type characterCount) const -> size_type |
Searches for the last character not matching any character in a character array. | |
auto | find_first_not_of (const char *string, size_type position=0) const -> size_type |
Searches for the last character not matching any character in a null terminated string. | |
auto | find_last_not_of (std::string_view string, size_type position=npos) const noexcept -> size_type |
Searches for the last character not matching any character in a string view. | |
auto | find_last_not_of (char character, size_type position=npos) const noexcept -> size_type |
Searches for the last character not matching a character. | |
auto | find_last_not_of (const char *characters, size_type position, size_type characterCount) const -> size_type |
Searches for the last character not matching any character in a character array. | |
auto | find_last_not_of (const char *string, size_type position=npos) const -> size_type |
Searches for the last character not matching any character in a null terminated string. | |
Access to the Location | |
auto | document () const -> const Document * |
Gets the JSON document that the member belongs to. | |
auto | lineNumber () const -> std::uint_least32_t |
Gets the line number in the JSON document that the member name is on. | |
auto | location () const -> Location |
Gets the location of the member name within its JSON document. | |
Explicit access to the contents | |
auto | view () const -> std::string_view |
Conversion to an std::string_view. | |
auto | str () const &-> const std::string & |
Conversion to an std::string reference. | |
auto | str () &&-> std::string && |
Conversion to an std::string rvalue reference. | |
Static Public Attributes | |
static const size_type | npos |
Non-existent string position. | |
The name of a member of a JSON object.
using xentara::utils::json::decoder::Name::const_iterator = std::string::const_iterator |
A const iterator.
using xentara::utils::json::decoder::Name::const_pointer = std::string::const_pointer |
A const pointer to a character.
using xentara::utils::json::decoder::Name::const_reference = std::string::const_reference |
A const reference to a character.
using xentara::utils::json::decoder::Name::const_reverse_iterator = std::string::const_reverse_iterator |
A const reverse iterator.
using xentara::utils::json::decoder::Name::difference_type = std::string::difference_type |
The difference type.
Same as a const iterator.
using xentara::utils::json::decoder::Name::pointer = std::string::pointer |
A pointer to a character.
using xentara::utils::json::decoder::Name::reference = std::string::reference |
A reference to a character.
Same as a const reverse iterator.
using xentara::utils::json::decoder::Name::size_type = std::string::size_type |
The size type.
using xentara::utils::json::decoder::Name::traits_type = std::string::traits_type |
The char traits.
using xentara::utils::json::decoder::Name::value_type = std::string::value_type |
The character type.
|
default |
Default constructor.
This constructor creates an empty name without a location
auto xentara::utils::json::decoder::Name::at | ( | size_type | position | ) | const -> const_reference |
Gets the element at a certain position.
|
noexcept |
Gets the last element.
auto xentara::utils::json::decoder::Name::begin | ( | ) | const -> const_iterator |
Gets the begin iterator.
|
noexcept |
Gets the name as a null terminated string.
auto xentara::utils::json::decoder::Name::cbegin | ( | ) | const -> const_iterator |
Gets the begin iterator.
auto xentara::utils::json::decoder::Name::cend | ( | ) | const -> const_iterator |
Gets the end iterator.
auto xentara::utils::json::decoder::Name::compare | ( | const char * | string | ) | const -> int |
Compares the name to a null terminated string.
auto xentara::utils::json::decoder::Name::compare | ( | size_type | thisPosition, |
size_type | thisCount, | ||
const char * | string | ||
) | const -> int |
Compares part of the name to a null terminated string.
auto xentara::utils::json::decoder::Name::compare | ( | size_type | thisPosition, |
size_type | thisCount, | ||
const char * | string, | ||
size_type | stringSize | ||
) | const -> int |
Compares part of the name to a string.
auto xentara::utils::json::decoder::Name::compare | ( | size_type | thisPosition, |
size_type | thisCount, | ||
std::string_view | string | ||
) | const -> int |
Compares part of the name to a string view.
auto xentara::utils::json::decoder::Name::compare | ( | size_type | thisPosition, |
size_type | thisCount, | ||
std::string_view | string, | ||
size_type | thatPosition, | ||
size_type | thatCount | ||
) | const -> int |
Compares part of the name to part of a string view.
|
noexcept |
Compares the name to a string view.
auto xentara::utils::json::decoder::Name::copy | ( | char * | destination, |
size_type | count, | ||
size_type | position = 0 |
||
) | const -> size_type |
Equivalent to std::string_view::copy()
auto xentara::utils::json::decoder::Name::crbegin | ( | ) | const -> const_reverse_iterator |
Gets the reverse begin iterator.
auto xentara::utils::json::decoder::Name::crend | ( | ) | const -> const_reverse_iterator |
Gets the reverse end iterator.
|
noexcept |
Gets the data.
auto xentara::utils::json::decoder::Name::document | ( | ) | const -> const Document * |
Gets the JSON document that the member belongs to.
|
noexcept |
Determines if the name is empty.
auto xentara::utils::json::decoder::Name::end | ( | ) | const -> const_iterator |
Gets the end iterator.
|
noexcept |
Determines whether the name ends with a certain character.
auto xentara::utils::json::decoder::Name::ends_with | ( | const char * | suffix | ) | const -> bool |
Determines whether the name ends with a certain suffix.
|
noexcept |
Determines whether the name ends with a certain suffix.
|
noexcept |
Searches for a character.
auto xentara::utils::json::decoder::Name::find | ( | const char * | string, |
size_type | position, | ||
size_type | stringSize | ||
) | const -> size_type |
Searches for a sub string.
auto xentara::utils::json::decoder::Name::find | ( | const char * | string, |
size_type | position = 0 |
||
) | const -> size_type |
Searches for a sub string.
|
noexcept |
Searches for a sub string.
|
noexcept |
Searches for the first character not matching a character.
auto xentara::utils::json::decoder::Name::find_first_not_of | ( | const char * | characters, |
size_type | position, | ||
size_type | characterCount | ||
) | const -> size_type |
Searches for the last character not matching any character in a character array.
auto xentara::utils::json::decoder::Name::find_first_not_of | ( | const char * | string, |
size_type | position = 0 |
||
) | const -> size_type |
Searches for the last character not matching any character in a null terminated string.
|
noexcept |
Searches for the first character not matching any character in a string view.
|
noexcept |
Searches for the first occurrence of a character.
auto xentara::utils::json::decoder::Name::find_first_of | ( | const char * | characters, |
size_type | position, | ||
size_type | characterCount | ||
) | const -> size_type |
Searches for the first character matching any character in a character array.
auto xentara::utils::json::decoder::Name::find_first_of | ( | const char * | string, |
size_type | position = 0 |
||
) | const -> size_type |
Searches for the first character matching any character in a null terminated string.
|
noexcept |
Searches for the first character matching any character in a string view.
|
noexcept |
Searches for the last character not matching a character.
auto xentara::utils::json::decoder::Name::find_last_not_of | ( | const char * | characters, |
size_type | position, | ||
size_type | characterCount | ||
) | const -> size_type |
Searches for the last character not matching any character in a character array.
auto xentara::utils::json::decoder::Name::find_last_not_of | ( | const char * | string, |
size_type | position = npos |
||
) | const -> size_type |
Searches for the last character not matching any character in a null terminated string.
|
noexcept |
Searches for the last character not matching any character in a string view.
|
noexcept |
Searches for the last occurrence of a character.
auto xentara::utils::json::decoder::Name::find_last_of | ( | const char * | characters, |
size_type | position, | ||
size_type | characterCount | ||
) | const -> size_type |
Searches for the last character matching any character in a character array.
auto xentara::utils::json::decoder::Name::find_last_of | ( | const char * | string, |
size_type | position = npos |
||
) | const -> size_type |
Searches for the last character matching any character in a null terminated string.
|
noexcept |
Searches for the last character matching any character in a string view.
|
noexcept |
Gets the first element.
|
noexcept |
Gets the length of the name, which is the same as the size.
auto xentara::utils::json::decoder::Name::lineNumber | ( | ) | const -> std::uint_least32_t |
Gets the line number in the JSON document that the member name is on.
auto xentara::utils::json::decoder::Name::location | ( | ) | const -> Location |
Gets the location of the member name within its JSON document.
xentara::utils::json::decoder::Name::operator const std::string & | ( | ) | const & |
Conversion to an std::string reference.
xentara::utils::json::decoder::Name::operator std::string && | ( | ) | && |
Conversion to an std::string rvalue reference.
xentara::utils::json::decoder::Name::operator std::string_view | ( | ) | const |
Conversion to an std::string_view.
auto xentara::utils::json::decoder::Name::operator[] | ( | size_type | position | ) | const -> const_reference |
Gets the element at a certain position without bounds checking.
auto xentara::utils::json::decoder::Name::rbegin | ( | ) | const -> const_reverse_iterator |
Gets the reverse begin iterator.
auto xentara::utils::json::decoder::Name::rend | ( | ) | const -> const_reverse_iterator |
Gets the reverse end iterator.
|
noexcept |
Searches for the last occurrence of a character.
auto xentara::utils::json::decoder::Name::rfind | ( | const char * | string, |
size_type | position, | ||
size_type | stringSize | ||
) | const -> size_type |
Searches for the last occurrence of a sub string.
auto xentara::utils::json::decoder::Name::rfind | ( | const char * | string, |
size_type | position = npos |
||
) | const -> size_type |
Searches for the last occurrence of a sub string.
|
noexcept |
Searches for the last occurrence of a sub string.
|
noexcept |
Gets the size of the name.
|
noexcept |
Determines whether the name starts with a certain character.
auto xentara::utils::json::decoder::Name::starts_with | ( | const char * | prefix | ) | const -> bool |
Determines whether the name starts with a certain prefix.
|
noexcept |
Determines whether the name starts with a certain prefix.
auto xentara::utils::json::decoder::Name::str | ( | ) | && -> std::string && |
Conversion to an std::string rvalue reference.
auto xentara::utils::json::decoder::Name::str | ( | ) | const & -> const std::string & |
Conversion to an std::string reference.
auto xentara::utils::json::decoder::Name::substr | ( | size_type | position = 0 , |
size_type | count = std::string::npos |
||
) | const -> std::string_view |
Returns a substring.
auto xentara::utils::json::decoder::Name::view | ( | ) | const -> std::string_view |
Conversion to an std::string_view.
|
static |
Non-existent string position.