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;
189 __attribute__((warn_unused_result));
204 __attribute__((warn_unused_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,
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,
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
void add(const std::string &group, PCmdOption opt)
EProgramDescriptionEntry
program description entry identifiers
#define NS_MIA_BEGIN
conveniance define to start the mia namespace
EXPORT_CORE const char * g_help_optiongroup
the string defining the name of the help options
EHelpRequested parse(size_t argc, const char *args[], const std::string &additional_type, const CPluginHandlerBase *additional_help=NULL) __attribute__((warn_unused_result))
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.
EHelpRequested parse(size_t argc, char *args[], const std::string &additional_type, const CPluginHandlerBase *additional_help=NULL) __attribute__((warn_unused_result))
EHelpRequested parse(size_t argc, char *args[]) __attribute__((warn_unused_result))
Command line option that translates a string to a set of flags.
CCmdOptionList(const SProgramDescription &description)
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.
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.
void set_stdout_is_result()
std::pair< std::string, CHistoryRecord > CHistoryEntry
The base class for all plugin handlers.
const std::vector< std::string > & get_remaining() const
void set_group(const std::string &group)
#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.
CHistoryRecord get_values() const
The base class for all command line options.
Generic type of a complex paramter.
EHelpRequested parse(size_t argc, const char *args[]) __attribute__((warn_unused_result))
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)
void add_selftest(int &test_result, CSelftestCallback *callback)
void set_logstream(std::ostream &os)