diff options
author | Aaron Seigo <aseigo@kde.org> | 2014-12-04 11:54:25 +0100 |
---|---|---|
committer | Aaron Seigo <aseigo@kde.org> | 2014-12-04 11:54:34 +0100 |
commit | 66f871ca418e099dbb13614a613e78e556292c0b (patch) | |
tree | 4bc80c5a81ba9166e40ddc78d15328e04e75f28e /common/commands.cpp | |
parent | 7cf9ad9456b0ef80372b2a4f5b48f06ad390ec59 (diff) | |
download | sink-66f871ca418e099dbb13614a613e78e556292c0b.tar.gz sink-66f871ca418e099dbb13614a613e78e556292c0b.zip |
missing file
Diffstat (limited to 'common/commands.cpp')
-rw-r--r-- | common/commands.cpp | 16 |
1 files changed, 16 insertions, 0 deletions
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 @@ | |||
1 | #include "commands.h" | ||
2 | |||
3 | #include <QIODevice> | ||
4 | |||
5 | namespace Commands | ||
6 | { | ||
7 | |||
8 | void write(QIODevice *device, int commandId, flatbuffers::FlatBufferBuilder &fbb) | ||
9 | { | ||
10 | const int dataSize = fbb.GetSize(); | ||
11 | device->write((const char*)&commandId, sizeof(int)); | ||
12 | device->write((const char*)&dataSize, sizeof(int)); | ||
13 | device->write((const char*)fbb.GetBufferPointer(), dataSize); | ||
14 | } | ||
15 | |||
16 | } \ No newline at end of file | ||