summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Source/cmDefinitions.cxx13
-rw-r--r--Source/cmDefinitions.h3
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;