From 8a44d57fab35c56d8bcff32632b8e0c8ad44d6d8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=9B=D0=B5=D0=BE=D0=BD=D0=B8=D0=B4=20=D0=AE=D1=80=D1=8C?= =?UTF-8?q?=D0=B5=D0=B2=20=28Leonid=20Yuriev=29?= Date: Fri, 31 Mar 2023 00:47:53 +0300 Subject: [PATCH] =?UTF-8?q?mdbx++:=20=D0=B4=D0=BE=D0=B1=D0=B0=D0=B2=D0=BB?= =?UTF-8?q?=D0=B5=D0=BD=D0=B8=D0=B5=20=D0=B2=D0=B0=D1=80=D0=B8=D0=B0=D0=BD?= =?UTF-8?q?=D1=82=D0=BE=D0=B2=20`buffer::key=5Ffrom()`=20=D1=81=20=D1=8F?= =?UTF-8?q?=D0=B2=D0=BD=D1=8B=D0=BC=20=D0=B8=D0=BC=D0=B5=D0=BD=D0=BE=D0=B2?= =?UTF-8?q?=D0=B0=D0=BD=D0=B8=D0=B5=D0=BC=20=D0=BF=D0=BE=20=D1=82=D0=B8?= =?UTF-8?q?=D0=BF=D1=83=20=D0=B4=D0=B0=D0=BD=D0=BD=D1=8B=D1=85.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- mdbx.h++ | 36 ++++++++++++++++++++++++++++++------ 1 file changed, 30 insertions(+), 6 deletions(-) diff --git a/mdbx.h++ b/mdbx.h++ index a05f1c63..650673c4 100644 --- a/mdbx.h++ +++ b/mdbx.h++ @@ -2663,41 +2663,65 @@ public: return buffer(::std::move(src)); } - static buffer key_from(const double ieee754_64bit) { + static buffer key_from_double(const double ieee754_64bit) { return wrap(::mdbx_key_from_double(ieee754_64bit)); } + static buffer key_from(const double ieee754_64bit) { + return key_from_double(ieee754_64bit); + } + static buffer key_from(const double *ieee754_64bit) { return wrap(::mdbx_key_from_ptrdouble(ieee754_64bit)); } - static buffer key_from(const uint64_t unsigned_int64) { + static buffer key_from_u64(const uint64_t unsigned_int64) { return wrap(unsigned_int64); } - static buffer key_from(const int64_t signed_int64) { + static buffer key_from(const uint64_t unsigned_int64) { + return key_from_u64(unsigned_int64); + } + + static buffer key_from_i64(const int64_t signed_int64) { return wrap(::mdbx_key_from_int64(signed_int64)); } + static buffer key_from(const int64_t signed_int64) { + return key_from_i64(signed_int64); + } + static buffer key_from_jsonInteger(const int64_t json_integer) { return wrap(::mdbx_key_from_jsonInteger(json_integer)); } - static buffer key_from(const float ieee754_32bit) { + static buffer key_from_float(const float ieee754_32bit) { return wrap(::mdbx_key_from_float(ieee754_32bit)); } + static buffer key_from(const float ieee754_32bit) { + return key_from_float(ieee754_32bit); + } + static buffer key_from(const float *ieee754_32bit) { return wrap(::mdbx_key_from_ptrfloat(ieee754_32bit)); } - static buffer key_from(const uint32_t unsigned_int32) { + static buffer key_from_u32(const uint32_t unsigned_int32) { return wrap(unsigned_int32); } - static buffer key_from(const int32_t signed_int32) { + static buffer key_from(const uint32_t unsigned_int32) { + return key_from_u32(unsigned_int32); + } + + static buffer key_from_i32(const int32_t signed_int32) { return wrap(::mdbx_key_from_int32(signed_int32)); } + + static buffer key_from(const int32_t signed_int32) { + return key_from_i32(signed_int32); + } }; template