MCPcopy Create free account
hub / github.com/OpenFodder/openfodder / consume_positional

Method consume_positional

Source/Utils/cxxopts.hpp:2223–2251  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2221}
2222
2223inline
2224bool
2225OptionParser::consume_positional(const std::string& a, PositionalListIterator& next)
2226{
2227 while (next != m_positional.end())
2228 {
2229 auto iter = m_options.find(*next);
2230 if (iter != m_options.end())
2231 {
2232 if (!iter->second->value().is_container())
2233 {
2234 auto& result = m_parsed[iter->second->hash()];
2235 if (result.count() == 0)
2236 {
2237 add_to_option(iter, *next, a);
2238 ++next;
2239 return true;
2240 }
2241 ++next;
2242 continue;
2243 }
2244 add_to_option(iter, *next, a);
2245 return true;
2246 }
2247 throw_or_mimic<option_not_exists_exception>(*next);
2248 }
2249
2250 return false;
2251}
2252
2253inline
2254void

Callers

nothing calls this directly

Calls 6

findMethod · 0.80
is_containerMethod · 0.80
hashMethod · 0.80
endMethod · 0.45
valueMethod · 0.45
countMethod · 0.45

Tested by

no test coverage detected