1 #pragma once
2 
3 namespace APE
4 {
5 
6 #ifndef FILE_BEGIN
7     #define FILE_BEGIN        0
8 #endif
9 
10 #ifndef FILE_CURRENT
11     #define FILE_CURRENT    1
12 #endif
13 
14 #ifndef FILE_END
15     #define FILE_END        2
16 #endif
17 
18 class CIO
19 {
20 public:
21     // construction / destruction
CIO()22     CIO() { }
~CIO()23     virtual ~CIO() { };
24 
25     // open / close
26     virtual int Open(const wchar_t * pName, bool bOpenReadOnly = false) = 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(intn nDistance, unsigned int nMoveMode) = 0;
35 
36     // creation / destruction
37     virtual int Create(const wchar_t * 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 unsigned int GetSize() = 0;
46     virtual int GetName(wchar_t * pBuffer) = 0;
47 };
48 
49 }
50