21 #ifndef mia_core_cmdoption_hh
22 #define mia_core_cmdoption_hh
29 #include <libxml++/libxml++.h>
61 CCmdOption(
char short_opt,
const char *long_opt,
const char *long_help,
62 const char *short_help,
bool required)__attribute__((deprecated));
64 CCmdOption(
char short_opt,
const char *long_opt,
const char *long_help,
80 size_t get_needed_args()
const;
85 void write_value(std::ostream& os)
const;
90 void set_value(
const char *str_value);
93 const char *get_long_option()
const;
96 char get_short_option()
const;
101 void print_short_help(std::ostream& os)
const;
106 void get_opt_help(std::ostream& os)
const;
111 void get_long_help(std::ostream& os)
const;
114 const std::string get_value_as_string()
const;
117 bool is_required()
const;
120 const char *long_help()
const;
130 std::string get_long_help_xml(xmlpp::Element& parent,
HandlerHelpMap& handler_map)
const;
143 void add_option_xml(xmlpp::Element& parent,
HandlerHelpMap& handler_map)
const;
147 void clear_required();
153 virtual void do_get_long_help(std::ostream& os)
const;
157 std::string get_flag_string()
const;
158 const char *get_short_help()
const;
161 virtual void do_print_short_help(std::ostream& os)
const;
162 virtual void do_get_opt_help(std::ostream& os)
const;
164 virtual bool do_set_value(
const char *str_value) = 0;
165 virtual size_t do_get_needed_args()
const;
166 virtual void do_write_value(std::ostream& os)
const = 0;
168 virtual const std::string do_get_value_as_string()
const;
169 virtual void do_post_set();
171 virtual void do_get_long_help_xml(std::ostream& os, xmlpp::Element& parent,
HandlerHelpMap& handler_map)
const;
174 const char *m_long_opt;
175 const char *m_long_help;
176 const char *m_short_help;
The base class for all command line options.
#define NS_MIA_BEGIN
conveniance define to start the mia namespace
std::map< std::string, const CPluginHandlerBase * > HandlerHelpMap
A map that is used to collect the plug-in handlers used in a program.
std::map< std::string, CCmdOption * > CLongoptionMap
Class to provide a maping from long option names to options.
bool has_flag(CCmdOptionFlags flags, CCmdOptionFlags test)
std::shared_ptr< CCmdOption > PCmdOption
a shared pointer definition of the Option
#define EXPORT_CORE
Macro to manage Visual C++ style dllimport/dllexport.
std::map< char, CCmdOption * > CShortoptionMap
Class to provide a maping from short option names to options.
#define NS_MIA_END
conveniance define to end the mia namespace