A helper class to manage the arguments passed to the main application.
More...
#include <argument_configuration.h>
|
| ArgumentConfiguration (int argc, char *argv[], std::string defaultConfigFile="../../configuration/execution_manifest.arxml", std::string extendedVehicleConfigFile="../../configuration/extended_vehicle_manifest.arxml", std::string diagnosticManagerConfigFile="../../configuration/diagnostic_manager_manifest.arxml", std::string healthMonitoringConfigFile="../../configuration/health_monitoring_manifest.arxml") |
| Constructor. More...
|
|
const std::map< std::string, std::string > & | GetArguments () const noexcept |
| Arguments property getter. More...
|
|
bool | TryAskingVccApiKey (std::string message="Please enter the VCC API key:") |
| Try asking the user to enter the VCC API key safely. More...
|
|
bool | TryAskingBearToken (std::string message="Please enter the OAuth 2.0 bearer token:") |
| Try asking the user to enter the OAuth 2.0 bearer token safely. More...
|
|
|
static const std::string | cConfigArgument {"config"} |
| Execution manifest filename argument key.
|
|
static const std::string | cEvConfigArgument {"evconfig"} |
| Extended Vehicle AA manifest filename argument key.
|
|
static const std::string | cDmConfigArgument {"dmconfig"} |
| Diagnostic Manager manifest filename argument key.
|
|
static const std::string | cPhmConfigArgument {"phmconfig"} |
| Platform Health Management manifest filename argument key.
|
|
static const std::string | cApiKeyArgument {"vccapikey"} |
| VCC API key argument key.
|
|
static const std::string | cBearerTokenArgument {"bearertoken"} |
| OAuth 2.0 bearer token argument key.
|
|
A helper class to manage the arguments passed to the main application.
◆ ArgumentConfiguration()
application::helper::ArgumentConfiguration::ArgumentConfiguration |
( |
int |
argc, |
|
|
char * |
argv[], |
|
|
std::string |
defaultConfigFile = "../../configuration/execution_manifest.arxml" , |
|
|
std::string |
extendedVehicleConfigFile = "../../configuration/extended_vehicle_manifest.arxml" , |
|
|
std::string |
diagnosticManagerConfigFile = "../../configuration/diagnostic_manager_manifest.arxml" , |
|
|
std::string |
healthMonitoringConfigFile = "../../configuration/health_monitoring_manifest.arxml" |
|
) |
| |
Constructor.
- Parameters
-
argc | Argument count |
argv | Passed arguments |
defaultConfigFile | Default execution manifest file path |
extendedVehicleConfigFile | Default Extended Vehicle AA manifest file path |
diagnosticManagerConfigFile | Default DM manifest file path |
healthMonitoringConfigFile | Default PHM manifest file path |
◆ GetArguments()
const std::map< std::string, std::string > & application::helper::ArgumentConfiguration::GetArguments |
( |
| ) |
const |
|
noexcept |
Arguments property getter.
- Returns
- All the parsed and/or set arguments
◆ TryAskingBearToken()
bool application::helper::ArgumentConfiguration::TryAskingBearToken |
( |
std::string |
message = "Please enter the OAuth 2.0 bearer token:" | ) |
|
Try asking the user to enter the OAuth 2.0 bearer token safely.
- Parameters
-
message | Message to be shown on the console to ask the bearer token |
- Returns
- True if the bearer token is set correctly; otherwise false
◆ TryAskingVccApiKey()
bool application::helper::ArgumentConfiguration::TryAskingVccApiKey |
( |
std::string |
message = "Please enter the VCC API key:" | ) |
|
Try asking the user to enter the VCC API key safely.
- Parameters
-
message | Message to be shown on the console to ask the API key |
- Returns
- True if the API key is set correctly; otherwise false