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) |
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.
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.
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 byte > | bytes () const |
constexpr ::std::span< byte > | bytes () |
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) | |
slice & | assign (const void *ptr, size_t bytes) |
slice & | assign (const slice &src) noexcept |
slice & | assign (const ::MDBX_val &src) |
slice & | assign (slice &&src) noexcept |
slice & | assign (::MDBX_val &&src) |
slice & | assign (const void *begin, const void *end) |
template<class CHAR , class T , class ALLOCATOR > | |
slice & | assign (const ::std::basic_string< CHAR, T, ALLOCATOR > &str) |
slice & | assign (const char *c_str) |
template<class CHAR , class T > | |
slice & | assign (const ::std::basic_string_view< CHAR, T > &view) |
template<class CHAR , class T > | |
slice & | assign (::std::basic_string_view< CHAR, T > &&view) |
slice & | operator= (const slice &) noexcept=default |
slice & | operator= (slice &&src) noexcept |
slice & | operator= (::MDBX_val &&src) |
operator MDBX_val * () noexcept | |
operator const MDBX_val * () const noexcept | |
template<class CHAR , class T > | |
slice & | operator= (const ::std::basic_string_view< CHAR, T > &view) |
template<class CHAR , class T > | |
slice & | operator= (::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 byte * | byte_ptr () const noexcept |
Returns casted to pointer to byte an address of data. | |
constexpr byte * | byte_ptr () noexcept |
constexpr const byte * | end_byte_ptr () const noexcept |
Returns casted to pointer to byte an end of data. | |
constexpr byte * | end_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 slice & | set_length (size_t bytes) |
Set slice length. | |
constexpr slice & | set_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) |
|
inlineconstexpr |
Create a slice that refers to text[0,strlen(text)-1].
|
inlineexplicitconstexpr |
Create a slice that refers to the contents of "str".
|
constexprdefaultnoexcept |
|
inlineconstexpr |
|
inlineconstexpr |
Create a slice that refers to the same contents as "string_view".
|
inline |
|
inlineconstexprprotectednoexcept |
|
inlineconstexpr |
int128_t mdbx::slice::as_int128_adapt | ( | ) | const |
|
inlineconstexpr |
int16_t mdbx::slice::as_int16_adapt | ( | ) | const |
|
inlineconstexpr |
int32_t mdbx::slice::as_int32_adapt | ( | ) | const |
|
inlineconstexpr |
int64_t mdbx::slice::as_int64_adapt | ( | ) | const |
|
inlineconstexpr |
int8_t mdbx::slice::as_int8_adapt | ( | ) | const |
|
inlineconstexpr |
|
inlineconstexpr |
|
inlineconstexpr |
|
inline |
|
inlineconstexpr |
uint128_t mdbx::slice::as_uint128_adapt | ( | ) | const |
|
inlineconstexpr |
uint16_t mdbx::slice::as_uint16_adapt | ( | ) | const |
|
inlineconstexpr |
uint32_t mdbx::slice::as_uint32_adapt | ( | ) | const |
|
inlineconstexpr |
uint64_t mdbx::slice::as_uint64_adapt | ( | ) | const |
|
inlineconstexpr |
uint8_t mdbx::slice::as_uint8_adapt | ( | ) | const |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inlinestaticconstexprnoexcept |
Build an invalid slice which non-zero length and refers to null address.
|
noexcept |
Checks whether the content of the slice is printable.
[in] | disable_utf8 | By 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. |
|
inlineconstexprnoexcept |
Checks the slice is not refers to null address or has zero length.
|
inlinenoexcept |
|
inlinenoexcept |
|
inlineexplicitconstexpr |
|
inlineexplicitconstexprnoexcept |
Return a string_view that references the same data as this slice.
|
inline |
|
inline |
|
inlinenoexcept |
Return a string_view that references the same data as this slice.
|
inlinenoexcept |
|
inlinestaticconstexpr |
|
inlinestaticconstexpr |
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) |
|
inlinestaticconstexpr |
|
inlinestaticconstexpr |
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 |
|
inlineconstexprnoexcept |
|
inline |
Returns a buffer with a hexadecimal dump of a passed slice.
|
inline |
Returns a string with a hexadecimal dump of a passed slice.
|
inlineconstexprnoexcept |
Returns the buffer size in bytes needed for hexadecimal dump of a passed slice.
|
inlinenoexcept |
Checks whether a passed slice is empty, and therefore there will be no output bytes.
|
inlinenoexcept |
Checks whether the content of a passed slice is a valid data and could be encoded or unexpectedly not.
::std::ostream & mdbx::to_hex::output | ( | ::std::ostream & | out | ) | const |
Output hexadecimal dump of passed slice to the std::ostream.
std::ios_base::failure | corresponding to std::ostream::write() behaviour. |
char * mdbx::to_hex::write_bytes | ( | char * | dest, |
size_t | dest_size ) const |
Fills the buffer by hexadecimal dump of a passed slice.
std::length_error | if given buffer is too small. |
const slice mdbx::to_hex::source |
const bool mdbx::to_hex::uppercase = false |
const unsigned mdbx::to_hex::wrap_width = 0 |
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 |
|
inlineconstexprnoexcept |
|
inline |
Returns a buffer with a Base58 dump of a passed slice.
|
inline |
Returns a string with a Base58 dump of a passed slice.
|
inlineconstexprnoexcept |
Returns the buffer size in bytes needed for Base58 dump of passed slice.
|
inlinenoexcept |
Checks whether a passed slice is empty, and therefore there will be no output bytes.
|
inlinenoexcept |
Checks whether the content of a passed slice is a valid data and could be encoded or unexpectedly not.
::std::ostream & mdbx::to_base58::output | ( | ::std::ostream & | out | ) | const |
Output Base58 dump of passed slice to the std::ostream.
std::ios_base::failure | corresponding to std::ostream::write() behaviour. |
char * mdbx::to_base58::write_bytes | ( | char * | dest, |
size_t | dest_size ) const |
Fills the buffer by Base58 dump of passed slice.
std::length_error | if given buffer is too small. |
const slice mdbx::to_base58::source |
const unsigned mdbx::to_base58::wrap_width = 0 |
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 |
|
inlineconstexprnoexcept |
|
inline |
Returns a buffer with a Base64 dump of a passed slice.
|
inline |
Returns a string with a Base64 dump of a passed slice.
|
inlineconstexprnoexcept |
Returns the buffer size in bytes needed for Base64 dump of passed slice.
|
inlinenoexcept |
Checks whether a passed slice is empty, and therefore there will be no output bytes.
|
inlinenoexcept |
Checks whether the content of a passed slice is a valid data and could be encoded or unexpectedly not.
::std::ostream & mdbx::to_base64::output | ( | ::std::ostream & | out | ) | const |
Output Base64 dump of passed slice to the std::ostream.
std::ios_base::failure | corresponding to std::ostream::write() behaviour. |
char * mdbx::to_base64::write_bytes | ( | char * | dest, |
size_t | dest_size ) const |
Fills the buffer by Base64 dump of passed slice.
std::length_error | if given buffer is too small. |
const slice mdbx::to_base64::source |
const unsigned mdbx::to_base64::wrap_width = 0 |
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 |
|
inlineconstexprnoexcept |
|
inline |
Decodes hexadecimal dump from a passed slice to returned buffer.
|
inline |
Decodes hexadecimal dump from a passed slice to returned string.
|
inlineconstexprnoexcept |
Returns the number of bytes needed for conversion hexadecimal dump from a passed slice to decoded data.
|
inlinenoexcept |
Checks whether a passed slice is empty, and therefore there will be no output bytes.
|
noexcept |
Checks whether the content of a passed slice is a valid hexadecimal dump, and therefore there could be decoded or not.
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.
std::length_error | if given buffer is too small. |
const bool mdbx::from_hex::ignore_spaces = false |
const slice mdbx::from_hex::source |
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 |
|
inlineconstexprnoexcept |
|
inline |
Decodes Base58 dump from a passed slice to returned buffer.
|
inline |
Decodes Base58 dump from a passed slice to returned string.
|
inlineconstexprnoexcept |
Returns the number of bytes needed for conversion Base58 dump from a passed slice to decoded data.
|
inlinenoexcept |
Checks whether a passed slice is empty, and therefore there will be no output bytes.
|
noexcept |
Checks whether the content of a passed slice is a valid Base58 dump, and therefore there could be decoded or not.
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.
std::length_error | if given buffer is too small. |
const bool mdbx::from_base58::ignore_spaces = false |
const slice mdbx::from_base58::source |
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 |
|
inlineconstexprnoexcept |
|
inline |
Decodes Base64 dump from a passed slice to returned buffer.
|
inline |
Decodes Base64 dump from a passed slice to returned string.
|
inlineconstexprnoexcept |
Returns the number of bytes needed for conversion Base64 dump from a passed slice to decoded data.
|
inlinenoexcept |
Checks whether a passed slice is empty, and therefore there will be no output bytes.
|
noexcept |
Checks whether the content of a passed slice is a valid Base64 dump, and therefore there could be decoded or not.
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.
std::length_error | if given buffer is too small. |
const bool mdbx::from_base64::ignore_spaces = false |
const slice mdbx::from_base64::source |
class mdbx::buffer |
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 byte * | byte_ptr () const noexcept |
Returns casted to const pointer to byte an address of data. | |
constexpr const byte * | end_byte_ptr () const noexcept |
Returns casted to const pointer to byte an end of data. | |
constexpr byte * | byte_ptr () noexcept |
Returns casted to pointer to byte an address of data. | |
constexpr byte * | end_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 buffer & | set_length (size_t bytes) |
Set length of data. | |
constexpr buffer & | set_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 slice & | slice () 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 byte > | bytes () const |
constexpr ::std::span< byte > | bytes () |
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. | |
buffer & | assign_reference (const void *ptr, size_t bytes) |
buffer & | assign_freestanding (const void *ptr, size_t bytes) |
constexpr void | swap (buffer &other) noexcept(swap_alloc::is_nothrow()) |
buffer & | assign (const buffer &src, bool make_reference=false) |
buffer & | assign (const void *ptr, size_t bytes, bool make_reference=false) |
buffer & | assign (const struct slice &src, bool make_reference=false) |
buffer & | assign (const ::MDBX_val &src, bool make_reference=false) |
buffer & | assign (struct slice &&src, bool make_reference=false) |
buffer & | assign (::MDBX_val &&src, bool make_reference=false) |
buffer & | assign (const void *begin, const void *end, bool make_reference=false) |
template<class CHAR , class T , class A > | |
buffer & | assign (const ::std::basic_string< CHAR, T, A > &str, bool make_reference=false) |
buffer & | assign (const char *c_str, bool make_reference=false) |
buffer & | operator= (const buffer &src) |
buffer & | operator= (buffer &&src) noexcept(move_assign_alloc::is_nothrow()) |
buffer & | operator= (const struct slice &src) |
buffer & | operator= (struct slice &&src) |
template<class CHAR , class T > | |
buffer & | operator= (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 byte & | operator[] (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 byte & | at (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. | |
buffer & | append (const void *src, size_t bytes) |
buffer & | append (const struct slice &chunk) |
buffer & | add_header (const void *src, size_t bytes) |
buffer & | add_header (const struct slice &chunk) |
template<MutableByteProducer PRODUCER> | |
buffer & | append_producer (PRODUCER &producer) |
template<ImmutableByteProducer PRODUCER> | |
buffer & | append_producer (const PRODUCER &producer) |
buffer & | append_hex (const struct slice &data, bool uppercase=false, unsigned wrap_width=0) |
buffer & | append_base58 (const struct slice &data, unsigned wrap_width=0) |
buffer & | append_base64 (const struct slice &data, unsigned wrap_width=0) |
buffer & | append_decoded_hex (const struct slice &data, bool ignore_spaces=false) |
buffer & | append_decoded_base58 (const struct slice &data, bool ignore_spaces=false) |
buffer & | append_decoded_base64 (const struct slice &data, bool ignore_spaces=false) |
buffer & | append_u8 (uint_fast8_t u8) |
buffer & | append_byte (uint_fast8_t byte) |
buffer & | append_u16 (uint_fast16_t u16) |
buffer & | append_u24 (uint_fast32_t u24) |
buffer & | append_u32 (uint_fast32_t u32) |
buffer & | append_u48 (uint_fast64_t u48) |
buffer & | append_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 |
using mdbx::buffer< ALLOCATOR, CAPACITY_POLICY >::allocator_traits = ::std::allocator_traits<allocator_type> |
using mdbx::buffer< ALLOCATOR, CAPACITY_POLICY >::allocator_type = typename ::std::allocator_traits<ALLOCATOR>::template rebind_alloc<uint64_t> |
using mdbx::buffer< ALLOCATOR, CAPACITY_POLICY >::copy_assign_alloc = allocation_aware_details::copy_assign_alloc<silo, allocator_type> |
using mdbx::buffer< ALLOCATOR, CAPACITY_POLICY >::move_assign_alloc = allocation_aware_details::move_assign_alloc<silo, allocator_type> |
using mdbx::buffer< ALLOCATOR, CAPACITY_POLICY >::reservation_policy = CAPACITY_POLICY |
anonymous enum : size_t |
|
constexprdefaultnoexcept |
|
inlineconstexprnoexcept |
|
inline |
|
inline |
|
inline |
|
delete |
|
delete |
|
inline |
|
inline |
|
inlineconstexpr |
|
inlineconstexpr |
|
inlineconstexpr |
|
inlineconstexpr |
|
inlineconstexpr |
|
inlineconstexpr |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inlinenoexcept |
|
inlineconstexpr |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inlineconstexpr |
|
inline |
|
inlineconstexpr |
|
inline |
|
inlineconstexpr |
|
inline |
|
inlineconstexpr |
|
inline |
|
inlineconstexpr |
|
inline |
|
inlineconstexpr |
|
inlineconstexpr |
|
inlineconstexpr |
|
inline |
|
inlineconstexpr |
|
inline |
|
inlineconstexpr |
|
inline |
|
inlineconstexpr |
|
inline |
|
inlineconstexpr |
|
inline |
|
inlineconstexpr |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inlineconstexpr |
Accesses the specified byte of data chunk with bounds checking.
std::out_of_range | if n >= size() |
|
inlineconstexpr |
Accesses the specified byte of data chunk with bounds checking.
std::out_of_range | if n >= size() |
|
inlinestatic |
Returns a new buffer with a Base58 dump of the slice content.
|
inlinestatic |
Returns a new buffer with a Base58 dump of the given pod.
|
inline |
Decodes Base58 dump from the buffer content to new returned buffer.
|
inlinestatic |
Decodes Base58 dump from the slice content to returned buffer.
|
inlinestatic |
Returns a new buffer with a Base64 dump of the slice content.
|
inlinestatic |
Returns a new buffer with a Base64 dump of the given pod.
|
inline |
Decodes Base64 dump from the buffer content to new returned buffer.
|
inlinestatic |
Decodes Base64 dump from the slice content to returned buffer.
|
inlineconstexprnoexcept |
Returns casted to const pointer to byte an address of data.
|
inlineconstexprnoexcept |
Returns casted to pointer to byte an address of data.
|
inline |
|
inline |
|
inlineconstexprnoexcept |
Returns the number of bytes that can be held in currently allocated storage.
|
inlineconstexprnoexcept |
Returns casted to const pointer to char an address of data.
|
inlineconstexprnoexcept |
Returns casted to pointer to char an address of data.
|
inline |
|
inline |
|
inlinenoexcept |
Clears the contents and storage.
|
inlinenoexcept |
Clears the contents and reserve storage.
|
inlinestatic |
|
inlineconstexprnoexcept |
Return a const pointer to the beginning of the referenced data.
|
inlineconstexprnoexcept |
Return a pointer to the beginning of the referenced data.
|
inlineconstexprnoexcept |
Checks whether the string is empty.
|
inline |
Returns a new buffer with a Base58 dump of the slice content.
|
inline |
Returns a new buffer with a Base64 dump of the slice content.
|
inline |
Returns a new buffer with a hexadecimal dump of the slice content.
|
inlineconstexprnoexcept |
Return a const pointer to the end of the referenced data.
|
inlineconstexprnoexcept |
Return a pointer to the end of the referenced data.
|
inlineconstexprnoexcept |
Returns casted to const pointer to byte an end of data.
|
inlineconstexprnoexcept |
Returns casted to pointer to byte an end of data.
|
inlineconstexprnoexcept |
Returns casted to const pointer to char an end of data.
|
inlineconstexprnoexcept |
Returns casted to pointer to char an end of data.
|
inlinenoexcept |
Checks if the data ends with the given suffix.
|
inlineconstexpr |
Returns the associated allocator.
|
inlineconstexprnoexcept |
Returns the hash value of the data.
|
inlinenoexcept |
Returns the first "n" bytes of the data chunk.
n <= size()
|
inlineconstexprnoexcept |
Returns the number of bytes that available in currently allocated storage ahead the currently beginning of data.
|
inlinestatic |
Returns a new buffer with a hexadecimal dump of the slice content.
|
inlinestatic |
Returns a new buffer with a hexadecimal dump of the given pod.
|
inline |
Decodes hexadecimal dump from the buffer content to new returned buffer.
|
inlinestatic |
Decodes hexadecimal dump from the slice content to returned buffer.
|
inlineconstexprnoexcept |
Checks whether data chunk stored inside the buffer, otherwise buffer just refers to data located outside the buffer.
|
inlineconstexprnoexcept |
Checks whether the data pointer of the buffer is nullptr.
|
inlineconstexprnoexcept |
Checks whether the buffer just refers to data located outside the buffer, rather than stores it.
|
inlinestatic |
|
inlinestatic |
|
inlinestatic |
|
inlinestatic |
|
inlinestatic |
|
inlinestatic |
|
inlinestatic |
|
inlinestatic |
|
inlinestatic |
|
inlinestatic |
|
inlinestatic |
|
inlinestatic |
|
inlinestaticnoexcept |
|
inlinestatic |
|
inlinestatic |
|
inlinestatic |
|
inlinestatic |
|
inlinestatic |
|
inlinestatic |
|
inlinestatic |
|
inlineconstexprnoexcept |
Returns the number of bytes.
|
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.
|
inlinenoexcept |
Returns the middle "n" bytes of the data chunk.
from + n <= size()
|
inlineconstexprnoexcept |
|
inlineexplicitconstexpr |
|
inlinenoexcept |
Return a string_view that references the data of this buffer.
|
inlinenoexcept |
|
inlinenoexcept |
|
inline |
|
inline |
|
inline |
|
inlineconstexprnoexcept |
Accesses the specified byte of data chunk.
n < size()
|
inlineconstexprnoexcept |
Accesses the specified byte of data chunk.
n < size()
|
inlinenoexcept |
Drops the first "n" bytes from the data chunk.
n <= size()
|
inlinenoexcept |
Drops the last "n" bytes from the data chunk.
n <= size()
|
inline |
Reserves storage space.
|
inline |
Reserves space before the payload.
|
inline |
Reserves space after the payload.
|
inline |
Returns the first "n" bytes of the data chunk.
std::out_of_range | if n >= size() |
|
inline |
Returns the middle "n" bytes of the data chunk.
std::out_of_range | if from + n >= size() |
|
inline |
Drops the first "n" bytes from the data chunk.
std::out_of_range | if n > size() |
|
inline |
Drops the last "n" bytes from the data chunk.
std::out_of_range | if n > size() |
|
inline |
Returns the last "n" bytes of the data chunk.
std::out_of_range | if n >= size() |
|
inlineconstexpr |
Sets the length by specifying the end of the data.
|
inlineconstexpr |
Set length of data.
|
inline |
Reduces memory usage by freeing unused storage space.
|
inlineconstexprnoexcept |
Returns the number of bytes.
|
inlinenoexcept |
|
inlinenoexcept |
Checks if the data starts with the given prefix.
|
inlinenoexcept |
Return a string_view that references the data of this buffer.
|
inlineconstexprnoexcept |
|
inlinenoexcept |
Returns the last "n" bytes of the data chunk.
n <= size()
|
inlineconstexprnoexcept |
Returns the number of bytes that available in currently allocated storage after the currently data end.
|
inlinestatic |
|
friend |
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_result & | operator= (const value_result &) noexcept=default |
Public Attributes | |
slice | value |
bool | done |
|
inlinenoexcept |
|
defaultnoexcept |
|
defaultnoexcept |
bool mdbx::value_result::done |
slice mdbx::value_result::value |
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 | |
pair & | operator= (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) |
using mdbx::pair::stl_pair = std::pair<slice, slice> |
|
inlineconstexprnoexcept |
|
defaultnoexcept |
|
inlinestaticconstexprnoexcept |
|
inlineconstexprnoexcept |
slice mdbx::pair::key |
slice mdbx::pair::value |
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_result & | operator= (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 | |
pair & | operator= (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. | |
|
inlineconstexprnoexcept |
|
inlineconstexprnoexcept |
|
defaultnoexcept |
|
defaultnoexcept |
bool mdbx::pair_result::done |
struct mdbx::buffer_pair_spec |
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 |
using mdbx::buffer_pair_spec< ALLOCATOR, CAPACITY_POLICY >::allocator_traits = typename buffer_type::allocator_traits |
using mdbx::buffer_pair_spec< ALLOCATOR, CAPACITY_POLICY >::allocator_type = typename buffer_type::allocator_type |
using mdbx::buffer_pair_spec< ALLOCATOR, CAPACITY_POLICY >::buffer_type = buffer<ALLOCATOR, CAPACITY_POLICY> |
using mdbx::buffer_pair_spec< ALLOCATOR, CAPACITY_POLICY >::reservation_policy = CAPACITY_POLICY |
using mdbx::buffer_pair_spec< ALLOCATOR, CAPACITY_POLICY >::stl_pair = ::std::pair<buffer_type, buffer_type> |
|
constexprdefaultnoexcept |
|
inlineconstexprnoexcept |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inlinenoexcept |
|
inlinenoexcept |
|
inlineconstexprnoexcept |
Checks whether data chunk stored inside the buffers both, otherwise at least one of buffers just refers to data located outside.
|
inlineconstexprnoexcept |
Checks whether one of the buffers just refers to data located outside the buffer, rather than stores it.
|
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.
|
inlinenoexcept |
buffer_type mdbx::buffer_pair_spec< ALLOCATOR, CAPACITY_POLICY >::key |
buffer_type mdbx::buffer_pair_spec< ALLOCATOR, CAPACITY_POLICY >::value |
interface MutableByteProducer |
MutableByteProducer C++20 concept.
interface ImmutableByteProducer |
ImmutableByteProducer C++20 concept.
interface SliceTranscoder |
SliceTranscoder C++20 concept.
using mdbx::buffer_pair = buffer_pair_spec<typename BUFFER::allocator_type, typename BUFFER::reservation_policy> |
|
inline |
|
inline |
|
inline |
|
inline |
inline ::std::ostream & mdbx::operator<< | ( | ::std::ostream & | out, |
const to_base58 & | wrapper ) |
inline ::std::ostream & mdbx::operator<< | ( | ::std::ostream & | out, |
const to_base64 & | wrapper ) |
inline ::std::ostream & mdbx::operator<< | ( | ::std::ostream & | out, |
const to_hex & | wrapper ) |