Public Types | |
enum | Mode { READ, WRITE, APPEND } |
File open mode. More... | |
Public Member Functions | |
PG_FileArchive () | |
~PG_FileArchive () | |
Static Public Member Functions | |
void | Deinit () |
bool | AddArchive (const char *arch, bool append=true) |
Add a directory or archive file to the pool. | |
bool | RemoveArchive (const char *arch) |
Remove a directory or archive file from the pool. | |
bool | RemoveAllArchives () |
Remove all currently registered directories or archive files from the pool. | |
char ** | GetSearchPath () |
Get a list of registered archives. | |
void | FreeList (void *list) |
Free a list of entries. | |
char ** | EnumerateFiles (const char *dir) |
Get a list of files in a directory. | |
bool | Exists (const char *filename) |
Check if a file exists in the archive. | |
bool | IsDirectory (const char *filename) |
Check if the "filename" is a directory. | |
const char * | GetDirSeparator () |
Get the platform specifiy directory separator. | |
const char * | GetRealDir (const char *filename) |
const char * | GetLastError () |
bool | MakeDir (const char *dir) |
Create a new directory. | |
bool | SetWriteDir (const char *dir) |
Set write directory. | |
string * | PathToPlatform (const char *path) |
convert a path from UNIX to system dependent format | |
const char * | GetBaseDir () |
Get the application base directory. | |
const char * | GetUserDir () |
Get the users home directory. | |
const char * | GetWriteDir () |
Get the designated write directory. | |
bool | SetSaneConfig (const char *organization, const char *appName, const char *archiveExt=0, bool includeCdRoms=false, bool archivesFirst=true) |
Setup a sane config for a typical application. | |
PG_File * | OpenFile (const char *filename, Mode mode=READ) |
Open a file from the archive. | |
SDL_RWops * | OpenFileRWops (const char *filename, Mode mode=READ) |
Open a file from the archive. | |
PG_DataContainer * | ReadFile (const char *filename) |
Open and read a file from the archive. | |
SDL_Surface * | LoadSurface (const char *filename, bool convert=false) |
Load a surface (image) from the archive all loaded surface will be cached. | |
SDL_Surface * | LoadSurface (const char *filename, bool usekey, Uint32 colorkey, bool convert=false) |
Load a surface (image) from the archive and apply a colorkey all loaded surface will be cached. | |
bool | UnloadSurface (SDL_Surface *surface, bool bDeleteIfNotExists=true) |
Removes the surface from the cache. | |
void | EnableSymlinks (bool followSymlinks) |
Enable / disable the use of symlinks. | |
PG_FileList * | GetSearchPathList () |
Get the names of all registered archives. | |
PG_FileList * | GetFileList (const char *dir, const char *wildcard="*") |
Get the names of all files in a directory. |
|
File open mode.
|
|
|
|
|
|
Add a directory or archive file to the pool.
|
|
|
|
Enable / disable the use of symlinks. By default, the file I/O routines will check if a file is really a symlink during open calls and fail if it is. Otherwise, the link could take you outside the write and search paths, and compromise security. Symbolic link permission can be enabled or disabled at any time, and is disabled by default |
|
Get a list of files in a directory. This function returns a NULL terminated char ** with the files in the specified directory. If the directory doesn't exist, NULL is returned.
|
|
Check if a file exists in the archive.
|
|
Free a list of entries. This function returns frees a previously retrieved list (GetSearchPath()).
|
|
Get the application base directory.
|
|
Get the platform specifiy directory separator.
|
|
Get the names of all files in a directory. This function returns a vector of strings containing the names of all files in the specified directory.
|
|
|
|
|
|
Get a list of registered archives. This function returns a NULL terminated char ** with all currently registered archives (AddArchive).
|
|
Get the names of all registered archives. This function returns a vector of strings containing the names of all currently registered archives (Added via AddArchive)
|
|
Get the users home directory. This functions tries to find the users home directory. If it can't find it, it returns a directory relative to the application base directory.
|
|
Get the designated write directory. This function returns the directory which is opened for writing, if any.
|
|
Check if the "filename" is a directory.
|
|
Load a surface (image) from the archive and apply a colorkey all loaded surface will be cached.
|
|
Load a surface (image) from the archive all loaded surface will be cached.
|
|
Create a new directory. This function tries to create a directory in the application write directory, if any.
|
|
Open a file from the archive.
|
|
Open a file from the archive.
|
|
convert a path from UNIX to system dependent format This function converts / in a path to the system dependent format, which for example is \ in Windows and : on MacOS.
|
|
Open and read a file from the archive. This is a utility function which opens and reads a file in one step. The returned string should be deleted when it's not needed anymore.
|
|
Remove all currently registered directories or archive files from the pool.
|
|
Remove a directory or archive file from the pool.
|
|
Setup a sane config for a typical application. This function is a convenience function which tries to open / create a directory in USERHOME/.organization/appName/ and add it as the write directory, add the base directory to the load path, optionally adds mounted cdroms to the searchpath and finally optiopnally adds files with the extension archiveExt to the load path (if any).
|
|
Set write directory. This function sets the write directory to use.
|
|
Removes the surface from the cache.
|