Data Structures | Typedefs | Enumerations | Functions | Variables
cmdlineparser.hh File Reference
#include <vector>
#include <map>
#include <memory>
#include <sstream>
#include <iostream>
#include <string>
#include <iterator>
#include <mia/core/cmdoption.hh>
#include <mia/core/typedescr.hh>
#include <mia/core/paramoption.hh>
#include <mia/core/dictmap.hh>
#include <mia/core/flagstring.hh>
#include <mia/core/handlerbase.hh>

Go to the source code of this file.

Data Structures

class  CHelpOption::Callback
 Interface for the callback to print the help assositated with the given option. More...
 
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...
 
class  CHelpOption
 A command line option that will appear in the help group and exits the program after printing the help. More...
 
class  TCmdOption< T >
 Templated version based on CCmdOptionValue for values that can be converted to and from strings by stream operators. More...
 
class  TPluginHandlerHelpCallback< PluginHandler >
 Help callback to print the help for the given plug-in. More...
 

Typedefs

typedef std::pair< std::string,
CHistoryRecord
CHistoryEntry
 
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

PCmdOption make_help_opt (const char *long_opt, char short_opt, const char *long_help, CHelpOption::Callback *cb)
 Create a command line help option. More...
 
template<typename T >
PCmdOption make_opt (T &value, const char *long_opt, char short_opt, const char *help, bool flags=false)
 Create a standard option that sets a value of the give type. More...
 
template<typename T , typename Tmin , typename Tmax >
PCmdOption make_opt (T &value, Tmin min, Tmax max, const char *long_opt, char short_opt, const char *help, bool flags=false)
 Create an option of a scalar value that is expecte to be within a given range. More...
 
template<typename T >
PCmdOption make_opt (std::vector< T > &value, const char *long_opt, char short_opt, const char *help, bool required=false)
 Create an option to set a vector of values,. More...
 
PCmdOption make_opt (bool &value, const char *long_opt, char short_opt, const char *help)
 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, bool flags=false)
 Create a flag lookup option. More...
 
PCmdOption make_opt (std::string &value, const char *long_opt, char short_opt, const char *long_help, bool required=false, 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, bool required=false)
 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, bool required=false)
 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, bool required=false)
 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

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

holds the name of the program and the associated history record

Definition at line 49 of file cmdlineparser.hh.

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

holds the history info of a certain program call

Definition at line 46 of file cmdlineparser.hh.

Variable Documentation

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

the string defining the name of the help options