4

We want to persist some user settings int he GUI part of our code. I used to do Win32 programming exclusively and the typical way this was done was with registry settings.

I assume that this should be done with configuration files, but was wondering if there was a library or cross platform wrapper that made key/value pair persistence very easy.

Tim
  • 19,847
  • 23
  • 114
  • 212

8 Answers8

7

Qt's QSettings class handles this:

http://doc.qt.nokia.com/4.6/qsettings.html

Pieter
  • 1,165
  • 1
  • 11
  • 29
7

Boost.PropertyTree supports XML, JSON, INI config files.

jfs
  • 374,366
  • 172
  • 933
  • 1,594
3

There is also JSON for a lighter alternative of XML. Lots of implementations on that page too.

DanDan
  • 10,235
  • 8
  • 50
  • 68
2

Qt 4 has a class for it, named QSettings. Looks exactly like what you need.

SigTerm
  • 25,518
  • 5
  • 63
  • 112
1

Why not use an XML as the configuration file. Then you only have to find a cross platform XML library which is easier IMO. Here is a list of nice XML parsing solutions for C++.

Community
  • 1
  • 1
nc3b
  • 14,524
  • 5
  • 49
  • 63
  • I am not a fan of XML - it is far too heavyweight and I find it pretty unreadable. I try not to propagate this standard if I can help it. – Tim May 09 '10 at 00:43
1

Old school Berkley DB comes to mind.

msw
  • 41,609
  • 8
  • 82
  • 107
1

Have a look at Tokyo Cabinet or at Embedded InnoDB.

Jonas
  • 109,920
  • 93
  • 295
  • 369
1

In the old days we used .ini files in windows. Here is a portable version of an ini file read/write library
It will work on Windows as well as Linux.

Romain Hippeau
  • 23,694
  • 5
  • 55
  • 76