mirror of
https://github.com/XRPLF/rippled.git
synced 2025-11-25 13:35:54 +00:00
Remove TaggedList's, they're obsolete.
This commit is contained in:
@@ -116,7 +116,6 @@ public:
|
|||||||
RippleAddress getFieldAccount(SField::ref field) const;
|
RippleAddress getFieldAccount(SField::ref field) const;
|
||||||
uint160 getFieldAccount160(SField::ref field) const;
|
uint160 getFieldAccount160(SField::ref field) const;
|
||||||
std::vector<unsigned char> getFieldVL(SField::ref field) const;
|
std::vector<unsigned char> getFieldVL(SField::ref field) const;
|
||||||
std::vector<TaggedListItem> getFieldTL(SField::ref field) const;
|
|
||||||
STAmount getFieldAmount(SField::ref field) const;
|
STAmount getFieldAmount(SField::ref field) const;
|
||||||
STPathSet getFieldPathSet(SField::ref field) const;
|
STPathSet getFieldPathSet(SField::ref field) const;
|
||||||
STVector256 getFieldV256(SField::ref field) const;
|
STVector256 getFieldV256(SField::ref field) const;
|
||||||
@@ -129,7 +128,6 @@ public:
|
|||||||
void setFieldH160(SField::ref field, const uint160&);
|
void setFieldH160(SField::ref field, const uint160&);
|
||||||
void setFieldH256(SField::ref field, const uint256&);
|
void setFieldH256(SField::ref field, const uint256&);
|
||||||
void setFieldVL(SField::ref field, const std::vector<unsigned char>&);
|
void setFieldVL(SField::ref field, const std::vector<unsigned char>&);
|
||||||
void setFieldTL(SField::ref field, const std::vector<TaggedListItem>&);
|
|
||||||
void setFieldAccount(SField::ref field, const uint160&);
|
void setFieldAccount(SField::ref field, const uint160&);
|
||||||
void setFieldAccount(SField::ref field, const RippleAddress& addr)
|
void setFieldAccount(SField::ref field, const RippleAddress& addr)
|
||||||
{ setFieldAccount(field, addr.getAccountID()); }
|
{ setFieldAccount(field, addr.getAccountID()); }
|
||||||
|
|||||||
@@ -380,64 +380,6 @@ int Serializer::addVL(const std::string& string)
|
|||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
int Serializer::addTaggedList(const std::list<TaggedListItem>& list)
|
|
||||||
{
|
|
||||||
int size = list.size();
|
|
||||||
if (size > 255) return -1;
|
|
||||||
int ret = add8(size);
|
|
||||||
if (size != 0)
|
|
||||||
{
|
|
||||||
BOOST_FOREACH(const TaggedListItem& it, list)
|
|
||||||
{
|
|
||||||
add8(it.first);
|
|
||||||
addVL(it.second);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return ret;
|
|
||||||
}
|
|
||||||
|
|
||||||
int Serializer::addTaggedList(const std::vector<TaggedListItem>& list)
|
|
||||||
{
|
|
||||||
int size = list.size();
|
|
||||||
if (size > 255) return -1;
|
|
||||||
int ret = add8(size);
|
|
||||||
if (size != 0)
|
|
||||||
{
|
|
||||||
BOOST_FOREACH(const TaggedListItem& it, list)
|
|
||||||
{
|
|
||||||
add8(it.first);
|
|
||||||
addVL(it.second);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return ret;
|
|
||||||
}
|
|
||||||
|
|
||||||
int Serializer::getTaggedListLength(const std::list<TaggedListItem>& list)
|
|
||||||
{
|
|
||||||
int size = list.size();
|
|
||||||
if (size > 255) return -1;
|
|
||||||
int ret = 1;
|
|
||||||
if (size != 0)
|
|
||||||
{
|
|
||||||
BOOST_FOREACH(const TaggedListItem& it, list)
|
|
||||||
ret += 1 + it.second.size() + Serializer::encodeLengthLength(it.second.size());
|
|
||||||
}
|
|
||||||
return ret;
|
|
||||||
}
|
|
||||||
|
|
||||||
int Serializer::getTaggedListLength(const std::vector<TaggedListItem>& list)
|
|
||||||
{
|
|
||||||
int size = list.size();
|
|
||||||
if (size > 255) return -1;
|
|
||||||
int ret = 1;
|
|
||||||
if (size != 0)
|
|
||||||
{
|
|
||||||
BOOST_FOREACH(const TaggedListItem& it, list)
|
|
||||||
ret += 1 + it.second.size() + Serializer::encodeLengthLength(it.second.size());
|
|
||||||
}
|
|
||||||
return ret;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool Serializer::getVL(std::vector<unsigned char>& objectVL, int offset, int& length) const
|
bool Serializer::getVL(std::vector<unsigned char>& objectVL, int offset, int& length) const
|
||||||
{
|
{
|
||||||
int b1;
|
int b1;
|
||||||
@@ -503,44 +445,6 @@ bool Serializer::getVLLength(int& length, int offset) const
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool Serializer::getTaggedList(std::list<TaggedListItem>& list, int offset, int& length) const
|
|
||||||
{
|
|
||||||
list.clear();
|
|
||||||
int startOffset = offset;
|
|
||||||
int numElem;
|
|
||||||
if (!get8(numElem, offset++)) return false;
|
|
||||||
for (int i = 0; i<numElem; ++i)
|
|
||||||
{
|
|
||||||
int tag, len;
|
|
||||||
std::vector<unsigned char> data;
|
|
||||||
if (!get8(tag, offset++)) return false;
|
|
||||||
if (!getVL(data, offset, len)) return false;
|
|
||||||
offset += len;
|
|
||||||
list.push_back(std::make_pair(tag, data));
|
|
||||||
}
|
|
||||||
length = offset - startOffset;
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool Serializer::getTaggedList(std::vector<TaggedListItem>& list, int offset, int& length) const
|
|
||||||
{
|
|
||||||
list.clear();
|
|
||||||
int startOffset = offset;
|
|
||||||
int numElem;
|
|
||||||
if (!get8(numElem, offset++)) return false;
|
|
||||||
for (int i = 0; i<numElem; ++i)
|
|
||||||
{
|
|
||||||
int tag, len;
|
|
||||||
std::vector<unsigned char> data;
|
|
||||||
if (!get8(tag, offset++)) return false;
|
|
||||||
if (!getVL(data, offset, len)) return false;
|
|
||||||
offset += len;
|
|
||||||
list.push_back(std::make_pair(tag, data));
|
|
||||||
}
|
|
||||||
length = offset - startOffset;
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
std::vector<unsigned char> Serializer::encodeVL(int length)
|
std::vector<unsigned char> Serializer::encodeVL(int length)
|
||||||
{
|
{
|
||||||
unsigned char lenBytes[4];
|
unsigned char lenBytes[4];
|
||||||
@@ -692,15 +596,6 @@ std::vector<unsigned char> SerializerIterator::getVL()
|
|||||||
return vl;
|
return vl;
|
||||||
}
|
}
|
||||||
|
|
||||||
std::vector<TaggedListItem> SerializerIterator::getTaggedList()
|
|
||||||
{
|
|
||||||
int length;
|
|
||||||
std::vector<TaggedListItem> tl;
|
|
||||||
if (!mSerializer.getTaggedList(tl, mPos, length)) throw std::runtime_error("invalid serializer getTL");
|
|
||||||
mPos += length;
|
|
||||||
return tl;
|
|
||||||
}
|
|
||||||
|
|
||||||
std::vector<unsigned char> SerializerIterator::getRaw(int iLength)
|
std::vector<unsigned char> SerializerIterator::getRaw(int iLength)
|
||||||
{
|
{
|
||||||
int iPos = mPos;
|
int iPos = mPos;
|
||||||
|
|||||||
@@ -11,8 +11,6 @@
|
|||||||
#include "uint256.h"
|
#include "uint256.h"
|
||||||
#include "FieldNames.h"
|
#include "FieldNames.h"
|
||||||
|
|
||||||
typedef std::pair<int, std::vector<unsigned char> > TaggedListItem;
|
|
||||||
|
|
||||||
class Serializer
|
class Serializer
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
@@ -46,10 +44,6 @@ public:
|
|||||||
int addVL(const std::vector<unsigned char> &vector);
|
int addVL(const std::vector<unsigned char> &vector);
|
||||||
int addVL(const std::string& string);
|
int addVL(const std::string& string);
|
||||||
int addVL(const void *ptr, int len);
|
int addVL(const void *ptr, int len);
|
||||||
int addTaggedList(const std::list<TaggedListItem>&);
|
|
||||||
int addTaggedList(const std::vector<TaggedListItem>&);
|
|
||||||
static int getTaggedListLength(const std::list<TaggedListItem>&);
|
|
||||||
static int getTaggedListLength(const std::vector<TaggedListItem>&);
|
|
||||||
|
|
||||||
// disassemble functions
|
// disassemble functions
|
||||||
bool get8(int&, int offset) const;
|
bool get8(int&, int offset) const;
|
||||||
@@ -66,8 +60,6 @@ public:
|
|||||||
|
|
||||||
bool getVL(std::vector<unsigned char>& objectVL, int offset, int& length) const;
|
bool getVL(std::vector<unsigned char>& objectVL, int offset, int& length) const;
|
||||||
bool getVLLength(int& length, int offset) const;
|
bool getVLLength(int& length, int offset) const;
|
||||||
bool getTaggedList(std::list<TaggedListItem>&, int offset, int& length) const;
|
|
||||||
bool getTaggedList(std::vector<TaggedListItem>&, int offset, int& length) const;
|
|
||||||
|
|
||||||
bool getFieldID(int& type, int& name, int offset) const;
|
bool getFieldID(int& type, int& name, int offset) const;
|
||||||
int addFieldID(int type, int name);
|
int addFieldID(int type, int name);
|
||||||
@@ -171,7 +163,6 @@ public:
|
|||||||
std::vector<unsigned char> getRaw(int iLength);
|
std::vector<unsigned char> getRaw(int iLength);
|
||||||
|
|
||||||
std::vector<unsigned char> getVL();
|
std::vector<unsigned char> getVL();
|
||||||
std::vector<TaggedListItem> getTaggedList();
|
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
Reference in New Issue
Block a user