Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | File List | Namespace Members | Class Members | File Members | Related Pages

IFileManager.h

Go to the documentation of this file.
00001 // mortic - A game engine for the Expanses of Naryan.
00002 // Copyright (C) 2007  Aaron Griffith
00003 // This file is under the LGPL. See mortic.h for more information.
00004 
00006 //  ______ _ _      __  __                                                    //
00007 // |  ____(_) |    |  \/  |                                                   //
00008 // | |__   _| | ___| \  / | __ _ _ __   __ _  __ _  ___ _ __                  //
00009 // |  __| | | |/ _ \ |\/| |/ _` | '_ \ / _` |/ _` |/ _ \ '__|                 //
00010 // | |    | | |  __/ |  | | (_| | | | | (_| | (_| |  __/ |                    //
00011 // |_|    |_|_|\___|_|  |_|\__,_|_| |_|\__,_|\__, |\___|_|                    //
00012 //                                            __/ |                           //
00013 //                                           |___/                            //
00014 // IFileManager.h - Interface of FileManager                                  //
00016 
00017 #ifndef __IFileManager_h_INCLUDED__
00018 #define __IFileManager_h_INCLUDED__
00019 
00020 namespace mortic
00021 {
00022         class IFile;
00023 };
00024 
00025 #include <string>
00026 #include <vector>
00027 #include "IRoot.h"
00028 #include "IObject.h"
00029 #include "IFile.h"
00030 
00031 namespace mortic
00032 {
00034         
00042         class IMount
00043         {
00044         public:
00046                 IMount()
00047                 { }
00049                 virtual ~IMount()
00050                 { }
00051                 
00053                 
00061         virtual IFile* open(std::string path, std::string filename,
00062                                         bool write=false, bool append=false) = 0;
00063         
00065         
00069         virtual bool exists(std::string filename) = 0;
00070         
00072         
00077         virtual bool isDirectory(std::string filename) = 0;
00078         
00080         
00085         virtual std::vector<std::string> listDir(std::string path) = 0;
00086         
00088         
00092         virtual unsigned int size(std::string filename) = 0;
00093     };
00094         
00096         
00107     class IFileManager : public IObject
00108     {
00109     public:
00111         IFileManager(IRoot* root) : IObject(root, "FileManager")
00112         { }
00114         virtual ~IFileManager()
00115         { }
00116                 
00118                 
00126                 virtual void mount(IMount* mnt, std::string path) = 0;
00127                 
00129                 
00135                 virtual void unmount(std::string path) = 0;
00136                 
00138                 
00143                 virtual void mountReal(std::string real, std::string path) = 0;
00144                 
00146                 
00150                 virtual void mountMirror(std::string from, std::string to) = 0;
00151                 
00153                 
00160         virtual IFile* open(std::string filename, bool write=false,
00161                                 bool append=false) = 0;
00162         
00164         
00168         virtual bool exists(std::string filename) = 0;
00169         
00171         
00176         virtual bool isDirectory(std::string filename) = 0;
00177         
00179         
00184         virtual std::vector<std::string> listDir(std::string path) = 0;
00185         
00187         
00191         virtual unsigned int size(std::string filename) = 0;
00192     };
00193 
00194 }
00195 ; // namespace mortic
00196 #endif // __IFileManager_h_INCLUDED__

Generated on Sat Dec 30 21:21:59 2006 for mortic by  doxygen 1.4.4