diff options
Diffstat (limited to '')
-rw-r--r-- | libraries/irrlicht-1.8/include/IFileArchive.h | 264 |
1 files changed, 132 insertions, 132 deletions
diff --git a/libraries/irrlicht-1.8/include/IFileArchive.h b/libraries/irrlicht-1.8/include/IFileArchive.h index a2e02a8..8bf8cad 100644 --- a/libraries/irrlicht-1.8/include/IFileArchive.h +++ b/libraries/irrlicht-1.8/include/IFileArchive.h | |||
@@ -1,132 +1,132 @@ | |||
1 | // Copyright (C) 2002-2012 Nikolaus Gebhardt/ Thomas Alten | 1 | // Copyright (C) 2002-2012 Nikolaus Gebhardt/ Thomas Alten |
2 | // This file is part of the "Irrlicht Engine". | 2 | // This file is part of the "Irrlicht Engine". |
3 | // For conditions of distribution and use, see copyright notice in irrlicht.h | 3 | // For conditions of distribution and use, see copyright notice in irrlicht.h |
4 | 4 | ||
5 | #ifndef __I_FILE_ARCHIVE_H_INCLUDED__ | 5 | #ifndef __I_FILE_ARCHIVE_H_INCLUDED__ |
6 | #define __I_FILE_ARCHIVE_H_INCLUDED__ | 6 | #define __I_FILE_ARCHIVE_H_INCLUDED__ |
7 | 7 | ||
8 | #include "IReadFile.h" | 8 | #include "IReadFile.h" |
9 | #include "IFileList.h" | 9 | #include "IFileList.h" |
10 | 10 | ||
11 | namespace irr | 11 | namespace irr |
12 | { | 12 | { |
13 | 13 | ||
14 | namespace io | 14 | namespace io |
15 | { | 15 | { |
16 | 16 | ||
17 | //! FileSystemType: which Filesystem should be used for e.g. browsing | 17 | //! FileSystemType: which Filesystem should be used for e.g. browsing |
18 | enum EFileSystemType | 18 | enum EFileSystemType |
19 | { | 19 | { |
20 | FILESYSTEM_NATIVE = 0, // Native OS FileSystem | 20 | FILESYSTEM_NATIVE = 0, // Native OS FileSystem |
21 | FILESYSTEM_VIRTUAL // Virtual FileSystem | 21 | FILESYSTEM_VIRTUAL // Virtual FileSystem |
22 | }; | 22 | }; |
23 | 23 | ||
24 | //! Contains the different types of archives | 24 | //! Contains the different types of archives |
25 | enum E_FILE_ARCHIVE_TYPE | 25 | enum E_FILE_ARCHIVE_TYPE |
26 | { | 26 | { |
27 | //! A PKZIP archive | 27 | //! A PKZIP archive |
28 | EFAT_ZIP = MAKE_IRR_ID('Z','I','P', 0), | 28 | EFAT_ZIP = MAKE_IRR_ID('Z','I','P', 0), |
29 | 29 | ||
30 | //! A gzip archive | 30 | //! A gzip archive |
31 | EFAT_GZIP = MAKE_IRR_ID('g','z','i','p'), | 31 | EFAT_GZIP = MAKE_IRR_ID('g','z','i','p'), |
32 | 32 | ||
33 | //! A virtual directory | 33 | //! A virtual directory |
34 | EFAT_FOLDER = MAKE_IRR_ID('f','l','d','r'), | 34 | EFAT_FOLDER = MAKE_IRR_ID('f','l','d','r'), |
35 | 35 | ||
36 | //! An ID Software PAK archive | 36 | //! An ID Software PAK archive |
37 | EFAT_PAK = MAKE_IRR_ID('P','A','K', 0), | 37 | EFAT_PAK = MAKE_IRR_ID('P','A','K', 0), |
38 | 38 | ||
39 | //! A Nebula Device archive | 39 | //! A Nebula Device archive |
40 | EFAT_NPK = MAKE_IRR_ID('N','P','K', 0), | 40 | EFAT_NPK = MAKE_IRR_ID('N','P','K', 0), |
41 | 41 | ||
42 | //! A Tape ARchive | 42 | //! A Tape ARchive |
43 | EFAT_TAR = MAKE_IRR_ID('T','A','R', 0), | 43 | EFAT_TAR = MAKE_IRR_ID('T','A','R', 0), |
44 | 44 | ||
45 | //! A wad Archive, Quake2, Halflife | 45 | //! A wad Archive, Quake2, Halflife |
46 | EFAT_WAD = MAKE_IRR_ID('W','A','D', 0), | 46 | EFAT_WAD = MAKE_IRR_ID('W','A','D', 0), |
47 | 47 | ||
48 | //! The type of this archive is unknown | 48 | //! The type of this archive is unknown |
49 | EFAT_UNKNOWN = MAKE_IRR_ID('u','n','k','n') | 49 | EFAT_UNKNOWN = MAKE_IRR_ID('u','n','k','n') |
50 | }; | 50 | }; |
51 | 51 | ||
52 | //! The FileArchive manages archives and provides access to files inside them. | 52 | //! The FileArchive manages archives and provides access to files inside them. |
53 | class IFileArchive : public virtual IReferenceCounted | 53 | class IFileArchive : public virtual IReferenceCounted |
54 | { | 54 | { |
55 | public: | 55 | public: |
56 | 56 | ||
57 | //! Opens a file based on its name | 57 | //! Opens a file based on its name |
58 | /** Creates and returns a new IReadFile for a file in the archive. | 58 | /** Creates and returns a new IReadFile for a file in the archive. |
59 | \param filename The file to open | 59 | \param filename The file to open |
60 | \return Returns A pointer to the created file on success, | 60 | \return Returns A pointer to the created file on success, |
61 | or 0 on failure. */ | 61 | or 0 on failure. */ |
62 | virtual IReadFile* createAndOpenFile(const path& filename) =0; | 62 | virtual IReadFile* createAndOpenFile(const path& filename) =0; |
63 | 63 | ||
64 | //! Opens a file based on its position in the file list. | 64 | //! Opens a file based on its position in the file list. |
65 | /** Creates and returns | 65 | /** Creates and returns |
66 | \param index The zero based index of the file. | 66 | \param index The zero based index of the file. |
67 | \return Returns a pointer to the created file on success, or 0 on failure. */ | 67 | \return Returns a pointer to the created file on success, or 0 on failure. */ |
68 | virtual IReadFile* createAndOpenFile(u32 index) =0; | 68 | virtual IReadFile* createAndOpenFile(u32 index) =0; |
69 | 69 | ||
70 | //! Returns the complete file tree | 70 | //! Returns the complete file tree |
71 | /** \return Returns the complete directory tree for the archive, | 71 | /** \return Returns the complete directory tree for the archive, |
72 | including all files and folders */ | 72 | including all files and folders */ |
73 | virtual const IFileList* getFileList() const =0; | 73 | virtual const IFileList* getFileList() const =0; |
74 | 74 | ||
75 | //! get the archive type | 75 | //! get the archive type |
76 | virtual E_FILE_ARCHIVE_TYPE getType() const { return EFAT_UNKNOWN; } | 76 | virtual E_FILE_ARCHIVE_TYPE getType() const { return EFAT_UNKNOWN; } |
77 | 77 | ||
78 | //! An optionally used password string | 78 | //! An optionally used password string |
79 | /** This variable is publicly accessible from the interface in order to | 79 | /** This variable is publicly accessible from the interface in order to |
80 | avoid single access patterns to this place, and hence allow some more | 80 | avoid single access patterns to this place, and hence allow some more |
81 | obscurity. | 81 | obscurity. |
82 | */ | 82 | */ |
83 | core::stringc Password; | 83 | core::stringc Password; |
84 | }; | 84 | }; |
85 | 85 | ||
86 | //! Class which is able to create an archive from a file. | 86 | //! Class which is able to create an archive from a file. |
87 | /** If you want the Irrlicht Engine be able to load archives of | 87 | /** If you want the Irrlicht Engine be able to load archives of |
88 | currently unsupported file formats (e.g .wad), then implement | 88 | currently unsupported file formats (e.g .wad), then implement |
89 | this and add your new Archive loader with | 89 | this and add your new Archive loader with |
90 | IFileSystem::addArchiveLoader() to the engine. */ | 90 | IFileSystem::addArchiveLoader() to the engine. */ |
91 | class IArchiveLoader : public virtual IReferenceCounted | 91 | class IArchiveLoader : public virtual IReferenceCounted |
92 | { | 92 | { |
93 | public: | 93 | public: |
94 | //! Check if the file might be loaded by this class | 94 | //! Check if the file might be loaded by this class |
95 | /** Check based on the file extension (e.g. ".zip") | 95 | /** Check based on the file extension (e.g. ".zip") |
96 | \param filename Name of file to check. | 96 | \param filename Name of file to check. |
97 | \return True if file seems to be loadable. */ | 97 | \return True if file seems to be loadable. */ |
98 | virtual bool isALoadableFileFormat(const path& filename) const =0; | 98 | virtual bool isALoadableFileFormat(const path& filename) const =0; |
99 | 99 | ||
100 | //! Check if the file might be loaded by this class | 100 | //! Check if the file might be loaded by this class |
101 | /** This check may look into the file. | 101 | /** This check may look into the file. |
102 | \param file File handle to check. | 102 | \param file File handle to check. |
103 | \return True if file seems to be loadable. */ | 103 | \return True if file seems to be loadable. */ |
104 | virtual bool isALoadableFileFormat(io::IReadFile* file) const =0; | 104 | virtual bool isALoadableFileFormat(io::IReadFile* file) const =0; |
105 | 105 | ||
106 | //! Check to see if the loader can create archives of this type. | 106 | //! Check to see if the loader can create archives of this type. |
107 | /** Check based on the archive type. | 107 | /** Check based on the archive type. |
108 | \param fileType The archive type to check. | 108 | \param fileType The archive type to check. |
109 | \return True if the archile loader supports this type, false if not */ | 109 | \return True if the archile loader supports this type, false if not */ |
110 | virtual bool isALoadableFileFormat(E_FILE_ARCHIVE_TYPE fileType) const =0; | 110 | virtual bool isALoadableFileFormat(E_FILE_ARCHIVE_TYPE fileType) const =0; |
111 | 111 | ||
112 | //! Creates an archive from the filename | 112 | //! Creates an archive from the filename |
113 | /** \param filename File to use. | 113 | /** \param filename File to use. |
114 | \param ignoreCase Searching is performed without regarding the case | 114 | \param ignoreCase Searching is performed without regarding the case |
115 | \param ignorePaths Files are searched for without checking for the directories | 115 | \param ignorePaths Files are searched for without checking for the directories |
116 | \return Pointer to newly created archive, or 0 upon error. */ | 116 | \return Pointer to newly created archive, or 0 upon error. */ |
117 | virtual IFileArchive* createArchive(const path& filename, bool ignoreCase, bool ignorePaths) const =0; | 117 | virtual IFileArchive* createArchive(const path& filename, bool ignoreCase, bool ignorePaths) const =0; |
118 | 118 | ||
119 | //! Creates an archive from the file | 119 | //! Creates an archive from the file |
120 | /** \param file File handle to use. | 120 | /** \param file File handle to use. |
121 | \param ignoreCase Searching is performed without regarding the case | 121 | \param ignoreCase Searching is performed without regarding the case |
122 | \param ignorePaths Files are searched for without checking for the directories | 122 | \param ignorePaths Files are searched for without checking for the directories |
123 | \return Pointer to newly created archive, or 0 upon error. */ | 123 | \return Pointer to newly created archive, or 0 upon error. */ |
124 | virtual IFileArchive* createArchive(io::IReadFile* file, bool ignoreCase, bool ignorePaths) const =0; | 124 | virtual IFileArchive* createArchive(io::IReadFile* file, bool ignoreCase, bool ignorePaths) const =0; |
125 | }; | 125 | }; |
126 | 126 | ||
127 | 127 | ||
128 | } // end namespace io | 128 | } // end namespace io |
129 | } // end namespace irr | 129 | } // end namespace irr |
130 | 130 | ||
131 | #endif | 131 | #endif |
132 | 132 | ||