option_parser.h
Go to the documentation of this file.
205 option(const value_container<T>& value, const std::string &flag, const std::string &help) : abstract_option(flag, help), m_value(
226 INTEROP_THROW(invalid_option_value_exception, "Failed to parse character: " << static_cast<char>(ch));
275 option_parser &operator()(const value_container<T> &value, const std::string &flag, const std::string &help)
343 void display_help(std::ostream &out, const char* prefix="\t", const char* sep=": ", const char* postfix="\n")
346 out << prefix << "--"<< m_options[i]->flag() << "[" << m_options[i]->get_value() << "]" << sep << m_options[i]->help() << postfix;
option_parser & operator()(T &value, const std::string &flag, const std::string &help)
Definition: option_parser.h:262
invalid_option_exception(const std::string &msg)
Definition: option_parser.h:101
bool is_help_requested(int argc, const char **argv)
Definition: option_parser.h:286
void check_for_unknown_options(const int argc, const char **argv)
Definition: option_parser.h:326
void set_value(const value_type &val) const
Definition: option_parser.h:160
Definition: enum_description.h:15
Definition: option_parser.h:94
value_container(T *ptr_obj, function_pointer ptr_func)
Definition: option_parser.h:154
Definition: option_parser.h:143
Definition: option_parser.h:249
Definition: option_parser.h:106
void set_value(const std::string &str)
Definition: option_parser.h:217
value_container< R(T::*)(P1) > wrap_setter(T &obj, R(T::*func)(P1))
Definition: option_parser.h:184
abstract_option(const std::string &flag, const std::string &help)
Definition: option_parser.h:32
virtual std::string get_value() const =0
const std::string & flag() const
Definition: option_parser.h:53
void display_help(std::ostream &out, const char *prefix="\t", const char *sep=": ", const char *postfix="\n")
Definition: option_parser.h:343
std::string get_value() const
Definition: option_parser.h:232
Definition: option_parser.h:83
invalid_option_value_exception(const std::string &msg)
Definition: option_parser.h:90
Definition: option_parser.h:72
P1 value_type
Definition: option_parser.h:148
virtual ~abstract_option()
Definition: option_parser.h:36
option_exception(const std::string &msg)
Definition: option_parser.h:79
option(const value_container< T > &value, const std::string &flag, const std::string &help)
Definition: option_parser.h:205
Definition: enums.h:301
void parse(int &argc, const char **argv)
Definition: option_parser.h:304
value_container(T *ptr)
Definition: option_parser.h:115
Definition: option_parser.h:24
const std::string & help() const
Definition: option_parser.h:61
Definition: option_parser.h:196
virtual void set_value(const std::string &str)=0
option_parser & operator()(const value_container< T > &value, const std::string &flag, const std::string &help)
Definition: option_parser.h:275
void set_value(const value_type &val) const
Definition: option_parser.h:123