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

Method checked_parse_arg

Source/Utils/cxxopts.hpp:2180–2214  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2178}
2179
2180inline
2181void
2182OptionParser::checked_parse_arg
2183(
2184 int argc,
2185 const char* const* argv,
2186 int& current,
2187 const std::shared_ptr<OptionDetails>& value,
2188 const std::string& name
2189)
2190{
2191 if (current + 1 >= argc)
2192 {
2193 if (value->value().has_implicit())
2194 {
2195 parse_option(value, name, value->value().get_implicit_value());
2196 }
2197 else
2198 {
2199 throw_or_mimic<missing_argument_exception>(name);
2200 }
2201 }
2202 else
2203 {
2204 if (value->value().has_implicit())
2205 {
2206 parse_option(value, name, value->value().get_implicit_value());
2207 }
2208 else
2209 {
2210 parse_option(value, name, argv[current + 1]);
2211 ++current;
2212 }
2213 }
2214}
2215
2216inline
2217void

Callers

nothing calls this directly

Calls 3

has_implicitMethod · 0.80
get_implicit_valueMethod · 0.80
valueMethod · 0.45

Tested by

no test coverage detected