This commit is contained in:
Roman
2015-05-19 23:02:13 +03:00
parent f978fb0d78
commit 2acfaf4cc5
2 changed files with 13 additions and 12 deletions

View File

@@ -10,14 +10,14 @@
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
* @brief pack user type to byte array data
* @arg variant user type, must be registered first
* @return array with user data only, all other fields will be added automatically
*/
typedef QByteArray (*pack_user_f)(const QVariant &variant);
/**
* unpack user type to QVariant
* @brief unpack user type to QVariant
* @arg data only user data, without size and messagepack type
*/
typedef QVariant (*unpack_user_f)(const QByteArray &data);
/**

View File

@@ -121,7 +121,7 @@ MsgPackStream &MsgPackStream::operator>>(quint16 &u16)
setStatus(ReadPastEnd);
return *this;
}
if (!unpack_upto_quint16(u16, &p {
if (!unpack_upto_quint16(u16, &p))
setStatus(ReadCorruptData);
return *this;
}
@@ -134,7 +134,7 @@ MsgPackStream &MsgPackStream::operator>>(quint32 &u32)
setStatus(ReadPastEnd);
return *this;
}
if (!unpack_upto_quint32(u32, &p {
if (!unpack_upto_quint32(u32, &p))
setStatus(ReadCorruptData);
return *this;
}
@@ -147,7 +147,7 @@ MsgPackStream &MsgPackStream::operator>>(quint64 &u64)
setStatus(ReadPastEnd);
return *this;
}
if (!unpack_upto_quint64(u64, &p {
if (!unpack_upto_quint64(u64, &p))
setStatus(ReadCorruptData);
return *this;
}
@@ -160,7 +160,8 @@ MsgPackStream &MsgPackStream::operator>>(qint8 &i8)
setStatus(ReadPastEnd);
return *this;
}
if (!unpack_upto_qint8(i8, &p)) setStatus(ReadCorruptData);
if (!unpack_upto_qint8(i8, &p))
setStatus(ReadCorruptData);
return *this;
}
@@ -172,7 +173,7 @@ MsgPackStream &MsgPackStream::operator>>(qint16 &i16)
setStatus(ReadPastEnd);
return *this;
}
if (!unpack_upto_qint16(i16, &p){
if (!unpack_upto_qint16(i16, &p))
setStatus(ReadCorruptData);
return *this;
}
@@ -185,7 +186,7 @@ MsgPackStream &MsgPackStream::operator>>(qint32 &i32)
setStatus(ReadPastEnd);
return *this;
}
if (!unpack_upto_qint32(i32, &p){
if (!unpack_upto_qint32(i32, &p))
setStatus(ReadCorruptData);
return *this;
}
@@ -198,7 +199,7 @@ MsgPackStream &MsgPackStream::operator>>(qint64 &i64)
setStatus(ReadPastEnd);
return *this;
}
if (!unpack_upto_qint64(i64, &p){
if (!unpack_upto_qint64(i64, &p))
setStatus(ReadCorruptData);
return *this;
}