SeqAn3  3.1.0-rc.1
The Modern C++ library for sequence analysis.
exception.hpp
Go to the documentation of this file.
1 // -----------------------------------------------------------------------------------------------------
2 // Copyright (c) 2006-2021, Knut Reinert & Freie Universität Berlin
3 // Copyright (c) 2016-2021, Knut Reinert & MPI für molekulare Genetik
4 // This file may be used, modified and/or redistributed under the terms of the 3-clause BSD-License
5 // shipped with this file and also available at: https://github.com/seqan/seqan3/blob/master/LICENSE.md
6 // -----------------------------------------------------------------------------------------------------
7 
13 #pragma once
14 
15 #include <ios>
16 #include <stdexcept>
17 
18 #include <seqan3/core/platform.hpp>
19 
20 namespace seqan3
21 {
22 
23 // ----------------------------------------------------------------------------
24 // file open exceptions
25 // ----------------------------------------------------------------------------
26 
30 {
33  {}
34 };
35 
39 {
42  {}
43 };
44 
48 {
51  {}
52 };
53 
57 {
58 #if SEQAN3_WORKAROUND_GCC_NO_CXX11_ABI
59  // std::ios_base::failure is missing the std::error_code constructor in pre-C++11 ABI
60  // see https://en.cppreference.com/w/cpp/io/ios_base/failure
61  using base_t = std::ios_base::failure;
62  using base_t::base_t;
63 #else // ^^^ workaround / no workaround vvv
65  explicit io_error(std::string const & s, std::error_code const & ec = std::io_errc::stream)
66  : std::ios_base::failure{s, ec}
67  {}
68 #endif // SEQAN3_WORKAROUND_GCC_NO_CXX11_ABI
69 };
70 
71 // ----------------------------------------------------------------------------
72 // parse exceptions
73 // ----------------------------------------------------------------------------
74 
78 {
81  {}
82 };
83 
84 // ----------------------------------------------------------------------------
85 // write exceptions
86 // ----------------------------------------------------------------------------
87 
91 {
94  {}
95 };
96 
97 } // namespace seqan3
The main SeqAn3 namespace.
Definition: aligned_sequence_concept.hpp:29
SeqAn specific customisations in the standard namespace.
Provides platform and dependency checks.
Thrown if there is an unspecified filesystem or stream error while opening, e.g. permission problem.
Definition: exception.hpp:39
file_open_error(std::string const &s)
Constructor that forwards the exception string.
Definition: exception.hpp:41
Thrown if information given to output format didn't match expectations.
Definition: exception.hpp:91
format_error(std::string const &s)
Constructor that forwards the exception string.
Definition: exception.hpp:93
Thrown if there is an io error in low level io operations such as in std::basic_streambuf operations.
Definition: exception.hpp:57
Thrown if there is a parse error, such as reading an unexpected character from an input stream.
Definition: exception.hpp:48
parse_error(std::string const &s)
Constructor that forwards the exception string.
Definition: exception.hpp:50
Thrown if I/O was expecting more input (e.g. a delimiter or a new line), but the end of input was rea...
Definition: exception.hpp:78
unexpected_end_of_input(std::string const &s)
Constructor that forwards the exception string.
Definition: exception.hpp:80
Thrown if there is no format that accepts a given file extension.
Definition: exception.hpp:30
unhandled_extension_error(std::string const &s)
Constructor that forwards the exception string.
Definition: exception.hpp:32