xref: /haiku/src/add-ons/media/plugins/ape_reader/MAClib/IO.h (revision b55a57da7173b9af0432bd3e148d03f06161d036)
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 
16 class CIO
17 {
18 
19 public:
20 
21     //construction / destruction
22     CIO() { }
23     virtual ~CIO() { };
24 
25     // open / close
26     virtual int Open(const wchar_t * 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 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 int GetSize() = 0;
46     virtual int GetName(wchar_t * pBuffer) = 0;
47 };
48 
49 #endif // #ifndef APE_IO_H
50