• 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 std::string FormatFullPath(const char *fileRelativePath);
40 
41 void PrintIdValues(const HapResource::IdValues *idValues);
42 
43 void PrintMapString(const std::map<std::string, std::string> &value);
44 
45 void PrintVectorString(const std::vector<std::string> &value);
46 
47 ResConfig *CreateResConfig(const char *language, const char *script, const char *region);
48 
49 Locale GetLocale(const char *language, const char *script, const char *region);
50 } // namespace Resource
51 } // namespace Global
52 } // namespace OHOS
53 #endif
54