cmIDEOptions: Add HasFlag method to test if a flag is set

This commit is contained in:
Brad King 2014-08-13 14:07:07 -04:00
parent 841001028a
commit 9633d11279
2 changed files with 7 additions and 0 deletions

View File

@ -216,6 +216,12 @@ void cmIDEOptions::RemoveFlag(const char* flag)
this->FlagMap.erase(flag); this->FlagMap.erase(flag);
} }
//----------------------------------------------------------------------------
bool cmIDEOptions::HasFlag(std::string const& flag) const
{
return this->FlagMap.find(flag) != this->FlagMap.end();
}
//---------------------------------------------------------------------------- //----------------------------------------------------------------------------
const char* cmIDEOptions::GetFlag(const char* flag) const char* cmIDEOptions::GetFlag(const char* flag)
{ {

View File

@ -34,6 +34,7 @@ public:
void AppendFlag(std::string const& flag, void AppendFlag(std::string const& flag,
std::vector<std::string> const& value); std::vector<std::string> const& value);
void RemoveFlag(const char* flag); void RemoveFlag(const char* flag);
bool HasFlag(std::string const& flag) const;
const char* GetFlag(const char* flag); const char* GetFlag(const char* flag);
protected: protected: