Class for writing to an RLP bytestream.
More...
#include <RLP.h>
|
| RLPStream () |
| Initializes empty RLPStream. More...
|
|
| RLPStream (size_t _listItems) |
| Initializes the RLPStream as a list of _listItems items. More...
|
|
| ~RLPStream () |
|
RLPStream & | append (unsigned _s) |
| Append given datum to the byte stream. More...
|
|
RLPStream & | append (u160 _s) |
|
RLPStream & | append (u256 _s) |
|
RLPStream & | append (bigint _s) |
|
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) |
| Appends an arbitrary RLP fragment - this must be a single item unless _itemCount is given. More...
|
|
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...
|
|
|
void | noteAppended (size_t _itemCount=1) |
|
void | pushCount (size_t _count, byte _offset) |
| Push the node-type byte (using _base) along with the item count _count. More...
|
|
template<class _T > |
void | pushInt (_T _i, size_t _br) |
| Push an integer as a raw big-endian byte-stream. More...
|
|
Class for writing to an RLP bytestream.
Definition at line 383 of file RLP.h.
dev::RLPStream::RLPStream |
( |
| ) |
|
|
inline |
dev::RLPStream::RLPStream |
( |
size_t |
_listItems | ) |
|
|
inlineexplicit |
Initializes the RLPStream as a list of _listItems items.
Definition at line 390 of file RLP.h.
dev::RLPStream::~RLPStream |
( |
| ) |
|
|
inline |
RLPStream& dev::RLPStream::append |
( |
unsigned |
_s | ) |
|
|
inline |
Append given datum to the byte stream.
Definition at line 395 of file RLP.h.
RLPStream& dev::RLPStream::append |
( |
std::string const & |
_s | ) |
|
|
inline |
RLPStream& dev::RLPStream::append |
( |
char const * |
_s | ) |
|
|
inline |
template<unsigned N>
RLPStream& dev::RLPStream::append |
( |
FixedHash< N > |
_s, |
|
|
bool |
_compact = false , |
|
|
bool |
_allOrNothing = false |
|
) |
| |
|
inline |
RLPStream& dev::RLPStream::append |
( |
RLP const & |
_rlp, |
|
|
size_t |
_itemCount = 1 |
|
) |
| |
|
inline |
Appends an arbitrary RLP fragment - this must be a single item unless _itemCount is given.
Definition at line 406 of file RLP.h.
template<class _T >
RLPStream& dev::RLPStream::append |
( |
std::vector< _T > const & |
_s | ) |
|
|
inline |
Appends a sequence of data to the stream as a list.
Definition at line 409 of file RLP.h.
template<class _T , size_t S>
RLPStream& dev::RLPStream::append |
( |
std::array< _T, S > const & |
_s | ) |
|
|
inline |
template<class _T >
RLPStream& dev::RLPStream::append |
( |
std::set< _T > const & |
_s | ) |
|
|
inline |
template<class _T >
RLPStream& dev::RLPStream::append |
( |
std::unordered_set< _T > const & |
_s | ) |
|
|
inline |
template<class T , class U >
RLPStream& dev::RLPStream::append |
( |
std::pair< T, U > const & |
_s | ) |
|
|
inline |
RLPStream & RLPStream::appendList |
( |
size_t |
_items | ) |
|
Appends a list.
Definition at line 276 of file RLP.cpp.
Appends raw (pre-serialised) RLP data. Use with caution.
Definition at line 230 of file RLP.cpp.
RLPStream& dev::RLPStream::appendRaw |
( |
bytes const & |
_rlp, |
|
|
size_t |
_itemCount = 1 |
|
) |
| |
|
inline |
template<class _T >
RLPStream& dev::RLPStream::appendVector |
( |
std::vector< _T > const & |
_s | ) |
|
|
inline |
void dev::RLPStream::clear |
( |
| ) |
|
|
inline |
Clear the output stream so far.
Definition at line 430 of file RLP.h.
bytes&& dev::RLPStream::invalidate |
( |
| ) |
|
|
inline |
Invalidate the object and steal the output byte stream.
Definition at line 436 of file RLP.h.
void RLPStream::noteAppended |
( |
size_t |
_itemCount = 1 | ) |
|
|
private |
Shift operators for appending data items.
Definition at line 427 of file RLP.h.
bytes const& dev::RLPStream::out |
( |
| ) |
const |
|
inline |
Read the byte stream.
Definition at line 433 of file RLP.h.
void RLPStream::pushCount |
( |
size_t |
_count, |
|
|
byte |
_offset |
|
) |
| |
|
private |
Push the node-type byte (using _base) along with the item count _count.
- _count is number of characters for strings, data-bytes for ints, or items for lists.
Definition at line 342 of file RLP.cpp.
template<class _T >
void dev::RLPStream::pushInt |
( |
_T |
_i, |
|
|
size_t |
_br |
|
) |
| |
|
inlineprivate |
Push an integer as a raw big-endian byte-stream.
Definition at line 449 of file RLP.h.
void dev::RLPStream::swapOut |
( |
bytes & |
_dest | ) |
|
|
inline |
Swap the contents of the output stream out for some other byte array.
Definition at line 439 of file RLP.h.
std::vector<std::pair<size_t, size_t> > dev::RLPStream::m_listStack |
|
private |
bytes dev::RLPStream::m_out |
|
private |
Our output byte stream.
Definition at line 458 of file RLP.h.
The documentation for this class was generated from the following files:
- src/cpp-ethereum/libdevcore/RLP.h
- src/cpp-ethereum/libdevcore/RLP.cpp