replace boost::ifind_first with std::ranges::search
Use a custom case-insensitive search to remove Boost dependency and
reduce compilation memory usage, keeping original string replacement
behavior.
Change-Id: I5778b208dfdb0082515e92f7bda335beb94c21cb
Signed-off-by: George Liu <liuxiwei@ieisystem.com>
diff --git a/src/utils.hpp b/src/utils.hpp
index 3a3a083..e51ed1e 100644
--- a/src/utils.hpp
+++ b/src/utils.hpp
@@ -18,6 +18,8 @@
 using DBusObject = boost::container::flat_map<std::string, DBusInterface>;
 using MapperGetSubTreeResponse =
     boost::container::flat_map<std::string, DBusObject>;
+using FirstIndex = size_t;
+using LastIndex = size_t;
 
 bool findFiles(const std::filesystem::path& dirPath,
                const std::string& matchString,
@@ -75,6 +77,9 @@
 /// \return true if the dbusValue matched the probe otherwise false.
 bool matchProbe(const nlohmann::json& probe, const DBusValueVariant& dbusValue);
 
+std::pair<FirstIndex, LastIndex> iFindFirst(std::string_view str,
+                                            std::string_view sub);
+
 template <typename T>
 std::from_chars_result fromCharsWrapper(const std::string_view& str, T& out,
                                         bool& fullMatch, int base = 10)