Qualia  0.2
Public Member Functions | Public Attributes | Private Attributes | List of all members
CmdOption Class Reference

#include <CmdOption.h>

Inheritance diagram for CmdOption:
Inheritance graph
[legend]

Public Member Functions

 CmdOption (const char *name_, const char *type_name_, const char *help_="", bool save_=false)
 
virtual void initValue ()
 Initialize the value of the option. More...
 
virtual void printValue (DiskXFile *file_)
 If is_setted# is true, print the current value, else the init value. More...
 
virtual void read (int *argc_, char ***argv_)
 
bool isCurrent (int *argc_, char ***argv_)
 
bool isOption (bool set_=false)
 
bool isArgument (bool set_=false)
 
bool isText (bool set_=false)
 
bool isMasterSwitch (bool set_=false)
 
virtual void load (DiskXFile *file)
 
virtual void save (DiskXFile *file)
 
virtual ~CmdOption ()
 

Public Attributes

char * name
 Name of the option. More...
 
char * type_name
 Type name of the option. More...
 
char * help
 
bool needsSave
 
bool is_setted
 

Private Attributes

bool is_option
 
bool is_argument
 
bool is_text
 
bool is_master_switch
 

Detailed Description

This class defines an option for the command line. If you need special command line arguments/options, you have to create a new children of this class.

Author
Ronan Collobert (collo.nosp@m.ber@.nosp@m.idiap.nosp@m..ch)
See Also
CmdLine

Constructor & Destructor Documentation

CmdOption::CmdOption ( const char *  name_,
const char *  type_name_,
const char *  help_ = "",
bool  save_ = false 
)
CmdOption::~CmdOption ( )
virtual

Member Function Documentation

void CmdOption::initValue ( )
virtual

Initialize the value of the option.

Reimplemented in StringCmdOption, BoolCmdOption, RealCmdOption, and IntCmdOption.

bool CmdOption::isArgument ( bool  set_ = false)

Returns true if it's a required argument. If #set_# is true, set it to a required argument.

bool CmdOption::isCurrent ( int *  argc_,
char ***  argv_ 
)
bool CmdOption::isMasterSwitch ( bool  set_ = false)

Returns true if it's a master switch. If #set_# is true, set it to a master switch.

bool CmdOption::isOption ( bool  set_ = false)

Returns true if it's an optional argument. If #set_# is true, set it to an optional argument.

bool CmdOption::isText ( bool  set_ = false)

Returns true if it's just text to be displayed in the command line. If #set_# is true, set it to text mode.

virtual void CmdOption::load ( DiskXFile file)
inlinevirtual
void CmdOption::printValue ( DiskXFile file_)
virtual

If is_setted# is true, print the current value, else the init value.

Reimplemented in StringCmdOption, RealCmdOption, and IntCmdOption.

void CmdOption::read ( int *  argc_,
char ***  argv_ 
)
virtual

Read the option on the command line. argv_ and argc_ have to point of the next option after that.

Reimplemented in StringCmdOption, BoolCmdOption, RealCmdOption, and IntCmdOption.

virtual void CmdOption::save ( DiskXFile file)
inlinevirtual

Member Data Documentation

char* CmdOption::help

An help string. Cannot be NULL.

bool CmdOption::is_argument
private
bool CmdOption::is_master_switch
private
bool CmdOption::is_option
private
bool CmdOption::is_setted

True is the option has been setted after reading the command-line.

bool CmdOption::is_text
private
char* CmdOption::name

Name of the option.

bool CmdOption::needsSave

True is the option has to be saved when saving the command line.

char* CmdOption::type_name

Type name of the option.


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