Cross platform library for reading/writing configuration files?

I've used Windows specific functions for reading/writing configuration (INI) files in my application and would like to know if there is a cross platform library available that is recommended. I searched the boost libs for something and there are libs of course that can achieve this with some programming, but I'd like to know if there is something (boost or other library) with specific functionality to handle reading/writing INI files. Example: [General] Language=Français [Strings] String00001=Version String00002=Etes vous sûr ? String00003=Voulez-vous continuer ? Thank you very much

On Fri, 14 Nov 2008 20:21:46 +0100, Jeff Dunlap
I've used Windows specific functions for reading/writing configuration (INI) files in my application and would like to know if there is a cross platform library available that is recommended.
I searched the boost libs for something and there are libs of course that can achieve this with some programming, but I'd like to know if there is something (boost or other library) with specific functionality to handle reading/writing INI files. Example:
The Property Tree library can do this. It hasn't been included yet into the Boost distribution (and I don't know what its status is). You can download the library from http://www.boostpro.com/vault/ though (property_tree_rev5.zip). Boris

Hello,
There are many libraries like that. In the past, I've successfully
used SimpleIni ( http://code.jellycan.com/simpleini/ ) and RudeConfig
( http://rudeserver.com/config/install.html ). While RudeConfig is
easier to use, SimpleIni has the advantage of being just a header file
(no library to link with).
--
Pau Garcia i Quiles
http://www.elpauer.org
(Due to my workload, I may need 10 days to answer)
On Fri, Nov 14, 2008 at 8:21 PM, Jeff Dunlap
I've used Windows specific functions for reading/writing configuration (INI) files in my application and would like to know if there is a cross platform library available that is recommended.
I searched the boost libs for something and there are libs of course that can achieve this with some programming, but I'd like to know if there is something (boost or other library) with specific functionality to handle reading/writing INI files. Example:
[General] Language=Français
[Strings] String00001=Version String00002=Etes vous sûr ? String00003=Voulez-vous continuer ?
Thank you very much
_______________________________________________ Boost-users mailing list Boost-users@lists.boost.org http://lists.boost.org/mailman/listinfo.cgi/boost-users

On Nov 14, 2008, at 2:21 PM, Jeff Dunlap wrote:
I've used Windows specific functions for reading/writing configuration (INI) files in my application and would like to know if there is a cross platform library available that is recommended.
I searched the boost libs for something and there are libs of course that can achieve this with some programming, but I'd like to know if there is something (boost or other library) with specific functionality to handle reading/writing INI files. Example:
[General] Language=Français
[Strings] String00001=Version String00002=Etes vous sûr ? String00003=Voulez-vous continuer ?
I am kind of curios why nobody mentioned it yet but isn't 'Boost.Program_options' made for this....? Ciao, Andreas

Andreas Masur wrote:
On Nov 14, 2008, at 2:21 PM, Jeff Dunlap wrote:
I've used Windows specific functions for reading/writing configuration (INI) files in my application and would like to know if there is a cross platform library available that is recommended.
...
[General] Language=Français
[Strings] String00001=Version String00002=Etes vous sûr ? String00003=Voulez-vous continuer ?
I am kind of curios why nobody mentioned it yet but isn't 'Boost.Program_options' made for this....?
Correct me if I am wrong, but doesn't Boost.Program_options only handle the reading part and not the writing part? I don't know it that well, but can you modify options and save it to a file using Boost.Program_options? But yes, it can at least handle the reading part, which is already half the work. :-) Ray

On Friday 14 November 2008, Raymond Wan wrote:
Andreas Masur wrote:
On Nov 14, 2008, at 2:21 PM, Jeff Dunlap wrote:
I've used Windows specific functions for reading/writing configuration (INI) files in my application and would like to know if there is a cross platform library available that is recommended.
Try ACE http://www.cs.wustl.edu/~schmidt/ACE.html Lothar -- Lothar Werzinger Dipl.-Ing. Univ. framework & platform architect Tradescape Inc. - Enabling Efficient Digital Marketplaces 1754 Technology Drive, Suite 128 San Jose, CA 95110 web: http://www.tradescape.biz

On Nov 15, 2008, at 2:21 AM, Raymond Wan wrote:
Andreas Masur wrote:
On Nov 14, 2008, at 2:21 PM, Jeff Dunlap wrote:
I've used Windows specific functions for reading/writing configuration (INI) files in my application and would like to know if there is a cross platform library available that is recommended.
...
[General] Language=Français
[Strings] String00001=Version String00002=Etes vous sûr ? String00003=Voulez-vous continuer ?
I am kind of curios why nobody mentioned it yet but isn't 'Boost.Program_options' made for this....?
Correct me if I am wrong, but doesn't Boost.Program_options only handle the reading part and not the writing part? I don't know it that well, but can you modify options and save it to a file using Boost.Program_options?
But yes, it can at least handle the reading part, which is already half the work. :-)
Actually you are correct I guess. I does not seem to be able to write them....I mainly deal with XML files thus, I have not used it much....thus, kind of assumed it would write as well....sorry. Might be an option that could be added though.... Ciao, Andreas

Jeff Dunlap wrote:
I've used Windows specific functions for reading/writing configuration (INI) files in my application and would like to know if there is a cross platform library available that is recommended.
I searched the boost libs for something and there are libs of course that can achieve this with some programming, but I'd like to know if there is something (boost or other library) with specific functionality to handle reading/writing INI files. Example:
[General] Language=Français
[Strings] String00001=Version String00002=Etes vous sûr ? String00003=Voulez-vous continuer ?
We have a Windows/Linux library that handles at least the reading part of this. It features a thread safe settings library that uses JSON for the values so it is pretty flexible on what it does. There's also a JSON parser and unparser. The library currently assumes all files are UTF-8 though, not sure if that will match what you have or not. svn://svn.felspar.com/public/fost-base/stable Username is 'guest' and the password is blank. It's Boost licensed. Kirit

On Fri, Nov 14, 2008 at 11:21 AM, Jeff Dunlap
I've used Windows specific functions for reading/writing configuration (INI) files in my application and would like to know if there is a cross platform library available that is recommended.
I searched the boost libs for something and there are libs of course that can achieve this with some programming, but I'd like to know if there is something (boost or other library) with specific functionality to handle reading/writing INI files. Example:
[General] Language=Français
[Strings] String00001=Version String00002=Etes vous sûr ? String00003=Voulez-vous continuer ?
When I want to do something like this, I use Lua. Eg.
conf.lua
conf = {
general = {
language='Français',
},
strings = {
string00001='Version',
string00002='Etes vous sûr ?',
string00003='Voulez-vous continuer ?',
},
}
EOF
main.cpp
#include <iostream>
#include
participants (8)
-
Andreas Masur
-
Boris
-
Jeff Dunlap
-
Ken Smith
-
Kirit Sælensminde
-
Lothar Werzinger
-
Pau Garcia i Quiles
-
Raymond Wan