tetl 0.1.0
Embedded Template Library
Loading...
Searching...
No Matches
iswgraph.hpp
Go to the documentation of this file.
1// SPDX-License-Identifier: BSL-1.0
2// SPDX-FileCopyrightText: Copyright (C) 2021 Tobias Hienzsch
3
4#ifndef TETL_CWCTYPE_ISWGRAPH_HPP
5#define TETL_CWCTYPE_ISWGRAPH_HPP
6
7#include <etl/_cwctype/iswdigit.hpp>
8#include <etl/_cwctype/iswlower.hpp>
9#include <etl/_cwctype/iswpunct.hpp>
10#include <etl/_cwctype/iswupper.hpp>
11
12namespace etl {
13
14/// \brief Checks if the given wide character has a graphical representation,
15/// i.e. it is either a number (0123456789), an uppercase letter
16/// (ABCDEFGHIJKLMNOPQRSTUVWXYZ), a lowercase letter
17/// (abcdefghijklmnopqrstuvwxyz), a punctuation
18/// character(!"#$%&'()*+,-./:;<=>?@[\]^_`{|}~) or any graphical character
19/// specific to the current C locale.
20///
21/// \details If the value of ch is neither representable as a wchar_t nor equal
22/// to the value of the macro WEOF, the behavior is undefined.
23///
24/// https://en.cppreference.com/w/cpp/string/wide/iswgraph
25///
26/// \ingroup cwctype
27[[nodiscard]] constexpr auto iswgraph(wint_t ch) noexcept -> int
28{
29 auto const isDigit = iswdigit(ch) != 0;
30 auto const isUpper = iswupper(ch) != 0;
31 auto const isLower = iswlower(ch) != 0;
32 auto const isPunct = iswpunct(ch) != 0;
33 return static_cast<int>(isDigit || isLower || isUpper || isPunct);
34}
35} // namespace etl
36
37#endif // TETL_CWCTYPE_ISWGRAPH_HPP
constexpr auto iswupper(wint_t ch) noexcept -> int
Checks if the given wide character is an uppercase letter, i.e. one of ABCDEFGHIJKLMNOPQRSTUVWXYZ or ...
Definition iswupper.hpp:21
constexpr auto iswdigit(wint_t ch) noexcept -> int
Checks if the given wide character corresponds (if narrowed) to one of the ten decimal digit characte...
Definition iswdigit.hpp:19
constexpr auto iswlower(wint_t ch) noexcept -> int
Checks if the given wide character is a lowercase letter, i.e. one of abcdefghijklmnopqrstuvwxyz or a...
Definition iswlower.hpp:21
constexpr auto iswgraph(wint_t ch) noexcept -> int
Checks if the given wide character has a graphical representation, i.e. it is either a number (012345...
Definition iswgraph.hpp:27
constexpr auto iswpunct(wint_t ch) noexcept -> int
Checks if the given wide character is a punctuation character, i.e. it is one of !...
Definition iswpunct.hpp:21
Definition adjacent_find.hpp:9