|
CommandLine Struct Reference#include <rcudata/Options.h>
Detailed Description
Class to deal with command line options. - Examples:
-
createAddresses.cxx, createConfigs.cxx, createParams.cxx, createPriority.cxx, createTables.cxx, createValues.cxx, dropTables.cxx, and rcuconf.cxx.
Definition at line 224 of file Options.h.
Member Typedef Documentation
|
Type of list of options.
Definition at line 330 of file Options.h. |
Constructor & Destructor Documentation
CommandLine::CommandLine |
( |
const char * |
args = "" |
) |
[inline] |
|
|
Constructor.
- Parameters:
-
Definition at line 228 of file Options.h.
References fArg. |
Member Function Documentation
void CommandLine::Add |
( |
OptionBase & |
option |
) |
[inline] |
|
int CommandLine::CheckOptions |
( |
char |
s, |
|
|
const char * |
arg |
|
) |
[inline, protected] |
|
|
Loop over all defined options, and check if one can handle the given long option.
- Parameters:
-
s | short option string |
arg | Possible argument |
- Returns:
- negative in case of errors, positive if succcessful, and the argument arg was processed, or 0 if successful and argument arg not processed.
Definition at line 315 of file Options.h.
References fList. |
int CommandLine::CheckOptions |
( |
const std::string & |
opt, |
|
|
const std::string & |
arg |
|
) |
[inline, protected] |
|
|
Loop over all defined options, and check if one can handle the given short option.
- Parameters:
-
opt | Short option character |
arg | Possible argument |
- Returns:
- negative in case of errors, positive if succcessful, and the argument arg was processed, or 0 if successful and argument arg not processed.
Definition at line 302 of file Options.h.
References fList.
Referenced by Process(). |
void CommandLine::GetLong |
( |
const char * |
str, |
|
|
std::string & |
opt, |
|
|
std::string & |
val |
|
) |
[inline, protected] |
|
|
Decode a long option.
- Parameters:
-
str | option and argument string to decode |
opt | Decoded option string |
val | Argument string. |
Definition at line 283 of file Options.h.
Referenced by Process(). |
void CommandLine::Help |
( |
|
) |
const [inline] |
|
bool CommandLine::Process |
( |
int |
argc, |
|
|
char ** |
argv |
|
) |
[inline] |
|
|
Process the command line.
- Parameters:
-
argc | Number of arguments |
argv | Arguments |
- Returns:
true on success, false otherwise
- Examples:
-
createAddresses.cxx, createConfigs.cxx, createParams.cxx, createPriority.cxx, createTables.cxx, createValues.cxx, dropTables.cxx, and rcuconf.cxx.
Definition at line 233 of file Options.h.
References CheckOptions(), fProg, fRemain, and GetLong().
Referenced by main(). |
std::vector<std::string>& CommandLine::Remain |
( |
|
) |
[inline] |
|
|
- Returns:
- Vector of remaining arguments not handled by any option
Definition at line 262 of file Options.h.
References fRemain. |
Field Documentation
The documentation for this struct was generated from the following file:
|