Application Settings Application Settings windows windows

Application Settings


If you are a boost user, you might take a look at the program options library, it supports using config files as well as environment variables and (of course) command line options.

It is designed to be portable, so that should ease your cross-platform headaches.


There are (at least) three reasonable choices:

Registry: This is my least favorite because of portability and relative opacity.

Environment variables: I recommend using one (just one) that points to a place where your material is kept - an "installation directory" or some such.

Files: Both a/the user-home directory (or in a subdirectory thereof) and project/product directory are suitable for storing things.

You might want to use a simple keyword=value paradigm, and basic rules so your variables - settings - can be read by more than one type of code very easily. For example, I typically use the Java paradigm for Property files and use matching behavior C code so both my codelines can easily read the settings.