diff options
| author | George Hazan <ghazan@miranda.im> | 2022-09-17 13:54:40 +0300 |
|---|---|---|
| committer | George Hazan <ghazan@miranda.im> | 2022-09-17 13:54:40 +0300 |
| commit | 1bc0b0657cdc9fc9c092896a7f893bca0c50c4ea (patch) | |
| tree | 09920e1526f5a54325d12f9f0b5af36370896fb5 /include | |
| parent | 0c63ec79606a42d944aeed0fd52596c55d6a0768 (diff) | |
MBinBuffer made a bit smarter to allow the decent people to return it from functions
Diffstat (limited to 'include')
| -rw-r--r-- | include/m_system.h | 11 |
1 files changed, 6 insertions, 5 deletions
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); |
