Loading...
Searching...
No Matches
pretty_print.hpp
Go to the documentation of this file.
// SPDX-FileCopyrightText: 2006-2025 Knut Reinert & Freie Universität Berlin
// SPDX-FileCopyrightText: 2016-2025 Knut Reinert & MPI für molekulare Genetik
// SPDX-License-Identifier: BSD-3-Clause
#pragma once
#include <string>
#include <seqan3/core/platform.hpp>
namespace seqan3::detail
{
// ----------------------------------------------------------------------------
// make_printable
// ----------------------------------------------------------------------------
inline std::string make_printable(char const c)
{
switch (c)
{
case '\0':
return "'\\0'";
case '\t':
return "'\\t'";
case '\n':
return "'\\n'";
case '\v':
return "'\\v'";
case '\f':
return "'\\f'";
case '\r':
return "'\\r'";
case static_cast<char>(127):
return "'DEL'";
default:
{
if ((c >= static_cast<char>(1) && c <= static_cast<char>(8))
|| (c >= static_cast<char>(14) && c <= static_cast<char>(31)))
return "'CTRL'";
else
return {'\'', c, '\''};
}
}
}
} // namespace seqan3::detail
platform.hpp
Provides platform and dependency checks.
string
Hide me