Base class of unparsable options, when the desired option cannot be identified. More...
#include <errors.hpp>
Public Member Functions | |
error_with_no_option_name (const std::string &template_, const std::string &original_token="") | |
virtual void | set_option_name (const std::string &) |
Does NOT set option name, because no option name makes sense. More... | |
~error_with_no_option_name () throw () | |
void | set_substitute (const std::string ¶meter_name, const std::string &value) |
Substitute parameter_name->value to create the error message from the error template. More... | |
void | set_substitute_default (const std::string ¶meter_name, const std::string &from, const std::string &to) |
If the parameter is missing, then make the from->to substitution instead. More... | |
void | add_context (const std::string &option_name, const std::string &original_token, int option_style) |
Add context to an exception. More... | |
void | set_prefix (int option_style) |
std::string | get_option_name () const throw () |
void | set_original_token (const std::string &original_token) |
virtual const char * | what () const throw () |
Creates the error_message on the fly Currently a thin wrapper for substitute_placeholders() More... | |
Public Attributes | |
std::string | m_error_template |
template with placeholders More... | |
Protected Types | |
typedef std::pair< std::string, std::string > | string_pair |
Protected Member Functions | |
virtual void | substitute_placeholders (const std::string &error_template) const |
Makes all substitutions using the template. More... | |
void | replace_token (const std::string &from, const std::string &to) const |
std::string | get_canonical_option_name () const |
Construct option name in accordance with the appropriate prefix style: i.e. More... | |
std::string | get_canonical_option_prefix () const |
Protected Attributes | |
int | m_option_style |
can be 0 = no prefix (config file options) allow_long allow_dash_for_short allow_slash_for_short allow_long_disguise More... | |
std::map< std::string, std::string > | m_substitutions |
substitutions from placeholders to values More... | |
std::map< std::string, string_pair > | m_substitution_defaults |
std::string | m_message |
Used to hold the error text returned by what() More... | |
Base class of unparsable options, when the desired option cannot be identified.
It makes no sense to have an option name, when we can't match an option to the parameter
Having this a part of the error_with_option_name hierachy makes error handling a lot easier, even if the name indicates some sort of conceptual dissonance!
|
protectedinherited |
|
inline |
|
inline |
|
inlineinherited |
Add context to an exception.
|
protectedinherited |
Construct option name in accordance with the appropriate prefix style: i.e.
long dash or short slash etc
|
protectedinherited |
|
inlineinherited |
|
protectedinherited |
|
inlinevirtual |
Does NOT set option name, because no option name makes sense.
Reimplemented from boost::program_options::error_with_option_name.
|
inlineinherited |
|
inlineinherited |
|
inlineinherited |
Substitute parameter_name->value to create the error message from the error template.
References boost::program_options::value().
|
inlineinherited |
If the parameter is missing, then make the from->to substitution instead.
References boost::xpressive::make_pair.
|
protectedvirtualinherited |
Makes all substitutions using the template.
Reimplemented in boost::program_options::ambiguous_option.
|
virtualinherited |
Creates the error_message on the fly Currently a thin wrapper for substitute_placeholders()
|
inherited |
template with placeholders
|
mutableprotectedinherited |
Used to hold the error text returned by what()
|
protectedinherited |
can be 0 = no prefix (config file options) allow_long allow_dash_for_short allow_slash_for_short allow_long_disguise
|
protectedinherited |
|
protectedinherited |
substitutions from placeholders to values