Go to the documentation of this file.
21 #ifndef mia_core_cmdlineparser_hh
22 #define mia_core_cmdlineparser_hh
106 const char *
long_help,
const char *short_help,
109 virtual bool do_set_value(
const char *str_value);
110 virtual size_t do_get_needed_args()
const;
111 virtual void do_write_value(std::ostream& os)
const;
112 virtual void do_get_long_help(std::ostream& os)
const;
113 virtual const std::string do_get_value_as_string()
const;
164 void add(
const std::string& group,
PCmdOption opt);
187 EHelpRequested parse(
size_t argc,
char *args[],
const std::string& additional_type,
189 __attribute__((warn_unused_result));
202 EHelpRequested parse(
size_t argc,
const char *args[],
const std::string& additional_type,
204 __attribute__((warn_unused_result));
211 EHelpRequested parse(
size_t argc,
char *args[]) __attribute__((warn_unused_result));
218 EHelpRequested parse(
size_t argc,
const char *args[]) __attribute__((warn_unused_result));
221 const std::vector<std::string>& get_remaining()
const;
232 void set_group(
const std::string& group);
238 void set_logstream(std::ostream& os);
243 void set_stdout_is_result();
245 EHelpRequested do_parse(
size_t argc,
const char *args[],
bool has_additional,
247 __attribute__((warn_unused_result));
248 int handle_shortargs(
const char *arg,
size_t argc,
const char *args[]);
249 struct CCmdOptionListData *m_impl;
272 template <
typename T>
295 template <
typename T>
297 const char *long_opt,
char short_opt,
319 PCmdOption make_opt(
bool& value,
const char *long_opt,
char short_opt,
const char *help,
337 template <
typename T>
339 const char *long_opt,
char short_opt,
const char *help)
363 char short_opt,
const char *long_help,
364 const char *short_help,
383 PCmdOption make_opt(std::string& value,
const char *long_opt,
char short_opt,
const char *long_help,
403 template <
typename T>
405 const char *long_opt,
char short_opt,
434 template <
typename T>
435 PCmdOption make_opt(
typename std::shared_ptr<T>& value,
const char *default_value,
const char *long_opt,
436 char short_opt,
const char *help,
440 typedef typename FactoryTrait<T>::type F;
463 template <
typename T>
464 PCmdOption make_opt(
typename std::unique_ptr<T>& value,
const char *default_value,
const char *long_opt,
468 typedef typename FactoryTrait<T>::type F;
const char * long_help() const
const std::map< EProgramDescriptionEntry, const char * > g_DescriptionEntryNames
EProgramDescriptionEntry
program description entry identifiers
#define NS_MIA_BEGIN
conveniance define to start the mia namespace
std::map< std::string, std::string > CHistoryRecord
#define NS_MIA_END
conveniance define to end the mia namespace
const mia::SProgramDescription description
The class to hold the list of options.
Command line option that translates a string to a set of flags.
command line option that handles a parameter
std::map< EProgramDescriptionEntry, const char * > SProgramDescription
the map that holds a basic program description
A parameter that get's initialized by a factory to a shared or unique pointer.
const EXPORT_CORE char * g_help_optiongroup
the string defining the name of the help options
EParameterBounds
Scalar parameter with an expected value range.
A mapper from emums to string values. - usefull for names flags.
A parameter that can only assume values out of a limited set.
std::pair< std::string, CHistoryRecord > CHistoryEntry
The base class for all plugin handlers.
#define EXPORT_CORE
Macro to manage Visual C++ style dllimport/dllexport.
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 base class for all command line options.
Generic type of a complex paramter.
std::shared_ptr< CCmdOption > PCmdOption
a shared pointer definition of the Option
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)