5 #ifndef BITCOIN_UTIL_SPANPARSING_H
6 #define BITCOIN_UTIL_SPANPARSING_H
11 #include <string_view>
47 template <
typename T = Span<const
char>>
53 while (it != sp.
end()) {
54 if (separators.find(*it) != std::string::npos) {
55 ret.emplace_back(start, it);
60 ret.emplace_back(start, it);
71 template <
typename T = Span<const
char>>
74 return Split<T>(sp, std::string_view{&sep, 1});
A Span is an object that can refer to a contiguous sequence of objects.
constexpr C * end() const noexcept
constexpr C * begin() const noexcept
Span< const char > Expr(Span< const char > &sp)
Extract the expression that sp begins with.
bool Const(const std::string &str, Span< const char > &sp)
Parse a constant.
bool Func(const std::string &str, Span< const char > &sp)
Parse a function call.
std::vector< T > Split(const Span< const char > &sp, std::string_view separators)
Split a string on any char found in separators, returning a vector.