SeqAn3
3.4.0
The Modern C++ library for sequence analysis.
Toggle main menu visibility
Loading...
Searching...
No Matches
io/exception.hpp
Go to the documentation of this file.
1
// SPDX-FileCopyrightText: 2006-2025 Knut Reinert & Freie Universität Berlin
2
// SPDX-FileCopyrightText: 2016-2025 Knut Reinert & MPI für molekulare Genetik
3
// SPDX-License-Identifier: BSD-3-Clause
4
9
10
#pragma once
11
12
#include <
ios
>
13
#include <
stdexcept
>
14
15
#include <
seqan3/core/platform.hpp
>
16
17
namespace
seqan3
18
{
19
20
// ----------------------------------------------------------------------------
21
// file open exceptions
22
// ----------------------------------------------------------------------------
23
26
struct
unhandled_extension_error
:
std::invalid_argument
27
{
29
unhandled_extension_error
(
std::string
const
& s) :
std
::
invalid_argument
{s}
30
{}
31
};
32
35
struct
file_open_error
:
std::runtime_error
36
{
38
file_open_error
(
std::string
const
& s) :
std
::
runtime_error
{s}
39
{}
40
};
41
44
struct
parse_error
:
std::runtime_error
45
{
47
parse_error
(
std::string
const
& s) :
std
::
runtime_error
{s}
48
{}
49
};
50
53
struct
io_error
:
std::ios_base::failure
54
{
55
#if SEQAN3_WORKAROUND_GCC_NO_CXX11_ABI
56
// std::ios_base::failure is missing the std::error_code constructor in pre-C++11 ABI
57
// see https://en.cppreference.com/w/cpp/io/ios_base/failure
58
using
base_t =
std::ios_base::failure
;
59
using
base_t::base_t;
60
#else
// ^^^ workaround / no workaround vvv
62
explicit io_error(std::string const & s, std::error_code const & ec = std::io_errc::stream) :
63
std::ios_base::failure
{s, ec}
64
{}
65
#endif
// SEQAN3_WORKAROUND_GCC_NO_CXX11_ABI
66
};
67
68
// ----------------------------------------------------------------------------
69
// parse exceptions
70
// ----------------------------------------------------------------------------
71
74
struct
unexpected_end_of_input
:
std::runtime_error
75
{
77
unexpected_end_of_input
(
std::string
const
& s) :
std
::
runtime_error
{s}
78
{}
79
};
80
81
// ----------------------------------------------------------------------------
82
// write exceptions
83
// ----------------------------------------------------------------------------
84
87
struct
format_error
:
std::invalid_argument
88
{
90
format_error
(
std::string
const
& s) :
std
::
invalid_argument
{s}
91
{}
92
};
93
94
}
// namespace seqan3
std::string
std::ios_base::failure
std::invalid_argument
ios
seqan3
The main SeqAn3 namespace.
Definition
aligned_sequence_concept.hpp:26
std
SeqAn specific customisations in the standard namespace.
platform.hpp
Provides platform and dependency checks.
std::runtime_error
stdexcept
seqan3::file_open_error::file_open_error
file_open_error(std::string const &s)
Constructor that forwards the exception string.
Definition
io/exception.hpp:38
seqan3::format_error::format_error
format_error(std::string const &s)
Constructor that forwards the exception string.
Definition
io/exception.hpp:90
seqan3::io_error::io_error
io_error(std::string const &s, std::error_code const &ec=std::io_errc::stream)
Constructor that forwards the exception string.
Definition
io/exception.hpp:62
seqan3::parse_error::parse_error
parse_error(std::string const &s)
Constructor that forwards the exception string.
Definition
io/exception.hpp:47
seqan3::unexpected_end_of_input::unexpected_end_of_input
unexpected_end_of_input(std::string const &s)
Constructor that forwards the exception string.
Definition
io/exception.hpp:77
seqan3::unhandled_extension_error::unhandled_extension_error
unhandled_extension_error(std::string const &s)
Constructor that forwards the exception string.
Definition
io/exception.hpp:29
Hide me
Version:
seqan3
io
exception.hpp
Generated on
for SeqAn3 by
1.17.0