From dd47f1bfd9077278bbc6442f0863280626a873e4 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, 24 Nov 2023 08:47:55 +0300 Subject: [PATCH] =?UTF-8?q?mdbx++:=20=D0=BF=D0=B5=D1=80=D0=B5=D1=85=D0=BE?= =?UTF-8?q?=D0=B4=20=D0=BD=D0=B0=20=D0=B8=D1=81=D0=BF=D0=BE=D0=BB=D1=8C?= =?UTF-8?q?=D0=B7=D0=BE=D0=B2=D0=B0=D0=BD=D0=B8=D0=B5=20=D0=BF=D0=BE-?= =?UTF-8?q?=D1=83=D0=BC=D0=BE=D0=BB=D1=87=D0=B0=D0=BD=D0=B8=D1=8E=20defaul?= =?UTF-8?q?t=5Fallocator=20=D0=B2=D0=BC=D0=B5=D1=81=D1=82=D0=BE=20legacy?= =?UTF-8?q?=5Fallocator.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- mdbx.h++ | 76 ++++++++++++++++++++++++++++---------------------------- 1 file changed, 38 insertions(+), 38 deletions(-) diff --git a/mdbx.h++ b/mdbx.h++ index a056e279..321550ed 100644 --- a/mdbx.h++ +++ b/mdbx.h++ @@ -354,18 +354,6 @@ static MDBX_CXX20_CONSTEXPR int memcmp(const void *a, const void *b, /// but it is recommended to use \ref polymorphic_allocator. using legacy_allocator = ::std::string::allocator_type; -struct slice; -struct default_capacity_policy; -template -class buffer; -class env; -class env_managed; -class txn; -class txn_managed; -class cursor; -class cursor_managed; - #if defined(DOXYGEN) || \ (defined(__cpp_lib_memory_resource) && \ __cpp_lib_memory_resource >= 201603L && _GLIBCXX_USE_CXX11_ABI) @@ -376,6 +364,18 @@ using default_allocator = polymorphic_allocator; using default_allocator = legacy_allocator; #endif /* __cpp_lib_memory_resource >= 201603L */ +struct slice; +struct default_capacity_policy; +template +class buffer; +class env; +class env_managed; +class txn; +class txn_managed; +class cursor; +class cursor_managed; + /// \brief Default buffer. using default_buffer = buffer; @@ -633,24 +633,24 @@ concept SliceTranscoder = #endif /* MDBX_HAVE_CXX20_CONCEPTS */ -template inline buffer make_buffer(PRODUCER &producer, const ALLOCATOR &allocator = ALLOCATOR()); -template inline buffer make_buffer(const PRODUCER &producer, const ALLOCATOR &allocator = ALLOCATOR()); -template inline string make_string(PRODUCER &producer, const ALLOCATOR &allocator = ALLOCATOR()); -template inline string make_string(const PRODUCER &producer, const ALLOCATOR &allocator = ALLOCATOR()); @@ -783,7 +783,7 @@ struct LIBMDBX_API_TYPE slice : public ::MDBX_val { #endif /* __cpp_lib_string_view >= 201606L */ template , - class ALLOCATOR = legacy_allocator> + class ALLOCATOR = default_allocator> MDBX_CXX20_CONSTEXPR ::std::basic_string as_string(const ALLOCATOR &allocator = ALLOCATOR()) const { static_assert(sizeof(CHAR) == 1, "Must be single byte characters"); @@ -798,27 +798,27 @@ struct LIBMDBX_API_TYPE slice : public ::MDBX_val { } /// \brief Returns a string with a hexadecimal dump of the slice content. - template + template inline string as_hex_string(bool uppercase = false, unsigned wrap_width = 0, const ALLOCATOR &allocator = ALLOCATOR()) const; /// \brief Returns a string with a /// [Base58](https://en.wikipedia.org/wiki/Base58) dump of the slice content. - template + template inline string as_base58_string(unsigned wrap_width = 0, const ALLOCATOR &allocator = ALLOCATOR()) const; /// \brief Returns a string with a /// [Base58](https://en.wikipedia.org/wiki/Base64) dump of the slice content. - template + template inline string as_base64_string(unsigned wrap_width = 0, const ALLOCATOR &allocator = ALLOCATOR()) const; /// \brief Returns a buffer with a hexadecimal dump of the slice content. - template inline buffer encode_hex(bool uppercase = false, unsigned wrap_width = 0, @@ -826,7 +826,7 @@ struct LIBMDBX_API_TYPE slice : public ::MDBX_val { /// \brief Returns a buffer with a /// [Base58](https://en.wikipedia.org/wiki/Base58) dump of the slice content. - template inline buffer encode_base58(unsigned wrap_width = 0, @@ -834,14 +834,14 @@ struct LIBMDBX_API_TYPE slice : public ::MDBX_val { /// \brief Returns a buffer with a /// [Base64](https://en.wikipedia.org/wiki/Base64) dump of the slice content. - template inline buffer encode_base64(unsigned wrap_width = 0, const ALLOCATOR &allocator = ALLOCATOR()) const; /// \brief Decodes hexadecimal dump from the slice content to returned buffer. - template inline buffer hex_decode(bool ignore_spaces = false, @@ -849,7 +849,7 @@ struct LIBMDBX_API_TYPE slice : public ::MDBX_val { /// \brief Decodes [Base58](https://en.wikipedia.org/wiki/Base58) dump /// from the slice content to returned buffer. - template inline buffer base58_decode(bool ignore_spaces = false, @@ -857,7 +857,7 @@ struct LIBMDBX_API_TYPE slice : public ::MDBX_val { /// \brief Decodes [Base64](https://en.wikipedia.org/wiki/Base64) dump /// from the slice content to returned buffer. - template inline buffer base64_decode(bool ignore_spaces = false, @@ -1294,13 +1294,13 @@ struct LIBMDBX_API to_hex { } /// \brief Returns a string with a hexadecimal dump of a passed slice. - template + template string as_string(const ALLOCATOR &allocator = ALLOCATOR()) const { return make_string(*this, allocator); } /// \brief Returns a buffer with a hexadecimal dump of a passed slice. - template buffer as_buffer(const ALLOCATOR &allocator = ALLOCATOR()) const { @@ -1345,14 +1345,14 @@ struct LIBMDBX_API to_base58 { /// \brief Returns a string with a /// [Base58](https://en.wikipedia.org/wiki/Base58) dump of a passed slice. - template + template string as_string(const ALLOCATOR &allocator = ALLOCATOR()) const { return make_string(*this, allocator); } /// \brief Returns a buffer with a /// [Base58](https://en.wikipedia.org/wiki/Base58) dump of a passed slice. - template buffer as_buffer(const ALLOCATOR &allocator = ALLOCATOR()) const { @@ -1400,14 +1400,14 @@ struct LIBMDBX_API to_base64 { /// \brief Returns a string with a /// [Base64](https://en.wikipedia.org/wiki/Base64) dump of a passed slice. - template + template string as_string(const ALLOCATOR &allocator = ALLOCATOR()) const { return make_string(*this, allocator); } /// \brief Returns a buffer with a /// [Base64](https://en.wikipedia.org/wiki/Base64) dump of a passed slice. - template buffer as_buffer(const ALLOCATOR &allocator = ALLOCATOR()) const { @@ -1464,13 +1464,13 @@ struct LIBMDBX_API from_hex { } /// \brief Decodes hexadecimal dump from a passed slice to returned string. - template + template string as_string(const ALLOCATOR &allocator = ALLOCATOR()) const { return make_string(*this, allocator); } /// \brief Decodes hexadecimal dump from a passed slice to returned buffer. - template buffer as_buffer(const ALLOCATOR &allocator = ALLOCATOR()) const { @@ -1510,14 +1510,14 @@ struct LIBMDBX_API from_base58 { /// \brief Decodes [Base58](https://en.wikipedia.org/wiki/Base58) dump from a /// passed slice to returned string. - template + template string as_string(const ALLOCATOR &allocator = ALLOCATOR()) const { return make_string(*this, allocator); } /// \brief Decodes [Base58](https://en.wikipedia.org/wiki/Base58) dump from a /// passed slice to returned buffer. - template buffer as_buffer(const ALLOCATOR &allocator = ALLOCATOR()) const { @@ -1559,14 +1559,14 @@ struct LIBMDBX_API from_base64 { /// \brief Decodes [Base64](https://en.wikipedia.org/wiki/Base64) dump from a /// passed slice to returned string. - template + template string as_string(const ALLOCATOR &allocator = ALLOCATOR()) const { return make_string(*this, allocator); } /// \brief Decodes [Base64](https://en.wikipedia.org/wiki/Base64) dump from a /// passed slice to returned buffer. - template buffer as_buffer(const ALLOCATOR &allocator = ALLOCATOR()) const {