irrlicht/source/Irrlicht/Android/CAndroidAssetFileArchive.h
Desour f5c6d3e945 Reformat the code, using:
find -type f |  # list all regular files
  grep -E '\.(h|cpp|mm)$' |  # filter for source files
  grep -v '/mt_' |  # filter out generated files
  grep -v '/vendor/' | # and vendored GL
  grep -v '/test/image_loader_test.cpp' |  # and this file (has giant literals arrays)
  xargs -n 1 -P $(nproc) clang-format -i  # reformat everything

Co-authored-by: numzero <numzer0@yandex.ru>
2024-03-21 22:08:26 +01:00

59 lines
1.4 KiB
C++

// Copyright (C) 2012 Joerg Henrichs
// This file is part of the "Irrlicht Engine".
// For conditions of distribution and use, see copyright notice in irrlicht.h
#pragma once
#include "IReadFile.h"
#include "IFileArchive.h"
#include "CFileList.h"
#include <android/native_activity.h>
namespace irr
{
namespace io
{
/*!
Android asset file system written August 2012 by J.Henrichs (later reworked by others).
*/
class CAndroidAssetFileArchive : public virtual IFileArchive,
virtual CFileList
{
public:
//! constructor
CAndroidAssetFileArchive(AAssetManager *assetManager, bool ignoreCase, bool ignorePaths);
//! destructor
virtual ~CAndroidAssetFileArchive();
//! opens a file by file name
virtual IReadFile *createAndOpenFile(const io::path &filename);
//! opens a file by index
virtual IReadFile *createAndOpenFile(u32 index);
//! returns the list of files
virtual const IFileList *getFileList() const;
//! get the archive type
virtual E_FILE_ARCHIVE_TYPE getType() const;
//! Add a directory to read files from. Since the Android
//! API does not return names of directories, they need to
//! be added manually.
virtual void addDirectoryToFileList(const io::path &filename);
//! return the name (id) of the file Archive
const io::path &getArchiveName() const override { return Path; }
protected:
//! Android's asset manager
AAssetManager *AssetManager;
}; // CAndroidAssetFileArchive
} // end namespace io
} // end namespace irr