From 6ccf56eb38f9dfd510a1c6e6f847a8809842bd7c Mon Sep 17 00:00:00 2001 From: Romain BOULLARD Date: Fri, 28 Aug 2026 01:06:13 +0200 Subject: [PATCH] EASTL codecs for string_view and string --- .../Include/Utils/Log/EASTLFormatters.hpp | 40 +++++++++++++++---- 1 file changed, 33 insertions(+), 7 deletions(-) diff --git a/Bigfoot/Sources/Utils/Include/Utils/Log/EASTLFormatters.hpp b/Bigfoot/Sources/Utils/Include/Utils/Log/EASTLFormatters.hpp index 87cea01..e4e0077 100644 --- a/Bigfoot/Sources/Utils/Include/Utils/Log/EASTLFormatters.hpp +++ b/Bigfoot/Sources/Utils/Include/Utils/Log/EASTLFormatters.hpp @@ -9,7 +9,10 @@ #include #if defined(BIGFOOT_NOT_OPTIMIZED) -#include +#include + +#include +#include #endif #include @@ -46,11 +49,6 @@ struct fmtquill::formatter return fmtquill::format_to(ctx.out(), "{}", p_string.c_str()); } }; - -template<> -struct quill::Codec: quill::DeferredFormatCodec -{ -}; #endif // STRING_VIEW @@ -84,8 +82,36 @@ struct fmtquill::formatter } }; +namespace Bigfoot::Codec +{ +template +struct string_view: quill::Codec +{ + using Base = quill::Codec; + + [[nodiscard]] + static size_t compute_encoded_size(quill::detail::SizeCacheVector& p_cache, const STRING& p_arg) noexcept + { + return Base::compute_encoded_size(p_cache, std::string_view {p_arg.data(), p_arg.size()}); + } + + static void encode(std::byte*& p_buffer, + const quill::detail::SizeCacheVector& p_cache, + std::uint32_t& p_cacheIndex, + const STRING& p_arg) noexcept + { + Base::encode(p_buffer, p_cache, p_cacheIndex, std::string_view {p_arg.data(), p_arg.size()}); + } +}; +} + template<> -struct quill::Codec: quill::DeferredFormatCodec +struct quill::Codec: Bigfoot::Codec::string_view +{ +}; + +template<> +struct quill::Codec: Bigfoot::Codec::string_view { }; #endif