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
9 #include "IrrCompileConfig.h"
\r
11 #ifdef _IRR_COMPILE_ANDROID_ASSET_READER_
\r
14 #include "IReadFile.h"
\r
15 #include "IFileArchive.h"
\r
16 #include "CFileList.h"
\r
18 #include <android/native_activity.h>
\r
26 Android asset file system written August 2012 by J.Henrichs (later reworked by others).
\r
28 class CAndroidAssetFileArchive : public virtual IFileArchive,
\r
34 CAndroidAssetFileArchive(AAssetManager *assetManager, bool ignoreCase, bool ignorePaths);
\r
37 virtual ~CAndroidAssetFileArchive();
\r
39 //! opens a file by file name
\r
40 virtual IReadFile* createAndOpenFile(const io::path& filename);
\r
42 //! opens a file by index
\r
43 virtual IReadFile* createAndOpenFile(u32 index);
\r
45 //! returns the list of files
\r
46 virtual const IFileList* getFileList() const;
\r
48 //! get the archive type
\r
49 virtual E_FILE_ARCHIVE_TYPE getType() const;
\r
51 //! Add a directory to read files from. Since the Android
\r
52 //! API does not return names of directories, they need to
\r
53 //! be added manually.
\r
54 virtual void addDirectoryToFileList(const io::path &filename);
\r
56 //! return the name (id) of the file Archive
\r
57 const io::path& getArchiveName() const override {return Path;}
\r
60 //! Android's asset manager
\r
61 AAssetManager *AssetManager;
\r
63 }; // CAndroidAssetFileArchive
\r
65 } // end namespace io
\r
66 } // end namespace irr
\r
68 #endif // _IRR_COMPILE_ANDROID_ASSET_READER_
\r
69 #endif // __C_ANDROID_ASSET_READER_H_INCLUDED__
\r