

Public Member Functions | |
| CommandLineArgument (String *longArg, Character *shortArg, bool mandatory, Callback< void > *callback, Object *userData=nil) | |
| virtual void | printGetOptShortOn (Stream *stream) |
| virtual void | performCallback (void) |
| virtual void | performCallbackWith (String *param) |
| virtual bool | acceptsParameter (void) |
| virtual bool | matchShortArgument (int character) |
| virtual bool | isMandatory (void) |
| virtual bool | wasEvaluated (void) |
| virtual void | fillGetOptLongOption (struct option *longopt) |
Protected Attributes | |
| String * | long_argument |
| Character * | short_argument |
| bool | _mandatory |
| Callback< void > * | _callback |
| Object * | user_data |
| bool | _evaluated |
|
||||||||||||||||||||||||
|
Definition at line 55 of file CmdLineParser.cc. References _callback, _evaluated, _mandatory, long_argument, short_argument, and user_data. 00057 {
00058 long_argument = longArg;
00059 short_argument = shortArg;
00060 _mandatory = mandatory;
00061 _callback = callback;
00062 user_data = userData;
00063 _evaluated = false;
00064 }
|
|
|
Definition at line 90 of file CmdLineParser.cc. References _callback, Core::Callback< void >::argumentsNumber(), nil, and user_data. Referenced by fillGetOptLongOption(), printGetOptShortOn(), and Tools::CommandLineParser::process(). 00091 {
00092 return _callback->argumentsNumber() > 0 && user_data == nil;
00093 }
|
|
|
Definition at line 111 of file CmdLineParser.cc. References acceptsParameter(), Core::String::asCString(), Core::Character::asInteger(), long_argument, nil, and short_argument. Referenced by Tools::CommandLineParser::collectLongOptions(). 00112 {
00113 longopt->name = long_argument->asCString();
00114 longopt->has_arg = acceptsParameter() ? 1 : 0;
00115 longopt->flag = NULL;
00116 if (short_argument == nil) longopt->val = 0;
00117 else
00118 longopt->val = short_argument->asInteger();
00119 }
|
|
|
Definition at line 100 of file CmdLineParser.cc. References _mandatory. Referenced by Tools::CommandLineParser::checkMissingArguments(). 00101 {
00102 return _mandatory;
00103 }
|
|
|
Definition at line 95 of file CmdLineParser.cc. References Core::Character::isEqual(), and short_argument. Referenced by Tools::CommandLineParser::process(). 00096 {
00097 return short_argument->isEqual((char) character);
00098 }
|
|
|
Definition at line 77 of file CmdLineParser.cc. References _callback, _evaluated, Core::Callback< void >::executeWith(), and user_data. Referenced by Tools::CommandLineParser::process(). 00078 {
00079 _callback->executeWith(user_data);
00080 _evaluated = true;
00081 }
|
|
|
Definition at line 83 of file CmdLineParser.cc. References _callback, _evaluated, and Core::Callback< void >::executeWith(). Referenced by Tools::CommandLineParser::process(). 00084 {
00085 _callback->executeWith(param);
00086 _evaluated = true;
00087 }
|
|
|
Definition at line 67 of file CmdLineParser.cc. References acceptsParameter(), Core::Stream::nextPut(), nil, and short_argument. 00068 {
00069 if (short_argument == nil) return;
00070
00071 stream->nextPut(short_argument);
00072 if (acceptsParameter())
00073 stream->nextPut(':');
00074 }
|
|
|
Definition at line 105 of file CmdLineParser.cc. References _evaluated. Referenced by Tools::CommandLineParser::checkMissingArguments(). 00106 {
00107 return _evaluated;
00108 }
|
|
|
Definition at line 50 of file CmdLineParser.cc. Referenced by acceptsParameter(), CommandLineArgument(), performCallback(), and performCallbackWith(). |
|
|
Definition at line 52 of file CmdLineParser.cc. Referenced by CommandLineArgument(), performCallback(), performCallbackWith(), and wasEvaluated(). |
|
|
Definition at line 49 of file CmdLineParser.cc. Referenced by CommandLineArgument(), and isMandatory(). |
|
|
Definition at line 47 of file CmdLineParser.cc. Referenced by CommandLineArgument(), and fillGetOptLongOption(). |
|
|
Definition at line 48 of file CmdLineParser.cc. Referenced by CommandLineArgument(), fillGetOptLongOption(), matchShortArgument(), and printGetOptShortOn(). |
|
|
Definition at line 51 of file CmdLineParser.cc. Referenced by acceptsParameter(), CommandLineArgument(), and performCallback(). |
1.4.2