Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members  

filedevice.h

Go to the documentation of this file.
00001 /***************************************************************************
00002     filedevice.h  -  Definition of the FileDevice class.
00003                              -------------------
00004     begin                : June 21 2002
00005     copyright            : (C) 2003 by Vojtìch Toman
00006     email                : vtoman@lit.cz
00007  ***************************************************************************/
00008 
00009 /***************************************************************************
00010  *                                                                         *
00011  *   This program is free software; you can redistribute it and/or modify  *
00012  *   it under the terms of the GNU General Public License as published by  *
00013  *   the Free Software Foundation; either version 2 of the License, or     *
00014  *   (at your option) any later version.                                   *
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

Generated on Wed Feb 5 10:43:01 2003 for Exalt by doxygen1.2.14 written by Dimitri van Heesch, © 1997-2002