Manages reading and parsing of input files and command-line arguments.
More...
#include <input.h>
|
| Input (const std::string &filename) |
| Constructs an Input object and parses the input file.
|
|
void | parseInputFile (const std::string &filename) |
| Parses the input file and stores constants and filenames.
|
|
void | parseCommandLineArgs (int argc, char *argv[]) |
| Parses command-line arguments and updates constants.
|
|
double | getConstant (const std::string &key) const |
| Gets the value of a constant.
|
|
std::string | getFilename (const std::string &key) const |
| Gets the value of a filename.
|
|
void | setConstant (const std::string &key, double value) |
| Sets or updates the value of a constant.
|
|
void | setFilename (const std::string &key, const std::string &value) |
| Sets or updates the value of a filename.
|
|
Manages reading and parsing of input files and command-line arguments.
◆ Input()
Input::Input |
( |
const std::string & | filename | ) |
|
Constructs an Input object and parses the input file.
- Parameters
-
filename | The name of the input file to be parsed. |
◆ getConstant()
double Input::getConstant |
( |
const std::string & | key | ) |
const |
Gets the value of a constant.
- Parameters
-
key | The name of the constant to retrieve. |
- Returns
- The value of the constant, or 0 if not found.
◆ getFilename()
std::string Input::getFilename |
( |
const std::string & | key | ) |
const |
Gets the value of a filename.
- Parameters
-
key | The name of the filename to retrieve. |
- Returns
- The filename as a string, or an empty string if not found.
◆ parseCommandLineArgs()
void Input::parseCommandLineArgs |
( |
int | argc, |
|
|
char * | argv[] ) |
Parses command-line arguments and updates constants.
- Parameters
-
argc | Number of command-line arguments. |
argv | Array of command-line arguments. |
◆ parseInputFile()
void Input::parseInputFile |
( |
const std::string & | filename | ) |
|
Parses the input file and stores constants and filenames.
- Parameters
-
filename | The name of the input file to be parsed. |
◆ setConstant()
void Input::setConstant |
( |
const std::string & | key, |
|
|
double | value ) |
Sets or updates the value of a constant.
- Parameters
-
key | The name of the constant to set. |
value | The value to assign to the constant. |
◆ setFilename()
void Input::setFilename |
( |
const std::string & | key, |
|
|
const std::string & | value ) |
Sets or updates the value of a filename.
- Parameters
-
key | The name of the filename to set. |
value | The filename as a string. |
The documentation for this class was generated from the following files: