tetl 0.1.0
Embedded Template Library
Loading...
Searching...
No Matches
isprint.hpp
Go to the documentation of this file.
1// SPDX-License-Identifier: BSL-1.0
2// SPDX-FileCopyrightText: Copyright (C) 2020 Tobias Hienzsch
3
4#ifndef TETL_CCTYPE_ISPRINT_HPP
5#define TETL_CCTYPE_ISPRINT_HPP
6
7#include <etl/_cctype/isgraph.hpp>
8
9namespace etl {
10/// \brief Checks if ch is a printable character as classified by the default C
11/// locale.
12///
13/// \param ch Character to classify.
14///
15/// \returns Non-zero value if the character is a punctuation character, zero
16/// otherwise.
17///
18/// https://en.cppreference.com/w/cpp/string/byte/isprint
19///
20/// \ingroup cctype
21[[nodiscard]] constexpr auto isprint(int ch) noexcept -> int
22{
23 return static_cast<int>(etl::isgraph(ch) != 0 || ch == ' ');
24}
25} // namespace etl
26
27#endif // TETL_CCTYPE_ISPRINT_HPP
constexpr auto isgraph(int ch) noexcept -> int
Checks if the given character is graphic (has a graphical representation) as classified by the defaul...
Definition isgraph.hpp:25
constexpr auto isprint(int ch) noexcept -> int
Checks if ch is a printable character as classified by the default C locale.
Definition isprint.hpp:21
Definition adjacent_find.hpp:9