This class defines an option for the command line.
Inheritance:
Public Fields
-
char* name
- Name of the option
-
char* type_name
- Type name of the option
-
char* help
- An help string.
-
bool save
- True is the option has to be saved when saving the command line
-
bool is_setted
- True is the option has been setted after reading the command-line
Public Methods
-
CmdOption(const char* name_, const char* type_name_, const char* help_="", bool save_=false)
-
virtual void initValue()
- Initialize the value of the option
-
virtual void printValue(XFile* file_)
- If is_setted is true, print the current value, else the init value
-
virtual void read(int* argc_, char*** argv_)
- Read the option on the command line.
-
bool isOption(bool set_=false)
- Returns true if it's an optional argument.
-
bool isArgument(bool set_=false)
- Returns true if it's a required argument.
-
bool isText(bool set_=false)
- Returns true if it's just text to be displayed in the command line.
-
bool isMasterSwitch(bool set_=false)
- Returns true if it's a master switch.
Inherited from Object:
Public Fields
-
Allocator* allocator
Public Methods
-
void addOption(const char* name, int size, void* ptr, const char* help="")
-
void addIOption(const char* name, int* ptr, int init_value, const char* help="")
-
void addROption(const char* name, real* ptr, real init_value, const char* help="")
-
void addBOption(const char* name, bool* ptr, bool init_value, const char* help="")
-
void addOOption(const char* name, Object** ptr, Object* init_value, const char* help="")
-
void setOption(const char* name, void* ptr)
-
void setIOption(const char* name, int option)
-
void setROption(const char* name, real option)
-
void setBOption(const char* name, bool option)
-
void setOOption(const char* name, Object* option)
-
virtual void loadXFile(XFile* file)
-
virtual void saveXFile(XFile* file)
-
void load(const char* filename)
-
void* operator new(size_t size, Allocator* allocator_=NULL)
-
void* operator new(size_t size, Allocator* allocator_, void* ptr_)
-
void operator delete(void* ptr)
Documentation
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.
- char* name
- Name of the option
- char* type_name
- Type name of the option
- char* help
- An help string.
Cannot be NULL.
- bool save
- True is the option has to be saved
when saving the command line
- bool is_setted
- True is the option has been setted after
reading the command-line
- CmdOption(const char* name_, const char* type_name_, const char* help_="", bool save_=false)
- virtual void initValue()
- Initialize the value of the option
- virtual void printValue(XFile* file_)
- If is_setted is true, print the current value, else the init value
- virtual void read(int* argc_, char*** argv_)
- Read the option on the command line.
argv_ and argc_ have to point of the next
option after that.
- bool isOption(bool set_=false)
- Returns true if it's an optional argument.
If set_ is true, set it to an optional argument.
- bool isArgument(bool set_=false)
- Returns true if it's a required argument.
If set_ is true, set it to a required argument.
- bool 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.
- bool isMasterSwitch(bool set_=false)
- Returns true if it's a master switch.
If set_ is true, set it to a master switch.
- Direct child classes:
- StringCmdOption
RealCmdOption
IntCmdOption
FileListCmdOption
BoolCmdOption
- Author:
- Ronan Collobert (collober@idiap.ch)
- See Also:
- CmdLine
Alphabetic index HTML hierarchy of classes or Java
This page was generated with the help of DOC++.