commsfwsupport/commselements/commsfw/src/cfutil.cpp
branchRCL_3
changeset 15 51722b10598b
parent 0 dfb7c4ff071f
child 21 07656293a99c
equal deleted inserted replaced
14:4ccf8e394726 15:51722b10598b
   436 	CDir* dir;
   436 	CDir* dir;
   437 	if(ff.FindWildByDir(aFileMask, aDir, dir) == KErrNone)
   437 	if(ff.FindWildByDir(aFileMask, aDir, dir) == KErrNone)
   438 		{
   438 		{
   439 		do 
   439 		do 
   440 			{
   440 			{
       
   441 			CleanupStack::PushL(dir);
   441 			const TInt cnt = dir->Count();
   442 			const TInt cnt = dir->Count();
   442 			for(TInt i = 0; i < cnt; ++i)
   443 			for(TInt i = 0; i < cnt; ++i)
   443 				{
   444 				{
   444 				const TEntry& entry = (*dir)[i];
   445 				const TEntry& entry = (*dir)[i];
   445 				fullEntry.Set(entry.iName, &ff.File(), NULL);      
   446 				fullEntry.Set(entry.iName, &ff.File(), NULL);      
   446 				AddL(TOwnEntry(fullEntry, entry));
   447 				AddL(TOwnEntry(fullEntry, entry));
   447 				}
   448 				}
   448 			delete dir;
   449 			CleanupStack::PopAndDestroy(dir);
   449 			}
   450 			}
   450 		while(ff.FindWild(dir) == KErrNone);
   451 		while(ff.FindWild(dir) == KErrNone);
   451 		}	
   452 		}	
   452 	fs.Pop();
   453 	fs.Pop();
   453 	}
   454 	}
   467 	fs.PushL();
   468 	fs.PushL();
   468 	TFindFile ff(fs.iObj);
   469 	TFindFile ff(fs.iObj);
   469 	TParse fullEntry;
   470 	TParse fullEntry;
   470 	CDir* dir;
   471 	CDir* dir;
   471 	RArray<TEntry> files;
   472 	RArray<TEntry> files;
       
   473 	CleanupClosePushL(files);
   472 	TBool found;
   474 	TBool found;
   473 	if(ff.FindWildByDir(aFileMask, aDir, dir) == KErrNone)
   475 	if(ff.FindWildByDir(aFileMask, aDir, dir) == KErrNone)
   474 		{
   476 		{
   475 		do 
   477 		do 
   476 			{
   478 			{
       
   479 			CleanupStack::PushL(dir);
   477 			const TInt cnt = dir->Count();
   480 			const TInt cnt = dir->Count();
   478 			for(TInt i = 0; i < cnt; ++i)
   481 			for(TInt i = 0; i < cnt; ++i)
   479 				{
   482 				{
   480 				const TEntry& entry = (*dir)[i];
   483 				const TEntry& entry = (*dir)[i];
   481 		               if(files.Count()!=0)
   484 				if(files.Count()!=0)
   482 				      {
   485 					{
   483 					found = EFalse;
   486 					found = EFalse;
   484 					for( TInt Index=0;Index<files.Count();Index++)
   487 					for( TInt Index=0;Index<files.Count();Index++)
   485 			    	           {
   488 						{
   486 						if(files[Index].iName.CompareF(entry.iName)==0)
   489 						if(files[Index].iName.CompareF(entry.iName)==0)
   487 						     {
   490 							{
   488 							found = ETrue;
   491 							found = ETrue;
   489 					             }
   492 							}
   490 				             }
   493 						}
   491 	                            if(!found)
   494 					if(!found)
   492 	    	                         {
   495 						{
   493 				    	   files.Append(entry);
   496 						files.Append(entry);
   494 					   fullEntry.Set(entry.iName, &ff.File(), NULL);      
   497 						fullEntry.Set(entry.iName, &ff.File(), NULL);      
   495 					   AddL(TOwnEntry(fullEntry, entry));
   498 						AddL(TOwnEntry(fullEntry, entry));
   496 				    	     }
   499 						}
   497 				       }
   500 					}
   498 		        	else
   501 				else
   499 			          {
   502 					{
   500 			           files.Append(entry);
   503 					files.Append(entry);
   501 				    fullEntry.Set(entry.iName, &ff.File(), NULL);      
   504 				    fullEntry.Set(entry.iName, &ff.File(), NULL);      
   502 				    AddL(TOwnEntry(fullEntry, entry));
   505 				    AddL(TOwnEntry(fullEntry, entry));
   503 				    }		
   506 				    }
   504 							
   507 				}
   505 		         }
   508 				CleanupStack::PopAndDestroy(dir);
   506 		     delete dir;
   509 			}
   507 			
   510 		while(ff.FindWild(dir) == KErrNone);
   508 	           }
   511 		}	
   509 	           while(ff.FindWild(dir) == KErrNone);
   512 	CleanupStack::PopAndDestroy(&files);
   510         	}	
       
   511 	files.Close();	
       
   512 	fs.Pop();
   513 	fs.Pop();
   513 	}
   514 	}
   514 
   515 
   515 //
   516 //
   516 // class RCFHeap
   517 // class RCFHeap