initial commit

This commit is contained in:
2026-08-07 15:56:42 +09:00
commit 91ad25aca9
1012 changed files with 159314 additions and 0 deletions
+34
View File
@@ -0,0 +1,34 @@
#ifndef ENV_HELPER_H
#define ENV_HELPER_H
/*!
* \file
* Helper functions for environment parsing
*/
namespace env {
/*!
* \brief Check if environment variable steered feature is enabled
*
* \param envvar environment variable name
* \return true if feature is enabled
*/
inline bool is_enabled (const std::string &envvar)
{
char *val = std::getenv(envvar.c_str());
if (! val)
return false;
std::string value(val);
if (value == "1")
return true;
if (value == "yes")
return true;
if (value == "true")
return true;
return false;
}
} // namespace
#endif