00001 /* 00002 00003 AmnesiaEngine 00004 Copyright (c) 2006 John DiSanti. 00005 00006 Permission is hereby granted, free of charge, 00007 to any person obtaining a copy of this software and associated 00008 documentation files (the "Software"), to deal in the Software 00009 without restriction, including without limitation the rights to 00010 use, copy, modify, merge, publish, distribute, sublicense, 00011 and/or sell copies of the Software, and to permit persons to 00012 whom the Software is furnished to do so, subject to the following 00013 conditions: 00014 00015 The above copyright notice and this permission notice shall be included 00016 in all copies or substantial portions of the Software. 00017 00018 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, 00019 INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A 00020 PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT 00021 HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 00022 OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE 00023 SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 00024 00025 */ 00026 00027 #ifndef AMN_IFILEMANAGER_H 00028 #define AMN_IFILEMANAGER_H 00029 00030 #include "IArray.h" 00031 #include "IReference.h" 00032 #include "IReadFile.h" 00033 #include "IWriteFile.h" 00034 #include "IReadFileXML.h" 00035 00036 namespace amn 00037 { 00038 class IEngine; 00039 00041 class IFileManager : public IReference 00042 { 00043 public: 00044 IFileManager(IEngine* e) {} 00045 virtual ~IFileManager() {} 00046 00048 virtual IEngine* getEngine() = 0; 00049 00054 virtual IReadFile* openFileForReading(const char* filename) = 0; 00055 00060 virtual IReadFileXML* openXMLFileForReading(const char* filename) = 0; 00061 00066 virtual IWriteFile* openFileForWriting(const char* filename) = 0; 00067 00069 virtual void closeFile(IReadFile* file) = 0; 00070 00072 virtual void closeFile(IReadFileXML* file) = 0; 00073 00075 virtual void closeFile(IWriteFile* file) = 0; 00076 00077 protected: 00078 IEngine* engine; 00079 IArray<IReadFile*> openInputs; 00080 IArray<IReadFileXML*> openInputsXML; 00081 IArray<IWriteFile*> openOutputs; 00082 }; 00083 }; 00084 00085 #endif//AMN_IFILEMANAGER_H 00086 00087 /* End of File */