Bitcoin Core 29.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 std::span. More...

#include <streams.h>

Public Member Functions

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

Private Attributes

std::span< const unsigned char > m_data
 

Detailed Description

Minimal stream for reading from an existing byte array by std::span.

Definition at line 100 of file streams.h.

Constructor & Destructor Documentation

◆ SpanReader()

SpanReader::SpanReader ( std::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.

◆ ignore()

void SpanReader::ignore ( size_t  n)
inline

Definition at line 135 of file streams.h.

◆ 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 ( std::span< std::byte >  dst)
inline

Definition at line 121 of file streams.h.

◆ size()

size_t SpanReader::size ( ) const
inline

Definition at line 118 of file streams.h.

Member Data Documentation

◆ m_data

std::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: