diff options
author | Stephen Kelly <steveire@gmail.com> | 2015-07-04 04:56:13 (GMT) |
---|---|---|
committer | Stephen Kelly <steveire@gmail.com> | 2015-07-05 14:56:36 (GMT) |
commit | 94704d759cc8939f3573122d36d52c4598fd04ba (patch) | |
tree | e25964731cd3f90a4dca7cc837b27b5c390e7d93 /Source | |
parent | a8e54460243b0650145c8684f3d8deb8a712376a (diff) | |
download | CMake-94704d759cc8939f3573122d36d52c4598fd04ba.zip CMake-94704d759cc8939f3573122d36d52c4598fd04ba.tar.gz CMake-94704d759cc8939f3573122d36d52c4598fd04ba.tar.bz2 |
cmState: Add GetCallStackParent method.
Diffstat (limited to 'Source')
-rw-r--r-- | Source/cmState.cxx | 22 | ||||
-rw-r--r-- | Source/cmState.h | 1 |
2 files changed, 23 insertions, 0 deletions
diff --git a/Source/cmState.cxx b/Source/cmState.cxx index ef55e09..5ca1cce 100644 --- a/Source/cmState.cxx +++ b/Source/cmState.cxx @@ -854,6 +854,28 @@ cmState::Snapshot cmState::Snapshot::GetBuildsystemDirectoryParent() const return snapshot; } +cmState::Snapshot cmState::Snapshot::GetCallStackParent() const +{ + assert(this->State); + assert(this->Position != this->State->SnapshotData.Root()); + + Snapshot snapshot; + if (this->Position->SnapshotType == cmState::BuildsystemDirectoryType) + { + return snapshot; + } + + PositionType parentPos = this->Position; + ++parentPos; + if (parentPos == this->State->SnapshotData.Root()) + { + return snapshot; + } + + snapshot = Snapshot(this->State, parentPos); + return snapshot; +} + cmState* cmState::Snapshot::GetState() const { return this->State; diff --git a/Source/cmState.h b/Source/cmState.h index 9a1f764..e35b843 100644 --- a/Source/cmState.h +++ b/Source/cmState.h @@ -59,6 +59,7 @@ public: bool IsValid() const; Snapshot GetBuildsystemDirectoryParent() const; + Snapshot GetCallStackParent() const; cmState* GetState() const; |