Kajetan Johannes Hammerle преди 3 години
родител
ревизия
923055a156
променени са 2 файла, в които са добавени 6 реда и са изтрити 0 реда
  1. 4 0
      utils/Buffer.cpp
  2. 2 0
      utils/Buffer.h

+ 4 - 0
utils/Buffer.cpp

@@ -50,4 +50,8 @@ void Buffer::swap(Buffer& other) {
     std::swap(length, other.length);
     std::swap(capacity, other.capacity);
     std::swap(buffer, other.buffer);
+}
+
+void Buffer::clear() {
+    length = 0;
 }

+ 2 - 0
utils/Buffer.h

@@ -24,6 +24,8 @@ public:
     int getLength() const;
     operator const char*() const;
 
+    void clear();
+
 private:
     void swap(Buffer& other);
 };