SeqAn3 3.4.0-rc.1
The Modern C++ library for sequence analysis.
Loading...
Searching...
No Matches
pretty_print.hpp
Go to the documentation of this file.
1// SPDX-FileCopyrightText: 2006-2024 Knut Reinert & Freie Universität Berlin
2// SPDX-FileCopyrightText: 2016-2024 Knut Reinert & MPI für molekulare Genetik
3// SPDX-License-Identifier: BSD-3-Clause
4
10#pragma once
11
12#include <string>
13
15
16namespace seqan3::detail
17{
18
19// ----------------------------------------------------------------------------
20// make_printable
21// ----------------------------------------------------------------------------
22
45inline std::string make_printable(char const c)
46{
47 switch (c)
48 {
49 case '\0':
50 return "'\\0'";
51 case '\t':
52 return "'\\t'";
53 case '\n':
54 return "'\\n'";
55 case '\v':
56 return "'\\v'";
57 case '\f':
58 return "'\\f'";
59 case '\r':
60 return "'\\r'";
61 case static_cast<char>(127):
62 return "'DEL'";
63 default:
64 {
65 if ((c >= static_cast<char>(1) && c <= static_cast<char>(8))
66 || (c >= static_cast<char>(14) && c <= static_cast<char>(31)))
67 return "'CTRL'";
68 else
69 return {'\'', c, '\''};
70 }
71 }
72}
73
74} // namespace seqan3::detail
Provides platform and dependency checks.
Hide me