Chinaunix首页 | 论坛 | 博客
  • 博客访问: 523573
  • 博文数量: 1344
  • 博客积分: 3000
  • 博客等级: 中校
  • 技术积分: 14890
  • 用 户 组: 普通用户
  • 注册时间: 2010-06-14 20:31
文章分类

全部博文(1344)

文章存档

2010年(1344)

我的朋友

分类:

2010-10-08 19:28:42

  遍历symbian某目录下的所有文件应该是symbian中常用到的功能模块,比如你想写一个类似“程序管理器”的程序,那么首先的任务就是要先知道某目录下到底有那些文件,然后再筛选出你所需要的文件。   遍历symbian某目录下的所有文件有两种方法   ① 我们首先学习点预备知识   查看sdk help中的getdir()方法,你会看到如下的内容:   getdir()   tint getdir(const tdesc& aname,tuint anentryattmask,tuint anentrysortkey, cdir*& anentrylist) const;   description   gets a filtered list of a directory's contents. the bitmask determines which file and directory entry types should be listed. the sort key determines the order in which they are listed.   注释:   得到一个目录下内容的过滤列表。   anentryattmask决定哪个文件和目录应该被列出。   anentrysortkey决定这些内容按照什么顺序列出。   notes:   if sorting by uid (esortbyuid is or'ed with the entry sort key), then uid information will be included in the listing whether or not kentryattallowuid is specified in anentryattmask.(如果按照uid排序,即anentrysortkey参数的值定义为esortbyuid。那么uid信息将被包含在列表中不管anentryattmask参数是否定义了kentryattallowuid)   the function sets anentrylist to null, then allocates memory for it before appending entries to the list. therefore, anentrylist should have no memory allocated to it before this function is called, otherwise this memory will become orphaned.(这个函数把anentrylist参数设置为null,然后在添加文件项到列表之前为anentrylist分配内存空间。因此,该函数调用之前anentrylist应该没有分配内存,否则这部分内存会变成而被遗弃) 如果喜欢遍历symbian某目录下的所有文件请收藏或告诉您的好朋友.
阅读(100) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~