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::from_hex Struct Reference

Hexadecimal decoder which satisfy SliceTranscoder concept. More...

#include <mdbx.h++>

Public Member Functions

MDBX_CXX11_CONSTEXPR from_hex (const slice &source, bool ignore_spaces=false) noexcept
 
template<class ALLOCATOR = legacy_allocator>
string< ALLOCATOR > as_string (const ALLOCATOR &allocator=ALLOCATOR()) const
 Decodes hexadecimal dump from a passed slice to returned string. More...
 
template<class ALLOCATOR = legacy_allocator, typename CAPACITY_POLICY = default_capacity_policy>
buffer< ALLOCATOR, CAPACITY_POLICY > as_buffer (const ALLOCATOR &allocator=ALLOCATOR()) const
 Decodes hexadecimal dump from a passed slice to returned buffer. More...
 
MDBX_CXX11_CONSTEXPR size_t envisage_result_length () const noexcept
 Returns the number of bytes needed for conversion hexadecimal dump from a passed slice to decoded data. More...
 
char * write_bytes (char *dest, size_t dest_size) const
 Fills the destination with data decoded from hexadecimal dump from a passed slice. 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 hexadecimal dump, and therefore there could be decoded or not. More...
 

Public Attributes

const slice source
 
const bool ignore_spaces = false
 

Detailed Description

Hexadecimal decoder which satisfy SliceTranscoder concept.

Constructor & Destructor Documentation

◆ from_hex()

MDBX_CXX11_CONSTEXPR mdbx::from_hex::from_hex ( const slice source,
bool  ignore_spaces = false 
)
inlinenoexcept

Member Function Documentation

◆ as_buffer()

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

Decodes hexadecimal dump from a passed slice to returned buffer.

◆ as_string()

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

Decodes hexadecimal dump from a passed slice to returned string.

◆ envisage_result_length()

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

Returns the number of bytes needed for conversion hexadecimal dump from a passed slice to decoded data.

◆ is_empty()

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

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

◆ is_erroneous()

bool mdbx::from_hex::is_erroneous ( ) const
noexcept

Checks whether the content of a passed slice is a valid hexadecimal dump, and therefore there could be decoded or not.

◆ write_bytes()

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

Fills the destination with data decoded from hexadecimal dump from a passed slice.

Exceptions
std::length_errorif given buffer is too small.

Member Data Documentation

◆ ignore_spaces

const bool mdbx::from_hex::ignore_spaces = false

◆ source

const slice mdbx::from_hex::source

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