From 0edf1ac65db56054c80bc913a62172bbcebba321 Mon Sep 17 00:00:00 2001 From: Pixel Date: Sun, 13 Nov 2011 19:16:46 +0100 Subject: Adding isEOF() to Buffers (and cleaning code a tiny bit) --- src/Buffer.cc | 25 ++++++------------------- 1 file changed, 6 insertions(+), 19 deletions(-) (limited to 'src') 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; } -- cgit v1.2.3