21 #ifndef mia_core_cmdlineparser_hh 22 #define mia_core_cmdlineparser_hh 105 const char *
long_help,
const char *short_help,
108 virtual bool do_set_value(
const char *str_value);
109 virtual size_t do_get_needed_args()
const;
110 virtual void do_write_value(std::ostream& os)
const;
111 virtual void do_get_long_help(std::ostream& os)
const;
112 virtual const std::string do_get_value_as_string()
const;
162 void add(
const std::string& group,
PCmdOption opt);
185 EHelpRequested parse(
size_t argc,
char *args[],
const std::string& additional_type,
187 __attribute__((warn_unused_result));
200 EHelpRequested parse(
size_t argc,
const char *args[],
const std::string& additional_type,
202 __attribute__((warn_unused_result));
209 EHelpRequested parse(
size_t argc,
char *args[]) __attribute__((warn_unused_result));
216 EHelpRequested parse(
size_t argc,
const char *args[]) __attribute__((warn_unused_result));
219 const std::vector<std::string>& get_remaining()
const;
230 void set_group(
const std::string& group);
236 void set_logstream(std::ostream& os);
241 void set_stdout_is_result();
243 EHelpRequested do_parse(
size_t argc,
const char *args[],
bool has_additional,
245 __attribute__((warn_unused_result));
246 int handle_shortargs(
const char *arg,
size_t argc,
const char *args[]);
247 struct CCmdOptionListData *m_impl;
270 template <
typename T>
293 template <
typename T>
295 const char *long_opt,
char short_opt,
317 PCmdOption make_opt(
bool& value,
const char *long_opt,
char short_opt,
const char *help,
335 template <
typename T>
337 const char *long_opt,
char short_opt,
const char *help)
362 const char *short_help,
381 PCmdOption make_opt(std::string& value,
const char *long_opt,
char short_opt,
const char *long_help,
401 template <
typename T>
403 const char *long_opt,
char short_opt,
432 template <
typename T>
433 PCmdOption make_opt(
typename std::shared_ptr<T>& value,
const char *default_value,
const char *long_opt,
434 char short_opt,
const char *help,
438 typedef typename FactoryTrait<T>::type F;
461 template <
typename T>
462 PCmdOption make_opt(
typename std::unique_ptr<T>& value,
const char *default_value,
const char *long_opt,
466 typedef typename FactoryTrait<T>::type F;
std::pair< std::string, CHistoryRecord > CHistoryEntry
EXPORT_CORE const char * g_help_optiongroup
the string defining the name of the help options
std::map< std::string, std::string > CHistoryRecord
A parameter that get's initialized by a factory to a shared or unique pointer.
A parameter that can only assume values out of a limited set.
The base class for all command line options.
#define NS_MIA_BEGIN
conveniance define to start the mia namespace
Command line option that translates a string to a set of flags.
std::map< EProgramDescriptionEntry, const char * > SProgramDescription
the map that holds a basic program description
The base class for all plugin handlers.
Generic type of a complex paramter.
EParameterBounds
Scalar parameter with an expected value range.
CCmdFlagOption(int &val, const CFlagString &map, char short_opt, const char *long_opt, const char *long_help, const char *short_help, CCmdOptionFlags flags=CCmdOptionFlags::none)
const char * long_help() const
command line option that handles a parameter
const mia::SProgramDescription description
std::shared_ptr< CCmdOption > PCmdOption
a shared pointer definition of the Option
EProgramDescriptionEntry
program description entry identifiers
#define EXPORT_CORE
Macro to manage Visual C++ style dllimport/dllexport.
bool has_flag(CCmdOptionFlags test_flags) const
PCmdOption make_opt(T &value, const char *long_opt, char short_opt, const char *help, CCmdOptionFlags flags=CCmdOptionFlags::none)
Create a standard option that sets a value of the give type.
The class to hold the list of options.
const std::map< EProgramDescriptionEntry, const char * > g_DescriptionEntryNames
A mapper from emums to string values. - usefull for names flags.
#define NS_MIA_END
conveniance define to end the mia namespace