#include <classifier.hpp>
|
template<fly::StandardStringLike T> |
constexpr auto | size (T &&value) -> size_type |
|
template<std::size_t N> |
constexpr auto | size (const CharType(&value)[N]) -> size_type |
|
|
template<fly::StandardStringLike T> |
static constexpr size_type | size (T &&value) |
|
template<std::size_t N> |
static constexpr size_type | size (const CharType(&value)[N]) |
|
static constexpr bool | is_alpha (CharType ch) |
|
static constexpr bool | is_upper (CharType ch) |
|
static constexpr bool | is_lower (CharType ch) |
|
static constexpr CharType | to_upper (CharType ch) |
|
static constexpr CharType | to_lower (CharType ch) |
|
static constexpr bool | is_digit (CharType ch) |
|
static constexpr bool | is_x_digit (CharType ch) |
|
static constexpr bool | is_space (CharType ch) |
|
template<fly::StandardCharacter CharType>
class fly::detail::BasicClassifier< CharType >
Helper class to provide safe alernatives to the STL's <cctype> methods.
- Author
- Timothy Flynn (trfly.nosp@m.nn89.nosp@m.@pm.m.nosp@m.e)
- Version
- January 3, 2021
◆ is_alpha()
template<fly::StandardCharacter CharType>
Checks if the given character is an alphabetic character as classified by the default C locale.
The STL's std::isalpha and std::iswalpha require that the provided character fits into an unsigned char and unsigned wchar_t, respectively. Other values result in undefined behavior. This method has no such restriction.
- Parameters
-
ch | The character to classify. |
- Returns
- True if the character is an alphabetic character.
◆ is_digit()
template<fly::StandardCharacter CharType>
Checks if the given character is a decimal digit character.
The STL's std::isdigit and std::iswdigit require that the provided character fits into an unsigned char and unsigned wchar_t, respectively. Other values result in undefined behavior. This method has no such restriction.
- Parameters
-
ch | The character to classify. |
- Returns
- True if the character is a decimal digit character.
◆ is_lower()
template<fly::StandardCharacter CharType>
Checks if the given character is a lower-case alphabetic character as classified by the default C locale.
The STL's std::islower and std::iswlower require that the provided character fits into an unsigned char and unsigned wchar_t, respectively. Other values result in undefined behavior. This method has no such restriction.
- Parameters
-
ch | The character to classify. |
- Returns
- True if the character is an alphabetic character.
◆ is_space()
template<fly::StandardCharacter CharType>
Checks if the given character is a whitespace character as classified by the default C locale.
The STL's std::isspace and std::iswspace require that the provided character fits into an unsigned char and unsigned wchar_t, respectively. Other values result in undefined behavior. This method has no such restriction.
- Parameters
-
ch | The character to classify. |
- Returns
- True if the character is a whitespace character.
◆ is_upper()
template<fly::StandardCharacter CharType>
Checks if the given character is an upper-case alphabetic character as classified by the default C locale.
The STL's std::isupper and std::iswupper require that the provided character fits into an unsigned char and unsigned wchar_t, respectively. Other values result in undefined behavior. This method has no such restriction.
- Parameters
-
ch | The character to classify. |
- Returns
- True if the character is an alphabetic character.
◆ is_x_digit()
template<fly::StandardCharacter CharType>
Checks if the given character is a hexadecimal digit character.
The STL's std::isxdigit and std::iswxdigit require that the provided character fits into an unsigned char and unsigned wchar_t, respectively. Other values result in undefined behavior. This method has no such restriction.
- Parameters
-
ch | The character to classify. |
- Returns
- True if the character is a hexadecimal digit character.
◆ size() [1/2]
template<fly::StandardCharacter CharType>
template<std::size_t N>
Determine the length of a character array value, excluding the null terminator (if present).
- Parameters
-
value | The character array. |
- Returns
- The length of the character array.
◆ size() [2/2]
template<fly::StandardCharacter CharType>
template<fly::StandardStringLike T>
Determine the length of any string-like value. Accepts std::basic_string and std::basic_string_view specializations.
- Template Parameters
-
- Parameters
-
value | The string-like value. |
- Returns
- The length of the string-like value.
◆ to_lower()
template<fly::StandardCharacter CharType>
Converts the given character to a lower-case alphabetic character as classified by the default C locale.
The STL's std:tolower and std::towlower require that the provided character fits into an unsigned char and unsigned wchar_t, respectively. Other values result in undefined behavior. This method has no such restriction.
- Parameters
-
ch | The character to convert. |
- Returns
- The converted character.
◆ to_upper()
template<fly::StandardCharacter CharType>
Converts the given character to an upper-case alphabetic character as classified by the default C locale.
The STL's std:toupper and std::towupper require that the provided character fits into an unsigned char and unsigned wchar_t, respectively. Other values result in undefined behavior. This method has no such restriction.
- Parameters
-
ch | The character to convert. |
- Returns
- The converted character.
The documentation for this class was generated from the following file: