gatb.core-API-0.0.0
|
Implementation of the IOptionsParser interface. More...
#include <OptionsParser.hpp>
Public Member Functions | |
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::IProperties * | parse (int argc, char **argv) |
misc::IProperties * | parseString (const std::string &s) |
misc::IProperties * | getProperties () |
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) |
IOptionsParser * | getParser (const std::string &name) |
std::list< IOptionsParser * > & | getParsers () |
misc::IProperties * | getDefaultProperties () |
void | accept (IOptionsParserVisitor &visitor, size_t depth=0) |
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 SmartPointer | |
SmartPointer () | |
virtual | ~SmartPointer () |
Implementation of the IOptionsParser interface.
This implementation represents the 'composite' part of the Composite design pattern.
Example:
OptionsParser | ( | const std::string & | name = "" , |
const std::string & | help = "" |
||
) |
Constructor.
|
virtual |
Destructor.
|
inlinevirtual |
|
virtual |
|
inlinevirtual |
Get help.
Implements IOptionsParser.
|
inlinevirtual |
Get name.
Implements IOptionsParser.
|
virtual |
Get a parser given its name.
[in] | name | : name of the parser to be retrieved |
Implements IOptionsParser.
Reimplemented in Option.
|
inlinevirtual |
|
inlinevirtual |
Return the properties found during parsing.
Implements IOptionsParser.
|
inlinevirtual |
Get visibility status.
Implements IOptionsParser.
|
virtual |
Perform the analyze of the arguments.
[in] | argc | : number of command line arguments. |
[in] | argv | : table of arguments |
Implements IOptionsParser.
|
virtual |
Perform the analyze of the arguments.
[in] | s | : string containing the options to be parsed |
Implements IOptionsParser.
|
virtual |
Add a parser child at the back of known parsers.
[in] | parser | : the child parser |
[in] | expandDepth | : while depth is less than expandDepth, put all the children and not the 'parser' itself. |
[in] | visibility | : visibility status. |
Implements IOptionsParser.
|
virtual |
Add a parser child at the front of known parsers.
[in] | parser | : the child parser |
[in] | expandDepth | : while depth is less than expandDepth, put all the children and not the 'parser' itself. |
[in] | visibility | : visibility status. |
Implements IOptionsParser.
|
virtual |
Tells whether an option has been seen during parsing.
[in] | name | : name of the option to be checked |
Implements IOptionsParser.
|
inlinevirtual |
|
inlinevirtual |
Associate a name to the parser.
[in] | name | : the name of the parser. |
Implements IOptionsParser.
|
inlinevirtual |
Set visibility status.
Implements IOptionsParser.