22 m_values.push_back(val);
28 return m_values.at(idx);
32 return m_buffer.
data();
37 return m_values.size();
39 return m_buffer.
size();
Buffer to store and retrieve byte data.
auto data() -> void *
Returns a raw pointer to the start of the buffer data.
void clear()
Removes any existing content in the buffer making its size 0.
void extend(size_t len)
Extends the size of the buffer by the given length.
auto size() const -> size_t
Returns the number of bytes contained in the buffer.
This class contains a value that can be serialized into, or was deserialized from,...
void assign(const buffer &data)
Assigns the given data to the internal buffer of this rlp_value can only be used for rlp_value instan...
auto type() const -> rlp_value_type
Get the type of rlp_value.
auto value_at(size_t idx) const -> rlp_value
Returns the rlp_value at the given index for RLP values of type rlp_value_type::array.
auto push_back(const rlp_value &val) -> bool
Pushes an rlp_value into an rlp_value of type rlp_value_type::array You can push both rlp_value_type:...
auto data() const -> const void *
Returns a raw pointer to the start of the buffer data for rlp_value of type rlp_buffer.
auto size() const -> size_t
Get the size of the rlp_value.
rlp_value()
Default constructor. Sets m_type to rlp_value_type::buffer.
rlp_value_type
Possible types for an RLP value.
@ array
A collection of RLP values.