wibble  0.1.28
Public Member Functions | Public Attributes | Protected Attributes
wibble::commandline::StandardParserWithManpage Class Reference

Parser for commandline arguments, with builting help functions and manpage generation. More...

#include <parser.h>

Inheritance diagram for wibble::commandline::StandardParserWithManpage:
Inheritance graph
[legend]
Collaboration diagram for wibble::commandline::StandardParserWithManpage:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 StandardParserWithManpage (const std::string &appname, const std::string &version, int section, const std::string &author)
bool parse (int argc, const char *argv[])
 Parse the commandline.
- Public Member Functions inherited from wibble::commandline::StandardParser
 StandardParser (const std::string &appname, const std::string &version)
void outputHelp (std::ostream &out)
- Public Member Functions inherited from wibble::commandline::Parser
 Parser (const std::string &name, const std::string &usage=std::string(), const std::string &description=std::string(), const std::string &longDescription=std::string())
bool hasNext () const
std::string next ()
- Public Member Functions inherited from wibble::commandline::Engine
const std::string & name () const
Optionadd (Option *o)
 Add an Option to this engine.
OptionGroupadd (OptionGroup *group)
 Add an OptionGroup to this engine.
Engineadd (Engine *o)
 Add a Engine to this engine.
template<typename T >
T * create (const std::string &name, char shortName, const std::string &longName, const std::string &usage=std::string(), const std::string &description=std::string())
 Create an option.
template<typename T >
T * add (const std::string &name, char shortName, const std::string &longName, const std::string &usage=std::string(), const std::string &description=std::string())
 Create an option and add to this engine.
OptionGroupcreateGroup (const std::string &description)
 Create an OptionGroup.
OptionGroupaddGroup (const std::string &description)
 Create an OptionGroup and add it to this engine.
EnginecreateEngine (const std::string &name, const std::string &usage=std::string(), const std::string &description=std::string(), const std::string &longDescription=std::string())
 Create a Engine.
EngineaddEngine (const std::string &name, const std::string &usage=std::string(), const std::string &description=std::string(), const std::string &longDescription=std::string())
 Create a Engine and add it to this engine as a command.
const std::vector< OptionGroup * > & groups () const
 Get the OptionGroups that have been added to this engine.
const std::vector< Option * > & options () const
 Get the Options that have been added to this engine.
const std::vector< Engine * > & commands () const
 Get the Engines that have been added to this engine.
Enginecommand (const std::string &name) const
bool hasOptions () const
 Returns true if this Engine has options to parse.
EnginefoundCommand () const
 Return the command that has been found in the commandline, or NULL if none have been found.
void dump (std::ostream &out, const std::string &prefix=std::string())
- Public Member Functions inherited from wibble::commandline::Managed
virtual ~Managed ()

Public Attributes

StringOptionmanpage
- Public Attributes inherited from wibble::commandline::StandardParser
OptionGrouphelpGroup
BoolOptionhelp
BoolOptionversion

Protected Attributes

int m_section
std::string m_author
- Protected Attributes inherited from wibble::commandline::StandardParser
std::string m_version
- Protected Attributes inherited from wibble::commandline::Parser
ArgList m_args
MemoryManager m_manager
- Protected Attributes inherited from wibble::commandline::Engine
std::vector< OptionGroup * > m_groups
std::vector< Option * > m_options
std::vector< Engine * > m_commands
std::map< char, Option * > m_short
std::map< std::string, Option * > m_long
std::map< std::string, Engine * > m_aliases
Enginem_found_command

Detailed Description

Parser for commandline arguments, with builting help functions and manpage generation.


Constructor & Destructor Documentation

wibble::commandline::StandardParserWithManpage::StandardParserWithManpage ( const std::string &  appname,
const std::string &  version,
int  section,
const std::string &  author 
)
inline

Member Function Documentation

bool wibble::commandline::StandardParserWithManpage::parse ( int  argc,
const char *  argv[] 
)

Parse the commandline.

Returns:
true if it also took care of performing the action requested by the user, or false if the caller should do it instead.

Reimplemented from wibble::commandline::StandardParser.

Reimplemented in wibble::commandline::StandardParserWithMandatoryCommand.

References wibble::commandline::Manpage::output(), and wibble::commandline::Manpage::readHooks().


Member Data Documentation

std::string wibble::commandline::StandardParserWithManpage::m_author
protected
int wibble::commandline::StandardParserWithManpage::m_section
protected
StringOption* wibble::commandline::StandardParserWithManpage::manpage

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