Public Member Functions |
| | SwitchArg (const std::string &flag, const std::string &name, const std::string &desc, bool def, Visitor *v=NULL) |
| | SwitchArg constructor.
|
| | SwitchArg (const std::string &flag, const std::string &name, const std::string &desc, bool def, CmdLineInterface &parser, Visitor *v=NULL) |
| | SwitchArg constructor.
|
| virtual bool | processArg (int *i, std::vector< std::string > &args) |
| | Handles the processing of the argument.
|
| bool | combinedSwitchesMatch (std::string &combined) |
| | Checks a string to see if any of the chars in the string match the flag for this Switch.
|
| bool | getValue () const |
| | Returns bool, whether or not the switch has been set.
|
| | operator bool () |
| | implicit conversion to bool
|
| virtual | ~Arg () |
| | Destructor.
|
| virtual void | addToList (std::list< Arg * > &argList) const |
| | Adds this to the specified list of Args.
|
| virtual bool | operator== (const Arg &a) |
| | Operator ==.
|
| const std::string & | getFlag () const |
| | Returns the argument flag.
|
| const std::string & | getName () const |
| | Returns the argument name.
|
| std::string | getDescription () const |
| | Returns the argument description.
|
| virtual bool | isRequired () const |
| | Indicates whether the argument is required.
|
| void | forceRequired () |
| | Sets _required to true.
|
| void | xorSet () |
| | Sets the _alreadySet value to true.
|
| bool | isValueRequired () const |
| | Indicates whether a value must be specified for argument.
|
| bool | isSet () const |
| | Indicates whether the argument has already been set.
|
| bool | isIgnoreable () const |
| | Indicates whether the argument can be ignored, if desired.
|
| virtual bool | argMatches (const std::string &s) const |
| | A method that tests whether a string matches this argument.
|
| virtual std::string | toString () const |
| | Returns a simple string representation of the argument.
|
| virtual std::string | shortID (const std::string &valueId="val") const |
| | Returns a short ID for the usage.
|
| virtual std::string | longID (const std::string &valueId="val") const |
| | Returns a long ID for the usage.
|
| virtual void | trimFlag (std::string &flag, std::string &value) const |
| | Trims a value off of the flag.
|
| bool | _hasBlanks (const std::string &s) const |
| | Checks whether a given string has blank chars, indicating that it is a combined SwitchArg.
|
| void | setRequireLabel (const std::string &s) |
| | Sets the requireLabel.
|
Protected Attributes |
| bool | _value |
| | The value of the switch.
|
| std::string | _flag |
| | The single char flag used to identify the argument.
|
| std::string | _name |
| | A single work namd indentifying the argument.
|
| std::string | _description |
| | Description of the argument.
|
| bool | _required |
| | Indicating whether the argument is required.
|
| std::string | _requireLabel |
| | Label to be used in usage description.
|
| bool | _valueRequired |
| | Indicates whether a value is required for the argument.
|
| bool | _alreadySet |
| | Indicates whether the argument has been set.
|
| Visitor * | _visitor |
| | A pointer to a vistitor object.
|
| bool | _ignoreable |
| | Whether this argument can be ignored, if desired.
|
| bool | _xorSet |
| | Indicates that the arg was set as part of an XOR and not on the command line.
|
Additional Inherited Members |
| static void | beginIgnoring () |
| | Begin ignoring arguments since the "–" argument was specified.
|
| static bool | ignoreRest () |
| | Whether to ignore the rest.
|
| static char | delimiter () |
| | The delimiter that separates an argument flag/name from the value.
|
| static const char | blankChar () |
| | The char used as a place holder when SwitchArgs are combined.
|
| static const char | flagStartChar () |
| | The char that indicates the beginning of a flag.
|
| static const std::string | flagStartString () |
| | The sting that indicates the beginning of a flag.
|
| static const std::string | nameStartString () |
| | The sting that indicates the beginning of a name.
|
| static const std::string | ignoreNameString () |
| | The name used to identify the ignore rest argument.
|
| static void | setDelimiter (char c) |
| | Sets the delimiter for all arguments.
|
| void | _checkWithVisitor () const |
| | Performs the special handling described by the Vistitor.
|
| | Arg (const std::string &flag, const std::string &name, const std::string &desc, bool req, bool valreq, Visitor *v=NULL) |
| | Primary constructor.
|
A simple switch argument.
If the switch is set on the command line, then the getValue method will return the opposite of the default value for the switch.