#pragma once /** * @file * * Utilities for working with the current process's environment * variables. */ #include #include #include namespace nix { /** * @return an environment variable. */ std::optional getEnv(const std::string & key); /** * @return a non empty environment variable. Returns nullopt if the env * variable is set to "" */ std::optional getEnvNonEmpty(const std::string & key); /** * Get the entire environment. */ std::map getEnv(); /** * Clear the environment. */ void clearEnv(); /** * Replace the entire environment with the given one. */ void replaceEnv(const std::map & newEnv); }