Irrlicht 3D Engine
IFileList.h
Go to the documentation of this file.
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 
11 namespace irr
12 {
13 namespace io
14 {
15 
17 
19 class IFileList : public virtual IReferenceCounted
20 {
21 public:
23 
24  virtual u32 getFileCount() const = 0;
25 
27 
31  virtual const io::path& getFileName(u32 index) const = 0;
32 
34 
37  virtual const io::path& getFullFileName(u32 index) const = 0;
38 
40 
43  virtual u32 getFileSize(u32 index) const = 0;
44 
46 
49  virtual u32 getFileOffset(u32 index) const = 0;
50 
52 
58  virtual u32 getID(u32 index) const = 0;
59 
61 
64  virtual bool isDirectory(u32 index) const = 0;
65 
67 
72  virtual s32 findFile(const io::path& filename, bool isFolder=false) const = 0;
73 
75  virtual const io::path& getPath() const = 0;
76 
78 
83  virtual u32 addItem(const io::path& fullPath, u32 offset, u32 size, bool isDirectory, u32 id=0) = 0;
84 
86  virtual void sort() = 0;
87 };
88 
89 } // end namespace irr
90 } // end namespace io
91 
92 
93 #endif
94 
virtual u32 getID(u32 index) const =0
Returns the ID of a file in the file list, based on an index.
Provides a list of files and folders.
Definition: IFileList.h:19
virtual u32 getFileOffset(u32 index) const =0
Returns the file offset of a file in the file list, based on an index.
virtual s32 findFile(const io::path &filename, bool isFolder=false) const =0
Searches for a file or folder in the list.
Everything in the Irrlicht Engine can be found in this namespace.
Definition: aabbox3d.h:12
signed int s32
32 bit signed variable.
Definition: irrTypes.h:70
virtual const io::path & getFullFileName(u32 index) const =0
Gets the full name of a file in the list including the path, based on an index.
unsigned int u32
32 bit unsigned variable.
Definition: irrTypes.h:62
virtual u32 addItem(const io::path &fullPath, u32 offset, u32 size, bool isDirectory, u32 id=0)=0
Add as a file or folder to the list.
virtual const io::path & getFileName(u32 index) const =0
Gets the name of a file in the list, based on an index.
virtual bool isDirectory(u32 index) const =0
Check if the file is a directory.
virtual u32 getFileSize(u32 index) const =0
Returns the size of a file in the file list, based on an index.
Base class of most objects of the Irrlicht Engine.
virtual void sort()=0
Sorts the file list. You should call this after adding any items to the file list.
virtual u32 getFileCount() const =0
Get the number of files in the filelist.
virtual const io::path & getPath() const =0
Returns the base path of the file list.