diff options
author | Brad King <brad.king@kitware.com> | 2014-05-15 13:44:25 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2014-05-15 14:26:30 (GMT) |
commit | f52b5ae3c4a87723f90f63249a979424aaf99407 (patch) | |
tree | 415fe0d6b9ec6177377ff50fdd572660e5e5a7ef /Source/cmSystemTools.h | |
parent | a9ae1d7a605333f0dea6d709e27a177b19f8c2ae (diff) | |
download | CMake-f52b5ae3c4a87723f90f63249a979424aaf99407.zip CMake-f52b5ae3c4a87723f90f63249a979424aaf99407.tar.gz CMake-f52b5ae3c4a87723f90f63249a979424aaf99407.tar.bz2 |
cmSystemTools: Add callback for Stderr
Factor a common callback type out of StdoutCallback. Add an equivalent
StderrCallback. While at it, use "size_t" for the data length instead
of "int".
Teach "ctest --build-and-test" to capture the Stderr callback because
output sent through it is part of the logical CMake process output.
Diffstat (limited to 'Source/cmSystemTools.h')
-rw-r--r-- | Source/cmSystemTools.h | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/Source/cmSystemTools.h b/Source/cmSystemTools.h index 979551c..4455dd1 100644 --- a/Source/cmSystemTools.h +++ b/Source/cmSystemTools.h @@ -77,14 +77,17 @@ public: */ static void Message(const char* m, const char* title=0); + typedef void (*OutputCallback)(const char*, size_t length, void*); + ///! Send a string to stdout static void Stdout(const char* s); - static void Stdout(const char* s, int length); - typedef void (*StdoutCallback)(const char*, int length, void*); - static void SetStdoutCallback(StdoutCallback, void* clientData=0); + static void Stdout(const char* s, size_t length); + static void SetStdoutCallback(OutputCallback, void* clientData=0); - ///! Send a string to stderr. Stdout callbacks will not be invoced. - static void Stderr(const char* s, int length); + ///! Send a string to stderr + static void Stderr(const char* s); + static void Stderr(const char* s, size_t length); + static void SetStderrCallback(OutputCallback, void* clientData=0); typedef bool (*InterruptCallback)(void*); @@ -471,10 +474,12 @@ private: static bool s_DisableMessages; static bool s_DisableRunCommandOutput; static MessageCallback s_MessageCallback; - static StdoutCallback s_StdoutCallback; + static OutputCallback s_StdoutCallback; + static OutputCallback s_StderrCallback; static InterruptCallback s_InterruptCallback; static void* s_MessageCallbackClientData; static void* s_StdoutCallbackClientData; + static void* s_StderrCallbackClientData; static void* s_InterruptCallbackClientData; }; |