Hyper API for C++ 0.0.18825
Hyper client library for C++ applications
Loading...
Searching...
No Matches
hyperapi::ByteSpan Struct Reference

An arbitrarily-sized binary value. More...

#include <ByteSpan.hpp>

Public Member Functions

 ByteSpan (const uint8_t *data, size_t size) noexcept
 Constructor.
 
 ByteSpan (const std::vector< uint8_t > &bytes) noexcept
 Constructor.
 
std::string toString () const
 Returns a string representation of the binary data.
 

Public Attributes

const uint8_t * data
 The start of the binary data.
 
size_t size
 The size of the data.
 

Detailed Description

An arbitrarily-sized binary value.

Definition at line 20 of file ByteSpan.hpp.

Constructor & Destructor Documentation

◆ ByteSpan() [1/2]

hyperapi::ByteSpan::ByteSpan ( const uint8_t *  data,
size_t  size 
)
inlinenoexcept

Constructor.

Definition at line 27 of file ByteSpan.hpp.

◆ ByteSpan() [2/2]

hyperapi::ByteSpan::ByteSpan ( const std::vector< uint8_t > &  bytes)
inlinenoexcept

Constructor.

Definition at line 30 of file ByteSpan.hpp.

Member Function Documentation

◆ toString()

std::string hyperapi::ByteSpan::toString ( ) const

Returns a string representation of the binary data.

The binary data is printed byte-wise. All printable bytes (according to std::isprint()) are printed as is. All other bytes are printed as escaped hexadecimal characters (e.g.: \\x04).

Returns
a string representation of the binary data.

Member Data Documentation

◆ data

const uint8_t* hyperapi::ByteSpan::data

The start of the binary data.

Definition at line 22 of file ByteSpan.hpp.

◆ size

size_t hyperapi::ByteSpan::size

The size of the data.

Definition at line 24 of file ByteSpan.hpp.


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