#include <f32file.h>
class RDir : public RSubSessionBase |
Public Member Functions | |
---|---|
EFSRV_IMPORT_C void | Close() |
EFSRV_IMPORT_C TInt | Open(RFs &, const TDesC &, const TUidType &) |
EFSRV_IMPORT_C TInt | Open(RFs &, const TDesC &, TUint) |
EFSRV_IMPORT_C TInt | Read(TEntryArray &) |
EFSRV_IMPORT_C void | Read(TEntryArray &, TRequestStatus &) |
EFSRV_IMPORT_C TInt | Read(TEntry &) |
EFSRV_IMPORT_C void | Read(TPckg< TEntry > &, TRequestStatus &) |
Reads the entries contained in a directory.
You must first open the directory, specifying an attribute mask which is used by Read() calls to filter the entry types required. Then, use one of the Read() functions to read the filtered entries. When the operation is complete, the directory should be closed using Close()
There are two types of Read(): one works with a single entry at a time, requiring programs to iterate through the entries explicitly. The other works with an entire TEntryArray, allowing multiple entries to be read in one call. As well as making application program logic somewhat simpler, this type uses fewer calls to the server, and is more efficient.
Each type of Read() can be performed either synchronously or asynchronously.
It may be more convenient to use RFs::GetDir() than the Read() calls supported by this class. RFs::GetDir() has the advantage that it allows a directory s entries to be sorted in various ways. However, it does not provide asynchronous as well as synchronous variants and does not allow entries to be read individually.
See also: RFs
EFSRV_IMPORT_C void | Close | ( | ) |
Closes the directory.
Any open files are closed when the file server session is closed.
Close() is guaranteed to return, and provides no indication whether it completed successfully or not.
Opens a directory using the specified UID type to filter the directory entry types that will subsequently be read.
This function, or its overload, must be called before reading the entries in the directory.
Note: to close the directory, use Close()
Parameter | Description |
---|---|
aFs | The file server session. |
aMatchName | Name of the directory to be opened. Any path components that are not specified here are taken from the session path. Note that the wildcard characters ? and * can be used. As with all directory paths aName must be terminated with '\', Please refer to "Structure of paths and filenames" section in the Symbian OS Library. |
aUidType | UID type used by the Read() functions to filter the entry types required. Only those entries with the UID type specified here will be read. |
Returns: KErrNone, if successful, otherwise one of the other system-wide error codes.
Opens a directory using an attribute bitmask to filter the directory entry types that will subsequently be read.
This function, or its overload, must be called before reading the entries in the directory.
Note: to close the directory, use Close()
See also: KEntryAttNormal
Parameter | Description |
---|---|
aFs | The file server session. |
aMatchName | Name of the directory to be opened. Any path components that are not specified here are taken from the session path. Note that the wildcard characters ? and * can be used. As with all directory paths aName must be terminated with '\', Please refer to "Structure of paths and filenames" section in the Symbian OS Library. |
anAttMask | An attribute mask used by the Read() functions to filter the entry types required. Only those entries with the attributes specified here will be read. See KEntryAttNormal, and the other file or directory attributes. |
Returns: KErrNone, if successful, otherwise one of the other system-wide error codes.
EFSRV_IMPORT_C TInt | Read | ( | TEntryArray & | anArray | ) | const |
Reads all filtered directory entries into the specified array.
This is a synchronous function that returns when the operation is complete.
Parameter | Description |
---|---|
anArray | On successful return, contains filtered entries from the directory. |
Returns: KErrNone, if the read operation is successful - the end of the directory has not yet been reached, and there may be more entries to be read; KErrEof, if the read operation is successful - all the entries in the directory have been read, and anArray contains the final set of entries; otherwise one of the other system-wide error codes (e.g. KErrCorrupt, KErrNoMemory etc).
EFSRV_IMPORT_C void | Read | ( | TEntryArray & | anArray, |
TRequestStatus & | aStatus | |||
) | const |
Reads all filtered directory entries into the specified array.
This is an asynchronous function.
Parameter | Description |
---|---|
anArray | On request completion, contains filtered entries from the directory. |
aStatus | The request status object. On completion, this will contain: KErrNone, if the read operation is successful - the end of the directory has not yet been reached, and there may be more entries to be read; KErrEof, if the read operation is successful - all the entries in the directory have been read, and anArray contains the final set of entries; otherwise one of the other system-wide error codes (e.g. KErrCorrupt, KErrNoMemory etc). |
Reads a single directory entry.
This is a synchronous function that returns when the operation is complete.
Parameter | Description |
---|---|
anEntry | On successful return, contains a directory entry. |
Returns: KErrNone, if successful, otherwise one of the other system-wide error codes.
EFSRV_IMPORT_C void | Read | ( | TPckg< TEntry > & | anEntry, |
TRequestStatus & | aStatus | |||
) | const |
Reads a single directory entry.
This is an asynchronous function.
Parameter | Description |
---|---|
anEntry | On request completion, contains a directory entry. |
aStatus | The request status object. On request completion, contains: KErrNone, if successful; otherwise one of the other system-wide error codes. |