当前位置: 代码迷 >> Symbian >> 关于文件后缀名的获取解决方法
  详细解决方案

关于文件后缀名的获取解决方法

热度:2801   发布时间:2013-02-26 00:00:00.0
关于文件后缀名的获取
CDesCArray* array = static_cast <CDesCArray*>(model->ItemTextArray()); 

RFs fs;
User::LeaveIfError(fs.Connect());
CleanupClosePushL( fs );
_LIT(KDir,"c:\\*");
_LIT(KS,"\t%S");
TFileName aKs;

CDir* dirList;
fs.GetDir(KDir,KEntryAttNormal,ESortByName,dirList);

for(TInt i=0;i<dirList->Count();i++)
{
aKs.Format(KS,&(*dirList)[i].iName);
array->AppendL(aKs);}
我能否判断后缀然后再放入列表


______________________


我从列表项中取出字符串后怎样才能判断后缀名

谢谢

------解决方案--------------------------------------------------------
const TEntry e = (*dirList)[i];

下面是TEntry 的方法。

IMPORT_C TBool IsSystem() const;
IMPORT_C TBool IsDir() const;
IMPORT_C TBool IsArchive() const;
public:
/**
The individual bits within this byte indicate which attributes
have been set.

@see KEntryAttNormal
@see KEntryAttReadOnly
@see KEntryAttHidden
@see KEntryAttSystem
*/
TUint iAtt;


/**
The size of the file in bytes.
*/
TInt iSize;


/**
The system time of last modification, in universal time.
*/
TTime iModified;


/**
The file's UIDtype
*/
TUidType iType;


/**
The name of the file relative to the owning directory,
with a maximum of KMaxFileName characters.

@see KMaxFileName
*/
TBufC<KMaxFileName> iName;
  相关解决方案