libmdbx 0.13.2.20 (2024-12-20T11:46:01+03:00)
One of the fastest compact embeddable key-value ACID storage engine without WAL.
 
Loading...
Searching...
No Matches
slices and buffers

Namespaces

namespace  mdbx::allocation_aware_details
 

Concepts

concept  mdbx::MutableByteProducer
 
concept  mdbx::ImmutableByteProducer
 
concept  mdbx::SliceTranscoder
 

Classes

struct  mdbx::slice
 References a data located outside the slice. More...
 
struct  mdbx::default_capacity_policy
 
struct  mdbx::to_hex
 Hexadecimal encoder which satisfy SliceTranscoder concept. More...
 
struct  mdbx::to_base58
 Base58 encoder which satisfy SliceTranscoder concept. More...
 
struct  mdbx::to_base64
 Base64 encoder which satisfy SliceTranscoder concept. More...
 
struct  mdbx::from_hex
 Hexadecimal decoder which satisfy SliceTranscoder concept. More...
 
struct  mdbx::from_base58
 Base58 decoder which satisfy SliceTranscoder concept. More...
 
struct  mdbx::from_base64
 Base64 decoder which satisfy SliceTranscoder concept. More...
 
class  mdbx::buffer< ALLOCATOR, CAPACITY_POLICY >
 The chunk of data stored inside the buffer or located outside it. More...
 
struct  mdbx::value_result
 Combines data slice with boolean flag to represent result of certain operations. More...
 
struct  mdbx::pair
 Combines pair of slices for key and value to represent result of certain operations. More...
 
struct  mdbx::pair_result
 Combines pair of slices for key and value with boolean flag to represent result of certain operations. More...
 
struct  mdbx::buffer_pair_spec< ALLOCATOR, CAPACITY_POLICY >
 
interface  MutableByteProducer
 MutableByteProducer C++20 concept. More...
 
interface  ImmutableByteProducer
 ImmutableByteProducer C++20 concept. More...
 
interface  SliceTranscoder
 SliceTranscoder C++20 concept. More...
 

Typedefs

template<typename BUFFER >
using mdbx::buffer_pair = buffer_pair_spec<typename BUFFER::allocator_type, typename BUFFER::reservation_policy>
 

Functions

template<class ALLOCATOR = default_allocator, typename CAPACITY_POLICY = default_capacity_policy, MutableByteProducer PRODUCER>
buffer< ALLOCATOR, CAPACITY_POLICY > mdbx::make_buffer (PRODUCER &producer, const ALLOCATOR &allocator=ALLOCATOR())
 
template<class ALLOCATOR = default_allocator, typename CAPACITY_POLICY = default_capacity_policy, ImmutableByteProducer PRODUCER>
buffer< ALLOCATOR, CAPACITY_POLICY > mdbx::make_buffer (const PRODUCER &producer, const ALLOCATOR &allocator=ALLOCATOR())
 
template<class ALLOCATOR = default_allocator, MutableByteProducer PRODUCER>
string< ALLOCATOR > mdbx::make_string (PRODUCER &producer, const ALLOCATOR &allocator=ALLOCATOR())
 
template<class ALLOCATOR = default_allocator, ImmutableByteProducer PRODUCER>
string< ALLOCATOR > mdbx::make_string (const PRODUCER &producer, const ALLOCATOR &allocator=ALLOCATOR())
 
inline ::std::ostream & mdbx::operator<< (::std::ostream &out, const to_hex &wrapper)
 
inline ::std::ostream & mdbx::operator<< (::std::ostream &out, const to_base58 &wrapper)
 
inline ::std::ostream & mdbx::operator<< (::std::ostream &out, const to_base64 &wrapper)
 

Detailed Description


Class Documentation

◆ mdbx::slice

struct mdbx::slice

References a data located outside the slice.

The slice is similar in many ways to std::string_view, but it implements specific capabilities and manipulates with bytes but not a characters.

See also
mdbx::slice
mdbx::buffer

Values returned from the table are valid only until a subsequent update operation, or the end of the transaction. Do not modify or free them, they commonly point into the database itself.

Key sizes must be between 0 and mdbx_env_get_maxkeysize() inclusive. The same applies to data sizes in tables with the MDBX_DUPSORT flag. Other data items can in theory be from 0 to MDBX_MAXDATASIZE bytes long.

Note
The notable difference between MDBX and LMDB is that MDBX support zero length keys.

Inherits MDBX_val.

Public Types

enum  { max_length = MDBX_MAXDATASIZE }
 

Public Member Functions

constexpr slice () noexcept
 Create an empty slice.
 
constexpr slice (const void *ptr, size_t bytes)
 Create a slice that refers to [0,bytes-1] of memory bytes pointed by ptr.
 
constexpr slice (const void *begin, const void *end)
 Create a slice that refers to [begin,end] of memory bytes.
 
template<size_t SIZE>
constexpr slice (const char(&text)[SIZE])
 Create a slice that refers to text[0,strlen(text)-1].
 
constexpr slice (const char *c_str)
 Create a slice that refers to c_str[0,strlen(c_str)-1].
 
template<class CHAR , class T , class A >
constexpr slice (const ::std::basic_string< CHAR, T, A > &str)
 Create a slice that refers to the contents of "str".
 
constexpr slice (const MDBX_val &src)
 
constexpr slice (const slice &) noexcept=default
 
constexpr slice (MDBX_val &&src)
 
constexpr slice (slice &&src) noexcept
 
template<typename POD >
constexpr slice (const ::std::span< POD > &span)
 
template<typename POD >
constexpr ::std::span< const POD > as_span () const
 
template<typename POD >
constexpr ::std::span< POD > as_span ()
 
constexpr ::std::span< const bytebytes () const
 
constexpr ::std::span< bytebytes ()
 
constexpr ::std::span< const char > chars () const
 
constexpr ::std::span< char > chars ()
 
template<class CHAR , class T >
constexpr slice (const ::std::basic_string_view< CHAR, T > &sv)
 Create a slice that refers to the same contents as "string_view".
 
template<class CHAR , class T >
 slice (::std::basic_string_view< CHAR, T > &&sv)
 
sliceassign (const void *ptr, size_t bytes)
 
sliceassign (const slice &src) noexcept
 
sliceassign (const ::MDBX_val &src)
 
sliceassign (slice &&src) noexcept
 
sliceassign (::MDBX_val &&src)
 
sliceassign (const void *begin, const void *end)
 
template<class CHAR , class T , class ALLOCATOR >
sliceassign (const ::std::basic_string< CHAR, T, ALLOCATOR > &str)
 
sliceassign (const char *c_str)
 
template<class CHAR , class T >
sliceassign (const ::std::basic_string_view< CHAR, T > &view)
 
template<class CHAR , class T >
sliceassign (::std::basic_string_view< CHAR, T > &&view)
 
sliceoperator= (const slice &) noexcept=default
 
sliceoperator= (slice &&src) noexcept
 
sliceoperator= (::MDBX_val &&src)
 
 operator MDBX_val * () noexcept
 
 operator const MDBX_val * () const noexcept
 
template<class CHAR , class T >
sliceoperator= (const ::std::basic_string_view< CHAR, T > &view)
 
template<class CHAR , class T >
sliceoperator= (::std::basic_string_view< CHAR, T > &&view)
 
template<class CHAR = char, class T = ::std::char_traits<CHAR>>
constexpr ::std::basic_string_view< CHAR, T > string_view () const noexcept
 Return a string_view that references the same data as this slice.
 
template<class CHAR , class T >
constexpr operator::std::basic_string_view () const noexcept
 Return a string_view that references the same data as this slice.
 
template<class CHAR = char, class T = ::std::char_traits<CHAR>, class ALLOCATOR = default_allocator>
constexpr ::std::basic_string< CHAR, T, ALLOCATOR > as_string (const ALLOCATOR &allocator=ALLOCATOR()) const
 
template<class CHAR , class T , class ALLOCATOR >
constexpr operator::std::basic_string () const
 
template<class ALLOCATOR = default_allocator>
string< ALLOCATOR > as_hex_string (bool uppercase=false, unsigned wrap_width=0, const ALLOCATOR &allocator=ALLOCATOR()) const
 Returns a string with a hexadecimal dump of the slice content.
 
template<class ALLOCATOR = default_allocator>
string< ALLOCATOR > as_base58_string (unsigned wrap_width=0, const ALLOCATOR &allocator=ALLOCATOR()) const
 Returns a string with a Base58 dump of the slice content.
 
template<class ALLOCATOR = default_allocator>
string< ALLOCATOR > as_base64_string (unsigned wrap_width=0, const ALLOCATOR &allocator=ALLOCATOR()) const
 Returns a string with a Base58 dump of the slice content.
 
template<class ALLOCATOR = default_allocator, class CAPACITY_POLICY = default_capacity_policy>
buffer< ALLOCATOR, CAPACITY_POLICY > encode_hex (bool uppercase=false, unsigned wrap_width=0, const ALLOCATOR &allocator=ALLOCATOR()) const
 Returns a buffer with a hexadecimal dump of the slice content.
 
template<class ALLOCATOR = default_allocator, class CAPACITY_POLICY = default_capacity_policy>
buffer< ALLOCATOR, CAPACITY_POLICY > encode_base58 (unsigned wrap_width=0, const ALLOCATOR &allocator=ALLOCATOR()) const
 Returns a buffer with a Base58 dump of the slice content.
 
template<class ALLOCATOR = default_allocator, class CAPACITY_POLICY = default_capacity_policy>
buffer< ALLOCATOR, CAPACITY_POLICY > encode_base64 (unsigned wrap_width=0, const ALLOCATOR &allocator=ALLOCATOR()) const
 Returns a buffer with a Base64 dump of the slice content.
 
template<class ALLOCATOR = default_allocator, class CAPACITY_POLICY = default_capacity_policy>
buffer< ALLOCATOR, CAPACITY_POLICY > hex_decode (bool ignore_spaces=false, const ALLOCATOR &allocator=ALLOCATOR()) const
 Decodes hexadecimal dump from the slice content to returned buffer.
 
template<class ALLOCATOR = default_allocator, class CAPACITY_POLICY = default_capacity_policy>
buffer< ALLOCATOR, CAPACITY_POLICY > base58_decode (bool ignore_spaces=false, const ALLOCATOR &allocator=ALLOCATOR()) const
 Decodes Base58 dump from the slice content to returned buffer.
 
template<class ALLOCATOR = default_allocator, class CAPACITY_POLICY = default_capacity_policy>
buffer< ALLOCATOR, CAPACITY_POLICY > base64_decode (bool ignore_spaces=false, const ALLOCATOR &allocator=ALLOCATOR()) const
 Decodes Base64 dump from the slice content to returned buffer.
 
bool is_printable (bool disable_utf8=false) const noexcept
 Checks whether the content of the slice is printable.
 
bool is_hex (bool ignore_spaces=false) const noexcept
 Checks whether the content of the slice is a hexadecimal dump.
 
bool is_base58 (bool ignore_spaces=false) const noexcept
 Checks whether the content of the slice is a Base58 dump.
 
bool is_base64 (bool ignore_spaces=false) const noexcept
 Checks whether the content of the slice is a Base64 dump.
 
void swap (slice &other) noexcept
 
template<class CHAR , class T >
void swap (::std::basic_string_view< CHAR, T > &view) noexcept
 
constexpr const bytebyte_ptr () const noexcept
 Returns casted to pointer to byte an address of data.
 
constexpr bytebyte_ptr () noexcept
 
constexpr const byteend_byte_ptr () const noexcept
 Returns casted to pointer to byte an end of data.
 
constexpr byteend_byte_ptr () noexcept
 
constexpr const char * char_ptr () const noexcept
 Returns casted to pointer to char an address of data.
 
constexpr char * char_ptr () noexcept
 
constexpr const char * end_char_ptr () const noexcept
 Returns casted to pointer to char an end of data.
 
constexpr char * end_char_ptr () noexcept
 
constexpr const void * data () const noexcept
 Return a pointer to the beginning of the referenced data.
 
constexpr void * data () noexcept
 
constexpr const void * end () const noexcept
 Return a pointer to the ending of the referenced data.
 
constexpr void * end () noexcept
 
constexpr size_t length () const noexcept
 Returns the number of bytes.
 
constexpr sliceset_length (size_t bytes)
 Set slice length.
 
constexpr sliceset_end (const void *ptr)
 Sets the length by specifying the end of the slice data.
 
constexpr bool empty () const noexcept
 Checks whether the slice is empty.
 
constexpr bool is_null () const noexcept
 Checks whether the slice data pointer is nullptr.
 
constexpr size_t size () const noexcept
 Returns the number of bytes.
 
constexpr void invalidate () noexcept
 Depletes content of slice and make it invalid.
 
constexpr void clear () noexcept
 Makes the slice empty and referencing to nothing.
 
void remove_prefix (size_t n) noexcept
 Drops the first "n" bytes from this slice.
 
void remove_suffix (size_t n) noexcept
 Drops the last "n" bytes from this slice.
 
void safe_remove_prefix (size_t n)
 Drops the first "n" bytes from this slice.
 
void safe_remove_suffix (size_t n)
 Drops the last "n" bytes from this slice.
 
constexpr bool starts_with (const slice &prefix) const noexcept
 Checks if the data starts with the given prefix.
 
constexpr bool ends_with (const slice &suffix) const noexcept
 Checks if the data ends with the given suffix.
 
constexpr byte operator[] (size_t n) const noexcept
 Returns the nth byte in the referenced data.
 
constexpr byte at (size_t n) const
 Returns the nth byte in the referenced data with bounds checking.
 
constexpr slice head (size_t n) const noexcept
 Returns the first "n" bytes of the slice.
 
constexpr slice tail (size_t n) const noexcept
 Returns the last "n" bytes of the slice.
 
constexpr slice middle (size_t from, size_t n) const noexcept
 Returns the middle "n" bytes of the slice.
 
constexpr slice safe_head (size_t n) const
 Returns the first "n" bytes of the slice.
 
constexpr slice safe_tail (size_t n) const
 Returns the last "n" bytes of the slice.
 
constexpr slice safe_middle (size_t from, size_t n) const
 Returns the middle "n" bytes of the slice.
 
constexpr size_t hash_value () const noexcept
 Returns the hash value of referenced data.
 
constexpr bool is_valid () const noexcept
 Checks the slice is not refers to null address or has zero length.
 
template<typename POD >
constexpr POD as_pod () const
 
constexpr uint128_t as_uint128 () const
 
constexpr uint64_t as_uint64 () const
 
constexpr uint32_t as_uint32 () const
 
constexpr uint16_t as_uint16 () const
 
constexpr uint8_t as_uint8 () const
 
constexpr int128_t as_int128 () const
 
constexpr int64_t as_int64 () const
 
constexpr int32_t as_int32 () const
 
constexpr int16_t as_int16 () const
 
constexpr int8_t as_int8 () const
 
uint128_t as_uint128_adapt () const
 
uint64_t as_uint64_adapt () const
 
uint32_t as_uint32_adapt () const
 
uint16_t as_uint16_adapt () const
 
uint8_t as_uint8_adapt () const
 
int128_t as_int128_adapt () const
 
int64_t as_int64_adapt () const
 
int32_t as_int32_adapt () const
 
int16_t as_int16_adapt () const
 
int8_t as_int8_adapt () const
 

Static Public Member Functions

template<size_t SIZE>
static constexpr slice wrap (const char(&text)[SIZE])
 
template<typename POD >
static constexpr slice wrap (const POD &pod)
 
static constexpr intptr_t compare_fast (const slice &a, const slice &b) noexcept
 Three-way fast non-lexicographically length-based comparison.
 
static constexpr intptr_t compare_lexicographically (const slice &a, const slice &b) noexcept
 Three-way lexicographically comparison.
 
static constexpr slice invalid () noexcept
 Build an invalid slice which non-zero length and refers to null address.
 

Protected Member Functions

constexpr slice (size_t invalid_length) noexcept
 

Friends

constexpr bool operator== (const slice &a, const slice &b)
 
constexpr bool operator< (const slice &a, const slice &b)
 
constexpr bool operator> (const slice &a, const slice &b)
 
constexpr bool operator<= (const slice &a, const slice &b)
 
constexpr bool operator>= (const slice &a, const slice &b)
 
constexpr bool operator!= (const slice &a, const slice &b)
 

Member Enumeration Documentation

◆ anonymous enum

anonymous enum
Enumerator
max_length 

Constructor & Destructor Documentation

◆ slice() [1/7]

template<size_t SIZE>
mdbx::slice::slice ( const char(&) text[SIZE])
inlineconstexpr

Create a slice that refers to text[0,strlen(text)-1].

◆ slice() [2/7]

template<class CHAR , class T , class A >
mdbx::slice::slice ( const ::std::basic_string< CHAR, T, A > & str)
inlineexplicitconstexpr

Create a slice that refers to the contents of "str".

Note
'explicit' to avoid reference to the temporary std::string instance.

◆ slice() [3/7]

mdbx::slice::slice ( const slice & )
constexprdefaultnoexcept

◆ slice() [4/7]

template<typename POD >
mdbx::slice::slice ( const ::std::span< POD > & span)
inlineconstexpr

◆ slice() [5/7]

template<class CHAR , class T >
mdbx::slice::slice ( const ::std::basic_string_view< CHAR, T > & sv)
inlineconstexpr

Create a slice that refers to the same contents as "string_view".

◆ slice() [6/7]

template<class CHAR , class T >
mdbx::slice::slice ( ::std::basic_string_view< CHAR, T > && sv)
inline

◆ slice() [7/7]

mdbx::slice::slice ( size_t invalid_length)
inlineconstexprprotectednoexcept

Member Function Documentation

◆ as_int128()

int128_t mdbx::slice::as_int128 ( ) const
inlineconstexpr

◆ as_int128_adapt()

int128_t mdbx::slice::as_int128_adapt ( ) const

◆ as_int16()

int16_t mdbx::slice::as_int16 ( ) const
inlineconstexpr

◆ as_int16_adapt()

int16_t mdbx::slice::as_int16_adapt ( ) const

◆ as_int32()

int32_t mdbx::slice::as_int32 ( ) const
inlineconstexpr

◆ as_int32_adapt()

int32_t mdbx::slice::as_int32_adapt ( ) const

◆ as_int64()

int64_t mdbx::slice::as_int64 ( ) const
inlineconstexpr

◆ as_int64_adapt()

int64_t mdbx::slice::as_int64_adapt ( ) const

◆ as_int8()

int8_t mdbx::slice::as_int8 ( ) const
inlineconstexpr

◆ as_int8_adapt()

int8_t mdbx::slice::as_int8_adapt ( ) const

◆ as_pod()

template<typename POD >
POD mdbx::slice::as_pod ( ) const
inlineconstexpr

◆ as_span() [1/2]

template<typename POD >
::std::span< POD > mdbx::slice::as_span ( )
inlineconstexpr

◆ as_span() [2/2]

template<typename POD >
::std::span< const POD > mdbx::slice::as_span ( ) const
inlineconstexpr

◆ as_string()

template<class CHAR = char, class T = ::std::char_traits<CHAR>, class ALLOCATOR = default_allocator>
::std::basic_string< CHAR, T, ALLOCATOR > mdbx::slice::as_string ( const ALLOCATOR & allocator = ALLOCATOR()) const
inline

◆ as_uint128()

uint128_t mdbx::slice::as_uint128 ( ) const
inlineconstexpr

◆ as_uint128_adapt()

uint128_t mdbx::slice::as_uint128_adapt ( ) const

◆ as_uint16()

uint16_t mdbx::slice::as_uint16 ( ) const
inlineconstexpr

◆ as_uint16_adapt()

uint16_t mdbx::slice::as_uint16_adapt ( ) const

◆ as_uint32()

uint32_t mdbx::slice::as_uint32 ( ) const
inlineconstexpr

◆ as_uint32_adapt()

uint32_t mdbx::slice::as_uint32_adapt ( ) const

◆ as_uint64()

uint64_t mdbx::slice::as_uint64 ( ) const
inlineconstexpr

◆ as_uint64_adapt()

uint64_t mdbx::slice::as_uint64_adapt ( ) const

◆ as_uint8()

uint8_t mdbx::slice::as_uint8 ( ) const
inlineconstexpr

◆ as_uint8_adapt()

uint8_t mdbx::slice::as_uint8_adapt ( ) const

◆ assign() [1/3]

template<class CHAR , class T >
slice & mdbx::slice::assign ( ::std::basic_string_view< CHAR, T > && view)
inline

◆ assign() [2/3]

template<class CHAR , class T , class ALLOCATOR >
slice & mdbx::slice::assign ( const ::std::basic_string< CHAR, T, ALLOCATOR > & str)
inline

◆ assign() [3/3]

template<class CHAR , class T >
slice & mdbx::slice::assign ( const ::std::basic_string_view< CHAR, T > & view)
inline

◆ bytes() [1/2]

::std::span< byte > mdbx::slice::bytes ( )
inline

◆ bytes() [2/2]

::std::span< const byte > mdbx::slice::bytes ( ) const
inline

◆ chars() [1/2]

::std::span< char > mdbx::slice::chars ( )
inline

◆ chars() [2/2]

::std::span< const char > mdbx::slice::chars ( ) const
inline

◆ invalid()

static constexpr slice mdbx::slice::invalid ( )
inlinestaticconstexprnoexcept

Build an invalid slice which non-zero length and refers to null address.

◆ is_printable()

bool mdbx::slice::is_printable ( bool disable_utf8 = false) const
noexcept

Checks whether the content of the slice is printable.

Parameters
[in]disable_utf8By default if disable_utf8 is false function checks that content bytes are printable ASCII-7 characters or a valid UTF8 sequences. Otherwise, if disable_utf8 is true function checks that content bytes are printable extended 8-bit ASCII codes.

◆ is_valid()

bool mdbx::slice::is_valid ( ) const
inlineconstexprnoexcept

Checks the slice is not refers to null address or has zero length.

◆ operator const MDBX_val *()

mdbx::slice::operator const MDBX_val * ( ) const
inlinenoexcept

◆ operator MDBX_val *()

mdbx::slice::operator MDBX_val * ( )
inlinenoexcept

◆ operator::std::basic_string()

template<class CHAR , class T , class ALLOCATOR >
mdbx::slice::operator::std::basic_string ( ) const
inlineexplicitconstexpr

◆ operator::std::basic_string_view()

template<class CHAR , class T >
mdbx::slice::operator::std::basic_string_view ( ) const
inlineexplicitconstexprnoexcept

Return a string_view that references the same data as this slice.

◆ operator=() [1/3]

template<class CHAR , class T >
slice & mdbx::slice::operator= ( ::std::basic_string_view< CHAR, T > && view)
inline

◆ operator=() [2/3]

template<class CHAR , class T >
slice & mdbx::slice::operator= ( const ::std::basic_string_view< CHAR, T > & view)
inline

◆ operator=() [3/3]

slice & mdbx::slice::operator= ( const slice & )
defaultnoexcept

◆ string_view()

template<class CHAR = char, class T = ::std::char_traits<CHAR>>
::std::basic_string_view< CHAR, T > mdbx::slice::string_view ( ) const
inlinenoexcept

Return a string_view that references the same data as this slice.

◆ swap()

template<class CHAR , class T >
void mdbx::slice::swap ( ::std::basic_string_view< CHAR, T > & view)
inlinenoexcept

◆ wrap() [1/2]

template<size_t SIZE>
static constexpr slice mdbx::slice::wrap ( const char(&) text[SIZE])
inlinestaticconstexpr

◆ wrap() [2/2]

template<typename POD >
static constexpr slice mdbx::slice::wrap ( const POD & pod)
inlinestaticconstexpr

Friends And Related Symbol Documentation

◆ operator!=

bool operator!= ( const slice & a,
const slice & b )
friend

◆ operator<

bool operator< ( const slice & a,
const slice & b )
friend

◆ operator<=

bool operator<= ( const slice & a,
const slice & b )
friend

◆ operator==

bool operator== ( const slice & a,
const slice & b )
friend

◆ operator>

bool operator> ( const slice & a,
const slice & b )
friend

◆ operator>=

bool operator>= ( const slice & a,
const slice & b )
friend

◆ mdbx::default_capacity_policy

struct mdbx::default_capacity_policy

Public Types

enum  : size_t { extra_inplace_storage = 0 , pettiness_threshold = 64 , max_reserve = 65536 }
 

Static Public Member Functions

static constexpr size_t round (const size_t value)
 
static constexpr size_t advise (const size_t current, const size_t wanna)
 

Member Enumeration Documentation

◆ anonymous enum

anonymous enum : size_t
Enumerator
extra_inplace_storage 
pettiness_threshold 
max_reserve 

Member Function Documentation

◆ advise()

static constexpr size_t mdbx::default_capacity_policy::advise ( const size_t current,
const size_t wanna )
inlinestaticconstexpr

◆ round()

static constexpr size_t mdbx::default_capacity_policy::round ( const size_t value)
inlinestaticconstexpr

◆ mdbx::to_hex

struct mdbx::to_hex

Hexadecimal encoder which satisfy SliceTranscoder concept.

Public Member Functions

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

Public Attributes

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

Constructor & Destructor Documentation

◆ to_hex()

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

Member Function Documentation

◆ as_buffer()

template<class ALLOCATOR = default_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 = default_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()

size_t mdbx::to_hex::envisage_result_length ( ) const
inlineconstexprnoexcept

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

◆ mdbx::to_base58

struct mdbx::to_base58

Base58 encoder which satisfy SliceTranscoder concept.

Public Member Functions

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

Public Attributes

const slice source
 
const unsigned wrap_width = 0
 

Constructor & Destructor Documentation

◆ to_base58()

mdbx::to_base58::to_base58 ( const slice & source,
unsigned wrap_width = 0 )
inlineconstexprnoexcept

Member Function Documentation

◆ as_buffer()

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

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

◆ as_string()

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

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

◆ envisage_result_length()

size_t mdbx::to_base58::envisage_result_length ( ) const
inlineconstexprnoexcept

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

◆ is_empty()

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

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

◆ is_erroneous()

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

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

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

◆ write_bytes()

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

Fills the buffer by Base58 dump of passed slice.

Exceptions
std::length_errorif given buffer is too small.

Member Data Documentation

◆ source

const slice mdbx::to_base58::source

◆ wrap_width

const unsigned mdbx::to_base58::wrap_width = 0

◆ mdbx::to_base64

struct mdbx::to_base64

Base64 encoder which satisfy SliceTranscoder concept.

Public Member Functions

constexpr to_base64 (const slice &source, unsigned wrap_width=0) noexcept
 
template<class ALLOCATOR = default_allocator>
string< ALLOCATOR > as_string (const ALLOCATOR &allocator=ALLOCATOR()) const
 Returns a string with a Base64 dump of a passed slice.
 
template<class ALLOCATOR = default_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.
 
constexpr size_t envisage_result_length () const noexcept
 Returns the buffer size in bytes needed for Base64 dump of passed slice.
 
char * write_bytes (char *dest, size_t dest_size) const
 Fills the buffer by Base64 dump of passed slice.
 
::std::ostream & output (::std::ostream &out) const
 Output Base64 dump of passed slice to the std::ostream.
 
bool is_empty () const noexcept
 Checks whether a passed slice is empty, and therefore there will be no output bytes.
 
bool is_erroneous () const noexcept
 Checks whether the content of a passed slice is a valid data and could be encoded or unexpectedly not.
 

Public Attributes

const slice source
 
const unsigned wrap_width = 0
 

Constructor & Destructor Documentation

◆ to_base64()

mdbx::to_base64::to_base64 ( const slice & source,
unsigned wrap_width = 0 )
inlineconstexprnoexcept

Member Function Documentation

◆ as_buffer()

template<class ALLOCATOR = default_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 = default_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()

size_t mdbx::to_base64::envisage_result_length ( ) const
inlineconstexprnoexcept

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

◆ mdbx::from_hex

struct mdbx::from_hex

Hexadecimal decoder which satisfy SliceTranscoder concept.

Public Member Functions

constexpr from_hex (const slice &source, bool ignore_spaces=false) noexcept
 
template<class ALLOCATOR = default_allocator>
string< ALLOCATOR > as_string (const ALLOCATOR &allocator=ALLOCATOR()) const
 Decodes hexadecimal dump from a passed slice to returned string.
 
template<class ALLOCATOR = default_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.
 
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.
 
char * write_bytes (char *dest, size_t dest_size) const
 Fills the destination with data decoded from hexadecimal dump from a passed slice.
 
bool is_empty () const noexcept
 Checks whether a passed slice is empty, and therefore there will be no output bytes.
 
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.
 

Public Attributes

const slice source
 
const bool ignore_spaces = false
 

Constructor & Destructor Documentation

◆ from_hex()

mdbx::from_hex::from_hex ( const slice & source,
bool ignore_spaces = false )
inlineconstexprnoexcept

Member Function Documentation

◆ as_buffer()

template<class ALLOCATOR = default_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 = default_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()

size_t mdbx::from_hex::envisage_result_length ( ) const
inlineconstexprnoexcept

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

◆ mdbx::from_base58

struct mdbx::from_base58

Base58 decoder which satisfy SliceTranscoder concept.

Public Member Functions

constexpr from_base58 (const slice &source, bool ignore_spaces=false) noexcept
 
template<class ALLOCATOR = default_allocator>
string< ALLOCATOR > as_string (const ALLOCATOR &allocator=ALLOCATOR()) const
 Decodes Base58 dump from a passed slice to returned string.
 
template<class ALLOCATOR = default_allocator, typename CAPACITY_POLICY = default_capacity_policy>
buffer< ALLOCATOR, CAPACITY_POLICY > as_buffer (const ALLOCATOR &allocator=ALLOCATOR()) const
 Decodes Base58 dump from a passed slice to returned buffer.
 
constexpr size_t envisage_result_length () const noexcept
 Returns the number of bytes needed for conversion Base58 dump from a passed slice to decoded data.
 
char * write_bytes (char *dest, size_t dest_size) const
 Fills the destination with data decoded from Base58 dump from a passed slice.
 
bool is_empty () const noexcept
 Checks whether a passed slice is empty, and therefore there will be no output bytes.
 
bool is_erroneous () const noexcept
 Checks whether the content of a passed slice is a valid Base58 dump, and therefore there could be decoded or not.
 

Public Attributes

const slice source
 
const bool ignore_spaces = false
 

Constructor & Destructor Documentation

◆ from_base58()

mdbx::from_base58::from_base58 ( const slice & source,
bool ignore_spaces = false )
inlineconstexprnoexcept

Member Function Documentation

◆ as_buffer()

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

Decodes Base58 dump from a passed slice to returned buffer.

◆ as_string()

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

Decodes Base58 dump from a passed slice to returned string.

◆ envisage_result_length()

size_t mdbx::from_base58::envisage_result_length ( ) const
inlineconstexprnoexcept

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

◆ is_empty()

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

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

◆ is_erroneous()

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

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

◆ write_bytes()

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

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

Exceptions
std::length_errorif given buffer is too small.

Member Data Documentation

◆ ignore_spaces

const bool mdbx::from_base58::ignore_spaces = false

◆ source

const slice mdbx::from_base58::source

◆ mdbx::from_base64

struct mdbx::from_base64

Base64 decoder which satisfy SliceTranscoder concept.

Public Member Functions

constexpr from_base64 (const slice &source, bool ignore_spaces=false) noexcept
 
template<class ALLOCATOR = default_allocator>
string< ALLOCATOR > as_string (const ALLOCATOR &allocator=ALLOCATOR()) const
 Decodes Base64 dump from a passed slice to returned string.
 
template<class ALLOCATOR = default_allocator, typename CAPACITY_POLICY = default_capacity_policy>
buffer< ALLOCATOR, CAPACITY_POLICY > as_buffer (const ALLOCATOR &allocator=ALLOCATOR()) const
 Decodes Base64 dump from a passed slice to returned buffer.
 
constexpr size_t envisage_result_length () const noexcept
 Returns the number of bytes needed for conversion Base64 dump from a passed slice to decoded data.
 
char * write_bytes (char *dest, size_t dest_size) const
 Fills the destination with data decoded from Base64 dump from a passed slice.
 
bool is_empty () const noexcept
 Checks whether a passed slice is empty, and therefore there will be no output bytes.
 
bool is_erroneous () const noexcept
 Checks whether the content of a passed slice is a valid Base64 dump, and therefore there could be decoded or not.
 

Public Attributes

const slice source
 
const bool ignore_spaces = false
 

Constructor & Destructor Documentation

◆ from_base64()

mdbx::from_base64::from_base64 ( const slice & source,
bool ignore_spaces = false )
inlineconstexprnoexcept

Member Function Documentation

◆ as_buffer()

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

Decodes Base64 dump from a passed slice to returned buffer.

◆ as_string()

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

Decodes Base64 dump from a passed slice to returned string.

◆ envisage_result_length()

size_t mdbx::from_base64::envisage_result_length ( ) const
inlineconstexprnoexcept

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

◆ is_empty()

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

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

◆ is_erroneous()

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

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

◆ write_bytes()

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

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

Exceptions
std::length_errorif given buffer is too small.

Member Data Documentation

◆ ignore_spaces

const bool mdbx::from_base64::ignore_spaces = false

◆ source

const slice mdbx::from_base64::source

◆ mdbx::buffer

class mdbx::buffer
template<class ALLOCATOR, typename CAPACITY_POLICY>
class mdbx::buffer< ALLOCATOR, CAPACITY_POLICY >

The chunk of data stored inside the buffer or located outside it.

Public Types

enum  : size_t { max_length = MDBX_MAXDATASIZE , max_capacity = (max_length / 3u * 4u + 1023u) & ~size_t(1023) , extra_inplace_storage = reservation_policy::extra_inplace_storage , pettiness_threshold = reservation_policy::pettiness_threshold }
 
using allocator_type = typename ::std::allocator_traits<ALLOCATOR>::template rebind_alloc<uint64_t>
 
using allocator_traits = ::std::allocator_traits<allocator_type>
 
using reservation_policy = CAPACITY_POLICY
 
using move_assign_alloc = allocation_aware_details::move_assign_alloc<silo, allocator_type>
 
using copy_assign_alloc = allocation_aware_details::copy_assign_alloc<silo, allocator_type>
 

Public Member Functions

constexpr allocator_type get_allocator () const
 Returns the associated allocator.
 
constexpr bool is_freestanding () const noexcept
 Checks whether data chunk stored inside the buffer, otherwise buffer just refers to data located outside the buffer.
 
constexpr bool is_reference () const noexcept
 Checks whether the buffer just refers to data located outside the buffer, rather than stores it.
 
constexpr size_t capacity () const noexcept
 Returns the number of bytes that can be held in currently allocated storage.
 
constexpr size_t headroom () const noexcept
 Returns the number of bytes that available in currently allocated storage ahead the currently beginning of data.
 
constexpr size_t tailroom () const noexcept
 Returns the number of bytes that available in currently allocated storage after the currently data end.
 
constexpr const bytebyte_ptr () const noexcept
 Returns casted to const pointer to byte an address of data.
 
constexpr const byteend_byte_ptr () const noexcept
 Returns casted to const pointer to byte an end of data.
 
constexpr bytebyte_ptr () noexcept
 Returns casted to pointer to byte an address of data.
 
constexpr byteend_byte_ptr () noexcept
 Returns casted to pointer to byte an end of data.
 
constexpr const char * char_ptr () const noexcept
 Returns casted to const pointer to char an address of data.
 
constexpr const char * end_char_ptr () const noexcept
 Returns casted to const pointer to char an end of data.
 
constexpr char * char_ptr () noexcept
 Returns casted to pointer to char an address of data.
 
constexpr char * end_char_ptr () noexcept
 Returns casted to pointer to char an end of data.
 
constexpr const void * data () const noexcept
 Return a const pointer to the beginning of the referenced data.
 
constexpr const void * end () const noexcept
 Return a const pointer to the end of the referenced data.
 
constexpr void * data () noexcept
 Return a pointer to the beginning of the referenced data.
 
constexpr void * end () noexcept
 Return a pointer to the end of the referenced data.
 
constexpr size_t length () const noexcept
 Returns the number of bytes.
 
constexpr bufferset_length (size_t bytes)
 Set length of data.
 
constexpr bufferset_end (const void *ptr)
 Sets the length by specifying the end of the data.
 
void make_freestanding ()
 Makes buffer owning the data.
 
constexpr buffer () noexcept=default
 
constexpr buffer (const allocator_type &allocator) noexcept
 
 buffer (const struct slice &src, bool make_reference, const allocator_type &allocator=allocator_type())
 
 buffer (const buffer &src, bool make_reference, const allocator_type &allocator=allocator_type())
 
 buffer (const void *ptr, size_t bytes, bool make_reference, const allocator_type &allocator=allocator_type())
 
template<class CHAR , class T , class A >
 buffer (const ::std::basic_string< CHAR, T, A > &)=delete
 
template<class CHAR , class T , class A >
 buffer (const ::std::basic_string< CHAR, T, A > &&)=delete
 
 buffer (const char *c_str, bool make_reference, const allocator_type &allocator=allocator_type())
 
template<class CHAR , class T >
 buffer (const ::std::basic_string_view< CHAR, T > &view, bool make_reference, const allocator_type &allocator=allocator_type())
 
constexpr buffer (const struct slice &src, const allocator_type &allocator=allocator_type())
 
constexpr buffer (const buffer &src, const allocator_type &allocator=allocator_type())
 
constexpr buffer (const void *ptr, size_t bytes, const allocator_type &allocator=allocator_type())
 
template<class CHAR , class T , class A >
constexpr buffer (const ::std::basic_string< CHAR, T, A > &str, const allocator_type &allocator=allocator_type())
 
constexpr buffer (const char *c_str, const allocator_type &allocator=allocator_type())
 
template<class CHAR , class T >
constexpr buffer (const ::std::basic_string_view< CHAR, T > &view, const allocator_type &allocator=allocator_type())
 
 buffer (size_t head_room, size_t tail_room, const allocator_type &allocator=allocator_type())
 
 buffer (size_t capacity, const allocator_type &allocator=allocator_type())
 
 buffer (size_t head_room, const struct slice &src, size_t tail_room, const allocator_type &allocator=allocator_type())
 
 buffer (size_t head_room, const buffer &src, size_t tail_room, const allocator_type &allocator=allocator_type())
 
 buffer (const ::mdbx::txn &txn, const struct slice &src, const allocator_type &allocator=allocator_type())
 
 buffer (buffer &&src) noexcept(move_assign_alloc::is_nothrow())
 
constexpr const struct sliceslice () const noexcept
 
constexpr operator const struct slice & () const noexcept
 
template<typename POD >
constexpr buffer (const ::std::span< POD > &span)
 
template<typename POD >
constexpr ::std::span< const POD > as_span () const
 
template<typename POD >
constexpr ::std::span< POD > as_span ()
 
constexpr ::std::span< const bytebytes () const
 
constexpr ::std::span< bytebytes ()
 
constexpr ::std::span< const char > chars () const
 
constexpr ::std::span< char > chars ()
 
template<typename POD >
constexpr POD as_pod () const
 
constexpr uint128_t as_uint128 () const
 
constexpr uint64_t as_uint64 () const
 
constexpr uint32_t as_uint32 () const
 
constexpr uint16_t as_uint16 () const
 
constexpr uint8_t as_uint8 () const
 
constexpr int128_t as_int128 () const
 
constexpr int64_t as_int64 () const
 
constexpr int32_t as_int32 () const
 
constexpr int16_t as_int16 () const
 
constexpr int8_t as_int8 () const
 
uint128_t as_uint128_adapt () const
 
uint64_t as_uint64_adapt () const
 
uint32_t as_uint32_adapt () const
 
uint16_t as_uint16_adapt () const
 
uint8_t as_uint8_adapt () const
 
int128_t as_int128_adapt () const
 
int64_t as_int64_adapt () const
 
int32_t as_int32_adapt () const
 
int16_t as_int16_adapt () const
 
int8_t as_int8_adapt () const
 
buffer encode_hex (bool uppercase=false, unsigned wrap_width=0, const allocator_type &allocator=allocator_type()) const
 Returns a new buffer with a hexadecimal dump of the slice content.
 
buffer encode_base58 (unsigned wrap_width=0, const allocator_type &allocator=allocator_type()) const
 Returns a new buffer with a Base58 dump of the slice content.
 
buffer encode_base64 (unsigned wrap_width=0, const allocator_type &allocator=allocator_type()) const
 Returns a new buffer with a Base64 dump of the slice content.
 
buffer hex_decode (bool ignore_spaces=false, const allocator_type &allocator=allocator_type()) const
 Decodes hexadecimal dump from the buffer content to new returned buffer.
 
buffer base58_decode (bool ignore_spaces=false, const allocator_type &allocator=allocator_type()) const
 Decodes Base58 dump from the buffer content to new returned buffer.
 
buffer base64_decode (bool ignore_spaces=false, const allocator_type &allocator=allocator_type()) const
 Decodes Base64 dump from the buffer content to new returned buffer.
 
void reserve (size_t wanna_headroom, size_t wanna_tailroom)
 Reserves storage space.
 
void reserve_headroom (size_t wanna_headroom)
 Reserves space before the payload.
 
void reserve_tailroom (size_t wanna_tailroom)
 Reserves space after the payload.
 
bufferassign_reference (const void *ptr, size_t bytes)
 
bufferassign_freestanding (const void *ptr, size_t bytes)
 
constexpr void swap (buffer &other) noexcept(swap_alloc::is_nothrow())
 
bufferassign (const buffer &src, bool make_reference=false)
 
bufferassign (const void *ptr, size_t bytes, bool make_reference=false)
 
bufferassign (const struct slice &src, bool make_reference=false)
 
bufferassign (const ::MDBX_val &src, bool make_reference=false)
 
bufferassign (struct slice &&src, bool make_reference=false)
 
bufferassign (::MDBX_val &&src, bool make_reference=false)
 
bufferassign (const void *begin, const void *end, bool make_reference=false)
 
template<class CHAR , class T , class A >
bufferassign (const ::std::basic_string< CHAR, T, A > &str, bool make_reference=false)
 
bufferassign (const char *c_str, bool make_reference=false)
 
bufferoperator= (const buffer &src)
 
bufferoperator= (buffer &&src) noexcept(move_assign_alloc::is_nothrow())
 
bufferoperator= (const struct slice &src)
 
bufferoperator= (struct slice &&src)
 
template<class CHAR , class T >
bufferoperator= (const ::std::basic_string_view< CHAR, T > &view) noexcept
 
template<class CHAR = char, class T = ::std::char_traits<CHAR>>
::std::basic_string_view< CHAR, T > string_view () const noexcept
 Return a string_view that references the data of this buffer.
 
template<class CHAR , class T >
 operator::std::basic_string_view () const noexcept
 Return a string_view that references the data of this buffer.
 
constexpr bool empty () const noexcept
 Checks whether the string is empty.
 
constexpr bool is_null () const noexcept
 Checks whether the data pointer of the buffer is nullptr.
 
constexpr size_t size () const noexcept
 Returns the number of bytes.
 
constexpr size_t hash_value () const noexcept
 Returns the hash value of the data.
 
template<class CHAR = char, class T = ::std::char_traits<CHAR>, class A = legacy_allocator>
constexpr ::std::basic_string< CHAR, T, A > as_string (const A &allocator=A()) const
 
template<class CHAR , class T , class A >
constexpr operator::std::basic_string () const
 
bool starts_with (const struct slice &prefix) const noexcept
 Checks if the data starts with the given prefix.
 
bool ends_with (const struct slice &suffix) const noexcept
 Checks if the data ends with the given suffix.
 
void clear () noexcept
 Clears the contents and storage.
 
void clear_and_reserve (size_t whole_capacity, size_t headroom=0) noexcept
 Clears the contents and reserve storage.
 
void shrink_to_fit ()
 Reduces memory usage by freeing unused storage space.
 
void remove_prefix (size_t n) noexcept
 Drops the first "n" bytes from the data chunk.
 
void remove_suffix (size_t n) noexcept
 Drops the last "n" bytes from the data chunk.
 
void safe_remove_prefix (size_t n)
 Drops the first "n" bytes from the data chunk.
 
void safe_remove_suffix (size_t n)
 Drops the last "n" bytes from the data chunk.
 
constexpr byte operator[] (size_t n) const noexcept
 Accesses the specified byte of data chunk.
 
constexpr byteoperator[] (size_t n) noexcept
 Accesses the specified byte of data chunk.
 
constexpr byte at (size_t n) const
 Accesses the specified byte of data chunk with bounds checking.
 
constexpr byteat (size_t n)
 Accesses the specified byte of data chunk with bounds checking.
 
constexpr struct slice head (size_t n) const noexcept
 Returns the first "n" bytes of the data chunk.
 
constexpr struct slice tail (size_t n) const noexcept
 Returns the last "n" bytes of the data chunk.
 
constexpr struct slice middle (size_t from, size_t n) const noexcept
 Returns the middle "n" bytes of the data chunk.
 
constexpr struct slice safe_head (size_t n) const
 Returns the first "n" bytes of the data chunk.
 
constexpr struct slice safe_tail (size_t n) const
 Returns the last "n" bytes of the data chunk.
 
constexpr struct slice safe_middle (size_t from, size_t n) const
 Returns the middle "n" bytes of the data chunk.
 
bufferappend (const void *src, size_t bytes)
 
bufferappend (const struct slice &chunk)
 
bufferadd_header (const void *src, size_t bytes)
 
bufferadd_header (const struct slice &chunk)
 
template<MutableByteProducer PRODUCER>
bufferappend_producer (PRODUCER &producer)
 
template<ImmutableByteProducer PRODUCER>
bufferappend_producer (const PRODUCER &producer)
 
bufferappend_hex (const struct slice &data, bool uppercase=false, unsigned wrap_width=0)
 
bufferappend_base58 (const struct slice &data, unsigned wrap_width=0)
 
bufferappend_base64 (const struct slice &data, unsigned wrap_width=0)
 
bufferappend_decoded_hex (const struct slice &data, bool ignore_spaces=false)
 
bufferappend_decoded_base58 (const struct slice &data, bool ignore_spaces=false)
 
bufferappend_decoded_base64 (const struct slice &data, bool ignore_spaces=false)
 
bufferappend_u8 (uint_fast8_t u8)
 
bufferappend_byte (uint_fast8_t byte)
 
bufferappend_u16 (uint_fast16_t u16)
 
bufferappend_u24 (uint_fast32_t u24)
 
bufferappend_u32 (uint_fast32_t u32)
 
bufferappend_u48 (uint_fast64_t u48)
 
bufferappend_u64 (uint_fast64_t u64)
 
template<class ALLOCATOR , typename CAPACITY_POLICY >
 buffer (const txn &txn, const struct slice &src, const allocator_type &allocator)
 

Static Public Member Functions

template<typename POD >
static buffer wrap (const POD &pod, bool make_reference=false, const allocator_type &allocator=allocator_type())
 
static buffer hex (const ::mdbx::slice &source, bool uppercase=false, unsigned wrap_width=0, const allocator_type &allocator=allocator_type())
 Returns a new buffer with a hexadecimal dump of the slice content.
 
static buffer base58 (const ::mdbx::slice &source, unsigned wrap_width=0, const allocator_type &allocator=allocator_type())
 Returns a new buffer with a Base58 dump of the slice content.
 
static buffer base64 (const ::mdbx::slice &source, unsigned wrap_width=0, const allocator_type &allocator=allocator_type())
 Returns a new buffer with a Base64 dump of the slice content.
 
template<typename POD >
static buffer hex (const POD &pod, bool uppercase=false, unsigned wrap_width=0, const allocator_type &allocator=allocator_type())
 Returns a new buffer with a hexadecimal dump of the given pod.
 
template<typename POD >
static buffer base58 (const POD &pod, unsigned wrap_width=0, const allocator_type &allocator=allocator_type())
 Returns a new buffer with a Base58 dump of the given pod.
 
template<typename POD >
static buffer base64 (const POD &pod, unsigned wrap_width=0, const allocator_type &allocator=allocator_type())
 Returns a new buffer with a Base64 dump of the given pod.
 
static buffer hex_decode (const ::mdbx::slice &source, bool ignore_spaces=false, const allocator_type &allocator=allocator_type())
 Decodes hexadecimal dump from the slice content to returned buffer.
 
static buffer base58_decode (const ::mdbx::slice &source, bool ignore_spaces=false, const allocator_type &allocator=allocator_type())
 Decodes Base58 dump from the slice content to returned buffer.
 
static buffer base64_decode (const ::mdbx::slice &source, bool ignore_spaces=false, const allocator_type &allocator=allocator_type())
 Decodes Base64 dump from the slice content to returned buffer.
 
static buffer clone (const buffer &src, const allocator_type &allocator=allocator_type())
 
template<size_t SIZE>
static buffer key_from (const char(&text)[SIZE], bool make_reference=true)
 
template<class CHAR , class T >
static buffer key_from (const ::std::basic_string_view< CHAR, T > &src, bool make_reference=false)
 
static buffer key_from (const char *src, bool make_reference=false)
 
template<class CHAR , class T , class A >
static buffer key_from (const ::std::basic_string< CHAR, T, A > &src, bool make_reference=false)
 
static buffer key_from (silo &&src) noexcept
 
static buffer key_from_double (const double ieee754_64bit)
 
static buffer key_from (const double ieee754_64bit)
 
static buffer key_from (const double *ieee754_64bit)
 
static buffer key_from_u64 (const uint64_t unsigned_int64)
 
static buffer key_from (const uint64_t unsigned_int64)
 
static buffer key_from_i64 (const int64_t signed_int64)
 
static buffer key_from (const int64_t signed_int64)
 
static buffer key_from_jsonInteger (const int64_t json_integer)
 
static buffer key_from_float (const float ieee754_32bit)
 
static buffer key_from (const float ieee754_32bit)
 
static buffer key_from (const float *ieee754_32bit)
 
static buffer key_from_u32 (const uint32_t unsigned_int32)
 
static buffer key_from (const uint32_t unsigned_int32)
 
static buffer key_from_i32 (const int32_t signed_int32)
 
static buffer key_from (const int32_t signed_int32)
 

Friends

class txn
 

Member Typedef Documentation

◆ allocator_traits

template<class ALLOCATOR , typename CAPACITY_POLICY >
using mdbx::buffer< ALLOCATOR, CAPACITY_POLICY >::allocator_traits = ::std::allocator_traits<allocator_type>

◆ allocator_type

template<class ALLOCATOR , typename CAPACITY_POLICY >
using mdbx::buffer< ALLOCATOR, CAPACITY_POLICY >::allocator_type = typename ::std::allocator_traits<ALLOCATOR>::template rebind_alloc<uint64_t>

◆ copy_assign_alloc

template<class ALLOCATOR , typename CAPACITY_POLICY >
using mdbx::buffer< ALLOCATOR, CAPACITY_POLICY >::copy_assign_alloc = allocation_aware_details::copy_assign_alloc<silo, allocator_type>

◆ move_assign_alloc

template<class ALLOCATOR , typename CAPACITY_POLICY >
using mdbx::buffer< ALLOCATOR, CAPACITY_POLICY >::move_assign_alloc = allocation_aware_details::move_assign_alloc<silo, allocator_type>

◆ reservation_policy

template<class ALLOCATOR , typename CAPACITY_POLICY >
using mdbx::buffer< ALLOCATOR, CAPACITY_POLICY >::reservation_policy = CAPACITY_POLICY

Member Enumeration Documentation

◆ anonymous enum

template<class ALLOCATOR , typename CAPACITY_POLICY >
anonymous enum : size_t
Enumerator
max_length 
max_capacity 
extra_inplace_storage 
pettiness_threshold 

Constructor & Destructor Documentation

◆ buffer() [1/22]

template<class ALLOCATOR , typename CAPACITY_POLICY >
mdbx::buffer< ALLOCATOR, CAPACITY_POLICY >::buffer ( )
constexprdefaultnoexcept

◆ buffer() [2/22]

template<class ALLOCATOR , typename CAPACITY_POLICY >
mdbx::buffer< ALLOCATOR, CAPACITY_POLICY >::buffer ( const allocator_type & allocator)
inlineconstexprnoexcept

◆ buffer() [3/22]

template<class ALLOCATOR , typename CAPACITY_POLICY >
mdbx::buffer< ALLOCATOR, CAPACITY_POLICY >::buffer ( const struct slice & src,
bool make_reference,
const allocator_type & allocator = allocator_type() )
inline

◆ buffer() [4/22]

template<class ALLOCATOR , typename CAPACITY_POLICY >
mdbx::buffer< ALLOCATOR, CAPACITY_POLICY >::buffer ( const buffer< ALLOCATOR, CAPACITY_POLICY > & src,
bool make_reference,
const allocator_type & allocator = allocator_type() )
inline

◆ buffer() [5/22]

template<class ALLOCATOR , typename CAPACITY_POLICY >
mdbx::buffer< ALLOCATOR, CAPACITY_POLICY >::buffer ( const void * ptr,
size_t bytes,
bool make_reference,
const allocator_type & allocator = allocator_type() )
inline

◆ buffer() [6/22]

template<class ALLOCATOR , typename CAPACITY_POLICY >
template<class CHAR , class T , class A >
mdbx::buffer< ALLOCATOR, CAPACITY_POLICY >::buffer ( const ::std::basic_string< CHAR, T, A > & )
delete

◆ buffer() [7/22]

template<class ALLOCATOR , typename CAPACITY_POLICY >
template<class CHAR , class T , class A >
mdbx::buffer< ALLOCATOR, CAPACITY_POLICY >::buffer ( const ::std::basic_string< CHAR, T, A > && )
delete

◆ buffer() [8/22]

template<class ALLOCATOR , typename CAPACITY_POLICY >
mdbx::buffer< ALLOCATOR, CAPACITY_POLICY >::buffer ( const char * c_str,
bool make_reference,
const allocator_type & allocator = allocator_type() )
inline

◆ buffer() [9/22]

template<class ALLOCATOR , typename CAPACITY_POLICY >
template<class CHAR , class T >
mdbx::buffer< ALLOCATOR, CAPACITY_POLICY >::buffer ( const ::std::basic_string_view< CHAR, T > & view,
bool make_reference,
const allocator_type & allocator = allocator_type() )
inline

◆ buffer() [10/22]

template<class ALLOCATOR , typename CAPACITY_POLICY >
mdbx::buffer< ALLOCATOR, CAPACITY_POLICY >::buffer ( const struct slice & src,
const allocator_type & allocator = allocator_type() )
inlineconstexpr

◆ buffer() [11/22]

template<class ALLOCATOR , typename CAPACITY_POLICY >
mdbx::buffer< ALLOCATOR, CAPACITY_POLICY >::buffer ( const buffer< ALLOCATOR, CAPACITY_POLICY > & src,
const allocator_type & allocator = allocator_type() )
inlineconstexpr

◆ buffer() [12/22]

template<class ALLOCATOR , typename CAPACITY_POLICY >
mdbx::buffer< ALLOCATOR, CAPACITY_POLICY >::buffer ( const void * ptr,
size_t bytes,
const allocator_type & allocator = allocator_type() )
inlineconstexpr

◆ buffer() [13/22]

template<class ALLOCATOR , typename CAPACITY_POLICY >
template<class CHAR , class T , class A >
mdbx::buffer< ALLOCATOR, CAPACITY_POLICY >::buffer ( const ::std::basic_string< CHAR, T, A > & str,
const allocator_type & allocator = allocator_type() )
inlineconstexpr

◆ buffer() [14/22]

template<class ALLOCATOR , typename CAPACITY_POLICY >
mdbx::buffer< ALLOCATOR, CAPACITY_POLICY >::buffer ( const char * c_str,
const allocator_type & allocator = allocator_type() )
inlineconstexpr

◆ buffer() [15/22]

template<class ALLOCATOR , typename CAPACITY_POLICY >
template<class CHAR , class T >
mdbx::buffer< ALLOCATOR, CAPACITY_POLICY >::buffer ( const ::std::basic_string_view< CHAR, T > & view,
const allocator_type & allocator = allocator_type() )
inlineconstexpr

◆ buffer() [16/22]

template<class ALLOCATOR , typename CAPACITY_POLICY >
mdbx::buffer< ALLOCATOR, CAPACITY_POLICY >::buffer ( size_t head_room,
size_t tail_room,
const allocator_type & allocator = allocator_type() )
inline

◆ buffer() [17/22]

template<class ALLOCATOR , typename CAPACITY_POLICY >
mdbx::buffer< ALLOCATOR, CAPACITY_POLICY >::buffer ( size_t capacity,
const allocator_type & allocator = allocator_type() )
inline

◆ buffer() [18/22]

template<class ALLOCATOR , typename CAPACITY_POLICY >
mdbx::buffer< ALLOCATOR, CAPACITY_POLICY >::buffer ( size_t head_room,
const struct slice & src,
size_t tail_room,
const allocator_type & allocator = allocator_type() )
inline

◆ buffer() [19/22]

template<class ALLOCATOR , typename CAPACITY_POLICY >
mdbx::buffer< ALLOCATOR, CAPACITY_POLICY >::buffer ( size_t head_room,
const buffer< ALLOCATOR, CAPACITY_POLICY > & src,
size_t tail_room,
const allocator_type & allocator = allocator_type() )
inline

◆ buffer() [20/22]

template<class ALLOCATOR , typename CAPACITY_POLICY >
mdbx::buffer< ALLOCATOR, CAPACITY_POLICY >::buffer ( const ::mdbx::txn & txn,
const struct slice & src,
const allocator_type & allocator = allocator_type() )
inline

◆ buffer() [21/22]

template<class ALLOCATOR , typename CAPACITY_POLICY >
mdbx::buffer< ALLOCATOR, CAPACITY_POLICY >::buffer ( buffer< ALLOCATOR, CAPACITY_POLICY > && src)
inlinenoexcept

◆ buffer() [22/22]

template<class ALLOCATOR , typename CAPACITY_POLICY >
template<typename POD >
mdbx::buffer< ALLOCATOR, CAPACITY_POLICY >::buffer ( const ::std::span< POD > & span)
inlineconstexpr

Member Function Documentation

◆ add_header() [1/2]

template<class ALLOCATOR , typename CAPACITY_POLICY >
buffer & mdbx::buffer< ALLOCATOR, CAPACITY_POLICY >::add_header ( const struct slice & chunk)
inline

◆ add_header() [2/2]

template<class ALLOCATOR , typename CAPACITY_POLICY >
buffer & mdbx::buffer< ALLOCATOR, CAPACITY_POLICY >::add_header ( const void * src,
size_t bytes )
inline

◆ append() [1/2]

template<class ALLOCATOR , typename CAPACITY_POLICY >
buffer & mdbx::buffer< ALLOCATOR, CAPACITY_POLICY >::append ( const struct slice & chunk)
inline

◆ append() [2/2]

template<class ALLOCATOR , typename CAPACITY_POLICY >
buffer & mdbx::buffer< ALLOCATOR, CAPACITY_POLICY >::append ( const void * src,
size_t bytes )
inline

◆ append_base58()

template<class ALLOCATOR , typename CAPACITY_POLICY >
buffer & mdbx::buffer< ALLOCATOR, CAPACITY_POLICY >::append_base58 ( const struct slice & data,
unsigned wrap_width = 0 )
inline

◆ append_base64()

template<class ALLOCATOR , typename CAPACITY_POLICY >
buffer & mdbx::buffer< ALLOCATOR, CAPACITY_POLICY >::append_base64 ( const struct slice & data,
unsigned wrap_width = 0 )
inline

◆ append_byte()

template<class ALLOCATOR , typename CAPACITY_POLICY >
buffer & mdbx::buffer< ALLOCATOR, CAPACITY_POLICY >::append_byte ( uint_fast8_t byte)
inline

◆ append_decoded_base58()

template<class ALLOCATOR , typename CAPACITY_POLICY >
buffer & mdbx::buffer< ALLOCATOR, CAPACITY_POLICY >::append_decoded_base58 ( const struct slice & data,
bool ignore_spaces = false )
inline

◆ append_decoded_base64()

template<class ALLOCATOR , typename CAPACITY_POLICY >
buffer & mdbx::buffer< ALLOCATOR, CAPACITY_POLICY >::append_decoded_base64 ( const struct slice & data,
bool ignore_spaces = false )
inline

◆ append_decoded_hex()

template<class ALLOCATOR , typename CAPACITY_POLICY >
buffer & mdbx::buffer< ALLOCATOR, CAPACITY_POLICY >::append_decoded_hex ( const struct slice & data,
bool ignore_spaces = false )
inline

◆ append_hex()

template<class ALLOCATOR , typename CAPACITY_POLICY >
buffer & mdbx::buffer< ALLOCATOR, CAPACITY_POLICY >::append_hex ( const struct slice & data,
bool uppercase = false,
unsigned wrap_width = 0 )
inline

◆ append_producer() [1/2]

template<class ALLOCATOR , typename CAPACITY_POLICY >
template<ImmutableByteProducer PRODUCER>
buffer & mdbx::buffer< ALLOCATOR, CAPACITY_POLICY >::append_producer ( const PRODUCER & producer)
inline

◆ append_producer() [2/2]

template<class ALLOCATOR , typename CAPACITY_POLICY >
template<MutableByteProducer PRODUCER>
buffer & mdbx::buffer< ALLOCATOR, CAPACITY_POLICY >::append_producer ( PRODUCER & producer)
inline

◆ append_u16()

template<class ALLOCATOR , typename CAPACITY_POLICY >
buffer & mdbx::buffer< ALLOCATOR, CAPACITY_POLICY >::append_u16 ( uint_fast16_t u16)
inline

◆ append_u24()

template<class ALLOCATOR , typename CAPACITY_POLICY >
buffer & mdbx::buffer< ALLOCATOR, CAPACITY_POLICY >::append_u24 ( uint_fast32_t u24)
inline

◆ append_u32()

template<class ALLOCATOR , typename CAPACITY_POLICY >
buffer & mdbx::buffer< ALLOCATOR, CAPACITY_POLICY >::append_u32 ( uint_fast32_t u32)
inline

◆ append_u48()

template<class ALLOCATOR , typename CAPACITY_POLICY >
buffer & mdbx::buffer< ALLOCATOR, CAPACITY_POLICY >::append_u48 ( uint_fast64_t u48)
inline

◆ append_u64()

template<class ALLOCATOR , typename CAPACITY_POLICY >
buffer & mdbx::buffer< ALLOCATOR, CAPACITY_POLICY >::append_u64 ( uint_fast64_t u64)
inline

◆ append_u8()

template<class ALLOCATOR , typename CAPACITY_POLICY >
buffer & mdbx::buffer< ALLOCATOR, CAPACITY_POLICY >::append_u8 ( uint_fast8_t u8)
inline

◆ as_int128()

template<class ALLOCATOR , typename CAPACITY_POLICY >
int128_t mdbx::buffer< ALLOCATOR, CAPACITY_POLICY >::as_int128 ( ) const
inlineconstexpr

◆ as_int128_adapt()

template<class ALLOCATOR , typename CAPACITY_POLICY >
int128_t mdbx::buffer< ALLOCATOR, CAPACITY_POLICY >::as_int128_adapt ( ) const
inline

◆ as_int16()

template<class ALLOCATOR , typename CAPACITY_POLICY >
int16_t mdbx::buffer< ALLOCATOR, CAPACITY_POLICY >::as_int16 ( ) const
inlineconstexpr

◆ as_int16_adapt()

template<class ALLOCATOR , typename CAPACITY_POLICY >
int16_t mdbx::buffer< ALLOCATOR, CAPACITY_POLICY >::as_int16_adapt ( ) const
inline

◆ as_int32()

template<class ALLOCATOR , typename CAPACITY_POLICY >
int32_t mdbx::buffer< ALLOCATOR, CAPACITY_POLICY >::as_int32 ( ) const
inlineconstexpr

◆ as_int32_adapt()

template<class ALLOCATOR , typename CAPACITY_POLICY >
int32_t mdbx::buffer< ALLOCATOR, CAPACITY_POLICY >::as_int32_adapt ( ) const
inline

◆ as_int64()

template<class ALLOCATOR , typename CAPACITY_POLICY >
int64_t mdbx::buffer< ALLOCATOR, CAPACITY_POLICY >::as_int64 ( ) const
inlineconstexpr

◆ as_int64_adapt()

template<class ALLOCATOR , typename CAPACITY_POLICY >
int64_t mdbx::buffer< ALLOCATOR, CAPACITY_POLICY >::as_int64_adapt ( ) const
inline

◆ as_int8()

template<class ALLOCATOR , typename CAPACITY_POLICY >
int8_t mdbx::buffer< ALLOCATOR, CAPACITY_POLICY >::as_int8 ( ) const
inlineconstexpr

◆ as_int8_adapt()

template<class ALLOCATOR , typename CAPACITY_POLICY >
int8_t mdbx::buffer< ALLOCATOR, CAPACITY_POLICY >::as_int8_adapt ( ) const
inline

◆ as_pod()

template<class ALLOCATOR , typename CAPACITY_POLICY >
template<typename POD >
POD mdbx::buffer< ALLOCATOR, CAPACITY_POLICY >::as_pod ( ) const
inlineconstexpr

◆ as_span() [1/2]

template<class ALLOCATOR , typename CAPACITY_POLICY >
template<typename POD >
::std::span< POD > mdbx::buffer< ALLOCATOR, CAPACITY_POLICY >::as_span ( )
inlineconstexpr

◆ as_span() [2/2]

template<class ALLOCATOR , typename CAPACITY_POLICY >
template<typename POD >
::std::span< const POD > mdbx::buffer< ALLOCATOR, CAPACITY_POLICY >::as_span ( ) const
inlineconstexpr

◆ as_string()

template<class ALLOCATOR , typename CAPACITY_POLICY >
template<class CHAR = char, class T = ::std::char_traits<CHAR>, class A = legacy_allocator>
::std::basic_string< CHAR, T, A > mdbx::buffer< ALLOCATOR, CAPACITY_POLICY >::as_string ( const A & allocator = A()) const
inline

◆ as_uint128()

template<class ALLOCATOR , typename CAPACITY_POLICY >
uint128_t mdbx::buffer< ALLOCATOR, CAPACITY_POLICY >::as_uint128 ( ) const
inlineconstexpr

◆ as_uint128_adapt()

template<class ALLOCATOR , typename CAPACITY_POLICY >
uint128_t mdbx::buffer< ALLOCATOR, CAPACITY_POLICY >::as_uint128_adapt ( ) const
inline

◆ as_uint16()

template<class ALLOCATOR , typename CAPACITY_POLICY >
uint16_t mdbx::buffer< ALLOCATOR, CAPACITY_POLICY >::as_uint16 ( ) const
inlineconstexpr

◆ as_uint16_adapt()

template<class ALLOCATOR , typename CAPACITY_POLICY >
uint16_t mdbx::buffer< ALLOCATOR, CAPACITY_POLICY >::as_uint16_adapt ( ) const
inline

◆ as_uint32()

template<class ALLOCATOR , typename CAPACITY_POLICY >
uint32_t mdbx::buffer< ALLOCATOR, CAPACITY_POLICY >::as_uint32 ( ) const
inlineconstexpr

◆ as_uint32_adapt()

template<class ALLOCATOR , typename CAPACITY_POLICY >
uint32_t mdbx::buffer< ALLOCATOR, CAPACITY_POLICY >::as_uint32_adapt ( ) const
inline

◆ as_uint64()

template<class ALLOCATOR , typename CAPACITY_POLICY >
uint64_t mdbx::buffer< ALLOCATOR, CAPACITY_POLICY >::as_uint64 ( ) const
inlineconstexpr

◆ as_uint64_adapt()

template<class ALLOCATOR , typename CAPACITY_POLICY >
uint64_t mdbx::buffer< ALLOCATOR, CAPACITY_POLICY >::as_uint64_adapt ( ) const
inline

◆ as_uint8()

template<class ALLOCATOR , typename CAPACITY_POLICY >
uint8_t mdbx::buffer< ALLOCATOR, CAPACITY_POLICY >::as_uint8 ( ) const
inlineconstexpr

◆ as_uint8_adapt()

template<class ALLOCATOR , typename CAPACITY_POLICY >
uint8_t mdbx::buffer< ALLOCATOR, CAPACITY_POLICY >::as_uint8_adapt ( ) const
inline

◆ assign() [1/9]

template<class ALLOCATOR , typename CAPACITY_POLICY >
buffer & mdbx::buffer< ALLOCATOR, CAPACITY_POLICY >::assign ( ::MDBX_val && src,
bool make_reference = false )
inline

◆ assign() [2/9]

template<class ALLOCATOR , typename CAPACITY_POLICY >
buffer & mdbx::buffer< ALLOCATOR, CAPACITY_POLICY >::assign ( const ::MDBX_val & src,
bool make_reference = false )
inline

◆ assign() [3/9]

template<class ALLOCATOR , typename CAPACITY_POLICY >
template<class CHAR , class T , class A >
buffer & mdbx::buffer< ALLOCATOR, CAPACITY_POLICY >::assign ( const ::std::basic_string< CHAR, T, A > & str,
bool make_reference = false )
inline

◆ assign() [4/9]

template<class ALLOCATOR , typename CAPACITY_POLICY >
buffer & mdbx::buffer< ALLOCATOR, CAPACITY_POLICY >::assign ( const buffer< ALLOCATOR, CAPACITY_POLICY > & src,
bool make_reference = false )
inline

◆ assign() [5/9]

template<class ALLOCATOR , typename CAPACITY_POLICY >
buffer & mdbx::buffer< ALLOCATOR, CAPACITY_POLICY >::assign ( const char * c_str,
bool make_reference = false )
inline

◆ assign() [6/9]

template<class ALLOCATOR , typename CAPACITY_POLICY >
buffer & mdbx::buffer< ALLOCATOR, CAPACITY_POLICY >::assign ( const struct slice & src,
bool make_reference = false )
inline

◆ assign() [7/9]

template<class ALLOCATOR , typename CAPACITY_POLICY >
buffer & mdbx::buffer< ALLOCATOR, CAPACITY_POLICY >::assign ( const void * begin,
const void * end,
bool make_reference = false )
inline

◆ assign() [8/9]

template<class ALLOCATOR , typename CAPACITY_POLICY >
buffer & mdbx::buffer< ALLOCATOR, CAPACITY_POLICY >::assign ( const void * ptr,
size_t bytes,
bool make_reference = false )
inline

◆ assign() [9/9]

template<class ALLOCATOR , typename CAPACITY_POLICY >
buffer & mdbx::buffer< ALLOCATOR, CAPACITY_POLICY >::assign ( struct slice && src,
bool make_reference = false )
inline

◆ assign_freestanding()

template<class ALLOCATOR , typename CAPACITY_POLICY >
buffer & mdbx::buffer< ALLOCATOR, CAPACITY_POLICY >::assign_freestanding ( const void * ptr,
size_t bytes )
inline

◆ assign_reference()

template<class ALLOCATOR , typename CAPACITY_POLICY >
buffer & mdbx::buffer< ALLOCATOR, CAPACITY_POLICY >::assign_reference ( const void * ptr,
size_t bytes )
inline

◆ at() [1/2]

template<class ALLOCATOR , typename CAPACITY_POLICY >
byte & mdbx::buffer< ALLOCATOR, CAPACITY_POLICY >::at ( size_t n)
inlineconstexpr

Accesses the specified byte of data chunk with bounds checking.

Exceptions
std::out_of_rangeif n >= size()

◆ at() [2/2]

template<class ALLOCATOR , typename CAPACITY_POLICY >
byte mdbx::buffer< ALLOCATOR, CAPACITY_POLICY >::at ( size_t n) const
inlineconstexpr

Accesses the specified byte of data chunk with bounds checking.

Exceptions
std::out_of_rangeif n >= size()

◆ base58() [1/2]

template<class ALLOCATOR , typename CAPACITY_POLICY >
static buffer mdbx::buffer< ALLOCATOR, CAPACITY_POLICY >::base58 ( const ::mdbx::slice & source,
unsigned wrap_width = 0,
const allocator_type & allocator = allocator_type() )
inlinestatic

Returns a new buffer with a Base58 dump of the slice content.

◆ base58() [2/2]

template<class ALLOCATOR , typename CAPACITY_POLICY >
template<typename POD >
static buffer mdbx::buffer< ALLOCATOR, CAPACITY_POLICY >::base58 ( const POD & pod,
unsigned wrap_width = 0,
const allocator_type & allocator = allocator_type() )
inlinestatic

Returns a new buffer with a Base58 dump of the given pod.

◆ base58_decode() [1/2]

template<class ALLOCATOR , typename CAPACITY_POLICY >
buffer mdbx::buffer< ALLOCATOR, CAPACITY_POLICY >::base58_decode ( bool ignore_spaces = false,
const allocator_type & allocator = allocator_type() ) const
inline

Decodes Base58 dump from the buffer content to new returned buffer.

◆ base58_decode() [2/2]

template<class ALLOCATOR , typename CAPACITY_POLICY >
static buffer mdbx::buffer< ALLOCATOR, CAPACITY_POLICY >::base58_decode ( const ::mdbx::slice & source,
bool ignore_spaces = false,
const allocator_type & allocator = allocator_type() )
inlinestatic

Decodes Base58 dump from the slice content to returned buffer.

◆ base64() [1/2]

template<class ALLOCATOR , typename CAPACITY_POLICY >
static buffer mdbx::buffer< ALLOCATOR, CAPACITY_POLICY >::base64 ( const ::mdbx::slice & source,
unsigned wrap_width = 0,
const allocator_type & allocator = allocator_type() )
inlinestatic

Returns a new buffer with a Base64 dump of the slice content.

◆ base64() [2/2]

template<class ALLOCATOR , typename CAPACITY_POLICY >
template<typename POD >
static buffer mdbx::buffer< ALLOCATOR, CAPACITY_POLICY >::base64 ( const POD & pod,
unsigned wrap_width = 0,
const allocator_type & allocator = allocator_type() )
inlinestatic

Returns a new buffer with a Base64 dump of the given pod.

◆ base64_decode() [1/2]

template<class ALLOCATOR , typename CAPACITY_POLICY >
buffer mdbx::buffer< ALLOCATOR, CAPACITY_POLICY >::base64_decode ( bool ignore_spaces = false,
const allocator_type & allocator = allocator_type() ) const
inline

Decodes Base64 dump from the buffer content to new returned buffer.

◆ base64_decode() [2/2]

template<class ALLOCATOR , typename CAPACITY_POLICY >
static buffer mdbx::buffer< ALLOCATOR, CAPACITY_POLICY >::base64_decode ( const ::mdbx::slice & source,
bool ignore_spaces = false,
const allocator_type & allocator = allocator_type() )
inlinestatic

Decodes Base64 dump from the slice content to returned buffer.

◆ byte_ptr() [1/2]

template<class ALLOCATOR , typename CAPACITY_POLICY >
const byte * mdbx::buffer< ALLOCATOR, CAPACITY_POLICY >::byte_ptr ( ) const
inlineconstexprnoexcept

Returns casted to const pointer to byte an address of data.

◆ byte_ptr() [2/2]

template<class ALLOCATOR , typename CAPACITY_POLICY >
byte * mdbx::buffer< ALLOCATOR, CAPACITY_POLICY >::byte_ptr ( )
inlineconstexprnoexcept

Returns casted to pointer to byte an address of data.

Precondition
REQUIRES: The buffer should store data chunk, but not referenced to an external one.

◆ bytes() [1/2]

template<class ALLOCATOR , typename CAPACITY_POLICY >
::std::span< byte > mdbx::buffer< ALLOCATOR, CAPACITY_POLICY >::bytes ( )
inline

◆ bytes() [2/2]

template<class ALLOCATOR , typename CAPACITY_POLICY >
::std::span< const byte > mdbx::buffer< ALLOCATOR, CAPACITY_POLICY >::bytes ( ) const
inline

◆ capacity()

template<class ALLOCATOR , typename CAPACITY_POLICY >
size_t mdbx::buffer< ALLOCATOR, CAPACITY_POLICY >::capacity ( ) const
inlineconstexprnoexcept

Returns the number of bytes that can be held in currently allocated storage.

◆ char_ptr() [1/2]

template<class ALLOCATOR , typename CAPACITY_POLICY >
const char * mdbx::buffer< ALLOCATOR, CAPACITY_POLICY >::char_ptr ( ) const
inlineconstexprnoexcept

Returns casted to const pointer to char an address of data.

◆ char_ptr() [2/2]

template<class ALLOCATOR , typename CAPACITY_POLICY >
char * mdbx::buffer< ALLOCATOR, CAPACITY_POLICY >::char_ptr ( )
inlineconstexprnoexcept

Returns casted to pointer to char an address of data.

Precondition
REQUIRES: The buffer should store data chunk, but not referenced to an external one.

◆ chars() [1/2]

template<class ALLOCATOR , typename CAPACITY_POLICY >
::std::span< char > mdbx::buffer< ALLOCATOR, CAPACITY_POLICY >::chars ( )
inline

◆ chars() [2/2]

template<class ALLOCATOR , typename CAPACITY_POLICY >
::std::span< const char > mdbx::buffer< ALLOCATOR, CAPACITY_POLICY >::chars ( ) const
inline

◆ clear()

template<class ALLOCATOR , typename CAPACITY_POLICY >
void mdbx::buffer< ALLOCATOR, CAPACITY_POLICY >::clear ( )
inlinenoexcept

Clears the contents and storage.

◆ clear_and_reserve()

template<class ALLOCATOR , typename CAPACITY_POLICY >
void mdbx::buffer< ALLOCATOR, CAPACITY_POLICY >::clear_and_reserve ( size_t whole_capacity,
size_t headroom = 0 )
inlinenoexcept

Clears the contents and reserve storage.

◆ clone()

template<class ALLOCATOR , typename CAPACITY_POLICY >
static buffer mdbx::buffer< ALLOCATOR, CAPACITY_POLICY >::clone ( const buffer< ALLOCATOR, CAPACITY_POLICY > & src,
const allocator_type & allocator = allocator_type() )
inlinestatic

◆ data() [1/2]

template<class ALLOCATOR , typename CAPACITY_POLICY >
const void * mdbx::buffer< ALLOCATOR, CAPACITY_POLICY >::data ( ) const
inlineconstexprnoexcept

Return a const pointer to the beginning of the referenced data.

◆ data() [2/2]

template<class ALLOCATOR , typename CAPACITY_POLICY >
void * mdbx::buffer< ALLOCATOR, CAPACITY_POLICY >::data ( )
inlineconstexprnoexcept

Return a pointer to the beginning of the referenced data.

Precondition
REQUIRES: The buffer should store data chunk, but not referenced to an external one.

◆ empty()

template<class ALLOCATOR , typename CAPACITY_POLICY >
bool mdbx::buffer< ALLOCATOR, CAPACITY_POLICY >::empty ( ) const
inlineconstexprnoexcept

Checks whether the string is empty.

◆ encode_base58()

template<class ALLOCATOR , typename CAPACITY_POLICY >
buffer mdbx::buffer< ALLOCATOR, CAPACITY_POLICY >::encode_base58 ( unsigned wrap_width = 0,
const allocator_type & allocator = allocator_type() ) const
inline

Returns a new buffer with a Base58 dump of the slice content.

◆ encode_base64()

template<class ALLOCATOR , typename CAPACITY_POLICY >
buffer mdbx::buffer< ALLOCATOR, CAPACITY_POLICY >::encode_base64 ( unsigned wrap_width = 0,
const allocator_type & allocator = allocator_type() ) const
inline

Returns a new buffer with a Base64 dump of the slice content.

◆ encode_hex()

template<class ALLOCATOR , typename CAPACITY_POLICY >
buffer mdbx::buffer< ALLOCATOR, CAPACITY_POLICY >::encode_hex ( bool uppercase = false,
unsigned wrap_width = 0,
const allocator_type & allocator = allocator_type() ) const
inline

Returns a new buffer with a hexadecimal dump of the slice content.

◆ end() [1/2]

template<class ALLOCATOR , typename CAPACITY_POLICY >
const void * mdbx::buffer< ALLOCATOR, CAPACITY_POLICY >::end ( ) const
inlineconstexprnoexcept

Return a const pointer to the end of the referenced data.

◆ end() [2/2]

template<class ALLOCATOR , typename CAPACITY_POLICY >
void * mdbx::buffer< ALLOCATOR, CAPACITY_POLICY >::end ( )
inlineconstexprnoexcept

Return a pointer to the end of the referenced data.

Precondition
REQUIRES: The buffer should store data chunk, but not referenced to an external one.

◆ end_byte_ptr() [1/2]

template<class ALLOCATOR , typename CAPACITY_POLICY >
const byte * mdbx::buffer< ALLOCATOR, CAPACITY_POLICY >::end_byte_ptr ( ) const
inlineconstexprnoexcept

Returns casted to const pointer to byte an end of data.

◆ end_byte_ptr() [2/2]

template<class ALLOCATOR , typename CAPACITY_POLICY >
byte * mdbx::buffer< ALLOCATOR, CAPACITY_POLICY >::end_byte_ptr ( )
inlineconstexprnoexcept

Returns casted to pointer to byte an end of data.

Precondition
REQUIRES: The buffer should store data chunk, but not referenced to an external one.

◆ end_char_ptr() [1/2]

template<class ALLOCATOR , typename CAPACITY_POLICY >
const char * mdbx::buffer< ALLOCATOR, CAPACITY_POLICY >::end_char_ptr ( ) const
inlineconstexprnoexcept

Returns casted to const pointer to char an end of data.

◆ end_char_ptr() [2/2]

template<class ALLOCATOR , typename CAPACITY_POLICY >
char * mdbx::buffer< ALLOCATOR, CAPACITY_POLICY >::end_char_ptr ( )
inlineconstexprnoexcept

Returns casted to pointer to char an end of data.

Precondition
REQUIRES: The buffer should store data chunk, but not referenced to an external one.

◆ ends_with()

template<class ALLOCATOR , typename CAPACITY_POLICY >
bool mdbx::buffer< ALLOCATOR, CAPACITY_POLICY >::ends_with ( const struct slice & suffix) const
inlinenoexcept

Checks if the data ends with the given suffix.

◆ get_allocator()

template<class ALLOCATOR , typename CAPACITY_POLICY >
allocator_type mdbx::buffer< ALLOCATOR, CAPACITY_POLICY >::get_allocator ( ) const
inlineconstexpr

Returns the associated allocator.

◆ hash_value()

template<class ALLOCATOR , typename CAPACITY_POLICY >
size_t mdbx::buffer< ALLOCATOR, CAPACITY_POLICY >::hash_value ( ) const
inlineconstexprnoexcept

Returns the hash value of the data.

Attention
Function implementation and returned hash values may changed version to version, and in future the t1ha3 will be used here. Therefore values obtained from this function shouldn't be persisted anywhere.

◆ head()

template<class ALLOCATOR , typename CAPACITY_POLICY >
struct slice mdbx::buffer< ALLOCATOR, CAPACITY_POLICY >::head ( size_t n) const
inlinenoexcept

Returns the first "n" bytes of the data chunk.

Precondition
REQUIRES: n <= size()

◆ headroom()

template<class ALLOCATOR , typename CAPACITY_POLICY >
size_t mdbx::buffer< ALLOCATOR, CAPACITY_POLICY >::headroom ( ) const
inlineconstexprnoexcept

Returns the number of bytes that available in currently allocated storage ahead the currently beginning of data.

◆ hex() [1/2]

template<class ALLOCATOR , typename CAPACITY_POLICY >
static buffer mdbx::buffer< ALLOCATOR, CAPACITY_POLICY >::hex ( const ::mdbx::slice & source,
bool uppercase = false,
unsigned wrap_width = 0,
const allocator_type & allocator = allocator_type() )
inlinestatic

Returns a new buffer with a hexadecimal dump of the slice content.

◆ hex() [2/2]

template<class ALLOCATOR , typename CAPACITY_POLICY >
template<typename POD >
static buffer mdbx::buffer< ALLOCATOR, CAPACITY_POLICY >::hex ( const POD & pod,
bool uppercase = false,
unsigned wrap_width = 0,
const allocator_type & allocator = allocator_type() )
inlinestatic

Returns a new buffer with a hexadecimal dump of the given pod.

◆ hex_decode() [1/2]

template<class ALLOCATOR , typename CAPACITY_POLICY >
buffer mdbx::buffer< ALLOCATOR, CAPACITY_POLICY >::hex_decode ( bool ignore_spaces = false,
const allocator_type & allocator = allocator_type() ) const
inline

Decodes hexadecimal dump from the buffer content to new returned buffer.

◆ hex_decode() [2/2]

template<class ALLOCATOR , typename CAPACITY_POLICY >
static buffer mdbx::buffer< ALLOCATOR, CAPACITY_POLICY >::hex_decode ( const ::mdbx::slice & source,
bool ignore_spaces = false,
const allocator_type & allocator = allocator_type() )
inlinestatic

Decodes hexadecimal dump from the slice content to returned buffer.

◆ is_freestanding()

template<class ALLOCATOR , typename CAPACITY_POLICY >
bool mdbx::buffer< ALLOCATOR, CAPACITY_POLICY >::is_freestanding ( ) const
inlineconstexprnoexcept

Checks whether data chunk stored inside the buffer, otherwise buffer just refers to data located outside the buffer.

◆ is_null()

template<class ALLOCATOR , typename CAPACITY_POLICY >
bool mdbx::buffer< ALLOCATOR, CAPACITY_POLICY >::is_null ( ) const
inlineconstexprnoexcept

Checks whether the data pointer of the buffer is nullptr.

◆ is_reference()

template<class ALLOCATOR , typename CAPACITY_POLICY >
bool mdbx::buffer< ALLOCATOR, CAPACITY_POLICY >::is_reference ( ) const
inlineconstexprnoexcept

Checks whether the buffer just refers to data located outside the buffer, rather than stores it.

◆ key_from() [1/13]

template<class ALLOCATOR , typename CAPACITY_POLICY >
template<class CHAR , class T , class A >
static buffer mdbx::buffer< ALLOCATOR, CAPACITY_POLICY >::key_from ( const ::std::basic_string< CHAR, T, A > & src,
bool make_reference = false )
inlinestatic

◆ key_from() [2/13]

template<class ALLOCATOR , typename CAPACITY_POLICY >
template<class CHAR , class T >
static buffer mdbx::buffer< ALLOCATOR, CAPACITY_POLICY >::key_from ( const ::std::basic_string_view< CHAR, T > & src,
bool make_reference = false )
inlinestatic

◆ key_from() [3/13]

template<class ALLOCATOR , typename CAPACITY_POLICY >
static buffer mdbx::buffer< ALLOCATOR, CAPACITY_POLICY >::key_from ( const char * src,
bool make_reference = false )
inlinestatic

◆ key_from() [4/13]

template<class ALLOCATOR , typename CAPACITY_POLICY >
template<size_t SIZE>
static buffer mdbx::buffer< ALLOCATOR, CAPACITY_POLICY >::key_from ( const char(&) text[SIZE],
bool make_reference = true )
inlinestatic

◆ key_from() [5/13]

template<class ALLOCATOR , typename CAPACITY_POLICY >
static buffer mdbx::buffer< ALLOCATOR, CAPACITY_POLICY >::key_from ( const double * ieee754_64bit)
inlinestatic

◆ key_from() [6/13]

template<class ALLOCATOR , typename CAPACITY_POLICY >
static buffer mdbx::buffer< ALLOCATOR, CAPACITY_POLICY >::key_from ( const double ieee754_64bit)
inlinestatic

◆ key_from() [7/13]

template<class ALLOCATOR , typename CAPACITY_POLICY >
static buffer mdbx::buffer< ALLOCATOR, CAPACITY_POLICY >::key_from ( const float * ieee754_32bit)
inlinestatic

◆ key_from() [8/13]

template<class ALLOCATOR , typename CAPACITY_POLICY >
static buffer mdbx::buffer< ALLOCATOR, CAPACITY_POLICY >::key_from ( const float ieee754_32bit)
inlinestatic

◆ key_from() [9/13]

template<class ALLOCATOR , typename CAPACITY_POLICY >
static buffer mdbx::buffer< ALLOCATOR, CAPACITY_POLICY >::key_from ( const int32_t signed_int32)
inlinestatic

◆ key_from() [10/13]

template<class ALLOCATOR , typename CAPACITY_POLICY >
static buffer mdbx::buffer< ALLOCATOR, CAPACITY_POLICY >::key_from ( const int64_t signed_int64)
inlinestatic

◆ key_from() [11/13]

template<class ALLOCATOR , typename CAPACITY_POLICY >
static buffer mdbx::buffer< ALLOCATOR, CAPACITY_POLICY >::key_from ( const uint32_t unsigned_int32)
inlinestatic

◆ key_from() [12/13]

template<class ALLOCATOR , typename CAPACITY_POLICY >
static buffer mdbx::buffer< ALLOCATOR, CAPACITY_POLICY >::key_from ( const uint64_t unsigned_int64)
inlinestatic

◆ key_from() [13/13]

template<class ALLOCATOR , typename CAPACITY_POLICY >
static buffer mdbx::buffer< ALLOCATOR, CAPACITY_POLICY >::key_from ( silo && src)
inlinestaticnoexcept

◆ key_from_double()

template<class ALLOCATOR , typename CAPACITY_POLICY >
static buffer mdbx::buffer< ALLOCATOR, CAPACITY_POLICY >::key_from_double ( const double ieee754_64bit)
inlinestatic

◆ key_from_float()

template<class ALLOCATOR , typename CAPACITY_POLICY >
static buffer mdbx::buffer< ALLOCATOR, CAPACITY_POLICY >::key_from_float ( const float ieee754_32bit)
inlinestatic

◆ key_from_i32()

template<class ALLOCATOR , typename CAPACITY_POLICY >
static buffer mdbx::buffer< ALLOCATOR, CAPACITY_POLICY >::key_from_i32 ( const int32_t signed_int32)
inlinestatic

◆ key_from_i64()

template<class ALLOCATOR , typename CAPACITY_POLICY >
static buffer mdbx::buffer< ALLOCATOR, CAPACITY_POLICY >::key_from_i64 ( const int64_t signed_int64)
inlinestatic

◆ key_from_jsonInteger()

template<class ALLOCATOR , typename CAPACITY_POLICY >
static buffer mdbx::buffer< ALLOCATOR, CAPACITY_POLICY >::key_from_jsonInteger ( const int64_t json_integer)
inlinestatic

◆ key_from_u32()

template<class ALLOCATOR , typename CAPACITY_POLICY >
static buffer mdbx::buffer< ALLOCATOR, CAPACITY_POLICY >::key_from_u32 ( const uint32_t unsigned_int32)
inlinestatic

◆ key_from_u64()

template<class ALLOCATOR , typename CAPACITY_POLICY >
static buffer mdbx::buffer< ALLOCATOR, CAPACITY_POLICY >::key_from_u64 ( const uint64_t unsigned_int64)
inlinestatic

◆ length()

template<class ALLOCATOR , typename CAPACITY_POLICY >
size_t mdbx::buffer< ALLOCATOR, CAPACITY_POLICY >::length ( ) const
inlineconstexprnoexcept

Returns the number of bytes.

◆ make_freestanding()

template<class ALLOCATOR , typename CAPACITY_POLICY >
void mdbx::buffer< ALLOCATOR, CAPACITY_POLICY >::make_freestanding ( )
inline

Makes buffer owning the data.

If buffer refers to an external data, then makes it the owner of clone by allocating storage and copying the data.

◆ middle()

template<class ALLOCATOR , typename CAPACITY_POLICY >
struct slice mdbx::buffer< ALLOCATOR, CAPACITY_POLICY >::middle ( size_t from,
size_t n ) const
inlinenoexcept

Returns the middle "n" bytes of the data chunk.

Precondition
REQUIRES: from + n <= size()

◆ operator const struct slice &()

template<class ALLOCATOR , typename CAPACITY_POLICY >
mdbx::buffer< ALLOCATOR, CAPACITY_POLICY >::operator const struct slice & ( ) const
inlineconstexprnoexcept

◆ operator::std::basic_string()

template<class ALLOCATOR , typename CAPACITY_POLICY >
template<class CHAR , class T , class A >
mdbx::buffer< ALLOCATOR, CAPACITY_POLICY >::operator::std::basic_string ( ) const
inlineexplicitconstexpr

◆ operator::std::basic_string_view()

template<class ALLOCATOR , typename CAPACITY_POLICY >
template<class CHAR , class T >
mdbx::buffer< ALLOCATOR, CAPACITY_POLICY >::operator::std::basic_string_view ( ) const
inlinenoexcept

Return a string_view that references the data of this buffer.

◆ operator=() [1/5]

template<class ALLOCATOR , typename CAPACITY_POLICY >
buffer & mdbx::buffer< ALLOCATOR, CAPACITY_POLICY >::operator= ( buffer< ALLOCATOR, CAPACITY_POLICY > && src)
inlinenoexcept

◆ operator=() [2/5]

template<class ALLOCATOR , typename CAPACITY_POLICY >
template<class CHAR , class T >
buffer & mdbx::buffer< ALLOCATOR, CAPACITY_POLICY >::operator= ( const ::std::basic_string_view< CHAR, T > & view)
inlinenoexcept

◆ operator=() [3/5]

template<class ALLOCATOR , typename CAPACITY_POLICY >
buffer & mdbx::buffer< ALLOCATOR, CAPACITY_POLICY >::operator= ( const buffer< ALLOCATOR, CAPACITY_POLICY > & src)
inline

◆ operator=() [4/5]

template<class ALLOCATOR , typename CAPACITY_POLICY >
buffer & mdbx::buffer< ALLOCATOR, CAPACITY_POLICY >::operator= ( const struct slice & src)
inline

◆ operator=() [5/5]

template<class ALLOCATOR , typename CAPACITY_POLICY >
buffer & mdbx::buffer< ALLOCATOR, CAPACITY_POLICY >::operator= ( struct slice && src)
inline

◆ operator[]() [1/2]

template<class ALLOCATOR , typename CAPACITY_POLICY >
byte mdbx::buffer< ALLOCATOR, CAPACITY_POLICY >::operator[] ( size_t n) const
inlineconstexprnoexcept

Accesses the specified byte of data chunk.

Precondition
REQUIRES: n < size()

◆ operator[]() [2/2]

template<class ALLOCATOR , typename CAPACITY_POLICY >
byte & mdbx::buffer< ALLOCATOR, CAPACITY_POLICY >::operator[] ( size_t n)
inlineconstexprnoexcept

Accesses the specified byte of data chunk.

Precondition
REQUIRES: n < size()

◆ remove_prefix()

template<class ALLOCATOR , typename CAPACITY_POLICY >
void mdbx::buffer< ALLOCATOR, CAPACITY_POLICY >::remove_prefix ( size_t n)
inlinenoexcept

Drops the first "n" bytes from the data chunk.

Precondition
REQUIRES: n <= size()

◆ remove_suffix()

template<class ALLOCATOR , typename CAPACITY_POLICY >
void mdbx::buffer< ALLOCATOR, CAPACITY_POLICY >::remove_suffix ( size_t n)
inlinenoexcept

Drops the last "n" bytes from the data chunk.

Precondition
REQUIRES: n <= size()

◆ reserve()

template<class ALLOCATOR , typename CAPACITY_POLICY >
void mdbx::buffer< ALLOCATOR, CAPACITY_POLICY >::reserve ( size_t wanna_headroom,
size_t wanna_tailroom )
inline

Reserves storage space.

◆ reserve_headroom()

template<class ALLOCATOR , typename CAPACITY_POLICY >
void mdbx::buffer< ALLOCATOR, CAPACITY_POLICY >::reserve_headroom ( size_t wanna_headroom)
inline

Reserves space before the payload.

◆ reserve_tailroom()

template<class ALLOCATOR , typename CAPACITY_POLICY >
void mdbx::buffer< ALLOCATOR, CAPACITY_POLICY >::reserve_tailroom ( size_t wanna_tailroom)
inline

Reserves space after the payload.

◆ safe_head()

template<class ALLOCATOR , typename CAPACITY_POLICY >
struct slice mdbx::buffer< ALLOCATOR, CAPACITY_POLICY >::safe_head ( size_t n) const
inline

Returns the first "n" bytes of the data chunk.

Exceptions
std::out_of_rangeif n >= size()

◆ safe_middle()

template<class ALLOCATOR , typename CAPACITY_POLICY >
struct slice mdbx::buffer< ALLOCATOR, CAPACITY_POLICY >::safe_middle ( size_t from,
size_t n ) const
inline

Returns the middle "n" bytes of the data chunk.

Exceptions
std::out_of_rangeif from + n >= size()

◆ safe_remove_prefix()

template<class ALLOCATOR , typename CAPACITY_POLICY >
void mdbx::buffer< ALLOCATOR, CAPACITY_POLICY >::safe_remove_prefix ( size_t n)
inline

Drops the first "n" bytes from the data chunk.

Exceptions
std::out_of_rangeif n > size()

◆ safe_remove_suffix()

template<class ALLOCATOR , typename CAPACITY_POLICY >
void mdbx::buffer< ALLOCATOR, CAPACITY_POLICY >::safe_remove_suffix ( size_t n)
inline

Drops the last "n" bytes from the data chunk.

Exceptions
std::out_of_rangeif n > size()

◆ safe_tail()

template<class ALLOCATOR , typename CAPACITY_POLICY >
struct slice mdbx::buffer< ALLOCATOR, CAPACITY_POLICY >::safe_tail ( size_t n) const
inline

Returns the last "n" bytes of the data chunk.

Exceptions
std::out_of_rangeif n >= size()

◆ set_end()

template<class ALLOCATOR , typename CAPACITY_POLICY >
buffer & mdbx::buffer< ALLOCATOR, CAPACITY_POLICY >::set_end ( const void * ptr)
inlineconstexpr

Sets the length by specifying the end of the data.

◆ set_length()

template<class ALLOCATOR , typename CAPACITY_POLICY >
buffer & mdbx::buffer< ALLOCATOR, CAPACITY_POLICY >::set_length ( size_t bytes)
inlineconstexpr

Set length of data.

◆ shrink_to_fit()

template<class ALLOCATOR , typename CAPACITY_POLICY >
void mdbx::buffer< ALLOCATOR, CAPACITY_POLICY >::shrink_to_fit ( )
inline

Reduces memory usage by freeing unused storage space.

◆ size()

template<class ALLOCATOR , typename CAPACITY_POLICY >
size_t mdbx::buffer< ALLOCATOR, CAPACITY_POLICY >::size ( ) const
inlineconstexprnoexcept

Returns the number of bytes.

◆ slice()

template<class ALLOCATOR , typename CAPACITY_POLICY >
const struct slice & mdbx::buffer< ALLOCATOR, CAPACITY_POLICY >::slice ( ) const
inlinenoexcept

◆ starts_with()

template<class ALLOCATOR , typename CAPACITY_POLICY >
bool mdbx::buffer< ALLOCATOR, CAPACITY_POLICY >::starts_with ( const struct slice & prefix) const
inlinenoexcept

Checks if the data starts with the given prefix.

◆ string_view()

template<class ALLOCATOR , typename CAPACITY_POLICY >
template<class CHAR = char, class T = ::std::char_traits<CHAR>>
::std::basic_string_view< CHAR, T > mdbx::buffer< ALLOCATOR, CAPACITY_POLICY >::string_view ( ) const
inlinenoexcept

Return a string_view that references the data of this buffer.

◆ swap()

template<class ALLOCATOR , typename CAPACITY_POLICY >
void mdbx::buffer< ALLOCATOR, CAPACITY_POLICY >::swap ( buffer< ALLOCATOR, CAPACITY_POLICY > & other)
inlineconstexprnoexcept

◆ tail()

template<class ALLOCATOR , typename CAPACITY_POLICY >
struct slice mdbx::buffer< ALLOCATOR, CAPACITY_POLICY >::tail ( size_t n) const
inlinenoexcept

Returns the last "n" bytes of the data chunk.

Precondition
REQUIRES: n <= size()

◆ tailroom()

template<class ALLOCATOR , typename CAPACITY_POLICY >
size_t mdbx::buffer< ALLOCATOR, CAPACITY_POLICY >::tailroom ( ) const
inlineconstexprnoexcept

Returns the number of bytes that available in currently allocated storage after the currently data end.

◆ wrap()

template<class ALLOCATOR , typename CAPACITY_POLICY >
template<typename POD >
static buffer mdbx::buffer< ALLOCATOR, CAPACITY_POLICY >::wrap ( const POD & pod,
bool make_reference = false,
const allocator_type & allocator = allocator_type() )
inlinestatic

Friends And Related Symbol Documentation

◆ txn

template<class ALLOCATOR , typename CAPACITY_POLICY >
friend class txn
friend

◆ mdbx::value_result

struct mdbx::value_result

Combines data slice with boolean flag to represent result of certain operations.

Public Member Functions

 value_result (const slice &value, bool done) noexcept
 
 value_result (const value_result &) noexcept=default
 
value_resultoperator= (const value_result &) noexcept=default
 

Public Attributes

slice value
 
bool done
 

Constructor & Destructor Documentation

◆ value_result() [1/2]

mdbx::value_result::value_result ( const slice & value,
bool done )
inlinenoexcept

◆ value_result() [2/2]

mdbx::value_result::value_result ( const value_result & )
defaultnoexcept

Member Function Documentation

◆ operator=()

value_result & mdbx::value_result::operator= ( const value_result & )
defaultnoexcept

Member Data Documentation

◆ done

bool mdbx::value_result::done

◆ value

slice mdbx::value_result::value

◆ mdbx::pair

struct mdbx::pair

Combines pair of slices for key and value to represent result of certain operations.

Inherited by mdbx::cursor::estimate_result, and mdbx::pair_result.

Public Types

using stl_pair = std::pair<slice, slice>
 

Public Member Functions

constexpr pair (const slice &key, const slice &value) noexcept
 
constexpr pair (const stl_pair &couple) noexcept
 
constexpr operator stl_pair () const noexcept
 
 pair (const pair &) noexcept=default
 
pairoperator= (const pair &) noexcept=default
 

Static Public Member Functions

static constexpr pair invalid () noexcept
 
static constexpr intptr_t compare_fast (const pair &a, const pair &b) noexcept
 Three-way fast non-lexicographically length-based comparison.
 
static constexpr intptr_t compare_lexicographically (const pair &a, const pair &b) noexcept
 Three-way lexicographically comparison.
 

Public Attributes

slice key
 
slice value
 

Friends

constexpr bool operator== (const pair &a, const pair &b)
 
constexpr bool operator< (const pair &a, const pair &b)
 
constexpr bool operator> (const pair &a, const pair &b)
 
constexpr bool operator<= (const pair &a, const pair &b)
 
constexpr bool operator>= (const pair &a, const pair &b)
 
constexpr bool operator!= (const pair &a, const pair &b)
 

Member Typedef Documentation

◆ stl_pair

using mdbx::pair::stl_pair = std::pair<slice, slice>

Constructor & Destructor Documentation

◆ pair() [1/3]

mdbx::pair::pair ( const slice & key,
const slice & value )
inlineconstexprnoexcept

◆ pair() [2/3]

mdbx::pair::pair ( const stl_pair & couple)
inlineconstexprnoexcept

◆ pair() [3/3]

mdbx::pair::pair ( const pair & )
defaultnoexcept

Member Function Documentation

◆ invalid()

static constexpr pair mdbx::pair::invalid ( )
inlinestaticconstexprnoexcept

◆ operator stl_pair()

mdbx::pair::operator stl_pair ( ) const
inlineconstexprnoexcept

◆ operator=()

pair & mdbx::pair::operator= ( const pair & )
defaultnoexcept

Friends And Related Symbol Documentation

◆ operator!=

bool operator!= ( const pair & a,
const pair & b )
friend

◆ operator<

bool operator< ( const pair & a,
const pair & b )
friend

◆ operator<=

bool operator<= ( const pair & a,
const pair & b )
friend

◆ operator==

bool operator== ( const pair & a,
const pair & b )
friend

◆ operator>

bool operator> ( const pair & a,
const pair & b )
friend

◆ operator>=

bool operator>= ( const pair & a,
const pair & b )
friend

Member Data Documentation

◆ key

slice mdbx::pair::key

◆ value

slice mdbx::pair::value

◆ mdbx::pair_result

struct mdbx::pair_result

Combines pair of slices for key and value with boolean flag to represent result of certain operations.

Inherits mdbx::pair.

Inherited by mdbx::cursor::move_result.

Public Member Functions

constexpr pair_result () noexcept
 
constexpr pair_result (const slice &key, const slice &value, bool done) noexcept
 
 pair_result (const pair_result &) noexcept=default
 
pair_resultoperator= (const pair_result &) noexcept=default
 
- Public Member Functions inherited from mdbx::pair
constexpr pair (const slice &key, const slice &value) noexcept
 
constexpr pair (const stl_pair &couple) noexcept
 
constexpr operator stl_pair () const noexcept
 
 pair (const pair &) noexcept=default
 
pairoperator= (const pair &) noexcept=default
 

Public Attributes

bool done
 
- Public Attributes inherited from mdbx::pair
slice key
 
slice value
 

Additional Inherited Members

- Public Types inherited from mdbx::pair
using stl_pair = std::pair<slice, slice>
 
- Static Public Member Functions inherited from mdbx::pair
static constexpr pair invalid () noexcept
 
static constexpr intptr_t compare_fast (const pair &a, const pair &b) noexcept
 Three-way fast non-lexicographically length-based comparison.
 
static constexpr intptr_t compare_lexicographically (const pair &a, const pair &b) noexcept
 Three-way lexicographically comparison.
 

Constructor & Destructor Documentation

◆ pair_result() [1/3]

mdbx::pair_result::pair_result ( )
inlineconstexprnoexcept

◆ pair_result() [2/3]

mdbx::pair_result::pair_result ( const slice & key,
const slice & value,
bool done )
inlineconstexprnoexcept

◆ pair_result() [3/3]

mdbx::pair_result::pair_result ( const pair_result & )
defaultnoexcept

Member Function Documentation

◆ operator=()

pair_result & mdbx::pair_result::operator= ( const pair_result & )
defaultnoexcept

Member Data Documentation

◆ done

bool mdbx::pair_result::done

◆ mdbx::buffer_pair_spec

struct mdbx::buffer_pair_spec
template<typename ALLOCATOR, typename CAPACITY_POLICY>
struct mdbx::buffer_pair_spec< ALLOCATOR, CAPACITY_POLICY >

Public Types

using buffer_type = buffer<ALLOCATOR, CAPACITY_POLICY>
 
using allocator_type = typename buffer_type::allocator_type
 
using allocator_traits = typename buffer_type::allocator_traits
 
using reservation_policy = CAPACITY_POLICY
 
using stl_pair = ::std::pair<buffer_type, buffer_type>
 

Public Member Functions

constexpr buffer_pair_spec () noexcept=default
 
constexpr buffer_pair_spec (const allocator_type &allocator) noexcept
 
 buffer_pair_spec (const buffer_type &key, const buffer_type &value, const allocator_type &allocator=allocator_type())
 
 buffer_pair_spec (const buffer_type &key, const buffer_type &value, bool make_reference, const allocator_type &allocator=allocator_type())
 
 buffer_pair_spec (const stl_pair &pair, const allocator_type &allocator=allocator_type())
 
 buffer_pair_spec (const stl_pair &pair, bool make_reference, const allocator_type &allocator=allocator_type())
 
 buffer_pair_spec (const slice &key, const slice &value, const allocator_type &allocator=allocator_type())
 
 buffer_pair_spec (const slice &key, const slice &value, bool make_reference, const allocator_type &allocator=allocator_type())
 
 buffer_pair_spec (const pair &pair, const allocator_type &allocator=allocator_type())
 
 buffer_pair_spec (const pair &pair, bool make_reference, const allocator_type &allocator=allocator_type())
 
 buffer_pair_spec (const txn &txn, const slice &key, const slice &value, const allocator_type &allocator=allocator_type())
 
 buffer_pair_spec (const txn &txn, const pair &pair, const allocator_type &allocator=allocator_type())
 
 buffer_pair_spec (buffer_type &&key, buffer_type &&value) noexcept(buffer_type::move_assign_alloc::is_nothrow())
 
 buffer_pair_spec (buffer_pair_spec &&pair) noexcept(buffer_type::move_assign_alloc::is_nothrow())
 
constexpr bool is_freestanding () const noexcept
 Checks whether data chunk stored inside the buffers both, otherwise at least one of buffers just refers to data located outside.
 
constexpr bool is_reference () const noexcept
 Checks whether one of the buffers just refers to data located outside the buffer, rather than stores it.
 
void make_freestanding ()
 Makes buffers owning the data.
 
 operator pair () const noexcept
 

Public Attributes

buffer_type key
 
buffer_type value
 

Member Typedef Documentation

◆ allocator_traits

template<typename ALLOCATOR , typename CAPACITY_POLICY >
using mdbx::buffer_pair_spec< ALLOCATOR, CAPACITY_POLICY >::allocator_traits = typename buffer_type::allocator_traits

◆ allocator_type

template<typename ALLOCATOR , typename CAPACITY_POLICY >
using mdbx::buffer_pair_spec< ALLOCATOR, CAPACITY_POLICY >::allocator_type = typename buffer_type::allocator_type

◆ buffer_type

template<typename ALLOCATOR , typename CAPACITY_POLICY >
using mdbx::buffer_pair_spec< ALLOCATOR, CAPACITY_POLICY >::buffer_type = buffer<ALLOCATOR, CAPACITY_POLICY>

◆ reservation_policy

template<typename ALLOCATOR , typename CAPACITY_POLICY >
using mdbx::buffer_pair_spec< ALLOCATOR, CAPACITY_POLICY >::reservation_policy = CAPACITY_POLICY

◆ stl_pair

template<typename ALLOCATOR , typename CAPACITY_POLICY >
using mdbx::buffer_pair_spec< ALLOCATOR, CAPACITY_POLICY >::stl_pair = ::std::pair<buffer_type, buffer_type>

Constructor & Destructor Documentation

◆ buffer_pair_spec() [1/14]

template<typename ALLOCATOR , typename CAPACITY_POLICY >
mdbx::buffer_pair_spec< ALLOCATOR, CAPACITY_POLICY >::buffer_pair_spec ( )
constexprdefaultnoexcept

◆ buffer_pair_spec() [2/14]

template<typename ALLOCATOR , typename CAPACITY_POLICY >
mdbx::buffer_pair_spec< ALLOCATOR, CAPACITY_POLICY >::buffer_pair_spec ( const allocator_type & allocator)
inlineconstexprnoexcept

◆ buffer_pair_spec() [3/14]

template<typename ALLOCATOR , typename CAPACITY_POLICY >
mdbx::buffer_pair_spec< ALLOCATOR, CAPACITY_POLICY >::buffer_pair_spec ( const buffer_type & key,
const buffer_type & value,
const allocator_type & allocator = allocator_type() )
inline

◆ buffer_pair_spec() [4/14]

template<typename ALLOCATOR , typename CAPACITY_POLICY >
mdbx::buffer_pair_spec< ALLOCATOR, CAPACITY_POLICY >::buffer_pair_spec ( const buffer_type & key,
const buffer_type & value,
bool make_reference,
const allocator_type & allocator = allocator_type() )
inline

◆ buffer_pair_spec() [5/14]

template<typename ALLOCATOR , typename CAPACITY_POLICY >
mdbx::buffer_pair_spec< ALLOCATOR, CAPACITY_POLICY >::buffer_pair_spec ( const stl_pair & pair,
const allocator_type & allocator = allocator_type() )
inline

◆ buffer_pair_spec() [6/14]

template<typename ALLOCATOR , typename CAPACITY_POLICY >
mdbx::buffer_pair_spec< ALLOCATOR, CAPACITY_POLICY >::buffer_pair_spec ( const stl_pair & pair,
bool make_reference,
const allocator_type & allocator = allocator_type() )
inline

◆ buffer_pair_spec() [7/14]

template<typename ALLOCATOR , typename CAPACITY_POLICY >
mdbx::buffer_pair_spec< ALLOCATOR, CAPACITY_POLICY >::buffer_pair_spec ( const slice & key,
const slice & value,
const allocator_type & allocator = allocator_type() )
inline

◆ buffer_pair_spec() [8/14]

template<typename ALLOCATOR , typename CAPACITY_POLICY >
mdbx::buffer_pair_spec< ALLOCATOR, CAPACITY_POLICY >::buffer_pair_spec ( const slice & key,
const slice & value,
bool make_reference,
const allocator_type & allocator = allocator_type() )
inline

◆ buffer_pair_spec() [9/14]

template<typename ALLOCATOR , typename CAPACITY_POLICY >
mdbx::buffer_pair_spec< ALLOCATOR, CAPACITY_POLICY >::buffer_pair_spec ( const pair & pair,
const allocator_type & allocator = allocator_type() )
inline

◆ buffer_pair_spec() [10/14]

template<typename ALLOCATOR , typename CAPACITY_POLICY >
mdbx::buffer_pair_spec< ALLOCATOR, CAPACITY_POLICY >::buffer_pair_spec ( const pair & pair,
bool make_reference,
const allocator_type & allocator = allocator_type() )
inline

◆ buffer_pair_spec() [11/14]

template<typename ALLOCATOR , typename CAPACITY_POLICY >
mdbx::buffer_pair_spec< ALLOCATOR, CAPACITY_POLICY >::buffer_pair_spec ( const txn & txn,
const slice & key,
const slice & value,
const allocator_type & allocator = allocator_type() )
inline

◆ buffer_pair_spec() [12/14]

template<typename ALLOCATOR , typename CAPACITY_POLICY >
mdbx::buffer_pair_spec< ALLOCATOR, CAPACITY_POLICY >::buffer_pair_spec ( const txn & txn,
const pair & pair,
const allocator_type & allocator = allocator_type() )
inline

◆ buffer_pair_spec() [13/14]

template<typename ALLOCATOR , typename CAPACITY_POLICY >
mdbx::buffer_pair_spec< ALLOCATOR, CAPACITY_POLICY >::buffer_pair_spec ( buffer_type && key,
buffer_type && value )
inlinenoexcept

◆ buffer_pair_spec() [14/14]

template<typename ALLOCATOR , typename CAPACITY_POLICY >
mdbx::buffer_pair_spec< ALLOCATOR, CAPACITY_POLICY >::buffer_pair_spec ( buffer_pair_spec< ALLOCATOR, CAPACITY_POLICY > && pair)
inlinenoexcept

Member Function Documentation

◆ is_freestanding()

template<typename ALLOCATOR , typename CAPACITY_POLICY >
bool mdbx::buffer_pair_spec< ALLOCATOR, CAPACITY_POLICY >::is_freestanding ( ) const
inlineconstexprnoexcept

Checks whether data chunk stored inside the buffers both, otherwise at least one of buffers just refers to data located outside.

◆ is_reference()

template<typename ALLOCATOR , typename CAPACITY_POLICY >
bool mdbx::buffer_pair_spec< ALLOCATOR, CAPACITY_POLICY >::is_reference ( ) const
inlineconstexprnoexcept

Checks whether one of the buffers just refers to data located outside the buffer, rather than stores it.

◆ make_freestanding()

template<typename ALLOCATOR , typename CAPACITY_POLICY >
void mdbx::buffer_pair_spec< ALLOCATOR, CAPACITY_POLICY >::make_freestanding ( )
inline

Makes buffers owning the data.

If buffer refers to an external data, then makes it the owner of clone by allocating storage and copying the data.

◆ operator pair()

template<typename ALLOCATOR , typename CAPACITY_POLICY >
mdbx::buffer_pair_spec< ALLOCATOR, CAPACITY_POLICY >::operator pair ( ) const
inlinenoexcept

Member Data Documentation

◆ key

template<typename ALLOCATOR , typename CAPACITY_POLICY >
buffer_type mdbx::buffer_pair_spec< ALLOCATOR, CAPACITY_POLICY >::key

◆ value

template<typename ALLOCATOR , typename CAPACITY_POLICY >
buffer_type mdbx::buffer_pair_spec< ALLOCATOR, CAPACITY_POLICY >::value

◆ MutableByteProducer

interface MutableByteProducer

MutableByteProducer C++20 concept.

◆ ImmutableByteProducer

interface ImmutableByteProducer

ImmutableByteProducer C++20 concept.

◆ SliceTranscoder

interface SliceTranscoder

SliceTranscoder C++20 concept.

Typedef Documentation

◆ buffer_pair

template<typename BUFFER >
using mdbx::buffer_pair = buffer_pair_spec<typename BUFFER::allocator_type, typename BUFFER::reservation_policy>

Function Documentation

◆ make_buffer() [1/2]

template<class ALLOCATOR = default_allocator, typename CAPACITY_POLICY = default_capacity_policy, ImmutableByteProducer PRODUCER>
buffer< ALLOCATOR, CAPACITY_POLICY > mdbx::make_buffer ( const PRODUCER & producer,
const ALLOCATOR & allocator = ALLOCATOR() )
inline

◆ make_buffer() [2/2]

template<class ALLOCATOR = default_allocator, typename CAPACITY_POLICY = default_capacity_policy, MutableByteProducer PRODUCER>
buffer< ALLOCATOR, CAPACITY_POLICY > mdbx::make_buffer ( PRODUCER & producer,
const ALLOCATOR & allocator = ALLOCATOR() )
inline

◆ make_string() [1/2]

template<class ALLOCATOR = default_allocator, ImmutableByteProducer PRODUCER>
string< ALLOCATOR > mdbx::make_string ( const PRODUCER & producer,
const ALLOCATOR & allocator = ALLOCATOR() )
inline

◆ make_string() [2/2]

template<class ALLOCATOR = default_allocator, MutableByteProducer PRODUCER>
string< ALLOCATOR > mdbx::make_string ( PRODUCER & producer,
const ALLOCATOR & allocator = ALLOCATOR() )
inline

◆ operator<<() [1/3]

inline ::std::ostream & mdbx::operator<< ( ::std::ostream & out,
const to_base58 & wrapper )

◆ operator<<() [2/3]

inline ::std::ostream & mdbx::operator<< ( ::std::ostream & out,
const to_base64 & wrapper )

◆ operator<<() [3/3]

inline ::std::ostream & mdbx::operator<< ( ::std::ostream & out,
const to_hex & wrapper )