mirror of
https://github.com/XRPLF/rippled.git
synced 2025-12-06 17:27:55 +00:00
New serializer work.
Rework add/addRaw/addData per discussion with Arthur. New STObject add/deserialize code. STArray add/deserialize code. Allow arrays of normal fields. Other small fixes.
This commit is contained in:
@@ -61,8 +61,7 @@ public:
|
||||
virtual Json::Value getJson(int) const
|
||||
{ return getText(); }
|
||||
|
||||
virtual void add(Serializer& s) const { addFieldID(s); addData(s); }
|
||||
virtual void addData(Serializer& s) const { ; }
|
||||
virtual void add(Serializer& s) const { ; }
|
||||
|
||||
virtual bool isEquivalent(const SerializedType& t) const
|
||||
{ assert(getSType() == STI_NOTPRESENT); return t.getSType() == STI_NOTPRESENT; }
|
||||
@@ -98,7 +97,7 @@ public:
|
||||
|
||||
SerializedTypeID getSType() const { return STI_UINT8; }
|
||||
std::string getText() const;
|
||||
void addData(Serializer& s) const { s.add8(value); }
|
||||
void add(Serializer& s) const { s.add8(value); }
|
||||
|
||||
unsigned char getValue() const { return value; }
|
||||
void setValue(unsigned char v) { value = v; }
|
||||
@@ -124,7 +123,7 @@ public:
|
||||
|
||||
SerializedTypeID getSType() const { return STI_UINT16; }
|
||||
std::string getText() const;
|
||||
void addData(Serializer& s) const { s.add16(value); }
|
||||
void add(Serializer& s) const { s.add16(value); }
|
||||
|
||||
uint16 getValue() const { return value; }
|
||||
void setValue(uint16 v) { value=v; }
|
||||
@@ -150,7 +149,7 @@ public:
|
||||
|
||||
SerializedTypeID getSType() const { return STI_UINT32; }
|
||||
std::string getText() const;
|
||||
void addData(Serializer& s) const { s.add32(value); }
|
||||
void add(Serializer& s) const { s.add32(value); }
|
||||
|
||||
uint32 getValue() const { return value; }
|
||||
void setValue(uint32 v) { value=v; }
|
||||
@@ -176,7 +175,7 @@ public:
|
||||
|
||||
SerializedTypeID getSType() const { return STI_UINT64; }
|
||||
std::string getText() const;
|
||||
void addData(Serializer& s) const { s.add64(value); }
|
||||
void add(Serializer& s) const { s.add64(value); }
|
||||
|
||||
uint64 getValue() const { return value; }
|
||||
void setValue(uint64 v) { value=v; }
|
||||
@@ -268,7 +267,7 @@ public:
|
||||
std::string getText() const;
|
||||
std::string getRaw() const;
|
||||
std::string getFullText() const;
|
||||
void addData(Serializer& s) const;
|
||||
void add(Serializer& s) const;
|
||||
|
||||
int getExponent() const { return mOffset; }
|
||||
uint64 getMantissa() const { return mValue; }
|
||||
@@ -392,7 +391,7 @@ public:
|
||||
|
||||
SerializedTypeID getSType() const { return STI_HASH128; }
|
||||
virtual std::string getText() const;
|
||||
void addData(Serializer& s) const { s.add128(value); }
|
||||
void add(Serializer& s) const { s.add128(value); }
|
||||
|
||||
const uint128& getValue() const { return value; }
|
||||
void setValue(const uint128& v) { value=v; }
|
||||
@@ -420,7 +419,7 @@ public:
|
||||
|
||||
SerializedTypeID getSType() const { return STI_HASH160; }
|
||||
virtual std::string getText() const;
|
||||
void addData(Serializer& s) const { s.add160(value); }
|
||||
void add(Serializer& s) const { s.add160(value); }
|
||||
|
||||
const uint160& getValue() const { return value; }
|
||||
void setValue(const uint160& v) { value=v; }
|
||||
@@ -448,7 +447,7 @@ public:
|
||||
|
||||
SerializedTypeID getSType() const { return STI_HASH256; }
|
||||
std::string getText() const;
|
||||
void addData(Serializer& s) const { s.add256(value); }
|
||||
void add(Serializer& s) const { s.add256(value); }
|
||||
|
||||
const uint256& getValue() const { return value; }
|
||||
void setValue(const uint256& v) { value=v; }
|
||||
@@ -477,7 +476,7 @@ public:
|
||||
|
||||
virtual SerializedTypeID getSType() const { return STI_VL; }
|
||||
virtual std::string getText() const;
|
||||
void addData(Serializer& s) const { s.addVL(value); }
|
||||
void add(Serializer& s) const { s.addVL(value); }
|
||||
|
||||
const std::vector<unsigned char>& peekValue() const { return value; }
|
||||
std::vector<unsigned char>& peekValue() { return value; }
|
||||
@@ -642,7 +641,7 @@ public:
|
||||
{ return std::auto_ptr<SerializedType>(construct(sit, name)); }
|
||||
|
||||
// std::string getText() const;
|
||||
void addData(Serializer& s) const;
|
||||
void add(Serializer& s) const;
|
||||
virtual Json::Value getJson(int) const;
|
||||
|
||||
SerializedTypeID getSType() const { return STI_PATHSET; }
|
||||
@@ -711,7 +710,7 @@ public:
|
||||
STVector256(const std::vector<uint256>& vector) : mValue(vector) { ; }
|
||||
|
||||
SerializedTypeID getSType() const { return STI_VECTOR256; }
|
||||
void addData(Serializer& s) const;
|
||||
void add(Serializer& s) const;
|
||||
|
||||
static std::auto_ptr<SerializedType> deserialize(SerializerIterator& sit, SField::ref name)
|
||||
{ return std::auto_ptr<SerializedType>(construct(sit, name)); }
|
||||
|
||||
Reference in New Issue
Block a user