diff options
author | Andy Cedilnik <andy.cedilnik@kitware.com> | 2007-04-11 15:13:05 -0400 |
---|---|---|
committer | Andy Cedilnik <andy.cedilnik@kitware.com> | 2007-04-11 15:13:05 -0400 |
commit | f9f1ccadb370b7b3466d491b1824104d81a15308 (patch) | |
tree | 8428b8e66ce907c5befa5b86fa3fb6773722e8c4 /Source/cmVariableWatch.h | |
parent | 76e5344590f6259fcfc73d35e286509f9e260678 (diff) | |
download | cmake-f9f1ccadb370b7b3466d491b1824104d81a15308.tar.gz |
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 15e8f90c6f..7f97c282c6 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 |