cmState: Add GetCallStackParent method.

This commit is contained in:
Stephen Kelly 2015-07-04 06:56:13 +02:00
parent a8e5446024
commit 94704d759c
2 changed files with 23 additions and 0 deletions

View File

@ -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;

View File

@ -59,6 +59,7 @@ public:
bool IsValid() const;
Snapshot GetBuildsystemDirectoryParent() const;
Snapshot GetCallStackParent() const;
cmState* GetState() const;