From 2e6d9fd4d4ab7824fa5367f0097b5fe7a9bdd465 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: Sun, 16 Mar 2025 01:44:29 +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`mdbx::cursor::seek=5Fmultiple=5Fsam?= =?UTF-8?q?elength()`.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- mdbx.h++ | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/mdbx.h++ b/mdbx.h++ index 55bfc8e9..ba403bca 100644 --- a/mdbx.h++ +++ b/mdbx.h++ @@ -4265,9 +4265,14 @@ public: batch_samelength = MDBX_GET_MULTIPLE, batch_samelength_next = MDBX_NEXT_MULTIPLE, - batch_samelength_previous = MDBX_PREV_MULTIPLE + batch_samelength_previous = MDBX_PREV_MULTIPLE, + seek_and_batch_samelength = MDBX_SEEK_AND_GET_MULTIPLE }; + // TODO: добавить легковесный proxy-класс для замещения параметра throw_notfound более сложным набором опций, + // в том числе с explicit-конструктором из bool, чтобы защититься от неявной конвертации ключей поиска + // и других параметров в bool-throw_notfound. + struct move_result : public pair_result { inline move_result(const cursor &cursor, bool throw_notfound); move_result(cursor &cursor, move_operation operation, bool throw_notfound) @@ -4465,8 +4470,8 @@ public: inline move_result lower_bound_multivalue(const slice &key, const slice &value, bool throw_notfound = false); inline move_result upper_bound_multivalue(const slice &key, const slice &value, bool throw_notfound = false); - inline move_result get_multiple_samelength(const slice &key, bool throw_notfound = true) { - return move(batch_samelength, key, throw_notfound); + inline move_result seek_multiple_samelength(const slice &key, bool throw_notfound = true) { + return move(seek_and_batch_samelength, key, throw_notfound); } inline move_result get_multiple_samelength(bool throw_notfound = false) {