Go to the documentation of this file.00001
00002
00003
00004
00005 #ifndef __I_FILE_ARCHIVE_H_INCLUDED__
00006 #define __I_FILE_ARCHIVE_H_INCLUDED__
00007
00008 #include "IReadFile.h"
00009 #include "IFileList.h"
00010
00011 namespace irr
00012 {
00013
00014 namespace io
00015 {
00016
00018 enum EFileSystemType
00019 {
00020 FILESYSTEM_NATIVE = 0,
00021 FILESYSTEM_VIRTUAL
00022 };
00023
00025 enum E_FILE_ARCHIVE_TYPE
00026 {
00028 EFAT_ZIP = MAKE_IRR_ID('Z','I','P', 0),
00029
00031 EFAT_GZIP = MAKE_IRR_ID('g','z','i','p'),
00032
00034 EFAT_FOLDER = MAKE_IRR_ID('f','l','d','r'),
00035
00037 EFAT_PAK = MAKE_IRR_ID('P','A','K', 0),
00038
00040 EFAT_NPK = MAKE_IRR_ID('N','P','K', 0),
00041
00043 EFAT_TAR = MAKE_IRR_ID('T','A','R', 0),
00044
00046 EFAT_WAD = MAKE_IRR_ID('W','A','D', 0),
00047
00049 EFAT_UNKNOWN = MAKE_IRR_ID('u','n','k','n')
00050 };
00051
00053 class IFileArchive : public virtual IReferenceCounted
00054 {
00055 public:
00056
00058
00062 virtual IReadFile* createAndOpenFile(const path& filename) =0;
00063
00065
00068 virtual IReadFile* createAndOpenFile(u32 index) =0;
00069
00071
00073 virtual const IFileList* getFileList() const =0;
00074
00076 virtual E_FILE_ARCHIVE_TYPE getType() const { return EFAT_UNKNOWN; }
00077
00079
00083 core::stringc Password;
00084 };
00085
00087
00091 class IArchiveLoader : public virtual IReferenceCounted
00092 {
00093 public:
00095
00098 virtual bool isALoadableFileFormat(const path& filename) const =0;
00099
00101
00104 virtual bool isALoadableFileFormat(io::IReadFile* file) const =0;
00105
00107
00110 virtual bool isALoadableFileFormat(E_FILE_ARCHIVE_TYPE fileType) const =0;
00111
00113
00117 virtual IFileArchive* createArchive(const path& filename, bool ignoreCase, bool ignorePaths) const =0;
00118
00120
00124 virtual IFileArchive* createArchive(io::IReadFile* file, bool ignoreCase, bool ignorePaths) const =0;
00125 };
00126
00127
00128 }
00129 }
00130
00131 #endif
00132