Bitcoin Core 31.0.0
P2P Digital Currency
Loading...
Searching...
No Matches
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)
 SpanReader (std::span< const std::byte > 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 std::byte > m_data

Detailed Description

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

Definition at line 82 of file streams.h.

Constructor & Destructor Documentation

◆ SpanReader() [1/2]

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

Definition at line 91 of file streams.h.

Here is the caller graph for this function:

◆ SpanReader() [2/2]

SpanReader::SpanReader ( std::span< const std::byte > data)
inlineexplicit

Definition at line 92 of file streams.h.

Member Function Documentation

◆ empty()

bool SpanReader::empty ( ) const
inline

Definition at line 102 of file streams.h.

Here is the caller graph for this function:

◆ ignore()

void SpanReader::ignore ( size_t n)
inline

Definition at line 118 of file streams.h.

◆ operator>>()

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

Definition at line 95 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 104 of file streams.h.

◆ size()

size_t SpanReader::size ( ) const
inline

Definition at line 101 of file streams.h.

Here is the caller graph for this function:

Member Data Documentation

◆ m_data

std::span<const std::byte> SpanReader::m_data
private

Definition at line 85 of file streams.h.


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