xref: /haiku/src/add-ons/media/plugins/ape_reader/MAClib/StdLibFileIO.h (revision 053cc0d4fe060114342762e1e8dbbf86a9cad259)
1b51fbe43SDavid McPaul #ifdef IO_USE_STD_LIB_FILE_IO
2b51fbe43SDavid McPaul 
3b51fbe43SDavid McPaul #ifndef APE_STDLIBFILEIO_H
4b51fbe43SDavid McPaul #define APE_STDLIBFILEIO_H
5b51fbe43SDavid McPaul 
6b51fbe43SDavid McPaul #include "IO.h"
7b51fbe43SDavid McPaul #include "NoWindows.h"
8b51fbe43SDavid McPaul 
9b51fbe43SDavid McPaul class CStdLibFileIO : public CIO
10b51fbe43SDavid McPaul {
11b51fbe43SDavid McPaul public:
12b51fbe43SDavid McPaul 
13b51fbe43SDavid McPaul     // construction / destruction
14b51fbe43SDavid McPaul     CStdLibFileIO();
15b51fbe43SDavid McPaul     ~CStdLibFileIO();
16b51fbe43SDavid McPaul 
17b51fbe43SDavid McPaul     // open / close
18b51fbe43SDavid McPaul     int Open(LPCTSTR pName);
19b51fbe43SDavid McPaul     int Close();
20b51fbe43SDavid McPaul 
21b51fbe43SDavid McPaul     // read / write
22b51fbe43SDavid McPaul     int Read(void * pBuffer, unsigned int nBytesToRead, unsigned int * pBytesRead);
23b51fbe43SDavid McPaul     int Write(const void * pBuffer, unsigned int nBytesToWrite, unsigned int * pBytesWritten);
24b51fbe43SDavid McPaul 
25b51fbe43SDavid McPaul     // seek
26b51fbe43SDavid McPaul     int Seek(int nDistance, unsigned int nMoveMode);
27b51fbe43SDavid McPaul 
28b51fbe43SDavid McPaul     // other functions
29b51fbe43SDavid McPaul     int SetEOF();
30b51fbe43SDavid McPaul 
31b51fbe43SDavid McPaul     // creation / destruction
32*053cc0d4SAugustin Cavalier     int Create(const char* pName);
33b51fbe43SDavid McPaul     int Delete();
34b51fbe43SDavid McPaul 
35b51fbe43SDavid McPaul     // attributes
36b51fbe43SDavid McPaul     int GetPosition();
37b51fbe43SDavid McPaul     int GetSize();
38*053cc0d4SAugustin Cavalier     int GetName(char* pBuffer);
39b51fbe43SDavid McPaul     int GetHandle();
40b51fbe43SDavid McPaul 
41b51fbe43SDavid McPaul private:
42b51fbe43SDavid McPaul 
43b51fbe43SDavid McPaul     char m_cFileName[MAX_PATH];
44b51fbe43SDavid McPaul     BOOL m_bReadOnly;
45b51fbe43SDavid McPaul     FILE * m_pFile;
46b51fbe43SDavid McPaul };
47b51fbe43SDavid McPaul 
48b51fbe43SDavid McPaul #endif // #ifndef APE_STDLIBFILEIO_H
49b51fbe43SDavid McPaul 
50b51fbe43SDavid McPaul #endif // #ifdef IO_USE_STD_LIB_FILE_IO
51b51fbe43SDavid McPaul 
52