#ifndef __C_FILE_SYSTEM_H_INCLUDED__
#define __C_FILE_SYSTEM_H_INCLUDED__
#include "IFileSystem.h"
#include "irrArray.h"
namespace irr
{
namespace io
{
class CZipReader;
class CPakReader;
class CMountPointReader;
class CFileSystem : public IFileSystem
{
public:
CFileSystem();
virtual ~CFileSystem();
virtual IReadFile* createAndOpenFile(const io::path& filename);
virtual IReadFile* createMemoryReadFile(void* memory, s32 len, const io::path& fileName, bool deleteMemoryWhenDropped = false);
virtual IReadFile* createLimitReadFile(const io::path& fileName, IReadFile* alreadyOpenedFile, long pos, long areaSize);
virtual IWriteFile* createMemoryWriteFile(void* memory, s32 len, const io::path& fileName, bool deleteMemoryWhenDropped=false);
virtual IWriteFile* createAndWriteFile(const io::path& filename, bool append=false);
virtual bool addFileArchive(const io::path& filename,
bool ignoreCase = true, bool ignorePaths = true,
E_FILE_ARCHIVE_TYPE archiveType = EFAT_UNKNOWN,
const core::stringc& password="");
virtual bool moveFileArchive( u32 sourceIndex, s32 relative );
virtual void addArchiveLoader(IArchiveLoader* loader);
virtual u32 getArchiveLoaderCount() const;
virtual IArchiveLoader* getArchiveLoader(u32 index) const;
virtual u32 getFileArchiveCount() const;
virtual IFileArchive* getFileArchive(u32 index);
virtual bool removeFileArchive(u32 index);
virtual bool removeFileArchive(const io::path& filename);
virtual const io::path& getWorkingDirectory();
virtual bool changeWorkingDirectoryTo(const io::path& newDirectory);
virtual io::path getAbsolutePath(const io::path& filename) const;
virtual io::path getFileDir(const io::path& filename) const;
virtual io::path getFileBasename(const io::path& filename, bool keepExtension=true) const;
virtual io::path& flattenFilename( io::path& directory, const io::path& root = "/" ) const;
virtual path getRelativeFilename(const path& filename, const path& directory) const;
virtual EFileSystemType setFileListSystem(EFileSystemType listType);
virtual IFileList* createFileList();
virtual IFileList* createEmptyFileList(const io::path& path, bool ignoreCase, bool ignorePaths);
virtual bool existFile(const io::path& filename) const;
virtual IXMLReader* createXMLReader(const io::path& filename);
virtual IXMLReader* createXMLReader(IReadFile* file);
virtual IXMLReaderUTF8* createXMLReaderUTF8(const io::path& filename);
virtual IXMLReaderUTF8* createXMLReaderUTF8(IReadFile* file);
virtual IXMLWriter* createXMLWriter(const io::path& filename);
virtual IXMLWriter* createXMLWriter(IWriteFile* file);
virtual IAttributes* createEmptyAttributes(video::IVideoDriver* driver);
private:
EFileSystemType FileSystemType;
io::path WorkingDirectory [2];
core::array<IArchiveLoader*> ArchiveLoader;
core::array<IFileArchive*> FileArchives;
};
}
}
#endif