Flutter Engine
The Flutter Engine
Public Member Functions | List of all members
flutter::DirectoryAssetBundle Class Reference

#include <directory_asset_bundle.h>

Inheritance diagram for flutter::DirectoryAssetBundle:
flutter::AssetResolver

Public Member Functions

 DirectoryAssetBundle (fml::UniqueFD descriptor, bool is_valid_after_asset_manager_change)
 
 ~DirectoryAssetBundle () override
 
- Public Member Functions inherited from flutter::AssetResolver
 AssetResolver ()=default
 
virtual ~AssetResolver ()=default
 
virtual const AssetManageras_asset_manager () const
 
virtual const APKAssetProvideras_apk_asset_provider () const
 
virtual const DirectoryAssetBundleas_directory_asset_bundle () const
 
virtual bool IsValid () const =0
 
virtual bool IsValidAfterAssetManagerChange () const =0
 Certain asset resolvers are still valid after the asset manager is replaced before a hot reload, or after a new run configuration is created during a hot restart. By preserving these resolvers and re-inserting them into the new resolver or run configuration, the tooling can avoid needing to sync all application assets through the Dart devFS upon connecting to the VM Service. Besides improving the startup performance of running a Flutter application, it also reduces the occurrence of tool failures due to repeated network flakes caused by damaged cables or hereto unknown bugs in the Dart HTTP server implementation. More...
 
virtual AssetResolverType GetType () const =0
 Gets the type of AssetResolver this is. Types are defined in AssetResolverType. More...
 
virtual std::unique_ptr< fml::MappingGetAsMapping (const std::string &asset_name) const =0
 
virtual std::vector< std::unique_ptr< fml::Mapping > > GetAsMappings (const std::string &asset_pattern, const std::optional< std::string > &subdir) const
 Same as GetAsMapping() but returns mappings for all files who's name matches a given pattern. Returns empty vector if no matching assets are found. More...
 
virtual bool operator== (const AssetResolver &other) const =0
 
bool operator!= (const AssetResolver &other) const
 

Additional Inherited Members

- Public Types inherited from flutter::AssetResolver
enum  AssetResolverType { kAssetManager , kApkAssetProvider , kDirectoryAssetBundle }
 Identifies the type of AssetResolver an instance is. More...
 

Detailed Description

Definition at line 16 of file directory_asset_bundle.h.

Constructor & Destructor Documentation

◆ DirectoryAssetBundle()

flutter::DirectoryAssetBundle::DirectoryAssetBundle ( fml::UniqueFD  descriptor,
bool  is_valid_after_asset_manager_change 
)

Definition at line 17 of file directory_asset_bundle.cc.

20 : descriptor_(std::move(descriptor)) {
21 if (!fml::IsDirectory(descriptor_)) {
22 return;
23 }
24 is_valid_after_asset_manager_change_ = is_valid_after_asset_manager_change;
25 is_valid_ = true;
26}
bool IsDirectory(const fml::UniqueFD &directory)
Definition: file_posix.cc:127

◆ ~DirectoryAssetBundle()

flutter::DirectoryAssetBundle::~DirectoryAssetBundle ( )
overridedefault

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