From 9633d112794e1bb6b08ab6de0c20baca3a8c5847 Mon Sep 17 00:00:00 2001 From: Brad King Date: Wed, 13 Aug 2014 14:07:07 -0400 Subject: cmIDEOptions: Add HasFlag method to test if a flag is set --- Source/cmIDEOptions.cxx | 6 ++++++ Source/cmIDEOptions.h | 1 + 2 files changed, 7 insertions(+) diff --git a/Source/cmIDEOptions.cxx b/Source/cmIDEOptions.cxx index e9980cf..0eb903d 100644 --- a/Source/cmIDEOptions.cxx +++ b/Source/cmIDEOptions.cxx @@ -217,6 +217,12 @@ void cmIDEOptions::RemoveFlag(const char* flag) } //---------------------------------------------------------------------------- +bool cmIDEOptions::HasFlag(std::string const& flag) const +{ + return this->FlagMap.find(flag) != this->FlagMap.end(); +} + +//---------------------------------------------------------------------------- const char* cmIDEOptions::GetFlag(const char* flag) { // This method works only for single-valued flags! diff --git a/Source/cmIDEOptions.h b/Source/cmIDEOptions.h index 2bedbad..7386016 100644 --- a/Source/cmIDEOptions.h +++ b/Source/cmIDEOptions.h @@ -34,6 +34,7 @@ public: void AppendFlag(std::string const& flag, std::vector const& value); void RemoveFlag(const char* flag); + bool HasFlag(std::string const& flag) const; const char* GetFlag(const char* flag); protected: -- cgit v0.12