00001
00002
00003
00004
00006
00007
00008
00009
00010
00011
00012
00013
00014
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 ;
00196 #endif // __IFileManager_h_INCLUDED__