Add more consistency checks to serialization code

As suggested by Cyril
This commit is contained in:
Gioacchino Mazzurco 2018-08-28 15:20:41 +02:00
parent 3094146c13
commit dd55ddea95
No known key found for this signature in database
GPG key ID: A1FBCA3872E87051
2 changed files with 30 additions and 5 deletions

View file

@ -159,8 +159,6 @@
struct RsItem;
#define SERIALIZE_ERROR() std::cerr << __PRETTY_FUNCTION__ << " : "
// This is the base class for serializers.
class RsSerialType
@ -222,9 +220,7 @@ struct RsGenericSerializer : RsSerialType
SerializeContext(
uint8_t* data = nullptr, uint32_t size = 0,
SerializationFlags flags = SERIALIZATION_FLAG_NONE,
RsJson::AllocatorType* allocator = nullptr) :
mData(data), mSize(size), mOffset(0), mOk(true), mFlags(flags),
mJson(rapidjson::kObjectType, allocator) {}
RsJson::AllocatorType* allocator = nullptr);
RS_DEPRECATED SerializeContext(
uint8_t *data, uint32_t size, SerializationFormat format,