Thursday 15 April 2010

xml - What settings storage format to choose? -


I am writing a QT application and I will need to store settings for the program. I want them to be easily editable by non-advanced users but are flexible enough for advanced users (thus allow easy automated editing by other programs, scripts, whatever). QSettings provides two formats, native format, which is the registry for Windows, and INI format, which is original for most other platforms. INI is fine, but seeing Qestring (...) or other QT stuff is not really readable and it is a little error prone.

The registry is not great either, it was not designed to disturb and was not exactly right for editing or advanced use; This resolves the problem of synchronization between threads and multiple QSettings objects (so I can not erase everything, although I can only use a global object, protected by a read-write locker). I am looking at XML, but it is very clear and it is necessary to write a quotes format (not really an issue), but it is very flexible.

I know that other options of XML are present, but I'm not really familiar with them;

Update - Attention: I will not leave the Q settings at all, I will just write one format for it - it seems that this is just two function pointers And for a writing job) are passed in a constant function and then I can use my format.

Update 2: I'm also worried about Linux servers, which are not usually GUI .. I want people to be nanotech or something similar Easy to edit the configuration, without using the manager (yes, I will have a daemon server and remote GUI manager).

For any reason except for QSettings and your configuration file Consider XML, I suggest you look at JSON or YAST, depending on how you like available Libs.

As a sidenote, if you do not intend to ever edit the file M on one side, choose the easiest ( QSettings ?) For you and your life Proceed with, because the choice of format will not make any difference to each bit.


No comments:

Post a Comment