Implement alternative to on boost::split
boost::split has a documented false-positive in clang-tidy. While
normally we'd handle this with NOLINTNEXTLINE, this doesn't appear to
work in all cases. Unclear why, but seems to be due to some of our
lambda callback complexity.
Each of these uses is a case where we should be using a more specific
check, rather than split, but for the moment, this is the best we have.
Tested: clang-tidy passes.
[1] https://github.com/llvm/llvm-project/issues/40486
Signed-off-by: Ed Tanous <edtanous@google.com>
Change-Id: I144c6610cb740287b7225e2be03b4142a64f9563
diff --git a/redfish-core/lib/log_services.hpp b/redfish-core/lib/log_services.hpp
index ef1652b..89c38b0 100644
--- a/redfish-core/lib/log_services.hpp
+++ b/redfish-core/lib/log_services.hpp
@@ -98,7 +98,7 @@
// the right Message
std::vector<std::string> fields;
fields.reserve(4);
- boost::split(fields, messageID, boost::is_any_of("."));
+ bmcweb::split(fields, messageID, '.');
const std::string& registryName = fields[0];
const std::string& messageKey = fields[3];
@@ -1238,8 +1238,7 @@
entry.remove_prefix(entryStart);
// Use split to separate the entry into its fields
std::vector<std::string> logEntryFields;
- boost::split(logEntryFields, entry, boost::is_any_of(","),
- boost::token_compress_on);
+ bmcweb::split(logEntryFields, entry, ',');
// We need at least a MessageId to be valid
if (logEntryFields.empty())
{
@@ -3616,7 +3615,7 @@
uint64_t& currentValue, uint16_t& index)
{
std::vector<std::string> split;
- boost::algorithm::split(split, postCodeID, boost::is_any_of("-"));
+ bmcweb::split(split, postCodeID, '-');
if (split.size() != 2 || split[0].length() < 2 || split[0].front() != 'B')
{
return false;