![]() |
ToyGine2 26.2.0
Game Engine for retro consoles
|
Non-owning string view class for C-style strings. More...
Public Member Functions | |
| constexpr | CStringView () noexcept |
| Default constructor. | |
| constexpr | CStringView (const CStringView &string) noexcept=default |
| Constructs a copy of string view. | |
| constexpr | explicit (false) CStringView(const char *string) noexcept |
| Constructs a string view from a C string. | |
| constexpr | ~CStringView () noexcept=default |
| Destructor for the string view. | |
| constexpr CStringView & | operator= (const CStringView &string) noexcept=default |
| Copy assigns other string view to this string view. | |
| constexpr CStringView & | operator= (const char *string) noexcept |
| Copy assigns the C string to this string view. | |
| constexpr CStringView & | assign (const CStringView &string) noexcept |
| Copy assigns other string view to this string view. | |
| constexpr CStringView & | assign (const char *string) noexcept |
| Copy assigns the C string to this string view. | |
| constexpr const char & | at (size_t offset) const noexcept |
| Access a character in the string view at a given offset. | |
| constexpr const char & | operator[] (size_t offset) const noexcept |
| Access a character in the string view at a given offset. | |
| constexpr const char & | front () const noexcept |
| Returns a const reference to the first character of the string view. | |
| constexpr const char & | back () const noexcept |
| Returns a const reference to the last character of the string view. | |
| constexpr const char * | data () const noexcept |
| Returns a constant pointer to the data of the string view. | |
| constexpr const char * | c_str () const noexcept |
| Returns a constant pointer to the C string representation of this string view. | |
| constexpr bool | empty () const noexcept |
| Checks if the string view is empty. | |
| constexpr size_t | size () const noexcept |
| Returns the size of the string view. | |
| size_t | utf8_size () const noexcept |
| Returns the size of the Unicode string in UTF-8 encoding. | |
| constexpr size_t | length () const noexcept |
| Returns the size of the string view. | |
| constexpr size_t | max_size () const noexcept |
| Returns the maximum observable size of this string view. | |
| constexpr size_t | capacity () const noexcept |
| Returns the capacity of the string view. | |
| constexpr void | clear () noexcept |
| Clears the contents by detaching from the current C string. | |
| constexpr void | swap (CStringView &string) noexcept |
| Swaps the contents of this string view with another string view. | |
| template<StringLike stringType> | |
| constexpr size_t | find (const stringType &string, size_t position=0) const noexcept |
| Finds the first occurrence of a toy::StringLike object in the string view. | |
| constexpr size_t | find (const char *string, size_t position=0) const noexcept |
| Finds the first occurrence of the C string in the string view. | |
| constexpr size_t | find (char character, size_t position=0) const noexcept |
| Finds the first occurrence of a character in the string view. | |
| template<StringLike stringType> | |
| constexpr size_t | rfind (const stringType &string, size_t position=npos) const noexcept |
| Finds the last occurrence of a toy::StringLike object in the string view. | |
| constexpr size_t | rfind (const char *string, size_t position=npos) const noexcept |
| Finds the last occurrence of the C string in the string view. | |
| constexpr size_t | rfind (char character, size_t position=npos) const noexcept |
| Finds the last occurrence of a character in the string view. | |
| template<StringLike stringType> | |
| constexpr size_t | find_first_of (const stringType &string, size_t position=0) const noexcept |
| Finds the first occurrence of any character from a toy::StringLike object. | |
| constexpr size_t | find_first_of (const char *string, size_t position=0) const noexcept |
| Finds the first occurrence of any character from the C string. | |
| constexpr size_t | find_first_of (char character, size_t position=0) const noexcept |
| Finds the first occurrence of the specified character. | |
| template<StringLike stringType> | |
| constexpr size_t | find_first_not_of (const stringType &string, size_t position=0) const noexcept |
| Finds the first occurrence of any character not from a toy::StringLike object. | |
| constexpr size_t | find_first_not_of (const char *string, size_t position=0) const noexcept |
| Finds the first occurrence of any character not from the C string. | |
| constexpr size_t | find_first_not_of (char character, size_t position=0) const noexcept |
| Finds the first occurrence of any character not equal to the specified character. | |
| template<StringLike stringType> | |
| constexpr size_t | find_last_of (const stringType &string, size_t position=npos) const noexcept |
| Finds the last occurrence of any character from a toy::StringLike object. | |
| constexpr size_t | find_last_of (const char *string, size_t position=npos) const noexcept |
| Finds the last occurrence of any character from the C string. | |
| constexpr size_t | find_last_of (char character, size_t position=npos) const noexcept |
| Finds the last occurrence of the specified character. | |
| template<StringLike stringType> | |
| constexpr size_t | find_last_not_of (const stringType &string, size_t position=npos) const noexcept |
| Finds the last occurrence of any character not from a toy::StringLike object. | |
| constexpr size_t | find_last_not_of (const char *string, size_t position=npos) const noexcept |
| Finds the last occurrence of any character not from the C string. | |
| constexpr size_t | find_last_not_of (char character, size_t position=npos) const noexcept |
| Finds the last occurrence of any character not equal to the specified character. | |
| template<StringLike stringType> | |
| constexpr int | compare (const stringType &string) const noexcept |
| Compares this string view with a toy::StringLike object lexicographically. | |
| constexpr int | compare (const char *string) const noexcept |
| Compares this string view with the C string lexicographically. | |
| template<StringLike stringType> | |
| constexpr bool | starts_with (const stringType &string) const noexcept |
| Checks if the string view starts with a toy::StringLike object. | |
| constexpr bool | starts_with (const char *string) const noexcept |
| Checks if the string view starts with the specified C string. | |
| constexpr bool | starts_with (char character) const noexcept |
| Checks if the string view starts with the specified character. | |
| template<StringLike stringType> | |
| constexpr bool | ends_with (const stringType &string) const noexcept |
| Checks if the string view ends with a toy::StringLike object. | |
| constexpr bool | ends_with (const char *string) const noexcept |
| Checks if the string view ends with the C string. | |
| constexpr bool | ends_with (char character) const noexcept |
| Checks if the string view ends with the specified character. | |
| template<StringLike stringType> | |
| constexpr bool | contains (const stringType &string) const noexcept |
| Checks if the string view contains a toy::StringLike object. | |
| constexpr bool | contains (const char *string) const noexcept |
| Checks if the string view contains the C string. | |
| constexpr bool | contains (char character) const noexcept |
| Checks if the string view contains the specified character. | |
Static Public Attributes | |
| static constexpr size_t | npos = size_t(-1) |
| The special value, its exact meaning depends on the context. | |
Private Member Functions | |
| constexpr size_t | _find_raw (size_t position, const char *data, size_t dataSize) const noexcept |
| Helper method for finding data in the string view. | |
| constexpr size_t | _rfind_raw (size_t position, const char *data, size_t dataSize) const noexcept |
| Helper method for finding data in the string view backwards. | |
| constexpr size_t | _find_first_of_raw (size_t position, const char *data, size_t dataSize) const noexcept |
| Helper method for finding the first occurrence of any character from data. | |
| constexpr size_t | _find_first_not_of_raw (size_t position, const char *data, size_t dataSize) const noexcept |
| Helper method for finding the first occurrence of any character not from data. | |
| constexpr size_t | _find_last_of_raw (size_t position, const char *data, size_t dataSize) const noexcept |
| Helper method for finding the last occurrence of any character from data. | |
| constexpr size_t | _find_last_not_of_raw (size_t position, const char *data, size_t dataSize) const noexcept |
| Helper method for finding the last occurrence of any character not from data. | |
Private Attributes | |
| const char * | _data |
| Pointer to the wrapped C string. | |
Static Private Attributes | |
| static constexpr char | _emptyString [] {'\0'} |
| Static empty C string used as default value for null pointers. | |
Friends | |
| constexpr bool | operator== (const CStringView &lhs, const CStringView &rhs) |
| Equality comparison operator for two CStringView objects. | |
| template<StringLike stringType> | |
| constexpr bool | operator== (const CStringView &lhs, const stringType &rhs) |
| Equality comparison operator for CStringView and toy::StringLike object. | |
| template<StringLike stringType> | |
| constexpr bool | operator== (const stringType &lhs, const CStringView &rhs) |
| Equality comparison operator for toy::StringLike object and CStringView. | |
| constexpr bool | operator== (const CStringView &lhs, const char *rhs) |
| Equality comparison operator for CStringView and C string. | |
| constexpr bool | operator== (const char *lhs, const CStringView &rhs) |
| Equality comparison operator for C string and CStringView. | |
| constexpr strong_ordering | operator<=> (const CStringView &lhs, const CStringView &rhs) |
| Three-way comparison operator for two CStringView objects. | |
| template<StringLike stringType> | |
| constexpr strong_ordering | operator<=> (const CStringView &lhs, const stringType &rhs) |
| Three-way comparison operator for CStringView and toy::StringLike object. | |
| template<StringLike stringType> | |
| constexpr strong_ordering | operator<=> (const stringType &lhs, const CStringView &rhs) |
| Three-way comparison operator for toy::StringLike object and CStringView. | |
| constexpr strong_ordering | operator<=> (const CStringView &lhs, const char *rhs) |
| Three-way comparison operator for CStringView and C string. | |
| constexpr strong_ordering | operator<=> (const char *lhs, const CStringView &rhs) |
| Three-way comparison operator for C string and CStringView. | |
Non-owning string view class for C-style strings.
CStringView is a lightweight, non-owning wrapper around C-style strings that provides a safe and efficient way to work with null-terminated character arrays. It offers a std::string_view-like interface while being specifically designed for constexpr contexts and compile-time string manipulation.
Unlike std::string_view, CStringView is optimized for constexpr usage and provides additional functionality for compile-time string operations. It does not own the underlying string data and simply holds a pointer to it, making it extremely lightweight and efficient.
std::string_view / std::string like interface
|
constexprnoexcept |
Default constructor.
Creates an empty string view that points to an empty string.
|
constexprdefaultnoexcept |
Constructs a copy of string view.
This constructor initializes a string view by copying the C string from another string view.
| string | The source string view to copy C string from. |
|
constexprdefaultnoexcept |
Destructor for the string view.
|
constexprprivatenoexcept |
Helper method for finding the first occurrence of any character not from data.
This private method performs the common search logic used by all find_first_not_of methods. It searches for the first occurrence of any character that is not present in the specified data starting from the given position.
| position | The position to start searching from. |
| data | The data containing characters to exclude from search. |
| dataSize | The size of the data containing characters to exclude from search. |
|
constexprprivatenoexcept |
Helper method for finding the first occurrence of any character from data.
This private method performs the common search logic used by all find_first_of methods. It searches for the first occurrence of any character from the specified data starting from the given position.
| position | The position to start searching from. |
| data | The data containing characters to search for. |
| dataSize | The size of the data containing characters to search for. |
|
constexprprivatenoexcept |
Helper method for finding the last occurrence of any character not from data.
This private method performs the common reverse search logic used by all find_last_not_of methods. It searches for the last occurrence of any character that is not present in the specified data starting from the given position and searching backwards.
| position | The position to start searching from (default: npos). If npos, searches from the end. |
| data | The data containing characters to exclude from search. |
| dataSize | The size of the data containing characters to exclude from search. |
|
constexprprivatenoexcept |
Helper method for finding the last occurrence of any character from data.
This private method performs the common reverse search logic used by all find_last_of methods. It searches for the last occurrence of any character from the specified data starting from the given position and searching backwards.
| position | The position to start searching from (default: npos). If npos, searches from the end. |
| data | The data containing characters to search for. |
| dataSize | The size of the data containing characters to search for. |
|
constexprprivatenoexcept |
Helper method for finding data in the string view.
This private method performs the common search logic used by all find methods. It searches for the specified data starting from the given position.
| position | The position to start searching from. |
| data | The data to search for. |
| dataSize | The size of the data to search for. |
|
constexprprivatenoexcept |
Helper method for finding data in the string view backwards.
This private method performs the common reverse search logic used by all rfind methods. It searches for the specified data starting from the given position and searching backwards.
| position | The position to start searching from. |
| data | The data to search for. |
| dataSize | The size of the data to search for. |
|
constexprnoexcept |
Copy assigns the C string to this string view.
This method assigns a new C string to this string view.
| string | The C string to assign. |
|
constexprnoexcept |
Copy assigns other string view to this string view.
This method assigns the C string of another string view to this string view.
| string | The source string view to copy C string from. |
|
nodiscardconstexprnoexcept |
Access a character in the string view at a given offset.
This method provides read-only access to a character at the specified offset within the string view.
| offset | The offset of the character to access in the string view. |
|
nodiscardconstexprnoexcept |
Returns a const reference to the last character of the string view.
This method provides read-only access to the last character of the string view.
|
nodiscardconstexprnoexcept |
Returns a constant pointer to the C string representation of this string view.
This method returns a constant pointer to the C string representation of this string view. The returned pointer provides read-only access to the string view contents and can be used with C functions that require a char pointer.
|
nodiscardconstexprnoexcept |
Returns the capacity of the string view.
This method returns the capacity of the allocated buffer for the string view.
|
constexprnoexcept |
Clears the contents by detaching from the current C string.
This method resets this view to point at the internal empty sentinel. The previously referenced character buffer is not modified or freed.
0).
|
nodiscardconstexprnoexcept |
Compares this string view with the C string lexicographically.
This method performs a lexicographic comparison between this string view and the C string. The comparison is performed character by character using the character's numeric value.
| string | The C string to compare with this string. |
|
nodiscardconstexprnoexcept |
Compares this string view with a toy::StringLike object lexicographically.
This method performs a lexicographic comparison between this string view and a toy::StringLike object. The comparison is performed character by character using the character's numeric value.
| stringType | The type of the source string. Must satisfy the toy::StringLike concept. |
| string | The toy::StringLike object to compare with this string. |
|
nodiscardconstexprnoexcept |
Checks if the string view contains the specified character.
This method checks if the current string view contains the specified character anywhere within it.
| character | The character to search for within this string view. |
true if this string view contains the specified character, false otherwise.false.
|
nodiscardconstexprnoexcept |
Checks if the string view contains the C string.
This method checks if the current string view contains the C string anywhere within it.
| string | The C string to search for within this string. |
true if this string view contains the C string, false otherwise.true. false.
|
nodiscardconstexprnoexcept |
Checks if the string view contains a toy::StringLike object.
This method checks if the current string view contains a toy::StringLike object anywhere within it.
| stringType | The type of the source string. Must satisfy the toy::StringLike concept. |
| string | The toy::StringLike object to search for within this string. |
true if this string view contains a toy::StringLike object, false otherwise.true. false.
|
nodiscardconstexprnoexcept |
Returns a constant pointer to the data of the string view.
This method returns a constant pointer to the internal character array that stores the string view data. The returned pointer provides read-only access to the string view contents and can be used for low-level operations.
|
nodiscardconstexprnoexcept |
Checks if the string view is empty.
This method checks if the string view is empty, i.e. its size is zero. An empty string view contains no characters and has a length of zero.
true if the string view is empty, false otherwise.
|
nodiscardconstexprnoexcept |
Checks if the string view ends with the specified character.
This method checks if the current string view ends with the specified character. The comparison is performed on the last character of the string view.
| character | The character to check if this string view ends with. |
true if this string view ends with the specified character, false otherwise.false.
|
nodiscardconstexprnoexcept |
Checks if the string view ends with the C string.
This method checks if the current string view ends with the C string. The comparison is performed character by character from the end of the string view.
| string | The C string to check if this string view ends with. |
true if this string view ends with the C string, false otherwise.true. false.
|
nodiscardconstexprnoexcept |
Checks if the string view ends with a toy::StringLike object.
This method checks if the current string view ends with a toy::StringLike object. The comparison is performed character by character from the end of the string view.
| stringType | The type of the source string. Must satisfy the toy::StringLike concept. |
| string | The toy::StringLike object to check if this string view ends with. |
true if this string view ends with a toy::StringLike object, false otherwise.true. false.
|
constexprnoexcept |
Constructs a string view from a C string.
Creates a new string view that wraps the provided C string pointer.
| string | The C string to wrap. |
|
nodiscardconstexprnoexcept |
Finds the first occurrence of a character in the string view.
This method searches for the first occurrence of the specified character within this string view, starting from the given position.
| character | The character to search for. |
| position | The position to start searching from (default: 0). |
|
nodiscardconstexprnoexcept |
Finds the first occurrence of the C string in the string view.
This method searches for the first occurrence of the C string within this string view, starting from the given position.
| string | The source C string to search for. |
| position | The position to start searching from (default: 0). |
|
nodiscardconstexprnoexcept |
Finds the first occurrence of a toy::StringLike object in the string view.
This method searches for the first occurrence of a toy::StringLike object within this string view, starting from the given position.
| stringType | The type of the source string. Must satisfy the toy::StringLike concept. |
| string | The source toy::StringLike object to search for. |
| position | The position to start searching from (default: 0). |
|
nodiscardconstexprnoexcept |
Finds the first occurrence of any character not equal to the specified character.
This method searches for the first occurrence of any character that is not equal to the specified character within this string view, starting from the given position.
| character | The character to exclude from search. |
| position | The position to start searching from (default: 0). |
|
nodiscardconstexprnoexcept |
Finds the first occurrence of any character not from the C string.
This method searches for the first occurrence of any character that is not present in the C string within this string view, starting from the given position.
| string | The C string containing characters to exclude from search. |
| position | The position to start searching from (default: 0). |
|
nodiscardconstexprnoexcept |
Finds the first occurrence of any character not from a toy::StringLike object.
This method searches for the first occurrence of any character that is not present in a toy::StringLike object within this string view, starting from the given position.
| stringType | The type of the source string. Must satisfy the toy::StringLike concept. |
| string | The toy::StringLike object containing characters to exclude from search. |
| position | The position to start searching from (default: 0). |
|
nodiscardconstexprnoexcept |
Finds the first occurrence of the specified character.
This method searches for the first occurrence of the specified character within this string view, starting from the given position.
| character | The character to search for. |
| position | The position to start searching from (default: 0). |
|
nodiscardconstexprnoexcept |
Finds the first occurrence of any character from the C string.
This method searches for the first occurrence of any character from the C string within this string view, starting from the given position.
| string | The C string containing characters to search for. |
| position | The position to start searching from (default: 0). |
|
nodiscardconstexprnoexcept |
Finds the first occurrence of any character from a toy::StringLike object.
This method searches for the first occurrence of any character from a toy::StringLike object within this string view, starting from the given position.
| stringType | The type of the source string. Must satisfy the toy::StringLike concept. |
| string | The toy::StringLike object containing characters to search for. |
| position | The position to start searching from (default: 0). |
|
nodiscardconstexprnoexcept |
Finds the last occurrence of any character not equal to the specified character.
This method searches for the last occurrence of any character that is not equal to the specified character within this string view, starting from the given position and searching backwards.
| character | The character to exclude from search. |
| position | The position to start searching from (default: npos). If npos, searches from the end. |
|
nodiscardconstexprnoexcept |
Finds the last occurrence of any character not from the C string.
This method searches for the last occurrence of any character that is not present in the C string within this string view, starting from the given position and searching backwards.
| string | The C string containing characters to exclude from search. |
| position | The position to start searching from (default: npos). If npos, searches from the end. |
|
nodiscardconstexprnoexcept |
Finds the last occurrence of any character not from a toy::StringLike object.
This method searches for the last occurrence of any character that is not present in a toy::StringLike object within this string view, starting from the given position and searching backwards.
| stringType | The type of the source string. Must satisfy the toy::StringLike concept. |
| string | The toy::StringLike object containing characters to exclude from search. |
| position | The position to start searching from (default: npos). If npos, searches from the end. |
|
nodiscardconstexprnoexcept |
Finds the last occurrence of the specified character.
This method searches for the last occurrence of the specified character within this string view, starting from the given position and searching backwards.
| character | The character to search for. |
| position | The position to start searching from (default: npos). If npos, searches from the end. |
|
nodiscardconstexprnoexcept |
Finds the last occurrence of any character from the C string.
This method searches for the last occurrence of any character from the C string within this string view, starting from the given position and searching backwards.
| string | The C string containing characters to search for. |
| position | The position to start searching from (default: npos). If npos, searches from the end. |
|
nodiscardconstexprnoexcept |
Finds the last occurrence of any character from a toy::StringLike object.
This method searches for the last occurrence of any character from a toy::StringLike object within this string view, starting from the given position and searching backwards.
| stringType | The type of the source string. Must satisfy the toy::StringLike concept. |
| string | The toy::StringLike object containing characters to search for. |
| position | The position to start searching from (default: npos). If npos, searches from the end. |
|
nodiscardconstexprnoexcept |
Returns a const reference to the first character of the string view.
This method provides read-only access to the first character of the string view.
|
nodiscardconstexprnoexcept |
Returns the size of the string view.
This method returns the current number of characters in the string view, excluding the terminating null character. The length represents the actual length of the string view content.
|
nodiscardconstexprnoexcept |
Returns the maximum observable size of this string view.
This method returns the maximum possible size for the string view. The maximum size represents the size of the allocated buffer.
|
constexprnoexcept |
Copy assigns the C string to this string view.
This operator assigns a new C string to this string view.
| string | The C string to assign. |
|
constexprdefaultnoexcept |
Copy assigns other string view to this string view.
This operator assigns the C string of another string view to this string view.
| string | The source string view to copy C string from. |
|
nodiscardconstexprnoexcept |
Access a character in the string view at a given offset.
This operator provides read-only access to a character at the specified offset within the string view.
| offset | The offset of the character to access in the string view. |
|
nodiscardconstexprnoexcept |
Finds the last occurrence of a character in the string view.
This method searches for the last occurrence of the specified character within this string view, starting from the given position and searching backwards.
| character | The character to search for. |
| position | The position to start searching from (default: npos). If npos, searches from the end. |
|
nodiscardconstexprnoexcept |
Finds the last occurrence of the C string in the string view.
This method searches for the last occurrence of the C string within this string view, starting from the given position and searching backwards.
| string | The source C string to search for. |
| position | The position to start searching from (default: npos). If npos, searches from the end. |
|
nodiscardconstexprnoexcept |
Finds the last occurrence of a toy::StringLike object in the string view.
This method searches for the last occurrence of a toy::StringLike object within this string view, starting from the given position and searching backwards.
| stringType | The type of the source string. Must satisfy the toy::StringLike concept. |
| string | The source toy::StringLike object to search for. |
| position | The position to start searching from (default: npos). If npos, searches from the end. |
|
nodiscardconstexprnoexcept |
Returns the size of the string view.
This method returns the current number of characters in the string view, excluding the terminating null character. The size represents the actual length of the string view content.
|
nodiscardconstexprnoexcept |
Checks if the string view starts with the specified character.
This method checks if the current string view starts with the specified character. The comparison is performed on the first character of the string view.
| character | The character to check if this string view starts with. |
true if this string view starts with the specified character, false otherwise.false.
|
nodiscardconstexprnoexcept |
Checks if the string view starts with the specified C string.
This method checks if the current string view starts with the C string. The comparison is performed character by character from the beginning of the string view.
| string | The C string to check if this string starts with. |
true if this string view starts with the C string, false otherwise.true. false.
|
nodiscardconstexprnoexcept |
Checks if the string view starts with a toy::StringLike object.
This method checks if the current string view starts with a toy::StringLike object. The comparison is performed character by character from the beginning of the string view.
| stringType | The type of the source string. Must satisfy the toy::StringLike concept. |
| string | The toy::StringLike object to check if this string starts with. |
true if this string view starts with a toy::StringLike object, false otherwise.true. false.
|
constexprnoexcept |
Swaps the contents of this string view with another string view.
This method exchanges the contents of this string view with another string view of the same type. The operation is performed efficiently by swapping the internal data information.
| string | The string view to swap contents with. |
|
inlinenodiscardnoexcept |
Returns the size of the Unicode string in UTF-8 encoding.
This method returns the number of Unicode characters in the UTF-8 encoded string, excluding the terminating null character. For ASCII strings, this value equals the size() method. For UTF-8 encoded strings, this method counts the number of Unicode characters rather than bytes. The method validates UTF-8 encoding and counts only complete, well-formed Unicode characters.
|
friend |
Three-way comparison operator for C string and CStringView.
This operator provides a three-way comparison between a C string and a CStringView object. It returns a strong_ordering value that indicates the relationship between the strings.
| lhs | The C string to compare. |
| rhs | The CStringView object to compare. |
strong_ordering::less if lhs is lexicographically less than rhs, strong_ordering::equal if they are equal, or strong_ordering::greater if lhs is lexicographically greater than rhs.
|
friend |
Three-way comparison operator for CStringView and C string.
This operator provides a three-way comparison between a CStringView object and a C string. It returns a strong_ordering value that indicates the relationship between the strings.
| lhs | The CStringView object to compare. |
| rhs | The C string to compare. |
strong_ordering::less if lhs is lexicographically less than rhs, strong_ordering::equal if they are equal, or strong_ordering::greater if lhs is lexicographically greater than rhs.
|
friend |
Three-way comparison operator for two CStringView objects.
This operator provides a three-way comparison between two CStringView objects. It returns a strong_ordering value that indicates the relationship between the string views.
| lhs | The left-hand side CStringView object to compare. |
| rhs | The right-hand side CStringView object to compare. |
strong_ordering::less if lhs is lexicographically less than rhs, strong_ordering::equal if they are equal, or strong_ordering::greater if lhs is lexicographically greater than rhs.
|
friend |
Three-way comparison operator for CStringView and toy::StringLike object.
This operator provides a three-way comparison between a CStringView object and a toy::StringLike object. It returns a strong_ordering value that indicates the relationship between the strings.
| stringType | The type of the toy::StringLike object. Must satisfy the toy::StringLike concept. |
| lhs | The CStringView object to compare. |
| rhs | The toy::StringLike object to compare. |
strong_ordering::less if lhs is lexicographically less than rhs, strong_ordering::equal if they are equal, or strong_ordering::greater if lhs is lexicographically greater than rhs.
|
friend |
Three-way comparison operator for toy::StringLike object and CStringView.
This operator provides a three-way comparison between a toy::StringLike object and a CStringView object. It returns a strong_ordering value that indicates the relationship between the strings.
| stringType | The type of the toy::StringLike object. Must satisfy the toy::StringLike concept. |
| lhs | The toy::StringLike object to compare. |
| rhs | The CStringView object to compare. |
strong_ordering::less if lhs is lexicographically less than rhs, strong_ordering::equal if they are equal, or strong_ordering::greater if lhs is lexicographically greater than rhs.
|
friend |
Equality comparison operator for C string and CStringView.
This operator compares a C string with a CStringView object for equality.
| lhs | The C string. |
| rhs | The CStringView object. |
true if both strings have the same content, false otherwise.
|
friend |
Equality comparison operator for CStringView and C string.
This operator compares a CStringView object with a C string for equality.
| lhs | The CStringView object. |
| rhs | The C string. |
true if both strings have the same content, false otherwise.
|
friend |
Equality comparison operator for two CStringView objects.
This operator compares two CStringView objects for equality. The comparison is performed character by character.
| lhs | The left-hand side CStringView object. |
| rhs | The right-hand side CStringView object. |
true if both strings view have the same content, false otherwise.
|
friend |
Equality comparison operator for CStringView and toy::StringLike object.
This operator compares a CStringView object with a toy::StringLike object for equality.
| stringType | The type of the toy::StringLike object. Must satisfy the toy::StringLike concept. |
| lhs | The CStringView object. |
| rhs | The toy::StringLike object. |
true if both strings have the same content, false otherwise.
|
friend |
Equality comparison operator for toy::StringLike object and CStringView.
This operator compares a toy::StringLike object with a CStringView object for equality.
| stringType | The type of the toy::StringLike object. Must satisfy the toy::StringLike concept. |
| lhs | The toy::StringLike object. |
| rhs | The CStringView object. |
true if both strings have the same content, false otherwise.
|
private |
Pointer to the wrapped C string.
|
staticconstexprprivate |
Static empty C string used as default value for null pointers.
|
staticconstexpr |
The special value, its exact meaning depends on the context.