Commit Graph

10 Commits

Author SHA1 Message Date
Brad King
84b335c286 cmArgumentParser: Track pending keyword explicitly
Avoid allocating missing keyword vector unnecessarily.
2022-07-20 16:03:13 -04:00
Brad King
197ef69aa1 cmArgumentParser: Simplify internal method signatures
Record `Parse` parameters during construction of the internal instance
instead of passing them to every method.
2022-07-20 16:03:12 -04:00
Brad King
f46b2e9142 cmArgumentParser: Model maybe-missing string with wrapper type
Bindings to `std::string` require one value.  Some clients have been
filtering `keywordsMissingValue` to support keywords that tolerate a
missing value.  Offer them a type-safe way to achieve this instead.
2022-07-07 09:49:04 -04:00
Brad King
e6d1e29ffa cmArgumentParser: Model maybe-empty and non-empty lists with wrapper types
Previously bindings to `std::vector<std::string>` required at least one
value.  Some clients have been filtering `keywordsMissingValue` to
support keywords followed by empty lists.  Instead, require clients to
specify whether a keyword's list can be empty as part of the binding
type.
2022-07-07 09:48:58 -04:00
Brad King
f3dbf4b89d cmArgumentParser: Remove unnecessary local names for common types 2022-07-05 16:35:01 -04:00
Brad King
1ee5a4a548 cmArgumentParser: Avoid allocating copies of keyword strings 2022-07-05 16:34:57 -04:00
Ben Boeckel
1bf8938825 IWYU: add a mapping for other __decay_and_strip instances 2020-04-29 11:16:44 -04:00
Regina Pfeifer
d5a6a13368 cmArgumentParser: Record parsed keywords 2019-09-20 13:27:30 +02:00
Brad King
aeddf63587 cmArgumentParser: Fix -Wcomma warning
Clang `-Wcomma` warns:

```
Source/cmArgumentParser.cxx:58:42: warning: possible misuse of comma operator
  this->CurrentList = (val.emplace_back(), &val.back());
                                         ^
```

This was introduced by commit 4359fe133b (Introduce cmArgumentParser,
2019-03-23).  Suppress it with the suggested cast.
2019-04-11 10:44:38 -04:00
Regina Pfeifer
4359fe133b Introduce cmArgumentParser 2019-04-04 13:24:39 -04:00