mirror of
https://github.com/romixlab/qmsgpack.git
synced 2026-02-04 06:15:24 +01:00
739 B
739 B
qmsgpack 
MessagePack for Qt
Installation
Clone repository:
git clone https://github.com/romixlab/qmsgpack.git
cd qmsgpack
mkdir build
cd build
cmake ..
make install
Sample usage
Packing
QVariantList list;
list << 1 << 2 << 3;
QByteArray array = MsgPack::pack(list);
Unpacking:
QVariantList unpacked = MsgPack::unpack(array).toList();
Streaming API:
// packing
MsgPackStream stream(&ba, QIODevice::WriteOnly);
stream << 1 << 2.3 << "some string";
// unpacking
MsgPackStream stream(ba);
int a;
double b;
QSting s;
stream >> a >> b >> s;