mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-06-29 00:27:27 -04:00
Add more consistency checks to serialization code
As suggested by Cyril
This commit is contained in:
parent
3094146c13
commit
dd55ddea95
2 changed files with 30 additions and 5 deletions
|
@ -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,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue