WEB开发网
开发学院手机开发Symbian 开发 Symbian OS应用开发 文件和目录 阅读

Symbian OS应用开发 文件和目录

 2010-05-31 19:48:00 来源:WEB开发网   
核心提示:Parametersconst TDesC& aName Name of the directory for which a listing is required. Wildcards may be used to specify particular files.TUint anEntryAttMask Bitma

Parameters

const TDesC& aName Name of the directory for which a listing is required. Wildcards may be used to specify particular files.

TUint anEntryAttMask Bitmask indicating the attributes of interest. Only files and directories whose attributes match those specified here can be included in the listing. For more information see KEntryAttMatchMask and the other directory entry details. Also see KEntryAttNormal and the other file or directory attributes.

TUint anEntrySortKey Flag indicating the order in which the entries are to be sorted. This flag is defined in TEntryKey.

CDir*& anEntryList On return contains a list of directory and file entries.

Return value

TInt KErrNone if successful, otherwise another of the system-wide error codes.

--------------------------------------------------------------------------------

上面介绍摘自Series 60 2.1 help。

主要使用方式就是用户给定一个path,也就是第一个参数const TDesC& aName,通过调用,该文件夹中的内容就会返回到第四个参数CDir*& anEntryList中,接下来这个list中存储的内容就是该文件夹下的文件信息,至于中间两个参数可以设置一些屏蔽信息,使得用户可以取出自己需要的文件信息。

查找相应文件:

-------------------------------------

TFindFile file_finder(aSession); // 1

CDir* file_list; // 2

TInt err = file_finder.FindWildByDir(aWildName,aScanDir, file_list); // 3

while (err==KErrNone)

{

TInt i;

for (i=0; iCount(); i++) // 4

{

TParse fullentry;

fullentry.Set((*file_list)[i].iName,& file_finder.File(),NULL); // 5,6,7

// Do something with the full Symbian OS filename

DoOneFile(aSession, fullentry.FullName()); // 8

}

delete file_list; // 9

err=file_finder.FindWild(file_list); // 10

上一页  1 2 3 4 5  下一页

Tags:Symbian OS 应用开发

编辑录入:coldstar [复制链接] [打 印]
赞助商链接