Get environment variable as a string * * @note Return empty string on bare-metal * * @param[in] env_name Name of the Environment variable to retrieve * * @return Environment variable content, or empty string if the variable is undefined or on bare-metal */
| 224 | * @return Environment variable content, or empty string if the variable is undefined or on bare-metal |
| 225 | */ |
| 226 | inline std::string getenv(const std::string &env_name) |
| 227 | { |
| 228 | #ifdef BARE_METAL |
| 229 | ARM_COMPUTE_UNUSED(env_name); |
| 230 | return std::string{}; |
| 231 | #else // BARE_METAL |
| 232 | const auto env_chr = std::getenv(env_name.c_str()); |
| 233 | return env_chr == nullptr ? std::string{} : std::string{env_chr}; |
| 234 | #endif // BARE_METAL |
| 235 | } |
| 236 | } // namespace utility |
| 237 | } // namespace arm_compute |
| 238 | #endif // ACL_ARM_COMPUTE_CORE_UTILS_MISC_UTILITY_H |