aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/src/others/irrlicht-1.8.1/include/IFileList.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/others/irrlicht-1.8.1/include/IFileList.h')
-rw-r--r--src/others/irrlicht-1.8.1/include/IFileList.h94
1 files changed, 94 insertions, 0 deletions
diff --git a/src/others/irrlicht-1.8.1/include/IFileList.h b/src/others/irrlicht-1.8.1/include/IFileList.h
new file mode 100644
index 0000000..4c2f8ea
--- /dev/null
+++ b/src/others/irrlicht-1.8.1/include/IFileList.h
@@ -0,0 +1,94 @@
1// Copyright (C) 2002-2012 Nikolaus Gebhardt
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_LIST_H_INCLUDED__
6#define __I_FILE_LIST_H_INCLUDED__
7
8#include "IReferenceCounted.h"
9#include "path.h"
10
11namespace irr
12{
13namespace io
14{
15
16//! Provides a list of files and folders.
17/** File lists usually contain a list of all files in a given folder,
18but can also contain a complete directory structure. */
19class IFileList : public virtual IReferenceCounted
20{
21public:
22 //! Get the number of files in the filelist.
23 /** \return Amount of files and directories in the file list. */
24 virtual u32 getFileCount() const = 0;
25
26 //! Gets the name of a file in the list, based on an index.
27 /** The path is not included in this name. Use getFullFileName for this.
28 \param index is the zero based index of the file which name should
29 be returned. The index must be less than the amount getFileCount() returns.
30 \return File name of the file. Returns 0, if an error occured. */
31 virtual const io::path& getFileName(u32 index) const = 0;
32
33 //! Gets the full name of a file in the list including the path, based on an index.
34 /** \param index is the zero based index of the file which name should
35 be returned. The index must be less than the amount getFileCount() returns.
36 \return File name of the file. Returns 0 if an error occured. */
37 virtual const io::path& getFullFileName(u32 index) const = 0;
38
39 //! Returns the size of a file in the file list, based on an index.
40 /** \param index is the zero based index of the file which should be returned.
41 The index must be less than the amount getFileCount() returns.
42 \return The size of the file in bytes. */
43 virtual u32 getFileSize(u32 index) const = 0;
44
45 //! Returns the file offset of a file in the file list, based on an index.
46 /** \param index is the zero based index of the file which should be returned.
47 The index must be less than the amount getFileCount() returns.
48 \return The offset of the file in bytes. */
49 virtual u32 getFileOffset(u32 index) const = 0;
50
51 //! Returns the ID of a file in the file list, based on an index.
52 /** This optional ID can be used to link the file list entry to information held
53 elsewhere. For example this could be an index in an IFileArchive, linking the entry
54 to its data offset, uncompressed size and CRC.
55 \param index is the zero based index of the file which should be returned.
56 The index must be less than the amount getFileCount() returns.
57 \return The ID of the file. */
58 virtual u32 getID(u32 index) const = 0;
59
60 //! Check if the file is a directory
61 /** \param index The zero based index which will be checked. The index
62 must be less than the amount getFileCount() returns.
63 \return True if the file is a directory, else false. */
64 virtual bool isDirectory(u32 index) const = 0;
65
66 //! Searches for a file or folder in the list
67 /** Searches for a file by name
68 \param filename The name of the file to search for.
69 \param isFolder True if you are searching for a directory path, false if you are searching for a file
70 \return Returns the index of the file in the file list, or -1 if
71 no matching name name was found. */
72 virtual s32 findFile(const io::path& filename, bool isFolder=false) const = 0;
73
74 //! Returns the base path of the file list
75 virtual const io::path& getPath() const = 0;
76
77 //! Add as a file or folder to the list
78 /** \param fullPath The file name including path, from the root of the file list.
79 \param isDirectory True if this is a directory rather than a file.
80 \param offset The file offset inside an archive
81 \param size The size of the file in bytes.
82 \param id The ID of the file in the archive which owns it */
83 virtual u32 addItem(const io::path& fullPath, u32 offset, u32 size, bool isDirectory, u32 id=0) = 0;
84
85 //! Sorts the file list. You should call this after adding any items to the file list
86 virtual void sort() = 0;
87};
88
89} // end namespace irr
90} // end namespace io
91
92
93#endif
94