diff options
author | Ben Boeckel <ben.boeckel@kitware.com> | 2010-08-24 18:40:51 (GMT) |
---|---|---|
committer | Ben Boeckel <ben.boeckel@kitware.com> | 2010-09-01 17:08:14 (GMT) |
commit | 52f9637174242752721dfb322908adb40c8244c2 (patch) | |
tree | 7b309c7e53d8790c3d270a12b523eb6e11187487 | |
parent | f794d589a44918c905911eb7688d69350922c6b3 (diff) | |
download | CMake-52f9637174242752721dfb322908adb40c8244c2.zip CMake-52f9637174242752721dfb322908adb40c8244c2.tar.gz CMake-52f9637174242752721dfb322908adb40c8244c2.tar.bz2 |
Add method to get the local scope variables
-rw-r--r-- | Source/cmDefinitions.cxx | 13 | ||||
-rw-r--r-- | Source/cmDefinitions.h | 3 |
2 files changed, 16 insertions, 0 deletions
diff --git a/Source/cmDefinitions.cxx b/Source/cmDefinitions.cxx index 2d40718..34ca68d 100644 --- a/Source/cmDefinitions.cxx +++ b/Source/cmDefinitions.cxx @@ -85,6 +85,19 @@ const char* cmDefinitions::Set(const char* key, const char* value) } //---------------------------------------------------------------------------- +std::set<cmStdString> cmDefinitions::LocalKeys() const +{ + std::set<cmStdString> keys; + // Consider local definitions. + for(MapType::const_iterator mi = this->Map.begin(); + mi != this->Map.end(); ++mi) + { + keys.insert(mi->first); + } + return keys; +} + +//---------------------------------------------------------------------------- cmDefinitions cmDefinitions::Closure() const { return cmDefinitions(ClosureTag(), this); diff --git a/Source/cmDefinitions.h b/Source/cmDefinitions.h index e385e88..4834d84 100644 --- a/Source/cmDefinitions.h +++ b/Source/cmDefinitions.h @@ -40,6 +40,9 @@ public: /** Set (or unset if null) a value associated with a key. */ const char* Set(const char* key, const char* value); + /** Get the set of all local keys. */ + std::set<cmStdString> LocalKeys() const; + /** Compute the closure of all defined keys with values. This flattens the scope. The result has no parent. */ cmDefinitions Closure() const; |