diff options
author | Brad King <brad.king@kitware.com> | 2012-04-24 20:24:17 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2012-04-24 20:56:14 (GMT) |
commit | b10c5cbb878af541f4ffa35a9e287c31743c6e97 (patch) | |
tree | d812f0b9f60fb650f5f7cbee21bbfe73490f222e /Source/cmSystemTools.h | |
parent | 93e6069553874e11af8915da68996fb4323d4a52 (diff) | |
download | CMake-b10c5cbb878af541f4ffa35a9e287c31743c6e97.zip CMake-b10c5cbb878af541f4ffa35a9e287c31743c6e97.tar.gz CMake-b10c5cbb878af541f4ffa35a9e287c31743c6e97.tar.bz2 |
CTest: Simplify environment save/restore
Replace use of AppendEnv/RestoreEnv pairs with instances of
SaveRestoreEnvironment. Simplify the signature of AppendEnv and use it
in place of similar loops elsewhere. Move the RestoreEnv implementation
inside the SaveRestoreEnvironment destructor which is the only place
left that calls it.
Diffstat (limited to 'Source/cmSystemTools.h')
-rw-r--r-- | Source/cmSystemTools.h | 12 |
1 files changed, 2 insertions, 10 deletions
diff --git a/Source/cmSystemTools.h b/Source/cmSystemTools.h index 5f21de2..69673c9 100644 --- a/Source/cmSystemTools.h +++ b/Source/cmSystemTools.h @@ -371,16 +371,8 @@ public: /** Get the list of all environment variables */ static std::vector<std::string> GetEnvironmentVariables(); - /** Append multiple variables to the current environment. - Return the original environment, as it was before the - append. */ - static std::vector<std::string> AppendEnv( - std::vector<std::string>* env); - - /** Restore the full environment to "env" - use after - AppendEnv to put the environment back to the way it - was. */ - static void RestoreEnv(const std::vector<std::string>& env); + /** Append multiple variables to the current environment. */ + static void AppendEnv(std::vector<std::string> const& env); /** Helper class to save and restore the environment. Instantiate this class as an automatic variable on |