00001
00002
00003
00004
00005
00006
00007
00008
00014 #ifndef _FU_FILE_H_
00015 #define _FU_FILE_H_
00016
00024 class FCOLLADA_EXPORT FUFile
00025 {
00026 public:
00028 enum Mode
00029 {
00030 READ,
00031 WRITE
00032 };
00033
00034 private:
00035 FILE* filePtr;
00036 fstring filepath;
00037
00038 public:
00042 FUFile(const fstring& filename, Mode mode);
00043 FUFile(const fchar* filename, Mode mode);
00048 FUFile();
00049
00052 ~FUFile();
00053
00056 inline const fstring& GetFilePath() const { return filepath; }
00057
00062 inline bool Open(const fstring& filename, Mode mode) { return Open(filename.c_str(), mode); }
00063 bool Open(const fchar* filename, Mode mode);
00067 bool IsOpen() { return filePtr != NULL; }
00068
00071 size_t GetLength();
00072
00076 FILE* GetHandle() { return filePtr; }
00077
00084 bool Read(void* buffer, size_t length);
00085
00091 bool Write(const void* buffer, size_t length);
00092
00095 void Flush();
00096
00098 void Close();
00099 };
00100
00101 #endif // _FU_FILE_H_