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

TCLAP::Arg::Arg ( const std::string &  flag,
const std::string &  name,
const std::string &  desc,
bool  req,
bool  valreq,
Visitor v = NULL 
) [inline, protected]

Primary constructor. YOU (yes you) should NEVER construct an Arg directly, this is a base class that is extended by various children that are meant to be used. Use SwitchArg, ValueArg, MultiArg, UnlabeledValueArg, or UnlabeledMultiArg instead.

Parameters:
flag- The flag identifying the argument.
name- The name identifying the argument.
desc- The description of the argument, used in the usage.
req- Whether the argument is required.
valreq- Whether the a value is required for the argument.
v- The visitor checked by the argument. Defaults to NULL.

Definition at line 354 of file Arg.h.

References _flag, _name, flagStartString(), ignoreNameString(), nameStartString(), and toString().

                     :
  _flag(flag),
  _name(name),
  _description(desc),
  _required(req),
  _requireLabel("required"),
  _valueRequired(valreq),
  _alreadySet(false),
  _visitor( v ),
  _ignoreable(true),
  _xorSet(false)
{
      if ( _flag.length() > 1 ) 
            throw(SpecificationException(
                        "Argument flag can only be one character long", toString() ) );

      if ( _name != ignoreNameString() &&  
             ( _flag == Arg::flagStartString() || 
               _flag == Arg::nameStartString() || 
               _flag == " " ) )
            throw(SpecificationException("Argument flag cannot be either '" + 
                                          Arg::flagStartString() + "' or '" + 
                                          Arg::nameStartString() + "' or a space.",
                                          toString() ) );

      if ( ( _name.find( Arg::flagStartString(), 0 ) != std::string::npos ) || 
             ( _name.find( Arg::nameStartString(), 0 ) != std::string::npos ) ||
             ( _name.find( " ", 0 ) != std::string::npos ) )
            throw(SpecificationException("Argument name cannot contain either '" + 
                                          Arg::flagStartString() + "' or '" + 
                                          Arg::nameStartString() + "' or space.",
                                          toString() ) );

}

Here is the call graph for this function:


Generated by  Doxygen 1.6.0   Back to index