arg_router  1.4.0
C++ command line argument parsing and routing
arg_router::parse_exception Class Reference

#include <arg_router/exception.hpp>

Inherits std::exception.

Public Member Functions

 parse_exception (const string &message, const vector< parsing::token_type > &tokens={})
 
 parse_exception (const string &message, const parsing::token_type &token)
 
template<typename S >
 parse_exception (utility::exception_formatter< S > cts, const vector< parsing::token_type > &tokens={})
 

Detailed Description

An exception that represents a parsing failure.

Note
Because the standard library exception types that accept a std::basic_string in their constructor (e.g. std::logic_error) do not have an allocator template parameter, we cannot use them even though they would be easier in this circumstance. Because of this we have to carry our own string member which may throw upon copying, which means that technically this exception type isn't std::exception compatible as the copy constructor cannot be marked as nothrow

Definition at line 160 of file exception.hpp.

Constructor & Destructor Documentation

◆ parse_exception() [1/3]

arg_router::parse_exception::parse_exception ( const string message,
const vector< parsing::token_type > &  tokens = {} 
)
inlineexplicit

Token list constructor.

Parameters
messageError message
tokensTokens that caused the error

Definition at line 168 of file exception.hpp.

◆ parse_exception() [2/3]

arg_router::parse_exception::parse_exception ( const string message,
const parsing::token_type token 
)
inline

Token constructor.

Parameters
messageError message
tokenToken that caused the error

Definition at line 179 of file exception.hpp.

◆ parse_exception() [3/3]

template<typename S >
arg_router::parse_exception::parse_exception ( utility::exception_formatter< S >  cts,
const vector< parsing::token_type > &  tokens = {} 
)
inline

Formatter constructor.

Template Parameters
SCompile-time string type
Parameters
ctsCompile-time string instance
tokensTokens to pass to the formatter's placeholders

Definition at line 191 of file exception.hpp.


The documentation for this class was generated from the following file: