mirror of
https://github.com/XRPLF/rippled.git
synced 2025-12-06 17:27:55 +00:00
Access base_uint through public members (RIPD-898):
* Updates many (but probably not all) locations that access base_uint private storage. * More calls to access base_uint through members. * Use an iterator to write Serializer collections.
This commit is contained in:
@@ -107,6 +107,8 @@ public:
|
||||
|
||||
int addVL (Blob const& vector);
|
||||
int addVL (Slice const& slice);
|
||||
template<class Iter>
|
||||
int addVL (Iter begin, Iter end, int len);
|
||||
int addVL (const void* ptr, int len);
|
||||
|
||||
// disassemble functions
|
||||
@@ -280,6 +282,21 @@ private:
|
||||
int addEncoded (int length);
|
||||
};
|
||||
|
||||
template<class Iter>
|
||||
int Serializer::addVL(Iter begin, Iter end, int len)
|
||||
{
|
||||
int ret = addEncoded(len);
|
||||
for (; begin != end; ++begin)
|
||||
{
|
||||
addRaw(begin->data(), begin->size());
|
||||
#ifndef NDEBUG
|
||||
len -= begin->size();
|
||||
#endif
|
||||
}
|
||||
assert(len == 0);
|
||||
return ret;
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
// DEPRECATED
|
||||
|
||||
Reference in New Issue
Block a user