Main Page | Namespace List | Class Hierarchy | Class List | Directories | File List | Namespace Members | Class Members | File Members

File.h

Go to the documentation of this file.
00001 #ifndef FILE_H
00002 #define FILE_H
00003 
00004 #include <abuse/abuse.h>
00005 #include <abuse/SysError.h>
00006 #include <string>
00007 
00008 class File/*:public IFile*/
00009 {
00010 public:
00011         File(const std::string& filename,DWORD dwCreation=OPEN_EXISTING,DWORD dwAccess=GENERIC_READ|GENERIC_WRITE,DWORD dwShareMode=0,DWORD dwFlags=FILE_ATTRIBUTE_NORMAL)throw(SysError);
00012         virtual ~File();
00013         operator HANDLE()const{return m_hFile;}
00014         size_t read(BYTE* buf,size_t size)const throw(SysError);
00015         size_t write(const BYTE* buf,size_t size)throw(SysError);
00016         size_t seek(int pos,DWORD dwPoint=FILE_BEGIN)throw(SysError);
00017         size_t tell()const{return const_cast<File*>(this)->seek(0,FILE_CURRENT);}
00018         size_t size()const {return GetFileSize(m_hFile,NULL);}
00019         bool isEOF()const{return m_EOF;}
00020         std::string readText()const throw(SysError);
00021         void writeText(const std::string& buf)throw(SysError);
00022 protected:
00023         HANDLE m_hFile;
00024         mutable bool m_EOF;
00025 private:
00026         void operator=(const File& f);
00027         File(const File& f);
00028 };
00029 
00030 #endif

Generated on Thu Jun 16 00:13:24 2005 for Abuse! by  doxygen 1.4.3