MCPcopy Create free account
hub / github.com/docopt/docopt.cpp / single_match

Method single_match

docopt_private.h:487–502  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

485 }
486
487 inline std::pair<size_t, std::shared_ptr<LeafPattern>> Argument::single_match(PatternList const& left) const
488 {
489 std::pair<size_t, std::shared_ptr<LeafPattern>> ret {};
490
491 for(size_t i = 0, size = left.size(); i < size; ++i)
492 {
493 auto arg = dynamic_cast<Argument const*>(left[i].get());
494 if (arg) {
495 ret.first = i;
496 ret.second = std::make_shared<Argument>(name(), arg->getValue());
497 break;
498 }
499 }
500
501 return ret;
502 }
503
504 inline std::pair<size_t, std::shared_ptr<LeafPattern>> Command::single_match(PatternList const& left) const
505 {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected