cmdlineparser.hh File Reference
#include <vector>
#include <map>
#include <memory>
#include <sstream>
#include <iostream>
#include <string>
#include <iterator>
#include <mia/core/cmdparamoption.hh>
#include <mia/core/dictmap.hh>
#include <mia/core/flagstring.hh>
#include <mia/core/handlerbase.hh>
#include <mia/core/selftestcmdoption.hh>
Include dependency graph for cmdlineparser.hh:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

class  CCmdFlagOption
 Command line option that translates a string to a set of flags. More...
 
class  CCmdOptionList
 The class to hold the list of options. More...
 

Typedefs

typedef std::pair< std::string, CHistoryRecordCHistoryEntry
 
typedef std::map< std::string, std::string > CHistoryRecord
 
typedef std::map< EProgramDescriptionEntry, const char * > SProgramDescription
 the map that holds a basic program description More...
 

Enumerations

enum  EProgramDescriptionEntry {
  pdi_group = 0, pdi_short = 1, pdi_description = 2, pdi_example_descr = 3,
  pdi_example_code = 4, pdi_author = 5
}
 program description entry identifiers More...
 

Functions

template<typename T >
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. More...
 
template<typename T >
PCmdOption make_opt (T &value, EParameterBounds bflags, const std::vector< T > &bounds, const char *long_opt, char short_opt, const char *help, CCmdOptionFlags flags=CCmdOptionFlags::none)
 Create an option of a scalar value that can have boundaries. More...
 
PCmdOption make_opt (bool &value, const char *long_opt, char short_opt, const char *help, CCmdOptionFlags flags=CCmdOptionFlags::none)
 Create an option that represents a flag. More...
 
template<typename T >
PCmdOption make_opt (T &value, const TDictMap< T > &map, const char *long_opt, char short_opt, const char *help)
 Create a table lookup option. More...
 
PCmdOption make_opt (int &value, const CFlagString &map, const char *long_opt, char short_opt, const char *long_help, const char *short_help, CCmdOptionFlags flags=CCmdOptionFlags::none)
 Create a flag lookup option. More...
 
PCmdOption make_opt (std::string &value, const char *long_opt, char short_opt, const char *long_help, CCmdOptionFlags flags=CCmdOptionFlags::none, const CPluginHandlerBase *plugin_hint=NULL)
 Create an option to set a string. More...
 
template<typename T >
PCmdOption make_opt (T &value, const std::set< T > &valid_set, const char *long_opt, char short_opt, const char *help, CCmdOptionFlags flags=CCmdOptionFlags::none)
 Create an oĆ¼ption that only takes values from a pre-defined set. More...
 
template<typename T >
PCmdOption make_opt (typename std::shared_ptr< T > &value, const char *default_value, const char *long_opt, char short_opt, const char *help, CCmdOptionFlags flags=CCmdOptionFlags::none)
 Create a command line option that creates uses a factory to create an object based on the given description. More...
 
template<typename T >
PCmdOption make_opt (typename std::unique_ptr< T > &value, const char *default_value, const char *long_opt, char short_opt, const char *help, CCmdOptionFlags flags=CCmdOptionFlags::none)
 Create a command line option that creates uses a factory to create an object based on the given description. More...
 

Variables

const std::map< EProgramDescriptionEntry, const char * > g_DescriptionEntryNames
 
EXPORT_CORE const char * g_help_optiongroup
 the string defining the name of the help options More...
 

Typedef Documentation

◆ CHistoryEntry

typedef std::pair<std::string, CHistoryRecord> CHistoryEntry

holds the name of the program and the associated history record

Definition at line 47 of file cmdlineparser.hh.

◆ CHistoryRecord

typedef std::map<std::string, std::string> CHistoryRecord

holds the history info of a certain program call

Definition at line 44 of file cmdlineparser.hh.

Variable Documentation

◆ g_DescriptionEntryNames

const std::map<EProgramDescriptionEntry, const char *> g_DescriptionEntryNames

◆ g_help_optiongroup

EXPORT_CORE const char* g_help_optiongroup

the string defining the name of the help options