Class for parsing input flags. Modified from https://stackoverflow.com/questions/865668/parsing-command-line-arguments-in-c.
More...
|
| const std::string & | Get_Cmd_Option (const std::string &option) const |
| | Get the option that follows the given flag. Also checks that the flag exists and is not empty.
|
| |
| bool | Cmd_Option_Exists (const std::string &option) const |
| | Checks that an option exists. Returns True if it exists and False otherwise.
|
| |
| | InputParser (int &argc, char **argv) |
| | Construct a new Input Parser object.
|
| |
◆ InputParser()
| InputParser::InputParser |
( |
int & |
argc, |
|
|
char ** |
argv |
|
) |
| |
|
inline |
Construct a new Input Parser object.
- Parameters
-
| argc | argc from main |
| argv | argv from main |
◆ Cmd_Option_Exists()
| bool InputParser::Cmd_Option_Exists |
( |
const std::string & |
option | ) |
const |
|
inline |
Checks that an option exists. Returns True if it exists and False otherwise.
- Parameters
-
| option | The option flag to search for |
- Returns
- true The option flag exists in argv
-
false The option flage does not exist in argv
◆ Get_Cmd_Option()
| const std::string & InputParser::Get_Cmd_Option |
( |
const std::string & |
option | ) |
const |
|
inline |
Get the option that follows the given flag. Also checks that the flag exists and is not empty.
- Parameters
-
| option | The string option to look for |
- Returns
- const std::string& The option the follows a given flag
The documentation for this class was generated from the following file: