#include <GFile.h>
Public Member Functions | |
void | OnDeviceChange (char *Reserved=0) |
GVolume * | GetRootVolume () |
Gets the root volume of the system. | |
GDirectory * | GetDir () |
Returns a dynamically allocated GDirectory to iterate a directory in the file system. | |
bool | Copy (char *From, char *To, int *Status=0, CopyFileCallback Callback=0, void *Token=0) |
Copies a file. | |
bool | Delete (char *FileName, bool ToTrash=true) |
Delete file. | |
bool | Delete (GArray< char * > &Files, GArray< int > *Status=0, bool ToTrash=true) |
Delete files. | |
bool | CreateDirectory (char *PathName) |
Create a directory. | |
bool | RemoveDirectory (char *PathName, bool Recurse=false) |
Remove's a directory. | |
bool | Move (char *OldName, char *NewName) |
Moves a file to a new location. Only works on the same device. | |
Static Public Member Functions | |
static GFileSystem * | GetInstance () |
Return the current instance of the file system. The shorthand for this is "FileDev". | |
Friends | |
class | GFile |
void GFileSystem::OnDeviceChange | ( | char * | Reserved = 0 |
) |
Call this when the devices on the system change. For instance on windows when you receive WM_DEVICECHANGE.
bool GFileSystem::Copy | ( | char * | From, | |
char * | To, | |||
int * | Status = 0 , |
|||
CopyFileCallback | Callback = 0 , |
|||
void * | Token = 0 | |||
) |
Copies a file.
From | The file to copy from... |
To | The file to copy to. Any existing file there will be overwritten without warning. |
Status | The error code or zero on success |
Callback | Optional callback when some data is copied. |
Token | A user defined token passed to the callback function |
References GFile::GetError(), GFile::GetSize(), GArray< Type >::Length(), GFile::Open(), GFile::Read(), and GFile::Write().
bool GFileSystem::Delete | ( | GArray< char * > & | Files, | |
GArray< int > * | Status = 0 , |
|||
bool | ToTrash = true | |||
) |
Delete files.
Files | The list of files to delete |
Status | A list of status codes where 0 means success and non-zero is an error code, usually an OS error code. NULL if not required. |
ToTrash | true if you want the files moved to the trash folder, false if you want them deleted directly |
References DIR_CHAR, GArray< Type >::Length(), LSP_TRASH, and Move().
bool GFileSystem::RemoveDirectory | ( | char * | PathName, | |
bool | Recurse = false | |||
) |
Remove's a directory.
PathName | The path to remove |
Recurse | True if you want this function to recursively delete all contents of the path passing in. |
References Delete(), GDirectory::First(), GDirectory::IsDir(), GDirectory::Next(), and GDirectory::Path().