FUtils/FUFile.h

00001 /*
00002     Copyright (C) 2005-2006 Feeling Software Inc.
00003     MIT License: http://www.opensource.org/licenses/mit-license.php
00004 */
00005 
00006 #ifndef _FU_FILE_H_
00007 #define _FU_FILE_H_
00008 
00009 class FCOLLADA_EXPORT FUFile
00010 {
00011 public:
00012     enum Mode
00013     {
00014         READ,
00015         WRITE
00016     };
00017 
00018 private:
00019     FILE* filePtr;
00020     
00021 public:
00022     FUFile(const char* filename, Mode mode);
00023     FUFile();
00024     ~FUFile();
00025     
00026     bool IsOpen() { return filePtr != NULL; }
00027 
00028     // Retrieve the file length
00029     uint32 GetLength();
00030 
00031     // Writes/Reads in a piece of the file from/into the given buffer
00032     bool Read(void* buffer, size_t length);
00033     bool Write(const void* buffer, size_t length);
00034 
00035     // Flush/close the file stream
00036     void Flush();
00037     void Close();
00038 };
00039 
00040 #endif // _FU_FILE_H_

Generated on Fri May 12 16:44:39 2006 for FCollada by  doxygen 1.4.6-NO