treewide: prefer std::starts_with to boost
Replace boost versions of starts_with and ends_with with the std
versions provided with c++20.
Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
Change-Id: I97218c607ff04aedad490b3af428071b0fa75615
diff --git a/src/processing.cpp b/src/processing.cpp
index 561cbde..5a733d4 100644
--- a/src/processing.cpp
+++ b/src/processing.cpp
@@ -1,15 +1,14 @@
#include "processing.hpp"
-#include <boost/algorithm/string/predicate.hpp>
-
#include <iostream>
+#include <string>
bool getWellKnown(
const boost::container::flat_map<std::string, std::string>& owners,
const std::string& request, std::string& wellKnown)
{
// If it's already a well known name, just return
- if (!boost::starts_with(request, ":"))
+ if (!request.starts_with(":"))
{
wellKnown = request;
return true;
@@ -27,11 +26,10 @@
bool needToIntrospect(const std::string& processName,
const AllowDenyList& allowList)
{
- auto inAllowList =
- std::find_if(allowList.begin(), allowList.end(),
- [&processName](const auto& prefix) {
- return boost::starts_with(processName, prefix);
- }) != allowList.end();
+ auto inAllowList = std::find_if(allowList.begin(), allowList.end(),
+ [&processName](const auto& prefix) {
+ return processName.starts_with(prefix);
+ }) != allowList.end();
return inAllowList;
}
@@ -42,7 +40,7 @@
InterfaceMapType& interfaceMap, AssociationMaps& assocMaps,
sdbusplus::asio::object_server& server)
{
- if (boost::starts_with(oldOwner, ":"))
+ if (oldOwner.starts_with(":"))
{
auto it = nameOwners.find(oldOwner);
if (it != nameOwners.end())