本文整理汇总了C++中TDesC::FindF方法的典型用法代码示例。如果您正苦于以下问题:C++ TDesC::FindF方法的具体用法?C++ TDesC::FindF怎么用?C++ TDesC::FindF使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TDesC
的用法示例。
在下文中一共展示了TDesC::FindF方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: MalformedPath
TBool CStateDownload::MalformedPath(const TDesC& aPath)
{
_LIT(KErr1,".\\"); //this is usually a typo, e.g "E.\" instead of "E:\"
_LIT(KErr2,"\\*\\"); //this is simply a stupid request, as in "\*\"
if((aPath.FindF(KErr1) != KErrNotFound) || (aPath.FindF(KErr2) != KErrNotFound))
return ETrue;
else
return EFalse;
}
示例2: IsFileScheme
// -----------------------------------------------------------------------------
// CWidgetUiObserver::IsFileScheme
// -----------------------------------------------------------------------------
//
TBool CWidgetUiObserver::IsFileScheme( const TDesC& aFileName )
{
if ( aFileName.Length()> 0 && aFileName.Ptr() )
{
if ( aFileName.FindF(KFileScheme) == 0 )
{
return ETrue;
}
else
{//Check for paths are that not URI, but of the form..
// c:/dir/foo.txt. This is to accomodate browser engine inconsistencies.
TUriParser16 parser;
if( parser.Parse( aFileName ) == KErrNone )
{
TPtrC16 scheme = parser.Extract( EUriScheme );
// As per the URI RFC, the part before : is the Scheme
if ( scheme.Length() == (KMaxDriveName-1) )
{
return ETrue;
}
}
}
}
return EFalse;
}
示例3: IsFileScheme
TBool CBrCtlApiTestObserver::IsFileScheme(const TDesC& aFileName)
{
_LIT(KFileScheme, "file://");
if (aFileName.Length() > 0 && aFileName.Ptr() != NULL)
{
if (aFileName.FindF(KFileScheme) == 0)
{
return ETrue;
}
}
return EFalse;
}
示例4:
// ---------------------------------------------------------
// CBrCtlSampleAppLinkResolver::IsFileScheme
// ---------------------------------------------------------
//
TBool
CBrCtlSampleAppLinkResolver::IsFileScheme(const TDesC& aFileName)
{
_LIT(KFileScheme, "file://");
if (aFileName.Length() > 0 && aFileName.Ptr() != NULL)
{
if (aFileName.FindF(KFileScheme) == 0)
{
return ETrue;
}
}
return EFalse;
}
示例5: PrintDiskUsage
void PrintDiskUsage(RFs& aFs, const TDesC& aPath, TInt aOffset = 0)
{
_LIT(KSpace, " ");
TheTest.Printf(_L("%*.*S%S\r\n"), aOffset, aOffset, &KSpace, &aPath);
TFindFile findFile(aFs);
CDir* fileNameCol = NULL;
TBuf<8> fileNameMask;
fileNameMask.Copy(_L("*.*"));
TInt err = findFile.FindWildByDir(fileNameMask, aPath, fileNameCol);
if(err == KErrNone)
{
do
{
const TDesC& file = findFile.File();//"file" variable contains the drive and the path. the file name in "file" is invalid in this case.
(void)TheParse.Set(file, NULL, NULL);
TPtrC driveName = TheParse.Drive();
if(aPath.FindF(driveName) >= 0)
{
TInt cnt = fileNameCol->Count();
for(TInt i=0;i<cnt;++i)
{
const ::TEntry& entry = (*fileNameCol)[i];
if(!entry.IsDir())
{
TheTest.Printf(_L("%*.*S %S, size=%d\r\n"), aOffset, aOffset, &KSpace, &entry.iName, entry.iSize);
}
else
{
TBuf<100> path;
path.Copy(aPath);
path.Append(entry.iName);
path.Append(_L("\\"));
PrintDiskUsage(aFs, path, aOffset + 4);
}
}
} // if(aPath.FindF(driveName) >= 0)
delete fileNameCol;
fileNameCol = NULL;
} while((err = findFile.FindWild(fileNameCol)) == KErrNone);//Get the next set of files
}
else
{
TheTest.Printf(_L(" FindWildByDir() failed with err=%d\r\n"), err);
}
}
示例6: IsPrivatePathInFileName
/**
@return ETrue if the aDbFileName argument contains aPrivatePath as a first directory in the file path, EFalse otherwise.
@internalComponent
*/
static TBool IsPrivatePathInFileName(const TDesC& aDbFileName, const TDesC& aPrivatePath)
{
TInt pos = aDbFileName.FindF(aPrivatePath);
return (TUint)pos <= (TUint)KMaxDriveName;
}
示例7: StoreAttributesL
// ---------------------------------------------------------
// CNSmlDsProvisioningAdapter::StoreAttributesL
// ---------------------------------------------------------
void CNSmlDsProvisioningAdapter::StoreAttributesL( const TDesC& aType )
{
_DBG_FILE("CNSmlDsProvisioningAdapter::StoreAttributesL(): begin");
TInt iDataProvElementCount = iProfiles[iProfiles.Count()-1]->iDataProvElement.Count()-1;
// Leave if aType cannot be assigned
if( ( aType.Length() > 0 ) &&
( iProfiles[iProfiles.Count()-1]->iDataProvElement[iDataProvElementCount]->iRemoteDBUri ) )
{
TBool dataProvIdFoundInZ = FALSE;
TSmlDataProviderId firstDataProvIdFound = 0;
TSmlDataProviderId uidFound = 0;
TBool doSearch = ETrue;
if ( aType.FindF( KXVcardMimeType ) != KErrNotFound )
{
if ( IsOperatorProfile( *iProfiles[iProfiles.Count()-1] ) )
{
const CNSmlDsProfileElement& profile = *iProfiles[iProfiles.Count()-1];
StoreOperatorUrlL( *profile.iHostAddress );
// Do not make a search through adapter implementations
doSearch = EFalse;
uidFound = OperatorAdapterUid();
if ( !uidFound )
{
// If OperatorAdapterUid returns 0, do a search
doSearch = ETrue;
}
}
}
// look through every implementation adapter until one found
// which supports MIME type in question
// The first one located in ROM is chosen. If none found in ROM then
// the first adapter found is chosen.
HBufC8 *type = HBufC8::NewLC(aType.Size());
TPtr8 typePtr = type->Des();
CnvUtfConverter::ConvertFromUnicodeToUtf8( typePtr, aType);
// get list of dataproviderIds
RImplInfoPtrArray implArray;
CleanupStack::PushL( PtrArrCleanupItemRArr( CImplementationInformation, &implArray ) );
TUid ifUid = { KNSmlDSInterfaceUid };
REComSession::ListImplementationsL( ifUid, implArray );
if ( doSearch )
{
TInt countProviders = implArray.Count();
for( TInt i = 0; i < countProviders; i++ )
{
CImplementationInformation* implInfo = implArray[i];
RSyncMLDataProvider dataProvider;
dataProvider.OpenL( iSession, implInfo->ImplementationUid().iUid );
CleanupClosePushL( dataProvider );
TInt mimeTypeCount = dataProvider.MimeTypeCount();
for( TInt j = 0; j < mimeTypeCount; j++ )
{
HBufC* mimeType = dataProvider.MimeType( j ).AllocLC();
TPtrC8 convMimeType = ConvertTo8LC( *mimeType );
if( typePtr.Find( convMimeType ) == 0)
{
// MIME type in question was found
uidFound = implInfo->ImplementationUid().iUid;
if( firstDataProvIdFound == 0 )
{
// save the first in case of none found from ROM
firstDataProvIdFound = uidFound;
}
// check whether the provider is located in ROM (drive Z)
if( implInfo->Drive() == EDriveZ )
{
dataProvIdFoundInZ = TRUE;
}
}
CleanupStack::PopAndDestroy(2); // mimetype, ConvertTo8LC
if( uidFound )
{
break;
}
}
CleanupStack::PopAndDestroy(); // dataProvider
if ( dataProvIdFoundInZ )
{
break;
}
else
{
//.........这里部分代码省略.........