1 #ifndef _FLEDGE_UTILS_H 2 #define _FLEDGE_UTILS_H 16 #define _FLEDGE_ROOT_PATH "/usr/local/fledge" 28 static const string getRootDir()
30 const char* rootDir = getenv(
"FLEDGE_ROOT");
31 return (rootDir ?
string(rootDir) :
string(_FLEDGE_ROOT_PATH));
42 static const string getDataDir()
44 const char* dataDir = getenv(
"FLEDGE_DATA");
45 return (dataDir ?
string(dataDir) :
string(getRootDir() +
"/data"));
53 static std::string getDebugTracePath()
55 return getDataDir() +
"/logs/debug-trace";
77 static bool stringToBool(
const std::string& str)
79 std::string lowerStr = str;
80 std::transform(lowerStr.begin(), lowerStr.end(), lowerStr.begin(), ::tolower);
81 return (lowerStr ==
"true" || lowerStr ==
"1");
Definition: asset_tracking.h:108