summaryrefslogtreecommitdiffstats
path: root/Source/cmState.h
diff options
context:
space:
mode:
authorStephen Kelly <steveire@gmail.com>2015-07-18 17:11:05 (GMT)
committerStephen Kelly <steveire@gmail.com>2015-07-18 17:37:58 (GMT)
commit9ebc7502b2e4cf991e721b695aead2c366eb0bef (patch)
treefc15903bb08ee8a4a8006c30d170cd2ec7d09cb1 /Source/cmState.h
parent27ec21dbb2370ac71aebc0089d4269f27661f4b8 (diff)
downloadCMake-9ebc7502b2e4cf991e721b695aead2c366eb0bef.zip
CMake-9ebc7502b2e4cf991e721b695aead2c366eb0bef.tar.gz
CMake-9ebc7502b2e4cf991e721b695aead2c366eb0bef.tar.bz2
cmState: Extract a Directory class.
Move Directory-scoped state accessors to it. This will be expanded with directory property state soon.
Diffstat (limited to 'Source/cmState.h')
-rw-r--r--Source/cmState.h52
1 files changed, 34 insertions, 18 deletions
diff --git a/Source/cmState.h b/Source/cmState.h
index 15a6192..acd23a5 100644
--- a/Source/cmState.h
+++ b/Source/cmState.h
@@ -39,27 +39,14 @@ public:
InlineListFileType
};
+ class Directory;
+
class Snapshot {
public:
Snapshot(cmState* state = 0, PositionType position = PositionType());
- const char* GetCurrentSourceDirectory() const;
- void SetCurrentSourceDirectory(std::string const& dir);
- const char* GetCurrentBinaryDirectory() const;
- void SetCurrentBinaryDirectory(std::string const& dir);
-
void SetListFile(std::string const& listfile);
- std::vector<std::string> const&
- GetCurrentSourceDirectoryComponents() const;
- std::vector<std::string> const&
- GetCurrentBinaryDirectoryComponents() const;
-
- const char* GetRelativePathTopSource() const;
- const char* GetRelativePathTopBinary() const;
- void SetRelativePathTopSource(const char* dir);
- void SetRelativePathTopBinary(const char* dir);
-
std::string GetExecutionListFile() const;
std::string GetEntryPointCommand() const;
long GetEntryPointLine() const;
@@ -70,16 +57,45 @@ public:
cmState* GetState() const;
- private:
- void ComputeRelativePathTopSource();
- void ComputeRelativePathTopBinary();
+ Directory GetDirectory() const;
private:
friend class cmState;
+ friend class Directory;
cmState* State;
cmState::PositionType Position;
};
+ class Directory
+ {
+ Directory(cmLinkedTree<BuildsystemDirectoryStateType>::iterator iter,
+ Snapshot const& snapshot);
+ public:
+ const char* GetCurrentSource() const;
+ void SetCurrentSource(std::string const& dir);
+ const char* GetCurrentBinary() const;
+ void SetCurrentBinary(std::string const& dir);
+
+ std::vector<std::string> const&
+ GetCurrentSourceComponents() const;
+ std::vector<std::string> const&
+ GetCurrentBinaryComponents() const;
+
+ const char* GetRelativePathTopSource() const;
+ const char* GetRelativePathTopBinary() const;
+ void SetRelativePathTopSource(const char* dir);
+ void SetRelativePathTopBinary(const char* dir);
+
+ private:
+ void ComputeRelativePathTopSource();
+ void ComputeRelativePathTopBinary();
+
+ private:
+ cmLinkedTree<BuildsystemDirectoryStateType>::iterator DirectoryState;
+ Snapshot Snapshot_;
+ friend class Snapshot;
+ };
+
Snapshot CreateBaseSnapshot();
Snapshot
CreateBuildsystemDirectorySnapshot(Snapshot originSnapshot,