Replace boost string predicate functions with stdlib ones
Now that we're on C++20 we no longer need boost for starts_with() and
ends_with() tests.
Also remove the predicate.hpp #include from files that weren't actually
using anything from it.
Signed-off-by: Zev Weiss <zev@bewilderbeest.net>
Change-Id: Id68a019d5108a4646eb9b5fd18af33d60617e048
diff --git a/src/Utils.cpp b/src/Utils.cpp
index e247edd..7dc40c4 100644
--- a/src/Utils.cpp
+++ b/src/Utils.cpp
@@ -17,7 +17,6 @@
#include "dbus-sensor_config.h"
#include <Utils.hpp>
-#include <boost/algorithm/string/predicate.hpp>
#include <boost/container/flat_map.hpp>
#include <sdbusplus/asio/connection.hpp>
#include <sdbusplus/asio/object_server.hpp>
@@ -178,7 +177,7 @@
bool correctType = false;
for (const auto& [intf, cfg] : pathPair.second)
{
- if (boost::starts_with(intf, type))
+ if (intf.starts_with(type))
{
correctType = true;
break;
@@ -354,8 +353,7 @@
std::cerr << "error getting power status " << ec.message() << "\n";
return;
}
- powerStatusOn =
- boost::ends_with(std::get<std::string>(state), ".Running");
+ powerStatusOn = std::get<std::string>(state).ends_with(".Running");
},
power::busname, power::path, properties::interface, properties::get,
power::interface, power::property);
@@ -420,8 +418,8 @@
auto findState = values.find(power::property);
if (findState != values.end())
{
- bool on = boost::ends_with(std::get<std::string>(findState->second),
- ".Running");
+ bool on =
+ std::get<std::string>(findState->second).ends_with(".Running");
if (!on)
{
timer.cancel();