• 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 <unicode/localebuilder.h>
23 #include <unicode/locid.h>
24 #include <unicode/utypes.h>
25 #include <map>
26 #include <string>
27 #include <vector>
28 
29 namespace OHOS {
30 namespace Global {
31 namespace Resource {
32 // this is relative path
33 static const char *g_resFilePath = "all/assets/entry/resources.index";
34 static const char *g_hapPath = "all.hap";
35 static const char *g_nonExistName = "non_existent_name";
36 static const char *g_overlayResFilePath = "overlay/assets/entry/resources.index";
37 static const float BASE_DPI = 160.0f;
38 static const int NON_EXIST_ID = 1111;
39 static const char *HAP_PATH_FA = "all_fa.hap";
40 std::string FormatFullPath(const char *fileRelativePath);
41 
42 void PrintIdValues(const std::shared_ptr<HapResource::IdValues> &idValues);
43 
44 void PrintMapString(const std::map<std::string, std::string> &value);
45 
46 void PrintVectorString(const std::vector<std::string> &value);
47 
48 ResConfig *CreateResConfig(const char *language, const char *script, const char *region);
49 
50 Locale GetLocale(const char *language, const char *script, const char *region);
51 
52 std::shared_ptr<ResConfigImpl> InitDefaultResConfig();
53 } // namespace Resource
54 } // namespace Global
55 } // namespace OHOS
56 #endif
57