From 3189a3cbee8eb9d7ded7605776a75f35e5e2f122 Mon Sep 17 00:00:00 2001 From: Peter Bell Date: Fri, 15 May 2020 03:35:43 +0100 Subject: Update logging code to reduce unnecessary string copying: * Write into a single fmt::memory_buffer * Use string_view instead of AString for listener callbacks * Also collapsed vFLOG and vLOG functions into one per formatting type --- src/OSSupport/File.h | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src/OSSupport/File.h') diff --git a/src/OSSupport/File.h b/src/OSSupport/File.h index 0bb877186..689900816 100644 --- a/src/OSSupport/File.h +++ b/src/OSSupport/File.h @@ -80,6 +80,11 @@ public: /** Writes up to a_NumBytes bytes from a_Buffer, returns the number of bytes actually written, or -1 on failure; asserts if not open */ int Write(const void * a_Buffer, size_t a_NumBytes); + int Write(std::string_view a_String) + { + return Write(a_String.data(), a_String.size()); + } + /** Seeks to iPosition bytes from file start, returns old position or -1 for failure; asserts if not open */ long Seek (int iPosition); -- cgit v1.2.3