GFileSystem Class Reference

A singleton class for accessing the file system. More...

#include <GFile.h>

List of all members.

Public Member Functions

void OnDeviceChange (char *Reserved=0)
GVolumeGetRootVolume ()
 Gets the root volume of the system.
GDirectoryGetDir ()
 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 GFileSystemGetInstance ()
 Return the current instance of the file system. The shorthand for this is "FileDev".

Friends

class GFile


Detailed Description

A singleton class for accessing the file system.

Member Function Documentation

bool GFileSystem::Copy ( char *  From,
char *  To,
int *  Status = 0,
CopyFileCallback  Callback = 0,
void *  Token = 0 
)

Copies a file.

Parameters:
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.

Parameters:
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().

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::RemoveDirectory ( char *  PathName,
bool  Recurse = false 
)

Remove's a directory.

Parameters:
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().


The documentation for this class was generated from the following files:

Generated on Wed Dec 1 15:41:03 2010 for Lgi by  doxygen 1.5.7.1