TBool CCntServerCurrentItemMap::EntryAvailable(const TDesC& aDatabaseFile, TInt& aIndex) const { const TInt count = iCurrentItemMap.Count(); for(aIndex = 0; aIndex < count; aIndex++) { if (FileNamesIdentical(iCurrentItemMap[aIndex]->DatabaseFile(),aDatabaseFile)) return ETrue; } aIndex = KErrNotFound; return EFalse; }
void CSVPHostMountCB::ReplaceL(const TDesC& anOldName,const TDesC& aNewName) { DP(_L("** (SVPHOSTMNT) CSVPHostMountCB::ReplaceL()")); if(FileNamesIdentical(anOldName,aNewName)) { return; } TBuf<KMaxPath> oldName, newName; TUint driveNumber = Drive().DriveNumber(); CanonicalizePathname(anOldName, driveNumber, oldName); CanonicalizePathname(aNewName, driveNumber, newName); TSVPHostFsReplaceInfo info(driveNumber, oldName, newName); User::LeaveIfError(SVP_HOST_FS_DEVICE().Replace(info)); }
TBool CCntServerSpeedDialManager::DeleteTable(const TDesC& aDatabase) { const TInt count = iSpeedDials.Count(); for (TInt i = 0; i < count; i++) { CCntServerSpeedDialTable* table = iSpeedDials[i]; if (FileNamesIdentical(aDatabase,table->Database())) { iSpeedDials.Remove(i); delete table; // table has been deleted, cntmodel.ini file needs saving return ETrue; } } // no change return EFalse; }
// returns the speeddial table for the database or if it doesn't exist creates a table CCntServerSpeedDialTable& CCntServerSpeedDialManager::TableL(const TDesC& aDatabase) { TInt count = iSpeedDials.Count(); TInt index = KErrNotFound; for (TInt i=0; i<count; i++) { CCntServerSpeedDialTable* table = iSpeedDials[i]; if (FileNamesIdentical(aDatabase,table->Database())) { index = i; break; } } if (index==KErrNotFound) // the table doesn't exist yet { CCntServerSpeedDialTable* newTable = CCntServerSpeedDialTable::NewL(aDatabase); CleanupStack::PushL(newTable); User::LeaveIfError(iSpeedDials.Append(newTable)); CleanupStack::Pop(newTable); index = count; } return *(iSpeedDials[index]); }