Public Member Functions | Private Member Functions | Private Attributes

alize::CmdLine Class Reference

#include <CmdLine.h>

Inheritance diagram for alize::CmdLine:
Inheritance graph
[legend]
Collaboration diagram for alize::CmdLine:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 CmdLine (int argc, char *argv[])
virtual ~CmdLine ()
unsigned long getOptionCount () const
bool isShortOption (unsigned long i) const
StringgetName (unsigned long i) const
StringgetContent (unsigned long i) const
bool displayHelpRequired () const
bool displayVersionRequired () const
void copyIntoConfig (Config &c) const
virtual String getClassName () const

Private Member Functions

 CmdLine (const CmdLine &)
const CmdLineoperator= (const CmdLine &c)
bool operator== (const CmdLine &c) const
bool operator!= (const CmdLine &c) const

Private Attributes

XList _list
bool _displayHelp
bool _displayVersion

Detailed Description

Class for the command line.

Author:
Frederic Wils frederic.wils@lia.univ-avignon.fr
Version:
1.0
Date:
2004

Definition at line 83 of file CmdLine.h.


Constructor & Destructor Documentation

CmdLine::CmdLine ( int  argc,
char *  argv[] 
)
CmdLine::~CmdLine (  ) [virtual]

Definition at line 146 of file CmdLine.cpp.

alize::CmdLine::CmdLine ( const CmdLine  ) [private]

Member Function Documentation

void CmdLine::copyIntoConfig ( Config c ) const

Copy options of command line into the configuration object

Parameters:
cthe configuration

Definition at line 135 of file CmdLine.cpp.

References _list, alize::XLine::getElement(), alize::XList::getLine(), alize::XList::getLineCount(), and alize::Config::setParam().

bool CmdLine::displayHelpRequired (  ) const

Return true if the command line contains --help

Returns:
true if the command line contains --help; false otherwise

Definition at line 131 of file CmdLine.cpp.

References _displayHelp.

bool CmdLine::displayVersionRequired (  ) const

Return true if the command line contains --version

Returns:
true if the command line contains --version; false otherwise

Definition at line 133 of file CmdLine.cpp.

References _displayVersion.

String CmdLine::getClassName (  ) const [virtual]

Returns the name of the class

Returns:
the name of the class of the object as a String

Implements alize::Object.

Definition at line 144 of file CmdLine.cpp.

String & CmdLine::getContent ( unsigned long  i ) const

Returns the content of the option i

Parameters:
iindex of the option
Returns:
the content of the option i

Definition at line 128 of file CmdLine.cpp.

References _list, alize::XLine::getElement(), and alize::XList::getLine().

String & CmdLine::getName ( unsigned long  i ) const

Returns the name of the option i

Parameters:
iindex of the option
Returns:
the name of the option i

Definition at line 125 of file CmdLine.cpp.

References _list, alize::XLine::getElement(), and alize::XList::getLine().

unsigned long CmdLine::getOptionCount (  ) const

Affiche le nombre d'options de la ligne. Attention : les options --help et --version ne sont pas comptée

Definition at line 119 of file CmdLine.cpp.

References _list, and alize::XList::getLineCount().

bool CmdLine::isShortOption ( unsigned long  i ) const

Tests whether an option is a short (-)or a long (--) option

Parameters:
iindex of the option
Returns:
true if the option is a short option; false otherwise

Definition at line 122 of file CmdLine.cpp.

References _list, alize::XLine::getElement(), and alize::XList::getLine().

bool alize::CmdLine::operator!= ( const CmdLine c ) const [private]

not implemented

const CmdLine& alize::CmdLine::operator= ( const CmdLine c ) [private]

not implemented

bool alize::CmdLine::operator== ( const CmdLine c ) const [private]

not implemented


Member Data Documentation

Definition at line 134 of file CmdLine.h.

Referenced by CmdLine(), and displayHelpRequired().

Definition at line 135 of file CmdLine.h.

Referenced by CmdLine(), and displayVersionRequired().

Definition at line 133 of file CmdLine.h.

Referenced by CmdLine(), copyIntoConfig(), getContent(), getName(), getOptionCount(), and isShortOption().


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