00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024 #ifndef FILEIO_H
00025 #define FILEIO_H
00026
00027 #include "localdef.h"
00028 #include <fstream>
00029
00055 class FileIO {
00056 public:
00057
00059 FileIO(const char *filename);
00060
00062 FileIO(const char *filename, std::ios::openmode mode);
00063
00064 ~FileIO(void);
00065
00067 void open(std::ios::openmode mode);
00068
00070 void close(void);
00071
00073 FILE_POS_TYPE fileSize(void);
00074
00076 void readBlock(char *buffer, int blockSize);
00077
00079 void writeBlock(char *buffer, int blockSize);
00080
00082 FILE_POS_TYPE repositionRead(FILE_POS_TYPE filePos);
00083
00085 FILE_POS_TYPE repositionWrite(FILE_POS_TYPE filePos);
00086
00088 void truncateFile(FILE_POS_TYPE fileSize);
00089 private:
00090 std::fstream *_file;
00091 char *_fileName;
00092 };
00093
00094 #endif