00001
00002
00003
00004
00005 #ifndef __I_FILE_SYSTEM_H_INCLUDED__
00006 #define __I_FILE_SYSTEM_H_INCLUDED__
00007
00008 #include "IReferenceCounted.h"
00009 #include "IXMLReader.h"
00010 #include "IFileArchive.h"
00011
00012 namespace irr
00013 {
00014 namespace video
00015 {
00016 class IVideoDriver;
00017 }
00018 namespace io
00019 {
00020
00021 class IReadFile;
00022 class IWriteFile;
00023 class IFileList;
00024 class IXMLWriter;
00025 class IAttributes;
00026
00027
00029
00032 class IFileSystem : public virtual IReferenceCounted
00033 {
00034 public:
00035
00037
00041 virtual IReadFile* createAndOpenFile(const path& filename) =0;
00042
00044
00054 virtual IReadFile* createMemoryReadFile(void* memory, s32 len, const path& fileName, bool deleteMemoryWhenDropped=false) =0;
00055
00057
00066 virtual IReadFile* createLimitReadFile(const path& fileName,
00067 IReadFile* alreadyOpenedFile, long pos, long areaSize) =0;
00068
00070
00081 virtual IWriteFile* createMemoryWriteFile(void* memory, s32 len, const path& fileName, bool deleteMemoryWhenDropped=false) =0;
00082
00083
00085
00092 virtual IWriteFile* createAndWriteFile(const path& filename, bool append=false) =0;
00093
00095
00115 virtual bool addFileArchive(const path& filename, bool ignoreCase=true,
00116 bool ignorePaths=true,
00117 E_FILE_ARCHIVE_TYPE archiveType=EFAT_UNKNOWN,
00118 const core::stringc& password="") =0;
00119
00121
00123 virtual void addArchiveLoader(IArchiveLoader* loader) =0;
00124
00126 virtual u32 getFileArchiveCount() const =0;
00127
00129
00133 virtual bool removeFileArchive(u32 index) =0;
00134
00136
00141 virtual bool removeFileArchive(const path& filename) =0;
00142
00144
00147 virtual bool moveFileArchive(u32 sourceIndex, s32 relative) =0;
00148
00150 virtual IFileArchive* getFileArchive(u32 index) =0;
00151
00153
00165 virtual bool addZipFileArchive(const c8* filename, bool ignoreCase=true, bool ignorePaths=true)
00166 {
00167 return addFileArchive(filename, ignoreCase, ignorePaths, EFAT_ZIP);
00168 }
00169
00171
00181 virtual bool addFolderFileArchive(const c8* filename, bool ignoreCase=true, bool ignorePaths=true)
00182 {
00183 return addFileArchive(filename, ignoreCase, ignorePaths, EFAT_FOLDER);
00184 }
00185
00187
00199 virtual bool addPakFileArchive(const c8* filename, bool ignoreCase=true, bool ignorePaths=true)
00200 {
00201 return addFileArchive(filename, ignoreCase, ignorePaths, EFAT_PAK);
00202 }
00203
00205
00206 virtual const path& getWorkingDirectory() =0;
00207
00209
00213 virtual bool changeWorkingDirectoryTo(const path& newDirectory) =0;
00214
00216
00218 virtual path getAbsolutePath(const path& filename) const =0;
00219
00221
00223 virtual path getFileDir(const path& filename) const =0;
00224
00226
00230 virtual path getFileBasename(const path& filename, bool keepExtension=true) const =0;
00231
00233 virtual path& flattenFilename(path& directory, const path& root="/") const =0;
00234
00236
00239 virtual IFileList* createFileList() =0;
00240
00242
00245 virtual IFileList* createEmptyFileList(const io::path& path, bool ignoreCase, bool ignorePaths) =0;
00246
00248 virtual EFileSystemType setFileListSystem(EFileSystemType listType) =0;
00249
00251
00253 virtual bool existFile(const path& filename) const =0;
00254
00256
00262 virtual IXMLReader* createXMLReader(const path& filename) =0;
00263
00265
00271 virtual IXMLReader* createXMLReader(IReadFile* file) =0;
00272
00274
00280 virtual IXMLReaderUTF8* createXMLReaderUTF8(const path& filename) =0;
00281
00283
00289 virtual IXMLReaderUTF8* createXMLReaderUTF8(IReadFile* file) =0;
00290
00292
00296 virtual IXMLWriter* createXMLWriter(const path& filename) =0;
00297
00299
00303 virtual IXMLWriter* createXMLWriter(IWriteFile* file) =0;
00304
00306
00311 virtual IAttributes* createEmptyAttributes(video::IVideoDriver* driver=0) =0;
00312 };
00313
00314
00315 }
00316 }
00317
00318 #endif
00319