1
// Copyright (C) 2002-2011 Nikolaus Gebhardt
2
// This file is part of the "Irrlicht Engine".
3
// For conditions of distribution and use, see copyright notice in irrlicht.h
5
#ifndef __C_MOUNT_READER_H_INCLUDED__
6
#define __C_MOUNT_READER_H_INCLUDED__
8
#include "IrrCompileConfig.h"
10
#ifdef __IRR_COMPILE_WITH_MOUNT_ARCHIVE_LOADER_
12
#include "IFileSystem.h"
13
#include "CFileList.h"
20
//! Archiveloader capable of loading MountPoint Archives
21
class CArchiveLoaderMount : public IArchiveLoader
26
CArchiveLoaderMount(io::IFileSystem* fs);
28
//! returns true if the file maybe is able to be loaded by this class
29
//! based on the file extension (e.g. ".zip")
30
virtual bool isALoadableFileFormat(const io::path& filename) const;
32
//! Check if the file might be loaded by this class
33
/** Check might look into the file.
34
\param file File handle to check.
35
\return True if file seems to be loadable. */
36
virtual bool isALoadableFileFormat(io::IReadFile* file) const;
38
//! Check to see if the loader can create archives of this type.
39
/** Check based on the archive type.
40
\param fileType The archive type to check.
41
\return True if the archile loader supports this type, false if not */
42
virtual bool isALoadableFileFormat(E_FILE_ARCHIVE_TYPE fileType) const;
44
//! Creates an archive from the filename
45
/** \param file File handle to check.
46
\return Pointer to newly created archive, or 0 upon error. */
47
virtual IFileArchive* createArchive(const io::path& filename, bool ignoreCase, bool ignorePaths) const;
49
//! creates/loads an archive from the file.
50
//! \return Pointer to the created archive. Returns 0 if loading failed.
51
virtual IFileArchive* createArchive(io::IReadFile* file, bool ignoreCase, bool ignorePaths) const;
54
io::IFileSystem* FileSystem;
57
//! A File Archive which uses a mountpoint
58
class CMountPointReader : public virtual IFileArchive, virtual CFileList
63
CMountPointReader(IFileSystem *parent, const io::path& basename,
64
bool ignoreCase, bool ignorePaths);
66
//! opens a file by index
67
virtual IReadFile* createAndOpenFile(u32 index);
69
//! opens a file by file name
70
virtual IReadFile* createAndOpenFile(const io::path& filename);
72
//! returns the list of files
73
virtual const IFileList* getFileList() const;
75
//! get the class Type
76
virtual E_FILE_ARCHIVE_TYPE getType() const { return EFAT_FOLDER; }
80
core::array<io::path> RealFileNames;
83
void buildDirectory();
88
#endif // __IRR_COMPILE_WITH_MOUNT_ARCHIVE_LOADER_
89
#endif // __C_MOUNT_READER_H_INCLUDED__