Jimcpp 2.1.0
Jimcpp is a high-performance c++ graphics engine.
Loading...
Searching...
No Matches
IFileArchive.hpp
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 jimcpp/jimcpp.hpp
4
5#ifndef JPP_I_FILE_ARCHIVE_HPP_INCLUDED
6#define JPP_I_FILE_ARCHIVE_HPP_INCLUDED
7
8#include <jimcpp/core/engine/IReadFile.hpp>
9#include <jimcpp/core/engine/IFileList.hpp>
10
11namespace jpp
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_JPP_ID('Z','I','P', 0),
29
31 EFAT_GZIP = MAKE_JPP_ID('g','z','i','p'),
32
34 EFAT_FOLDER = MAKE_JPP_ID('f','l','d','r'),
35
37 EFAT_PAK = MAKE_JPP_ID('P','A','K', 0),
38
40 EFAT_NPK = MAKE_JPP_ID('N','P','K', 0),
41
43 EFAT_TAR = MAKE_JPP_ID('T','A','R', 0),
44
46 EFAT_WAD = MAKE_JPP_ID('W','A','D', 0),
47
49 EFAT_UNKNOWN = MAKE_JPP_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 virtual const io::path& getArchiveName() const =0;
80
82
87};
88
90
94class IArchiveLoader : public virtual IReferenceCounted
95{
96public:
98
101 virtual bool isALoadableFileFormat(const path& filename) const =0;
102
104
107 virtual bool isALoadableFileFormat(io::IReadFile* file) const =0;
108
110
113 virtual bool isALoadableFileFormat(E_FILE_ARCHIVE_TYPE fileType) const =0;
114
116
120 virtual IFileArchive* createArchive(const path& filename, bool ignoreCase, bool ignorePaths) const =0;
121
123
127 virtual IFileArchive* createArchive(io::IReadFile* file, bool ignoreCase, bool ignorePaths) const =0;
128};
129
130
131} // end namespace io
132} // end namespace jpp
133
134#endif
Base class of most objects of the Jimcpp Engine.
Definition IReferenceCounted.hpp:46
Axis aligned bounding box in 3d dimensional space.
Definition aabbox3d.hpp:22
Class which is able to create an archive from a file.
Definition IFileArchive.hpp:95
virtual bool isALoadableFileFormat(E_FILE_ARCHIVE_TYPE fileType) const =0
Check to see if the loader can create archives of this type.
virtual bool isALoadableFileFormat(io::IReadFile *file) const =0
Check if the file might be loaded by this class.
virtual bool isALoadableFileFormat(const path &filename) const =0
Check if the file might be loaded by this class.
virtual IFileArchive * createArchive(io::IReadFile *file, bool ignoreCase, bool ignorePaths) const =0
Creates an archive from the file.
virtual IFileArchive * createArchive(const path &filename, bool ignoreCase, bool ignorePaths) const =0
Creates an archive from the filename.
The FileArchive manages archives and provides access to files inside them.
Definition IFileArchive.hpp:54
core::stringc Password
An optionally used password string.
Definition IFileArchive.hpp:86
virtual IReadFile * createAndOpenFile(u32 index)=0
Opens a file based on its position in the file list.
virtual const io::path & getArchiveName() const =0
return the name (id) of the file Archive
virtual E_FILE_ARCHIVE_TYPE getType() const
get the archive type
Definition IFileArchive.hpp:76
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.
Provides a list of files and folders.
Definition IFileList.hpp:20
Interface providing read access to a file.
Definition IReadFile.hpp:19
EFileSystemType
FileSystemType: which filesystem should be used for e.g. browsing.
Definition IFileArchive.hpp:19
E_FILE_ARCHIVE_TYPE
Contains the different types of archives.
Definition IFileArchive.hpp:26
@ EFAT_FOLDER
A virtual directory.
Definition IFileArchive.hpp:34
@ EFAT_WAD
A wad Archive, Quake2, Halflife.
Definition IFileArchive.hpp:46
@ EFAT_PAK
An ID Software PAK archive.
Definition IFileArchive.hpp:37
@ EFAT_GZIP
A gzip archive.
Definition IFileArchive.hpp:31
@ EFAT_UNKNOWN
The type of this archive is unknown.
Definition IFileArchive.hpp:49
@ EFAT_NPK
A Nebula Device archive.
Definition IFileArchive.hpp:40
@ EFAT_ZIP
A PKZIP archive.
Definition IFileArchive.hpp:28
@ EFAT_TAR
A Tape ARchive.
Definition IFileArchive.hpp:43
As of Jimcpp 1.6, position2d is a synonym for vector2d.
Definition vector3d.hpp:11
unsigned int u32
32 bit unsigned variable.
Definition irrTypes.hpp:64

Jimcpp    @cppfx.xyz

K