I'm writing a cross-platform game (in C++) called Bombz and I need a way to read/write users' settings etc, which will also include records of which levels have been completed. Something like an ini file parser will be fine, and it doesn't really need to be efficient and/or scaleable - I can read all the settings at start-up instead of looking up named keys on the fly.
I've found a few simple ini file parsers but they overlook the question of where to store the files and it looks like I might have to write all this stuff myself. Should I just use something like:
- Windows:
$APPDATA/realh/Bombz/config
- Mac:
$HOME/Library/Bombz/config
- Linux etc:
$HOME/.bombz/config
(or use the XDG spec)
where I look up $HOME
or $APPDATA
with getenv()
? I know there are "better approved" ways of looking that up in Windows but I'm a Linux guy and I don't want to have to deal with the Windows API directly.