1# commonlibrary/c_utils<a name="EN-US_TOPIC_0000001148676553"></a> 2 3## Introduction<a name="section11660541593"></a> 4 5The **commonlibrary/c_utils** repository provides the following commonly used C++ utility classes for standard system: 6 7- Enhanced APIs for operations related to files, paths, and strings 8- APIs related to the read-write lock, semaphore, timer, thread, and thread pool 9- APIs related to the security data container and data serialization 10- Error codes for each subsystem 11 12## Directory Structure<a name="section17271017133915"></a> 13 14``` 15commonlibrary/c_utils 16├─ base 17│ ├── include # Header files of APIs open to other subsystems 18│ ├── src # Source files 19│ └── test # Test code 20├─ Docs 21 ├── en # Documents in English 22 └── zh-cn # Documents in Chinese 23``` 24## Condition 25Suitable for standard system. 26 27## Build 28### Build Component 29``` 30./build.sh --product-name rk3568 --build-target c_utils 31``` 32 33### Build Shared Library 34``` 35./build.sh --product-name rk3568 --build-target commonlibrary/c_utils/base:utils 36``` 37 38### Build Static Library 39``` 40./build.sh --product-name rk3568 --build-target commonlibrary/c_utils/base:utilsbase 41``` 42 43### How to Add Dependency of c_utils 441. Open the corresponding BUILD.gn file of the related module. 452. Add dependency to the corresponding block as follows: 46```gn 47 48ohos_shared_library("xxxxx") { 49 ... 50 51 external_deps = [ 52 ... 53 # Dependency of shared library(Optional) 54 "c_utils:utils", 55 # Dependency of static library(Optional) 56 "c_utils:utilsbase", 57 ] 58 59 ... 60} 61``` 62## Coding Directions 63 64### [Timer](https://gitee.com/openharmony/commonlibrary_c_utils/blob/master/docs/en/c_utils_timer.md) 65### [Thread Pool](https://gitee.com/openharmony/commonlibrary_c_utils/blob/master/docs/en/c_utils_thread_pool.md) 66 67## Changelog 68**2023/01/31** 691. Add docs directory,provide development guidelines for main functionalities in c_utils. 702. Add comments in header files. 713. Modify README in which the guidelines can be accessed by links in section "Coding Directions". 72 73**2022/10/10** 741. Move this repository from utils/native to commonlibrary/c_utils. 752. Switch component name from utils_base to c_utils. 763. Securec is not in this repository any more. Please use [third_party_bounds_checking_function](https://gitee.com/openharmony/third_party_bounds_checking_function). 77## Repositories Involved<a name="section1249817110914"></a> 78 79**[commonlibrary\_c\_utils](https://gitee.com/openharmony/commonlibrary_c_utils)** 80 81[commonlibrary\_utils\_lite](https://gitee.com/openharmony/commonlibrary_utils_lite) 82 83