diff options
Diffstat (limited to 'src/Buffer.h')
-rw-r--r-- | src/Buffer.h | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/Buffer.h b/src/Buffer.h index e486724..d181a46 100644 --- a/src/Buffer.h +++ b/src/Buffer.h @@ -50,6 +50,8 @@ class Buffer { Buffer(const std::vector<uint8_t>& vec); ~Buffer(); + void swap(Buffer& other); + /* Resize the buffer, reallocate memory if needed */ void setLength(size_t len); @@ -60,6 +62,8 @@ class Buffer { Buffer& operator=(Buffer&& other); Buffer& operator=(const std::vector<uint8_t>& buf); + uint8_t operator[](size_t i) const; + /* Concatenate the current data with the new data given. * Reallocates memory if needed. */ void appendData(const void *data, size_t len); @@ -80,3 +84,5 @@ class Buffer { void *m_data; }; +void swap(Buffer& buf1, Buffer& buf2); + |