#include <flagHandler.h>
|
| FlagHandler (const std::unordered_map< std::string, FlagInfo > &_flags) |
| Constructor for FlagHandler.
|
|
void | processFlags (const std::vector< std::string > &args) |
| Processes the command-line arguments and updates the flag values.
|
|
std::string | getFlagValue (const std::string &flagName) const |
| Retrieves the value of a flag.
|
|
void | checkRequiredFlags () const |
| Checks if all required flags have values.
|
|
float | getFloatValue (const std::string &name) const |
| Get given float option by user.
|
|
float | getBooleanValue (const std::string &name) const |
| Get given boolean option by user.
|
|
std::vector< std::string > | getFileArrayValue (const std::string &name) const |
| Get list of files.
|
|
std::vector< int > | getIntArrayValue (const std::string &name) const |
| Get given int option by user.
|
|
int | getIntValue (const std::string &name) const |
| Get given int option by user.
|
|
int | getNonZeroIntValue (const std::string &name) const |
| Get given non-zero int option by user.
|
|
◆ FlagHandler()
FlagHandler::FlagHandler |
( |
const std::unordered_map< std::string, FlagInfo > & | _flags | ) |
|
Constructor for FlagHandler.
- Parameters
-
_flags | The map of flags to be handled. |
◆ checkRequiredFlags()
void FlagHandler::checkRequiredFlags |
( |
| ) |
const |
Checks if all required flags have values.
- Exceptions
-
std::runtime_error | if a required flag is missing a value. |
◆ getBooleanValue()
float FlagHandler::getBooleanValue |
( |
const std::string & | name | ) |
const |
Get given boolean option by user.
- Parameters
-
- Returns
◆ getFileArrayValue()
vector< string > FlagHandler::getFileArrayValue |
( |
const std::string & | name | ) |
const |
Get list of files.
- Parameters
-
- Returns
◆ getFlagValue()
string FlagHandler::getFlagValue |
( |
const std::string & | flagName | ) |
const |
Retrieves the value of a flag.
- Parameters
-
flagName | The name of the flag. |
- Returns
- The value of the flag.
- Exceptions
-
std::runtime_error | if the flag is unknown. |
◆ getFloatValue()
float FlagHandler::getFloatValue |
( |
const std::string & | name | ) |
const |
Get given float option by user.
- Parameters
-
- Returns
◆ getIntArrayValue()
vector< int > FlagHandler::getIntArrayValue |
( |
const std::string & | name | ) |
const |
Get given int option by user.
- Parameters
-
- Returns
◆ getIntValue()
int FlagHandler::getIntValue |
( |
const std::string & | name | ) |
const |
Get given int option by user.
- Parameters
-
- Returns
◆ getNonZeroIntValue()
int FlagHandler::getNonZeroIntValue |
( |
const std::string & | name | ) |
const |
Get given non-zero int option by user.
- Parameters
-
- Returns
◆ processFlags()
void FlagHandler::processFlags |
( |
const std::vector< std::string > & | args | ) |
|
Processes the command-line arguments and updates the flag values.
- Parameters
-
args | The command-line arguments. |
- Exceptions
-
std::runtime_error | if a flag is unknown, missing a value, or if a required flag is missing. |
◆ flags
std::unordered_map<std::string, FlagInfo> FlagHandler::flags |
|
private |
The documentation for this class was generated from the following files: