Home | Namespaces | Hierarchy | Alphabetical List | Class list | Files | Namespace Members | Class members | File members | Tutorials
IFileSystem.h
Go to the documentation of this file.
1 // Copyright (C) 2002-2010 Nikolaus Gebhardt
2 // This file is part of the "Irrlicht Engine".
3 // For conditions of distribution and use, see copyright notice in irrlicht.h
4 
5 #ifndef __I_FILE_SYSTEM_H_INCLUDED__
6 #define __I_FILE_SYSTEM_H_INCLUDED__
7 
8 #include "IReferenceCounted.h"
9 #include "IXMLReader.h"
10 #include "IFileArchive.h"
11 
12 namespace irr
13 {
14 namespace video
15 {
16  class IVideoDriver;
17 } // end namespace video
18 namespace io
19 {
20 
21 class IReadFile;
22 class IWriteFile;
23 class IFileList;
24 class IXMLWriter;
25 class IAttributes;
26 
27 
29 
32 class IFileSystem : public virtual IReferenceCounted
33 {
34 public:
35 
37 
41  virtual IReadFile* createAndOpenFile(const path& filename) =0;
42 
44 
54  virtual IReadFile* createMemoryReadFile(void* memory, s32 len, const path& fileName, bool deleteMemoryWhenDropped=false) =0;
55 
57 
66  virtual IReadFile* createLimitReadFile(const path& fileName,
67  IReadFile* alreadyOpenedFile, long pos, long areaSize) =0;
68 
70 
81  virtual IWriteFile* createMemoryWriteFile(void* memory, s32 len, const path& fileName, bool deleteMemoryWhenDropped=false) =0;
82 
83 
85 
92  virtual IWriteFile* createAndWriteFile(const path& filename, bool append=false) =0;
93 
95 
115  virtual bool addFileArchive(const path& filename, bool ignoreCase=true,
116  bool ignorePaths=true,
117  E_FILE_ARCHIVE_TYPE archiveType=EFAT_UNKNOWN,
118  const core::stringc& password="") =0;
119 
121 
123  virtual void addArchiveLoader(IArchiveLoader* loader) =0;
124 
126  virtual u32 getFileArchiveCount() const =0;
127 
129 
133  virtual bool removeFileArchive(u32 index) =0;
134 
136 
141  virtual bool removeFileArchive(const path& filename) =0;
142 
144 
147  virtual bool moveFileArchive(u32 sourceIndex, s32 relative) =0;
148 
150  virtual IFileArchive* getFileArchive(u32 index) =0;
151 
153 
165  virtual bool addZipFileArchive(const c8* filename, bool ignoreCase=true, bool ignorePaths=true)
166  {
167  return addFileArchive(filename, ignoreCase, ignorePaths, EFAT_ZIP);
168  }
169 
171 
181  virtual bool addFolderFileArchive(const c8* filename, bool ignoreCase=true, bool ignorePaths=true)
182  {
183  return addFileArchive(filename, ignoreCase, ignorePaths, EFAT_FOLDER);
184  }
185 
187 
199  virtual bool addPakFileArchive(const c8* filename, bool ignoreCase=true, bool ignorePaths=true)
200  {
201  return addFileArchive(filename, ignoreCase, ignorePaths, EFAT_PAK);
202  }
203 
205 
206  virtual const path& getWorkingDirectory() =0;
207 
209 
213  virtual bool changeWorkingDirectoryTo(const path& newDirectory) =0;
214 
216 
218  virtual path getAbsolutePath(const path& filename) const =0;
219 
221 
223  virtual path getFileDir(const path& filename) const =0;
224 
226 
230  virtual path getFileBasename(const path& filename, bool keepExtension=true) const =0;
231 
233  virtual path& flattenFilename(path& directory, const path& root="/") const =0;
234 
236 
239  virtual IFileList* createFileList() =0;
240 
242 
245  virtual IFileList* createEmptyFileList(const io::path& path, bool ignoreCase, bool ignorePaths) =0;
246 
249 
251 
253  virtual bool existFile(const path& filename) const =0;
254 
256 
262  virtual IXMLReader* createXMLReader(const path& filename) =0;
263 
265 
271  virtual IXMLReader* createXMLReader(IReadFile* file) =0;
272 
274 
280  virtual IXMLReaderUTF8* createXMLReaderUTF8(const path& filename) =0;
281 
283 
289  virtual IXMLReaderUTF8* createXMLReaderUTF8(IReadFile* file) =0;
290 
292 
296  virtual IXMLWriter* createXMLWriter(const path& filename) =0;
297 
299 
303  virtual IXMLWriter* createXMLWriter(IWriteFile* file) =0;
304 
306 
312 };
313 
314 
315 } // end namespace io
316 } // end namespace irr
317 
318 #endif
319 

The Irrlicht Engine
The Irrlicht Engine Documentation © 2003-2010 by Nikolaus Gebhardt. Generated on Tue Jun 5 2012 17:57:11 by Doxygen (1.8.1)