application settings
what sincerely customary proceed storing concentration settings, especially windows nonetheless also easy pierce over platforms.
there's fundamentally 4 groups settings i wish have:
- global settings, affects users, competence changed between machines
- global component settings, affects users, nonetheless specific component (eg defaults system, eg graphics options)
- user settings, user settings changed between systems (eg sound volume)
- user component settings, user settings specific component (eg graphics options hardware dependent)
each turn overrides before level, permitting "global settings" largly applications defaults, user settings storing options user chose.
the initial twin fundamentally defaults where there user sourroundings (eg new user).
i deliberate implementing set functions, i following exercise opposite systems (likely by ini files), nonetheless best way?
(c++)
namespace config
{
vacant init(const std::string &appname);
//updates config keys/sections don't exist (ie don't overwrite changes modernized users rewriting whole file)
vacant defaults (std::map<std::string,std::map<std::string,std::string> > &map);
vacant systemdefaults (std::map<std::string,std::map<std::string,std::string> > &map);
vacant set (const std::string §ion, const std::string &key, const std::string &value);
vacant setsystem (const std::string §ion, const std::string &key, const std::string &value);
vacant setuser (const std::string §ion, const std::string &key, const std::string &value);
vacant setusersystem (const std::string §ion, const std::string &key, const std::string &value);
std::string getvalue (const std::string §ion, const std::string &key);
}
i know windows set directories such settings, nonetheless repremand dirs needs?
edit: i rather files (ini xml), rather controlling contend windows registery. however wheres best places put config files underneath any os?
under perspective i found these, seem fit groups, however comparison windows versions (i need support win2000, xp, etc), does mac/linux have there possess simelar folders?
- global settings - <sysdrive>\users\default\appdata\roaming
- global component settings - <sysdrive>\users\default\appdata\local
- user settings - <sysdrive>\users\<user>\appdata\roaming
- user component settings - <sysdrive>\users\<user>\appdata\local
Comments
Post a Comment