00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00026 #ifndef FILEDEVICE_H
00027 #define FILEDEVICE_H
00028
00029 #ifdef __GNUG__
00030 # pragma interface
00031 #endif
00032
00033
00034 #include <fstream>
00035 #include "iodevice.h"
00036 #include "defs.h"
00037
00038
00039
00047 class FileDevice : public IODevice, public fstream
00048 {
00049 public:
00051 FileDevice(void);
00052
00054 virtual ~FileDevice(void);
00055
00057 virtual void prepare(const char *, int) throw (ExaltIOException);
00058
00060 virtual void prepare(void) throw (ExaltIOException) { prepare(0, ios::in); }
00061
00063 virtual void flush(void) throw (ExaltIOException);
00064
00066 virtual void finish(void) throw (ExaltIOException);
00067
00069 virtual IOState readData(char *buf, IOSize length) throw (ExaltIOException);
00070
00072 virtual IOState getChar(int *) throw (ExaltIOException);
00073
00075 virtual IOState writeData(const char *buf, IOSize length) throw (ExaltIOException);
00076
00078 virtual IOState putChar(int) throw (ExaltIOException);
00079
00081 virtual IOSize bytesReadTotal(void);
00082
00084 virtual IOSize bytesRead(void);
00085
00087 virtual IOSize bytesWritten(void);
00088
00090 virtual bool errorOccurred(void);
00091
00093 virtual bool eof(void);
00094
00095 protected:
00097 IOSize bWritten;
00098
00100 IOSize bRead;
00101 };
00102
00103
00104
00105 #endif //FILEDEVICE_H