TARAXA
|
Class for writing to an RLP bytestream. More...
#include <RLP.h>
Public Member Functions | |
RLPStream () | |
Initializes empty RLPStream. More... | |
RLPStream (size_t _listItems) | |
Initializes the RLPStream as a list of _listItems items. More... | |
~RLPStream () | |
void | reserve (size_t cap_out, size_t cap_lists) |
template<typename N > | |
std::enable_if_t< is_integer< N >Signedness::signed_only), RLPStream & > | append (N const &_i) |
template<typename N > | |
std::enable_if_t< is_integer< N >Signedness::unsigned_only), RLPStream & > | append (N const &_i) |
RLPStream & | append (bool _i) |
RLPStream & | append (bytesConstRef _s, bool _compact=false) |
RLPStream & | append (bytes const &_s) |
RLPStream & | append (std::string const &_s) |
RLPStream & | append (char const *_s) |
template<unsigned N> | |
RLPStream & | append (FixedHash< N > _s, bool _compact=false, bool _allOrNothing=false) |
RLPStream & | append (RLP const &_rlp, size_t _itemCount=1) |
template<class _T > | |
RLPStream & | append (std::vector< _T > const &_s) |
Appends a sequence of data to the stream as a list. More... | |
template<class _T > | |
RLPStream & | appendVector (std::vector< _T > const &_s) |
template<class _T , size_t S> | |
RLPStream & | append (std::array< _T, S > const &_s) |
template<class _T > | |
RLPStream & | append (std::set< _T > const &_s) |
template<class _T > | |
RLPStream & | append (std::unordered_set< _T > const &_s) |
template<class T , class U > | |
RLPStream & | append (std::pair< T, U > const &_s) |
RLPStream & | appendList (size_t _items) |
Appends a list. More... | |
RLPStream & | appendList (bytesConstRef _rlp) |
RLPStream & | appendList (bytes const &_rlp) |
RLPStream & | appendList (RLPStream const &_s) |
RLPStream & | appendRaw (bytesConstRef _rlp, size_t _itemCount=1) |
Appends raw (pre-serialised) RLP data. Use with caution. More... | |
RLPStream & | appendRaw (bytes const &_rlp, size_t _itemCount=1) |
template<class T > | |
RLPStream & | operator<< (T _data) |
Shift operators for appending data items. More... | |
void | clear () |
Clear the output stream so far. More... | |
bytes const & | out () const |
Read the byte stream. More... | |
bytes && | invalidate () |
Invalidate the object and steal the output byte stream. More... | |
void | swapOut (bytes &_dest) |
Swap the contents of the output stream out for some other byte array. More... | |
Private Member Functions | |
template<typename N > | |
RLPStream & | append_int_ (N const &_i) |
RLPStream & | append_int_ (bool _i) |
void | noteAppended (size_t _itemCount=1) |
void | pushCount (size_t _count, ::byte _offset) |
template<class _T > | |
void | pushInt (_T _i, size_t _br) |
Push an integer as a raw big-endian byte-stream. More... | |
Private Attributes | |
bytes | m_out |
Our output byte stream. More... | |
std::vector< std::pair< size_t, size_t > > | m_listStack |
Class for writing to an RLP bytestream.
|
inline |
Initializes empty RLPStream.
|
inlineexplicit |
Initializes the RLPStream as a list of _listItems items.
|
inline |
|
inline |
RLPStream & RLPStream::append | ( | bytesConstRef | _s, |
bool | _compact = false |
||
) |
|
inline |
|
inline |
|
inline |
|
inline |
Appends an arbitrary RLP fragment - this must be a single item unless _itemCount is given.
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
Appends a sequence of data to the stream as a list.
|
inlineprivate |
|
inlineprivate |
RLPStream & RLPStream::appendList | ( | bytesConstRef | _rlp | ) |
RLPStream & RLPStream::appendList | ( | size_t | _items | ) |
Appends a list.
RLPStream & RLPStream::appendRaw | ( | bytesConstRef | _rlp, |
size_t | _itemCount = 1 |
||
) |
Appends raw (pre-serialised) RLP data. Use with caution.
|
inline |
|
inline |
Clear the output stream so far.
|
inline |
Invalidate the object and steal the output byte stream.
|
private |
|
inline |
Shift operators for appending data items.
|
inline |
Read the byte stream.
|
private |
Push the node-type byte (using _base) along with the item count _count.
|
inlineprivate |
Push an integer as a raw big-endian byte-stream.
void RLPStream::reserve | ( | size_t | cap_out, |
size_t | cap_lists | ||
) |
|
inline |
Swap the contents of the output stream out for some other byte array.
|
private |
|
private |
Our output byte stream.