diff options
author | Ed Tanous <edtanous@google.com> | 2023-07-18 20:07:23 +0300 |
---|---|---|
committer | Ed Tanous <ed@tanous.net> | 2024-01-19 22:43:50 +0300 |
commit | 18f8f608b966c802b3e2a389e3c1ec5a1fd9407b (patch) | |
tree | 89684cb74b7492ffc1e34fb8e3a004de18726071 /redfish-core/include/redfish_aggregator.hpp | |
parent | f86bcc875a496b3c321a4ed102579a4031617800 (diff) | |
download | bmcweb-18f8f608b966c802b3e2a389e3c1ec5a1fd9407b.tar.xz |
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>
Diffstat (limited to 'redfish-core/include/redfish_aggregator.hpp')
-rw-r--r-- | redfish-core/include/redfish_aggregator.hpp | 23 |
1 files changed, 10 insertions, 13 deletions
diff --git a/redfish-core/include/redfish_aggregator.hpp b/redfish-core/include/redfish_aggregator.hpp index 4ce25fdcf3..f255b9f0a6 100644 --- a/redfish-core/include/redfish_aggregator.hpp +++ b/redfish-core/include/redfish_aggregator.hpp @@ -5,8 +5,7 @@ #include "error_messages.hpp" #include "http_client.hpp" #include "http_connection.hpp" - -#include <boost/algorithm/string/predicate.hpp> +#include "parsing.hpp" #include <array> #include <ranges> @@ -154,8 +153,12 @@ inline bool searchCollectionsArray(std::string_view uri, // defined in the above array. inline bool isPropertyUri(std::string_view propertyName) { - return boost::iends_with(propertyName, "uri") || - std::binary_search(nonUriProperties.begin(), nonUriProperties.end(), + if (propertyName.ends_with("uri") || propertyName.ends_with("Uri") || + propertyName.ends_with("URI")) + { + return true; + } + return std::binary_search(nonUriProperties.begin(), nonUriProperties.end(), propertyName); } @@ -870,9 +873,7 @@ class RedfishAggregator // We want to attempt prefix fixing regardless of response code // The resp will not have a json component // We need to create a json from resp's stringResponse - std::string_view contentType = resp.getHeaderValue("Content-Type"); - if (boost::iequals(contentType, "application/json") || - boost::iequals(contentType, "application/json; charset=utf-8")) + if (isJsonContentType(resp.getHeaderValue("Content-Type"))) { nlohmann::json jsonVal = nlohmann::json::parse(*resp.body(), nullptr, false); @@ -934,9 +935,7 @@ class RedfishAggregator // The resp will not have a json component // We need to create a json from resp's stringResponse - std::string_view contentType = resp.getHeaderValue("Content-Type"); - if (boost::iequals(contentType, "application/json") || - boost::iequals(contentType, "application/json; charset=utf-8")) + if (isJsonContentType(resp.getHeaderValue("Content-Type"))) { nlohmann::json jsonVal = nlohmann::json::parse(*resp.body(), nullptr, false); @@ -1068,9 +1067,7 @@ class RedfishAggregator // The resp will not have a json component // We need to create a json from resp's stringResponse - std::string_view contentType = resp.getHeaderValue("Content-Type"); - if (boost::iequals(contentType, "application/json") || - boost::iequals(contentType, "application/json; charset=utf-8")) + if (isJsonContentType(resp.getHeaderValue("Content-Type"))) { bool addedLinks = false; nlohmann::json jsonVal = nlohmann::json::parse(*resp.body(), |