在C / C ++中解析配置文件 [英] Parse config file in C/C++

查看:336
本文介绍了在C / C ++中解析配置文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是一个新手,希望能用C或C ++(wxWidgets)解析文本文件。

I'm a newbie looking for a fast and easy way to parse a text file in C or C++ (wxWidgets)

该文件看起来像这样将出现在列表框中的主要类别

The file will look something like this (A main category with "sub-objects") which will appear in a list box

[CategoryA]

[SubCat]

    Str1 = Test 

    Str2 = Description  

[SubCat] [End]

[SubCat]

    Str1 = Othertest
...

[CategoryA] [End]

有任何建议吗?

推荐答案

听起来像是要解析非常靠近一个ini文件。

Sounds like you want to parse a file that's pretty close to an ini file.

至少有一些INI解析器库: minIni iniParser libini

There's at least a few INI parser libraries out there: minIni, iniParser, libini, for instance.

这篇关于在C / C ++中解析配置文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆