tetl 0.1.0
Embedded Template Library
Loading...
Searching...
No Matches

Functions to determine the category of narrow characters. More...

Functions

constexpr auto isalnum (int ch) noexcept -> int
 Checks if the given character is an alphanumeric character as classified by the default C locale.
 
constexpr auto isalpha (int ch) noexcept -> int
 Checks if the given character is an alphabetic character as classified by the default C locale.
 
constexpr auto isblank (int ch) noexcept -> int
 Checks if the given character is a blank character as classified by the currently installed C locale. Blank characters are whitespace characters used to separate words within a sentence. In the default C locale, only space (0x20) and horizontal tab (0x09) are classified as blank characters.
 
constexpr auto iscntrl (int ch) noexcept -> int
 Checks if the given character is a control character as classified by the currently installed C locale. In the default, "C" locale, the control characters are the characters with the codes 0x00-0x1F and 0x7F.
 
constexpr auto isdigit (int ch) noexcept -> int
 Checks if the given character is one of the 10 decimal digits: 0123456789.
 
constexpr auto isgraph (int ch) noexcept -> int
 Checks if the given character is graphic (has a graphical representation) as classified by the default C locale.
 
constexpr auto islower (int ch) noexcept -> int
 Checks if the given character is classified as a lowercase character according to the default C locale.
 
constexpr auto isprint (int ch) noexcept -> int
 Checks if ch is a printable character as classified by the default C locale.
 
constexpr auto ispunct (int ch) noexcept -> int
 Checks if the given character is a punctuation character as classified by the current C locale.
 
constexpr auto isspace (int ch) noexcept -> int
 Checks if the given character is whitespace character as classified by the default C locale.
 
constexpr auto isupper (int ch) noexcept -> int
 Checks if the given character is classified as a uppercase character according to the default C locale.
 
constexpr auto isxdigit (int ch) noexcept -> int
 Checks if the given character is a hexadecimal numeric character (0123456789abcdefABCDEF).
 
constexpr auto tolower (int ch) noexcept -> int
 Converts the given character to lowercase according to the character conversion rules defined by the default C locale.
 
constexpr auto toupper (int ch) noexcept -> int
 Converts the given character to uppercase according to the character conversion rules defined by the default C locale.
 

Detailed Description

Functions to determine the category of narrow characters.

Function Documentation

◆ isalnum()

auto isalnum ( int ch) -> int
nodiscardconstexprnoexcept

Checks if the given character is an alphanumeric character as classified by the default C locale.

Parameters
chCharacter to classify.
Returns
Non-zero value if the character is an alphanumeric character, 0 otherwise.

https://en.cppreference.com/w/cpp/string/byte/isalnum

◆ isalpha()

auto isalpha ( int ch) -> int
nodiscardconstexprnoexcept

Checks if the given character is an alphabetic character as classified by the default C locale.

Parameters
chCharacter to classify.
Returns
Non-zero value if the character is an alphabetic character, 0 otherwise.

https://en.cppreference.com/w/cpp/string/byte/isalpha

◆ isblank()

auto isblank ( int ch) -> int
nodiscardconstexprnoexcept

Checks if the given character is a blank character as classified by the currently installed C locale. Blank characters are whitespace characters used to separate words within a sentence. In the default C locale, only space (0x20) and horizontal tab (0x09) are classified as blank characters.

Parameters
chCharacter to classify.
Returns
Non-zero value if the character is a blank character, zero otherwise.

https://en.cppreference.com/w/cpp/string/byte/isblank

◆ iscntrl()

auto iscntrl ( int ch) -> int
nodiscardconstexprnoexcept

Checks if the given character is a control character as classified by the currently installed C locale. In the default, "C" locale, the control characters are the characters with the codes 0x00-0x1F and 0x7F.

Parameters
chCharacter to classify.
Returns
Non-zero value if the character is a control character, zero otherwise.

https://en.cppreference.com/w/cpp/string/byte/iscntrl

◆ isdigit()

auto isdigit ( int ch) -> int
nodiscardconstexprnoexcept

Checks if the given character is one of the 10 decimal digits: 0123456789.

https://en.cppreference.com/w/cpp/string/byte/isdigit

Returns
Non-zero value if the character is a numeric character, zero otherwise.
Parameters
chCharacter to classify.

◆ isgraph()

auto isgraph ( int ch) -> int
nodiscardconstexprnoexcept

Checks if the given character is graphic (has a graphical representation) as classified by the default C locale.

Parameters
chCharacter to classify.
Returns
Non-zero value if the character is a punctuation character, zero otherwise.

https://en.cppreference.com/w/cpp/string/byte/isgraph

◆ islower()

auto islower ( int ch) -> int
nodiscardconstexprnoexcept

Checks if the given character is classified as a lowercase character according to the default C locale.

Parameters
chCharacter to classify.
Returns
Non-zero value if the character is a lowercase letter, zero otherwise.

https://en.cppreference.com/w/cpp/string/byte/islower

◆ isprint()

auto isprint ( int ch) -> int
nodiscardconstexprnoexcept

Checks if ch is a printable character as classified by the default C locale.

Parameters
chCharacter to classify.
Returns
Non-zero value if the character is a punctuation character, zero otherwise.

https://en.cppreference.com/w/cpp/string/byte/isprint

◆ ispunct()

auto ispunct ( int ch) -> int
nodiscardconstexprnoexcept

Checks if the given character is a punctuation character as classified by the current C locale.

The default C locale classifies the characters !"#$%&'()*+,-./:;<=>?@[]^_`{|}~ as punctuation.

Parameters
chCharacter to classify.
Returns
Non-zero value if the character is a punctuation character, zero otherwise.

https://en.cppreference.com/w/cpp/string/byte/ispunct

◆ isspace()

auto isspace ( int ch) -> int
nodiscardconstexprnoexcept

Checks if the given character is whitespace character as classified by the default C locale.

Parameters
chCharacter to classify.
Returns
Non-zero value if the character is a whitespace character, zero otherwise.

https://en.cppreference.com/w/cpp/string/byte/isspace

◆ isupper()

auto isupper ( int ch) -> int
nodiscardconstexprnoexcept

Checks if the given character is classified as a uppercase character according to the default C locale.

Parameters
chCharacter to classify.
Returns
Non-zero value if the character is a uppercase letter, zero otherwise.

https://en.cppreference.com/w/cpp/string/byte/isupper

◆ isxdigit()

auto isxdigit ( int ch) -> int
nodiscardconstexprnoexcept

Checks if the given character is a hexadecimal numeric character (0123456789abcdefABCDEF).

Parameters
chCharacter to classify.
Returns
Non-zero value if the character is a hexadecimal numeric character, zero otherwise.

https://en.cppreference.com/w/cpp/string/byte/isxdigit

◆ tolower()

auto tolower ( int ch) -> int
nodiscardconstexprnoexcept

Converts the given character to lowercase according to the character conversion rules defined by the default C locale.

In the default "C" locale, the following uppercase letters ABCDEFGHIJKLMNOPQRSTUVWXYZ are replaced with respective lowercase letters abcdefghijklmnopqrstuvwxyz.

Parameters
chCharacter to classify.
Returns
Lowercase version of ch or unmodified ch if no lowercase version is listed in the current C locale.

https://en.cppreference.com/w/cpp/string/byte/tolower

◆ toupper()

auto toupper ( int ch) -> int
nodiscardconstexprnoexcept

Converts the given character to uppercase according to the character conversion rules defined by the default C locale.

In the default "C" locale, the following lowercase letters abcdefghijklmnopqrstuvwxyz are replaced with respective uppercase letters ABCDEFGHIJKLMNOPQRSTUVWXYZ.

Parameters
chCharacter to classify.
Returns
Converted character or ch if no uppercase version is defined by the current C locale.

https://en.cppreference.com/w/cpp/string/byte/toupper

Examples
string.cpp.