25 enum TSeekOrigin {soFromBeginning, soFromCurrent, soFromEnd};
31 virtual int Read(
void*,
int){
return 0;}
32 virtual int Write(
void*,
int){
return 0;}
33 virtual int Seek(
int, TSeekOrigin){
return Position;}
37 enum FileMode {fmRead, fmWrite, fmReadWrite};
44 if (mode==fmWrite) fp=fopen(filename,
"wb");
45 else if (mode==fmReadWrite) fp=fopen(filename,
"rb+");
46 else fp=fopen(filename,
"rb");
52 virtual int Read(
void* buffer,
int size)
54 int result=fread(buffer, 1, size, fp);
58 virtual int Write(
void* buffer,
int size)
60 int result=fwrite(buffer, 1, size, fp);
64 virtual int Seek(
int Offset, TSeekOrigin Origin)
66 fseek(fp, Offset, Origin);