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.cxx | |
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.cxx')
-rw-r--r-- | Source/cmVariableWatch.cxx | 26 |
1 files changed, 24 insertions, 2 deletions
diff --git a/Source/cmVariableWatch.cxx b/Source/cmVariableWatch.cxx index d267a52..d234f28 100644 --- a/Source/cmVariableWatch.cxx +++ b/Source/cmVariableWatch.cxx @@ -16,6 +16,25 @@ =========================================================================*/ #include "cmVariableWatch.h" +static const char* const cmVariableWatchAccessStrings[] = +{ + "READ_ACCESS", + "UNKNOWN_READ_ACCESS", + "ALLOWED_UNKNOWN_READ_ACCESS", + "MODIFIED_ACCESS", + "REMOVED_ACCESS", + "NO_ACCESS" +}; + +const char* cmVariableWatch::GetAccessAsString(int access_type) +{ + if ( access_type < 0 || access_type >= cmVariableWatch::NO_ACCESS ) + { + return "NO_ACCESS"; + } + return cmVariableWatchAccessStrings[access_type]; +} + cmVariableWatch::cmVariableWatch() { } @@ -60,7 +79,9 @@ void cmVariableWatch::RemoveWatch(const std::string& variable, } void cmVariableWatch::VariableAccessed(const std::string& variable, - int access_type) const + int access_type, + const char* newValue, + const cmMakefile* mf) const { cmVariableWatch::StringToVectorOfPairs::const_iterator mit = this->WatchMap.find(variable); @@ -70,7 +91,8 @@ void cmVariableWatch::VariableAccessed(const std::string& variable, cmVariableWatch::VectorOfPairs::const_iterator it; for ( it = vp->begin(); it != vp->end(); it ++ ) { - it->Method(variable, access_type, it->ClientData); + it->Method(variable, access_type, it->ClientData, + newValue, mf); } } } |