MCPcopy Create free account
hub / github.com/PDAL/PDAL / validate

Method validate

pdal/util/ProgramArgs.hpp:1664–1676  ·  view source on GitHub ↗

Make sure we don't have any required positional args after non-required positional args. */

Source from the content-addressed store, hash-verified

1662 non-required positional args.
1663 */
1664 void validate()
1665 {
1666 bool opt = false;
1667 for (auto ai = m_args.begin(); ai != m_args.end(); ++ai)
1668 {
1669 Arg *arg = ai->get();
1670 if (arg->positional() == Arg::PosType::Optional)
1671 opt = true;
1672 if (opt && (arg->positional() == Arg::PosType::Required))
1673 throw arg_error("Found required positional argument '" +
1674 arg->longname() + "' after optional positional argument.");
1675 }
1676 }
1677
1678 std::vector<std::unique_ptr<Arg>> m_args; /// Storage for arguments
1679 std::map<std::string, Arg *> m_shortargs; /// Map from shortname to args

Callers

nothing calls this directly

Calls 5

positionalMethod · 0.80
longnameMethod · 0.80
beginMethod · 0.45
endMethod · 0.45
getMethod · 0.45

Tested by

no test coverage detected