本文整理汇总了C++中CDesCArray::Find方法的典型用法代码示例。如果您正苦于以下问题:C++ CDesCArray::Find方法的具体用法?C++ CDesCArray::Find怎么用?C++ CDesCArray::Find使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CDesCArray
的用法示例。
在下文中一共展示了CDesCArray::Find方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: SynchronizeRegistryL
// ---------------------------------------------------------
// CPosLmLocalDatabaseManager::SynchronizeRegistryL
//
// (other items were commented in a header).
// ---------------------------------------------------------
//
void CPosLmLocalDatabaseManager::SynchronizeRegistryL()
{
RPointerArray<HPosLmDatabaseInfo> databaseInfoArray(KPosDbListGranularity);
CleanupStack::PushL(TCleanupItem(CleanupRPointerArray, &databaseInfoArray));
// list URIs
CDesCArray* dbUriArray = ListDatabasesLC();
// list registered databases
Session().ListDatabasesL(databaseInfoArray, KFileProtocol);
// unregister database which cannot be found on disk
for (TInt i = databaseInfoArray.Count() - 1; i >= 0; i--)
{
TInt index;
TPtrC registeredUri = databaseInfoArray[i]->DatabaseUri();
if (dbUriArray->Find(registeredUri, index) != 0)
{
// unregister database
User::LeaveIfError(Session().UnregisterDatabase(registeredUri,
DatabaseDrive(registeredUri)));
}
}
CleanupStack::PopAndDestroy(2, &databaseInfoArray); // dbUriArray
}
示例2: ListDatabasesL
// ---------------------------------------------------------
// CPosLmLocalDatabaseManager::ListDatabasesL
//
// (other items were commented in a header).
// ---------------------------------------------------------
//
void CPosLmLocalDatabaseManager::ListDatabasesL(
RPointerArray<HPosLmDatabaseInfo>& aDatabaseInfoArray)
{
// list URIs
CDesCArray* dbUriArray = ListDatabasesLC();
// list registered databases
Session().ListDatabasesL(aDatabaseInfoArray, KFileProtocol);
// delete from URI list those databases that are registered
for (TInt i = aDatabaseInfoArray.Count() - 1; i >= 0; i--)
{
TInt index;
if (dbUriArray->Find(aDatabaseInfoArray[i]->DatabaseUri(), index) == 0)
{
dbUriArray->Delete(index);
}
}
// for each remaining URI in the list, fill in database info
// and add to list
TInt count = dbUriArray->Count();
for (TInt i = 0; i < count; i++)
{
HPosLmDatabaseInfo* info = HPosLmDatabaseInfo::NewLC((*dbUriArray)[i]);
aDatabaseInfoArray.AppendL(info);
CleanupStack::Pop(info); // transfer of ownership to array
}
CleanupStack::PopAndDestroy(dbUriArray);
// database drive, database media and default flag
// will be filled in by database management provider.
}
示例3: Find
void X509CertNameParser::CompareAndAddNameL( const TDesC& aProposal,
CDesCArray& aNameArray )
{
TInt pos = 0; // This is needed only for calling Find().
// Append to array, if aProposal don't already exist in the array.
if ( aNameArray.Find( aProposal, pos, ECmpNormal ) )
{
aNameArray.AppendL( aProposal );
}
}
示例4: CloseDbsNotToSearch
// -----------------------------------------------------------------------------
// CPosLmMultiDbSearch::CloseDbsNotToSearch
//
// (other items were commented in a header).
// -----------------------------------------------------------------------------
//
void CPosLmMultiDbSearch::CloseDbsNotToSearch(const CDesCArray& aDatabaseList)
{
// Close any dbs not in databaseList
for (TInt i = 0; i < iSearchItems.Count(); i++)
{
HBufC* searchItemUri = iSearchItems[i]->iDbUriPtr;
// Does uri exist in databaseList?
TInt pos;
TInt foundUri = aDatabaseList.Find(*searchItemUri, pos, ECmpNormal);
if (foundUri != 0)
{
CPosLmMultiDbSearchItem* item = iSearchItems[i];
iSearchItems.Remove(i);
delete item;
i--;
}
}
}