Flutter Engine
directory_asset_bundle.h
Go to the documentation of this file.
1 // Copyright 2013 The Flutter Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4 
5 #ifndef FLUTTER_ASSETS_DIRECTORY_ASSET_BUNDLE_H_
6 #define FLUTTER_ASSETS_DIRECTORY_ASSET_BUNDLE_H_
7 
8 #include "flutter/assets/asset_resolver.h"
9 #include "flutter/fml/macros.h"
10 #include "flutter/fml/memory/ref_counted.h"
11 #include "flutter/fml/unique_fd.h"
12 
13 namespace flutter {
14 
16  public:
18  bool is_valid_after_asset_manager_change);
19 
20  ~DirectoryAssetBundle() override;
21 
22  private:
23  const fml::UniqueFD descriptor_;
24  bool is_valid_ = false;
25  bool is_valid_after_asset_manager_change_ = false;
26 
27  // |AssetResolver|
28  bool IsValid() const override;
29 
30  // |AssetResolver|
31  bool IsValidAfterAssetManagerChange() const override;
32 
33  // |AssetResolver|
34  std::unique_ptr<fml::Mapping> GetAsMapping(
35  const std::string& asset_name) const override;
36 
37  FML_DISALLOW_COPY_AND_ASSIGN(DirectoryAssetBundle);
38 };
39 
40 } // namespace flutter
41 
42 #endif // FLUTTER_ASSETS_DIRECTORY_ASSET_BUNDLE_H_
DirectoryAssetBundle(fml::UniqueFD descriptor, bool is_valid_after_asset_manager_change)