summaryrefslogtreecommitdiff
path: root/includes/Handle.h
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/Handle.h
parent67b6a78b347ab7ba269a52d772e79d12444f6e96 (diff)
Input class seems to be done.
Diffstat (limited to 'includes/Handle.h')
-rw-r--r--includes/Handle.h10
1 files changed, 10 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;
};