From 9049dc4466d1932eb85a57f14cb297ceb33c803b Mon Sep 17 00:00:00 2001 From: huangyuchen Date: Tue, 17 Jan 2023 21:28:46 +0800 Subject: [PATCH] Modify repo c_utils-related documents in docs of commonlibrary Signed-off-by: huangyuchen Change-Id: I149931fdc67d7631d4a97a8b31b28ce70fbfcee4 --- en/device-dev/subsystems/subsys-utils-faqs.md | 20 -- .../subsystems/subsys-utils-guide.md | 237 ++--------------- .../subsystems/subsys-utils-overview.md | 10 - en/readme/commonlibrary.md | 20 +- .../subsystems/subsys-utils-faqs.md | 21 -- .../subsystems/subsys-utils-guide.md | 245 ++---------------- .../subsystems/subsys-utils-overview.md | 13 - ...61\345\237\272\347\241\200\345\272\223.md" | 25 +- 8 files changed, 76 insertions(+), 515 deletions(-) delete mode 100644 en/device-dev/subsystems/subsys-utils-faqs.md delete mode 100644 en/device-dev/subsystems/subsys-utils-overview.md delete mode 100755 zh-cn/device-dev/subsystems/subsys-utils-faqs.md delete mode 100755 zh-cn/device-dev/subsystems/subsys-utils-overview.md diff --git a/en/device-dev/subsystems/subsys-utils-faqs.md b/en/device-dev/subsystems/subsys-utils-faqs.md deleted file mode 100644 index e2ee180ba0..0000000000 --- a/en/device-dev/subsystems/subsys-utils-faqs.md +++ /dev/null @@ -1,20 +0,0 @@ -# Utils FAQ - -## 1. Failed to run the KV store on the LiteOS Cortex-A kernel \(Hi3516 or Hi3518\) due to incorrect path setting for the KV store - -**Symptom** - -When the LiteOS Cortex-A kernel \(Hi3516 or Hi3518 platform\) directly calls the API provided by the KV store, the compiled executable program fails to run. - -**Possible Causes** - -The compiled executable program is run directly without being converted to an application using **AbilityKit** APIs. In this case, the Bundle Manager Service \(BMS\) cannot correctly set the path for storing application data during application installation. As a result, the KV store fails to run. - -**Solution** - -Call the **UtilsSetEnv** function of the KV store to set the data storage path. - -``` -UtilsSetEnv("/storage/com.example.kv"); -``` - diff --git a/en/device-dev/subsystems/subsys-utils-guide.md b/en/device-dev/subsystems/subsys-utils-guide.md index 20d772757d..c1c046cb85 100644 --- a/en/device-dev/subsystems/subsys-utils-guide.md +++ b/en/device-dev/subsystems/subsys-utils-guide.md @@ -1,222 +1,39 @@ -# Utils Development - -## Available APIs - -**Table 1** APIs for file operations - -| Function | Description | -| ---------- | ------------- | -| int UtilsFileOpen(const char* path, int oflag, int mode) | Opens or creates a file. | -| int UtilsFileClose(int fd) | Closes a file with a specified file descriptor. | -| int UtilsFileRead(int fd, char *buf, unsigned int len) | Reads a specified length of data from a file with the specified file descriptor and writes the data into the buffer. | -| int UtilsFileWrite(int fd, const char *buf, unsigned int len) | Writes a specified length of data into a file with the specified file descriptor. | -| int UtilsFileDelete(const char *path) | Deletes a specified file. | -| int UtilsFileStat(const char *path, unsigned int *fileSize) | Obtains the file size. | -| int UtilsFileSeek(int fd, int offset, unsigned int whence) | Adjusts the read and write position offset in a file. | -| int UtilsFileCopy(const char* src, const char* dest) | Copies the source file to a target file. | -| int UtilsFileMove(const char* src, const char* dest) | Moves the source file into a target file. | - - -Sample code for file operations: - +# Commonlibrary Development Guidelines +## Overview +The **commonlibrary** subsystem stores basic OpenHarmony components which provides common enhanced APIs for development in C, C++ and JS that are commonly used by OpenHarmony service subsystems and upper-layer applications. Including repositories: ``` -// Open a file and write data. -char fileName[] = "testfile"; -static const char def[] = "utils_file_operation implement."; -int fd = UtilsFileOpen(fileName, O_RDWR_FS | O_CREAT_FS | O_TRUNC_FS, 0); -printf("file handle = %d\n", fd); -int ret = UtilsFileWrite(fd, def, strlen(def)); -printf("write ret = %d\n", ret); - -// Adjust the position offset in the file. -ret = UtilsFileSeek(fd, 5, SEEK_SET_FS); -printf("lseek ret = %d\n", ret); - -// Read data and close the file. -char buf[64] = {0}; -int readLen = UtilsFileRead(fd, buf, 64); -ret = UtilsFileClose(fd); -printf("read len = %d : buf = %s\n", readLen, buf); - -// Obtain the file size. -int fileLen = 0; -ret = UtilsFileStat(fileName, &fileLen); -printf("file size = %d\n", fileLen); - -// Delete the file. -ret = UtilsFileDelete(fileName); -printf("delete ret = %d\n", ret); -``` - -**Table 2** APIs for KV store operations - -| Function | Description | -| ----------- | ---------------- | -| int UtilsGetValue(const char* key, char* value, unsigned int len) | Obtains the value matching a specified key from the file system or cache. | -| int UtilsSetValue(const char* key, const char* value) | Adds or updates the value matching a specified key in the file system or cache. | -| int UtilsDeleteValue(const char* key) | Deletes the value matching a specified key from the file system or cache. | - - -Sample code for the KV store: - -``` -// Set the value matching the specified key. -char key[] = "rw.sys.version_100"; -char value[] = "Hello kv operation implement!"; -int ret = UtilsSetValue(key, value); -printf("UtilsSetValue set ret = %d\n", ret); - -// Obtain the value matching the specified key. -char temp[128] = {0}; -ret = UtilsGetValue(key, temp, 128); -printf("UtilsGetValue get ret = %d, temp = %s\n", ret, temp); - -// Delete the value matching the specified key. -ret = UtilsDeleteValue(key); -printf("UtilsDeleteValue delete ret = %d\n", ret); +/commonlibrary + ├── c_utils # Enhanced basic C/C++ library for developers + ├── ets_utils # Enhanced basic JS library for developers + └── utils_lite # Basic tools for liteOS, including C and JS. ``` + Features provided by every repositories are listed here: -## How to Develop - -### Developing a Native Application for the KV Store That Uses the LiteOS Cortex-A Kernel \(Hi3516 or Hi3518\) - -1. Develop the native application for the KV store using **AbilityKit** APIs. - - Write the user program by calling the APIs provided by the KV store and compile the **libLauncher.so** file. - - ``` - // Set the value matching the specified key. - char key[] = "rw.sys.version_100"; - char value[] = "Hello kv operation implement!"; - int ret = UtilsSetValue(key, value); - printf("UtilsSetValue set ret = %d\n", ret); - - // Obtain the value matching the specified key. - char temp[128] = {0}; - ret = UtilsGetValue(key, temp, 128); - printf("UtilsGetValue get ret = %d, temp = %s\n", ret, temp); - - // Delete the value matching the specified key. - ret = UtilsDeleteValue(key); - printf("UtilsDeleteValue delete ret = %d\n", ret); - ``` - - - Edit the **config.json** file as follows: - - ``` - { - "app": { - "bundleName": "com.example.launcher", - "vendor": "example, - "version": { - "code": 1, - "name": "1.0" - } - }, - "deviceConfig": { - "default": { - "reqSdk": { - "compatible": "zsdk 1.0.0", - "target": "zsdk 1.0.1" - }, - "keepAlive": false - }, - "smartCamera": { - "reqSdk": { - "compatible": "zsdk 1.0.0", - "target": "zsdk 1.0.1" - }, - "keepAlive": false - } - }, - "module": { - "package": "com.example.launcher", - "name": ".MyHarmonyAbilityPackage", - "deviceType": [ - "phone", "tv","tablet", "pc","car","smartWatch","sportsWatch","smartCamera" - ], - "distro": { - "deliveryWithInstall": true, - "moduleName": "Launcher", - "moduleType": "entry" - }, - "abilities": [{ - "name": "MainAbility", - "icon": "res/drawable/phone.png", - "label": "test app 1", - "launchType": "standard", - "type": "page" - }, - { - "name": "SecondAbility", - "icon": "res/drawable/phone.png", - "label": "test app 2", - "launchType": "standard", - "type": "page" - }, - { - "name": "ServiceAbility", - "icon": "res/drawable/phone.png", - "label": "test app 2", - "launchType": "standard", - "type": "service" - } - ] - } - } - ``` - - - Generate a HAP file. - - - Add resource files in the **res/drawable** directory based on the following directory structure. - - ![](figure/unnaming.png) - - - Compress the **libLauncher.so**, **config.json**, and resource files into a ZIP package and change the file name extension to **.hap**, for example, **Launcher.hap**. - -2. Connect the development board and send the command for installing the native KV store application to the board through the serial port. - - ``` - ./nfs/dev_tools/bin/bm install -p /nfs/Launcher.hap - ``` - -3. Send the command for running the native KV store application to the board through the serial port. - - ``` - ./nfs/dev_tools/bin/aa start -p com.example.launcher -n ServiceAbility - ``` - - -### Dumping System Attributes on the Platform That Uses the LiteOS Cortex-M Kernel - -1. Connect the development board and send the **AT+SYSPARA** command to the board through the serial port. - - ``` - AT+SYSPARA - ``` - - **Figure 1** Output of the system attribute dumping command for the LiteOS Cortex-M kernel - ![](figure/output-of-the-system-attribute-dumping-command-for-the-liteos-cortex-m-kernel.png "output-of-the-system-attribute-dumping-command-for-the-liteos-cortex-m-kernel") +**c_utils** +- Enhanced APIs for operations related to files, paths, and strings +- APIs related to the read-write lock, semaphore, timer, thread, and thread pool +- APIs related to the security data container and data serialization +- Error codes for each subsystem +- Safe functions in C -### Dumping System Attributes on the Platform That Uses the LiteOS Cortex-A Kernel +**ets_utils** -1. Connect the development board and run the **os\_dump --help** command in the **bin** directory to view the **os\_dump** help information. +- JSAPIs for operation of URI, URL and xml +- JSAPIs for character encoder and decoder +- JSAPIs for operation of process +- Multithreading ability in JS - ``` - ./bin/os_dump --help - ``` +**utils_lite** -2. Run the **os\_dump -l** command in the **bin** directory to view system modules that support attribute dumping. +- Hardware Abstraction Layer (HAL) APIs for performing operations on standard files +- APIs for internal functions, such as the timer - ``` - ./bin/os_dump -l - ``` +## Development Guidelines -3. Run the **os\_dump syspara** command in the **bin** directory to dump the current system attributes. +[Development Guidelines for c_utils](https://gitee.com/openharmony/commonlibrary_c_utils/blob/master/docs/en/c-utils-guide.md) - ``` - ./bin/os_dump syspara - ``` - **Figure 2** Output of the system attribute dumping command for the LiteOS Cortex-A kernel - ![](figure/output-of-the-system-attribute-dumping-command-for-the-liteos-cortex-a-kernel.png "output-of-the-system-attribute-dumping-command-for-the-liteos-cortex-a-kernel") +# Commonlibrary Subsystem FAQ +## c_utils FAQ +See [Development Guidelines for c_utils](https://gitee.com/openharmony/commonlibrary_c_utils/blob/master/docs/en/c-utils-guide.md), including FAQs for several scenarios. \ No newline at end of file diff --git a/en/device-dev/subsystems/subsys-utils-overview.md b/en/device-dev/subsystems/subsys-utils-overview.md deleted file mode 100644 index 1d3971d61a..0000000000 --- a/en/device-dev/subsystems/subsys-utils-overview.md +++ /dev/null @@ -1,10 +0,0 @@ -# Utils Overview - -The Utils library stores basic OpenHarmony components that are commonly used by OpenHarmony service subsystems and upper-layer applications. - -This library provides the following capabilities on different platforms: - -- LiteOS Cortex-M \(Hi3861 platform\): KV store, file operations, IoT peripheral control, and system attribute dumping - -- LiteOS Cortex-A \(Hi3516 or Hi3518 platform\): KV store, timer, JavaScript APIs for data and file storage, and system attribute dumping - diff --git a/en/readme/commonlibrary.md b/en/readme/commonlibrary.md index e2c21fe797..35a1e1121c 100644 --- a/en/readme/commonlibrary.md +++ b/en/readme/commonlibrary.md @@ -3,7 +3,14 @@ ## Introduction -The **commonlibrary** subsystem provides common enhanced APIs for development in C, C++ and JS. +The **commonlibrary** subsystem stores basic OpenHarmony components which provides common enhanced APIs for development in C, C++ and JS that are commonly used by OpenHarmony service subsystems and upper-layer applications. Including repositories: +``` +/commonlibrary + ├── c_utils # Enhanced basic C/C++ library for developers + ├── ets_utils # Enhanced basic JS library for developers + └── utils_lite # Basic tools for liteOS, including C and JS. +``` + Features provided by every repositories are listed here: **c_utils** @@ -24,15 +31,8 @@ The **commonlibrary** subsystem provides common enhanced APIs for development in - Hardware Abstraction Layer (HAL) APIs for performing operations on standard files - APIs for internal functions, such as the timer - -## Directory Structure - -``` -/commonlibrary - ├── c_utils # Enhanced basic C/C++ library for developers - ├── ets_utils # Enhanced basic JS library for developers - └── utils_lite # Basic tools for liteOS, including C and JS. -``` +## Related Documents +[Commonlibrary Development Guidelines](https://gitee.com/openharmony/docs/blob/master/en/device-dev/subsystems/subsys-utils-guide.md) ## Repositories Involved diff --git a/zh-cn/device-dev/subsystems/subsys-utils-faqs.md b/zh-cn/device-dev/subsystems/subsys-utils-faqs.md deleted file mode 100755 index fed199c4fb..0000000000 --- a/zh-cn/device-dev/subsystems/subsys-utils-faqs.md +++ /dev/null @@ -1,21 +0,0 @@ -# 公共基础库常见问题 - - -## LiteOS-A内核(Hi3516、Hi3518平台)KV存储路径设置错误,导致KV存储运行失败 - -**现象描述** - -LiteOS-A内核(Hi3516、Hi3518平台)直接调用KV存储提供的接口,各参数正常的情况下,编译可执行程序运行失败。 - -**可能原因** - -直接运行编译出的可执行文件,没有将程序基于AbilityKit转换成应用,不能由BMS在应用安装时正确设置应用数据存储路径,导致KV存储运行失败。 - -**解决办法** - -显示调用KV存储的UtilsSetEnv接口,设置数据存储路径。 - - -``` -UtilsSetEnv("/storage/com.example.kv"); -``` diff --git a/zh-cn/device-dev/subsystems/subsys-utils-guide.md b/zh-cn/device-dev/subsystems/subsys-utils-guide.md index 360e10817e..7cc3206f6f 100644 --- a/zh-cn/device-dev/subsystems/subsys-utils-guide.md +++ b/zh-cn/device-dev/subsystems/subsys-utils-guide.md @@ -1,229 +1,36 @@ -# 公共基础库开发指导 - - -## 接口说明 - - **表1** 文件操作接口说明 - -| 接口名 | 描述 | -| -------- | -------- | -| int UtilsFileOpen(const char\* path, int oflag, int mode) | 打开或创建文件 | -| int UtilsFileClose(int fd) | 关闭文件 | -| int UtilsFileRead(int fd, char \*buf, unsigned int len) | 读取特定长度的文件数据 | -| int UtilsFileWrite(int fd, const char \*buf, unsigned int len) | 向文件写入特定大小的数据 | -| int UtilsFileDelete(const char \*path) | 删除指定文件 | -| int UtilsFileStat(const char \*path, unsigned int \*fileSize) | 获取文件大小 | -| int UtilsFileSeek(int fd, int offset, unsigned int whence) | 重新定位文件读/写偏移量 | -| int UtilsFileCopy(const char\* src, const char\* dest) | 将源文件复制一份并存储到目标文件 | -| int UtilsFileMove(const char\* src, const char\* dest) | 将源文件移动到指定目标文件 | - -文件操作使用示例: - - -``` -// open && write -char fileName[] = "testfile"; -static const char def[] = "utils_file_operation implement."; -int fd = UtilsFileOpen(fileName, O_RDWR_FS | O_CREAT_FS | O_TRUNC_FS, 0); -printf("file handle = %d\n", fd); -int ret = UtilsFileWrite(fd, def, strlen(def)); -printf("write ret = %d\n", ret); - -// seek -ret = UtilsFileSeek(fd, 5, SEEK_SET_FS); -printf("lseek ret = %d\n", ret); - -// read && close -char buf[64] = {0}; -int readLen = UtilsFileRead(fd, buf, 64); -ret = UtilsFileClose(fd); -printf("read len = %d : buf = %s\n", readLen, buf); - -// stat -int fileLen = 0; -ret = UtilsFileStat(fileName, &fileLen); -printf("file size = %d\n", fileLen); - -// delete -ret = UtilsFileDelete(fileName); -printf("delete ret = %d\n", ret); +# 公共基础类库开发指导 +## 概述 +公共基础类库存放OpenHarmony通用的基础组件。这些基础组件包括一些常用的C、C++、JS开发增强API,可被OpenHarmony各业务子系统及上层应用所使用。公共基础类库子系统包含如下代码仓库: ``` - - **表2** KV存储接口说明 - -| 接口名 | 描述 | -| -------- | -------- | -| int UtilsGetValue(const char\* key, char\* value, unsigned int len) | 提供给上层应用根据key获取对应数据项 | -| int UtilsSetValue(const char\* key, const char\* value) | 提供给上层应用用于存储/更新key对应数据项 | -| int UtilsDeleteValue(const char\* key) | 提供给上层应用删除key对应数据项 | - -KV存储使用示例: - - -``` -// set -char key[] = "rw.sys.version_100"; -char value[] = "Hello kv operation implement!"; -int ret = UtilsSetValue(key, value); -printf("UtilsSetValue set ret = %d\n", ret); - -// get -char temp[128] = {0}; -ret = UtilsGetValue(key, temp, 128); -printf("UtilsGetValue get ret = %d, temp = %s\n", ret, temp); - -// delete -ret = UtilsDeleteValue(key); -printf("UtilsDeleteValue delete ret = %d\n", ret); +/commonlibrary + ├── c_utils # c/c++标准库之外方便开发者开发的基础工具库 + ├── ets_utils # js标准库之外的与语言强相关的基础库 + └── utils_lite # lite上使用的工具函数,涉及c和js语言 ``` +各仓库提供的功能列表如下: +**c_utils** +- 文件、路径、字符串相关操作的能力增强接口; +- 读写锁、信号量、定时器、线程增强及线程池等接口; +- 安全数据容器、数据序列化等接口; +- 各子系统的错误码相关定义; -## 开发步骤 - - -### LiteOS-A内核(Hi3516、Hi3518平台)KV存储的native应用开发: - - -1. 基于AbilityKit开发KV存储的native应用。 - - 基于KV存储提供的接口编写用户程序,并编译出so(libLauncher.so)文件。 - - ``` - // set - char key[] = "rw.sys.version_100"; - char value[] = "Hello kv operation implement!"; - int ret = UtilsSetValue(key, value); - printf("UtilsSetValue set ret = %d\n", ret); - - // get - char temp[128] = {0}; - ret = UtilsGetValue(key, temp, 128); - printf("UtilsGetValue get ret = %d, temp = %s\n", ret, temp); - - // delete - ret = UtilsDeleteValue(key); - printf("UtilsDeleteValue delete ret = %d\n", ret); - ``` - - 编写config.json文件,内容如下: - - ``` - { - "app": { - "bundleName": "com.example.launcher", - "vendor": "example", - "version": { - "code": 1, - "name": "1.0" - } - }, - "deviceConfig": { - "default": { - "reqSdk": { - "compatible": "zsdk 1.0.0", - "target": "zsdk 1.0.1" - }, - "keepAlive": false - }, - "smartCamera": { - "reqSdk": { - "compatible": "zsdk 1.0.0", - "target": "zsdk 1.0.1" - }, - "keepAlive": false - } - }, - "module": { - "package": "com.example.launcher", - "name": ".MyOpenHarmonyAbilityPackage", - "deviceType": [ - "phone", "tv","tablet", "pc","car","smartWatch","sportsWatch","smartCamera" - ], - "distro": { - "deliveryWithInstall": true, - "moduleName": "Launcher", - "moduleType": "entry" - }, - "abilities": [{ - "name": "MainAbility", - "icon": "res/drawable/phone.png", - "label": "test app 1", - "launchType": "standard", - "type": "page" - }, - { - "name": "SecondAbility", - "icon": "res/drawable/phone.png", - "label": "test app 2", - "launchType": "standard", - "type": "page" - }, - { - "name": "ServiceAbility", - "icon": "res/drawable/phone.png", - "label": "test app 2", - "launchType": "standard", - "type": "service" - } - ] - } - } - ``` - - - 生成hap包。 - - 按照如下目录结构存放文件,res/drawable下面放置资源文件: - - **图1** 资源文件路径图 - - ![zh-cn_image_0000001154153558](figures/zh-cn_image_0000001154153558.png) - - - 将上述文件打包生成zip包,修改后缀为.hap,例如Launcher.hap - -2. 连接单板,通过串口向单板发送安装KV存储native应用的命令。 - - ``` - ./nfs/dev_tools/bin/bm install -p /nfs/Launcher.hap - ``` - -3. 通过串口向单板发送运行KV存储native应用的命令。 - - ``` - ./nfs/dev_tools/bin/aa start -p com.example.launcher -n ServiceAbility - ``` - - -### Dump系统属性在LiteOS-M内核平台使用: - -1. 连接单板,通过串口向单板发送AT+SYSPARA命令。 - - ``` - AT+SYSPARA - ``` - - **图2** LiteOS-M平台dump系统属性输出 - - ![zh-cn_image_0000001115123966](figures/zh-cn_image_0000001115123966.png) - - -### Dump系统属性在LiteOS-A内核平台使用: +**ets_utils** -1. 连接单板,运行bin路径下的os_dump加参数--help,查看os_dump使用指导。 - - ``` - ./bin/os_dump --help - ``` +- JS中URI、URL、xml相关操作接口; +- JS中字符编解码接口; +- JS中进程相关操作接口; +- JS中多线程能力; -2. os_dump加参数-l,查看当前系统有哪些模块支持获取属性。 - - ``` - ./bin/os_dump -l - ``` +**utils_lite** -3. os_dump加参数syspara,查看当前系统属性。 - - ``` - ./bin/os_dump syspara - ``` +- 标准文件相关操作HAL接口; +- 其它一些内部功能,如定时器等。 - **图3** LiteOS-A平台dump系统属性输出 +## 各仓库开发指导 +[C++公共基础库(c_utils)开发指导](https://gitee.com/openharmony/commonlibrary_c_utils/blob/master/docs/zh-cn/c-utils-guide.md) - ![zh-cn_image_0000001197369959](figures/zh-cn_image_0000001197369959.png) +# 公共基础类库常见问题 +## c_utils常见问题 +具体各应用场景常见问题,参见[C++公共基础库(c_utils)开发指导](https://gitee.com/openharmony/commonlibrary_c_utils/blob/master/docs/zh-cn/c-utils-guide.md) \ No newline at end of file diff --git a/zh-cn/device-dev/subsystems/subsys-utils-overview.md b/zh-cn/device-dev/subsystems/subsys-utils-overview.md deleted file mode 100755 index 19b55ac301..0000000000 --- a/zh-cn/device-dev/subsystems/subsys-utils-overview.md +++ /dev/null @@ -1,13 +0,0 @@ -# 公共基础库概述 - - -公共基础库存放OpenHarmony通用的基础组件。这些基础组件可被OpenHarmony各业务子系统及上层应用所使用。 - - -公共基础库在不同平台上提供的能力: - - -LiteOS-M内核(Hi3861平台):KV存储、文件操作、IoT外设控制、Dump系统属性。 - - -LiteOS-A内核(Hi3516、Hi3518平台):KV存储、定时器、数据和文件存储的JS API、Dump系统属性。 diff --git "a/zh-cn/readme/\345\205\254\345\205\261\345\237\272\347\241\200\345\272\223.md" "b/zh-cn/readme/\345\205\254\345\205\261\345\237\272\347\241\200\345\272\223.md" index 1b2609b9e4..68eacc1191 100755 --- "a/zh-cn/readme/\345\205\254\345\205\261\345\237\272\347\241\200\345\272\223.md" +++ "b/zh-cn/readme/\345\205\254\345\205\261\345\237\272\347\241\200\345\272\223.md" @@ -1,12 +1,19 @@ # 公共基础库 -- [简介](#section11660541593) -- [目录](#section17271017133915) +- [概述](#section11660541593) +- [相关文档](#section17271017133915) - [相关仓](#section1249817110914) -## 简介 +## 概述 -公共基础类库提供了一些常用的C、C++、JS开发增强API。包括如下部分: +公共基础类库存放OpenHarmony通用的基础组件。这些基础组件包括一些常用的C、C++、JS开发增强API,可被OpenHarmony各业务子系统及上层应用所使用。公共基础类库子系统包含如下代码仓库: +``` +/commonlibrary + ├── c_utils # c/c++标准库之外方便开发者开发的基础工具库 + ├── ets_utils # js标准库之外的与语言强相关的基础库 + └── utils_lite # lite上使用的工具函数,涉及c和js语言 +``` +各仓库提供的功能列表如下: **c_utils** @@ -27,14 +34,8 @@ - 标准文件相关操作HAL接口; - 其它一些内部功能,如定时器等。 -## 目录 - -``` -/commonlibrary - ├── c_utils # c/c++标准库之外方便开发者开发的基础工具库 - ├── ets_utils # js标准库之外的与语言强相关的基础库 - └── utils_lite # lite上使用的工具函数,涉及c和js语言 -``` +## 相关文档 +[公共基础类库开发指导](https://gitee.com/openharmony/docs/blob/master/zh-cn/device-dev/subsystems/subsys-utils-guide.md) ## 相关仓 -- GitLab