1#ifndef APE_IO_H
2#define APE_IO_H
3
4#ifndef FILE_BEGIN
5    #define FILE_BEGIN        0
6#endif
7
8#ifndef FILE_CURRENT
9    #define FILE_CURRENT    1
10#endif
11
12#ifndef FILE_END
13    #define FILE_END        2
14#endif
15
16class CIO
17{
18
19public:
20
21    //construction / destruction
22    CIO() { }
23    virtual ~CIO() { };
24
25    // open / close
26    virtual int Open(const char* pName) = 0;
27    virtual int Close() = 0;
28
29    // read / write
30    virtual int Read(void * pBuffer, unsigned int nBytesToRead, unsigned int * pBytesRead) = 0;
31    virtual int Write(const void * pBuffer, unsigned int nBytesToWrite, unsigned int * pBytesWritten) = 0;
32
33    // seek
34    virtual int Seek(int nDistance, unsigned int nMoveMode) = 0;
35
36    // creation / destruction
37    virtual int Create(const char* pName) = 0;
38    virtual int Delete() = 0;
39
40    // other functions
41    virtual int SetEOF() = 0;
42
43    // attributes
44    virtual int GetPosition() = 0;
45    virtual int GetSize() = 0;
46    virtual int GetName(char* pBuffer) = 0;
47};
48
49#endif // #ifndef APE_IO_H
50