|
MolSim
|
Namespace defining functions for parsing command line arguments. More...
Functions | |
| void | checkArgc (int argc) |
| Checks if there are enough arguments passed through the command line interface. | |
| void | checkHelpString (int argc, char **argv) |
| Checks if the help option '-h' is passed anywhere. | |
| void | checkValidity (const Arguments &args) |
| Checks the mathematical validity of the given arguments. | |
| void | setDefaults (Arguments &args) |
| Sets default values for uninitialized Argument attributes based on the chosen Simulation type. | |
| void | parseArguments (int argc, char **argv, Arguments &args) |
| Parses and store CLI arguments in an Arguments struct. | |
Namespace defining functions for parsing command line arguments.
| void CLIParser::checkArgc | ( | int | argc | ) |
Checks if there are enough arguments passed through the command line interface.
There must be at least one argument passed (i.e. the file name). Exits the program with an error message if argc is less than 2.
| argc | Argument counter, typically passed directly via the main function. |
| void CLIParser::checkHelpString | ( | int | argc, |
| char ** | argv | ||
| ) |
Checks if the help option '-h' is passed anywhere.
This is done before interpreting the last command line argument as an XML file to enable running the program while only passing the help string in order to print out a help message (i.e. ./MolSim -h should still be valid syntax, even if no file input is provided).
| argc | Argument counter, typically passed directly via the main function. |
| argv | Argument vector, typically passed directly via the main function. |
| void CLIParser::checkValidity | ( | const Arguments & | args | ) |
Checks the mathematical validity of the given arguments.
| args | A reference to the Argument struct to be checked. |
| void CLIParser::parseArguments | ( | int | argc, |
| char ** | argv, | ||
| Arguments & | args | ||
| ) |
Parses and store CLI arguments in an Arguments struct.
| argc | Argument counter, typically passed directly via the main function. |
| argv | Argument vector, typically passed directly via the main function. |
| args | A reference to the argument struct in which to store the parsed arguments. |
| void CLIParser::setDefaults | ( | Arguments & | args | ) |
Sets default values for uninitialized Argument attributes based on the chosen Simulation type.
| args | A reference to the Argument struct to be modified. |