mirror of
https://github.com/FairRootGroup/FairMQ.git
synced 2025-10-13 16:46:47 +00:00
Add GetProperties()
This commit is contained in:
parent
f46803a8b6
commit
5646d531f3
|
@ -17,10 +17,12 @@
|
||||||
#include <boost/program_options.hpp>
|
#include <boost/program_options.hpp>
|
||||||
|
|
||||||
#include <unordered_map>
|
#include <unordered_map>
|
||||||
|
#include <map>
|
||||||
#include <functional>
|
#include <functional>
|
||||||
#include <string>
|
#include <string>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
#include <mutex>
|
#include <mutex>
|
||||||
|
#include <regex>
|
||||||
#include <sstream>
|
#include <sstream>
|
||||||
|
|
||||||
namespace fair
|
namespace fair
|
||||||
|
@ -126,6 +128,20 @@ class FairMQProgOptions
|
||||||
return val;
|
return val;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
std::map<std::string, boost::any> GetProperties(const std::string& q)
|
||||||
|
{
|
||||||
|
std::regex re(q);
|
||||||
|
std::map<std::string, boost::any> 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
|
// Given a key, convert the variable value to string
|
||||||
std::string GetStringValue(const std::string& key);
|
std::string GetStringValue(const std::string& key);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user