mirror of
https://github.com/Kitware/CMake.git
synced 2026-01-09 15:20:56 -06:00
cmArgumentParser: Remove unnecessary local names for common types
This commit is contained in:
@@ -44,14 +44,14 @@ void Instance::Bind(std::string& val)
|
||||
this->ExpectValue = true;
|
||||
}
|
||||
|
||||
void Instance::Bind(StringList& val)
|
||||
void Instance::Bind(std::vector<std::string>& val)
|
||||
{
|
||||
this->CurrentString = nullptr;
|
||||
this->CurrentList = &val;
|
||||
this->ExpectValue = true;
|
||||
}
|
||||
|
||||
void Instance::Bind(MultiStringList& val)
|
||||
void Instance::Bind(std::vector<std::vector<std::string>>& val)
|
||||
{
|
||||
this->CurrentString = nullptr;
|
||||
this->CurrentList = (static_cast<void>(val.emplace_back()), &val.back());
|
||||
|
||||
@@ -15,9 +15,6 @@
|
||||
|
||||
namespace ArgumentParser {
|
||||
|
||||
using StringList = std::vector<std::string>;
|
||||
using MultiStringList = std::vector<StringList>;
|
||||
|
||||
class Instance;
|
||||
using Action = std::function<void(Instance&, void*)>;
|
||||
|
||||
@@ -39,8 +36,8 @@ public:
|
||||
|
||||
void Bind(bool& val);
|
||||
void Bind(std::string& val);
|
||||
void Bind(StringList& val);
|
||||
void Bind(MultiStringList& val);
|
||||
void Bind(std::vector<std::string>& val);
|
||||
void Bind(std::vector<std::vector<std::string>>& val);
|
||||
|
||||
void Consume(cm::string_view arg, void* result,
|
||||
std::vector<std::string>* unparsedArguments,
|
||||
@@ -50,7 +47,7 @@ public:
|
||||
private:
|
||||
ActionMap const& Bindings;
|
||||
std::string* CurrentString = nullptr;
|
||||
StringList* CurrentList = nullptr;
|
||||
std::vector<std::string>* CurrentList = nullptr;
|
||||
bool ExpectValue = false;
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user