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

template<class T >
bool TCLAP::ValueArg< T >::processArg ( int *  i,
std::vector< std::string > &  args 
) [virtual]

Handles the processing of the argument. This re-implements the Arg version of this method to set the _value of the argument appropriately. It knows the difference between labeled and unlabeled.

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

Implementation of processArg().

Implements TCLAP::Arg.

Reimplemented in TCLAP::UnlabeledValueArg< T >.

Definition at line 478 of file ValueArg.h.

References TCLAP::Arg::delimiter(), and TCLAP::Arg::ignoreRest().

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

    if ( _hasBlanks( args[*i] ) )
            return false;

    std::string flag = args[*i];

    std::string value = "";
    trimFlag( flag, value );

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

        if ( Arg::delimiter() != ' ' && value == "" )
                  throw( ArgParseException( 
                                          "Couldn't find delimiter for this argument!",
                             toString() ) );

        if ( value == "" )
        {
            (*i)++;
            if ( (unsigned int)*i < args.size() ) 
                        _extractValue( args[*i] );
            else
                        throw( ArgParseException("Missing a value for this argument!",
                                                    toString() ) );
        }
        else
                  _extractValue( value );
                        
        _alreadySet = true;
        _checkWithVisitor();
        return true;
    } 
    else
            return false;
}

Here is the call graph for this function:


Generated by  Doxygen 1.6.0   Back to index