11 #include <framework/utilities/MakeROOTCompatible.h>
12 #include <framework/logging/Logger.h>
14 #include <boost/algorithm/string/replace.hpp>
26 return std::map<std::string, std::string> {
68 if (str.find(
"__") != std::string::npos) {
69 B2WARNING(
"String passed to makeROOTCompatible contains double-underscore __, which is used internally for escaping special characters. "
70 "It is recommended to avoid this. However escaping a string twice with makeROOTCompatible is safe, but will print this warning. "
71 "Passed string: " + str);
74 for (
auto& pair : replace) {
75 boost::replace_all(str, pair.first, pair.second);
77 const static std::regex blackList(
"[^a-zA-Z0-9_]");
78 return std::regex_replace(str, blackList,
"");
84 for (
auto& pair : replace) {
85 boost::replace_all(str, pair.second, pair.first);