1 #ifndef OOKII_PARSE_RESULT_H_
4 #define OOKII_PARSE_RESULT_H_
60 template<
typename CharType,
typename Traits = std::
char_traits<CharType>,
typename Alloc = std::allocator<CharType>>
64 using string_type = std::basic_string<CharType, Traits, Alloc>;
76 : string_provider{&string_provider},
78 error_arg_name{error_arg_name}
94 operator bool() const noexcept
Provides custom localized strings.
Definition: localized_string_provider.h:30
virtual string_type duplicate_argument(string_view_type argument_name) const
Gets the error message for parse_error::duplicate_argument.
Definition: localized_string_provider.h:67
virtual string_type combined_short_name_non_switch(string_view_type argument_name) const
Gets the error message for parse_error::combined_short_name_non_switch.
Definition: localized_string_provider.h:87
virtual string_type too_many_arguments() const
Gets the error message for parse_error::too_many_arguments.
Definition: localized_string_provider.h:73
virtual string_type unknown_error() const
Gets the error message for parse_error::unknown.
Definition: localized_string_provider.h:93
virtual string_type invalid_value(string_view_type argument_name) const
Gets the error message for parse_error::invalid_value.
Definition: localized_string_provider.h:46
virtual string_type unknown_argument(string_view_type argument_name) const
Gets the error message for parse_error::unknown_argument.
Definition: localized_string_provider.h:53
virtual string_type missing_value(string_view_type argument_name) const
Gets the error message for parse_error::missing_value.
Definition: localized_string_provider.h:60
virtual string_type missing_required_argument(string_view_type argument_name) const
Gets the error message for parse_error::missing_required_argument.
Definition: localized_string_provider.h:80
Provides the ookii::basic_localized_string_provider class.
Namespace containing the core Ookii.CommandLine.Cpp types.
Definition: command_line_argument.h:16
@ error
There was an error converting the value to the element type of the argument.
parse_error
The type of error that occurred while parsing the command line.
Definition: parse_result.h:14
@ invalid_value
A supplied value could not be converted to the argument's type.
@ parsing_cancelled
Parsing was cancelled by an argument using basic_parser_builder::argument_builder_common::cancel_pars...
@ unknown_argument
An argument name was supplied that doesn't exist.
@ missing_required_argument
One of the required arguments was not supplied.
@ duplicate_argument
An argument, other than a multi-value argument, was supplied more than once, and basic_parser_builder...
@ missing_value
A named argument, other than a switch argument, was supplied without a value.
@ too_many_arguments
More positional arguments were supplied than were defined.
@ combined_short_name_non_switch
A combined short argument contains an argument that is not a switch.
Provides the result, success or error, of a command line argument parsing operation.
Definition: parse_result.h:62
const string_provider_type * string_provider
The string provider used to get error messages.
Definition: parse_result.h:83
parse_error error
The type of error that occurred, or parse_error::none to indicate no error.
Definition: parse_result.h:86
parse_result(const string_provider_type &string_provider, parse_error error=parse_error::none, string_type error_arg_name={})
Initializes a new instance of the parse_result structure.
Definition: parse_result.h:75
string_type error_arg_name
The name of the argument that caused the error, or a blank string if there was no error or the error ...
Definition: parse_result.h:90
string_type get_error_message() const
Gets a default, English language error message for the current error.
Definition: parse_result.h:105
std::basic_string< CharType, Traits, Alloc > string_type
The concrete string type used by this structure.
Definition: parse_result.h:64