diff --git a/CMakeLists.txt b/CMakeLists.txt index 946291af01..fa11fad7bc 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -84,7 +84,7 @@ message(STATUS "${CMAKE_PROJECT_NAME}: PLUGIN_LIBRARY_OUTPUT_DIRECTORY: ${PLUGIN # Check and print what JANA2 is used -find_package(JANA REQUIRED) +find_package(JANA 2.0.8 REQUIRED) message(STATUS "${CMAKE_PROJECT_NAME}: JANA2 CMake : ${JANA_DIR}") message(STATUS "${CMAKE_PROJECT_NAME}: JANA2 includes: ${JANA_INCLUDE_DIR}") message(STATUS "${CMAKE_PROJECT_NAME}: JANA2 library : ${JANA_LIBRARY}") diff --git a/src/detectors/FOFFMTRK/OffMomentumReconstruction_factory.cc b/src/detectors/FOFFMTRK/OffMomentumReconstruction_factory.cc index 52e66fa55f..166750082a 100644 --- a/src/detectors/FOFFMTRK/OffMomentumReconstruction_factory.cc +++ b/src/detectors/FOFFMTRK/OffMomentumReconstruction_factory.cc @@ -6,7 +6,6 @@ #include "OffMomentumReconstruction_factory.h" #include "services/log/Log_service.h" #include "extensions/spdlog/SpdlogExtensions.h" -#include "extensions/string/StringHelpers.h" namespace eicrecon { @@ -15,7 +14,7 @@ namespace eicrecon { void OffMomentumReconstruction_factory::Init() { - std::string plugin_name = eicrecon::str::ReplaceAll(GetPluginName(), ".so", ""); + std::string plugin_name = GetPluginName(); std::string param_prefix = plugin_name + ":" + m_input_tag + ":"; auto app = GetApplication(); diff --git a/src/detectors/RPOTS/RomanPotsReconstruction_factory.cc b/src/detectors/RPOTS/RomanPotsReconstruction_factory.cc index ed9293716c..d4d4754da8 100644 --- a/src/detectors/RPOTS/RomanPotsReconstruction_factory.cc +++ b/src/detectors/RPOTS/RomanPotsReconstruction_factory.cc @@ -8,7 +8,6 @@ #include "RomanPotsReconstruction_factory.h" #include "services/log/Log_service.h" #include "extensions/spdlog/SpdlogExtensions.h" -#include "extensions/string/StringHelpers.h" namespace eicrecon { @@ -17,7 +16,7 @@ namespace eicrecon { void RomanPotsReconstruction_factory::Init() { - std::string plugin_name = eicrecon::str::ReplaceAll(GetPluginName(), ".so", ""); + std::string plugin_name = GetPluginName(); std::string param_prefix = plugin_name + ":" + m_input_tag + ":"; auto app = GetApplication(); diff --git a/src/extensions/jana/JChainFactoryT.h b/src/extensions/jana/JChainFactoryT.h index b315f52268..60c96ce430 100644 --- a/src/extensions/jana/JChainFactoryT.h +++ b/src/extensions/jana/JChainFactoryT.h @@ -14,7 +14,6 @@ #include #include "services/io/podio/JFactoryPodioT.h" -#include "extensions/string/StringHelpers.h" /// This struct might be used for factories that has no underlying config class @@ -66,8 +65,7 @@ class JChainFactoryT : public BaseT { /// Get default prefix name std::string GetDefaultParameterPrefix() { - std::string plugin_name = eicrecon::str::ReplaceAll(this->GetPluginName(), ".so", ""); - std::string param_prefix = plugin_name+ ":" + this->GetTag(); + std::string param_prefix = this->GetPluginName() + ":" + this->GetTag(); return std::move(param_prefix); } diff --git a/src/extensions/jana/JChainMultifactoryGeneratorT.h b/src/extensions/jana/JChainMultifactoryGeneratorT.h index 2770ed1f80..af6eb4165f 100644 --- a/src/extensions/jana/JChainMultifactoryGeneratorT.h +++ b/src/extensions/jana/JChainMultifactoryGeneratorT.h @@ -60,8 +60,8 @@ class JChainMultifactoryGeneratorT : public JFactoryGenerator { void Init() { - std::string plugin_name = eicrecon::str::ReplaceAll(this->GetPluginName(), ".so", ""); - m_prefix = plugin_name+ ":" + m_tag; + std::string plugin_name = this->GetPluginName(); + m_prefix = plugin_name + ":" + m_tag; // Get input data tags m_app->SetDefaultParameter(m_prefix + ":InputTags", m_input_tags, "Input data tag names"); diff --git a/src/extensions/jana/JChainMultifactoryT.h b/src/extensions/jana/JChainMultifactoryT.h index ad5de23ff5..69ce169e49 100644 --- a/src/extensions/jana/JChainMultifactoryT.h +++ b/src/extensions/jana/JChainMultifactoryT.h @@ -22,7 +22,6 @@ #include "datamodel_glue.h" #include #include "extensions/jana/JChainFactoryT.h" // Just to pull in struct NoConfig -#include "extensions/string/StringHelpers.h" template diff --git a/src/extensions/string/StringHelpers.h b/src/extensions/string/StringHelpers.h deleted file mode 100644 index 45c26e7d73..0000000000 --- a/src/extensions/string/StringHelpers.h +++ /dev/null @@ -1,243 +0,0 @@ -// Created by Dmitry Romanov -// Subject to the terms in the LICENSE file found in the top-level directory. -// - -#pragma once - -#include -#include -#include -#include - -namespace eicrecon::str -{ - inline bool EndsWith(const std::string &str, const char *suffix, unsigned suffixLen) - { - return str.size() >= suffixLen && 0 == str.compare(str.size()-suffixLen, suffixLen, suffix, suffixLen); - } - - inline bool EndsWith(const std::string& str, const char* suffix) - { - return EndsWith(str, suffix, static_cast(std::string::traits_type::length(suffix))); - } - - inline bool StartsWith(const std::string &str, const char *prefix, unsigned prefixLen) - { - return str.size() >= prefixLen && 0 == str.compare(0, prefixLen, prefix, prefixLen); - } - - inline bool StartsWith(const std::string &str, const char *prefix) - { - return StartsWith(str, prefix, static_cast(std::string::traits_type::length(prefix))); - } - - inline bool StartsWith(const std::string &str, const std::string &prefix) - { - return StartsWith(str, prefix.c_str()); - } - - // TrimThis from start (in place) - inline void LeftTrimThis(std::string &s) - { - s.erase(s.begin(), std::find_if(s.begin(), s.end(), [](int ch) { - return !std::isspace(ch); - })); - } - - // TrimThis from end (in place) - inline void RightTrimThis(std::string &s) - { - s.erase(std::find_if(s.rbegin(), s.rend(), [](int ch) { - return !std::isspace(ch); - }).base(), s.end()); - } - - // TrimThis from both ends (in place) - inline void TrimThis(std::string &s) - { - LeftTrimThis(s); - RightTrimThis(s); - } - - // TrimThis from start (copying) - inline std::string LeftTrimCopy(std::string s) - { - LeftTrimThis(s); - return s; - } - - // TrimThis from end (copying) - inline std::string RightTrimCopy(std::string s) - { - RightTrimThis(s); - return s; - } - - // TrimThis from both ends (copying) - inline std::string TrimCopy(std::string s) - { - TrimThis(s); - return s; - } - - inline std::vector Split(const std::string& content, const std::string& delimiter) - { - std::vector result; - auto prev_pos = content.begin(); - auto next_pos = std::search(prev_pos, content.end(), - delimiter.begin(), delimiter.end()); - while (next_pos != content.end()) - { - result.emplace_back(prev_pos, next_pos); - prev_pos = next_pos + delimiter.size(); - next_pos = std::search(prev_pos, content.end(), - delimiter.begin(), delimiter.end()); - } - - if (prev_pos != content.end()) - { - result.emplace_back(prev_pos, content.end()); - } - return result; - } - - /** - * Check the character is one of " \n\t\v\r\f" - * - * @param ch character to check - * @return true if character is one of " \n\t\v\r\f" - */ - constexpr bool IsBlank(char ch){ - return ((ch)==' ' || (ch)=='\n' || (ch)=='\t' || (ch)=='\v' || (ch)=='\r' || (ch)=='\f'); - } - - - /** Splits string to lexical values. - * - * LexicalSplit treats: - * 1) "quoted values" as one value, - * 2) '#' not in the beginning of the file are treated as comments to the end of the line - * 3) skips all white space characters. All specification is in doc/ccdb_file_format.pdf - * - * @remark - * Handling inconsistencies and errors while readout parse time: - * - No ending quote. If no ending " is found, string value will be taken - * until the end of line. - * - Comment inside a string. Comment symbol inside the line is ignored. - * So if you have a record in the file "info #4" it will be read just - * as "info #4" string - * - Sticking string. In case of there is no spaces between symbols and - * a quote, all will be merged as one string. I.e.: - * John" Smith" will be parsed as one value: "John Smith" - * John" "Smith will be parsed as one value: "John Smith" - * but be careful(!) not to forget to do a spaces between columns - * 5.14"Smith" will be parsed as one value "5.14Smith" that probably would - * lead to errors if these were two different columns - * - If data contains string fields they are taken into "..." characters. All " - * inside string should be saved by \" symbol. All words and symbols - * inside "..." will be interpreted as string entity. - * - */ - inline std::vector LexicalSplit(const std::string& source ) - { - std::vector tokens; - - tokens.reserve(160); - bool stringIsStarted = false; //Indicates that we meet '"' and looking for second one - std::string readValue; - - //iterate through string - for(size_t i=0; i0) - { - tokens.push_back(readValue); - readValue=""; - } - } - else - { - //it is not a blank character! - if(source[i]=='\\' && stringIsStarted && i<(source.length()-1) && source[i+1]=='"') - { - //ok! we found a \" inside a string! Not a problem! At all! - - i++; //skip this \ symbol - readValue+=source[i]; //it is just one more symbol in value - } - else if(source[i]=='#' && !stringIsStarted) //lets check if it is a comment symbol that is not inside a string... - { - //it is a comment started... - //lets save what we collected for now if we collected - if(readValue.length()>0) - { - tokens.push_back(readValue); - readValue=""; - } - - //and put there the rest of the lint(all comment) if there is something to put - if(i<(source.length()-1)) - { - tokens.push_back(source.substr(i)); - - //after that a gentlemen should exit - break; - } - } - else if(source[i]=='"') - { - - //it is a beginning or ending of a string - //just set appropriate flag and continue - stringIsStarted = !stringIsStarted; - } - else - { - //it is just one more symbol in file - readValue+=source[i]; - } - } - - //last we have is to check that - //it is not the end of the lint - if(i==(source.length()-1) && readValue.length()>0) - { - tokens.push_back(readValue); - readValue=""; - } - } - - return tokens; - } - - /** - * Replaces all occurrences of 'from' in 'str' to 'to' - * @param str - input string - * @param from - substring to search - * @param to - value to replace - */ - inline void ReplaceAllInPlace(std::string& str, const std::string& from, const std::string& to) { - if(from.empty()) - return; - size_t start_pos = 0; - while((start_pos = str.find(from, start_pos)) != std::string::npos) { - str.replace(start_pos, from.length(), to); - start_pos += to.length(); // In case 'to' contains 'from', like replacing 'x' with 'yx' - } - } - - /** - * Replaces all occurrences of 'from' in copy of 'str' to 'to', returns changed copy of srt - * @param str - input string - * @param from - substring to search - * @param to - value to replace - * @return resulting string - */ - inline std::string ReplaceAll(std::string str, const std::string& from, const std::string& to) { - ReplaceAllInPlace(str, from, to); - return str; - } -} diff --git a/src/factories/calorimetry/CalorimeterClusterRecoCoG_factoryT.h b/src/factories/calorimetry/CalorimeterClusterRecoCoG_factoryT.h index a04f5d47de..1ca712216b 100644 --- a/src/factories/calorimetry/CalorimeterClusterRecoCoG_factoryT.h +++ b/src/factories/calorimetry/CalorimeterClusterRecoCoG_factoryT.h @@ -37,7 +37,7 @@ class CalorimeterClusterRecoCoG_factoryT : auto app = GetApplication(); // This prefix will be used for parameters - std::string plugin_name = eicrecon::str::ReplaceAll(GetPluginName(), ".so", ""); + std::string plugin_name = GetPluginName(); std::string param_prefix = plugin_name + ":" + GetTag(); // Use JDD4hep_service to get dd4hep::Detector diff --git a/src/factories/calorimetry/CalorimeterHitDigi_factoryT.h b/src/factories/calorimetry/CalorimeterHitDigi_factoryT.h index 1542f39005..677e1cc63c 100644 --- a/src/factories/calorimetry/CalorimeterHitDigi_factoryT.h +++ b/src/factories/calorimetry/CalorimeterHitDigi_factoryT.h @@ -34,7 +34,7 @@ namespace eicrecon { auto app = GetApplication(); // This prefix will be used for parameters - std::string plugin_name = eicrecon::str::ReplaceAll(GetPluginName(), ".so", ""); + std::string plugin_name = GetPluginName(); std::string param_prefix = plugin_name + ":" + GetTag(); // Use JDD4hep_service to get dd4hep::Detector diff --git a/src/factories/calorimetry/CalorimeterHitReco_factoryT.h b/src/factories/calorimetry/CalorimeterHitReco_factoryT.h index d846694cb7..b36283df33 100644 --- a/src/factories/calorimetry/CalorimeterHitReco_factoryT.h +++ b/src/factories/calorimetry/CalorimeterHitReco_factoryT.h @@ -33,7 +33,7 @@ class CalorimeterHitReco_factoryT : auto app = GetApplication(); // This prefix will be used for parameters - std::string plugin_name = eicrecon::str::ReplaceAll(GetPluginName(), ".so", ""); + std::string plugin_name = GetPluginName(); std::string param_prefix = plugin_name + ":" + GetTag(); // Use JDD4hep_service to get dd4hep::Detector diff --git a/src/factories/calorimetry/CalorimeterHitsMerger_factoryT.h b/src/factories/calorimetry/CalorimeterHitsMerger_factoryT.h index b8fea4b293..0e9c631a0f 100644 --- a/src/factories/calorimetry/CalorimeterHitsMerger_factoryT.h +++ b/src/factories/calorimetry/CalorimeterHitsMerger_factoryT.h @@ -33,7 +33,7 @@ class CalorimeterHitsMerger_factoryT : auto app = GetApplication(); // This prefix will be used for parameters - std::string plugin_name = eicrecon::str::ReplaceAll(GetPluginName(), ".so", ""); + std::string plugin_name = GetPluginName(); std::string param_prefix = plugin_name + ":" + GetTag(); // Use JDD4hep_service to get dd4hep::Detector diff --git a/src/global/digi/SiliconTrackerDigi_factory.cc b/src/global/digi/SiliconTrackerDigi_factory.cc index 6c553fda10..b502aaa9f7 100644 --- a/src/global/digi/SiliconTrackerDigi_factory.cc +++ b/src/global/digi/SiliconTrackerDigi_factory.cc @@ -4,17 +4,14 @@ #include "services/log/Log_service.h" #include "extensions/spdlog/SpdlogExtensions.h" -#include "extensions/string/StringHelpers.h" #include "SiliconTrackerDigi_factory.h" void eicrecon::SiliconTrackerDigi_factory::Init() { - using namespace eicrecon::str; - auto app = GetApplication(); auto pm = app->GetJParameterManager(); - std::string plugin_name = ReplaceAll(GetPluginName(), ".so", ""); + std::string plugin_name = GetPluginName(); // We will use plugin name to get parameters for correct factory // So if we use :parameter whichever plugin uses this template. eg: diff --git a/src/global/tracking/CKFTracking_factory.cc b/src/global/tracking/CKFTracking_factory.cc index c726714c00..91323371ec 100644 --- a/src/global/tracking/CKFTracking_factory.cc +++ b/src/global/tracking/CKFTracking_factory.cc @@ -10,7 +10,6 @@ #include #include "extensions/spdlog/SpdlogExtensions.h" -#include "extensions/string/StringHelpers.h" #include "services/geometry/acts/ACTSGeo_service.h" #include "services/geometry/dd4hep/JDD4hep_service.h" #include "services/log/Log_service.h" @@ -19,7 +18,7 @@ void eicrecon::CKFTracking_factory::Init() { auto app = GetApplication(); // This prefix will be used for parameters - std::string plugin_name = eicrecon::str::ReplaceAll(GetPluginName(), ".so", ""); + std::string plugin_name = GetPluginName(); std::string param_prefix = plugin_name+ ":" + GetTag(); // Initialize input tags diff --git a/src/global/tracking/IterativeVertexFinder_factory.cc b/src/global/tracking/IterativeVertexFinder_factory.cc index 8904556235..f42c25b949 100644 --- a/src/global/tracking/IterativeVertexFinder_factory.cc +++ b/src/global/tracking/IterativeVertexFinder_factory.cc @@ -7,7 +7,6 @@ #include "IterativeVertexFinder_factory.h" #include "extensions/spdlog/SpdlogExtensions.h" -#include "extensions/string/StringHelpers.h" #include "services/geometry/acts/ACTSGeo_service.h" #include "services/log/Log_service.h" #include "services/geometry/dd4hep/JDD4hep_service.h" @@ -16,7 +15,7 @@ void eicrecon::IterativeVertexFinder_factory::Init() { auto app = GetApplication(); // This prefix will be used for parameters - std::string plugin_name = eicrecon::str::ReplaceAll(GetPluginName(), ".so", ""); + std::string plugin_name = GetPluginName(); std::string param_prefix = plugin_name + ":" + GetTag(); // Initialize input tags diff --git a/src/global/tracking/ParticlesWithTruthPID_factory.cc b/src/global/tracking/ParticlesWithTruthPID_factory.cc index 250c6522fc..ae0df2bc0d 100644 --- a/src/global/tracking/ParticlesWithTruthPID_factory.cc +++ b/src/global/tracking/ParticlesWithTruthPID_factory.cc @@ -4,7 +4,6 @@ #include #include -#include "extensions/string/StringHelpers.h" #include "ParticlesWithTruthPID_factory.h" @@ -12,7 +11,7 @@ void eicrecon::ParticlesWithTruthPID_factory::Init() { auto app = GetApplication(); // This prefix will be used for parameters - std::string plugin_name = eicrecon::str::ReplaceAll(GetPluginName(), ".so", ""); + std::string plugin_name = GetPluginName(); std::string param_prefix = plugin_name + ":" + GetTag(); // SpdlogMixin logger initialization, sets m_log diff --git a/src/global/tracking/TrackParamTruthInit_factory.cc b/src/global/tracking/TrackParamTruthInit_factory.cc index 1585574584..e712ef936c 100644 --- a/src/global/tracking/TrackParamTruthInit_factory.cc +++ b/src/global/tracking/TrackParamTruthInit_factory.cc @@ -8,7 +8,7 @@ void eicrecon::TrackParamTruthInit_factory::Init() { auto app = GetApplication(); // This prefix will be used for parameters - std::string plugin_name = eicrecon::str::ReplaceAll(GetPluginName(), ".so", ""); + std::string plugin_name = GetPluginName(); std::string param_prefix = plugin_name+ ":" + GetTag(); // Initialize input tags diff --git a/src/global/tracking/TrackProjector_factory.cc b/src/global/tracking/TrackProjector_factory.cc index 5f29356a5a..2ed2a7e4a3 100644 --- a/src/global/tracking/TrackProjector_factory.cc +++ b/src/global/tracking/TrackProjector_factory.cc @@ -6,7 +6,6 @@ #include #include "TrackProjector_factory.h" -#include "extensions/string/StringHelpers.h" #include "algorithms/tracking/JugTrack/TrackingResultTrajectory.hpp" #include "services/geometry/acts/ACTSGeo_service.h" diff --git a/src/global/tracking/TrackSeeding_factory.cc b/src/global/tracking/TrackSeeding_factory.cc index 5f3f4bbcb5..e3aad69c9c 100644 --- a/src/global/tracking/TrackSeeding_factory.cc +++ b/src/global/tracking/TrackSeeding_factory.cc @@ -11,14 +11,13 @@ #include "extensions/spdlog/SpdlogExtensions.h" #include "services/geometry/acts/ACTSGeo_service.h" #include "services/log/Log_service.h" -#include "extensions/string/StringHelpers.h" #include "services/geometry/dd4hep/JDD4hep_service.h" void eicrecon::TrackSeeding_factory::Init() { auto app = GetApplication(); // This prefix will be used for parameters - std::string plugin_name = eicrecon::str::ReplaceAll(GetPluginName(), ".so", ""); + std::string plugin_name = GetPluginName(); std::string param_prefix = plugin_name+ ":" + GetTag(); // Initialize input tags diff --git a/src/global/tracking/TrackerHitCollector_factory.cc b/src/global/tracking/TrackerHitCollector_factory.cc index 2c74c686cb..d3c82ce2bd 100644 --- a/src/global/tracking/TrackerHitCollector_factory.cc +++ b/src/global/tracking/TrackerHitCollector_factory.cc @@ -8,7 +8,6 @@ #include "TrackerHitCollector_factory.h" #include "services/log/Log_service.h" #include "extensions/spdlog/SpdlogExtensions.h" -#include "extensions/string/StringHelpers.h" namespace eicrecon { void TrackerHitCollector_factory::Init() { @@ -16,7 +15,7 @@ namespace eicrecon { auto app = this->GetApplication(); // This prefix will be used for parameters - std::string plugin_name = eicrecon::str::ReplaceAll(GetPluginName(), ".so", ""); + std::string plugin_name = GetPluginName(); std::string param_prefix = plugin_name+ ":" + GetTag(); // Now we check that user provided an input names diff --git a/src/global/tracking/TrackerHitReconstruction_factory.cc b/src/global/tracking/TrackerHitReconstruction_factory.cc index 5a68d26e45..9f1f5503b7 100644 --- a/src/global/tracking/TrackerHitReconstruction_factory.cc +++ b/src/global/tracking/TrackerHitReconstruction_factory.cc @@ -11,7 +11,6 @@ #include "services/geometry/dd4hep/JDD4hep_service.h" #include "services/log/Log_service.h" #include "extensions/spdlog/SpdlogExtensions.h" -#include "extensions/string/StringHelpers.h" void TrackerHitReconstruction_factory::Init() { diff --git a/src/global/tracking/TrackerSourceLinker_factory.cc b/src/global/tracking/TrackerSourceLinker_factory.cc index bb3cf0e968..2b393a0a25 100644 --- a/src/global/tracking/TrackerSourceLinker_factory.cc +++ b/src/global/tracking/TrackerSourceLinker_factory.cc @@ -10,7 +10,6 @@ #include "JANA/JEvent.h" #include "services/log/Log_service.h" #include "extensions/spdlog/SpdlogExtensions.h" -#include "extensions/string/StringHelpers.h" namespace eicrecon { @@ -21,7 +20,7 @@ namespace eicrecon { auto pm = app->GetJParameterManager(); // This prefix will be used for parameters - std::string plugin_name = eicrecon::str::ReplaceAll(GetPluginName(), ".so", ""); + std::string plugin_name = GetPluginName(); std::string param_prefix = plugin_name+ ":" + GetTag(); // Now we check that user provided an input names diff --git a/src/global/tracking/TrackingResult_factory.cc b/src/global/tracking/TrackingResult_factory.cc index 5ed22a3071..ef87e50d8e 100644 --- a/src/global/tracking/TrackingResult_factory.cc +++ b/src/global/tracking/TrackingResult_factory.cc @@ -5,7 +5,6 @@ #include "TrackingResult_factory.h" #include "services/log/Log_service.h" #include "extensions/spdlog/SpdlogExtensions.h" -#include "extensions/string/StringHelpers.h" #include void TrackingResult_factory::Init() { diff --git a/src/global/tracking/TruthTrackSeeding_factory.cc b/src/global/tracking/TruthTrackSeeding_factory.cc index a0f3767d19..7a2c546d58 100644 --- a/src/global/tracking/TruthTrackSeeding_factory.cc +++ b/src/global/tracking/TruthTrackSeeding_factory.cc @@ -11,11 +11,10 @@ #include "TruthTrackSeeding_factory.h" #include "services/geometry/acts/ACTSGeo_service.h" -#include "extensions/string/StringHelpers.h" void eicrecon::TruthTrackSeeding_factory::Init() { // This prefix will be used for parameters - std::string plugin_name = eicrecon::str::ReplaceAll(GetPluginName(), ".so", ""); + std::string plugin_name = GetPluginName(); std::string param_prefix = plugin_name+ ":" + GetTag(); // Create plugin level sub-log diff --git a/src/utilities/dump_flags/DumpFlags_processor.cc b/src/utilities/dump_flags/DumpFlags_processor.cc index afa28e5802..c6f95a932e 100644 --- a/src/utilities/dump_flags/DumpFlags_processor.cc +++ b/src/utilities/dump_flags/DumpFlags_processor.cc @@ -5,8 +5,6 @@ #include -#include "extensions/string/StringHelpers.h" - using namespace fmt; @@ -77,7 +75,8 @@ void DumpFlags_processor::Finish() for(auto [name,param]: pm->GetAllParameters()) { // form python content string - std::string python_escaped_descr = eicrecon::str::ReplaceAll(param->GetDescription(), "'", "`"); + std::string python_escaped_descr = param->GetDescription(); + std::replace(python_escaped_descr.begin(), python_escaped_descr.end(), '\'', '`'); python_content += fmt::format(" ({:{}} {:{}} '{}'),\n", fmt::format("'{}',", param->GetKey()), max_name_len + 3, @@ -87,7 +86,8 @@ void DumpFlags_processor::Finish() ); // form json content string - std::string json_escaped_descr = eicrecon::str::ReplaceAll(param->GetDescription(), "\"", "'"); + std::string json_escaped_descr = param->GetDescription(); + std::replace(json_escaped_descr.begin(), json_escaped_descr.end(), '"', '\''); json_content += fmt::format(" {}[\"{}\", \"{}\", \"{}\", \"{}\"]\n", line_num++==0?' ': ',', param->GetKey(),