carb::extras::getStringFromMapOrEnvVar

Defined in carb/extras/VariableSetup.h

inline std::string carb::extras::getStringFromMapOrEnvVar(const char *stringMapKey, const std::map<std::string, std::string> &stringMap, const char *envVarName)

Helper function that reads string value form the string map or the environment variable, if map doesn’t hold such key.

Parameters
  • stringMapKey – Key that should be present in the map.

  • stringMap – String map containing values indexed by string key.

  • envVarName – Environment variable name.

Returns

String value. Can be empty if neither string map value nor env contain the value.