Back to Site
Loading...
Searching...
No Matches
librats::ByteView Class Reference

Non-owning view over a contiguous run of bytes. More...

#include <bytes.h>

Public Member Functions

constexpr ByteView ()=default
 
constexpr ByteView (const uint8_t *data, size_t size)
 
 ByteView (const Bytes &b)
 
 ByteView (const std::string &s)
 
const uint8_t * data () const noexcept
 
size_t size () const noexcept
 
bool empty () const noexcept
 
const uint8_t * begin () const noexcept
 
const uint8_t * end () const noexcept
 
Bytes to_bytes () const
 

Detailed Description

Non-owning view over a contiguous run of bytes.

Definition at line 27 of file bytes.h.

Constructor & Destructor Documentation

◆ ByteView() [1/4]

constexpr librats::ByteView::ByteView ( )
constexprdefault

◆ ByteView() [2/4]

constexpr librats::ByteView::ByteView ( const uint8_t *  data,
size_t  size 
)
inlineconstexpr

Definition at line 30 of file bytes.h.

◆ ByteView() [3/4]

librats::ByteView::ByteView ( const Bytes b)
inline

Definition at line 31 of file bytes.h.

◆ ByteView() [4/4]

librats::ByteView::ByteView ( const std::string &  s)
inline

Definition at line 32 of file bytes.h.

Member Function Documentation

◆ begin()

const uint8_t * librats::ByteView::begin ( ) const
inlinenoexcept

Definition at line 39 of file bytes.h.

◆ data()

const uint8_t * librats::ByteView::data ( ) const
inlinenoexcept

Definition at line 35 of file bytes.h.

Referenced by librats::PeerId::from_public_key().

◆ empty()

bool librats::ByteView::empty ( ) const
inlinenoexcept

Definition at line 37 of file bytes.h.

◆ end()

const uint8_t * librats::ByteView::end ( ) const
inlinenoexcept

Definition at line 40 of file bytes.h.

◆ size()

size_t librats::ByteView::size ( ) const
inlinenoexcept

Definition at line 36 of file bytes.h.

Referenced by librats::PeerId::from_public_key().

◆ to_bytes()

Bytes librats::ByteView::to_bytes ( ) const
inline

Definition at line 42 of file bytes.h.


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