Main Page   Namespace List   Class Hierarchy   Compound List   File List   Compound Members   File Members  

commandl::int_arg Class Reference

An argument class that acts like an int. More...

#include <int_arg.hpp>

Inheritance diagram for commandl::int_arg:

commandl::argument List of all members.

Public Methods

 int_arg (std::vector< std::string >, std::string="", std::string="", bool=false, bool=false)
 int_arg (std::string, std::string="", std::string="", bool=false, bool=false)
 operator int () const
 This operator allows automatic conversion of an int_arg to an int. More...

void operator() (const std::string &, const std::string &, const unsigned long)
 This operator is called when there is no value to pass in. More...

void operator() (const std::string &, const std::string &, const std::string &, const std::string &, const unsigned long)
 Used when there is a single string to be passed as the value. More...

void operator() (const std::vector< std::string > &, const std::string &, const std::string &, const std::string &, const unsigned long)
 Can be used to pass a value contained in a vector. More...

int_arg & operator= (const int &)
 This operator allows assignment of an int value. More...


Protected Attributes

int arguments_int
 The underlying int that this class is wrapping. More...


Detailed Description

An argument class that acts like an int.


Constructor & Destructor Documentation

commandl::int_arg::int_arg std::vector< std::string >   ,
std::string    = "",
std::string    = "",
bool    = false,
bool    = false
 

commandl::int_arg::int_arg std::string   ,
std::string    = "",
std::string    = "",
bool    = false,
bool    = false
 


Member Function Documentation

commandl::int_arg::operator int   const
 

This operator allows automatic conversion of an int_arg to an int.

Returns:
An integer

void commandl::int_arg::operator() const std::vector< std::string > &    values,
const std::string &    prefix,
const std::string &    key,
const std::string &    assign,
const unsigned    long
[virtual]
 

Can be used to pass a value contained in a vector.

It is important to note that int_arg can take only a single integer as it's value. If the vector passed in has more than a single element, this operator will throw.

Implements commandl::argument.

void commandl::int_arg::operator() const std::string &    value,
const std::string &    prefix,
const std::string &    key,
const std::string &    assign,
const unsigned    long
[virtual]
 

Used when there is a single string to be passed as the value.

This operator should be used to pass a value in to be converted to the internal representation of an integer within this class.

Implements commandl::argument.

void commandl::int_arg::operator() const std::string &    prefix,
const std::string &    key,
const unsigned    long
[virtual]
 

This operator is called when there is no value to pass in.

This operator should only be called when there is no corresponding value to be set. If values_size() returns anything other than zero, this version of the operator will

Implements commandl::argument.

commandl::int_arg & commandl::int_arg::operator= const int &    new_int
 

This operator allows assignment of an int value.


Member Data Documentation

int commandl::int_arg::arguments_int [protected]
 

The underlying int that this class is wrapping.


The documentation for this class was generated from the following files:
Generated on Sat Apr 5 21:17:28 2003 for commandl Library by doxygen1.2.15