esphome-api-client 0.5.0
Modern C++17 client for the ESPHome native API (plaintext + Noise)
Loading...
Searching...
No Matches
Public Member Functions | List of all members
esphome::api::ByteView Class Reference

Non-owning view over a contiguous run of bytes (a C++17 stand-in for std::span<const std::uint8_t>). More...

#include <bytes.hpp>

Public Member Functions

constexpr ByteView () noexcept=default
 
constexpr ByteView (const std::uint8_t *data, const std::size_t size) noexcept
 
 ByteView (const ByteBuffer &buf) noexcept
 
constexpr const std::uint8_t * data () const noexcept
 
constexpr std::size_t size () const noexcept
 
constexpr bool empty () const noexcept
 
constexpr const std::uint8_t * begin () const noexcept
 
constexpr const std::uint8_t * end () const noexcept
 
constexpr std::uint8_t operator[] (const std::size_t i) const noexcept
 
ByteView subview (const std::size_t offset) const noexcept
 Sub-view starting at offset (clamped) spanning the remaining bytes.
 

Detailed Description

Non-owning view over a contiguous run of bytes (a C++17 stand-in for std::span<const std::uint8_t>).

The viewed storage must outlive the view.

Constructor & Destructor Documentation

◆ ByteView() [1/3]

constexpr esphome::api::ByteView::ByteView ( )
constexprdefaultnoexcept

◆ ByteView() [2/3]

constexpr esphome::api::ByteView::ByteView ( const std::uint8_t *  data,
const std::size_t  size 
)
inlineconstexprnoexcept

◆ ByteView() [3/3]

esphome::api::ByteView::ByteView ( const ByteBuffer buf)
inlinenoexcept

Member Function Documentation

◆ begin()

constexpr const std::uint8_t * esphome::api::ByteView::begin ( ) const
inlineconstexprnoexcept

◆ data()

constexpr const std::uint8_t * esphome::api::ByteView::data ( ) const
inlineconstexprnoexcept

◆ empty()

constexpr bool esphome::api::ByteView::empty ( ) const
inlineconstexprnoexcept

◆ end()

constexpr const std::uint8_t * esphome::api::ByteView::end ( ) const
inlineconstexprnoexcept

◆ operator[]()

constexpr std::uint8_t esphome::api::ByteView::operator[] ( const std::size_t  i) const
inlineconstexprnoexcept

◆ size()

constexpr std::size_t esphome::api::ByteView::size ( ) const
inlineconstexprnoexcept

◆ subview()

ByteView esphome::api::ByteView::subview ( const std::size_t  offset) const
inlinenoexcept

Sub-view starting at offset (clamped) spanning the remaining bytes.


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