Creating a simple configuration file and parser in C++

前端 未结 12 750
谎友^
谎友^ 2020-12-07 10:55

I am trying to create a simple configuration file that looks like this

url = http://mysite.com
file = main.exe
true = 0

when the program ru

12条回答
  •  忘掉有多难
    2020-12-07 11:45

    I was looking for something that worked like the python module ConfigParser and found this: https://github.com/jtilly/inih

    This is a header only C++ version of inih.

    inih (INI Not Invented Here) is a simple .INI file parser written in C. It's only a couple of pages of code, and it was designed to be small and simple, so it's good for embedded systems. It's also more or less compatible with Python's ConfigParser style of .INI files, including RFC 822-style multi-line syntax and name: value entries.

提交回复
热议问题