20 #ifndef GALOIS_SUBSTRATE_ENVCHECK_H
21 #define GALOIS_SUBSTRATE_ENVCHECK_H
26 #include "galois/config.h"
37 struct ConvByType<int> {
38 static void go(
const char* varVal,
int& ret) {
40 ret = std::atoi(varVal);
45 struct ConvByType<double> {
46 static void go(
const char* varVal,
double& ret) {
48 ret = std::atof(varVal);
53 struct ConvByType<std::string> {
54 static void go(
const char* varVal, std::string& ret) {
61 bool genericGetEnv(
const char* varName, T& ret) {
63 char* varVal = getenv(varName);
65 ConvByType<T>::go(varVal, ret);
76 bool EnvCheck(
const std::string& varName);
86 bool EnvCheck(
const char* varName, T& retVal) {
87 return internal::genericGetEnv(varName, retVal);
91 bool EnvCheck(
const std::string& varName, T& retVal) {
92 return EnvCheck(varName.c_str(), retVal);
bool EnvCheck(const char *varName)
Return true if the Enviroment variable is set.
Definition: EnvCheck.cpp:24