OSB_APP::ArgList Class Reference

Collaboration diagram for OSB_APP::ArgList:

Collaboration graph
List of all members.

Detailed Description

Utility class to expand command line arguments.

The class is a small wrapper around standard command line arguments.
The arguments are stored in a std::vector<char*>, who's last element is always 0.

Definition at line 60 of file apputils.h.

Public Member Functions

Private Member Functions

Private Attributes

Constructor & Destructor Documentation

OSB_APP::ArgList::ArgList (  ) 

Default constructor: adds 0 to args_.

OSB_APP::ArgList::ArgList ( int  argc,
char *const   argv[] 

Construct from command line arguments.

Adds argv[] and terminates args_ with a 0.

OSB_APP::ArgList::~ArgList (  ) 

Destructor: delete all entries in args_.

OSB_APP::ArgList::ArgList ( const ArgList  )  [private]

Prevent copying until needed: not implemented.

Member Function Documentation

void OSB_APP::ArgList::adjust ( int  newCount  ) 

Reduce the number of arguments.

Removes elements from the back of args_ until argc() is newCount.

int OSB_APP::ArgList::argc (  )  const

Get the argument count.

The size of args_ - 1.

const char* const* OSB_APP::ArgList::argv (  )  const

Get arguments a C-style array.

char** OSB_APP::ArgList::argv (  ) 

Get arguments a C-style array.

ArgList& OSB_APP::ArgList::operator<< ( const std::string &  arg  ) 

Add an argument.

ArgList& OSB_APP::ArgList::operator<< ( const char *const   arg  ) 

Add an argument.

ArgList& OSB_APP::ArgList::operator= ( const ArgList  )  [private]

Prevent assignment until needed: not implemented.

const char* OSB_APP::ArgList::operator[] ( int  i  )  const

Get a argument.

The argument at position i (0 is the first).
0 if i is out-of-bounds.

void OSB_APP::ArgList::print ( std::ostream &  os  )  const

Print the arguments to an output stream.

void OSB_APP::ArgList::remove ( int  i  ) 

Remove the argument at index i.

Member Data Documentation

std::vector<char*> OSB_APP::ArgList::args_ [private]

List of arguments, the last on is always 0.

Definition at line 115 of file apputils.h.

The documentation for this class was generated from the following file:
Generated on Sat Sep 2 14:17:24 2006 for OSB Library by  doxygen 1.4.7