SNYP40A1
June 24th, 2009, 01:16 AM
I am making a program (has to be in C++) and I want it to be easy to configure. The program will have several settings and a few ideas on how to store these settings popped into mind: text file, XML, SQLLite database. Basically, I will need to generate a config file which will basically hold a bunch of attributes or properties. I might want to store something like this:
define DataType HexDataType:
case "0" -> "0000"
case "1" -> "0001"
case "2" -> "0010"
case "3" -> "0011"
...
case "E" -> "1110"
case "F" -> "1111"
Or I might want to define something like this:
length 220
width 214
Or I might want to define a range like this:
define September 9/1 9/31
The program can specify how things are defined and will expect certain parameters to be defined. For example, the program might be expecting a parameter called length that has one value and another parameter called September which has 2 values, but it will not know how many datatypes will be defined.
Based on these requirements, I think XML might be the easiest way to do this, but the XML files can look a bit ugly. Is there an application which can make the XML file? I ask this because other people will need to setup the configuration info and I would like that to be as simple as possible. For example, there is a SQL Lite Browser application which makes setting up SQL Lite databases easy. I like the XMLEncoder / XMLDecoder features of Java, but not sure if something that simple exists for C++.
define DataType HexDataType:
case "0" -> "0000"
case "1" -> "0001"
case "2" -> "0010"
case "3" -> "0011"
...
case "E" -> "1110"
case "F" -> "1111"
Or I might want to define something like this:
length 220
width 214
Or I might want to define a range like this:
define September 9/1 9/31
The program can specify how things are defined and will expect certain parameters to be defined. For example, the program might be expecting a parameter called length that has one value and another parameter called September which has 2 values, but it will not know how many datatypes will be defined.
Based on these requirements, I think XML might be the easiest way to do this, but the XML files can look a bit ugly. Is there an application which can make the XML file? I ask this because other people will need to setup the configuration info and I would like that to be as simple as possible. For example, there is a SQL Lite Browser application which makes setting up SQL Lite databases easy. I like the XMLEncoder / XMLDecoder features of Java, but not sure if something that simple exists for C++.