vfs: check userland buffers before reading them.
[haiku.git] / src / add-ons / media / plugins / ape_reader / MAClib / IO.h
blobc6bee9078fe47169ee7fc568e085fa5e286ef2ef
1 #ifndef APE_IO_H
2 #define APE_IO_H
4 #ifndef FILE_BEGIN
5 #define FILE_BEGIN 0
6 #endif
8 #ifndef FILE_CURRENT
9 #define FILE_CURRENT 1
10 #endif
12 #ifndef FILE_END
13 #define FILE_END 2
14 #endif
16 class CIO
19 public:
21 //construction / destruction
22 CIO() { }
23 virtual ~CIO() { };
25 // open / close
26 virtual int Open(const wchar_t * pName) = 0;
27 virtual int Close() = 0;
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;
33 // seek
34 virtual int Seek(int nDistance, unsigned int nMoveMode) = 0;
36 // creation / destruction
37 virtual int Create(const wchar_t * pName) = 0;
38 virtual int Delete() = 0;
40 // other functions
41 virtual int SetEOF() = 0;
43 // attributes
44 virtual int GetPosition() = 0;
45 virtual int GetSize() = 0;
46 virtual int GetName(wchar_t * pBuffer) = 0;
49 #endif // #ifndef APE_IO_H