summaryrefslogtreecommitdiff
path: root/includes
diff options
context:
space:
mode:
authorPixel <pixel@nobis-crew.org>2011-10-11 00:47:18 -0700
committerPixel <pixel@nobis-crew.org>2011-10-11 00:47:18 -0700
commitd2252afcd74af0248c6141c8086d03e12a0a316f (patch)
tree43ba0cca065d205fa1b9fa5810de1481948aaad5 /includes
parent67b6a78b347ab7ba269a52d772e79d12444f6e96 (diff)
Input class seems to be done.
Diffstat (limited to 'includes')
-rw-r--r--includes/Handle.h10
-rw-r--r--includes/Input.h1
2 files changed, 11 insertions, 0 deletions
diff --git a/includes/Handle.h b/includes/Handle.h
index 489ab75..e3e22cd 100644
--- a/includes/Handle.h
+++ b/includes/Handle.h
@@ -9,6 +9,11 @@ class EAgain : public GeneralException {
EAgain() : GeneralException("Try Again") { }
};
+class ENoEnt : public GeneralException {
+ public:
+ ENoEnt(const char * name) : GeneralException(String("No such file or directory: `") + name + "'") { }
+};
+
class IO;
class Handle {
@@ -16,6 +21,7 @@ class Handle {
virtual ~Handle() { Assert(m_refCount == 0); }
virtual void close() throw (GeneralException) = 0;
virtual bool isClosed() = 0;
+ virtual bool isEOF() = 0;
virtual bool canSeek();
virtual bool canRead();
virtual bool canWrite();
@@ -59,6 +65,10 @@ class SeekableHandle : public Handle {
virtual void wseek(off_t offset, int whence = SEEK_SET) throw (GeneralException);
virtual off_t rtell() throw (GeneralException);
virtual off_t wtell() throw (GeneralException);
+ virtual bool isEOF();
+ protected:
+ off_t getWOffset() { return m_wOffset; }
+ off_t getROffset() { return m_rOffset; }
private:
off_t m_wOffset, m_rOffset;
};
diff --git a/includes/Input.h b/includes/Input.h
index 71e6845..518db39 100644
--- a/includes/Input.h
+++ b/includes/Input.h
@@ -8,6 +8,7 @@ class Input : public SeekableHandle {
public:
Input(const char * fname) throw (GeneralException);
virtual void close() throw (GeneralException);
+ virtual ssize_t read(void * buf, size_t count) throw (GeneralException);
virtual bool isClosed();
virtual bool canRead();
virtual const char * getName();