• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (c) 2021-2022 Huawei Device Co., Ltd.
3  * Licensed under the Apache License, Version 2.0 (the "License");
4  * you may not use this file except in compliance with the License.
5  * You may obtain a copy of the License at
6  *
7  *     http://www.apache.org/licenses/LICENSE-2.0
8  *
9  * Unless required by applicable law or agreed to in writing, software
10  * distributed under the License is distributed on an "AS IS" BASIS,
11  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12  * See the License for the specific language governing permissions and
13  * limitations under the License.
14  */
15 
16 #ifndef RESOURCE_MANAGER_TEST_COMMON_H
17 #define RESOURCE_MANAGER_TEST_COMMON_H
18 
19 #include "hap_resource.h"
20 #include "hilog_wrapper.h"
21 
22 #include <map>
23 #include <string>
24 #include <vector>
25 
26 namespace OHOS {
27 namespace Global {
28 namespace Resource {
29 // this is relative path
30 static const char *g_resFilePath = "all/assets/entry/resources.index";
31 static const char *g_hapPath = "all.hap";
32 static const char *g_nonExistName = "non_existent_name";
33 static const char *g_overlayResFilePath = "overlay/assets/entry/resources.index";
34 static const float BASE_DPI = 160.0f;
35 static const int NON_EXIST_ID = 1111;
36 std::string FormatFullPath(const char *fileRelativePath);
37 
38 void PrintIdValues(const HapResource::IdValues *idValues);
39 
40 void PrintMapString(const std::map<std::string, std::string> &value);
41 
42 void PrintVectorString(const std::vector<std::string> &value);
43 
44 ResConfig *CreateResConfig(const char *language, const char *script, const char *region);
45 } // namespace Resource
46 } // namespace Global
47 } // namespace OHOS
48 #endif
49