VS: Add method to take a value out of the option parser flag map

Remove a flag from the map and return its value.
This commit is contained in:
Brad King 2017-03-07 15:16:17 -05:00
parent f7bb40c92d
commit 80e982d7ad
2 changed files with 14 additions and 0 deletions

View File

@ -274,6 +274,18 @@ void cmVisualStudioGeneratorOptions::StoreUnknownFlag(const char* flag)
this->AppendFlagString(this->UnknownFlagField, opts);
}
cmIDEOptions::FlagValue cmVisualStudioGeneratorOptions::TakeFlag(
std::string const& key)
{
FlagValue value;
std::map<std::string, FlagValue>::iterator i = this->FlagMap.find(key);
if (i != this->FlagMap.end()) {
value = i->second;
this->FlagMap.erase(i);
}
return value;
}
void cmVisualStudioGeneratorOptions::SetConfiguration(const char* config)
{
this->Configuration = config;

View File

@ -91,6 +91,8 @@ private:
std::string UnknownFlagField;
virtual void StoreUnknownFlag(const char* flag);
FlagValue TakeFlag(std::string const& key);
};
#endif