13 std::vector<TclObject> outArgs;
14 outArgs.reserve(inArgs.
size());
16 while (!inArgs.
empty()) {
17 auto arg = inArgs.
front();
18 auto argStr = arg.getString();
26 if (it ==
table.end()) {
28 "Invalid option: '", argStr,
"'. Must be one of ",
30 return strCat(
'\'', info.name,
'\'');
33 auto consumed = it->func(interp, inArgs);
34 inArgs = inArgs.
subspan(consumed);
36 outArgs.push_back(arg);
constexpr subspan_return_t< Offset, Count > subspan() const
constexpr reference front() const
constexpr index_type size() const noexcept
constexpr bool empty() const noexcept
detail::Joiner< Collection, Separator > join(Collection &&col, Separator &&sep)
bool startsWith(string_view total, string_view part)
This file implemented 3 utility functions:
std::vector< TclObject > parseTclArgs(Interpreter &interp, span< const TclObject > inArgs, span< const ArgsInfo > table)
auto find_if(InputRange &&range, UnaryPredicate pred)
constexpr auto transform(Range &&range, UnaryOp op)
std::string strCat(Ts &&...ts)