mirror of
https://github.com/romixlab/qmsgpack.git
synced 2026-02-04 14:25:23 +01:00
Compatibility mode implemented
This commit is contained in:
@@ -1,5 +1,4 @@
|
||||
#include "msgpack.h"
|
||||
#include <QDebug>
|
||||
#include "private/unpack_p.h"
|
||||
#include "private/pack_p.h"
|
||||
#include <QByteArray>
|
||||
@@ -12,7 +11,6 @@ QVariant MsgPack::unpack(const QByteArray &data)
|
||||
return MsgPackPrivate::unpack(p, end);
|
||||
}
|
||||
|
||||
|
||||
QByteArray MsgPack::pack(const QVariant &variant)
|
||||
{
|
||||
quint8 *p = 0;
|
||||
@@ -27,14 +25,17 @@ QByteArray MsgPack::pack(const QVariant &variant)
|
||||
return arr;
|
||||
}
|
||||
|
||||
|
||||
bool MsgPack::registerPacker(QMetaType::Type qType, qint8 msgpackType, MsgPack::pack_user_f packer)
|
||||
{
|
||||
return MsgPackPrivate::register_packer(qType, msgpackType, packer);
|
||||
}
|
||||
|
||||
|
||||
bool MsgPack::registerUnpacker(qint8 msgpackType, MsgPack::unpack_user_f unpacker)
|
||||
{
|
||||
return MsgPackPrivate::register_unpacker(msgpackType, unpacker);
|
||||
}
|
||||
|
||||
void MsgPack::setCompatibilityModeEnabled(bool enabled)
|
||||
{
|
||||
MsgPackPrivate::compatibilityMode = enabled;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user