From 66f871ca418e099dbb13614a613e78e556292c0b Mon Sep 17 00:00:00 2001 From: Aaron Seigo Date: Thu, 4 Dec 2014 11:54:25 +0100 Subject: missing file --- common/commands.cpp | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 common/commands.cpp (limited to 'common') diff --git a/common/commands.cpp b/common/commands.cpp new file mode 100644 index 0000000..b5773e7 --- /dev/null +++ b/common/commands.cpp @@ -0,0 +1,16 @@ +#include "commands.h" + +#include + +namespace Commands +{ + +void write(QIODevice *device, int commandId, flatbuffers::FlatBufferBuilder &fbb) +{ + const int dataSize = fbb.GetSize(); + device->write((const char*)&commandId, sizeof(int)); + device->write((const char*)&dataSize, sizeof(int)); + device->write((const char*)fbb.GetBufferPointer(), dataSize); +} + +} \ No newline at end of file -- cgit v1.2.3