Flutter Engine
The Flutter Engine
Public Member Functions | List of all members
flutter::APKAssetProviderImpl Class Reference
Inheritance diagram for flutter::APKAssetProviderImpl:
flutter::APKAssetProviderInternal

Public Member Functions

 APKAssetProviderImpl (JNIEnv *env, jobject jassetManager, std::string directory)
 
 ~APKAssetProviderImpl ()=default
 
std::unique_ptr< fml::MappingGetAsMapping (const std::string &asset_name) const override
 
virtual std::unique_ptr< fml::MappingGetAsMapping (const std::string &asset_name) const =0
 

Additional Inherited Members

- Protected Member Functions inherited from flutter::APKAssetProviderInternal
virtual ~APKAssetProviderInternal ()=default
 

Detailed Description

Definition at line 38 of file apk_asset_provider.cc.

Constructor & Destructor Documentation

◆ APKAssetProviderImpl()

flutter::APKAssetProviderImpl::APKAssetProviderImpl ( JNIEnv *  env,
jobject  jassetManager,
std::string  directory 
)
inlineexplicit

Definition at line 40 of file apk_asset_provider.cc.

43 : java_asset_manager_(env, jassetManager),
44 directory_(std::move(directory)) {
45 asset_manager_ = AAssetManager_fromJava(env, jassetManager);
46 }
Definition: __init__.py:1

◆ ~APKAssetProviderImpl()

flutter::APKAssetProviderImpl::~APKAssetProviderImpl ( )
default

Member Function Documentation

◆ GetAsMapping()

std::unique_ptr< fml::Mapping > flutter::APKAssetProviderImpl::GetAsMapping ( const std::string &  asset_name) const
inlineoverridevirtual

Implements flutter::APKAssetProviderInternal.

Definition at line 50 of file apk_asset_provider.cc.

51 {
52 std::stringstream ss;
53 ss << directory_.c_str() << "/" << asset_name;
54 AAsset* asset = AAssetManager_open(asset_manager_, ss.str().c_str(),
55 AASSET_MODE_BUFFER);
56 if (!asset) {
57 return nullptr;
58 }
59
60 return std::make_unique<APKAssetMapping>(asset);
61 };

The documentation for this class was generated from the following file: