blob: 39e1c823512536d5b90f14cba030e216060b7c0c [file] [log] [blame]
Ed Tanous50ebd4a2023-01-19 19:03:17 -08001#pragma once
2
3#include <string>
4#include <string_view>
5#include <vector>
6
7namespace bmcweb
8{
9// This is a naive replacement for boost::split until
10// https://github.com/llvm/llvm-project/issues/40486
11// is resolved
12inline void split(std::vector<std::string>& strings, std::string_view str,
13 char delim)
14{
15 size_t start = 0;
16 size_t end = 0;
17 while ((start = str.find_first_not_of(delim, end)) != std::string::npos)
18 {
19 end = str.find(delim, start);
20 strings.emplace_back(str.substr(start, end - start));
21 }
22}
23} // namespace bmcweb