diff options
Diffstat (limited to 'base/env_var.h')
-rw-r--r-- | base/env_var.h | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/base/env_var.h b/base/env_var.h index 9622e74..43d3fd6 100644 --- a/base/env_var.h +++ b/base/env_var.h @@ -20,11 +20,14 @@ extern const char kHome[]; } // namespace env_vars -// These are used to derive mocks for unittests. class EnvVarGetter { public: virtual ~EnvVarGetter(); + // Static factory method that returns the implementation that provide the + // appropriate platform-specific instance. + static EnvVarGetter* Create(); + // Gets an environment variable's value and stores it in |result|. // Returns false if the key is unset. virtual bool GetEnv(const char* variable_name, std::string* result) = 0; @@ -36,8 +39,8 @@ class EnvVarGetter { virtual bool SetEnv(const char* variable_name, const std::string& new_value) = 0; - // Create an instance of EnvVarGetter - static EnvVarGetter* Create(); + // Returns true on success, otherwise returns false. + virtual bool UnSetEnv(const char* variable_name) = 0; }; } // namespace base |