Elm  1.0
ELM is a library providing generic data structures, OS-independent interface, plugins and XML.
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
elm::option::Manager Class Reference

#include <elm/option/Manager.h>

Classes

class  Make
 

Public Types

typedef const char *const * argv_t
 

Public Member Functions

 Manager (void)
 
 Manager (int tag,...)
 
 Manager (const Make &maker)
 
virtual ~Manager (void)
 
void addOption (Option *option) throw (OptionException)
 
void removeOption (Option *option)
 
void parse (int argc, argv_t argv) throw (OptionException)
 
void displayHelp (void)
 
cstring getProgram (void) const
 
const VersiongetVersion (void) const
 
cstring getAuthor (void) const
 
cstring getCopyright (void) const
 
cstring getDescription (void) const
 
cstring getFreeArgumentDescription (void) const
 

Protected Member Functions

virtual void process (String arg)
 
virtual void configure (int tag, VarArg &args)
 

Protected Attributes

Make info
 

Detailed Description

This class is used for managing the options of a command.

See also
Command Line Options

Member Typedef Documentation

typedef const char* const* elm::option::Manager::argv_t

Constructor & Destructor Documentation

elm::option::Manager::Manager ( void  )
elm::option::Manager::Manager ( int  tag,
  ... 
)

Build a manager with the new method.

Parameters
configFirst configuration item.
...end() ended configuration item list.
Deprecated:
Since 22/03/13.

References configure(), and elm::option::end.

elm::option::Manager::Manager ( const Make maker)

Build a new option manager.

Parameters
makerInformation for initialization.
virtual elm::option::Manager::~Manager ( void  )
virtual

Member Function Documentation

void elm::option::Manager::addOption ( Option option)
throw (OptionException
)

Add an option to the manager.

Parameters
optionOption to add.
Exceptions
OptionExceptionIf the short name or the long name is already used.

Referenced by elm::option::Option::init(), and elm::option::Option::Option().

void elm::option::Manager::configure ( int  tag,
VarArg args 
)
protectedvirtual

Called for each configuration tag. May be overload to customize Manager configuration.

Parameters
tagCurrent tag.
argsArgument list.

References elm::option::arg_desc, elm::option::author, elm::option::copyright, elm::option::description, elm::option::free_arg, info, elm::VarArg::next(), elm::option::program, and elm::option::version.

Referenced by Manager().

cstring elm::option::Manager::getAuthor ( void  ) const

References info.

cstring elm::option::Manager::getCopyright ( void  ) const

References info.

cstring elm::option::Manager::getDescription ( void  ) const

References info.

cstring elm::option::Manager::getFreeArgumentDescription ( void  ) const

References info.

cstring elm::option::Manager::getProgram ( void  ) const

References info.

const Version& elm::option::Manager::getVersion ( void  ) const

References info.

void elm::option::Manager::parse ( int  argc,
Manager::argv_t  argv 
)
throw (OptionException
)

Parse the given options.

Parameters
argcArgument count.
argvArgument vector.
Exceptions
OptionExceptionThrown if the syntax contains an error.

References elm::_, elm::String::indexOf(), elm::String::length(), and elm::String::substring().

void elm::option::Manager::process ( String  arg)
protectedvirtual

Called each time a free argumend (not tied to an option) is found.

Parameters
argFree argument value.
void elm::option::Manager::removeOption ( Option option)

Remove the option from the manager.

Parameters
optionOption to remove.

Member Data Documentation


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