From 5646d531f36507eef6f82520efef8ed541cb88fd Mon Sep 17 00:00:00 2001 From: Alexey Rybalchenko Date: Tue, 14 May 2019 13:22:38 +0200 Subject: [PATCH] Add GetProperties() --- fairmq/options/FairMQProgOptions.h | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/fairmq/options/FairMQProgOptions.h b/fairmq/options/FairMQProgOptions.h index 833452e7..a0a1a868 100644 --- a/fairmq/options/FairMQProgOptions.h +++ b/fairmq/options/FairMQProgOptions.h @@ -17,10 +17,12 @@ #include #include +#include #include #include #include #include +#include #include namespace fair @@ -126,6 +128,20 @@ class FairMQProgOptions return val; } + std::map GetProperties(const std::string& q) + { + std::regex re(q); + std::map result; + + for (const auto& m : fVarMap) { + if (std::regex_search(m.first, re)) { + result.emplace(m.first, m.second.value()); + } + } + + return result; + } + // Given a key, convert the variable value to string std::string GetStringValue(const std::string& key);