|
header_utils
|
Functions that operate on codepoints and strings encoded as ASCII. More...
Functions | |
| template<stringable T> | |
| constexpr bool | ghassanpl::string_ops::ascii::is_identifier (T const &str) noexcept |
| Returns true if the given str is a C-style identifier (e.g. matches /[\w_][\w_0-9]+/). | |
| template<stringable T> | |
| constexpr std::string | ghassanpl::string_ops::ascii::tolower (T const &str) noexcept |
| Returns a copy of the string with all characters transformed to lower case. | |
| constexpr std::string | ghassanpl::string_ops::ascii::tolower (std::string str) noexcept |
| Returns a copy of the string with all characters transformed to lower case. | |
| constexpr std::string | ghassanpl::string_ops::ascii::tolower (const char *str) noexcept |
| Returns a copy of the string with all characters transformed to lower case. | |
| template<stringable T> | |
| std::string | ghassanpl::string_ops::ascii::toupper (T const &str) noexcept |
| Returns a copy of the string with all characters transformed to upper case. | |
| std::string | ghassanpl::string_ops::ascii::toupper (std::string str) noexcept |
| Returns a copy of the string with all characters transformed to upper case. | |
| std::string | ghassanpl::string_ops::ascii::toupper (const char *str) noexcept |
| Returns a copy of the string with all characters transformed to upper case. | |
| std::string | ghassanpl::string_ops::ascii::capitalize (std::string str) noexcept |
| Returns a copy of the string with the first letter transformed to upper case if possible. | |
| constexpr char32_t | ghassanpl::string_ops::ascii::number_to_digit (int v) noexcept |
| Convert a number between 0 and 9 to its ASCII representation (only gives meaningful results with arguments between 0 and 9). | |
| constexpr char32_t | ghassanpl::string_ops::ascii::number_to_xdigit (int v) noexcept |
| Convert a number between 0 and 15 to its ASCII representation (only gives meaningful results with arguments between 0 and 15). | |
| constexpr int | ghassanpl::string_ops::ascii::digit_to_number (char32_t cp) noexcept |
| Convert an ASCII digit character to its numerical value (only gives meaningful results with valid digit arguments). | |
| constexpr int | ghassanpl::string_ops::ascii::xdigit_to_number (char32_t cp) noexcept |
| Convert an ASCII xdigit to its numerical value (only gives meaningful results with valid xdigit arguments). | |
*_chars variables | |
Constexpr arrays listing the characters that match their respective ascii::is* functions | |
| constexpr auto | ghassanpl::string_ops::ascii::alphabetic_chars |
All characters that match ascii::isalpha. | |
| constexpr auto | ghassanpl::string_ops::ascii::digit_chars |
All characters that match ascii::isdigit. | |
| constexpr auto | ghassanpl::string_ops::ascii::octal_digit_chars |
All characters that match ascii::isodigit. | |
| constexpr auto | ghassanpl::string_ops::ascii::hex_digit_chars |
All characters that match ascii::isxdigit. | |
| constexpr auto | ghassanpl::string_ops::ascii::alphanumeric_chars |
All characters that match ascii::isalnum. | |
| constexpr auto | ghassanpl::string_ops::ascii::identifier_chars |
All characters that match ascii::isident. | |
| constexpr auto | ghassanpl::string_ops::ascii::identifier_start_chars |
All characters that match ascii::isidentstart. | |
| constexpr auto | ghassanpl::string_ops::ascii::whitespace_chars |
All characters that match ascii::isspace. | |
| constexpr auto | ghassanpl::string_ops::ascii::punctuation_chars |
All characters that match ascii::ispunct. | |
| constexpr auto | ghassanpl::string_ops::ascii::lowercase_chars |
All characters that match ascii::islower. | |
| constexpr auto | ghassanpl::string_ops::ascii::uppercase_chars |
All characters that match ascii::isupper. | |
| constexpr auto | ghassanpl::string_ops::ascii::control_chars |
All characters that match ascii::iscntrl. | |
| constexpr auto | ghassanpl::string_ops::ascii::blank_chars |
All characters that match ascii::isblank. | |
| constexpr auto | ghassanpl::string_ops::ascii::graphical_chars |
All characters that match ascii::isgraph. | |
| constexpr auto | ghassanpl::string_ops::ascii::printable_chars |
All characters that match ascii::isprint. | |
is* and to* functions | |
These are our own versions of <cctype> functions that:
| |
| constexpr bool | ghassanpl::string_ops::ascii::isalpha (char32_t cp) noexcept |
| constexpr bool | ghassanpl::string_ops::ascii::isdigit (char32_t cp) noexcept |
| constexpr bool | ghassanpl::string_ops::ascii::isodigit (char32_t cp) noexcept |
| constexpr bool | ghassanpl::string_ops::ascii::isxdigit (char32_t d) noexcept |
| constexpr bool | ghassanpl::string_ops::ascii::isXdigit (char32_t d) noexcept |
| constexpr bool | ghassanpl::string_ops::ascii::islxdigit (char32_t d) noexcept |
| constexpr bool | ghassanpl::string_ops::ascii::isalnum (char32_t cp) noexcept |
| constexpr bool | ghassanpl::string_ops::ascii::isident (char32_t cp) noexcept |
| constexpr bool | ghassanpl::string_ops::ascii::isidentstart (char32_t cp) noexcept |
| constexpr bool | ghassanpl::string_ops::ascii::isspace (char32_t cp) noexcept |
| constexpr bool | ghassanpl::string_ops::ascii::ispunct (char32_t cp) noexcept |
| constexpr bool | ghassanpl::string_ops::ascii::islower (char32_t cp) noexcept |
| constexpr bool | ghassanpl::string_ops::ascii::isupper (char32_t cp) noexcept |
| constexpr bool | ghassanpl::string_ops::ascii::iscntrl (char32_t cp) noexcept |
| constexpr bool | ghassanpl::string_ops::ascii::isblank (char32_t cp) noexcept |
| constexpr bool | ghassanpl::string_ops::ascii::isgraph (char32_t cp) noexcept |
| constexpr bool | ghassanpl::string_ops::ascii::isprint (char32_t cp) noexcept |
| constexpr char32_t | ghassanpl::string_ops::ascii::toupper (char32_t cp) noexcept |
| constexpr char32_t | ghassanpl::string_ops::ascii::tolower (char32_t cp) noexcept |
Case-invariant Comparisons | |
| constexpr bool | ghassanpl::string_ops::ascii::strings_equal_ignore_case (std::string_view sa, std::string_view sb) |
| constexpr bool | ghassanpl::string_ops::ascii::string_starts_with_ignore_case (std::string_view a, std::string_view b) |
| constexpr bool | ghassanpl::string_ops::ascii::string_ends_with_ignore_case (std::string_view a, std::string_view b) |
| constexpr auto | ghassanpl::string_ops::ascii::string_find_ignore_case (std::string_view haystack, std::string_view pattern) |
| constexpr auto | ghassanpl::string_ops::ascii::string_find_last_ignore_case (std::string_view a, std::string_view b) |
| constexpr auto | ghassanpl::string_ops::ascii::string_contains_ignore_case (std::string_view a, std::string_view b) |
| constexpr bool | ghassanpl::string_ops::ascii::lexicographical_compare_ignore_case (std::string_view first, std::string_view second) |
| constexpr auto | ghassanpl::string_ops::ascii::lexicographical_compare_ignore_case_three_way (std::string_view a, std::string_view b) |
| constexpr uint64_t | ghassanpl::string_ops::ascii::hash_ignore_case (std::string_view str) |
| consteval detail::string_view_case_insensitive | ghassanpl::string_ops::ascii::operator""_i (const char *str, size_t size) noexcept |
| A version of the sv suffix that returns a special type allowing for case-insensitive comparisons (e.g. if (str == "hello"_i)). | |
Functions that operate on codepoints and strings encoded as ASCII.
|
inlinenodiscardnoexcept |
Returns a copy of the string with the first letter transformed to upper case if possible.
Definition at line 467 of file string_ops.h.
|
nodiscardconstexprnoexcept |
Convert an ASCII digit character to its numerical value (only gives meaningful results with valid digit arguments).
Definition at line 479 of file string_ops.h.
|
nodiscardconstexpr |
Definition at line 538 of file string_ops.h.
|
nodiscardconstexprnoexcept |
Returns true if the given str is a C-style identifier (e.g. matches /[\w_][\w_0-9]+/).
Definition at line 411 of file string_ops.h.
|
nodiscardconstexprnoexcept |
Definition at line 346 of file string_ops.h.
|
nodiscardconstexprnoexcept |
Definition at line 340 of file string_ops.h.
|
nodiscardconstexprnoexcept |
Definition at line 354 of file string_ops.h.
|
nodiscardconstexprnoexcept |
Definition at line 353 of file string_ops.h.
|
nodiscardconstexprnoexcept |
Definition at line 341 of file string_ops.h.
|
nodiscardconstexprnoexcept |
Definition at line 355 of file string_ops.h.
|
nodiscardconstexprnoexcept |
Definition at line 347 of file string_ops.h.
|
nodiscardconstexprnoexcept |
Definition at line 348 of file string_ops.h.
|
nodiscardconstexprnoexcept |
Definition at line 351 of file string_ops.h.
|
nodiscardconstexprnoexcept |
Definition at line 345 of file string_ops.h.
|
nodiscardconstexprnoexcept |
Definition at line 342 of file string_ops.h.
|
nodiscardconstexprnoexcept |
Definition at line 356 of file string_ops.h.
|
nodiscardconstexprnoexcept |
Definition at line 350 of file string_ops.h.
|
nodiscardconstexprnoexcept |
Definition at line 349 of file string_ops.h.
|
nodiscardconstexprnoexcept |
Definition at line 352 of file string_ops.h.
|
nodiscardconstexprnoexcept |
Definition at line 344 of file string_ops.h.
|
nodiscardconstexprnoexcept |
Definition at line 343 of file string_ops.h.
|
nodiscardconstexpr |
Definition at line 526 of file string_ops.h.
|
nodiscardconstexpr |
Definition at line 532 of file string_ops.h.
|
nodiscardconstexprnoexcept |
Convert a number between 0 and 9 to its ASCII representation (only gives meaningful results with arguments between 0 and 9).
Definition at line 474 of file string_ops.h.
|
nodiscardconstexprnoexcept |
Convert a number between 0 and 15 to its ASCII representation (only gives meaningful results with arguments between 0 and 15).
Definition at line 476 of file string_ops.h.
|
nodiscardconstevalnoexcept |
A version of the sv suffix that returns a special type allowing for case-insensitive comparisons (e.g. if (str == "hello"_i)).
Definition at line 562 of file string_ops.h.
|
nodiscardconstexpr |
Definition at line 521 of file string_ops.h.
|
nodiscardconstexpr |
Definition at line 497 of file string_ops.h.
|
nodiscardconstexpr |
Definition at line 503 of file string_ops.h.
|
nodiscardconstexpr |
Definition at line 512 of file string_ops.h.
|
nodiscardconstexpr |
Definition at line 492 of file string_ops.h.
|
nodiscardconstexpr |
Definition at line 487 of file string_ops.h.
|
nodiscardconstexprnoexcept |
Definition at line 361 of file string_ops.h.
|
nodiscardconstexprnoexcept |
Returns a copy of the string with all characters transformed to lower case.
Definition at line 435 of file string_ops.h.
|
nodiscardconstexprnoexcept |
Returns a copy of the string with all characters transformed to lower case.
Definition at line 429 of file string_ops.h.
|
nodiscardconstexprnoexcept |
Returns a copy of the string with all characters transformed to lower case.
Definition at line 418 of file string_ops.h.
|
nodiscardconstexprnoexcept |
Definition at line 358 of file string_ops.h.
|
inlinenodiscardnoexcept |
Returns a copy of the string with all characters transformed to upper case.
Definition at line 460 of file string_ops.h.
|
inlinenodiscardnoexcept |
Returns a copy of the string with all characters transformed to upper case.
Definition at line 454 of file string_ops.h.
|
inlinenodiscardnoexcept |
Returns a copy of the string with all characters transformed to upper case.
Definition at line 443 of file string_ops.h.
|
nodiscardconstexprnoexcept |
Convert an ASCII xdigit to its numerical value (only gives meaningful results with valid xdigit arguments).
Definition at line 482 of file string_ops.h.
|
inlineconstexpr |
All characters that match ascii::isalpha.
Definition at line 392 of file string_ops.h.
|
inlineconstexpr |
All characters that match ascii::isalnum.
Definition at line 396 of file string_ops.h.
|
inlineconstexpr |
All characters that match ascii::isblank.
Definition at line 404 of file string_ops.h.
|
inlineconstexpr |
All characters that match ascii::iscntrl.
Definition at line 403 of file string_ops.h.
|
inlineconstexpr |
All characters that match ascii::isdigit.
Definition at line 393 of file string_ops.h.
|
inlineconstexpr |
All characters that match ascii::isgraph.
Definition at line 405 of file string_ops.h.
|
inlineconstexpr |
All characters that match ascii::isxdigit.
Definition at line 395 of file string_ops.h.
|
inlineconstexpr |
All characters that match ascii::isident.
Definition at line 397 of file string_ops.h.
|
inlineconstexpr |
All characters that match ascii::isidentstart.
Definition at line 398 of file string_ops.h.
|
inlineconstexpr |
All characters that match ascii::islower.
Definition at line 401 of file string_ops.h.
|
inlineconstexpr |
All characters that match ascii::isodigit.
Definition at line 394 of file string_ops.h.
|
inlineconstexpr |
All characters that match ascii::isprint.
Definition at line 406 of file string_ops.h.
|
inlineconstexpr |
All characters that match ascii::ispunct.
Definition at line 400 of file string_ops.h.
|
inlineconstexpr |
All characters that match ascii::isupper.
Definition at line 402 of file string_ops.h.
|
inlineconstexpr |
All characters that match ascii::isspace.
Definition at line 399 of file string_ops.h.