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});
79 #endif // BITCOIN_UTIL_SPANPARSING_H
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.
bool Func(const std::string &str, Span< const char > &sp)
Parse a function call.
constexpr C * end() const noexcept
bool Const(const std::string &str, Span< const char > &sp)
Parse a constant.
Span< const char > Expr(Span< const char > &sp)
Extract the expression that sp begins with.
constexpr C * begin() const noexcept
A Span is an object that can refer to a contiguous sequence of objects.