#pragma once #include #include #include #include namespace NYT { //////////////////////////////////////////////////////////////////////////////// // NB: Currently not supported on other platforms. #if defined(_linux_) || defined(_darwin_) std::vector GetEnvironNameValuePairs(); #endif std::pair> ParseEnvironNameValuePair(TStringBuf pair); std::optional TryGetEnvValue(TStringBuf name); std::string GetEnvValueOrThrow(TStringBuf name); //! Returns the value of the environment variable #name parsed as #T (via |FromString|). //! Throws if the variable is not set or its value cannot be parsed. template T GetEnvValueOrThrow(TStringBuf name); //////////////////////////////////////////////////////////////////////////////// } // namespace NYT #define ENV_INL_H_ #include "env-inl.h" #undef ENV_INL_H_