@@ -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;
}
@@ -24,6 +24,8 @@ public:
int getLength() const;
operator const char*() const;
+ void clear();
private:
void swap(Buffer& other);
};