|
Elm
2
ELM is a library providing generic data structures, OS-independent interface, plugins and XML.
|
22 #ifndef ELM_OPTION_MANAGER_H
23 #define ELM_OPTION_MANAGER_H
26 #include <elm/data/ListMap.h>
27 #include <elm/data/Vector.h>
28 #include <elm/option/Option.h>
29 #include <elm/option/SwitchOption.h>
30 #include <elm/option/ValueOption.h>
31 #include <elm/util/Version.h>
32 #include <elm/util/MessageException.h>
34 namespace elm {
namespace option {
44 inline Make(
void): _help(false), _version_opt(false) { }
50 inline Make&
help(
void) { _help =
true;
return *
this; }
51 inline Make&
version(
void) { _version_opt =
true;
return *
this; }
58 cstring _free_argument_description;
98 virtual void run(
void);
103 void processOption(
Option *option,
int& i,
int argc,
argv_t argv,
const char *earg);
104 void addShort(
char cmd,
Option *option);
106 void addCommand(
string cmd,
Option *option);
115 #define ELM_RUN(C) int main(int argc, char **argv) { return C().manage(argc, argv); }
117 #endif // ELM_OPTION_MANAGER_H
cstring description(void) const
Definition: Manager.h:84
cstring freeArgumentDescription(void) const
Definition: Manager.h:85
virtual void run(void)
Definition: option_Manager.cpp:343
Definition: UniquePtr.h:27
Definition: ValueOption.h:72
cstring getFreeArgumentDescription(void) const
Definition: Manager.h:93
static const Version ZERO
Definition: Version.h:34
void removeOption(Option *option)
Definition: option_Manager.cpp:292
cstring getAuthor(void) const
Definition: Manager.h:90
const Vector< string > & freeArguments() const
Definition: Manager.h:99
ValueOption< T >::Make make_value(void)
Definition: Manager.h:65
Make & copyright(cstring s)
Definition: Manager.h:47
SwitchOption::Make make_switch(void)
Definition: Manager.h:64
virtual void displayVersion(void)
Definition: option_Manager.cpp:433
Make & help(void)
Definition: Manager.h:50
Make & description(cstring s)
Definition: Manager.h:48
const Version & version(void) const
Definition: Manager.h:81
Make & version(void)
Definition: Manager.h:51
const typedef char *const * argv_t
Definition: Manager.h:67
Make(void)
Definition: Manager.h:44
Make & author(cstring s)
Definition: Manager.h:46
virtual void process(String arg)
Definition: option_Manager.cpp:273
cstring copyright(void) const
Definition: Manager.h:83
Make info
Definition: Manager.h:96
virtual ~Manager(void)
Definition: option_Manager.cpp:206
cstring getCopyright(void) const
Definition: Manager.h:91
Make(cstring program, Version version=Version::ZERO)
Definition: Manager.h:45
cstring getProgram(void) const
Definition: Manager.h:88
Manager(void)
Definition: option_Manager.cpp:183
cstring program(void) const
Definition: Manager.h:80
cstring author(void) const
Definition: Manager.h:82
Make & free_argument(cstring s)
Definition: Manager.h:49
virtual void displayHelp(void)
Definition: option_Manager.cpp:441
cstring getDescription(void) const
Definition: Manager.h:92
int manage(int artc, argv_t argv)
Definition: option_Manager.cpp:364
void parse(int argc, argv_t argv)
Definition: option_Manager.cpp:388
const Version & getVersion(void) const
Definition: Manager.h:89
void addOption(Option *option)
Definition: option_Manager.cpp:282