C++轻量级配置库
C++ lightweight configuration library
我正在寻找具有非限制性许可证的跨平台C++轻量级配置库。我需要比带有部分的标准属性文件更复杂的东西,但我不想使用 XML(写得太多:-((。
我想这样写配置:
render =
{
window =
{
width = 800,
height = 600
}
}
有 boost 的property_tree。该许可证允许商业用途。
您的示例:
ptree pt;
pt.put("render.window.width", 800);
pt.put("render.window.height", 600);
例如,这可以导出为 JSON
write_json("my_config.json", pt);
然后看起来像
{
"render":
{
"window":
{
"width": 800;
"height": 600;
}
}
}
与导出到 XML、INI 和 INFO 的方式相同。
您也可以尝试 JsonCpp 并用 Json
编写配置文件,它的语法与您喜欢的语法非常相似:
// Configuration options
{
// Default encoding for text
"encoding" : "UTF-8",
// Plug-ins loaded at start-up
"plug-ins" : [
"python",
"c++",
"ruby"
],
// Tab indent size
"indent" : { "length" : 3, "use_space": true }
}
在MIT License
下,所以非常宽容。
相关文章:
- 为不同配置设置MSVC_RUNTIME_LIBRARY的正确方法是什么
- 无法找到/读取配置文件.conf-FileIOException
- 在WSL:configure_file上对config_file的每次调用都失败:配置文件时出现问题
- 一种在C++中读取TXT配置文件的简单方法
- 生成MRPT库时cmake配置失败
- FFMPEG配置文件级别id大小无效
- 如何通过Conan和CMake找到用于pkg配置的.pc文件
- 配置文件解析器仅返回以前的值
- 我的程序有一个保存配置文件的GUI,如何双击此配置文件以直接加载带有配置数据的GUI?
- 更改命令行 qt5 源代码构建配置的正确/快速方法
- 是否可以配置提升日志刷新?
- 如何配置Visual Studio Code以使用cygwin,cmake和gcc进行调试
- C/C++:打印(配置)头文件的内容
- 配置:错误:找不到 MySQL 包含目录
- 安装 psutil 和为 pypy 配置期间出错
- 叮当格式化程序多行格式配置错误
- 使用 Eclipse CDT 进行 Cplex 配置
- 为c++配置Visual studio代码
- 如何定义自定义生成配置类型,其中通常是.exe的目标改为 DLL
- C++轻量级配置库