gatb.core-API-0.0.0
OptionOneParam Class Reference

Option that has one argument. More...

#include <OptionsParser.hpp>

Inheritance diagram for OptionOneParam:
Inheritance graph

Public Member Functions

 OptionOneParam (const std::string &name, const std::string &help, bool mandatory=false, const std::string &defaultValue="", bool visible=true)
 
void proceed (const std::list< std::string > &args, IProperties &props)
 
- Public Member Functions inherited from Option
 Option (const std::string &name, int nbArgs, bool mandatory, const std::string &defaultValue, bool visible, const std::string &help)
 
virtual ~Option ()
 
std::string getDefaultValue () const
 
void setDefaultValue (const std::string &value)
 
bool isMandatory () const
 
IOptionsParsergetParser (const std::string &name)
 
void accept (IOptionsParserVisitor &visitor, size_t depth=0)
 
- Public Member Functions inherited from OptionsParser
 OptionsParser (const std::string &name="", const std::string &help="")
 
virtual ~OptionsParser ()
 
const std::string & getName () const
 
void setName (const std::string &name)
 
void setVisible (bool status)
 
bool isVisible () const
 
const std::string & getHelp () const
 
void setHelp (const std::string &help)
 
misc::IPropertiesparse (int argc, char **argv)
 
misc::IPropertiesparseString (const std::string &s)
 
misc::IPropertiesgetProperties ()
 
bool saw (const std::string &name) const
 
void push_back (IOptionsParser *parser, size_t expandDepth=0, bool visibility=true)
 
void push_front (IOptionsParser *parser, size_t expandDepth=0, bool visibility=true)
 
std::list< IOptionsParser * > & getParsers ()
 
misc::IPropertiesgetDefaultProperties ()
 
- Public Member Functions inherited from SmartPointer
void use ()
 
void forget ()
 
- Public Member Functions inherited from ISmartPointer
virtual ~ISmartPointer ()
 

Additional Inherited Members

- Protected Member Functions inherited from Option
size_t getNbArgs () const
 
- Protected Member Functions inherited from SmartPointer
 SmartPointer ()
 
virtual ~SmartPointer ()
 

Detailed Description

Option that has one argument.

This is a special option with only one argument.

Constructor & Destructor Documentation

OptionOneParam ( const std::string &  name,
const std::string &  help,
bool  mandatory = false,
const std::string &  defaultValue = "",
bool  visible = true 
)
inline

Constructor.

Parameters
[in]name: name of the option
[in]help: textual help for this option
[in]mandatory: tells whether this option is mandatory or not
[in]defaultValue: default value for the option
[in]visible: tells whether this option may be shown in help

Member Function Documentation

void proceed ( const std::list< std::string > &  args,
IProperties props 
)
inlinevirtual

When an option is recognized in the arguments list, we look the number of waited args and put them in a list of string objects. This is this list that is given as argument of the proceed() method that mainly will affect the given args to the variable given to the instantiation of the (derived class) Option.

Implements Option.


The documentation for this class was generated from the following file: