Case-insensitive operations on ASCII strings.
More...
#include <string_util.h>
|
| static std::weak_ordering | compare (const std::string_view &left, const std::string_view &right) noexcept |
| | Weak-ordering case-insensitive ASCII strings comparer. More...
|
| |
| static bool | equals (const std::string_view &left, const std::string_view &right) noexcept |
| | Compare two case-insensitive ASCII string for equality. More...
|
| |
| static bool | contains (const std::string_view &text, const std::string_view &str) noexcept |
| | Checks whether a specified substring occurs within a ASCII string. More...
|
| |
| static bool | contains (const std::vector< std::string > &source, const std::string_view &element) noexcept |
| | Checks whether a vector contains a ASCII strings element. More...
|
| |
| static bool | starts_with (const std::string_view &text, const std::string_view &str) noexcept |
| | Determines whether the start of a ASCII string matches a specified string. More...
|
| |
| static bool | ends_with (const std::string_view &text, const std::string_view &str) noexcept |
| | Determines whether the end of a ASCII string matches a specified string. More...
|
| |
| static int | index_of (const std::vector< std::string > &source, const std::string_view &element) noexcept |
| | Finds the zero-based index of the first occurrence of an element in a vector. More...
|
| |
Case-insensitive operations on ASCII strings.
◆ compare()
| std::weak_ordering hgps::core::case_insensitive::compare |
( |
const std::string_view & |
left, |
|
|
const std::string_view & |
right |
|
) |
| |
|
staticnoexcept |
Weak-ordering case-insensitive ASCII strings comparer.
- Parameters
-
| left | The left string to compare |
| right | The right string to compare |
- Returns
- true if the string are equal, otherwise, false
◆ contains() [1/2]
| bool hgps::core::case_insensitive::contains |
( |
const std::string_view & |
text, |
|
|
const std::string_view & |
str |
|
) |
| |
|
staticnoexcept |
Checks whether a specified substring occurs within a ASCII string.
- Parameters
-
| text | The source string |
| str | The string to seek |
- Returns
- true if the value occurs within the string, otherwise, false.
◆ contains() [2/2]
| bool hgps::core::case_insensitive::contains |
( |
const std::vector< std::string > & |
source, |
|
|
const std::string_view & |
element |
|
) |
| |
|
staticnoexcept |
Checks whether a vector contains a ASCII strings element.
- Parameters
-
| source | The vector of strings |
| element | The string to seek |
- Returns
- true if the value occurs within the vector, otherwise, false.
◆ ends_with()
| bool hgps::core::case_insensitive::ends_with |
( |
const std::string_view & |
text, |
|
|
const std::string_view & |
str |
|
) |
| |
|
staticnoexcept |
Determines whether the end of a ASCII string matches a specified string.
- Parameters
-
| text | The source string. |
| str | The end string to compare |
- Returns
- true if value matches the end of string; otherwise, false.
◆ equals()
| bool hgps::core::case_insensitive::equals |
( |
const std::string_view & |
left, |
|
|
const std::string_view & |
right |
|
) |
| |
|
staticnoexcept |
Compare two case-insensitive ASCII string for equality.
- Parameters
-
| left | The left string to compare |
| right | The right string to compare |
- Returns
- true if the string are equal, otherwise, false
◆ index_of()
| int hgps::core::case_insensitive::index_of |
( |
const std::vector< std::string > & |
source, |
|
|
const std::string_view & |
element |
|
) |
| |
|
staticnoexcept |
Finds the zero-based index of the first occurrence of an element in a vector.
- Parameters
-
| source | The vector of strings |
| element | The element to locate |
- Returns
- The zero-based index the element first occurrence, if found; otherwise, -1.
◆ starts_with()
| bool hgps::core::case_insensitive::starts_with |
( |
const std::string_view & |
text, |
|
|
const std::string_view & |
str |
|
) |
| |
|
staticnoexcept |
Determines whether the start of a ASCII string matches a specified string.
- Parameters
-
| text | The source string. |
| str | The start string to compare |
- Returns
- true if value matches the start of string; otherwise, false.
The documentation for this struct was generated from the following files: