summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--includes/Buffer.h1
-rw-r--r--src/Buffer.cc25
2 files changed, 7 insertions, 19 deletions
diff --git a/includes/Buffer.h b/includes/Buffer.h
index 99a57f0..50dd47b 100644
--- a/includes/Buffer.h
+++ b/includes/Buffer.h
@@ -11,6 +11,7 @@ class Buffer : public SeekableHandle {
virtual ssize_t read(void * buf, size_t count) throw (GeneralException);
virtual ssize_t write(const void * buf, size_t count) throw (GeneralException);
virtual bool isClosed();
+ virtual bool isEOF();
virtual bool canRead();
virtual bool canWrite();
virtual const char * getName();
diff --git a/src/Buffer.cc b/src/Buffer.cc
index d6ff9bb..e029df5 100644
--- a/src/Buffer.cc
+++ b/src/Buffer.cc
@@ -55,22 +55,9 @@ void Balau::Buffer::reset() {
rseek(0);
}
-bool Balau::Buffer::isClosed() {
- return false;
-}
-
-const char * Balau::Buffer::getName() {
- return "Buffer";
-}
-
-off_t Balau::Buffer::getSize() {
- return m_bufSize;
-}
-
-bool Balau::Buffer::canRead() {
- return true;
-}
-
-bool Balau::Buffer::canWrite() {
- return true;
-}
+bool Balau::Buffer::isClosed() { return false; }
+bool Balau::Buffer::isEOF() { return rtell() == m_bufSize; }
+const char * Balau::Buffer::getName() { return "Buffer"; }
+off_t Balau::Buffer::getSize() { return m_bufSize; }
+bool Balau::Buffer::canRead() { return true; }
+bool Balau::Buffer::canWrite() { return true; }