MCPcopy Create free account
hub / github.com/Tom94/tev / interpretAsVectorGraphics

Method interpretAsVectorGraphics

src/Ipc.cpp:332–356  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

330}
331
332IpcPacketVectorGraphics IpcPacket::interpretAsVectorGraphics() const {
333 IpcPacketVectorGraphics result;
334 IStream payload{mPayload};
335
336 EType type;
337 payload >> type;
338 if (type != EType::VectorGraphics) {
339 throw runtime_error{"Cannot interpret IPC packet as VectorGraphics."};
340 }
341
342 payload >> result.grabFocus;
343 payload >> result.imageName;
344 payload >> result.append;
345 payload >> result.nCommands;
346
347 result.commands.resize(result.nCommands);
348 for (int32_t i = 0; i < result.nCommands; ++i) {
349 auto& command = result.commands[i];
350 payload >> command.type;
351 command.data.resize(command.size());
352 payload >> command.data;
353 }
354
355 return result;
356}
357
358static void makeSocketNonBlocking(Ipc::socket_t socketFd) {
359#ifdef _WIN32

Callers 1

handleIpcPacketFunction · 0.80

Calls 2

resizeMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected