BCM WL 6.30.102.9 (r366174)
[tomato.git] / release / src-rt / linux / linux-2.6 / scripts / squashfs / lzma / C / Common / C_FileIO.h
blob48836a151eb6843e5cf2f1250bbcf7deed6fa7be
1 // Common/C_FileIO.h
3 #ifndef __COMMON_C_FILEIO_H
4 #define __COMMON_C_FILEIO_H
6 #include <stdio.h>
7 #include <sys/types.h>
9 #include "Types.h"
10 #include "MyWindows.h"
12 namespace NC {
13 namespace NFile {
14 namespace NIO {
16 class CFileBase
18 protected:
19 int _handle;
20 bool OpenBinary(const char *name, int flags);
21 public:
22 CFileBase(): _handle(-1) {};
23 ~CFileBase() { Close(); }
24 bool Close();
25 bool GetLength(UInt64 &length) const;
26 off_t Seek(off_t distanceToMove, int moveMethod) const;
29 class CInFile: public CFileBase
31 public:
32 bool Open(const char *name);
33 ssize_t Read(void *data, size_t size);
36 class COutFile: public CFileBase
38 public:
39 bool Create(const char *name, bool createAlways);
40 ssize_t Write(const void *data, size_t size);
43 }}}
45 #endif