add getRemaining method
authorDavid ‘Bombe’ Roden <bombe@pterodactylus.net>
Sat, 5 Jul 2008 18:54:53 +0000 (20:54 +0200)
committerDavid ‘Bombe’ Roden <bombe@pterodactylus.net>
Sat, 5 Jul 2008 18:54:53 +0000 (20:54 +0200)
GrowingBuffer.cpp
GrowingBuffer.h

index 719e793..b1c5dbc 100644 (file)
@@ -35,6 +35,10 @@ size_t GrowingBuffer::getSize() {
        return size;
 }
 
+size_t GrowingBuffer::getRemaining() {
+       return limit - position;
+}
+
 void GrowingBuffer::seek(size_t position) {
        this->position = (position > limit) ? limit : position;
        GlobalSettings::isVerbose() && fprintf(stderr, "[%s:%d] setting position to %d.\n", __FILE__, __LINE__, position);
index a622a50..856c4d2 100644 (file)
@@ -26,6 +26,7 @@ public:
        size_t getPosition();
        size_t getLimit();
        size_t getSize();
+       size_t getRemaining();
 
        /**
         * Sets the position of the buffer. The next {@link read(void*, size_t)} or