From 52f9637174242752721dfb322908adb40c8244c2 Mon Sep 17 00:00:00 2001 From: Ben Boeckel Date: Tue, 24 Aug 2010 14:40:51 -0400 Subject: Add method to get the local scope variables --- Source/cmDefinitions.cxx | 13 +++++++++++++ Source/cmDefinitions.h | 3 +++ 2 files changed, 16 insertions(+) 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 cmDefinitions::LocalKeys() const +{ + std::set 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 LocalKeys() const; + /** Compute the closure of all defined keys with values. This flattens the scope. The result has no parent. */ cmDefinitions Closure() const; -- cgit v0.12