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
5 #ifndef __C_ANDROID_ASSET_FILE_ARCHIVE_H_INCLUDED__
\r
6 #define __C_ANDROID_ASSET_FILE_ARCHIVE_H_INCLUDED__
\r
10 #ifdef _IRR_COMPILE_ANDROID_ASSET_READER_
\r
13 #include "IReadFile.h"
\r
14 #include "IFileArchive.h"
\r
15 #include "CFileList.h"
\r
17 #include <android/native_activity.h>
\r
25 Android asset file system written August 2012 by J.Henrichs (later reworked by others).
\r
27 class CAndroidAssetFileArchive : public virtual IFileArchive,
\r
33 CAndroidAssetFileArchive(AAssetManager *assetManager, bool ignoreCase, bool ignorePaths);
\r
36 virtual ~CAndroidAssetFileArchive();
\r
38 //! opens a file by file name
\r
39 virtual IReadFile* createAndOpenFile(const io::path& filename);
\r
41 //! opens a file by index
\r
42 virtual IReadFile* createAndOpenFile(u32 index);
\r
44 //! returns the list of files
\r
45 virtual const IFileList* getFileList() const;
\r
47 //! get the archive type
\r
48 virtual E_FILE_ARCHIVE_TYPE getType() const;
\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
55 //! return the name (id) of the file Archive
\r
56 const io::path& getArchiveName() const override {return Path;}
\r
59 //! Android's asset manager
\r
60 AAssetManager *AssetManager;
\r
62 }; // CAndroidAssetFileArchive
\r
64 } // end namespace io
\r
65 } // end namespace irr
\r
67 #endif // _IRR_COMPILE_ANDROID_ASSET_READER_
\r
68 #endif // __C_ANDROID_ASSET_READER_H_INCLUDED__
\r