Public Member Functions | Protected Attributes
ecl::MultiSwitchArg Class Reference

#include <multi_switch_arg.hpp>

Inheritance diagram for ecl::MultiSwitchArg:
Inheritance graph
[legend]

List of all members.

Public Member Functions

int getValue ()
std::string longID (const std::string &val) const
 MultiSwitchArg (const std::string &flag, const std::string &name, const std::string &desc, int init=0, Visitor *v=NULL)
 MultiSwitchArg (const std::string &flag, const std::string &name, const std::string &desc, CmdLineInterface &parser, int init=0, Visitor *v=NULL)
virtual bool processArg (int *i, std::vector< std::string > &args)
std::string shortID (const std::string &val) const

Protected Attributes

int _value

Detailed Description

A multiple switch argument. If the switch is set on the command line, then the getValue method will return the number of times the switch appears.

Definition at line 29 of file multi_switch_arg.hpp.


Constructor & Destructor Documentation

ecl::MultiSwitchArg::MultiSwitchArg ( const std::string &  flag,
const std::string &  name,
const std::string &  desc,
int  init = 0,
Visitor v = NULL 
) [inline]

MultiSwitchArg constructor.

Parameters:
flag- The one character flag that identifies this argument on the command line.
name- A one word name for the argument. Can be used as a long flag on the command line.
desc- A description of what the argument is for or does.
init- Optional. The initial/default value of this Arg. Defaults to 0.
v- An optional visitor. You probably should not use this unless you have a very good reason.

Definition at line 112 of file multi_switch_arg.hpp.

ecl::MultiSwitchArg::MultiSwitchArg ( const std::string &  flag,
const std::string &  name,
const std::string &  desc,
CmdLineInterface parser,
int  init = 0,
Visitor v = NULL 
) [inline]

MultiSwitchArg constructor.

Parameters:
flag- The one character flag that identifies this argument on the command line.
name- A one word name for the argument. Can be used as a long flag on the command line.
desc- A description of what the argument is for or does.
parser- A CmdLine parser object to add this Arg to
init- Optional. The initial/default value of this Arg. Defaults to 0.
v- An optional visitor. You probably should not use this unless you have a very good reason.

Definition at line 121 of file multi_switch_arg.hpp.


Member Function Documentation

Returns int, the number of times the switch has been set.

Reimplemented from ecl::SwitchArg.

Definition at line 133 of file multi_switch_arg.hpp.

std::string ecl::MultiSwitchArg::longID ( const std::string &  val) const [inline, virtual]

Returns the longID for this Arg.

Reimplemented from ecl::Arg.

Definition at line 179 of file multi_switch_arg.hpp.

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

Handles the processing of the argument. This re-implements the SwitchArg 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().

Reimplemented from ecl::SwitchArg.

Definition at line 135 of file multi_switch_arg.hpp.

std::string ecl::MultiSwitchArg::shortID ( const std::string &  val) const [inline, virtual]

Returns the shortID for this Arg.

Reimplemented from ecl::Arg.

Definition at line 172 of file multi_switch_arg.hpp.


Member Data Documentation

int ecl::MultiSwitchArg::_value [protected]

The value of the switch.

Reimplemented from ecl::SwitchArg.

Definition at line 36 of file multi_switch_arg.hpp.


The documentation for this class was generated from the following file:


ecl_command_line
Author(s): Daniel Stonier (d.stonier@gmail.com)
autogenerated on Thu Jan 2 2014 11:12:37