hpx/program_options/errors.hpp¶
See Public API for a list of names and headers that are part of the public HPX API.
-
namespace
hpx
-
namespace
program_options
-
-
class
ambiguous_option
: public hpx::program_options::error_with_no_option_name¶ - #include <errors.hpp>
Class thrown when there’s ambiguity among several possible options.
Public Functions
-
~ambiguous_option
()¶
Protected Functions
-
-
class
error
: public logic_error¶ - #include <errors.hpp>
Base class for all errors in the library.
Subclassed by hpx::program_options::duplicate_option_error, hpx::program_options::error_with_option_name, hpx::program_options::invalid_command_line_style, hpx::program_options::reading_file, hpx::program_options::too_many_positional_options_error
-
class
error_with_no_option_name
: public hpx::program_options::error_with_option_name¶ - #include <errors.hpp>
Base class of un-parsable 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 hierarchy makes error handling a lot easier, even if the name indicates some sort of conceptual dissonance!
Subclassed by hpx::program_options::ambiguous_option, hpx::program_options::unknown_option
-
class
error_with_option_name
: public hpx::program_options::error¶ - #include <errors.hpp>
Base class for most exceptions in the library.
Substitutes the values for the parameter name placeholders in the template to create the human readable error message
Placeholders are surrounded by % signs: example% Poor man’s version of boost::format
If a parameter name is absent, perform default substitutions instead so ugly placeholders are never left in-place.
Options are displayed in “canonical” form This is the most unambiguous form of the parsed option name and would correspond to option_description::format_name() i.e. what is shown by print_usage()
The “canonical” form depends on whether the option is specified in short or long form, using dashes or slashes or without a prefix (from a configuration file)
Subclassed by hpx::program_options::error_with_no_option_name, hpx::program_options::invalid_syntax, hpx::program_options::multiple_occurrences, hpx::program_options::multiple_values, hpx::program_options::required_option, hpx::program_options::validation_error
Public Functions
-
error_with_option_name
(const std::string &template_, const std::string &option_name = "", const std::string &original_token = "", int option_style = 0)¶
-
~error_with_option_name
()¶ gcc says that throw specification on dtor is loosened without this line
-
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
-
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
-
void
add_context
(const std::string &option_name, const std::string &original_token, int option_style)¶ Add context to an exception
-
void
set_prefix
(int option_style)¶
-
virtual void
set_option_name
(const std::string &option_name)¶ Overridden in error_with_no_option_name
-
const char *
what
() const¶ Creates the error_message on the fly Currently a thin wrapper for substitute_placeholders()
Protected Functions
-
virtual void
substitute_placeholders
(const std::string &error_template) const¶ Makes all substitutions using the template
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
-
std::map<std::string, string_pair>
m_substitution_defaults
¶
-
-
class
invalid_bool_value
: public hpx::program_options::validation_error¶ - #include <errors.hpp>
Class thrown if there is an invalid bool value given
-
class
invalid_command_line_style
: public hpx::program_options::error¶ - #include <errors.hpp>
Class thrown when there are programming error related to style
-
class
invalid_command_line_syntax
: public hpx::program_options::invalid_syntax¶ - #include <errors.hpp>
Class thrown when there are syntax errors in given command line
-
class
invalid_config_file_syntax
: public hpx::program_options::invalid_syntax¶
-
class
invalid_option_value
: public hpx::program_options::validation_error¶ - #include <errors.hpp>
Class thrown if there is an invalid option value given
-
class
invalid_syntax
: public hpx::program_options::error_with_option_name¶ - #include <errors.hpp>
Class thrown when there’s syntax error either for command line or config file options. See derived children for concrete classes.
Subclassed by hpx::program_options::invalid_command_line_syntax, hpx::program_options::invalid_config_file_syntax
Public Types
Public Functions
-
invalid_syntax
(kind_t kind, const std::string &option_name = "", const std::string &original_token = "", int option_style = 0)¶
-
~invalid_syntax
()¶
Protected Functions
-
-
class
multiple_occurrences
: public hpx::program_options::error_with_option_name¶ - #include <errors.hpp>
Class thrown when there are several occurrences of an option, but user called a method which cannot return them all.
-
class
multiple_values
: public hpx::program_options::error_with_option_name¶ - #include <errors.hpp>
Class thrown when there are several option values, but user called a method which cannot return them all.
-
class
reading_file
: public hpx::program_options::error¶ - #include <errors.hpp>
Class thrown if config file can not be read
Public Functions
-
reading_file
(const char *filename)¶
-
-
class
required_option
: public hpx::program_options::error_with_option_name¶ - #include <errors.hpp>
Class thrown when a required/mandatory option is missing
-
class
too_many_positional_options_error
: public hpx::program_options::error¶ - #include <errors.hpp>
Class thrown when there are too many positional options. This is a programming error.
Public Functions
-
too_many_positional_options_error
()¶
-
-
class
unknown_option
: public hpx::program_options::error_with_no_option_name¶ - #include <errors.hpp>
Class thrown when option name is not recognized.
-
class
validation_error
: public hpx::program_options::error_with_option_name¶ - #include <errors.hpp>
Class thrown when value of option is incorrect.
Subclassed by hpx::program_options::invalid_bool_value, hpx::program_options::invalid_option_value
Public Types
Public Functions
-
validation_error
(kind_t kind, const std::string &option_name = "", const std::string &original_token = "", int option_style = 0)¶
-
~validation_error
()¶
Protected Functions
-
-
class
-
namespace