Remove usages of boost::starts/ends_with
Per the coding standard, now that C++ supports std::string::starts_with
and std::string::ends_with, we should be using them over the boost
alternatives. This commit goes through and updates all usages.
Arguably some of these are incorrect, and instances of common error 13,
but because this is mostly a mechanical it intentionally doesn't try to
handle it.
Tested: Unit tests pass.
Signed-off-by: Ed Tanous <edtanous@google.com>
Change-Id: Ic4c6e5d0da90f7442693199dc691a47d2240fa4f
diff --git a/redfish-core/lib/memory.hpp b/redfish-core/lib/memory.hpp
index c4a2ef4..3c10130 100644
--- a/redfish-core/lib/memory.hpp
+++ b/redfish-core/lib/memory.hpp
@@ -18,7 +18,6 @@
#include "health.hpp"
#include <app.hpp>
-#include <boost/algorithm/string.hpp>
#include <dbus_utility.hpp>
#include <nlohmann/json.hpp>
#include <query.hpp>
@@ -383,7 +382,7 @@
for (const char* v : values)
{
- if (boost::ends_with(*value, v))
+ if (value->ends_with(v))
{
aResp->res.jsonValue[jsonPtr]["OperatingMemoryModes"].push_back(
v);
@@ -405,7 +404,7 @@
for (const char* v : values)
{
- if (boost::ends_with(*value, v))
+ if (value->ends_with(v))
{
aResp->res.jsonValue[jsonPtr]["MemoryMedia"].push_back(v);
break;
@@ -554,7 +553,7 @@
for (const char* v : values)
{
- if (boost::ends_with(*value, v))
+ if (value->ends_with(v))
{
aResp->res.jsonValue[jsonPtr]["ErrorCorrection"] = v;
break;
@@ -578,7 +577,7 @@
for (const char* v : values)
{
- if (boost::ends_with(*value, v))
+ if (value->ends_with(v))
{
aResp->res.jsonValue[jsonPtr]["BaseModuleType"] = v;
break;
@@ -642,7 +641,7 @@
{
aResp->res.jsonValue[jsonPtr]["MemoryType"] = "DRAM";
}
- else if (boost::ends_with(*value, "Logical"))
+ else if (value->ends_with("Logical"))
{
aResp->res.jsonValue[jsonPtr]["MemoryType"] = "IntelOptane";
}