MDBX Containers
Loading...
Searching...
No Matches
mdbxc Namespace Reference

Classes

class  AnyValueTable
 Table storing values of arbitrary type associated with a key. More...
 
class  BaseTable
 Base class providing common functionality for MDBX database access. More...
 
class  Config
 Parameters used by Connection to create the MDBX environment. More...
 
class  Connection
 Manages a single MDBX environment and an optional read-only transaction. More...
 
struct  has_from_bytes
 Trait to check if a type provides a static from_bytes() method. More...
 
struct  has_to_bytes
 Trait to check if a type provides a to_bytes() member. More...
 
struct  has_value_type
 Trait indicating that a container defines value_type. More...
 
class  KeyMultiValueTable
 Multi-value table (duplicate keys allowed) persisted in MDBX. More...
 
class  KeyTable
 Ordered key->value table persisted in MDBX. More...
 
class  KeyValueTable
 Template class for managing key-value pairs in an MDBX database. More...
 
class  MdbxException
 Represents a specific exception for MDBX-related errors. More...
 
struct  PathComponents
 Structure to hold the root and components of a path. More...
 
class  SerializeScratch
 Per-call scratch buffer to produce MDBX_val without using thread_local. More...
 
class  Transaction
 Manages MDBX transactions with automatic cleanup and error handling. More...
 
class  TransactionTracker
 Associates MDBX transactions with threads. More...
 

Enumerations

enum class  TransactionMode { READ_ONLY , WRITABLE }
 Specifies the access mode of a transaction. More...
 

Functions

bool is_explicitly_relative (const std::string &s) noexcept
 Check if path starts with explicit relative prefix.
 
bool is_absolute_path (const std::string &path)
 Checks whether the given path is absolute (cross-platform).
 
std::string get_parent_path (const std::string &file_path)
 Extracts the parent directory from a full file path.
 
std::string get_exec_dir ()
 Retrieves the directory of the executable file.
 
std::string get_file_name (const std::string &file_path)
 Extracts the file name from a full file path.
 
std::string utf8_to_ansi (const std::string &utf8) noexcept
 Converts a UTF-8 string to an ANSI string (Windows-specific).
 
bool is_path_sep (char c)
 Check if character is a path separator.
 
std::string lexically_normal_compat (const std::string &in)
 Normalize path removing '.
 
PathComponents split_path (const std::string &path)
 Splits a path into its root and components.
 
void create_directories (const std::string &path)
 Creates directories recursively for the given path.
 
void check_mdbx (int rc, const std::string &context)
 Throws an MdbxException if MDBX return code indicates an error.
 
uint32_t sortable_key_from_float (float f)
 Convert IEEE754 float to monotonic sortable unsigned int key.
 
uint64_t sortable_key_from_double (double d)
 Convert IEEE754 double to monotonic sortable unsigned int key.
 
template<typename T>
MDBX_db_flags_t get_mdbx_flags ()
 Returns MDBX flags for a given key type.
 
template<typename T>
size_t get_key_size (const T &key)
 Returns the size in bytes of a given key type.
 
template<typename T>
std::enable_if<!has_to_bytes< T >::value &&!std::is_same< T, std::string >::value &&!std::is_trivially_copyable< T >::value, MDBX_val >::type serialize_key (const T &key, SerializeScratch &sc)
 Serializes a key into MDBX_val for database operations.
 
template<typename T>
std::enable_if< std::is_same< T, std::string >::value, MDBX_val >::type serialize_key (const T &key, SerializeScratch &sc)
 Serializes a key of type std::string.
 
template<typename T>
std::enable_if< std::is_same< T, std::vector< uint8_t > >::value||std::is_same< T, std::vector< char > >::value||std::is_same< T, std::vector< unsignedchar > >::value, MDBX_val >::type serialize_key (const T &key, SerializeScratch &sc)
 Serializes a key stored in a byte vector.
 
template<typename T>
std::enable_if< std::is_integral< T >::value &&(sizeof(T)<=2), MDBX_val >::type serialize_key (const T &key, SerializeScratch &sc)
 Serializes a small integral key (<=16 bits).
 
template<typename T>
std::enable_if< std::is_same< T, int32_t >::value||std::is_same< T, uint32_t >::value, MDBX_val >::type serialize_key (const T &key, SerializeScratch &sc)
 Serializes a 32-bit integral key.
 
template<typename T>
std::enable_if< std::is_same< T, float >::value, MDBX_val >::type serialize_key (const T &key, SerializeScratch &sc)
 Serializes a 32-bit float key.
 
template<typename T>
std::enable_if< std::is_same< T, int64_t >::value||std::is_same< T, uint64_t >::value, MDBX_val >::type serialize_key (const T &key, SerializeScratch &sc)
 Serializes a 64-bit integral key.
 
template<typename T>
std::enable_if< std::is_same< T, double >::value, MDBX_val >::type serialize_key (const T &key, SerializeScratch &sc)
 Serializes a 64-bit double key.
 
template<typename T>
std::enable_if< std::is_trivially_copyable< T >::value &&!std::is_same< T, std::string >::value &&!(std::is_integral< T >::value &&sizeof(T)<=2)&&!std::is_same< T, int32_t >::value &&!std::is_same< T, uint32_t >::value &&!std::is_same< T, float >::value &&!std::is_same< T, int64_t >::value &&!std::is_same< T, uint64_t >::value &&!std::is_same< T, double >::value, MDBX_val >::type serialize_key (const T &key, SerializeScratch &sc)
 Serializes any other trivially copyable key type.
 
template<size_t N>
MDBX_val serialize_key (const std::bitset< N > &data, SerializeScratch &sc)
 Serializes a std::bitset as a key.
 
template<typename T>
std::enable_if<!has_value_type< T >::value &&!std::is_same< T, std::vector< typenameT::value_type > >::value &&!std::is_trivially_copyable< typenameT::value_type >::value &&!has_to_bytes< T >::value &&!std::is_same< T, std::string >::value &&!std::is_trivially_copyable< T >::value, MDBX_val >::type serialize_value (const T &value, SerializeScratch &sc)
 Serializes a general value into MDBX_val.
 
template<typename T>
std::enable_if< std::is_same< T, std::string >::value, MDBX_val >::type serialize_value (const T &value, SerializeScratch &sc)
 Serializes a std::string value.
 
template<typename T>
std::enable_if< has_value_type< T >::value &&std::is_trivially_copyable< typenameT::value_type >::value &&(std::is_same< T, std::deque< typenameT::value_type > >::value||std::is_same< T, std::list< typenameT::value_type > >::value||std::is_same< T, std::set< typenameT::value_type > >::value||std::is_same< T, std::unordered_set< typenameT::value_type > >::value), MDBX_val >::type serialize_value (const T &container, SerializeScratch &sc)
 Serializes containers (vector, deque, list, set, unordered_set) of trivially copyable elements.
 
template<typename T>
std::enable_if< has_value_type< T >::value &&std::is_same< T, std::vector< typenameT::value_type > >::value &&std::is_trivially_copyable< typenameT::value_type >::value, MDBX_val >::type serialize_value (const T &container, SerializeScratch &sc)
 Serializes a vector of trivially copyable elements.
 
template<typename T>
std::enable_if< has_to_bytes< T >::value, MDBX_val >::type serialize_value (const T &value, SerializeScratch &sc)
 Serializes a value using its to_bytes() method.
 
template<typename T>
std::enable_if<!has_to_bytes< T >::value &&std::is_trivially_copyable< T >::value, MDBX_val >::type serialize_value (const T &value, SerializeScratch &sc)
 Serializes any trivially copyable value.
 
template<typename T>
std::enable_if< has_value_type< T >::value &&std::is_same< typenameT::value_type, std::string >::value, MDBX_val >::type serialize_value (const T &container, SerializeScratch &sc)
 Serializes a container of strings.
 
template<typename T>
std::enable_if<!has_value_type< T >::value &&!has_from_bytes< T >::value &&!std::is_same< T, std::string >::value &&!std::is_trivially_copyable< T >::value, T >::type deserialize_value (const MDBX_val &val)
 Deserializes a value from MDBX_val into type T.
 
template<typename T>
std::enable_if< std::is_same< T, std::string >::value, T >::type deserialize_value (const MDBX_val &val)
 Deserializes a std::string value.
 
template<typename T>
std::enable_if< std::is_same< T, std::vector< uint8_t > >::value||std::is_same< T, std::vector< char > >::value||std::is_same< T, std::vector< unsignedchar > >::value, T >::type deserialize_value (const MDBX_val &val)
 Deserializes a vector of bytes.
 
template<typename T>
std::enable_if< std::is_same< T, std::deque< uint8_t > >::value||std::is_same< T, std::deque< char > >::value||std::is_same< T, std::deque< unsignedchar > >::value, T >::type deserialize_value (const MDBX_val &val)
 Deserializes a deque of bytes.
 
template<typename T>
std::enable_if< std::is_same< T, std::list< uint8_t > >::value||std::is_same< T, std::list< char > >::value||std::is_same< T, std::list< unsignedchar > >::value, T >::type deserialize_value (const MDBX_val &val)
 Deserializes a list of bytes.
 
template<typename T>
std::enable_if< has_value_type< T >::value &&std::is_same< T, std::vector< typenameT::value_type > >::value &&std::is_trivially_copyable< typenameT::value_type >::value &&!std::is_same< T, std::vector< uint8_t > >::value &&!std::is_same< T, std::vector< char > >::value &&!std::is_same< T, std::vector< unsignedchar > >::value, T >::type deserialize_value (const MDBX_val &val)
 Deserializes a vector of trivially copyable elements.
 
template<typename T>
std::enable_if<(std::is_same< T, std::deque< typenameT::value_type > >::value||std::is_same< T, std::list< typenameT::value_type > >::value)&&std::is_trivially_copyable< typenameT::value_type >::value, T >::type deserialize_value (const MDBX_val &val)
 Deserializes a deque or list of trivially copyable elements.
 
template<typename T>
std::enable_if<(std::is_same< T, std::set< typenameT::value_type > >::value||std::is_same< T, std::unordered_set< typenameT::value_type > >::value)&&std::is_trivially_copyable< typenameT::value_type >::value, T >::type deserialize_value (const MDBX_val &val)
 Deserializes a set or unordered_set of trivially copyable elements.
 
template<typename T>
std::enable_if<!has_from_bytes< T >::value &&std::is_trivially_copyable< T >::value, T >::type deserialize_value (const MDBX_val &val)
 Deserializes a trivially copyable value.
 
template<typename T>
std::enable_if< has_from_bytes< T >::value, T >::type deserialize_value (const MDBX_val &val)
 Deserializes a value using its from_bytes() method.
 
template<typename T>
std::enable_if< has_value_type< T >::value &&std::is_same< typenameT::value_type, std::string >::value, T >::type deserialize_value (const MDBX_val &val)
 Deserializes a container of strings.
 
template<typename T>
std::enable_if< std::is_same< T, std::set< std::string > >::value||std::is_same< T, std::unordered_set< std::string > >::value, T >::type deserialize_value (const MDBX_val &val)
 Deserializes a set of strings.
 

Enumeration Type Documentation

◆ TransactionMode

enum class mdbxc::TransactionMode
strong

Specifies the access mode of a transaction.

Defines whether the transaction is read-only or writable.

Enumerator
READ_ONLY 

Read-only transaction (no write operations allowed).

WRITABLE 

Writable transaction (allows inserts, updates, deletes).

Definition at line 14 of file Transaction.hpp.

Function Documentation

◆ check_mdbx()

void mdbxc::check_mdbx ( int rc,
const std::string & context )

Throws an MdbxException if MDBX return code indicates an error.

Parameters
rcReturn code from an MDBX function.
contextDescription of the calling context.

Definition at line 23 of file utils.hpp.

◆ create_directories()

void mdbxc::create_directories ( const std::string & path)
inline

Creates directories recursively for the given path.

Parameters
pathThe directory path to create.
Exceptions
std::runtime_errorif the directories cannot be created.

Definition at line 464 of file path_utils.hpp.

◆ deserialize_value() [1/12]

template<typename T>
std::enable_if<!has_value_type< T >::value &&!has_from_bytes< T >::value &&!std::is_same< T, std::string >::value &&!std::is_trivially_copyable< T >::value, T >::type mdbxc::deserialize_value ( const MDBX_val & val)

Deserializes a value from MDBX_val into type T.

Template Parameters
TDesired type.
Parameters
valMDBX_val containing raw data.
Returns
Deserialized T.

Definition at line 486 of file utils.hpp.

◆ deserialize_value() [2/12]

template<typename T>
std::enable_if< std::is_same< T, std::string >::value, T >::type mdbxc::deserialize_value ( const MDBX_val & val)

Deserializes a std::string value.

Template Parameters
TMust be std::string.

Definition at line 497 of file utils.hpp.

◆ deserialize_value() [3/12]

template<typename T>
std::enable_if< std::is_same< T, std::vector< uint8_t > >::value||std::is_same< T, std::vector< char > >::value||std::is_same< T, std::vector< unsignedchar > >::value, T >::type mdbxc::deserialize_value ( const MDBX_val & val)

Deserializes a vector of bytes.

Template Parameters
TVector type containing bytes.

Definition at line 511 of file utils.hpp.

◆ deserialize_value() [4/12]

template<typename T>
std::enable_if< std::is_same< T, std::deque< uint8_t > >::value||std::is_same< T, std::deque< char > >::value||std::is_same< T, std::deque< unsignedchar > >::value, T >::type mdbxc::deserialize_value ( const MDBX_val & val)

Deserializes a deque of bytes.

Template Parameters
TByte deque type.

Definition at line 526 of file utils.hpp.

◆ deserialize_value() [5/12]

template<typename T>
std::enable_if< std::is_same< T, std::list< uint8_t > >::value||std::is_same< T, std::list< char > >::value||std::is_same< T, std::list< unsignedchar > >::value, T >::type mdbxc::deserialize_value ( const MDBX_val & val)

Deserializes a list of bytes.

Template Parameters
TByte list type.

Definition at line 541 of file utils.hpp.

◆ deserialize_value() [6/12]

template<typename T>
std::enable_if< has_value_type< T >::value &&std::is_same< T, std::vector< typenameT::value_type > >::value &&std::is_trivially_copyable< typenameT::value_type >::value &&!std::is_same< T, std::vector< uint8_t > >::value &&!std::is_same< T, std::vector< char > >::value &&!std::is_same< T, std::vector< unsignedchar > >::value, T >::type mdbxc::deserialize_value ( const MDBX_val & val)

Deserializes a vector of trivially copyable elements.

Template Parameters
TVector type.

Definition at line 559 of file utils.hpp.

◆ deserialize_value() [7/12]

template<typename T>
std::enable_if<(std::is_same< T, std::deque< typenameT::value_type > >::value||std::is_same< T, std::list< typenameT::value_type > >::value)&&std::is_trivially_copyable< typenameT::value_type >::value, T >::type mdbxc::deserialize_value ( const MDBX_val & val)

Deserializes a deque or list of trivially copyable elements.

Template Parameters
TContainer type.

Definition at line 575 of file utils.hpp.

◆ deserialize_value() [8/12]

template<typename T>
std::enable_if<(std::is_same< T, std::set< typenameT::value_type > >::value||std::is_same< T, std::unordered_set< typenameT::value_type > >::value)&&std::is_trivially_copyable< typenameT::value_type >::value, T >::type mdbxc::deserialize_value ( const MDBX_val & val)

Deserializes a set or unordered_set of trivially copyable elements.

Template Parameters
TSet-like container type.

Definition at line 595 of file utils.hpp.

◆ deserialize_value() [9/12]

template<typename T>
std::enable_if<!has_from_bytes< T >::value &&std::is_trivially_copyable< T >::value, T >::type mdbxc::deserialize_value ( const MDBX_val & val)

Deserializes a trivially copyable value.

Template Parameters
TTrivially copyable type.

Definition at line 609 of file utils.hpp.

◆ deserialize_value() [10/12]

template<typename T>
std::enable_if< has_from_bytes< T >::value, T >::type mdbxc::deserialize_value ( const MDBX_val & val)

Deserializes a value using its from_bytes() method.

Template Parameters
TType providing from_bytes.

Definition at line 622 of file utils.hpp.

◆ deserialize_value() [11/12]

template<typename T>
std::enable_if< has_value_type< T >::value &&std::is_same< typenameT::value_type, std::string >::value, T >::type mdbxc::deserialize_value ( const MDBX_val & val)

Deserializes a container of strings.

Template Parameters
TContainer type with std::string elements.

Definition at line 633 of file utils.hpp.

◆ deserialize_value() [12/12]

template<typename T>
std::enable_if< std::is_same< T, std::set< std::string > >::value||std::is_same< T, std::unordered_set< std::string > >::value, T >::type mdbxc::deserialize_value ( const MDBX_val & val)

Deserializes a set of strings.

Template Parameters
TEither std::set<std::string> or std::unordered_set<std::string>.

Definition at line 663 of file utils.hpp.

◆ get_exec_dir()

std::string mdbxc::get_exec_dir ( )
inline

Retrieves the directory of the executable file.

Returns
A string containing the directory path of the executable.

Definition at line 96 of file path_utils.hpp.

◆ get_file_name()

std::string mdbxc::get_file_name ( const std::string & file_path)
inline

Extracts the file name from a full file path.

Parameters
file_pathThe full file path as a string.
Returns
The extracted file name, or the full string if no directory separator is found.

Definition at line 155 of file path_utils.hpp.

◆ get_key_size()

template<typename T>
size_t mdbxc::get_key_size ( const T & key)

Returns the size in bytes of a given key type.

Template Parameters
TKey type.
Parameters
keyThe key value.
Returns
Size in bytes suitable for filling MDBX_val.

Definition at line 111 of file utils.hpp.

◆ get_mdbx_flags()

template<typename T>
MDBX_db_flags_t mdbxc::get_mdbx_flags ( )
inline

Returns MDBX flags for a given key type.

Template Parameters
TKey type.
Returns
MDBX_INTEGERKEY if T is an integer-like type; 0 otherwise.

Definition at line 94 of file utils.hpp.

◆ get_parent_path()

std::string mdbxc::get_parent_path ( const std::string & file_path)
inline

Extracts the parent directory from a full file path.

Parameters
file_pathPath to a file (e.g., "data/testdb").
Returns
Directory path (e.g., "data")

Definition at line 78 of file path_utils.hpp.

◆ is_absolute_path()

bool mdbxc::is_absolute_path ( const std::string & path)
inline

Checks whether the given path is absolute (cross-platform).

Parameters
pathFile or directory path.
Returns
True if path is absolute, false otherwise.

Definition at line 59 of file path_utils.hpp.

◆ is_explicitly_relative()

bool mdbxc::is_explicitly_relative ( const std::string & s)
inlinenoexcept

Check if path starts with explicit relative prefix.

Parameters
sPath string to inspect.
Returns
true if path starts with "./", "../", ".\\", or "..\".

Definition at line 51 of file path_utils.hpp.

◆ is_path_sep()

bool mdbxc::is_path_sep ( char c)
inline

Check if character is a path separator.

Parameters
cCharacter to check.
Returns
true if c is '/' or '\'.

Definition at line 252 of file path_utils.hpp.

◆ lexically_normal_compat()

std::string mdbxc::lexically_normal_compat ( const std::string & in)
inline

Normalize path removing '.

' and '..' components.

Parameters
inPath to normalize.
Returns
Normalized path.

Definition at line 259 of file path_utils.hpp.

◆ serialize_key() [1/10]

template<size_t N>
MDBX_val mdbxc::serialize_key ( const std::bitset< N > & data,
SerializeScratch & sc )
inline

Serializes a std::bitset as a key.

Template Parameters
NNumber of bits in the bitset.
Parameters
dataBitset value to serialize.

Definition at line 352 of file utils.hpp.

◆ serialize_key() [2/10]

template<typename T>
std::enable_if<!has_to_bytes< T >::value &&!std::is_same< T, std::string >::value &&!std::is_trivially_copyable< T >::value, MDBX_val >::type mdbxc::serialize_key ( const T & key,
SerializeScratch & sc )

Serializes a key into MDBX_val for database operations.

Template Parameters
TKey type.
Parameters
keyThe key to convert.
Returns
MDBX_val representing the key.

Definition at line 230 of file utils.hpp.

◆ serialize_key() [3/10]

template<typename T>
std::enable_if< std::is_same< T, std::string >::value, MDBX_val >::type mdbxc::serialize_key ( const T & key,
SerializeScratch & sc )

Serializes a key of type std::string.

Template Parameters
TMust be std::string.

Definition at line 244 of file utils.hpp.

◆ serialize_key() [4/10]

template<typename T>
std::enable_if< std::is_same< T, std::vector< uint8_t > >::value||std::is_same< T, std::vector< char > >::value||std::is_same< T, std::vector< unsignedchar > >::value, MDBX_val >::type mdbxc::serialize_key ( const T & key,
SerializeScratch & sc )

Serializes a key stored in a byte vector.

Template Parameters
TVector type containing bytes.

Definition at line 259 of file utils.hpp.

◆ serialize_key() [5/10]

template<typename T>
std::enable_if< std::is_integral< T >::value &&(sizeof(T)<=2), MDBX_val >::type mdbxc::serialize_key ( const T & key,
SerializeScratch & sc )

Serializes a small integral key (<=16 bits).

Template Parameters
TIntegral type.

Definition at line 270 of file utils.hpp.

◆ serialize_key() [6/10]

template<typename T>
std::enable_if< std::is_same< T, int32_t >::value||std::is_same< T, uint32_t >::value, MDBX_val >::type mdbxc::serialize_key ( const T & key,
SerializeScratch & sc )

Serializes a 32-bit integral key.

Template Parameters
TSupported 32-bit type.

Definition at line 282 of file utils.hpp.

◆ serialize_key() [7/10]

template<typename T>
std::enable_if< std::is_same< T, float >::value, MDBX_val >::type mdbxc::serialize_key ( const T & key,
SerializeScratch & sc )

Serializes a 32-bit float key.

Template Parameters
TSupported 32-bit type.

Definition at line 297 of file utils.hpp.

◆ serialize_key() [8/10]

template<typename T>
std::enable_if< std::is_same< T, int64_t >::value||std::is_same< T, uint64_t >::value, MDBX_val >::type mdbxc::serialize_key ( const T & key,
SerializeScratch & sc )

Serializes a 64-bit integral key.

Template Parameters
TSupported 64-bit type.

Definition at line 309 of file utils.hpp.

◆ serialize_key() [9/10]

template<typename T>
std::enable_if< std::is_same< T, double >::value, MDBX_val >::type mdbxc::serialize_key ( const T & key,
SerializeScratch & sc )

Serializes a 64-bit double key.

Template Parameters
TSupported 64-bit type.

Definition at line 324 of file utils.hpp.

◆ serialize_key() [10/10]

template<typename T>
std::enable_if< std::is_trivially_copyable< T >::value &&!std::is_same< T, std::string >::value &&!(std::is_integral< T >::value &&sizeof(T)<=2)&&!std::is_same< T, int32_t >::value &&!std::is_same< T, uint32_t >::value &&!std::is_same< T, float >::value &&!std::is_same< T, int64_t >::value &&!std::is_same< T, uint64_t >::value &&!std::is_same< T, double >::value, MDBX_val >::type mdbxc::serialize_key ( const T & key,
SerializeScratch & sc )

Serializes any other trivially copyable key type.

Template Parameters
TTrivially copyable type.

Definition at line 343 of file utils.hpp.

◆ serialize_value() [1/7]

template<typename T>
std::enable_if< has_value_type< T >::value &&std::is_trivially_copyable< typenameT::value_type >::value &&(std::is_same< T, std::deque< typenameT::value_type > >::value||std::is_same< T, std::list< typenameT::value_type > >::value||std::is_same< T, std::set< typenameT::value_type > >::value||std::is_same< T, std::unordered_set< typenameT::value_type > >::value), MDBX_val >::type mdbxc::serialize_value ( const T & container,
SerializeScratch & sc )

Serializes containers (vector, deque, list, set, unordered_set) of trivially copyable elements.

Template Parameters
TContainer type with value_type.
Parameters
containerThe container to serialize.

Definition at line 409 of file utils.hpp.

◆ serialize_value() [2/7]

template<typename T>
std::enable_if< has_value_type< T >::value &&std::is_same< T, std::vector< typenameT::value_type > >::value &&std::is_trivially_copyable< typenameT::value_type >::value, MDBX_val >::type mdbxc::serialize_value ( const T & container,
SerializeScratch & sc )

Serializes a vector of trivially copyable elements.

Template Parameters
TVector type.

Definition at line 425 of file utils.hpp.

◆ serialize_value() [3/7]

template<typename T>
std::enable_if< has_value_type< T >::value &&std::is_same< typenameT::value_type, std::string >::value, MDBX_val >::type mdbxc::serialize_value ( const T & container,
SerializeScratch & sc )

Serializes a container of strings.

Template Parameters
TContainer type with std::string elements.

Definition at line 462 of file utils.hpp.

◆ serialize_value() [4/7]

template<typename T>
std::enable_if<!has_value_type< T >::value &&!std::is_same< T, std::vector< typenameT::value_type > >::value &&!std::is_trivially_copyable< typenameT::value_type >::value &&!has_to_bytes< T >::value &&!std::is_same< T, std::string >::value &&!std::is_trivially_copyable< T >::value, MDBX_val >::type mdbxc::serialize_value ( const T & value,
SerializeScratch & sc )

Serializes a general value into MDBX_val.

Template Parameters
TType of the value.
Parameters
valueThe value to serialize.
Returns
MDBX_val structure with binary representation of the value.

Definition at line 376 of file utils.hpp.

◆ serialize_value() [5/7]

template<typename T>
std::enable_if< std::is_same< T, std::string >::value, MDBX_val >::type mdbxc::serialize_value ( const T & value,
SerializeScratch & sc )

Serializes a std::string value.

Template Parameters
TMust be std::string.

Definition at line 390 of file utils.hpp.

◆ serialize_value() [6/7]

template<typename T>
std::enable_if< has_to_bytes< T >::value, MDBX_val >::type mdbxc::serialize_value ( const T & value,
SerializeScratch & sc )

Serializes a value using its to_bytes() method.

Template Parameters
TType providing to_bytes.

Definition at line 438 of file utils.hpp.

◆ serialize_value() [7/7]

template<typename T>
std::enable_if<!has_to_bytes< T >::value &&std::is_trivially_copyable< T >::value, MDBX_val >::type mdbxc::serialize_value ( const T & value,
SerializeScratch & sc )

Serializes any trivially copyable value.

Template Parameters
TTrivially copyable type.

Definition at line 450 of file utils.hpp.

◆ sortable_key_from_double()

uint64_t mdbxc::sortable_key_from_double ( double d)
inline

Convert IEEE754 double to monotonic sortable unsigned int key.

Parameters
dInput double value.
Returns
Unsigned 64-bit integer with preserved numeric order.

Definition at line 41 of file utils.hpp.

◆ sortable_key_from_float()

uint32_t mdbxc::sortable_key_from_float ( float f)
inline

Convert IEEE754 float to monotonic sortable unsigned int key.

Parameters
fInput float value.
Returns
Unsigned 32-bit integer with preserved numeric order.

Definition at line 32 of file utils.hpp.

◆ split_path()

PathComponents mdbxc::split_path ( const std::string & path)
inline

Splits a path into its root and components.

Parameters
pathThe path to split.
Returns
A PathComponents object containing the root and components of the path.

Definition at line 421 of file path_utils.hpp.

◆ utf8_to_ansi()

std::string mdbxc::utf8_to_ansi ( const std::string & utf8)
inlinenoexcept

Converts a UTF-8 string to an ANSI string (Windows-specific).

Parameters
utf8The UTF-8 encoded string.
Returns
The converted ANSI string.

Definition at line 173 of file path_utils.hpp.