本文整理汇总了C++中CDir::Sort方法的典型用法代码示例。如果您正苦于以下问题:C++ CDir::Sort方法的具体用法?C++ CDir::Sort怎么用?C++ CDir::Sort使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CDir
的用法示例。
在下文中一共展示了CDir::Sort方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: pj_symbianos_get_platform_info
/* Get platform info, returned format will be "Series60vX.X" */
unsigned pj_symbianos_get_platform_info(char *buf, unsigned buf_size)
{
/* OS info */
_LIT(KS60ProductIDFile, "Series60v*.sis");
_LIT(KROMInstallDir, "z:\\system\\install\\");
RFs fs;
TFindFile ff(fs);
CDir* result;
pj_str_t plat_info = {NULL, 0};
TInt err;
fs.Connect(1);
err = ff.FindWildByDir(KS60ProductIDFile, KROMInstallDir, result);
if (err == KErrNone) {
err = result->Sort(ESortByName|EDescending);
if (err == KErrNone) {
TPtr8 tmp_ptr8((TUint8*)buf, buf_size);
const pj_str_t tmp_ext = {".sis", 4};
char *p;
tmp_ptr8.Copy((*result)[0].iName);
pj_strset(&plat_info, buf, (pj_size_t)tmp_ptr8.Length());
p = pj_stristr(&plat_info, &tmp_ext);
if (p)
plat_info.slen -= (p - plat_info.ptr);
}
delete result;
}
fs.Close();
buf[plat_info.slen] = '\0';
return plat_info.slen;
}
示例2: GetPlatformVersionL
void CBrowserLauncher::GetPlatformVersionL(TUint& aMajor, TUint& aMinor) {
_LIT(KS60ProductIDFile, "Series60v*.sis");
_LIT(KROMInstallDir, "z:\\system\\install\\");
RFs aSession;
if(aSession.Connect() == KErrNone) {
CleanupClosePushL(aSession);
TFindFile aFindFile(aSession);
CDir* aResult;
if(aFindFile.FindWildByDir(KS60ProductIDFile, KROMInstallDir, aResult) == KErrNone) {
CleanupStack::PushL(aResult);
if(aResult->Sort(ESortByName|EDescending) == KErrNone) {
aMajor = (*aResult)[0].iName[9] - '0';
aMinor = (*aResult)[0].iName[11] - '0';
}
CleanupStack::PopAndDestroy(); // result
}
CleanupStack::PopAndDestroy(&aSession);
}
}
示例3: CleanupClosePushL
TBool XQAccessPointManagerPrivate::s60PlatformVersion(TUint& aMajor, TUint& aMinor) const
{
if (iPlatformVersionMajor != 0) {
aMajor = iPlatformVersionMajor;
aMinor = iPlatformVersionMinor;
return ETrue;
}
RFs fs;
if (fs.Connect() != KErrNone) {
return EFalse;
}
CleanupClosePushL(fs);
// Obtain the version number
TFindFile fileFinder = fs;
CDir* pResult;
_LIT(KS60ProductIDFile, "Series60v*.sis");
_LIT(KROMInstallDir, "z:\\system\\install\\");
if (fileFinder.FindWildByDir(KS60ProductIDFile, KROMInstallDir, pResult) != KErrNone) {
CleanupStack::PopAndDestroy(&fs);
return EFalse;
}
CleanupStack::PushL(pResult);
// Sort the file names so that the newest platforms are first
if (pResult->Sort(ESortByName | EDescending) != KErrNone) {
CleanupStack::PopAndDestroy(pResult);
CleanupStack::PopAndDestroy(&fs);
return EFalse;
}
// Parse the version numbers from the file name (e.g. Series60v3_1.sis)
aMajor = (*pResult)[0].iName[9] - '0';
aMinor = (*pResult)[0].iName[11] - '0';
CleanupStack::PopAndDestroy(pResult);
CleanupStack::PopAndDestroy(&fs);
iPlatformVersionMajor = aMajor;
iPlatformVersionMinor = aMinor;
return ETrue;
}
示例4: GetOsVersion
void CMyServer::GetOsVersion(OsVersion& aVersion)
{
TFindFile fileFinder = iFs;
CDir* result;
_LIT(KS60ProductIDFile, "Series60v*.sis");
_LIT(KROMInstallDir, "z:\\system\\install\\");
User::LeaveIfError(fileFinder.FindWildByDir(KS60ProductIDFile,
KROMInstallDir, result));
CleanupStack::PushL(result);
// Sort the file names so that the newest platforms are first
User::LeaveIfError(result->Sort(ESortByName | EDescending));
// Parse the version numbers from the file name (e.g. Series60v3_1.sis)
aVersion.iMajor = (*result)[0].iName[9] - '0';
aVersion.iMinor = (*result)[0].iName[11] - '0';
CleanupStack::PopAndDestroy(result);
}