A condition checker, that wraps a parse condition and throws a specified exception if the condition was not met. More...
#include <seqan3/io/stream/parse_condition.hpp>
Public Member Functions | |
template<char_adaptation_concept char_type> | |
void | operator() (char_type const c) const |
Checks if the given character satisfies the associated parse condition. More... | |
constexpr | parse_asserter (condition_type const &) noexcept |
Allow type deduction from constructor argument. | |
Static Public Attributes | |
static condition_type constexpr | cond {} |
Stores an instance of the stateless condition. | |
A condition checker, that wraps a parse condition and throws a specified exception if the condition was not met.
condition_type | The wrapped parse condition type to be use for testing. |
The parse_asserter
type is used to enforce that a parsed character satisfies certain conditions. For example, when reading an input fasta file and the expected alphabet is a dna4 but the actual data contained in the file is based on amino acids. Thus, the condition would not be satisfied, causing the exception to be thrown.
|
inline |
Checks if the given character satisfies the associated parse condition.
[in] | c | The character to be checked. Must satisfy the seqan3::char_adaptation_concept. |
Depends on the underlying condition to be checked. In the regular case it is constant.
Throws seqan3::parse_error if the associated condition is not met.
Thread-safe.