The Original CHomP Software
|
This is a helper class which defines common properties of a command-line argument bound with any type of a variable. More...
#include <arg.h>
Public Member Functions | |
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 | |
char * | name |
The argument name (without '-'). More... | |
argflags | flags |
The flags associated with this argument. More... | |
This is a helper class which defines common properties of a command-line argument bound with any type of a variable.
|
inline |
The constructor.
Definition at line 185 of file arg.h.
References name.
|
inlinevirtual |
|
inline |
|
inline |
char * chomp::homology::argelement::getvalue | ( | char * | str | ) |
Returns the argument's value string from the argument string or returns 0 if it is not this argument.
|
inline |
Resets the flags.
Definition at line 209 of file arg.h.
References chomp::homology::argflags::filled, flags, chomp::homology::argflags::missingvalue, chomp::homology::argflags::readerror, chomp::homology::argflags::toomany, and unset().
|
pure virtual |
Restores the previous argument value (except for tables).
Implemented in chomp::homology::argunit< type >.
|
inline |
Sets the given flag.
Definition at line 218 of file arg.h.
Referenced by chomp::homology::argunit< type >::argunit(), and set().
|
pure virtual |
Sets the value of this argument according to the string.
If necessary, the next argument may be used. Returns: 0 = Ok, -1 = Error, 1 = next used.
Implemented in chomp::homology::argunit< type >.
|
pure virtual |
Outputs the argument element to the output stream.
Implemented in chomp::homology::argunit< type >.
|
inline |
|
private |
|
private |
The argument name (without '-').
This string dynamically allocated.
Definition at line 178 of file arg.h.
Referenced by argelement(), getname(), and ~argelement().