Irrlicht 3D Engine
 
Loading...
Searching...
No Matches
IFileArchive.h
Go to the documentation of this file.
1// Copyright (C) 2002-2012 Nikolaus Gebhardt/ Thomas Alten
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_ARCHIVE_H_INCLUDED__
6#define __I_FILE_ARCHIVE_H_INCLUDED__
7
8#include "IReadFile.h"
9#include "IFileList.h"
10
11namespace irr
12{
13
14namespace io
15{
16
19{
20 FILESYSTEM_NATIVE = 0, // Native OS FileSystem
21 FILESYSTEM_VIRTUAL // Virtual FileSystem
22};
23
26{
28 EFAT_ZIP = MAKE_IRR_ID('Z','I','P', 0),
29
31 EFAT_GZIP = MAKE_IRR_ID('g','z','i','p'),
32
34 EFAT_FOLDER = MAKE_IRR_ID('f','l','d','r'),
35
37 EFAT_PAK = MAKE_IRR_ID('P','A','K', 0),
38
40 EFAT_NPK = MAKE_IRR_ID('N','P','K', 0),
41
43 EFAT_TAR = MAKE_IRR_ID('T','A','R', 0),
44
46 EFAT_WAD = MAKE_IRR_ID('W','A','D', 0),
47
49 EFAT_UNKNOWN = MAKE_IRR_ID('u','n','k','n')
50};
51
53class IFileArchive : public virtual IReferenceCounted
54{
55public:
56
58
62 virtual IReadFile* createAndOpenFile(const path& filename) =0;
63
65
68 virtual IReadFile* createAndOpenFile(u32 index) =0;
69
71
73 virtual const IFileList* getFileList() const =0;
74
76 virtual E_FILE_ARCHIVE_TYPE getType() const { return EFAT_UNKNOWN; }
77
79
84};
85
87
91class IArchiveLoader : public virtual IReferenceCounted
92{
93public:
95
98 virtual bool isALoadableFileFormat(const path& filename) const =0;
99
101
104 virtual bool isALoadableFileFormat(io::IReadFile* file) const =0;
105
107
110 virtual bool isALoadableFileFormat(E_FILE_ARCHIVE_TYPE fileType) const =0;
111
113
117 virtual IFileArchive* createArchive(const path& filename, bool ignoreCase, bool ignorePaths) const =0;
118
120
124 virtual IFileArchive* createArchive(io::IReadFile* file, bool ignoreCase, bool ignorePaths) const =0;
125};
126
127
128} // end namespace io
129} // end namespace irr
130
131#endif
132
Base class of most objects of the Irrlicht Engine.
Axis aligned bounding box in 3d dimensional space.
Definition aabbox3d.h:22
Class which is able to create an archive from a file.
virtual IFileArchive * createArchive(const path &filename, bool ignoreCase, bool ignorePaths) const =0
Creates an archive from the filename.
virtual IFileArchive * createArchive(io::IReadFile *file, bool ignoreCase, bool ignorePaths) const =0
Creates an archive from the file.
virtual bool isALoadableFileFormat(const path &filename) const =0
Check if the file might be loaded by this class.
virtual bool isALoadableFileFormat(io::IReadFile *file) const =0
Check if the file might be loaded by this class.
virtual bool isALoadableFileFormat(E_FILE_ARCHIVE_TYPE fileType) const =0
Check to see if the loader can create archives of this type.
The FileArchive manages archives and provides access to files inside them.
virtual IReadFile * createAndOpenFile(u32 index)=0
Opens a file based on its position in the file list.
virtual IReadFile * createAndOpenFile(const path &filename)=0
Opens a file based on its name.
virtual const IFileList * getFileList() const =0
Returns the complete file tree.
core::stringc Password
An optionally used password string.
virtual E_FILE_ARCHIVE_TYPE getType() const
get the archive type
Provides a list of files and folders.
Definition IFileList.h:20
Interface providing read acess to a file.
Definition IReadFile.h:18
#define MAKE_IRR_ID(c0, c1, c2, c3)
ignore VC8 warning deprecated
Definition irrTypes.h:241
EFileSystemType
FileSystemType: which Filesystem should be used for e.g. browsing.
@ FILESYSTEM_VIRTUAL
@ FILESYSTEM_NATIVE
E_FILE_ARCHIVE_TYPE
Contains the different types of archives.
@ EFAT_TAR
A Tape ARchive.
@ EFAT_FOLDER
A virtual directory.
@ EFAT_UNKNOWN
The type of this archive is unknown.
@ EFAT_WAD
A wad Archive, Quake2, Halflife.
@ EFAT_ZIP
A PKZIP archive.
@ EFAT_GZIP
A gzip archive.
@ EFAT_PAK
An ID Software PAK archive.
@ EFAT_NPK
A Nebula Device archive.
Everything in the Irrlicht Engine can be found in this namespace.
Definition aabbox3d.h:13
unsigned int u32
32 bit unsigned variable.
Definition irrTypes.h:58