// --------------------------------------------------------------------------- // NSPUtil::SortCandidatesL // --------------------------------------------------------------------------- // void NSPUtil::SortCandidatesL( RPointerArray<CNATFWCandidate>& aLocalCands ) { __ASSERT_ALWAYS( &aLocalCands, User::Leave( KErrArgument ) ); __ASSERT_ALWAYS( aLocalCands.Count(), User::Leave( KErrArgument ) ); TLinearOrder<CNATFWCandidate> order( CNATFWCandidate::PriorityOrder ); aLocalCands.Sort( order ); }
EXPORT_C void CEnvironment::GetKeysL(RPointerArray<HBufC>& aResult) const { WaitLC(); aResult.ResetAndDestroy(); TStringHashIter<HBufC*> iter(iConstVars); while (iter.NextValue() != NULL) { if (*iter.CurrentValue() != NULL) { HBufC* key = iter.CurrentKey()->AllocLC(); aResult.AppendL(key); CleanupStack::Pop(key); } } if (iParentEnv) { RPointerArray<HBufC> parentKeys; LtkUtils::CleanupResetAndDestroyPushL(parentKeys); iParentEnv->GetKeysL(parentKeys); for (TInt i = parentKeys.Count()-1; i >= 0; i--) { HBufC* key = parentKeys[i]; if (iConstVars.Find(*key) == NULL) { // Only add stuff in parent that isn't also in ours aResult.AppendL(key); parentKeys.Remove(i); } } CleanupStack::PopAndDestroy(&parentKeys); } // Make sure the resulting array is alphabetic, as RStringHash doesn't guarantee that (unlike RVarSet) aResult.Sort(TLinearOrder<HBufC>(&StringCompare)); CleanupStack::PopAndDestroy(); // Release lock }