Sunshine master
Self-hosted game stream host for Moonlight.
util::Hex< T > Class Template Reference

Formatter that exposes a value's bytes as hexadecimal text. More...

#include <src/utility.h>

Public Types

typedef T elem_type
 Integral type used for one formatted hex element.
 

Public Member Functions

char * begin ()
 Return an iterator to the first byte in the buffer view.
 
const char * begin () const
 Return an iterator to the first byte in the buffer view.
 
const char * cbegin () const
 Return a const iterator to the first byte in the view.
 
const char * cend () const
 Return a const iterator one past the last byte in the view.
 
char * end ()
 Return an iterator one past the final byte in the buffer view.
 
const char * end () const
 Return an iterator one past the final byte in the buffer view.
 
 Hex (const elem_type &elem, bool rev)
 Construct a hexadecimal byte view for the supplied value.
 
std::string to_string () const
 Convert to string.
 
std::string_view to_string_view () const
 Convert to string view.
 

Detailed Description

template<class T>
class util::Hex< T >

Formatter that exposes a value's bytes as hexadecimal text.

Constructor & Destructor Documentation

◆ Hex()

template<class T >
util::Hex< T >::Hex ( const elem_type & elem,
bool rev )
inline

Construct a hexadecimal byte view for the supplied value.

Parameters
elemElement value being serialized as bytes.
revWhether bytes should be emitted in reverse order.

Member Function Documentation

◆ begin() [1/2]

template<class T >
char * util::Hex< T >::begin ( )
inline

Return an iterator to the first byte in the buffer view.

Returns
Iterator to the first element.

◆ begin() [2/2]

template<class T >
const char * util::Hex< T >::begin ( ) const
inline

Return an iterator to the first byte in the buffer view.

Returns
Iterator to the first element.

◆ cbegin()

template<class T >
const char * util::Hex< T >::cbegin ( ) const
inline

Return a const iterator to the first byte in the view.

Returns
Pointer to the first formatted hexadecimal character.

◆ cend()

template<class T >
const char * util::Hex< T >::cend ( ) const
inline

Return a const iterator one past the last byte in the view.

Returns
Pointer one past the last formatted hexadecimal character.

◆ end() [1/2]

template<class T >
char * util::Hex< T >::end ( )
inline

Return an iterator one past the final byte in the buffer view.

Returns
Iterator one past the last element.

◆ end() [2/2]

template<class T >
const char * util::Hex< T >::end ( ) const
inline

Return an iterator one past the final byte in the buffer view.

Returns
Iterator one past the last element.

◆ to_string()

template<class T >
std::string util::Hex< T >::to_string ( ) const
inline

Convert to string.

Returns
Value converted to string.

◆ to_string_view()

template<class T >
std::string_view util::Hex< T >::to_string_view ( ) const
inline

Convert to string view.

Returns
Value converted to string view.

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