00001 /* 00002 * Base file format handler header 00003 * 00004 * This file is part of the "SoftPixel Engine" (Copyright (c) 2008 by Lukas Hermanns) 00005 * See "SoftPixelEngine.hpp" for license information. 00006 */ 00007 00008 #ifndef __SP_BASEFILEFORMATHANDLER_H__ 00009 #define __SP_BASEFILEFORMATHANDLER_H__ 00010 00011 00012 #include "Base/spStandard.hpp" 00013 #include "Base/spInputOutput.hpp" 00014 #include "Base/spMemoryManagement.hpp" 00015 00016 00017 namespace sp 00018 { 00019 namespace io 00020 { 00021 00022 00024 class SP_EXPORT BaseFileFormatHandler 00025 { 00026 00027 public: 00028 00029 virtual ~BaseFileFormatHandler(); 00030 00031 /* Inline functions */ 00032 00033 inline io::stringc getFilename() const 00034 { 00035 return Filename_; 00036 } 00037 00038 protected: 00039 00040 BaseFileFormatHandler(const io::stringc &Filename = ""); 00041 BaseFileFormatHandler(io::File* File); 00042 00043 /* Functions */ 00044 00045 bool openForReading(); 00046 bool openForWriting(); 00047 00048 /* Members */ 00049 00050 //todo -> change to only one io::File pointer given by the "load..." function 00051 io::FileSystem FileSys_; 00052 io::File* File_; 00053 00054 io::stringc Filename_; 00055 00056 }; 00057 00058 00059 } // /namespace io 00060 00061 } // /namespace sp 00062 00063 00064 #endif 00065 00066 00067 00068 // ================================================================================