00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024 #ifndef FXIO_H
00025 #define FXIO_H
00026
00027
00028
00029 namespace FX {
00030
00031
00037 class FXAPI FXIO {
00038 protected:
00039 FXInputHandle device;
00040 FXuint access;
00041 private:
00042 FXIO(const FXIO&);
00043 FXIO &operator=(const FXIO&);
00044 public:
00045
00047 enum {
00048
00050 OtherRead = 0x00004,
00051 OtherWrite = 0x00002,
00052 OtherExec = 0x00001,
00053 OtherReadWrite = 0x00006,
00054 OtherFull = 0x00007,
00055
00056 GroupRead = 0x00020,
00057 GroupWrite = 0x00010,
00058 GroupExec = 0x00008,
00059 GroupReadWrite = 0x00030,
00060 GroupFull = 0x00038,
00061
00062 OwnerRead = 0x00100,
00063 OwnerWrite = 0x00080,
00064 OwnerExec = 0x00040,
00065 OwnerReadWrite = 0x00180,
00066 OwnerFull = 0x001C0,
00067
00069 Hidden = 0x00200,
00070 Directory = 0x00400,
00071 File = 0x00800,
00072 SymLink = 0x01000,
00073
00075 SetUser = 0x02000,
00076 SetGroup = 0x04000,
00077 Sticky = 0x08000,
00078
00080 Character = 0x10000,
00081 Block = 0x20000,
00082 Socket = 0x40000,
00083 Fifo = 0x80000
00084 };
00085
00087 enum {
00088
00090 NoAccess = 0,
00091 ReadOnly = 1,
00092 WriteOnly = 2,
00093 ReadWrite = 3,
00094 Append = 4,
00095 Truncate = 8,
00096 Create = 16,
00097 Exclusive = 32,
00098 NonBlocking = 64,
00099 TextTranslate=65536,
00100
00102 Reading = ReadOnly,
00103 Writing = ReadWrite|Create|Truncate
00104 };
00105
00107 enum {
00108 Begin = 0,
00109 Current = 1,
00110 End = 2
00111 };
00112
00113 public:
00114
00116 FXIO();
00117
00119 virtual bool open(FXInputHandle handle,FXuint mode);
00120
00122 virtual bool isOpen() const;
00123
00125 FXuint mode() const { return access; }
00126
00128
00129
00131
00132
00134
00135
00137 virtual FXlong position() const;
00138
00140 virtual FXlong position(FXlong offset,FXuint from=FXIO::Begin);
00141
00143 virtual FXival readBlock(void* data,FXival count);
00144
00146 virtual FXival writeBlock(const void* data,FXival count);
00147
00149 virtual FXlong truncate(FXlong size);
00150
00152 virtual bool flush();
00153
00155 virtual bool eof();
00156
00158 virtual FXlong size();
00159
00161 virtual bool close();
00162
00164 virtual ~FXIO();
00165 };
00166
00167 }
00168
00169 #endif