Parse config file in C/C++

前端 未结 8 571
天涯浪人
天涯浪人 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条回答
  •  囚心锁ツ
    2020-12-03 09:08

    It looks more straightforward to implement your own parser than to try to adapt an existing one you are unfamiliar with.

    Your structure seems - from your example - to be line-based. This makes parsing it easy.

    It generally makes sense to load your file into a tree, and then walk around it as necessary.

提交回复
热议问题