libmdbx  0.11.6.39 (2022-04-13T11:05:50+03:00)
One of the fastest compact embeddable key-value ACID database without WAL.
mdbx::to_hex Struct Reference

Hexadecimal encoder which satisfy SliceTranscoder concept. More...

#include <mdbx.h++>

Public Member Functions

MDBX_CXX11_CONSTEXPR to_hex (const slice &source, bool uppercase=false, unsigned wrap_width=0) noexcept
 
template<class ALLOCATOR = legacy_allocator>
string< ALLOCATOR > as_string (const ALLOCATOR &allocator=ALLOCATOR()) const
 Returns a string with a hexadecimal dump of a passed slice. More...
 
template<class ALLOCATOR = legacy_allocator, typename CAPACITY_POLICY = default_capacity_policy>
buffer< ALLOCATOR, CAPACITY_POLICY > as_buffer (const ALLOCATOR &allocator=ALLOCATOR()) const
 Returns a buffer with a hexadecimal dump of a passed slice. More...
 
MDBX_CXX11_CONSTEXPR size_t envisage_result_length () const noexcept
 Returns the buffer size in bytes needed for hexadecimal dump of a passed slice. More...
 
char * write_bytes (char *dest, size_t dest_size) const
 Fills the buffer by hexadecimal dump of a passed slice. More...
 
::std::ostream & output (::std::ostream &out) const
 Output hexadecimal dump of passed slice to the std::ostream. More...
 
bool is_empty () const noexcept
 Checks whether a passed slice is empty, and therefore there will be no output bytes. More...
 
bool is_erroneous () const noexcept
 Checks whether the content of a passed slice is a valid data and could be encoded or unexpectedly not. More...
 

Public Attributes

const slice source
 
const bool uppercase = false
 
const unsigned wrap_width = 0
 

Detailed Description

Hexadecimal encoder which satisfy SliceTranscoder concept.

Constructor & Destructor Documentation

◆ to_hex()

MDBX_CXX11_CONSTEXPR mdbx::to_hex::to_hex ( const slice source,
bool  uppercase = false,
unsigned  wrap_width = 0 
)
inlinenoexcept

Member Function Documentation

◆ as_buffer()

template<class ALLOCATOR = legacy_allocator, typename CAPACITY_POLICY = default_capacity_policy>
buffer<ALLOCATOR, CAPACITY_POLICY> mdbx::to_hex::as_buffer ( const ALLOCATOR &  allocator = ALLOCATOR()) const
inline

Returns a buffer with a hexadecimal dump of a passed slice.

◆ as_string()

template<class ALLOCATOR = legacy_allocator>
string<ALLOCATOR> mdbx::to_hex::as_string ( const ALLOCATOR &  allocator = ALLOCATOR()) const
inline

Returns a string with a hexadecimal dump of a passed slice.

◆ envisage_result_length()

MDBX_CXX11_CONSTEXPR size_t mdbx::to_hex::envisage_result_length ( ) const
inlinenoexcept

Returns the buffer size in bytes needed for hexadecimal dump of a passed slice.

◆ is_empty()

bool mdbx::to_hex::is_empty ( ) const
inlinenoexcept

Checks whether a passed slice is empty, and therefore there will be no output bytes.

◆ is_erroneous()

bool mdbx::to_hex::is_erroneous ( ) const
inlinenoexcept

Checks whether the content of a passed slice is a valid data and could be encoded or unexpectedly not.

◆ output()

::std::ostream& mdbx::to_hex::output ( ::std::ostream &  out) const

Output hexadecimal dump of passed slice to the std::ostream.

Exceptions
std::ios_base::failurecorresponding to std::ostream::write() behaviour.

◆ write_bytes()

char* mdbx::to_hex::write_bytes ( char *  dest,
size_t  dest_size 
) const

Fills the buffer by hexadecimal dump of a passed slice.

Exceptions
std::length_errorif given buffer is too small.

Member Data Documentation

◆ source

const slice mdbx::to_hex::source

◆ uppercase

const bool mdbx::to_hex::uppercase = false

◆ wrap_width

const unsigned mdbx::to_hex::wrap_width = 0

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