Boost logo

Boost :

From: Jason Stewart (jstewart_at_[hidden])
Date: 2005-05-17 06:35:41


>
>Actually one shouldn't even try to write a parser on Windows,
>the API functions Get/SetPrivateProfileString are the preferred way
>of interacting with INI files. (And the Registry is of course preferred
>over ini files since win 95.)

I think that they officially deprecate the registry now. I believe that
.Net pushes people toward config files in the APPDATA or the
COMMON_APPDATA location as returned by SHGetFolderPath. These usually
resolve to "c:/Documents and Settings/username/Application Data" and
"c:/Documents and Settings/All Users/Application Data" directories
respectively.

I don't know if there is any way to abstract these locations in the
program_options library. It would be kind of a nice insulation layer.
Something like:

boost::filesystem::path get_user_config_path();
boost::filesystem::path get_system_config_path();

And make them call SHGetFolderPath on Windows or return "~/" or "/etc/" on
posix systems. I can't speak for other kinds of systems though. Anyway,
just a thought.

Jason


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk