The Original CHomP Software
|
This is a helper class which defines one command-line argument which is bound with some specific variable. More...
#include <arg.h>
Public Member Functions | |
argunit (const char *_name, type &_value) | |
The constructor of a command line argument bound with one variable. More... | |
argunit (const char *_name, type &_value, type defaultvalue) | |
The constructor of a command line argument bound with one variable which has a default value if none found in the command line. More... | |
argunit (const char *_name, type *_value, int &_count, int _size) | |
The constructor of a command line argument bound with an array of the given size. More... | |
argunit (const char *_name, type *_value, int &_count, int _size, type defaultvalue) | |
The constructor of a command line argument bound with an array of the given size; a default value is provided. More... | |
int | setvalue (char *str, char *next) |
Sets the argument value from the text string. More... | |
void | restore () |
Restores the previous argument value (except for tables). More... | |
void | show (std::ostream &out) const |
Displays the value and some information. More... | |
![]() | |
argelement (const char *_name) | |
The constructor. More... | |
virtual | ~argelement () |
The destructor. More... | |
const char * | getname () const |
Returns the name of the command-line argument. More... | |
char * | getvalue (char *str) |
Returns the argument's value string from the argument string or returns 0 if it is not this argument. More... | |
virtual int | setvalue (char *str, char *next)=0 |
Sets the value of this argument according to the string. More... | |
virtual void | restore ()=0 |
Restores the previous argument value (except for tables). More... | |
virtual void | show (std::ostream &out) const =0 |
Outputs the argument element to the output stream. More... | |
void | resetflags () |
Resets the flags. More... | |
void | set (int flag) |
Sets the given flag. More... | |
void | unset (int flag) |
Unsets (clears) the given flag. More... | |
bool | get (int flag) const |
Returns the value of the given flag. More... | |
Private Attributes | |
type & | value |
A reference to the variable which is bound to this command line argument. More... | |
type | defaultvalue |
The default value of the variable if any. More... | |
type | previousvalue |
The original value of the variable (before reading the command line). More... | |
type * | table |
A pointer to the array bound with the variable. More... | |
int * | count |
A pointer to the number of elements currently present in the array. More... | |
int | previouscount |
The initial value of the number of elements in the array. More... | |
int | size |
The size of the array if any. More... | |
This is a helper class which defines one command-line argument which is bound with some specific variable.
It is an extension of the "argelement" class defined in terms of a template whose parameter is the type of the variable which is to be set based on the value provided in the command line.
|
inline |
The constructor of a command line argument bound with one variable.
Definition at line 311 of file arg.h.
|
inline |
The constructor of a command line argument bound with one variable which has a default value if none found in the command line.
Definition at line 319 of file arg.h.
References chomp::homology::argflags::hasdefault, and chomp::homology::argelement::set().
|
inline |
The constructor of a command line argument bound with an array of the given size.
|
inline |
The constructor of a command line argument bound with an array of the given size; a default value is provided.
Definition at line 339 of file arg.h.
References chomp::homology::argflags::hasdefault, and chomp::homology::argelement::set().
|
virtual |
Restores the previous argument value (except for tables).
Implements chomp::homology::argelement.
|
inlinevirtual |
Sets the argument value from the text string.
Implements chomp::homology::argelement.
Definition at line 412 of file arg.h.
References chomp::homology::argflags::filled, chomp::homology::argflags::hasdefault, chomp::homology::argflags::missingvalue, chomp::homology::argflags::readerror, chomp::homology::readfromstring(), and chomp::homology::argflags::toomany.
|
virtual |
Displays the value and some information.
Implements chomp::homology::argelement.
Definition at line 487 of file arg.h.
References chomp::homology::argflags::filled, chomp::homology::argflags::hasdefault, chomp::homology::argflags::ignorevalue, chomp::homology::argflags::obligatory, and chomp::homology::argflags::toomany.
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |