class RFsPlugin : private RFs |
A class for making file server request internally from within a file server plugin.
See also RFilePlugin and RDirPlugin .
Public Member Functions | |
---|---|
RFsPlugin ( TFsPluginRequest &, TBool ) | |
~RFsPlugin () | |
IMPORT_C void | Close () |
IMPORT_C TInt | Connect () |
IMPORT_C TInt | Delete (const TDesC &) |
IMPORT_C TInt | Entry (const TDesC &, TEntry &) |
IMPORT_C TInt | ReadFileSection (const TDesC &, TInt64 , TDes8 &, TInt ) |
IMPORT_C TInt | Rename (const TDesC &, const TDesC &) |
IMPORT_C TInt | Replace (const TDesC &, const TDesC &) |
IMPORT_C TInt | SetEntry (const TDesC &, const TTime &, TUint , TUint ) |
IMPORT_C TInt | Volume ( TVolumeInfo &, TInt ) |
Protected Member Functions | |
---|---|
TInt | SendReceive ( TInt , const TIpcArgs &) |
Private Member Functions | |
---|---|
RFsPlugin () | |
RFsPlugin (const RFsPlugin &) | |
void | SetHandle ( TInt ) |
RFsPlugin & | operator= (const RFsPlugin &) |
Inherited Enumerations | |
---|---|
RFs:@37 | |
RFs:TFinaliseDrvMode | |
RHandleBase:TAttributes | |
RSessionBase:TAttachMode |
Private Attributes | |
---|---|
TPluginSessionHelper | iSessionHelper |
Inherited Attributes | |
---|---|
RHandleBase::iHandle |
IMPORT_C | RFsPlugin | ( | TFsPluginRequest & | aRequest, |
TBool | aDirectToDrive = EFalse | |||
) |
TFsPluginRequest & aRequest | |
TBool aDirectToDrive = EFalse |
IMPORT_C TInt | Delete | ( | const TDesC & | aName | ) |
Deletes a single file.
Wildcards are not allowed in either the file name or the extension, otherwise an error is returned.
Note that the file must be closed and must not be read-only. Hidden files can be deleted but system files cannot.
See class CFileMan for information on deleting multiple files.
const TDesC & aName | The name of the file to be deleted. Any path components which are not specified here will be taken from the session path. |
IMPORT_C TInt | Entry | ( | const TDesC & | aName, |
TEntry & | anEntry | |||
) | const |
Gets the entry details for a file or directory.
This information includes UID information.
IMPORT_C TInt | ReadFileSection | ( | const TDesC & | aName, |
TInt64 | aPos, | |||
TDes8 & | aDes, | |||
TInt | aLength | |||
) | const |
Reads data from a file without opening it.
The contents of the file can be accessed regardless of the file's lock state.
The file may be open by any number of other clients for reading or writing. In allowing such access to a file, the fileserver makes no guarantees as to the validity of the data it returns.
const TDesC & aName | Name of the file to be accessed. |
TInt64 aPos | The offset, in bytes, from the start of the file where reading is to start. |
TDes8 & aDes | On return, contains the data read from the file. The length of the descriptor is set to the number of bytes read. If the specified offset lies beyond the end of the file, no data is read and the length of this descriptor is set to zero. |
TInt aLength | The number of bytes to be read from the file. |
IMPORT_C TInt | Rename | ( | const TDesC & | anOldName, |
const TDesC & | aNewName | |||
) |
Renames a single file or directory.
It can also be used to move a file or directory by specifying different destination and source directories. If so, the destination and source directories must be on the same drive. If a directory is moved, then the directory structure beneath it is also moved.
If a directory specified by aNewName is different from one specified by anOldName, then the file or directory is moved to the new directory. The file or directory cannot be moved to another device by this means, either explicitly (by another drive specified in the name) or implicitly (because the directory has been mapped to another device with SetSubst() .
The function fails and returns an error code in the following circumstances:
1. If either the old or new name includes wildcards.
2. If a file or directory with the new name already exists in the target directory. Overwriting is not permitted.
3. If file anOldName does not exist, or is open.
Read-only, system and hidden files may be renamed. The renamed file's attributes are preserved.
Note that when this function is operating on directories, a trailing backslash is not required after the final directory name in either anOldName or aNewName.
See class CFileMan for information on renaming multiple files.
const TDesC & anOldName | File or directory to be renamed. Any path components which are not specified here will be taken from the session path. |
const TDesC & aNewName | Path specifying the new name for the file or directory and/or its new parent directory. All directories specified in this path must exist. Any path components which are not specified here will be taken from the session path. |
IMPORT_C TInt | Replace | ( | const TDesC & | anOldName, |
const TDesC & | aNewName | |||
) |
Replaces a single file with another.
This function does not support the use of wildcards. Unlike Rename() , it only applies to files.
This function operates as follows:
1. if the aNewName file does not exist, it is created.
2. anOldName's contents, attributes and the date and time of its last modification are copied to file aNewName, overwriting any existing contents and attribute details.
3. anOldName is deleted.
anOldName may be hidden, read-only or a system file. However, neither anOldName, nor, if it exists, aNewName, can be open; aNewName must not be read-only. Both files must be on the same drive.
const TDesC & anOldName | The file to be replaced. Must exist and must be closed. It is deleted by this function. |
const TDesC & aNewName | The file to replace anOldName. Does not need to exist, but if it does exist, it must be closed. If it exists, its name remains unchanged but its contents, attributes and the date and time of its last modification are replaced by those of anOldName. If it does not exist, it will be created and is assigned the contents and attributes of anOldName. Must not be followed by a trailing backslash. |
TInt | SendReceive | ( | TInt | aFunction, |
const TIpcArgs & | aArgs | |||
) | const [protected] |
Issues a synchronous request to the server with the specified function number and arguments.
IMPORT_C TInt | SetEntry | ( | const TDesC & | aName, |
const TTime & | aTime, | |||
TUint | aSetAttMask, | |||
TUint | aClearAttMask | |||
) |
Sets both the attributes and the last modified date and time for a file or directory.
The function uses two bitmasks. The first bitmask determines which attributes should be set. The second bitmask determines which should be cleared.
An attempt to set or clear the KEntryAttDir, KEntryAttVolume or KEntryAttRemote attributes have no effect.
const TDesC & aName | File or directory name. |
const TTime & aTime | New date and time. UTC date and time should be used. |
TUint aSetAttMask | Bitmask indicating which attributes are to be set. |
TUint aClearAttMask | Bitmask indicating which attributes are cleared. For more information, see KEntryAttNormal, and the other file or directory attributes. |
void | SetHandle | ( | TInt | aHandle | ) | [private] |
Sets the handle-number of this handle to the specified value.
TInt aHandle | The handle-number to be set. |
IMPORT_C TInt | Volume | ( | TVolumeInfo & | aVol, |
TInt | aDrive = KDefaultDrive | |||
) | const |
Gets volume information for a formatted device.
This function provides additional information to that given by Drive() , including the volume label, if set, and the amount of free space on the disk.
Note, use Drive() to get information about the drive without reference to a volume. These two functions are separate because, while the characteristics of a drive cannot change, those of a volume can, by mounting different media, reformatting etc. A volume may not even be present if the media is removable.
TVolumeInfo & aVol | On return, contains the volume information. |
TInt aDrive = KDefaultDrive | The drive which contains the media for which volume information is to be displayed. Specify a drive in the range EDriveA to EDriveZ for drives A to Z respectively. The default drive is the session default drive KDefaultDrive. |
RFsPlugin & | operator= | ( | const RFsPlugin & | ) | [private] |
const RFsPlugin & |
Copyright ©2010 Nokia Corporation and/or its subsidiary(-ies).
All rights
reserved. Unless otherwise stated, these materials are provided under the terms of the Eclipse Public License
v1.0.