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
14
#include <
seqan3/core/platform.hpp
>
15
16
namespace
seqan3::detail
17
{
18
19
// ----------------------------------------------------------------------------
20
// make_printable
21
// ----------------------------------------------------------------------------
22
45
inline
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
std::string
platform.hpp
Provides platform and dependency checks.
string
Hide me
Version:
seqan3
utility
char_operations
pretty_print.hpp
Generated on Thu Sep 19 2024 17:22:55 for SeqAn3 by
1.9.8