Parse config file in C/C++

前端 未结 8 558
天涯浪人
天涯浪人 2020-12-03 08:25

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

8条回答
  •  猫巷女王i
    2020-12-03 09:02

    You may want to try Boost.Program_Options. However it has slightly different formatting. More close to INI files. Subcategories are done like this:

    [CategoryA]
    Option = Data
    
    [CategoryB.Subcategory1]
    Option = Data
    
    [CategoryB.Subcategory2]
    Option = Data
    

    Also it has some other features so it is actually very useful IMO.

提交回复
热议问题