ini 解析库,config 解析库不完全列表

本文概览了多种C++配置文件解析库,包括ini解析库如iniparser、inicpp,以及通用配置库如Boost.PropertyTree、libconfig等,对比其特点并提供资源链接。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

1. ini 解析库

ini 解析库很多,有些只支持读取,如 inih, libiniloader

2. 其他 config 解析库

  • Boost.PropertyTree

    The Property Tree library provides a data structure that stores an arbitrarily deeply nested tree of values, indexed at each level by some key. Each node of the tree stores its own value, plus an ordered list of its subnodes and their keys. The tree allows easy access to any of its nodes by means of a path, which is a concatenation of multiple keys.

    In addition, the library provides parsers and generators for a number of data formats that can be represented by such a tree, including XML, INI, and JSON.

    https://www.boost.org/doc/libs/1_59_0/doc/html/property_tree.html

  • Boost.Program_options

    The program_options library allows program developers to obtain program options, that is (name, value) pairs from the user, via conventional methods such as command line and config file.

    https://www.boost.org/doc/libs/1_36_0/doc/html/program_options.html

  • libconfig

    一个用于读取,操作和编写结构化配置文件的库,类 JSON 语法,ubuntu 可直接 apt 安装。网上有人说它有一个缺陷,配置文件中的注释在回写时会丢失,未验证。

    http://www.hyperrealm.com/libconfig/libconfig_manual.html

  • A C++ Config File Parser

    This article describes a small, light-weight parser for structured config files. Unlike INI-Files, config files may be sub-structured arbitrarily deep. Config files support the expansion of symbolic values from previously defined variables and environment variables.

    https://www.codeproject.com/Articles/26145/A-C-Config-File-Parser

  • yaml-cpp

    yaml-cpp is a YAML parser and emitter in C++ matching the YAML 1.2 spec.

    https://github.com/jbeder/yaml-cpp

References

https://stackoverflow.com/questions/12633/what-is-the-easiest-way-to-parse-an-ini-file-in-c

http://www.cplusplus.com/forum/unices/80716/

转载于:https://www.cnblogs.com/armme/p/10310809.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值