Home | Namespaces | Hierarchy | Alphabetical List | Class list | Files | Namespace Members | Class members | File members | Tutorials

IFileSystem.h

Go to the documentation of this file.
00001 // Copyright (C) 2002-2009 Nikolaus Gebhardt
00002 // This file is part of the "Irrlicht Engine".
00003 // For conditions of distribution and use, see copyright notice in irrlicht.h
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 } // end namespace video
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 
00109         virtual bool addFileArchive(const path& filename, bool ignoreCase=true, bool ignorePaths=true,
00110                 E_FILE_ARCHIVE_TYPE archiveType=EFAT_UNKNOWN) =0;
00111 
00113 
00115         virtual void addArchiveLoader(IArchiveLoader* loader) =0;
00116 
00118         virtual u32 getFileArchiveCount() const =0;
00119 
00121 
00125         virtual bool removeFileArchive(u32 index) =0;
00126 
00128 
00133         virtual bool removeFileArchive(const path& filename) =0;
00134 
00136 
00139         virtual bool moveFileArchive(u32 sourceIndex, s32 relative) =0;
00140 
00142         virtual IFileArchive* getFileArchive(u32 index) =0;
00143 
00145 
00156         virtual bool addZipFileArchive(const c8* filename, bool ignoreCase=true, bool ignorePaths=true)
00157         {
00158                 return addFileArchive(filename, ignoreCase, ignorePaths, EFAT_ZIP);
00159         }
00160 
00162 
00171         virtual bool addFolderFileArchive(const c8* filename, bool ignoreCase=true, bool ignorePaths=true)
00172         {
00173                 return addFileArchive(filename, ignoreCase, ignorePaths, EFAT_FOLDER);
00174         }
00175 
00177 
00188         virtual bool addPakFileArchive(const c8* filename, bool ignoreCase=true, bool ignorePaths=true)
00189         {
00190                 return addFileArchive(filename, ignoreCase, ignorePaths, EFAT_PAK);
00191         }
00192 
00194 
00195         virtual const path& getWorkingDirectory() =0;
00196 
00198 
00202         virtual bool changeWorkingDirectoryTo(const path& newDirectory) =0;
00203 
00205 
00207         virtual path getAbsolutePath(const path& filename) const =0;
00208 
00210 
00212         virtual path getFileDir(const path& filename) const =0;
00213 
00215 
00219         virtual path getFileBasename(const path& filename, bool keepExtension=true) const =0;
00220 
00222         virtual path& flattenFilename(path& directory, const path& root="/") const =0;
00223 
00225 
00228         virtual IFileList* createFileList() =0;
00229 
00231 
00234         virtual IFileList* createEmptyFileList(const io::path& path, bool ignoreCase, bool ignorePaths) =0;
00235 
00237         virtual EFileSystemType setFileListSystem(EFileSystemType listType) =0;
00238 
00240 
00242         virtual bool existFile(const path& filename) const =0;
00243 
00245 
00251         virtual IXMLReader* createXMLReader(const path& filename) =0;
00252 
00254 
00260         virtual IXMLReader* createXMLReader(IReadFile* file) =0;
00261 
00263 
00269         virtual IXMLReaderUTF8* createXMLReaderUTF8(const path& filename) =0;
00270 
00272 
00278         virtual IXMLReaderUTF8* createXMLReaderUTF8(IReadFile* file) =0;
00279 
00281 
00285         virtual IXMLWriter* createXMLWriter(const path& filename) =0;
00286 
00288 
00292         virtual IXMLWriter* createXMLWriter(IWriteFile* file) =0;
00293 
00295 
00300         virtual IAttributes* createEmptyAttributes(video::IVideoDriver* driver=0) =0;
00301 };
00302 
00303 
00304 } // end namespace io
00305 } // end namespace irr
00306 
00307 #endif
00308 

The Irrlicht Engine
The Irrlicht Engine Documentation © 2003-2009 by Nikolaus Gebhardt. Generated on Sun Jan 10 09:24:03 2010 by Doxygen (1.5.6)