tetl 0.1.0
Embedded Template Library
Loading...
Searching...
No Matches
iswprint.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_ISWPRINT_HPP
5#define TETL_CWCTYPE_ISWPRINT_HPP
6
7#include <etl/_cwchar/wint_t.hpp>
8#include <etl/_cwctype/iswgraph.hpp>
9
10namespace etl {
11/// \brief Checks if the given wide character can be printed, i.e. it is either
12/// a number (0123456789), an uppercase letter (ABCDEFGHIJKLMNOPQRSTUVWXYZ), a
13/// lowercase letter (abcdefghijklmnopqrstuvwxyz), a punctuation
14/// character(!"#$%&'()*+,-./:;<=>?@[\]^_`{|}~), space or any printable
15/// character specific to the current C locale.
16///
17/// \details If the value of ch is neither representable as a wchar_t nor equal
18/// to the value of the macro WEOF, the behavior is undefined.
19///
20/// https://en.cppreference.com/w/cpp/string/wide/iswprint
21///
22/// \ingroup cwctype
23[[nodiscard]] constexpr auto iswprint(wint_t ch) noexcept -> int
24{
25 return static_cast<int>(etl::iswgraph(ch) != 0 || ch == ' ');
26}
27
28} // namespace etl
29
30#endif // TETL_CWCTYPE_ISWPRINT_HPP
constexpr auto iswprint(wint_t ch) noexcept -> int
Checks if the given wide character can be printed, i.e. it is either a number (0123456789),...
Definition iswprint.hpp:23
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
Definition adjacent_find.hpp:9