#include <Media.h>
Static Public Member Functions | |
static int | mountMedia (const char *fileName, bool writeFlag) |
Mount media associated with file. | |
static bool | unmountMedia (int mountPoint) |
Unmount media. | |
static int | getMediaState (int mountPoint) |
Get media state given a mount point. | |
static int | getMediaState (const char *fileName) |
Get media state given a file name. | |
static bool | unmountAll () |
Unmount all media. | |
static void | mountEnable () |
Enable media mounter. | |
static void | mountDisable () |
Disable media mounter. |
Media mounter class.
Media mounter is a helper class designed to simplify media mounting and unmounting when a corresponding file located on it is being opened or closed. Media mounter has static functions and does not require initialziation.
int Media::getMediaState | ( | const char * | fileName | ) | [static] |
Get media state given a file name.
Retrieves current media mount state for the given file name or a mount point path.
fileName | Contains a mount point path or a full file path on the media. |
int Media::getMediaState | ( | int | mountPoint | ) | [static] |
Get media state given a mount point.
Retrieves current media mount state for the given mount point identifier.
mountPoint | Contains the mount point identifier, as returned by mountMedia() function. |
void Media::mountDisable | ( | ) | [static] |
Disable media mounter.
Disables automatic mounting of media. The files located on that media will fail to open, when accessed through mountMedia() function or via StdioFile.
void Media::mountEnable | ( | ) | [static] |
Enable media mounter.
Enables automatic mounting of media. The files located on that media may be opened when accessed through mountMedia() function or via StdioFile.
int Media::mountMedia | ( | const char * | fileName, | |
bool | writeFlag | |||
) | [static] |
Mount media associated with file.
Mounts the media associated with the given file path, if required. The media is mounted to a specific mount point with a fixed identifier, which will be returned by the function on success. If the file is located on media that does not require any special handling, the function will return immediately.
fileName | Contains full path to the file located on media. | |
writeFlag | Specifies if file write access is required. |
bool Media::unmountAll | ( | ) | [static] |
Unmount all media.
Unmounts all available media. Should be called before the system enters a low-power state.
bool Media::unmountMedia | ( | int | mountPoint | ) | [static] |
Unmount media.
Unmount the media previously mounted with mountMedia(). The media may not have any open files located on it in order to be successfully unmounted.
mountPoint | Contains mount point identifier returned by the mount method. |