diff --git a/README.md b/README.md
index dbe03525c4a5b9dcfa30448025792a252f0234aa..ad02ca7bac3066343c8fe5e97ec241f219b0f585 100644
--- a/README.md
+++ b/README.md
@@ -1,4 +1,4 @@
-# utils/native
+# commonlibrary/c_utils
- [Introduction](#section11660541593)
@@ -7,7 +7,7 @@
## Introduction
-The **utils/native** repository provides the following commonly used C++ utility classes:
+The **commonlibrary/c_utils** repository provides the following commonly used C++ utility classes:
- Enhanced APIs for operations related to files, paths, and strings
- APIs related to the read-write lock, semaphore, timer, thread, and thread pool
@@ -18,7 +18,7 @@ The **utils/native** repository provides the following commonly used C++ utili
## Directory Structure
```
-utils/native
+commonlibrary/c_utils
└─ base
├── include # Header files of APIs open to other subsystems
├── src # Source files
diff --git a/README_zh.md b/README_zh.md
index dddd47ed95a2c4726d9d8ef377b8aa665d602a4b..18337e77af5b87b2277f05783d14148b50f617da 100644
--- a/README_zh.md
+++ b/README_zh.md
@@ -18,7 +18,7 @@ C++公共基础类库提供了一些常用的C++开发工具类,包括:
## 目录
```
-utils/native
+commonlibrary/c_utils
└─ base
├── include # 对各子系统开放的接口头文件
├── src # 源文件
diff --git a/base/BUILD.gn b/base/BUILD.gn
index 137fa802460a139a46ad6ef0f57f1cc58ebb8fc0..c38dfcf26f4cd557913e0466e6bdd0e2fc7c90b4 100644
--- a/base/BUILD.gn
+++ b/base/BUILD.gn
@@ -112,8 +112,8 @@ ohos_static_library("utilsbase") {
defines = [ "CONFIG_HILOG" ]
external_deps = [ "hilog_native:libhilog_base" ]
- subsystem_name = "utils"
- part_name = "utils_base"
+ subsystem_name = "commonlibrary"
+ part_name = "c_utils"
}
ohos_shared_library("utils") {
@@ -124,10 +124,11 @@ ohos_shared_library("utils") {
":private_securec_config",
]
public_configs = [ ":static_utils_config" ]
- subsystem_name = "utils"
defines = [ "CONFIG_HILOG" ]
external_deps = [ "hilog_native:libhilog_base" ]
- part_name = "utils_base"
+
+ subsystem_name = "commonlibrary"
+ part_name = "c_utils"
install_images = [
"system",
"updater",
@@ -135,21 +136,25 @@ ohos_shared_library("utils") {
}
ohos_static_library("utilsecurec") {
- visibility = [ "//foundation/arkui/ace_engine/*:*" ]
+ visibility = [
+ "//foundation/arkui/ace_engine/*:*",
+ "//utils/native/base:*",
+ ]
sources = securec_sources
configs = [
":utils_config",
":private_securec_config",
]
public_configs = [ ":static_utils_config" ]
- subsystem_name = "utils"
- part_name = "utils_base"
+ subsystem_name = "commonlibrary"
+ part_name = "c_utils"
}
ohos_shared_library("utilsecurec_shared") {
visibility = [
":*",
"//foundation/arkui/ace_engine/*:*",
+ "//utils/native/base:*",
]
sources = securec_sources
configs = [
@@ -157,7 +162,7 @@ ohos_shared_library("utilsecurec_shared") {
":private_securec_config",
]
public_configs = [ ":utils_config" ]
- part_name = "utils_base"
+ part_name = "c_utils"
install_images = [
"system",
"updater",
diff --git a/base/test/unittest/common/BUILD.gn b/base/test/unittest/common/BUILD.gn
index a44f8d13d499cff1a81fe643ccab8ba9efb457d7..0d7f4b4a183dae3873203b5f613f3d4b314234f9 100644
--- a/base/test/unittest/common/BUILD.gn
+++ b/base/test/unittest/common/BUILD.gn
@@ -34,8 +34,8 @@ ohos_unittest("UtilsStringTest") {
configs = [ ":module_private_config" ]
deps = [
+ "//commonlibrary/c_utils/base:utils",
"//third_party/googletest:gtest_main",
- "//utils/native/base:utils",
]
}
@@ -47,8 +47,8 @@ ohos_unittest("UtilsSecurecTest") {
configs = [ ":module_private_config" ]
deps = [
+ "//commonlibrary/c_utils/base:utils",
"//third_party/googletest:gtest_main",
- "//utils/native/base:utils",
]
}
@@ -60,8 +60,8 @@ ohos_unittest("UtilsDirectoryTest") {
configs = [ ":module_private_config" ]
deps = [
+ "//commonlibrary/c_utils/base:utils",
"//third_party/googletest:gtest_main",
- "//utils/native/base:utils",
]
}
@@ -73,8 +73,8 @@ ohos_unittest("UtilsDateTimeTest") {
configs = [ ":module_private_config" ]
deps = [
+ "//commonlibrary/c_utils/base:utils",
"//third_party/googletest:gtest_main",
- "//utils/native/base:utils",
]
}
@@ -86,8 +86,8 @@ ohos_unittest("UtilsParcelTest") {
configs = [ ":module_private_config" ]
deps = [
+ "//commonlibrary/c_utils/base:utils",
"//third_party/googletest:gtest_main",
- "//utils/native/base:utils",
]
}
@@ -99,8 +99,8 @@ ohos_unittest("UtilsAshmemTest") {
configs = [ ":module_private_config" ]
deps = [
+ "//commonlibrary/c_utils/base:utils",
"//third_party/googletest:gtest_main",
- "//utils/native/base:utils",
]
external_deps = [ "hilog_native:libhilog" ]
@@ -114,8 +114,8 @@ ohos_unittest("UtilsRefbaseTest") {
configs = [ ":module_private_config" ]
deps = [
+ "//commonlibrary/c_utils/base:utils",
"//third_party/googletest:gtest_main",
- "//utils/native/base:utils",
]
}
@@ -127,8 +127,8 @@ ohos_unittest("UtilsThreadTest") {
configs = [ ":module_private_config" ]
deps = [
+ "//commonlibrary/c_utils/base:utils",
"//third_party/googletest:gtest_main",
- "//utils/native/base:utils",
]
}
@@ -140,8 +140,8 @@ ohos_unittest("UtilsFileTest") {
configs = [ ":module_private_config" ]
deps = [
+ "//commonlibrary/c_utils/base:utils",
"//third_party/googletest:gtest_main",
- "//utils/native/base:utils",
]
}
@@ -153,8 +153,8 @@ ohos_unittest("UtilsObserverTest") {
configs = [ ":module_private_config" ]
deps = [
+ "//commonlibrary/c_utils/base:utils",
"//third_party/googletest:gtest_main",
- "//utils/native/base:utils",
]
}
@@ -166,8 +166,8 @@ ohos_unittest("UtilsSafeBlockQueueTest") {
configs = [ ":module_private_config" ]
deps = [
+ "//commonlibrary/c_utils/base:utils",
"//third_party/googletest:gtest_main",
- "//utils/native/base:utils",
]
}
@@ -183,8 +183,8 @@ ohos_unittest("UtilsSafeMapTest") {
remove_configs = [ "//build/config/compiler:no_exceptions" ]
deps = [
+ "//commonlibrary/c_utils/base:utils",
"//third_party/googletest:gtest_main",
- "//utils/native/base:utils",
]
}
@@ -196,8 +196,8 @@ ohos_unittest("UtilsSafeBlockQueueTrackingTest") {
configs = [ ":module_private_config" ]
deps = [
+ "//commonlibrary/c_utils/base:utils",
"//third_party/googletest:gtest_main",
- "//utils/native/base:utils",
]
}
@@ -209,8 +209,8 @@ ohos_unittest("UtilsSafeQueueTest") {
configs = [ ":module_private_config" ]
deps = [
+ "//commonlibrary/c_utils/base:utils",
"//third_party/googletest:gtest_main",
- "//utils/native/base:utils",
]
}
@@ -222,8 +222,8 @@ ohos_unittest("UtilsThreadPoolTest") {
configs = [ ":module_private_config" ]
deps = [
+ "//commonlibrary/c_utils/base:utils",
"//third_party/googletest:gtest_main",
- "//utils/native/base:utils",
]
}
@@ -235,8 +235,8 @@ ohos_unittest("UtilsSemaphoreTest") {
configs = [ ":module_private_config" ]
deps = [
+ "//commonlibrary/c_utils/base:utils",
"//third_party/googletest:gtest_main",
- "//utils/native/base:utils",
]
}
@@ -248,8 +248,8 @@ ohos_unittest("UtilsSingletonTest") {
configs = [ ":module_private_config" ]
deps = [
+ "//commonlibrary/c_utils/base:utils",
"//third_party/googletest:gtest_main",
- "//utils/native/base:utils",
]
}
@@ -261,8 +261,8 @@ ohos_unittest("UtilsSortedVectorTest") {
configs = [ ":module_private_config" ]
deps = [
+ "//commonlibrary/c_utils/base:utils",
"//third_party/googletest:gtest_main",
- "//utils/native/base:utils",
]
}
@@ -274,8 +274,8 @@ ohos_unittest("UtilsUniqueFdTest") {
configs = [ ":module_private_config" ]
deps = [
+ "//commonlibrary/c_utils/base:utils",
"//third_party/googletest:gtest_main",
- "//utils/native/base:utils",
]
}
@@ -287,8 +287,8 @@ ohos_unittest("UtilsTimerTest") {
configs = [ ":module_private_config" ]
deps = [
+ "//commonlibrary/c_utils/base:utils",
"//third_party/googletest:gtest_main",
- "//utils/native/base:utils",
]
}
diff --git a/bundle.json b/bundle.json
index e7b2f9cdb943e7acbdbc25fae92cdaa17b767325..25fd9b000bd28f4da2eb85446947c756f4cdd799 100644
--- a/bundle.json
+++ b/bundle.json
@@ -1,75 +1,106 @@
{
- "name": "@openharmony/utils_base",
- "version": "3.1.0",
- "description": "utils_base",
- "publishAs": "code-segment",
- "scripts": {
- "install": "DEST_PATH=${DEP_BUNDLE_BASE}/utils/native/base && mkdir -p $DEST_PATH && cp -r ./* $DEST_PATH"
+ "name": "@openharmony/c_utils",
+ "version": "3.1.0",
+ "description": "c_utils",
+ "publishAs": "code-segment",
+ "scripts": {
+ "install": "DEST_PATH=${DEP_BUNDLE_BASE}/commonlibrary/c_utils/base && mkdir -p $DEST_PATH && cp -r ./* $DEST_PATH"
+ },
+ "author": {},
+ "repository": "",
+ "license": "Apache License 2.0",
+ "component": {
+ "name": "c_utils",
+ "subsystem": "commonlibrary",
+ "adapted_system_type": [ "standard" ],
+ "deps": {
+ "components": [
+ "hilog_native"
+ ],
+ "third_party": []
},
- "author": {},
- "repository": "",
- "license": "Apache License 2.0",
- "component": {
- "name": "utils_base",
- "subsystem": "utils",
- "adapted_system_type": [ "standard" ],
- "deps": {
- "components": [
- "hilog_native"
- ],
- "third_party": []
- },
- "build": {
- "sub_component": [
- "//utils/native/base:utils"
- ],
- "inner_kits": [
- {
- "name": "//utils/native/base:utils",
- "header": {
- "header_files": [
- "include/ashmem.h",
- "include/common_errors.h",
- "include/common_timer_errors.h",
- "include/datetime_ex.h",
- "include/directory_ex.h",
- "include/errors.h",
- "include/file_ex.h",
- "include/flat_obj.h",
- "include/nocopyable.h",
- "include/observer.h",
- "include/parcel.h",
- "include/pubdef.h",
- "include/refbase.h",
- "include/rwlock.h",
- "include/safe_block_queue.h",
- "include/safe_map.h",
- "include/safe_queue.h",
- "include/securec_p.h",
- "include/securec.h",
- "include/securectype.h",
- "include/semaphore_ex.h",
- "include/singleton.h",
- "include/sorted_vector.h",
- "include/string_ex.h",
- "include/thread_ex.h",
- "include/thread_pool.h",
- "include/timer.h",
- "include/unique_fd.h",
- "src/event_demultiplexer.h",
- "src/event_handler.h",
- "src/event_reactor.h",
- "src/timer_event_handler.h",
- "src/unicode_ex.h",
- "src/utils_log.h"
- ],
- "header_base": "//utils/native/base/"
- }
+ "build": {
+ "sub_component": [
+ "//commonlibrary/c_utils/base:utils",
+ "//commonlibrary/c_utils/base:utilsbase"
+ ],
+ "inner_kits": [
+ {
+ "name": "//commonlibrary/c_utils/base:utils",
+ "header": {
+ "header_files": [
+ "ashmem.h",
+ "common_errors.h",
+ "common_timer_errors.h",
+ "datetime_ex.h",
+ "directory_ex.h",
+ "errors.h",
+ "file_ex.h",
+ "flat_obj.h",
+ "nocopyable.h",
+ "observer.h",
+ "parcel.h",
+ "pubdef.h",
+ "refbase.h",
+ "rwlock.h",
+ "safe_block_queue.h",
+ "safe_map.h",
+ "safe_queue.h",
+ "securec_p.h",
+ "securec.h",
+ "securectype.h",
+ "semaphore_ex.h",
+ "singleton.h",
+ "sorted_vector.h",
+ "string_ex.h",
+ "thread_ex.h",
+ "thread_pool.h",
+ "timer.h",
+ "unique_fd.h"
+ ],
+ "header_base": "//commonlibrary/c_utils/base/include"
}
- ],
- "test": [
- "//utils/native/base/test:unittest"
- ]
- }
+ },
+ {
+ "name": "//commonlibrary/c_utils/base:utilsbase",
+ "header": {
+ "header_files": [
+ "ashmem.h",
+ "common_errors.h",
+ "common_timer_errors.h",
+ "datetime_ex.h",
+ "directory_ex.h",
+ "errors.h",
+ "file_ex.h",
+ "flat_obj.h",
+ "nocopyable.h",
+ "observer.h",
+ "parcel.h",
+ "pubdef.h",
+ "refbase.h",
+ "rwlock.h",
+ "safe_block_queue.h",
+ "safe_map.h",
+ "safe_queue.h",
+ "securec_p.h",
+ "securec.h",
+ "securectype.h",
+ "semaphore_ex.h",
+ "singleton.h",
+ "sorted_vector.h",
+ "string_ex.h",
+ "thread_ex.h",
+ "thread_pool.h",
+ "timer.h",
+ "unique_fd.h"
+ ],
+ "header_base": "//commonlibrary/c_utils/base/include"
+ }
+ }
+ ],
+ "test": [
+ "//commonlibrary/c_utils/base/test:unittest"
+ ]
}
}
+}