]> git.lizzy.rs Git - irrlicht.git/blob - source/Irrlicht/Android/CAndroidAssetFileArchive.h
Reduce IrrCompileConfig usage to files that actually need it
[irrlicht.git] / source / Irrlicht / Android / CAndroidAssetFileArchive.h
1 // Copyright (C) 2012 Joerg Henrichs\r
2 // This file is part of the "Irrlicht Engine".\r
3 // For conditions of distribution and use, see copyright notice in irrlicht.h\r
4 \r
5 #ifndef __C_ANDROID_ASSET_FILE_ARCHIVE_H_INCLUDED__\r
6 #define __C_ANDROID_ASSET_FILE_ARCHIVE_H_INCLUDED__\r
7 \r
8 \r
9 \r
10 #ifdef  _IRR_COMPILE_ANDROID_ASSET_READER_\r
11 \r
12 \r
13 #include "IReadFile.h"\r
14 #include "IFileArchive.h"\r
15 #include "CFileList.h"\r
16 \r
17 #include <android/native_activity.h>\r
18 \r
19 namespace irr\r
20 {\r
21 namespace io\r
22 {\r
23 \r
24 /*!\r
25         Android asset file system written August 2012 by J.Henrichs (later reworked by others).\r
26 */\r
27         class CAndroidAssetFileArchive : public virtual IFileArchive,\r
28                                           virtual CFileList\r
29         {\r
30     public:\r
31 \r
32                 //! constructor\r
33                 CAndroidAssetFileArchive(AAssetManager *assetManager, bool ignoreCase, bool ignorePaths);\r
34 \r
35                 //! destructor\r
36                 virtual ~CAndroidAssetFileArchive();\r
37 \r
38                 //! opens a file by file name\r
39                 virtual IReadFile* createAndOpenFile(const io::path& filename);\r
40 \r
41                 //! opens a file by index\r
42                 virtual IReadFile* createAndOpenFile(u32 index);\r
43 \r
44                 //! returns the list of files\r
45                 virtual const IFileList* getFileList() const;\r
46 \r
47                 //! get the archive type\r
48                 virtual E_FILE_ARCHIVE_TYPE getType() const;\r
49 \r
50                 //! Add a directory to read files from. Since the Android \r
51                 //! API does not return names of directories, they need to\r
52                 //! be added manually.\r
53                 virtual void addDirectoryToFileList(const io::path &filename);\r
54 \r
55                 //! return the name (id) of the file Archive\r
56                 const io::path& getArchiveName() const override {return Path;}\r
57 \r
58         protected:\r
59                 //! Android's asset manager\r
60                 AAssetManager *AssetManager;\r
61 \r
62     };   // CAndroidAssetFileArchive\r
63 \r
64 } // end namespace io\r
65 } // end namespace irr\r
66 \r
67 #endif //   _IRR_COMPILE_ANDROID_ASSET_READER_\r
68 #endif //  __C_ANDROID_ASSET_READER_H_INCLUDED__\r
69 \r