# ExcelCfgForCpp **Repository Path**: yiliangwu880/ExcelCfgForCpp ## Basic Information - **Project Name**: ExcelCfgForCpp - **Description**: ExcelCfgForCpp - **Primary Language**: Unknown - **License**: Not specified - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2022-09-09 - **Last Updated**: 2023-03-21 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README 功能: 把excel配置文件 转换为 bin文件,并生成cpp源码读取文件。支持linux ,windows # 特点 纯c/c++实现。 合适熟识这类语言得开发者修改使用。 生成cpp代码用 模板代码替换得方式生成,针对不同项目,主要修改模板代码就可以了。不需要修改工具 实现逻辑代码量少,容易修改。 ================= # 编译方法 ## xlnt xlnt 用cmake编译,详情参考里面文档。 win概要步骤: vs 打开cmake 编译 linux概要步骤: 目录 ExcelCfgForCpp\Tool\xlnt mkdir build cd build cmake .. make -j8 ## Tool win概要步骤: vs 打开cmake 编译 cmake 编译,生成执行文件。 目录 ExcelCfgForCpp\Tool\xlnt\out\build\x64-Debug\source\ 有动态库 xlntd.dll 文件,复制到 \ExcelCfgForCpp\Tool\bin 项目执行文件目录才能运行。 Tool linux概要步骤: 目录 ExcelCfgForCpp\Tool\src mkdir build cd build cmake .. make -j8 ## Demo cmake 编译,生成执行文件。 # 目录 Tool --转换工具项目 Demo --游戏项目读取配置演示 Excel --excel文件配置 ## use follow: tool.exe + toolCfg.txt. 生成 cpp bin文件 你的项目使用生成的cpp,bin文件,读取配置 # excel 配置格式 第一行:字段名 , 符合C语言命名规则。 如果需要数组。命名后加数字,1开始。例如:两列 item1,item2 表示数组item[2]; 第二行:字段描述,随意填写 第三行:字段数据类型,可选后面这些: "int", "uint", "int64", "uint64", "double", "float", "string" 第四行:标识是否忽略不导出. 具体内容看配置 toolCfg.txt IGNORE_CLIENT_FIELD_STRING sheet首列字段名为 id才会导出.