summaryrefslogtreecommitdiff
path: root/Source/cmServer.cxx
diff options
context:
space:
mode:
authorTobias Hunger <tobias.hunger@qt.io>2016-09-09 10:01:45 +0200
committerTobias Hunger <tobias.hunger@qt.io>2016-09-22 16:30:03 +0200
commite22d30e25a264c309bd819edde3eacb1184da800 (patch)
tree06c316445faeeb2a8588fae1e264bbd903e7d712 /Source/cmServer.cxx
parentcc576c2c7f3272ec5370dc3cb45838c20d1837f9 (diff)
downloadcmake-e22d30e25a264c309bd819edde3eacb1184da800.tar.gz
server-mode: Allow for sending signals
Enable the server to send signals.
Diffstat (limited to 'Source/cmServer.cxx')
-rw-r--r--Source/cmServer.cxx13
1 files changed, 13 insertions, 0 deletions
diff --git a/Source/cmServer.cxx b/Source/cmServer.cxx
index f7e5e3b6ff..d5dac4e471 100644
--- a/Source/cmServer.cxx
+++ b/Source/cmServer.cxx
@@ -343,6 +343,19 @@ void cmServer::WriteParseError(const std::string& message) const
this->WriteJsonObject(obj, nullptr);
}
+void cmServer::WriteSignal(const std::string& name,
+ const Json::Value& data) const
+{
+ assert(data.isObject());
+ Json::Value obj = data;
+ obj[kTYPE_KEY] = kSIGNAL_TYPE;
+ obj[kREPLY_TO_KEY] = "";
+ obj[kCOOKIE_KEY] = "";
+ obj[kNAME_KEY] = name;
+
+ WriteJsonObject(obj, nullptr);
+}
+
void cmServer::WriteResponse(const cmServerResponse& response,
const DebugInfo* debug) const
{