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_base64 Struct Reference

Base64 encoder which satisfy SliceTranscoder concept. More...

#include <mdbx.h++>

Public Member Functions

MDBX_CXX11_CONSTEXPR to_base64 (const slice &source, unsigned wrap_width=0) noexcept
 
template<class ALLOCATOR = legacy_allocator>
string< ALLOCATOR > as_string (const ALLOCATOR &allocator=ALLOCATOR()) const
 Returns a string with a Base64 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 Base64 dump of a passed slice. More...
 
MDBX_CXX11_CONSTEXPR size_t envisage_result_length () const noexcept
 Returns the buffer size in bytes needed for Base64 dump of passed slice. More...
 
char * write_bytes (char *dest, size_t dest_size) const
 Fills the buffer by Base64 dump of passed slice. More...
 
::std::ostream & output (::std::ostream &out) const
 Output Base64 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 unsigned wrap_width = 0
 

Detailed Description

Base64 encoder which satisfy SliceTranscoder concept.

Constructor & Destructor Documentation

◆ to_base64()

MDBX_CXX11_CONSTEXPR mdbx::to_base64::to_base64 ( const slice source,
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_base64::as_buffer ( const ALLOCATOR &  allocator = ALLOCATOR()) const
inline

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

◆ as_string()

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

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

◆ envisage_result_length()

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

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

◆ is_empty()

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

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

◆ is_erroneous()

bool mdbx::to_base64::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_base64::output ( ::std::ostream &  out) const

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

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

◆ write_bytes()

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

Fills the buffer by Base64 dump of passed slice.

Exceptions
std::length_errorif given buffer is too small.

Member Data Documentation

◆ source

const slice mdbx::to_base64::source

◆ wrap_width

const unsigned mdbx::to_base64::wrap_width = 0

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