Bitcoin Core 28.99.0
P2P Digital Currency
|
Double ended buffer combining vector and stream-like interfaces. More...
#include <streams.h>
Public Types | |
typedef vector_type::allocator_type | allocator_type |
typedef vector_type::size_type | size_type |
typedef vector_type::difference_type | difference_type |
typedef vector_type::reference | reference |
typedef vector_type::const_reference | const_reference |
typedef vector_type::value_type | value_type |
typedef vector_type::iterator | iterator |
typedef vector_type::const_iterator | const_iterator |
typedef vector_type::reverse_iterator | reverse_iterator |
Public Member Functions | |
DataStream ()=default | |
DataStream (Span< const uint8_t > sp) | |
DataStream (Span< const value_type > sp) | |
std::string | str () const |
const_iterator | begin () const |
iterator | begin () |
const_iterator | end () const |
iterator | end () |
size_type | size () const |
bool | empty () const |
void | resize (size_type n, value_type c=value_type{}) |
void | reserve (size_type n) |
const_reference | operator[] (size_type pos) const |
reference | operator[] (size_type pos) |
void | clear () |
value_type * | data () |
const value_type * | data () const |
void | Compact () |
bool | Rewind (std::optional< size_type > n=std::nullopt) |
bool | eof () const |
int | in_avail () const |
void | read (Span< value_type > dst) |
void | ignore (size_t num_ignore) |
void | write (Span< const value_type > src) |
template<typename T > | |
DataStream & | operator<< (const T &obj) |
template<typename T > | |
DataStream & | operator>> (T &&obj) |
void | Xor (const std::vector< unsigned char > &key) |
XOR the contents of this stream with a certain key. More... | |
size_t | GetMemoryUsage () const noexcept |
Compute total memory usage of this object (own memory + any dynamic memory). More... | |
Protected Types | |
using | vector_type = SerializeData |
Protected Attributes | |
vector_type | vch |
vector_type::size_type | m_read_pos {0} |
Double ended buffer combining vector and stream-like interfaces.
and << read and write unformatted data using the above serialization templates.
Fills with data in linear time; some stringstream implementations take N^2 time.
typedef vector_type::allocator_type DataStream::allocator_type |
typedef vector_type::const_iterator DataStream::const_iterator |
typedef vector_type::const_reference DataStream::const_reference |
typedef vector_type::difference_type DataStream::difference_type |
typedef vector_type::iterator DataStream::iterator |
typedef vector_type::reference DataStream::reference |
typedef vector_type::reverse_iterator DataStream::reverse_iterator |
typedef vector_type::size_type DataStream::size_type |
typedef vector_type::value_type DataStream::value_type |
|
protected |
|
explicitdefault |
|
inlineexplicit |
|
inlineexplicit |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
noexcept |
Compute total memory usage of this object (own memory + any dynamic memory).
Definition at line 115 of file streams.cpp.
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
protected |
|
protected |