/src/skia/tools/Resources.h
Line | Count | Source (jump to first uncovered line) |
1 | | /* |
2 | | * Copyright 2014 Google Inc. |
3 | | * |
4 | | * Use of this source code is governed by a BSD-style license that can be |
5 | | * found in the LICENSE file. |
6 | | */ |
7 | | |
8 | | #ifndef Resources_DEFINED |
9 | | #define Resources_DEFINED |
10 | | |
11 | | #include "include/core/SkData.h" // IWYU pragma: keep |
12 | | #include "include/core/SkRefCnt.h" |
13 | | #include "include/core/SkString.h" |
14 | | |
15 | | #include <memory> |
16 | | #include <string> |
17 | | |
18 | | class SkStreamAsset; |
19 | | |
20 | | SkString GetResourcePath(const char* resource = ""); |
21 | | |
22 | | void SetResourcePath(const char*); |
23 | | |
24 | | sk_sp<SkData> GetResourceAsData(const char* resource); |
25 | | |
26 | 0 | inline sk_sp<SkData> GetResourceAsData(const std::string& resource) { |
27 | 0 | return GetResourceAsData(resource.c_str()); |
28 | 0 | } |
29 | | |
30 | | std::unique_ptr<SkStreamAsset> GetResourceAsStream(const char* resource, |
31 | | bool useFileStream = false); |
32 | | |
33 | | #endif // Resources_DEFINED |