diff options
author | Andy Cedilnik <andy.cedilnik@kitware.com> | 2007-04-11 19:13:05 (GMT) |
---|---|---|
committer | Andy Cedilnik <andy.cedilnik@kitware.com> | 2007-04-11 19:13:05 (GMT) |
commit | f9f1ccadb370b7b3466d491b1824104d81a15308 (patch) | |
tree | 8428b8e66ce907c5befa5b86fa3fb6773722e8c4 /Source/cmVariableWatch.h | |
parent | 76e5344590f6259fcfc73d35e286509f9e260678 (diff) | |
download | CMake-f9f1ccadb370b7b3466d491b1824104d81a15308.zip CMake-f9f1ccadb370b7b3466d491b1824104d81a15308.tar.gz CMake-f9f1ccadb370b7b3466d491b1824104d81a15308.tar.bz2 |
ENH: Add variable watch command
Diffstat (limited to 'Source/cmVariableWatch.h')
-rw-r--r-- | Source/cmVariableWatch.h | 24 |
1 files changed, 16 insertions, 8 deletions
diff --git a/Source/cmVariableWatch.h b/Source/cmVariableWatch.h index 15e8f90..7f97c28 100644 --- a/Source/cmVariableWatch.h +++ b/Source/cmVariableWatch.h @@ -19,6 +19,8 @@ #include "cmStandardIncludes.h" +class cmMakefile; + /** \class cmVariableWatch * \brief Helper class for watching of variable accesses. * @@ -28,7 +30,7 @@ class cmVariableWatch { public: typedef void (*WatchMethod)(const std::string& variable, int access_type, - void* client_data); + void* client_data, const char* newValue, const cmMakefile* mf); cmVariableWatch(); ~cmVariableWatch(); @@ -43,20 +45,26 @@ public: /** * This method is called when variable is accessed */ - void VariableAccessed(const std::string& variable, int access_type) const; + void VariableAccessed(const std::string& variable, int access_type, + const char* newValue, const cmMakefile* mf) const; /** * Different access types. */ enum { - VARIABLE_READ_ACCESS, - UNKNOWN_VARIABLE_READ_ACCESS, - ALLOWED_UNKNOWN_VARIABLE_READ_ACCESS, - VARIABLE_MODIFIED_ACCESS, - VARIABLE_REMOVED_ACCESS, - NO_ACCESS + VARIABLE_READ_ACCESS = 0, + UNKNOWN_VARIABLE_READ_ACCESS, + ALLOWED_UNKNOWN_VARIABLE_READ_ACCESS, + VARIABLE_MODIFIED_ACCESS, + VARIABLE_REMOVED_ACCESS, + NO_ACCESS }; + + /** + * Return the access as string + */ + static const char* GetAccessAsString(int access_type); protected: struct Pair |