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/certificate_service.hpp b/redfish-core/lib/certificate_service.hpp
index a4ecbf0..c2c873d 100644
--- a/redfish-core/lib/certificate_service.hpp
+++ b/redfish-core/lib/certificate_service.hpp
@@ -318,15 +318,14 @@
std::string objectPath;
std::string service;
- if (boost::starts_with(
- certURI,
+ if (certURI.starts_with(
"/redfish/v1/Managers/bmc/NetworkProtocol/HTTPS/Certificates"))
{
objectPath = certs::httpsObjectPath;
service = certs::httpsServiceName;
}
- else if (boost::starts_with(
- certURI, "/redfish/v1/AccountService/LDAP/Certificates"))
+ else if (certURI.starts_with(
+ "/redfish/v1/AccountService/LDAP/Certificates"))
{
objectPath = certs::ldapObjectPath;
service = certs::ldapServiceName;
@@ -358,8 +357,7 @@
}
// validate KeyUsage supporting only 1 type based on URL
- if (boost::starts_with(
- certURI,
+ if (certURI.starts_with(
"/redfish/v1/Managers/bmc/NetworkProtocol/HTTPS/Certificates"))
{
if (optKeyUsage->empty())
@@ -382,8 +380,8 @@
return;
}
}
- else if (boost::starts_with(
- certURI, "/redfish/v1/AccountService/LDAP/Certificates"))
+ else if (certURI.starts_with(
+ "/redfish/v1/AccountService/LDAP/Certificates"))
{
if (optKeyUsage->empty())
{
@@ -799,8 +797,7 @@
std::string objectPath;
std::string name;
std::string service;
- if (boost::starts_with(
- certURI,
+ if (certURI.starts_with(
"/redfish/v1/Managers/bmc/NetworkProtocol/HTTPS/Certificates/"))
{
objectPath =
@@ -808,16 +805,15 @@
name = "HTTPS certificate";
service = certs::httpsServiceName;
}
- else if (boost::starts_with(
- certURI, "/redfish/v1/AccountService/LDAP/Certificates/"))
+ else if (certURI.starts_with(
+ "/redfish/v1/AccountService/LDAP/Certificates/"))
{
objectPath =
std::string(certs::ldapObjectPath) + "/" + std::to_string(id);
name = "LDAP certificate";
service = certs::ldapServiceName;
}
- else if (boost::starts_with(
- certURI,
+ else if (certURI.starts_with(
"/redfish/v1/Managers/bmc/Truststore/Certificates/"))
{
objectPath = std::string(certs::authorityObjectPath) + "/" +