当前位置: 首页>>代码示例>>C++>>正文


C++ CDesCArray::Find方法代码示例

本文整理汇总了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
    }
开发者ID:cdaffara,项目名称:symbiandump-mw2,代码行数:31,代码来源:EPos_CPosLmLocalDatabaseManager.cpp

示例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.
    }
开发者ID:cdaffara,项目名称:symbiandump-mw2,代码行数:37,代码来源:EPos_CPosLmLocalDatabaseManager.cpp

示例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 );
        }
    }
开发者ID:kuailexs,项目名称:symbiandump-mw3,代码行数:10,代码来源:X509CertNameParser.cpp

示例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--;
        }
    }
}
开发者ID:kuailexs,项目名称:symbiandump-mw2,代码行数:26,代码来源:EPos_CPosLmMultiDbSearch.cpp


注:本文中的CDesCArray::Find方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。