From 1bc0b0657cdc9fc9c092896a7f893bca0c50c4ea Mon Sep 17 00:00:00 2001 From: George Hazan Date: Sat, 17 Sep 2022 13:54:40 +0300 Subject: MBinBuffer made a bit smarter to allow the decent people to return it from functions --- include/m_system.h | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'include') diff --git a/include/m_system.h b/include/m_system.h index b2abca8722..f961e15e3c 100644 --- a/include/m_system.h +++ b/include/m_system.h @@ -470,16 +470,17 @@ public: class MIR_CORE_EXPORT MBinBuffer { - char *m_buf; - size_t m_len; + char *m_buf = nullptr; public: MBinBuffer(); + MBinBuffer(size_t preAlloc); + MBinBuffer(const MBinBuffer &orig); ~MBinBuffer(); - __forceinline char *data() const { return m_buf; } - __forceinline bool isEmpty() const { return m_len == 0; } - __forceinline size_t length() const { return m_len; } + __forceinline char* data() const { return m_buf; } + __forceinline bool isEmpty() const { return m_buf == nullptr; } + size_t length() const; // adds a buffer to the end void append(const void *pBuf, size_t bufLen); -- cgit v1.2.3