Media Class Reference

Media mounter class. More...

#include <Media.h>

List of all members.

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.

Detailed Description

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.


Member Function Documentation

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.

Parameters:
fileName Contains a mount point path or a full file path on the media.
Returns:
Returns MEDIA_STATE_READWRITE or MEDIA_STATE_READONLY if the media is mounted, depending on its read/write setting. Returns MEDIA_STATE_UNMOUNT if the media is not mounted. Returns MEDIA_STATE_ERROR on error.
int Media::getMediaState ( int  mountPoint  )  [static]

Get media state given a mount point.

Retrieves current media mount state for the given mount point identifier.

Parameters:
mountPoint Contains the mount point identifier, as returned by mountMedia() function.
Returns:
Returns MEDIA_STATE_READWRITE or MEDIA_STATE_READONLY if the media is mounted, depending on its read/write setting. Returns MEDIA_STATE_UNMOUNT if the media is not mounted. Returns MEDIA_STATE_ERROR on error.
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.

Parameters:
fileName Contains full path to the file located on media.
writeFlag Specifies if file write access is required.
Returns:
Returns a positive integer if the media has been mounted successfully. The return value identifies the mount point associated with the media and should be further passed to unmountMedia() function. Returns MOUNT_NOT_REQUIRED = 0 if media mounting is not required for the given file. Returns a negative integer (MOUNT_FAILED) if the call failed.
bool Media::unmountAll (  )  [static]

Unmount all media.

Unmounts all available media. Should be called before the system enters a low-power state.

Returns:
Returns true if all media mount points have been successfully unmounted.
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.

Parameters:
mountPoint Contains mount point identifier returned by the mount method.
Returns:
Returns true if the operation was successful, false otherwise

The documentation for this class was generated from the following files:
Generated on Wed Oct 20 11:13:44 2010 for libspatha by  doxygen 1.6.3