Config file format

Posted by Felics on Stack Overflow See other posts from Stack Overflow or by Felics
Published on 2010-05-28T08:36:39Z Indexed on 2010/05/28 8:41 UTC
Read the original article Hit count: 202

Filed under:
|

Hello, does anyone knows a file format for configuration files easy to read by humans? I want to have something like tag = value where value may be:

  • String
  • Number(int or float)
  • Boolean(true/false)
  • Array(of String values, Number values, Boolean values)
  • Another structure(it will be more clear what I mean in the fallowing example)

Now I use something like this:

  • IntTag=1
  • FloatTag=1.1
  • StringTag="a string"
  • BoolTag=true
  • ArrayTag1=[1 2 3]
  • ArrayTag2=[1.1 2.1 3.1]
  • ArrayTag3=["str1" "str2" "str3"]
  • StructTag=
  • {
  • NestedTag1=1
  • NestedTag2="str1"
  • }

and so on.

Parsing is easy but for large files I find it hard to read/edit in text editors. I don't like xml for the same reason, it's hard to read. INI does not support nesting and I want to be able to nest tags. I also don't want a complicated format because I will use limited kind of values as I mentioned above.

Thanks for any help.

© Stack Overflow or respective owner

Related posts about parsing

Related posts about config-files