2014-09-22 20:03:00 +04:00
|
|
|
#ifndef COMMON_H
|
|
|
|
|
#define COMMON_H
|
|
|
|
|
|
|
|
|
|
#include <QVariant>
|
|
|
|
|
|
2014-09-26 22:03:24 +04:00
|
|
|
#define MSGPACK_MAJOR 0
|
2014-11-02 23:28:21 +03:00
|
|
|
#define MSGPACK_MINOR 1
|
2014-09-26 22:03:24 +04:00
|
|
|
#define MSGPACK_VERSION 0
|
|
|
|
|
|
2014-09-22 20:03:00 +04:00
|
|
|
namespace MsgPack {
|
|
|
|
|
/**
|
|
|
|
|
* pack some variant to byte array data
|
|
|
|
|
* when write == false only calculates and returns size
|
|
|
|
|
* when write == true writes bytes to data, and returns the same size
|
|
|
|
|
* return type size
|
|
|
|
|
*/
|
|
|
|
|
typedef quint32 (*pack_user_f)(const QVariant &variant, QByteArray &data, bool write);
|
2014-11-02 23:28:21 +03:00
|
|
|
/**
|
|
|
|
|
* unpack user type to QVariant
|
|
|
|
|
*/
|
2014-09-26 22:03:24 +04:00
|
|
|
typedef QVariant (*unpack_user_f)(const QByteArray &data);
|
2014-11-02 23:28:21 +03:00
|
|
|
/**
|
|
|
|
|
* @brief version
|
|
|
|
|
* @return current version
|
|
|
|
|
*/
|
2014-09-26 22:03:24 +04:00
|
|
|
QString version();
|
2014-09-22 20:03:00 +04:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#endif // COMMON_H
|