Bitcoin Core  27.99.0
P2P Digital Currency
Public Member Functions | Private Attributes | List of all members
SpanReader Class Reference

Minimal stream for reading from an existing byte array by Span. More...

#include <streams.h>

Collaboration diagram for SpanReader:
[legend]

Public Member Functions

 SpanReader (Span< const unsigned char > data)
 
template<typename T >
SpanReaderoperator>> (T &&obj)
 
size_t size () const
 
bool empty () const
 
void read (Span< std::byte > dst)
 
void ignore (size_t n)
 

Private Attributes

Span< const unsigned char > m_data
 

Detailed Description

Minimal stream for reading from an existing byte array by Span.

Definition at line 100 of file streams.h.

Constructor & Destructor Documentation

◆ SpanReader()

SpanReader::SpanReader ( Span< const unsigned char >  data)
inlineexplicit
Parameters
[in]dataReferenced byte vector to overwrite/append

Definition at line 109 of file streams.h.

Member Function Documentation

◆ empty()

bool SpanReader::empty ( ) const
inline

Definition at line 119 of file streams.h.

Here is the call graph for this function:

◆ ignore()

void SpanReader::ignore ( size_t  n)
inline

Definition at line 135 of file streams.h.

Here is the call graph for this function:

◆ operator>>()

template<typename T >
SpanReader& SpanReader::operator>> ( T &&  obj)
inline

Definition at line 112 of file streams.h.

Here is the call graph for this function:

◆ read()

void SpanReader::read ( Span< std::byte >  dst)
inline

Definition at line 121 of file streams.h.

Here is the call graph for this function:

◆ size()

size_t SpanReader::size ( ) const
inline

Definition at line 118 of file streams.h.

Here is the call graph for this function:

Member Data Documentation

◆ m_data

Span<const unsigned char> SpanReader::m_data
private

Definition at line 103 of file streams.h.


The documentation for this class was generated from the following file: