Replace boost::replace_all and boost::ireplace_all
Replaced with custom functions using std::string_view to remove Boost
dependency and reduce template instantiation, keeping original
behavior.
Tested: added UT and verified all tests passed
Change-Id: I82cc238c800c7780dc50b6a40445657931bf5250
Signed-off-by: George Liu <liuxiwei@ieisystem.com>
Signed-off-by: Ed Tanous <etanous@nvidia.com>
diff --git a/src/entity_manager/perform_probe.cpp b/src/entity_manager/perform_probe.cpp
index f398860..e5b57eb 100644
--- a/src/entity_manager/perform_probe.cpp
+++ b/src/entity_manager/perform_probe.cpp
@@ -5,7 +5,6 @@
 
 #include "perform_scan.hpp"
 
-#include <boost/algorithm/string/replace.hpp>
 #include <phosphor-logging/lg2.hpp>
 
 #include <regex>
@@ -114,7 +113,8 @@
                         return false;
                     }
                     std::string commandStr = *(match.begin() + 1);
-                    boost::replace_all(commandStr, "'", "");
+                    replaceAll(commandStr, "'", "");
+
                     cur = (std::find(scan->passedProbes.begin(),
                                      scan->passedProbes.end(), commandStr) !=
                            scan->passedProbes.end());
@@ -136,8 +136,9 @@
             }
             std::string commandStr = *(match.begin() + 1);
             // convert single ticks and single slashes into legal json
-            boost::replace_all(commandStr, "'", "\"");
-            boost::replace_all(commandStr, R"(\)", R"(\\)");
+            std::ranges::replace(commandStr, '\'', '"');
+
+            replaceAll(commandStr, R"(\)", R"(\\)");
             auto json = nlohmann::json::parse(commandStr, nullptr, false, true);
             if (json.is_discarded())
             {