The objects of this class gather the expected command-line arguments and decode them. It is recommended that you use the various functions called "arg" to enqueue the arguments into the list of arguments. When the list is complete, one just calls the "analyze" method of the class. Detailed instructions are gathered in the "arg.txt" file. The program "argtest.cpp" and most CHomP programs very well illustrate how to use various features of this class.
More...
#include <capd/auxil/arg.h>
|
| arguments () |
| The default constructor. More...
|
|
| ~arguments () |
| The destructor. More...
|
|
void | add (argelement *p) |
| Adds an argument to the end of the list. More...
|
|
int | remove (char *name) |
| Removes all the arguments with this name from the list and return the number of removed items. More...
|
|
int | analyze (int argc, char *argv[], std::ostream &out=std::cerr) |
| Analyzes the arguments from the command line strings. Returns a negative value in case of error (the negation of the number of errors) and displays error messages to the given output stream. Returns 1 if it is requested to stop the program (and show help information, for instance). Returns 0 otherwise. More...
|
|
void | reset () |
| Resets the flags and returns previous argument values (except for tables). More...
|
|
|
std::ostream & | operator<< (std::ostream &out, arguments &p) |
| Displays the arguments actually decoded (for debugging purpose). More...
|
|
The objects of this class gather the expected command-line arguments and decode them. It is recommended that you use the various functions called "arg" to enqueue the arguments into the list of arguments. When the list is complete, one just calls the "analyze" method of the class. Detailed instructions are gathered in the "arg.txt" file. The program "argtest.cpp" and most CHomP programs very well illustrate how to use various features of this class.
◆ arguments()
capd::auxil::arguments::arguments |
( |
| ) |
|
|
inline |
◆ ~arguments()
capd::auxil::arguments::~arguments |
( |
| ) |
|
◆ add()
void capd::auxil::arguments::add |
( |
argelement * |
p | ) |
|
|
inline |
Adds an argument to the end of the list.
◆ analyze()
int capd::auxil::arguments::analyze |
( |
int |
argc, |
|
|
char * |
argv[], |
|
|
std::ostream & |
out = std::cerr |
|
) |
| |
Analyzes the arguments from the command line strings. Returns a negative value in case of error (the negation of the number of errors) and displays error messages to the given output stream. Returns 1 if it is requested to stop the program (and show help information, for instance). Returns 0 otherwise.
◆ remove()
int capd::auxil::arguments::remove |
( |
char * |
name | ) |
|
Removes all the arguments with this name from the list and return the number of removed items.
◆ reset()
void capd::auxil::arguments::reset |
( |
| ) |
|
Resets the flags and returns previous argument values (except for tables).
◆ operator<<
std::ostream& operator<< |
( |
std::ostream & |
out, |
|
|
arguments & |
p |
|
) |
| |
|
friend |
Displays the arguments actually decoded (for debugging purpose).
The documentation for this class was generated from the following files: