From 7df336664ad6fb28b5c8271f7c847ead37009e5c Mon Sep 17 00:00:00 2001 From: Allan Odgaard Date: Mon, 24 Sep 2012 21:29:04 +0200 Subject: [PATCH] Add set_basic_environment MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This is in cases where we don’t want the “clean” environment setup by default. --- Frameworks/io/src/environment.cc | 14 ++++++++++++-- Frameworks/io/src/environment.h | 1 + 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/Frameworks/io/src/environment.cc b/Frameworks/io/src/environment.cc index bdf1ea9f..2b059774 100644 --- a/Frameworks/io/src/environment.cc +++ b/Frameworks/io/src/environment.cc @@ -40,10 +40,20 @@ namespace oak return res; } - std::map const& basic_environment () + std::map& rw_environment () { - static std::map const* environment = new std::map(setup_basic_environment()); + static std::map* environment = new std::map(setup_basic_environment()); return *environment; } + std::map const& basic_environment () + { + return rw_environment(); + } + + void set_basic_environment (std::map const& newEnvironment) + { + rw_environment() = newEnvironment; + } + } /* io */ \ No newline at end of file diff --git a/Frameworks/io/src/environment.h b/Frameworks/io/src/environment.h index b4199563..3a8de94f 100644 --- a/Frameworks/io/src/environment.h +++ b/Frameworks/io/src/environment.h @@ -6,6 +6,7 @@ namespace oak { PUBLIC std::map const& basic_environment (); + PUBLIC void set_basic_environment (std::map const& newEnvironment); } /* io */