diff --git a/src/SerializedTypes.cpp b/src/SerializedTypes.cpp index 270262ff4b..647b22c8a3 100644 --- a/src/SerializedTypes.cpp +++ b/src/SerializedTypes.cpp @@ -142,6 +142,11 @@ static std::string hex(const std::vector& value) return std::string(psz, psz + value.size()*2); } +STVariableLength::STVariableLength(SerializerIterator& st, const char *name) : SerializedType(name) +{ + value = st.getVL(); +} + std::string STVariableLength::getText() const { return hex(value); diff --git a/src/SerializedTypes.h b/src/SerializedTypes.h index b2a6fed188..b522ad2645 100644 --- a/src/SerializedTypes.h +++ b/src/SerializedTypes.h @@ -66,7 +66,7 @@ public: STUInt8(unsigned char v=0) : value(v) { ; } STUInt8(const char *n, unsigned char v=0) : SerializedType(n), value(v) { ; } - static STUInt8* construct(SerializerIterator&, const char *name=NULL); + static STUInt8* construct(SerializerIterator&, const char *name = NULL); int getLength() const { return 1; } SerializedTypeID getSType() const { return STI_UINT8; } @@ -91,7 +91,7 @@ public: STUInt16(uint16 v=0) : value(v) { ; } STUInt16(const char *n, uint16 v=0) : SerializedType(n), value(v) { ; } - static STUInt16* construct(SerializerIterator&, const char *name=NULL); + static STUInt16* construct(SerializerIterator&, const char *name = NULL); int getLength() const { return 2; } SerializedTypeID getSType() const { return STI_UINT16; } @@ -116,7 +116,7 @@ public: STUInt32(uint32 v=0) : value(v) { ; } STUInt32(const char *n, uint32 v=0) : SerializedType(n), value(v) { ; } - static STUInt32* construct(SerializerIterator&, const char *name=NULL); + static STUInt32* construct(SerializerIterator&, const char *name = NULL); int getLength() const { return 4; } SerializedTypeID getSType() const { return STI_UINT32; } @@ -141,7 +141,7 @@ public: STUInt64(uint64 v=0) : value(v) { ; } STUInt64(const char *n, uint64 v=0) : SerializedType(n), value(v) { ; } - static STUInt64* construct(SerializerIterator&, const char *name=NULL); + static STUInt64* construct(SerializerIterator&, const char *name = NULL); int getLength() const { return 8; } SerializedTypeID getSType() const { return STI_UINT64; } @@ -250,7 +250,7 @@ public: STHash128(const uint128& v=uint128()) : value(v) { ; } STHash128(const char *n, const uint128& v=uint128()) : SerializedType(n), value(v) { ; } STHash128() { ; } - static STHash128* construct(SerializerIterator&, const char *name=NULL); + static STHash128* construct(SerializerIterator&, const char *name = NULL); int getLength() const { return 20; } SerializedTypeID getSType() const { return STI_HASH128; } @@ -276,7 +276,7 @@ public: STHash160(const uint160& v=uint160()) : value(v) { ; } STHash160(const char *n, const uint160& v=uint160()) : SerializedType(n), value(v) { ; } STHash160() { ; } - static STHash160* construct(SerializerIterator&, const char *name=NULL); + static STHash160* construct(SerializerIterator&, const char *name = NULL); int getLength() const { return 20; } SerializedTypeID getSType() const { return STI_HASH160; } @@ -302,7 +302,7 @@ public: STHash256(const uint256& v) : value(v) { ; } STHash256(const char *n, const uint256& v=uint256()) : SerializedType(n), value(v) { ; } STHash256() { ; } - static STHash256* construct(SerializerIterator&, const char *name=NULL); + static STHash256* construct(SerializerIterator&, const char *name = NULL); int getLength() const { return 32; } SerializedTypeID getSType() const { return STI_HASH256; } @@ -328,8 +328,9 @@ public: STVariableLength(const std::vector& v) : value(v) { ; } STVariableLength(const char *n, const std::vector& v) : SerializedType(n), value(v) { ; } STVariableLength(const char *n) : SerializedType(n) { ; } + STVariableLength(SerializerIterator&, const char *name = NULL); STVariableLength() { ; } - static STVariableLength* construct(SerializerIterator&, const char *name=NULL); + static STVariableLength* construct(SerializerIterator&, const char *name = NULL); int getLength() const; virtual SerializedTypeID getSType() const { return STI_VL; } @@ -380,7 +381,7 @@ public: STTaggedList(const char *n) : SerializedType(n) { ; } STTaggedList(const std::vector& v) : value(v) { ; } STTaggedList(const char *n, const std::vector& v) : SerializedType(n), value(v) { ; } - static STTaggedList* construct(SerializerIterator&, const char *name=NULL); + static STTaggedList* construct(SerializerIterator&, const char *name = NULL); int getLength() const; SerializedTypeID getSType() const { return STI_TL; }