diff options
author | Brad King <brad.king@kitware.com> | 2017-03-07 20:16:17 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2017-03-10 15:19:55 (GMT) |
commit | 80e982d7ad571ce308708d36a531df7a91ffe0f8 (patch) | |
tree | e9ce1dd06489f42292c8cc93e2bace8a01d8f7c7 /Source | |
parent | f7bb40c92dceedd65965c4c475b5395239e630ea (diff) | |
download | CMake-80e982d7ad571ce308708d36a531df7a91ffe0f8.zip CMake-80e982d7ad571ce308708d36a531df7a91ffe0f8.tar.gz CMake-80e982d7ad571ce308708d36a531df7a91ffe0f8.tar.bz2 |
VS: Add method to take a value out of the option parser flag map
Remove a flag from the map and return its value.
Diffstat (limited to 'Source')
-rw-r--r-- | Source/cmVisualStudioGeneratorOptions.cxx | 12 | ||||
-rw-r--r-- | Source/cmVisualStudioGeneratorOptions.h | 2 |
2 files changed, 14 insertions, 0 deletions
diff --git a/Source/cmVisualStudioGeneratorOptions.cxx b/Source/cmVisualStudioGeneratorOptions.cxx index 1d20d44..3007f14 100644 --- a/Source/cmVisualStudioGeneratorOptions.cxx +++ b/Source/cmVisualStudioGeneratorOptions.cxx @@ -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; diff --git a/Source/cmVisualStudioGeneratorOptions.h b/Source/cmVisualStudioGeneratorOptions.h index 700b877..e79c977 100644 --- a/Source/cmVisualStudioGeneratorOptions.h +++ b/Source/cmVisualStudioGeneratorOptions.h @@ -91,6 +91,8 @@ private: std::string UnknownFlagField; virtual void StoreUnknownFlag(const char* flag); + + FlagValue TakeFlag(std::string const& key); }; #endif |