|
Boost : |
From: Jason Stewart (res0054p_at_[hidden])
Date: 2002-01-23 16:54:12
I think this is orthogonal to checking an environment variable. It would be
nice if it could support the same syntax as the registry stuff (or other
config file, or command line) but it seems like a separate issue. Now that
I re-read your post, maybe that is what you are saying.
Registry key(HKCU, "/software/MyCompany/MyProgram/");
string location = external::get(env(), "LOCATION", external::get(key,
"location", "c:/"));
would get the location from the environment variable "LOCATION" or if that
didn't exists from the registry key
"HKEY_CURRENT_USER/software/MyCompany/MyProgram/location".
The only problem that I see right now is that there is only one environment
so it seems to make sense to put its functions into a namespace but the key
needs to be in a class since it also stores path information.
Jason
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk