diff --git a/README.md b/README.md index 915a9365dcde983881092f3f9ab6a0e03ceeb87f..531bb9551c0f0411773c5a8e8554e8946221c033 100644 --- a/README.md +++ b/README.md @@ -1,37 +1,30 @@ -# Config Policy +# Config Policy -- [Introduction](#section1881113251316) -- [Directory Structure](#section196561842161316) -- [Usage](#section1799421112165) -- [Constraints](#section1811111510182) -- [Repositories Involved](#section170262901818) +## Introduction -## Introduction +The config policy, namely, cust, provides APIs for each service module to obtain the configuration directories at different levels or the configuration file paths. -The customization framework, namely, cust, provides APIs for each service module to obtain the configuration directories at different levels or the configuration file paths. +## Directory Structure -## Directory Structure - -The directory structure for the customization framework is as follows: +The directory structure for the config policy is as follows: ``` /base/customization/ -├── config_policy # Code repository for the customization framework -│ ├── frameworks # Core code of the customization framework -│ │ ├── config_policy # Customization framework +├── config_policy # Code repository for the config policy +│ ├── frameworks # Core code of the config policy +│ │ ├── config_policy # config policy │ │ │ └── src # Implementation code -│ ├── interfaces # APIs of the customization framework -│ │ ├── innerkits # APIs of the customization framework for internal subsystems +│ ├── interfaces # APIs of the config policy +│ │ ├── innerkits # APIs of the config policy for internal subsystems │ │ └── kits # JavaScript APIs │ └── test # Test code ``` -## Usage +## Usage -Call the APIs of the customization framework to obtain the configuration directories at different levels or the configuration file paths. +Call the APIs of the config policy to obtain the configuration directories at different levels or the configuration file paths. ``` -#include #include "config_policy_utils.h" const char *testPathSuffix = "user.xml"; // Set the name of the configuration file. @@ -39,6 +32,11 @@ char buf[MAX_PATH_LEN]; char *filePath = GetOneCfgFile(testPathSuffix, CUST_TYPE_CONFIG, buf, MAX_PATH_LEN); // Obtain the path of the configuration file with the highest priority. ``` -## Constraints +## Constraints **Programming language**: C/C++ + +## Repositories Involved + +**customization\_config\_policy** + diff --git a/README_zh.md b/README_zh.md index 9b069b7dbf0325512c1eddd233a5e1ecf95ba39c..31f6fbe91eed59df40230a82a3ae19b1025742fa 100644 --- a/README_zh.md +++ b/README_zh.md @@ -1,37 +1,41 @@ -# 定制框架组件介绍 +# 配置策略组件介绍 -- [简介](#section1881113251316) -- [目录](#section196561842161316) -- [说明](#section1799421112165) -- [约束](#section1811111510182) -- [相关仓](#section170262901818) +## 简介 -## 简介 +配置策略组件为各业务模块提供获取各配置层级的配置目录或配置文件路径的接口。 -**定制框架组件**为各业务模块提供获取各配置层级的配置目录或配置文件路径的接口。 +## 系统架构 -## 目录 +**图 1** 配置策略组件架构图 -定制框架组件源代码目录结构如下所示: +![](figures/config_policy.png) + +配置策略组件架构图说明: + +- interfaces对外提供指定文件的最高优先级文件路径以及指定文件所有层级路径。 +- frameworks实现配置层级目录的初始化与文件路径查询。 + +## 目录 + +配置策略组件源代码目录结构如下所示: ``` /base/customization/ -├── config_policy # 定制框架代码仓 -│ ├── frameworks # 定制框架核心代码 -│ │ ├── config_policy # 定制框架模块 +├── config_policy # 配置策略代码仓 +│ ├── frameworks # 配置策略核心代码 +│ │ ├── config_policy # 配置策略模块 │ │ │ └── src # 实现代码 -│ ├── interfaces # 定制框架接口 -│ │ ├── innerkits # 定制框架子系统间接口 -│ │ └── kits # 定制框架JavaScript接口 +│ ├── interfaces # 配置策略接口 +│ │ ├── innerkits # 子系统间接口 +│ │ └── kits # 配置策略JavaScript接口 │ └── test # 测试代码 ``` -## 说明 +## 说明 调用该组件中的接口获取各配置层级的配置目录或配置文件路径。 ``` -#include #include "config_policy_utils.h" const char *testPathSuffix = "user.xml"; //设置配置文件名称 @@ -39,6 +43,11 @@ char buf[MAX_PATH_LEN]; char *filePath = GetOneCfgFile(testPathSuffix, CUST_TYPE_CONFIG, buf, MAX_PATH_LEN); //获取最高优先级的配置文件路径 ``` -## 约束 +## 约束 **语言限制**:C/C++语言 + +## 相关仓 + +**customization\_config\_policy** + diff --git a/figures/config_policy.png b/figures/config_policy.png new file mode 100644 index 0000000000000000000000000000000000000000..08c461fc4600d0aa9913b3d1c107c77460bfd59c Binary files /dev/null and b/figures/config_policy.png differ