mirror of
https://github.com/XRPLF/rippled.git
synced 2025-12-06 17:27:55 +00:00
Serializer improvements:
* Add getSlice() * Make getVLDataLength public
This commit is contained in:
@@ -353,6 +353,15 @@ public:
|
||||
void
|
||||
getFieldID (int& type, int& name);
|
||||
|
||||
// Returns the size of the VL if the
|
||||
// next object is a VL. Advances the iterator
|
||||
// to the beginning of the VL.
|
||||
int
|
||||
getVLDataLength ();
|
||||
|
||||
Slice
|
||||
getSlice (std::size_t bytes);
|
||||
|
||||
// VFALCO DEPRECATED Returns a copy
|
||||
Blob
|
||||
getRaw (int size);
|
||||
@@ -364,9 +373,6 @@ public:
|
||||
Buffer
|
||||
getVLBuffer();
|
||||
|
||||
private:
|
||||
int getVLDataLength ();
|
||||
|
||||
template<class T>
|
||||
T getRawHelper (int size);
|
||||
};
|
||||
|
||||
@@ -575,6 +575,19 @@ int SerialIter::getVLDataLength ()
|
||||
return datLen;
|
||||
}
|
||||
|
||||
Slice
|
||||
SerialIter::getSlice (std::size_t bytes)
|
||||
{
|
||||
if (bytes > remain_)
|
||||
throw std::runtime_error(
|
||||
"invalid SerialIter getSlice");
|
||||
Slice s(p_, bytes);
|
||||
p_ += bytes;
|
||||
used_ += bytes;
|
||||
remain_ -= bytes;
|
||||
return s;
|
||||
}
|
||||
|
||||
// VFALCO DEPRECATED Returns a copy
|
||||
Blob
|
||||
SerialIter::getVL()
|
||||
|
||||
Reference in New Issue
Block a user