Remove some boost includes

The less we rely on boost, and more on std algorithms, the less people
have to look up, and the more likely that our code will deduplicate.

Replace all uses of boost::algorithms with std alternatives.

Tested: Redfish Service Validator passes.

Change-Id: I8a26f39b5709adc444b4178e92f5f3c7b988b05b
Signed-off-by: Ed Tanous <edtanous@google.com>
diff --git a/include/http_utility.hpp b/include/http_utility.hpp
index ae436ca..74ab15a 100644
--- a/include/http_utility.hpp
+++ b/include/http_utility.hpp
@@ -1,10 +1,6 @@
 #pragma once
 
-#include <boost/algorithm/string/classification.hpp>
-#include <boost/algorithm/string/constants.hpp>
-#include <boost/iterator/iterator_facade.hpp>
-#include <boost/type_index/type_index_facade.hpp>
-
+#include <algorithm>
 #include <cctype>
 #include <iomanip>
 #include <ostream>
diff --git a/include/ibm/locks.hpp b/include/ibm/locks.hpp
index 7a161fc..3bb82b9 100644
--- a/include/ibm/locks.hpp
+++ b/include/ibm/locks.hpp
@@ -3,7 +3,6 @@
 #include "ibm/utils.hpp"
 #include "logging.hpp"
 
-#include <boost/algorithm/string/predicate.hpp>
 #include <boost/container/flat_map.hpp>
 #include <boost/endian/conversion.hpp>
 #include <nlohmann/json.hpp>
@@ -363,8 +362,8 @@
 {
     // validate the locktype
 
-    if (!((boost::equals(std::get<2>(refLockRecord), "Read") ||
-           (boost::equals(std::get<2>(refLockRecord), "Write")))))
+    if (!((std::get<2>(refLockRecord) == "Read" ||
+           (std::get<2>(refLockRecord) == "Write"))))
     {
         BMCWEB_LOG_DEBUG("Validation of LockType Failed");
         BMCWEB_LOG_DEBUG("Locktype : {}", std::get<2>(refLockRecord));
@@ -392,9 +391,8 @@
         // validate the lock flags
         // Allowed lockflags are locksame,lockall & dontlock
 
-        if (!((boost::equals(p.first, "LockSame") ||
-               (boost::equals(p.first, "LockAll")) ||
-               (boost::equals(p.first, "DontLock")))))
+        if (!((p.first == "LockSame" || (p.first == "LockAll") ||
+               (p.first == "DontLock"))))
         {
             BMCWEB_LOG_DEBUG("Validation of lock flags failed");
             BMCWEB_LOG_DEBUG("{}", p.first);
@@ -411,8 +409,7 @@
             return false;
         }
 
-        if ((boost::equals(p.first, "LockSame") ||
-             (boost::equals(p.first, "LockAll"))))
+        if ((p.first == "LockSame" || (p.first == "LockAll")))
         {
             ++lockFlag;
             if (lockFlag >= 2)
@@ -534,8 +531,8 @@
 {
     // No conflict if both are read locks
 
-    if (boost::equals(std::get<2>(refLockRecord1), "Read") &&
-        boost::equals(std::get<2>(refLockRecord2), "Read"))
+    if (std::get<2>(refLockRecord1) == "Read" &&
+        std::get<2>(refLockRecord2) == "Read")
     {
         BMCWEB_LOG_DEBUG("Both are read locks, no conflict");
         return false;
@@ -546,8 +543,8 @@
     {
         // return conflict when any of them is try to lock all resources
         // under the current resource level.
-        if (boost::equals(p.first, "LockAll") ||
-            boost::equals(std::get<4>(refLockRecord2)[i].first, "LockAll"))
+        if (p.first == "LockAll" ||
+            std::get<4>(refLockRecord2)[i].first == "LockAll")
         {
             BMCWEB_LOG_DEBUG(
                 "Either of the Comparing locks are trying to lock all "
@@ -558,8 +555,8 @@
         // determine if there is a lock-all-with-same-segment-size.
         // If the current segment sizes are the same,then we should fail.
 
-        if ((boost::equals(p.first, "LockSame") ||
-             boost::equals(std::get<4>(refLockRecord2)[i].first, "LockSame")) &&
+        if ((p.first == "LockSame" ||
+             std::get<4>(refLockRecord2)[i].first == "LockSame") &&
             (p.second == std::get<4>(refLockRecord2)[i].second))
         {
             return true;
diff --git a/include/ibm/management_console_rest.hpp b/include/ibm/management_console_rest.hpp
index fd1e2a5..103017b 100644
--- a/include/ibm/management_console_rest.hpp
+++ b/include/ibm/management_console_rest.hpp
@@ -6,9 +6,9 @@
 #include "event_service_manager.hpp"
 #include "ibm/locks.hpp"
 #include "resource_messages.hpp"
+#include "str_utility.hpp"
 #include "utils/json_utils.hpp"
 
-#include <boost/algorithm/string/predicate.hpp>
 #include <boost/container/flat_set.hpp>
 #include <nlohmann/json.hpp>
 #include <sdbusplus/message/types.hpp>
@@ -49,7 +49,7 @@
     std::error_code ec;
     // Check the content-type of the request
     boost::beast::string_view contentType = req.getHeaderValue("content-type");
-    if (!boost::iequals(contentType, "application/octet-stream"))
+    if (!bmcweb::asciiIEquals(contentType, "application/octet-stream"))
     {
         asyncResp->res.result(boost::beast::http::status::not_acceptable);
         asyncResp->res.jsonValue["Description"] = contentNotAcceptableMsg;
diff --git a/include/openbmc_dbus_rest.hpp b/include/openbmc_dbus_rest.hpp
index 6bd3920..e801a32 100644
--- a/include/openbmc_dbus_rest.hpp
+++ b/include/openbmc_dbus_rest.hpp
@@ -28,8 +28,6 @@
 #include <systemd/sd-bus.h>
 #include <tinyxml2.h>
 
-#include <boost/algorithm/string/classification.hpp>
-#include <boost/algorithm/string/predicate.hpp>
 #include <boost/beast/http/status.hpp>
 #include <boost/beast/http/verb.hpp>
 #include <boost/container/flat_map.hpp>
@@ -429,7 +427,10 @@
 
         // Map indicating connection name, and the path where the object
         // manager exists
-        boost::container::flat_map<std::string, std::string> connections;
+        boost::container::flat_map<
+            std::string, std::string, std::less<>,
+            std::vector<std::pair<std::string, std::string>>>
+            connections;
 
         for (const auto& object : *(transaction->subtree))
         {
@@ -711,7 +712,14 @@
             }
             else if (stringValue != nullptr)
             {
-                boolInt = boost::istarts_with(*stringValue, "t") ? 1 : 0;
+                if (!stringValue->empty())
+                {
+                    if (stringValue->front() == 't' ||
+                        stringValue->front() == 'T')
+                    {
+                        boolInt = 1;
+                    }
+                }
             }
             else
             {
diff --git a/include/str_utility.hpp b/include/str_utility.hpp
index 7142583..8ac54b9 100644
--- a/include/str_utility.hpp
+++ b/include/str_utility.hpp
@@ -1,5 +1,7 @@
 #pragma once
 
+#include <algorithm>
+#include <ranges>
 #include <string>
 #include <string_view>
 #include <vector>
@@ -21,4 +23,22 @@
         start = end + 1;
     }
 }
+
+inline char asciiToLower(char c)
+{
+    // Converts a character to lower case without relying on std::locale
+    if ('A' <= c && c <= 'Z')
+    {
+        c -= ('A' - 'a');
+    }
+    return c;
+}
+
+inline bool asciiIEquals(std::string_view left, std::string_view right)
+{
+    return std::ranges::equal(left, right, [](char lChar, char rChar) {
+        return asciiToLower(lChar) == asciiToLower(rChar);
+    });
+}
+
 } // namespace bmcweb
diff --git a/include/webassets.hpp b/include/webassets.hpp
index 5ab0323..c5c7228 100644
--- a/include/webassets.hpp
+++ b/include/webassets.hpp
@@ -6,7 +6,6 @@
 #include "routing.hpp"
 #include "webroutes.hpp"
 
-#include <boost/algorithm/string/replace.hpp>
 #include <boost/container/flat_set.hpp>
 
 #include <filesystem>