![]() |
Nix 2.36.0
Nix, the purely functional package manager; unstable internal interfaces
|
Go to the source code of this file.
Functions | |
| std::optional< std::string > | nix::getEnv (const std::string &key) |
| std::optional< OsString > | nix::getEnvOs (const OsString &key) |
| OsStringMap | nix::getEnvOs () |
| std::optional< std::string > | nix::getEnvNonEmpty (const std::string &key) |
| std::optional< OsString > | nix::getEnvOsNonEmpty (const OsString &key) |
| StringMap | nix::getEnv () |
| void | nix::setEnv (const char *name, const char *value) |
| void | nix::setEnvOs (const OsString &name, const OsString &value) |
| void | nix::unsetEnv (const char *name) |
| void | nix::unsetEnvOs (const OsChar *name) |
| void | nix::clearEnv () |
| void | nix::replaceEnv (const StringMap &newEnv) |
Utilities for working with the current process's environment variables.
| void nix::clearEnv | ( | ) |
Clear the environment.
| StringMap nix::getEnv | ( | ) |
Get the entire environment.
| std::optional< std::string > nix::getEnv | ( | const std::string & | key | ) |
| std::optional< std::string > nix::getEnvNonEmpty | ( | const std::string & | key | ) |
| OsStringMap nix::getEnvOs | ( | ) |
Like getEnv, but using OsString to avoid coercions.
| std::optional< OsString > nix::getEnvOs | ( | const OsString & | key | ) |
Like getEnv, but using OsString to avoid coercions.
| std::optional< OsString > nix::getEnvOsNonEmpty | ( | const OsString & | key | ) |
Like getEnvNonEmpty, but using OsString to avoid coercions. Returns nullopt if the env variable is not set or set to "".
| void nix::replaceEnv | ( | const StringMap & | newEnv | ) |
Replace the entire environment with the given one.
| void nix::setEnv | ( | const char * | name, |
| const char * | value ) |
Like POSIX setenv, but always overrides.
We don't need the non-overriding version, and this is easier to reimplement on Windows.
| SystemError | on failure |
Like setEnv, but using OsString to avoid coercions.
| void nix::unsetEnv | ( | const char * | name | ) |
Like POSIX unsetenv, on every platform.
Unsetting a variable that is not set succeeds.
| SystemError | on failure |
| void nix::unsetEnvOs | ( | const OsChar * | name | ) |
Like unsetEnv, but using OsChar to avoid coercions.