From 600fac48da54651fd02b9540477b1af188b5813c Mon Sep 17 00:00:00 2001 From: Kory Draughn Date: Thu, 14 Nov 2024 20:57:59 -0500 Subject: [PATCH] [#8044] Add copy/set operation to environment_properties class. --- .../include/irods/irods_environment_properties.hpp | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/lib/core/include/irods/irods_environment_properties.hpp b/lib/core/include/irods/irods_environment_properties.hpp index 01539019ed..dc9b58fe6b 100644 --- a/lib/core/include/irods/irods_environment_properties.hpp +++ b/lib/core/include/irods/irods_environment_properties.hpp @@ -7,6 +7,7 @@ #include "irods/irods_exception.hpp" #include +#include namespace irods { @@ -24,10 +25,21 @@ namespace irods { */ static environment_properties& instance(); + // Returns a copy of the underlying configuration. + static std::unordered_map copy_configuration() + { + return instance().config_props_.map(); + } // copy_configuration + + void set_configuration(std::unordered_map _config) + { + config_props_.map() = std::move(_config); + } // set_configuration + /** * @brief Read environment configuration and fill environment_properties::properties */ - void capture( ); + void capture(); /** * @brief Get a property from the map if it exists. catch the exception in the case where