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_ASSET_RESOLVER_H_ 6 #define FLUTTER_ASSETS_ASSET_RESOLVER_H_ 7 8 #include <string> 9 #include <vector> 10 11 #include "flutter/fml/macros.h" 12 #include "flutter/fml/mapping.h" 13 14 namespace flutter { 15 16 class AssetResolver { 17 public: 18 AssetResolver() = default; 19 20 virtual ~AssetResolver() = default; 21 22 virtual bool IsValid() const = 0; 23 24 FML_WARN_UNUSED_RESULT 25 virtual std::unique_ptr<fml::Mapping> GetAsMapping( 26 const std::string& asset_name) const = 0; 27 28 private: 29 FML_DISALLOW_COPY_AND_ASSIGN(AssetResolver); 30 }; 31 32 } // namespace flutter 33 34 #endif // FLUTTER_ASSETS_ASSET_RESOLVER_H_ 35