2008-12-17 12:52:34 +01:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#define SEEK_SET 0
|
|
|
|
#define SEEK_CUR 1
|
|
|
|
|
|
|
|
#define FILE_BUFFER_SIZE 512
|
|
|
|
#define OS_BLOCK_SIZE 1
|
|
|
|
#define FILE_BUFFER_BLOCKS (FILE_BUFFER_SIZE / OS_BLOCK_SIZE)
|
|
|
|
|
|
|
|
|
|
|
|
class CKosFile
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
CKosFile(char *fileName);
|
2009-08-26 13:23:22 +02:00
|
|
|
~CKosFile(void);
|
|
|
|
int Read(Byte *targetPtr, int readCount);
|
|
|
|
int Write(Byte *sourcePtr, int writeCount);
|
|
|
|
int Seek(int seekFrom, int seekStep);
|
2008-12-17 12:52:34 +01:00
|
|
|
protected:
|
|
|
|
int filePointer;
|
|
|
|
int bufferPointer;
|
|
|
|
bool validBuffer;
|
|
|
|
kosFileInfo fileInfo;
|
2009-08-26 13:23:22 +02:00
|
|
|
void ValidateBuffer(void);
|
|
|
|
void UpdateBuffer(void);
|
2008-12-17 12:52:34 +01:00
|
|
|
};
|