landmarks/locationlandmarks/dbreg/src/EPos_CPosLmDbRegistry.cpp
changeset 18 3825cf2dc8c2
parent 0 667063e416a2
equal deleted inserted replaced
1:788b770ce3ae 18:3825cf2dc8c2
   106     const TDesC& aFileName)
   106     const TDesC& aFileName)
   107     {
   107     {
   108     User::LeaveIfError(iDb.Create(aFileSession, aFileName));
   108     User::LeaveIfError(iDb.Create(aFileSession, aFileName));
   109 
   109 
   110     TDeleteFile* del = new (ELeave) TDeleteFile;
   110     TDeleteFile* del = new (ELeave) TDeleteFile;
   111     CleanupStack::PushL(del);
       
   112     del->iFs = &aFileSession;
   111     del->iFs = &aFileSession;
   113     del->iFilename.Set(aFileName);
   112     del->iFilename.Set(aFileName);
   114 
   113 
   115     CleanupStack::PushL(TCleanupItem(DeleteFileCleanupItem, del));
   114     CleanupStack::PushL(TCleanupItem(DeleteFileCleanupItem, del));
   116     CleanupClosePushL(iDb);
       
   117 
   115 
   118     //Create the database table
   116     //Create the database table
   119     CDbColSet* columns = CDbColSet::NewLC();
   117     CDbColSet* columns = CDbColSet::NewLC();
   120 
   118 
   121     columns->AddL(TDbCol(KPosLmProtocolCol, EDbColText, KProtocolMaxLength));
   119     columns->AddL(TDbCol(KPosLmProtocolCol, EDbColText, KProtocolMaxLength));
   132     sql->Des().Format(KPosSqlCreateIndex, &KPosLmDbRegIndex,
   130     sql->Des().Format(KPosSqlCreateIndex, &KPosLmDbRegIndex,
   133                   &KPosLmDbRegistryTable, &KPosLmProtocolCol);
   131                   &KPosLmDbRegistryTable, &KPosLmProtocolCol);
   134     User::LeaveIfError(iDb.Execute(*sql));
   132     User::LeaveIfError(iDb.Execute(*sql));
   135     CleanupStack::PopAndDestroy(sql);
   133     CleanupStack::PopAndDestroy(sql);
   136 
   134 
   137     CleanupStack::Pop(&iDb);
   135     CleanupStack::PopAndDestroy(&del); //DeleteFileCleanupItem
   138     CleanupStack::Pop(); //DeleteFileCleanupItem
       
   139     CleanupStack::PopAndDestroy(del);
       
   140     }
   136     }
   141 
   137 
   142 // -----------------------------------------------------------------------------
   138 // -----------------------------------------------------------------------------
   143 // CPosLmDbRegistry::Open
   139 // CPosLmDbRegistry::Open
   144 // (other items were commented in a header).
   140 // (other items were commented in a header).