SeqAn3  3.0.3
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 
26 // ----------------------------------------------------------------------------
27 // file open exceptions
28 // ----------------------------------------------------------------------------
29 
32 {
35  {}
36 };
37 
40 {
43  {}
44 };
45 
48 {
51  {}
52 };
53 
56 {
57 #if SEQAN3_WORKAROUND_GCC_NO_CXX11_ABI
58  // std::ios_base::failure is missing the std::error_code constructor in pre-C++11 ABI
59  // see https://en.cppreference.com/w/cpp/io/ios_base/failure
60  using base_t = std::ios_base::failure;
61  using base_t::base_t;
62 #else // ^^^ workaround / no workaround vvv
64  explicit io_error(std::string const & s, std::error_code const & ec = std::io_errc::stream)
65  : std::ios_base::failure{s, ec}
66  {}
67 #endif // SEQAN3_WORKAROUND_GCC_NO_CXX11_ABI
68 };
69 
70 // ----------------------------------------------------------------------------
71 // parse exceptions
72 // ----------------------------------------------------------------------------
73 
76 {
79  {}
80 };
81 
82 // ----------------------------------------------------------------------------
83 // write exceptions
84 // ----------------------------------------------------------------------------
85 
88 {
91  {}
92 };
93 
95 
96 } // 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:40
file_open_error(std::string const &s)
Constructor that forwards the exception string.
Definition: exception.hpp:42
Thrown if information given to output format didn't match expectations.
Definition: exception.hpp:88
format_error(std::string const &s)
Constructor that forwards the exception string.
Definition: exception.hpp:90
Thrown if there is an io error in low level io operations such as in std::basic_streambuf operations.
Definition: exception.hpp:56
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:76
unexpected_end_of_input(std::string const &s)
Constructor that forwards the exception string.
Definition: exception.hpp:78
Thrown if there is no format that accepts a given file extension.
Definition: exception.hpp:32
unhandled_extension_error(std::string const &s)
Constructor that forwards the exception string.
Definition: exception.hpp:34