3 #ifndef __COMMON_C_FILEIO_H
4 #define __COMMON_C_FILEIO_H
10 #include "MyWindows.h"
20 bool OpenBinary(const char *name, int flags);
22 CFileBase(): _handle(-1) {};
23 ~CFileBase() { Close(); }
25 bool GetLength(UInt64 &length) const;
26 off_t Seek(off_t distanceToMove, int moveMethod) const;
29 class CInFile: public CFileBase
32 bool Open(const char *name);
33 bool OpenShared(const char *name, bool shareForWrite);
34 ssize_t Read(void *data, size_t size);
37 class COutFile: public CFileBase
40 bool Create(const char *name, bool createAlways);
41 bool Open(const char *name, DWORD creationDisposition);
42 ssize_t Write(const void *data, size_t size);