Lines Matching refs:a

15 The `CmdlineParser` class provides a fluent interface using a domain-specific language to quickly
16 generate a type-safe value parser that process a user-provided list of strings (`argv`). Currently,
17 it can parse a string into a `VariantMap`, although in the future it might be desirable to parse
20 To use, create a `CmdlineParser::Builder` and then chain the `Define` methods together with
24 For example, to save the values into a user-defined variant map:
33 // See variant_map_test.cc for how to completely define a custom map.
69 In the above code sample, we define a parser which is capable of parsing something like `--help
80 The simplest kind of argument just tests for presence, but we often want to parse out a particular
81 type of value (such as an int or double as in the above `FruitVariantMap` example). To do that, a
93 Everything that follows a `WithType<T>()` call is thus type checked to only take `T` values.
95 If this call is omitted, the parser generator assumes you are building a `Unit` type (i.e. an
99 Some values will not make sense outside of a `[min, max]` range, so this is an option to quickly add
100 a range check without writing custom code. The range check is performed after the main parsing
104 When parsing an enumeration, it might be very convenient to map a list of possible argument string
116 This is meant to be another shorthand (like `WithRange`) to avoid writing a custom type parser. In
117 general it takes a variadic number of `pair<const char* /*arg name*/, T /*value*/>`.
132 (Note that this method will not work when the argument definitions have a wildcard because there is
157 This specifies that when a value is parsed, it will get saved into a variant map using the specific
165 will save occurrences of the `-help` argument by doing a `Map.Set(Map::Help, ParsedValue("-help"))`
166 where `ParsedValue` is an imaginary function that parses the `-help` argment into a specific type
172 `Ignore` function which takes a list of argument definition names.
174 It's semantically equivalent to making a series of argument definitions that map to `Unit` but don't
176 with invalid values, only user-arguments for which it could not find a matching argument definition.
179 Any type can be parsed from a string by specializing the `CmdlineType` class and implementing the
213 Will parse any non-append argument definitions with a type of `double`.
230 #### What is a `Result`?
231 `Result` is a typedef for `CmdlineParseResult<T>` and it acts similar to a poor version of
238 When successfully parsing a single value, `Result::Success(value)` should be used, and when
242 When many arguments are parsed, the result is collapsed down to a `CmdlineResult` which acts as a
244 successfully stored, the parser will automatically save it into the target destination as a side