A nice alternative is how Olaf's RoadShow config files work. They appear to be parsed with ReadArgs() or similar.

e.g.

Code:

# Each line in this file is read and parsed according to the
# following template:
#
# NAME/A,PASSWORD/K,UID/A/N,GID/A/N,GECOS,DIR,SHELL

If I remember correctly, AmiTCP did this first and you are well-advised to always steal from the best

One shortcoming to this approach is in that the storage and retrieval of structured data is not one of its strengths. So, given a choice, JSON might do the job with a minimum of fuss if you need structured data to be handled well.

Just the other day I looked into how you would do just that. You have a lot of well-designed 'C' JSON implementations to choose from, as it turned out. The only restriction which I could see involved how much memory you would need to throw at the processing stage during retrieval. Some of the 'C' solutions are specifically made to work well on embedded systems, which helps, but if you are going to store and retrieve complex data structures, the amount of memory you will burn quickly increases almost geometrically