Logo Search packages:      
Sourcecode: passwordmaker-cli version File versions  Download package

bool TCLAP::SwitchArg::processArg ( int *  i,
std::vector< std::string > &  args 
) [inline, virtual]

Handles the processing of the argument. This re-implements the Arg version of this method to set the _value of the argument appropriately.

Parameters:
i- Pointer the the current argument in the list.
args- Mutable list of strings. Passed in from main().

Implements TCLAP::Arg.

Definition at line 168 of file SwitchArg.h.

References TCLAP::Arg::_alreadySet, TCLAP::Arg::_checkWithVisitor(), TCLAP::Arg::_ignoreable, _value, TCLAP::Arg::argMatches(), combinedSwitchesMatch(), TCLAP::Arg::ignoreRest(), and TCLAP::Arg::toString().

{
      if ( _ignoreable && Arg::ignoreRest() )
            return false;

      if ( argMatches( args[*i] ) || combinedSwitchesMatch( args[*i] ) )
      {
            // If we match on a combined switch, then we want to return false
            // so that other switches in the combination will also have a
            // chance to match.
            bool ret = false;
            if ( argMatches( args[*i] ) )
                  ret = true;

            if ( _alreadySet )
                  throw(CmdLineParseException("Argument already set!", toString()));      

            _alreadySet = true;

            if ( _value == true )
                  _value = false;
            else
                  _value = true;

            _checkWithVisitor();

            return ret;
      }
      else
            return false;
}

Here is the call graph for this function:


Generated by  Doxygen 1.6.0   Back to index