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/utils.cpp b/src/entity_manager/utils.cpp
index 6f51ec8..4e46395 100644
--- a/src/entity_manager/utils.cpp
+++ b/src/entity_manager/utils.cpp
@@ -6,7 +6,6 @@
 #include "phosphor-logging/lg2.hpp"
 
 #include <boost/algorithm/string/case_conv.hpp>
-#include <boost/algorithm/string/replace.hpp>
 #include <phosphor-logging/lg2.hpp>
 #include <sdbusplus/bus/match.hpp>
 
@@ -170,11 +169,11 @@
         return ret;
     }
 
-    boost::replace_all(*strPtr, std::string(templateChar) + "index",
-                       std::to_string(index));
+    replaceAll(*strPtr, std::string(templateChar) + "index",
+               std::to_string(index));
     if (replaceStr)
     {
-        boost::replace_all(*strPtr, *replaceStr, std::to_string(index));
+        replaceAll(*strPtr, *replaceStr, std::to_string(index));
     }
 
     for (const auto& [propName, propValue] : interface)
@@ -205,7 +204,7 @@
                       strPtr->at(nextItemIdx)) == mathChars.end())
         {
             std::string val = std::visit(VariantToStringVisitor(), propValue);
-            boost::ireplace_all(*strPtr, templateName, val);
+            iReplaceAll(*strPtr, templateName, val);
             continue;
         }