MCPcopy Create free account
hub / github.com/Kitware/CMake / processMessage

Method processMessage

Utilities/cmcppdap/src/session.cpp:291–317  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

289 }; // EventHandlers
290
291 Payload processMessage(const std::string& str) {
292 auto d = dap::json::Deserializer(str);
293 dap::string type;
294 if (!d.field("type", &type)) {
295 handlers.error("Message missing string 'type' field");
296 return {};
297 }
298
299 dap::integer sequence = 0;
300 if (!d.field("seq", &sequence)) {
301 handlers.error("Message missing number 'seq' field");
302 return {};
303 }
304
305 if (type == "request") {
306 return processRequest(&d, sequence);
307 } else if (type == "event") {
308 return processEvent(&d);
309 } else if (type == "response") {
310 processResponse(&d);
311 return {};
312 } else {
313 handlers.error("Unknown message type '%s'", type.c_str());
314 }
315
316 return {};
317 }
318
319 Payload processRequest(dap::json::Deserializer* d, dap::integer sequence) {
320 dap::string command;

Callers

nothing calls this directly

Calls 4

c_strMethod · 0.80
DeserializerClass · 0.50
fieldMethod · 0.45
errorMethod · 0.45

Tested by

no test coverage detected