From c58ce13db33c45a3e321edabe3bda12f45829482 Mon Sep 17 00:00:00 2001 From: =?utf8?q?David=20=E2=80=98Bombe=E2=80=99=20Roden?= Date: Sat, 5 Jul 2008 06:41:13 +0200 Subject: [PATCH] add isEOF method --- FileReaderInput.cpp | 4 ++++ FileReaderInput.h | 1 + ReaderInput.h | 1 + 3 files changed, 6 insertions(+) diff --git a/FileReaderInput.cpp b/FileReaderInput.cpp index 14fc0c6..bd08f13 100644 --- a/FileReaderInput.cpp +++ b/FileReaderInput.cpp @@ -18,3 +18,7 @@ int FileReaderInput::read(void* buffer, size_t length) { readBytes = fread(buffer, 1, length, file); return 0; } + +bool FileReaderInput::isEOF() { + return feof(file); +} diff --git a/FileReaderInput.h b/FileReaderInput.h index 4188557..747440f 100644 --- a/FileReaderInput.h +++ b/FileReaderInput.h @@ -14,6 +14,7 @@ public: ~FileReaderInput(); int read(void* buffer, size_t length); + bool isEOF(); private: FILE* file; diff --git a/ReaderInput.h b/ReaderInput.h index ec84632..c16426e 100644 --- a/ReaderInput.h +++ b/ReaderInput.h @@ -12,6 +12,7 @@ public: virtual ~ReaderInput(); virtual int read(void* buffer, size_t length) = 0; + virtual bool isEOF() = 0; }; -- 2.7.4