Name |
Date |
Size |
#Lines |
LOC |
||
---|---|---|---|---|---|---|
.. | - | - | ||||
frameworks/resmgr_lite/ | 12-May-2024 | - | 17,940 | 13,579 | ||
interfaces/inner_api/include/ | 12-May-2024 | - | 50 | 28 | ||
test/resource/data/ | 12-May-2024 | - | 1 | 1 | ||
LICENSE | D | 12-May-2024 | 9.9 KiB | 177 | 150 | |
OAT.xml | D | 12-May-2024 | 1.5 KiB | 30 | 16 | |
README.md | D | 12-May-2024 | 2.3 KiB | 59 | 41 | |
README_zh.md | D | 12-May-2024 | 2 KiB | 59 | 41 | |
bundle.json | D | 12-May-2024 | 1.6 KiB | 66 | 66 |
README.md
1# resmgr<a name="EN-US_TOPIC_0000001073289170"></a> 2 3- [Introduction](#section11660541593) 4- [Directory Structure](#section1844145112017) 5- [Usage](#section17235135618274) 6- [Constraints](#section568761318105) 7- [Repositories Involved](#section15583142420413) 8 9## Introduction<a name="section11660541593"></a> 10 11The resource management module, namely, resmgr, provides the function of loading multi-language GUI resources for applications, for example, displaying the application names or icons specific to a certain language. 12 13## Directory Structure<a name="section1844145112017"></a> 14 15The directory structure for the resource management module is as follows: 16 17``` 18/base/global/ 19├── resource_management_lite # Code repository for the resource management module 20│ ├── frameworks # Core code of the resource management module 21│ │ ├── resource_management_lite # Core code for resource parsing 22│ │ │ ├── include # Header files of the resource management module 23│ │ │ ├── src # Implementation code of the resource management module 24│ │ │ └── test # Test code 25│ ├── interfaces # APIs of the resource management module 26│ │ └── inner_api # APIs of the resource management module for internal subsystems 27``` 28 29## Usage<a name="section17235135618274"></a> 30 31Call the **GLOBAL\_GetValueById** API to obtain the resource information of the application. 32 33``` 34#include <stdint.h> 35#include <stdio.h> 36#include "global.h" 37 38uint32_t id = 0x16777216; 39char *values = NULL; 40int32_t re = GLOBAL_GetValueById(id, "/system/data/resources.index", &values); // Obtain the resource of a specified application and write the resource to values. 41std::cout << values << std::endl; 42if (values != NULL) { 43 free(values); 44} 45``` 46 47## Constraints<a name="section568761318105"></a> 48 49**Programming language**: C/C++ 50 51## Repositories Involved<a name="section15583142420413"></a> 52 53[Globalization subsystem](https://gitee.com/openharmony/docs/blob/master/en/readme/globalization.md) 54 55**global\_resmgr\_lite** 56 57[global\_i18n\_lite](https://gitee.com/openharmony/global_i18n_lite/blob/master/README.md) 58 59
README_zh.md
1# 资源管理组件介绍<a name="ZH-CN_TOPIC_0000001073289170"></a> 2 3- [简介](#section11660541593) 4- [目录](#section1844145112017) 5- [说明](#section17235135618274) 6- [约束](#section568761318105) 7- [相关仓](#section15583142420413) 8 9## 简介<a name="section11660541593"></a> 10 11资源管理组件为应用提供加载多语言界面资源的能力,如不同语言下提供不同的应用名称或图标等。 12 13## 目录<a name="section1844145112017"></a> 14 15资源管理组件源代码目录结构如下所示: 16 17``` 18/base/global/ 19├── resource_management_lite # 资源管理代码仓 20│ ├── frameworks # 资源管理核心代码 21│ │ ├── resource_management_lite # 资源解析核心代码 22│ │ │ ├── include # 资源管理头文件 23│ │ │ ├── src # 资源管理实现代码 24│ │ │ └── test # 资源管理测试代码 25│ ├── interfaces # 资源管理接口 26│ │ └── inner_api # 资源管理对子系统间接口 27``` 28 29## 说明<a name="section17235135618274"></a> 30 31调用GLOBAL\_GetValueById接口获取应用的资源信息 。 32 33``` 34#include <stdint.h> 35#include <stdio.h> 36#include "global.h" 37 38uint32_t id = 0x16777216; 39char *values = NULL; 40int32_t re = GLOBAL_GetValueById(id, "/system/data/resources.index", &values); // 调用指定应用下某一条资源,并写入values中 41std::cout << values << std::endl; 42if (values != NULL) { 43 free(values); 44} 45``` 46 47## 约束<a name="section568761318105"></a> 48 49**语言限制**:C/C++语言 50 51## 相关仓<a name="section15583142420413"></a> 52 53[全球化子系统](https://gitee.com/openharmony/docs/blob/master/zh-cn/readme/%E5%85%A8%E7%90%83%E5%8C%96%E5%AD%90%E7%B3%BB%E7%BB%9F.md) 54 55**global\_resmgr\_lite** 56 57[global\_i18n\_lite](https://gitee.com/openharmony/global_i18n_lite/blob/master/README_zh.md) 58 59