5#ifndef BITCOIN_UTIL_SPANPARSING_H
6#define BITCOIN_UTIL_SPANPARSING_H
51template <
typename T = Span<const
char>>
56 while (it !=
sp.end()) {
58 ret.emplace_back(start, it);
63 ret.emplace_back(start, it);
A Span is an object that can refer to a contiguous sequence of objects.
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.
std::vector< T > Split(const Span< const char > &sp, char sep)
Split a string on every instance of sep, returning a vector.
bool Func(const std::string &str, Span< const char > &sp)
Parse a function call.
T GetRand(T nMax=std::numeric_limits< T >::max()) noexcept
Generate a uniform random integer of type T in the range [0..nMax) nMax defaults to std::numeric_limi...