[AD] Allegro 4.3 file location API |
[ Thread Index |
Date Index
| More lists.liballeg.org/allegro-developers Archives
]
I added some thoughts about a file location API to the wiki:
http://awiki.tomasu.org/bin/view/Main/FileSystems
Here's what I wrote:
Different platforms store files in different places, so paths can't be
hardcoded. I propose a simple API like this:
enum FILE_LOCATION
{
SYSTEM_SETTINGS,
APP_RESOURCES,
USER_SETTINGS
};
const char* get_file_location(enum FILE_LOCATION);
void set_app_identifier(const char*);
The 'app identifier' is a 'unique' name for your application (could be
a reversed domain name » like Java), so for example on Unix-like
systems:
SYSTEM_SETTINGS -> /usr/local/share/allegro/
APP_RESOURCES -> /usr/local/share/${APP_ID}/
USER_SETTINGS -> ${HOME}/.allegro/$(APP_ID}/
On Windows: (need to check this, anyway there are W32 Shell API
functions to get these)
SYSTEM_SETTINGS -> c:\documents and settings\all users\application
data\allegro\
APP_RESOURCES -> c:\program files\%APP_ID%\
USER_SETTINGS -> c:\documents and settings\%USER%\application
data\%APP_ID%\
System settings wouldn't be used much, only by things like the 'setup'
program.
What do you think?
Pete