Basically what I want to do is put a lot of different parameters in a text file I edit by-hand, to avoid recompiling. I'm using Ogre3D, so I'm using configfile, but it gets messed up, and I'm looking for something with more features.

I've tried YAML-CPP, but it seems to be a pain to use, I had a very hard time figuring out how to make a difference between a pair and a mapping.

XML is a no-no, it's not human readable.

My program only reads the file, and I always edit it by hand.

Any C-like format ?

  • 3
    \$\begingroup\$ You'd be better off asking about your yaml-cpp-related confusion on Stack Overflow. Then you can use YAML. \$\endgroup\$
    – user744
    May 8 '12 at 15:25
  • 3
    \$\begingroup\$ XML is perfectly readable by humans. It may be more verbose than some other alternatives, but that it is entirely different criticism. \$\endgroup\$
    – user1430
    May 8 '12 at 15:41
  • \$\begingroup\$ Hm, negative ratings.. figures: "XML - not human readable".. odd statement :|. I also use Ogre and I'd like to understand why the configuration input file "gets messed up". Ogre has a powerful architectural design behind it and I don't think it lacks that much from this point of view. But there's always room for improvement. \$\endgroup\$
    – teodron
    May 8 '12 at 16:17
  • \$\begingroup\$ what about C like syntax ? \$\endgroup\$
    – jokoon
    May 8 '12 at 16:23
  • 2
    \$\begingroup\$ Go back and recheck YAML - it's pretty common and there are many libraries for accessing it available. Also, C is a language so I'm not sure what a "C-like format" is. \$\endgroup\$
    – Tim Holt
    May 8 '12 at 16:37

I use a simple format for many programs, where each line consists of a key,value pair. It's easy for both humans and programs to parse.

# this is a comment line
keyname,this is the value of the key "keyname"
key2,this is a multi line key called "key2"
,this is the continuation of the previous line

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.