diff options
author | David Walter Seikel | 2013-01-13 18:54:10 +1000 |
---|---|---|
committer | David Walter Seikel | 2013-01-13 18:54:10 +1000 |
commit | 959831f4ef5a3e797f576c3de08cd65032c997ad (patch) | |
tree | e7351908be5995f0b325b2ebeaa02d5a34b82583 /libraries/irrlicht-1.8/include/IFileSystem.h | |
parent | Add info about changes to Irrlicht. (diff) | |
download | SledjHamr-959831f4ef5a3e797f576c3de08cd65032c997ad.zip SledjHamr-959831f4ef5a3e797f576c3de08cd65032c997ad.tar.gz SledjHamr-959831f4ef5a3e797f576c3de08cd65032c997ad.tar.bz2 SledjHamr-959831f4ef5a3e797f576c3de08cd65032c997ad.tar.xz |
Remove damned ancient DOS line endings from Irrlicht. Hopefully I did not go overboard.
Diffstat (limited to '')
-rw-r--r-- | libraries/irrlicht-1.8/include/IFileSystem.h | 770 |
1 files changed, 385 insertions, 385 deletions
diff --git a/libraries/irrlicht-1.8/include/IFileSystem.h b/libraries/irrlicht-1.8/include/IFileSystem.h index f158363..0c5244d 100644 --- a/libraries/irrlicht-1.8/include/IFileSystem.h +++ b/libraries/irrlicht-1.8/include/IFileSystem.h | |||
@@ -1,385 +1,385 @@ | |||
1 | // Copyright (C) 2002-2012 Nikolaus Gebhardt | 1 | // Copyright (C) 2002-2012 Nikolaus Gebhardt |
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_SYSTEM_H_INCLUDED__ | 5 | #ifndef __I_FILE_SYSTEM_H_INCLUDED__ |
6 | #define __I_FILE_SYSTEM_H_INCLUDED__ | 6 | #define __I_FILE_SYSTEM_H_INCLUDED__ |
7 | 7 | ||
8 | #include "IReferenceCounted.h" | 8 | #include "IReferenceCounted.h" |
9 | #include "IXMLReader.h" | 9 | #include "IXMLReader.h" |
10 | #include "IFileArchive.h" | 10 | #include "IFileArchive.h" |
11 | 11 | ||
12 | namespace irr | 12 | namespace irr |
13 | { | 13 | { |
14 | namespace video | 14 | namespace video |
15 | { | 15 | { |
16 | class IVideoDriver; | 16 | class IVideoDriver; |
17 | } // end namespace video | 17 | } // end namespace video |
18 | namespace io | 18 | namespace io |
19 | { | 19 | { |
20 | 20 | ||
21 | class IReadFile; | 21 | class IReadFile; |
22 | class IWriteFile; | 22 | class IWriteFile; |
23 | class IFileList; | 23 | class IFileList; |
24 | class IXMLWriter; | 24 | class IXMLWriter; |
25 | class IAttributes; | 25 | class IAttributes; |
26 | 26 | ||
27 | 27 | ||
28 | //! The FileSystem manages files and archives and provides access to them. | 28 | //! The FileSystem manages files and archives and provides access to them. |
29 | /** It manages where files are, so that modules which use the the IO do not | 29 | /** It manages where files are, so that modules which use the the IO do not |
30 | need to know where every file is located. A file could be in a .zip-Archive or | 30 | need to know where every file is located. A file could be in a .zip-Archive or |
31 | as file on disk, using the IFileSystem makes no difference to this. */ | 31 | as file on disk, using the IFileSystem makes no difference to this. */ |
32 | class IFileSystem : public virtual IReferenceCounted | 32 | class IFileSystem : public virtual IReferenceCounted |
33 | { | 33 | { |
34 | public: | 34 | public: |
35 | 35 | ||
36 | //! Opens a file for read access. | 36 | //! Opens a file for read access. |
37 | /** \param filename: Name of file to open. | 37 | /** \param filename: Name of file to open. |
38 | \return Pointer to the created file interface. | 38 | \return Pointer to the created file interface. |
39 | The returned pointer should be dropped when no longer needed. | 39 | The returned pointer should be dropped when no longer needed. |
40 | See IReferenceCounted::drop() for more information. */ | 40 | See IReferenceCounted::drop() for more information. */ |
41 | virtual IReadFile* createAndOpenFile(const path& filename) =0; | 41 | virtual IReadFile* createAndOpenFile(const path& filename) =0; |
42 | 42 | ||
43 | //! Creates an IReadFile interface for accessing memory like a file. | 43 | //! Creates an IReadFile interface for accessing memory like a file. |
44 | /** This allows you to use a pointer to memory where an IReadFile is requested. | 44 | /** This allows you to use a pointer to memory where an IReadFile is requested. |
45 | \param memory: A pointer to the start of the file in memory | 45 | \param memory: A pointer to the start of the file in memory |
46 | \param len: The length of the memory in bytes | 46 | \param len: The length of the memory in bytes |
47 | \param fileName: The name given to this file | 47 | \param fileName: The name given to this file |
48 | \param deleteMemoryWhenDropped: True if the memory should be deleted | 48 | \param deleteMemoryWhenDropped: True if the memory should be deleted |
49 | along with the IReadFile when it is dropped. | 49 | along with the IReadFile when it is dropped. |
50 | \return Pointer to the created file interface. | 50 | \return Pointer to the created file interface. |
51 | The returned pointer should be dropped when no longer needed. | 51 | The returned pointer should be dropped when no longer needed. |
52 | See IReferenceCounted::drop() for more information. | 52 | See IReferenceCounted::drop() for more information. |
53 | */ | 53 | */ |
54 | virtual IReadFile* createMemoryReadFile(void* memory, s32 len, const path& fileName, bool deleteMemoryWhenDropped=false) =0; | 54 | virtual IReadFile* createMemoryReadFile(void* memory, s32 len, const path& fileName, bool deleteMemoryWhenDropped=false) =0; |
55 | 55 | ||
56 | //! Creates an IReadFile interface for accessing files inside files. | 56 | //! Creates an IReadFile interface for accessing files inside files. |
57 | /** This is useful e.g. for archives. | 57 | /** This is useful e.g. for archives. |
58 | \param fileName: The name given to this file | 58 | \param fileName: The name given to this file |
59 | \param alreadyOpenedFile: Pointer to the enclosing file | 59 | \param alreadyOpenedFile: Pointer to the enclosing file |
60 | \param pos: Start of the file inside alreadyOpenedFile | 60 | \param pos: Start of the file inside alreadyOpenedFile |
61 | \param areaSize: The length of the file | 61 | \param areaSize: The length of the file |
62 | \return A pointer to the created file interface. | 62 | \return A pointer to the created file interface. |
63 | The returned pointer should be dropped when no longer needed. | 63 | The returned pointer should be dropped when no longer needed. |
64 | See IReferenceCounted::drop() for more information. | 64 | See IReferenceCounted::drop() for more information. |
65 | */ | 65 | */ |
66 | virtual IReadFile* createLimitReadFile(const path& fileName, | 66 | virtual IReadFile* createLimitReadFile(const path& fileName, |
67 | IReadFile* alreadyOpenedFile, long pos, long areaSize) =0; | 67 | IReadFile* alreadyOpenedFile, long pos, long areaSize) =0; |
68 | 68 | ||
69 | //! Creates an IWriteFile interface for accessing memory like a file. | 69 | //! Creates an IWriteFile interface for accessing memory like a file. |
70 | /** This allows you to use a pointer to memory where an IWriteFile is requested. | 70 | /** This allows you to use a pointer to memory where an IWriteFile is requested. |
71 | You are responsible for allocating enough memory. | 71 | You are responsible for allocating enough memory. |
72 | \param memory: A pointer to the start of the file in memory (allocated by you) | 72 | \param memory: A pointer to the start of the file in memory (allocated by you) |
73 | \param len: The length of the memory in bytes | 73 | \param len: The length of the memory in bytes |
74 | \param fileName: The name given to this file | 74 | \param fileName: The name given to this file |
75 | \param deleteMemoryWhenDropped: True if the memory should be deleted | 75 | \param deleteMemoryWhenDropped: True if the memory should be deleted |
76 | along with the IWriteFile when it is dropped. | 76 | along with the IWriteFile when it is dropped. |
77 | \return Pointer to the created file interface. | 77 | \return Pointer to the created file interface. |
78 | The returned pointer should be dropped when no longer needed. | 78 | The returned pointer should be dropped when no longer needed. |
79 | See IReferenceCounted::drop() for more information. | 79 | See IReferenceCounted::drop() for more information. |
80 | */ | 80 | */ |
81 | virtual IWriteFile* createMemoryWriteFile(void* memory, s32 len, const path& fileName, bool deleteMemoryWhenDropped=false) =0; | 81 | virtual IWriteFile* createMemoryWriteFile(void* memory, s32 len, const path& fileName, bool deleteMemoryWhenDropped=false) =0; |
82 | 82 | ||
83 | 83 | ||
84 | //! Opens a file for write access. | 84 | //! Opens a file for write access. |
85 | /** \param filename: Name of file to open. | 85 | /** \param filename: Name of file to open. |
86 | \param append: If the file already exist, all write operations are | 86 | \param append: If the file already exist, all write operations are |
87 | appended to the file. | 87 | appended to the file. |
88 | \return Pointer to the created file interface. 0 is returned, if the | 88 | \return Pointer to the created file interface. 0 is returned, if the |
89 | file could not created or opened for writing. | 89 | file could not created or opened for writing. |
90 | The returned pointer should be dropped when no longer needed. | 90 | The returned pointer should be dropped when no longer needed. |
91 | See IReferenceCounted::drop() for more information. */ | 91 | See IReferenceCounted::drop() for more information. */ |
92 | virtual IWriteFile* createAndWriteFile(const path& filename, bool append=false) =0; | 92 | virtual IWriteFile* createAndWriteFile(const path& filename, bool append=false) =0; |
93 | 93 | ||
94 | //! Adds an archive to the file system. | 94 | //! Adds an archive to the file system. |
95 | /** After calling this, the Irrlicht Engine will also search and open | 95 | /** After calling this, the Irrlicht Engine will also search and open |
96 | files directly from this archive. This is useful for hiding data from | 96 | files directly from this archive. This is useful for hiding data from |
97 | the end user, speeding up file access and making it possible to access | 97 | the end user, speeding up file access and making it possible to access |
98 | for example Quake3 .pk3 files, which are just renamed .zip files. By | 98 | for example Quake3 .pk3 files, which are just renamed .zip files. By |
99 | default Irrlicht supports ZIP, PAK, TAR, PNK, and directories as | 99 | default Irrlicht supports ZIP, PAK, TAR, PNK, and directories as |
100 | archives. You can provide your own archive types by implementing | 100 | archives. You can provide your own archive types by implementing |
101 | IArchiveLoader and passing an instance to addArchiveLoader. | 101 | IArchiveLoader and passing an instance to addArchiveLoader. |
102 | Irrlicht supports AES-encrypted zip files, and the advanced compression | 102 | Irrlicht supports AES-encrypted zip files, and the advanced compression |
103 | techniques lzma and bzip2. | 103 | techniques lzma and bzip2. |
104 | \param filename: Filename of the archive to add to the file system. | 104 | \param filename: Filename of the archive to add to the file system. |
105 | \param ignoreCase: If set to true, files in the archive can be accessed without | 105 | \param ignoreCase: If set to true, files in the archive can be accessed without |
106 | writing all letters in the right case. | 106 | writing all letters in the right case. |
107 | \param ignorePaths: If set to true, files in the added archive can be accessed | 107 | \param ignorePaths: If set to true, files in the added archive can be accessed |
108 | without its complete path. | 108 | without its complete path. |
109 | \param archiveType: If no specific E_FILE_ARCHIVE_TYPE is selected then | 109 | \param archiveType: If no specific E_FILE_ARCHIVE_TYPE is selected then |
110 | the type of archive will depend on the extension of the file name. If | 110 | the type of archive will depend on the extension of the file name. If |
111 | you use a different extension then you can use this parameter to force | 111 | you use a different extension then you can use this parameter to force |
112 | a specific type of archive. | 112 | a specific type of archive. |
113 | \param password An optional password, which is used in case of encrypted archives. | 113 | \param password An optional password, which is used in case of encrypted archives. |
114 | \param retArchive A pointer that will be set to the archive that is added. | 114 | \param retArchive A pointer that will be set to the archive that is added. |
115 | \return True if the archive was added successfully, false if not. */ | 115 | \return True if the archive was added successfully, false if not. */ |
116 | virtual bool addFileArchive(const path& filename, bool ignoreCase=true, | 116 | virtual bool addFileArchive(const path& filename, bool ignoreCase=true, |
117 | bool ignorePaths=true, | 117 | bool ignorePaths=true, |
118 | E_FILE_ARCHIVE_TYPE archiveType=EFAT_UNKNOWN, | 118 | E_FILE_ARCHIVE_TYPE archiveType=EFAT_UNKNOWN, |
119 | const core::stringc& password="", | 119 | const core::stringc& password="", |
120 | IFileArchive** retArchive=0) =0; | 120 | IFileArchive** retArchive=0) =0; |
121 | 121 | ||
122 | //! Adds an archive to the file system. | 122 | //! Adds an archive to the file system. |
123 | /** After calling this, the Irrlicht Engine will also search and open | 123 | /** After calling this, the Irrlicht Engine will also search and open |
124 | files directly from this archive. This is useful for hiding data from | 124 | files directly from this archive. This is useful for hiding data from |
125 | the end user, speeding up file access and making it possible to access | 125 | the end user, speeding up file access and making it possible to access |
126 | for example Quake3 .pk3 files, which are just renamed .zip files. By | 126 | for example Quake3 .pk3 files, which are just renamed .zip files. By |
127 | default Irrlicht supports ZIP, PAK, TAR, PNK, and directories as | 127 | default Irrlicht supports ZIP, PAK, TAR, PNK, and directories as |
128 | archives. You can provide your own archive types by implementing | 128 | archives. You can provide your own archive types by implementing |
129 | IArchiveLoader and passing an instance to addArchiveLoader. | 129 | IArchiveLoader and passing an instance to addArchiveLoader. |
130 | Irrlicht supports AES-encrypted zip files, and the advanced compression | 130 | Irrlicht supports AES-encrypted zip files, and the advanced compression |
131 | techniques lzma and bzip2. | 131 | techniques lzma and bzip2. |
132 | If you want to add a directory as an archive, prefix its name with a | 132 | If you want to add a directory as an archive, prefix its name with a |
133 | slash in order to let Irrlicht recognize it as a folder mount (mypath/). | 133 | slash in order to let Irrlicht recognize it as a folder mount (mypath/). |
134 | Using this technique one can build up a search order, because archives | 134 | Using this technique one can build up a search order, because archives |
135 | are read first, and can be used more easily with relative filenames. | 135 | are read first, and can be used more easily with relative filenames. |
136 | \param file: Archive to add to the file system. | 136 | \param file: Archive to add to the file system. |
137 | \param ignoreCase: If set to true, files in the archive can be accessed without | 137 | \param ignoreCase: If set to true, files in the archive can be accessed without |
138 | writing all letters in the right case. | 138 | writing all letters in the right case. |
139 | \param ignorePaths: If set to true, files in the added archive can be accessed | 139 | \param ignorePaths: If set to true, files in the added archive can be accessed |
140 | without its complete path. | 140 | without its complete path. |
141 | \param archiveType: If no specific E_FILE_ARCHIVE_TYPE is selected then | 141 | \param archiveType: If no specific E_FILE_ARCHIVE_TYPE is selected then |
142 | the type of archive will depend on the extension of the file name. If | 142 | the type of archive will depend on the extension of the file name. If |
143 | you use a different extension then you can use this parameter to force | 143 | you use a different extension then you can use this parameter to force |
144 | a specific type of archive. | 144 | a specific type of archive. |
145 | \param password An optional password, which is used in case of encrypted archives. | 145 | \param password An optional password, which is used in case of encrypted archives. |
146 | \param retArchive A pointer that will be set to the archive that is added. | 146 | \param retArchive A pointer that will be set to the archive that is added. |
147 | \return True if the archive was added successfully, false if not. */ | 147 | \return True if the archive was added successfully, false if not. */ |
148 | virtual bool addFileArchive(IReadFile* file, bool ignoreCase=true, | 148 | virtual bool addFileArchive(IReadFile* file, bool ignoreCase=true, |
149 | bool ignorePaths=true, | 149 | bool ignorePaths=true, |
150 | E_FILE_ARCHIVE_TYPE archiveType=EFAT_UNKNOWN, | 150 | E_FILE_ARCHIVE_TYPE archiveType=EFAT_UNKNOWN, |
151 | const core::stringc& password="", | 151 | const core::stringc& password="", |
152 | IFileArchive** retArchive=0) =0; | 152 | IFileArchive** retArchive=0) =0; |
153 | 153 | ||
154 | //! Adds an archive to the file system. | 154 | //! Adds an archive to the file system. |
155 | /** \param archive: The archive to add to the file system. | 155 | /** \param archive: The archive to add to the file system. |
156 | \return True if the archive was added successfully, false if not. */ | 156 | \return True if the archive was added successfully, false if not. */ |
157 | virtual bool addFileArchive(IFileArchive* archive) =0; | 157 | virtual bool addFileArchive(IFileArchive* archive) =0; |
158 | 158 | ||
159 | //! Get the number of archives currently attached to the file system | 159 | //! Get the number of archives currently attached to the file system |
160 | virtual u32 getFileArchiveCount() const =0; | 160 | virtual u32 getFileArchiveCount() const =0; |
161 | 161 | ||
162 | //! Removes an archive from the file system. | 162 | //! Removes an archive from the file system. |
163 | /** This will close the archive and free any file handles, but will not | 163 | /** This will close the archive and free any file handles, but will not |
164 | close resources which have already been loaded and are now cached, for | 164 | close resources which have already been loaded and are now cached, for |
165 | example textures and meshes. | 165 | example textures and meshes. |
166 | \param index: The index of the archive to remove | 166 | \param index: The index of the archive to remove |
167 | \return True on success, false on failure */ | 167 | \return True on success, false on failure */ |
168 | virtual bool removeFileArchive(u32 index) =0; | 168 | virtual bool removeFileArchive(u32 index) =0; |
169 | 169 | ||
170 | //! Removes an archive from the file system. | 170 | //! Removes an archive from the file system. |
171 | /** This will close the archive and free any file handles, but will not | 171 | /** This will close the archive and free any file handles, but will not |
172 | close resources which have already been loaded and are now cached, for | 172 | close resources which have already been loaded and are now cached, for |
173 | example textures and meshes. Note that a relative filename might be | 173 | example textures and meshes. Note that a relative filename might be |
174 | interpreted differently on each call, depending on the current working | 174 | interpreted differently on each call, depending on the current working |
175 | directory. In case you want to remove an archive that was added using | 175 | directory. In case you want to remove an archive that was added using |
176 | a relative path name, you have to change to the same working directory | 176 | a relative path name, you have to change to the same working directory |
177 | again. This means, that the filename given on creation is not an | 177 | again. This means, that the filename given on creation is not an |
178 | identifier for the archive, but just a usual filename that is used for | 178 | identifier for the archive, but just a usual filename that is used for |
179 | locating the archive to work with. | 179 | locating the archive to work with. |
180 | \param filename The archive pointed to by the name will be removed | 180 | \param filename The archive pointed to by the name will be removed |
181 | \return True on success, false on failure */ | 181 | \return True on success, false on failure */ |
182 | virtual bool removeFileArchive(const path& filename) =0; | 182 | virtual bool removeFileArchive(const path& filename) =0; |
183 | 183 | ||
184 | //! Removes an archive from the file system. | 184 | //! Removes an archive from the file system. |
185 | /** This will close the archive and free any file handles, but will not | 185 | /** This will close the archive and free any file handles, but will not |
186 | close resources which have already been loaded and are now cached, for | 186 | close resources which have already been loaded and are now cached, for |
187 | example textures and meshes. | 187 | example textures and meshes. |
188 | \param archive The archive to remove. | 188 | \param archive The archive to remove. |
189 | \return True on success, false on failure */ | 189 | \return True on success, false on failure */ |
190 | virtual bool removeFileArchive(const IFileArchive* archive) =0; | 190 | virtual bool removeFileArchive(const IFileArchive* archive) =0; |
191 | 191 | ||
192 | //! Changes the search order of attached archives. | 192 | //! Changes the search order of attached archives. |
193 | /** | 193 | /** |
194 | \param sourceIndex: The index of the archive to change | 194 | \param sourceIndex: The index of the archive to change |
195 | \param relative: The relative change in position, archives with a lower index are searched first */ | 195 | \param relative: The relative change in position, archives with a lower index are searched first */ |
196 | virtual bool moveFileArchive(u32 sourceIndex, s32 relative) =0; | 196 | virtual bool moveFileArchive(u32 sourceIndex, s32 relative) =0; |
197 | 197 | ||
198 | //! Get the archive at a given index. | 198 | //! Get the archive at a given index. |
199 | virtual IFileArchive* getFileArchive(u32 index) =0; | 199 | virtual IFileArchive* getFileArchive(u32 index) =0; |
200 | 200 | ||
201 | //! Adds an external archive loader to the engine. | 201 | //! Adds an external archive loader to the engine. |
202 | /** Use this function to add support for new archive types to the | 202 | /** Use this function to add support for new archive types to the |
203 | engine, for example proprietary or encrypted file storage. */ | 203 | engine, for example proprietary or encrypted file storage. */ |
204 | virtual void addArchiveLoader(IArchiveLoader* loader) =0; | 204 | virtual void addArchiveLoader(IArchiveLoader* loader) =0; |
205 | 205 | ||
206 | //! Gets the number of archive loaders currently added | 206 | //! Gets the number of archive loaders currently added |
207 | virtual u32 getArchiveLoaderCount() const = 0; | 207 | virtual u32 getArchiveLoaderCount() const = 0; |
208 | 208 | ||
209 | //! Retrieve the given archive loader | 209 | //! Retrieve the given archive loader |
210 | /** \param index The index of the loader to retrieve. This parameter is an 0-based | 210 | /** \param index The index of the loader to retrieve. This parameter is an 0-based |
211 | array index. | 211 | array index. |
212 | \return A pointer to the specified loader, 0 if the index is incorrect. */ | 212 | \return A pointer to the specified loader, 0 if the index is incorrect. */ |
213 | virtual IArchiveLoader* getArchiveLoader(u32 index) const = 0; | 213 | virtual IArchiveLoader* getArchiveLoader(u32 index) const = 0; |
214 | 214 | ||
215 | //! Adds a zip archive to the file system. | 215 | //! Adds a zip archive to the file system. |
216 | /** \deprecated This function is provided for compatibility | 216 | /** \deprecated This function is provided for compatibility |
217 | with older versions of Irrlicht and may be removed in Irrlicht 1.9, | 217 | with older versions of Irrlicht and may be removed in Irrlicht 1.9, |
218 | you should use addFileArchive instead. | 218 | you should use addFileArchive instead. |
219 | After calling this, the Irrlicht Engine will search and open files directly from this archive too. | 219 | After calling this, the Irrlicht Engine will search and open files directly from this archive too. |
220 | This is useful for hiding data from the end user, speeding up file access and making it possible to | 220 | This is useful for hiding data from the end user, speeding up file access and making it possible to |
221 | access for example Quake3 .pk3 files, which are no different than .zip files. | 221 | access for example Quake3 .pk3 files, which are no different than .zip files. |
222 | \param filename: Filename of the zip archive to add to the file system. | 222 | \param filename: Filename of the zip archive to add to the file system. |
223 | \param ignoreCase: If set to true, files in the archive can be accessed without | 223 | \param ignoreCase: If set to true, files in the archive can be accessed without |
224 | writing all letters in the right case. | 224 | writing all letters in the right case. |
225 | \param ignorePaths: If set to true, files in the added archive can be accessed | 225 | \param ignorePaths: If set to true, files in the added archive can be accessed |
226 | without its complete path. | 226 | without its complete path. |
227 | \return True if the archive was added successfully, false if not. */ | 227 | \return True if the archive was added successfully, false if not. */ |
228 | _IRR_DEPRECATED_ virtual bool addZipFileArchive(const c8* filename, bool ignoreCase=true, bool ignorePaths=true) | 228 | _IRR_DEPRECATED_ virtual bool addZipFileArchive(const c8* filename, bool ignoreCase=true, bool ignorePaths=true) |
229 | { | 229 | { |
230 | return addFileArchive(filename, ignoreCase, ignorePaths, EFAT_ZIP); | 230 | return addFileArchive(filename, ignoreCase, ignorePaths, EFAT_ZIP); |
231 | } | 231 | } |
232 | 232 | ||
233 | //! Adds an unzipped archive (or basedirectory with subdirectories..) to the file system. | 233 | //! Adds an unzipped archive (or basedirectory with subdirectories..) to the file system. |
234 | /** \deprecated This function is provided for compatibility | 234 | /** \deprecated This function is provided for compatibility |
235 | with older versions of Irrlicht and may be removed in Irrlicht 1.9, | 235 | with older versions of Irrlicht and may be removed in Irrlicht 1.9, |
236 | you should use addFileArchive instead. | 236 | you should use addFileArchive instead. |
237 | Useful for handling data which will be in a zip file | 237 | Useful for handling data which will be in a zip file |
238 | \param filename: Filename of the unzipped zip archive base directory to add to the file system. | 238 | \param filename: Filename of the unzipped zip archive base directory to add to the file system. |
239 | \param ignoreCase: If set to true, files in the archive can be accessed without | 239 | \param ignoreCase: If set to true, files in the archive can be accessed without |
240 | writing all letters in the right case. | 240 | writing all letters in the right case. |
241 | \param ignorePaths: If set to true, files in the added archive can be accessed | 241 | \param ignorePaths: If set to true, files in the added archive can be accessed |
242 | without its complete path. | 242 | without its complete path. |
243 | \return True if the archive was added successful, false if not. */ | 243 | \return True if the archive was added successful, false if not. */ |
244 | _IRR_DEPRECATED_ virtual bool addFolderFileArchive(const c8* filename, bool ignoreCase=true, bool ignorePaths=true) | 244 | _IRR_DEPRECATED_ virtual bool addFolderFileArchive(const c8* filename, bool ignoreCase=true, bool ignorePaths=true) |
245 | { | 245 | { |
246 | return addFileArchive(filename, ignoreCase, ignorePaths, EFAT_FOLDER); | 246 | return addFileArchive(filename, ignoreCase, ignorePaths, EFAT_FOLDER); |
247 | } | 247 | } |
248 | 248 | ||
249 | //! Adds a pak archive to the file system. | 249 | //! Adds a pak archive to the file system. |
250 | /** \deprecated This function is provided for compatibility | 250 | /** \deprecated This function is provided for compatibility |
251 | with older versions of Irrlicht and may be removed in Irrlicht 1.9, | 251 | with older versions of Irrlicht and may be removed in Irrlicht 1.9, |
252 | you should use addFileArchive instead. | 252 | you should use addFileArchive instead. |
253 | After calling this, the Irrlicht Engine will search and open files directly from this archive too. | 253 | After calling this, the Irrlicht Engine will search and open files directly from this archive too. |
254 | This is useful for hiding data from the end user, speeding up file access and making it possible to | 254 | This is useful for hiding data from the end user, speeding up file access and making it possible to |
255 | access for example Quake2/KingPin/Hexen2 .pak files | 255 | access for example Quake2/KingPin/Hexen2 .pak files |
256 | \param filename: Filename of the pak archive to add to the file system. | 256 | \param filename: Filename of the pak archive to add to the file system. |
257 | \param ignoreCase: If set to true, files in the archive can be accessed without | 257 | \param ignoreCase: If set to true, files in the archive can be accessed without |
258 | writing all letters in the right case. | 258 | writing all letters in the right case. |
259 | \param ignorePaths: If set to true, files in the added archive can be accessed | 259 | \param ignorePaths: If set to true, files in the added archive can be accessed |
260 | without its complete path.(should not use with Quake2 paks | 260 | without its complete path.(should not use with Quake2 paks |
261 | \return True if the archive was added successful, false if not. */ | 261 | \return True if the archive was added successful, false if not. */ |
262 | _IRR_DEPRECATED_ virtual bool addPakFileArchive(const c8* filename, bool ignoreCase=true, bool ignorePaths=true) | 262 | _IRR_DEPRECATED_ virtual bool addPakFileArchive(const c8* filename, bool ignoreCase=true, bool ignorePaths=true) |
263 | { | 263 | { |
264 | return addFileArchive(filename, ignoreCase, ignorePaths, EFAT_PAK); | 264 | return addFileArchive(filename, ignoreCase, ignorePaths, EFAT_PAK); |
265 | } | 265 | } |
266 | 266 | ||
267 | //! Get the current working directory. | 267 | //! Get the current working directory. |
268 | /** \return Current working directory as a string. */ | 268 | /** \return Current working directory as a string. */ |
269 | virtual const path& getWorkingDirectory() =0; | 269 | virtual const path& getWorkingDirectory() =0; |
270 | 270 | ||
271 | //! Changes the current working directory. | 271 | //! Changes the current working directory. |
272 | /** \param newDirectory: A string specifying the new working directory. | 272 | /** \param newDirectory: A string specifying the new working directory. |
273 | The string is operating system dependent. Under Windows it has | 273 | The string is operating system dependent. Under Windows it has |
274 | the form "<drive>:\<directory>\<sudirectory>\<..>". An example would be: "C:\Windows\" | 274 | the form "<drive>:\<directory>\<sudirectory>\<..>". An example would be: "C:\Windows\" |
275 | \return True if successful, otherwise false. */ | 275 | \return True if successful, otherwise false. */ |
276 | virtual bool changeWorkingDirectoryTo(const path& newDirectory) =0; | 276 | virtual bool changeWorkingDirectoryTo(const path& newDirectory) =0; |
277 | 277 | ||
278 | //! Converts a relative path to an absolute (unique) path, resolving symbolic links if required | 278 | //! Converts a relative path to an absolute (unique) path, resolving symbolic links if required |
279 | /** \param filename Possibly relative file or directory name to query. | 279 | /** \param filename Possibly relative file or directory name to query. |
280 | \result Absolute filename which points to the same file. */ | 280 | \result Absolute filename which points to the same file. */ |
281 | virtual path getAbsolutePath(const path& filename) const =0; | 281 | virtual path getAbsolutePath(const path& filename) const =0; |
282 | 282 | ||
283 | //! Get the directory a file is located in. | 283 | //! Get the directory a file is located in. |
284 | /** \param filename: The file to get the directory from. | 284 | /** \param filename: The file to get the directory from. |
285 | \return String containing the directory of the file. */ | 285 | \return String containing the directory of the file. */ |
286 | virtual path getFileDir(const path& filename) const =0; | 286 | virtual path getFileDir(const path& filename) const =0; |
287 | 287 | ||
288 | //! Get the base part of a filename, i.e. the name without the directory part. | 288 | //! Get the base part of a filename, i.e. the name without the directory part. |
289 | /** If no directory is prefixed, the full name is returned. | 289 | /** If no directory is prefixed, the full name is returned. |
290 | \param filename: The file to get the basename from | 290 | \param filename: The file to get the basename from |
291 | \param keepExtension True if filename with extension is returned otherwise everything | 291 | \param keepExtension True if filename with extension is returned otherwise everything |
292 | after the final '.' is removed as well. */ | 292 | after the final '.' is removed as well. */ |
293 | virtual path getFileBasename(const path& filename, bool keepExtension=true) const =0; | 293 | virtual path getFileBasename(const path& filename, bool keepExtension=true) const =0; |
294 | 294 | ||
295 | //! flatten a path and file name for example: "/you/me/../." becomes "/you" | 295 | //! flatten a path and file name for example: "/you/me/../." becomes "/you" |
296 | virtual path& flattenFilename(path& directory, const path& root="/") const =0; | 296 | virtual path& flattenFilename(path& directory, const path& root="/") const =0; |
297 | 297 | ||
298 | //! Get the relative filename, relative to the given directory | 298 | //! Get the relative filename, relative to the given directory |
299 | virtual path getRelativeFilename(const path& filename, const path& directory) const =0; | 299 | virtual path getRelativeFilename(const path& filename, const path& directory) const =0; |
300 | 300 | ||
301 | //! Creates a list of files and directories in the current working directory and returns it. | 301 | //! Creates a list of files and directories in the current working directory and returns it. |
302 | /** \return a Pointer to the created IFileList is returned. After the list has been used | 302 | /** \return a Pointer to the created IFileList is returned. After the list has been used |
303 | it has to be deleted using its IFileList::drop() method. | 303 | it has to be deleted using its IFileList::drop() method. |
304 | See IReferenceCounted::drop() for more information. */ | 304 | See IReferenceCounted::drop() for more information. */ |
305 | virtual IFileList* createFileList() =0; | 305 | virtual IFileList* createFileList() =0; |
306 | 306 | ||
307 | //! Creates an empty filelist | 307 | //! Creates an empty filelist |
308 | /** \return a Pointer to the created IFileList is returned. After the list has been used | 308 | /** \return a Pointer to the created IFileList is returned. After the list has been used |
309 | it has to be deleted using its IFileList::drop() method. | 309 | it has to be deleted using its IFileList::drop() method. |
310 | See IReferenceCounted::drop() for more information. */ | 310 | See IReferenceCounted::drop() for more information. */ |
311 | virtual IFileList* createEmptyFileList(const io::path& path, bool ignoreCase, bool ignorePaths) =0; | 311 | virtual IFileList* createEmptyFileList(const io::path& path, bool ignoreCase, bool ignorePaths) =0; |
312 | 312 | ||
313 | //! Set the active type of file system. | 313 | //! Set the active type of file system. |
314 | virtual EFileSystemType setFileListSystem(EFileSystemType listType) =0; | 314 | virtual EFileSystemType setFileListSystem(EFileSystemType listType) =0; |
315 | 315 | ||
316 | //! Determines if a file exists and could be opened. | 316 | //! Determines if a file exists and could be opened. |
317 | /** \param filename is the string identifying the file which should be tested for existence. | 317 | /** \param filename is the string identifying the file which should be tested for existence. |
318 | \return True if file exists, and false if it does not exist or an error occured. */ | 318 | \return True if file exists, and false if it does not exist or an error occured. */ |
319 | virtual bool existFile(const path& filename) const =0; | 319 | virtual bool existFile(const path& filename) const =0; |
320 | 320 | ||
321 | //! Creates a XML Reader from a file which returns all parsed strings as wide characters (wchar_t*). | 321 | //! Creates a XML Reader from a file which returns all parsed strings as wide characters (wchar_t*). |
322 | /** Use createXMLReaderUTF8() if you prefer char* instead of wchar_t*. See IIrrXMLReader for | 322 | /** Use createXMLReaderUTF8() if you prefer char* instead of wchar_t*. See IIrrXMLReader for |
323 | more information on how to use the parser. | 323 | more information on how to use the parser. |
324 | \return 0, if file could not be opened, otherwise a pointer to the created | 324 | \return 0, if file could not be opened, otherwise a pointer to the created |
325 | IXMLReader is returned. After use, the reader | 325 | IXMLReader is returned. After use, the reader |
326 | has to be deleted using its IXMLReader::drop() method. | 326 | has to be deleted using its IXMLReader::drop() method. |
327 | See IReferenceCounted::drop() for more information. */ | 327 | See IReferenceCounted::drop() for more information. */ |
328 | virtual IXMLReader* createXMLReader(const path& filename) =0; | 328 | virtual IXMLReader* createXMLReader(const path& filename) =0; |
329 | 329 | ||
330 | //! Creates a XML Reader from a file which returns all parsed strings as wide characters (wchar_t*). | 330 | //! Creates a XML Reader from a file which returns all parsed strings as wide characters (wchar_t*). |
331 | /** Use createXMLReaderUTF8() if you prefer char* instead of wchar_t*. See IIrrXMLReader for | 331 | /** Use createXMLReaderUTF8() if you prefer char* instead of wchar_t*. See IIrrXMLReader for |
332 | more information on how to use the parser. | 332 | more information on how to use the parser. |
333 | \return 0, if file could not be opened, otherwise a pointer to the created | 333 | \return 0, if file could not be opened, otherwise a pointer to the created |
334 | IXMLReader is returned. After use, the reader | 334 | IXMLReader is returned. After use, the reader |
335 | has to be deleted using its IXMLReader::drop() method. | 335 | has to be deleted using its IXMLReader::drop() method. |
336 | See IReferenceCounted::drop() for more information. */ | 336 | See IReferenceCounted::drop() for more information. */ |
337 | virtual IXMLReader* createXMLReader(IReadFile* file) =0; | 337 | virtual IXMLReader* createXMLReader(IReadFile* file) =0; |
338 | 338 | ||
339 | //! Creates a XML Reader from a file which returns all parsed strings as ASCII/UTF-8 characters (char*). | 339 | //! Creates a XML Reader from a file which returns all parsed strings as ASCII/UTF-8 characters (char*). |
340 | /** Use createXMLReader() if you prefer wchar_t* instead of char*. See IIrrXMLReader for | 340 | /** Use createXMLReader() if you prefer wchar_t* instead of char*. See IIrrXMLReader for |
341 | more information on how to use the parser. | 341 | more information on how to use the parser. |
342 | \return 0, if file could not be opened, otherwise a pointer to the created | 342 | \return 0, if file could not be opened, otherwise a pointer to the created |
343 | IXMLReader is returned. After use, the reader | 343 | IXMLReader is returned. After use, the reader |
344 | has to be deleted using its IXMLReaderUTF8::drop() method. | 344 | has to be deleted using its IXMLReaderUTF8::drop() method. |
345 | See IReferenceCounted::drop() for more information. */ | 345 | See IReferenceCounted::drop() for more information. */ |
346 | virtual IXMLReaderUTF8* createXMLReaderUTF8(const path& filename) =0; | 346 | virtual IXMLReaderUTF8* createXMLReaderUTF8(const path& filename) =0; |
347 | 347 | ||
348 | //! Creates a XML Reader from a file which returns all parsed strings as ASCII/UTF-8 characters (char*). | 348 | //! Creates a XML Reader from a file which returns all parsed strings as ASCII/UTF-8 characters (char*). |
349 | /** Use createXMLReader() if you prefer wchar_t* instead of char*. See IIrrXMLReader for | 349 | /** Use createXMLReader() if you prefer wchar_t* instead of char*. See IIrrXMLReader for |
350 | more information on how to use the parser. | 350 | more information on how to use the parser. |
351 | \return 0, if file could not be opened, otherwise a pointer to the created | 351 | \return 0, if file could not be opened, otherwise a pointer to the created |
352 | IXMLReader is returned. After use, the reader | 352 | IXMLReader is returned. After use, the reader |
353 | has to be deleted using its IXMLReaderUTF8::drop() method. | 353 | has to be deleted using its IXMLReaderUTF8::drop() method. |
354 | See IReferenceCounted::drop() for more information. */ | 354 | See IReferenceCounted::drop() for more information. */ |
355 | virtual IXMLReaderUTF8* createXMLReaderUTF8(IReadFile* file) =0; | 355 | virtual IXMLReaderUTF8* createXMLReaderUTF8(IReadFile* file) =0; |
356 | 356 | ||
357 | //! Creates a XML Writer from a file. | 357 | //! Creates a XML Writer from a file. |
358 | /** \return 0, if file could not be opened, otherwise a pointer to the created | 358 | /** \return 0, if file could not be opened, otherwise a pointer to the created |
359 | IXMLWriter is returned. After use, the reader | 359 | IXMLWriter is returned. After use, the reader |
360 | has to be deleted using its IXMLWriter::drop() method. | 360 | has to be deleted using its IXMLWriter::drop() method. |
361 | See IReferenceCounted::drop() for more information. */ | 361 | See IReferenceCounted::drop() for more information. */ |
362 | virtual IXMLWriter* createXMLWriter(const path& filename) =0; | 362 | virtual IXMLWriter* createXMLWriter(const path& filename) =0; |
363 | 363 | ||
364 | //! Creates a XML Writer from a file. | 364 | //! Creates a XML Writer from a file. |
365 | /** \return 0, if file could not be opened, otherwise a pointer to the created | 365 | /** \return 0, if file could not be opened, otherwise a pointer to the created |
366 | IXMLWriter is returned. After use, the reader | 366 | IXMLWriter is returned. After use, the reader |
367 | has to be deleted using its IXMLWriter::drop() method. | 367 | has to be deleted using its IXMLWriter::drop() method. |
368 | See IReferenceCounted::drop() for more information. */ | 368 | See IReferenceCounted::drop() for more information. */ |
369 | virtual IXMLWriter* createXMLWriter(IWriteFile* file) =0; | 369 | virtual IXMLWriter* createXMLWriter(IWriteFile* file) =0; |
370 | 370 | ||
371 | //! Creates a new empty collection of attributes, usable for serialization and more. | 371 | //! Creates a new empty collection of attributes, usable for serialization and more. |
372 | /** \param driver: Video driver to be used to load textures when specified as attribute values. | 372 | /** \param driver: Video driver to be used to load textures when specified as attribute values. |
373 | Can be null to prevent automatic texture loading by attributes. | 373 | Can be null to prevent automatic texture loading by attributes. |
374 | \return Pointer to the created object. | 374 | \return Pointer to the created object. |
375 | If you no longer need the object, you should call IAttributes::drop(). | 375 | If you no longer need the object, you should call IAttributes::drop(). |
376 | See IReferenceCounted::drop() for more information. */ | 376 | See IReferenceCounted::drop() for more information. */ |
377 | virtual IAttributes* createEmptyAttributes(video::IVideoDriver* driver=0) =0; | 377 | virtual IAttributes* createEmptyAttributes(video::IVideoDriver* driver=0) =0; |
378 | }; | 378 | }; |
379 | 379 | ||
380 | 380 | ||
381 | } // end namespace io | 381 | } // end namespace io |
382 | } // end namespace irr | 382 | } // end namespace irr |
383 | 383 | ||
384 | #endif | 384 | #endif |
385 | 385 | ||