persistentstorage/sql/SRC/Server/SqlSrvFileData.cpp
branchRCL_3
changeset 11 211563e4b919
parent 9 667e88a979d7
child 23 26645d81f48d
equal deleted inserted replaced
10:31a8f755b7fe 11:211563e4b919
   190        KErrArgument, the database file name format is secure but the name does not contain SID.
   190        KErrArgument, the database file name format is secure but the name does not contain SID.
   191 
   191 
   192 @panic SqlDb 4 In _DEBUG mode. Invalid aFileNameArgNum value.
   192 @panic SqlDb 4 In _DEBUG mode. Invalid aFileNameArgNum value.
   193 @panic SqlDb 7 In _DEBUG mode. Invalid TSqlSrvFileData object. Not initialized system drive and path.
   193 @panic SqlDb 7 In _DEBUG mode. Invalid TSqlSrvFileData object. Not initialized system drive and path.
   194 */
   194 */
   195 void TSqlSrvFileData::SetL(const RMessage2& aMessage, TInt aFileNameLen, TInt aFileNameArgNum, const TDesC8* aConfigStr)
   195 void TSqlSrvFileData::SetL(const RMessage2& aMessage, TInt aFileNameLen, TInt aFileNameArgNum, 
       
   196 #ifdef SQLSRV_STARTUP_TEST
       
   197                            const TDesC& aDbFileName,
       
   198 #endif          
       
   199                            const TDesC8* aConfigStr)
   196 	{
   200 	{
   197 	__SQLASSERT((TUint)aFileNameArgNum < KMaxMessageArguments, ESqlPanicBadArgument);
   201 	__SQLASSERT((TUint)aFileNameArgNum < KMaxMessageArguments, ESqlPanicBadArgument);
   198 	__SQLASSERT(iSysDrivePrivatePath.DriveAndPath().Length() > 0, ESqlPanicInternalError);
   202 	__SQLASSERT(iSysDrivePrivatePath.DriveAndPath().Length() > 0, ESqlPanicInternalError);
   199 		
   203 		
   200 	if(aFileNameLen < 1 || aFileNameLen > KMaxFileName)
   204 	if(aFileNameLen < 1 || aFileNameLen > KMaxFileName)
   201 		{
   205 		{
   202 		__SQLLEAVE(KErrBadName);
   206 		__SQLLEAVE(KErrBadName);
   203 		}
   207 		}
   204 #ifdef SQLSRV_STARTUP_TEST
   208 #ifdef SQLSRV_STARTUP_TEST
   205 	aMessage.Int0();//prevents compiler warning
   209 	//To prevent compiler warning
   206 	aFileNameArgNum = aFileNameArgNum;//prevents compiler warning
   210 	aMessage.Int0();
   207 	iFileName.Copy(*(const TDesC*)aConfigStr);
   211 	aFileNameArgNum = aFileNameArgNum;
       
   212 	//
       
   213 	iFileName.Copy(aDbFileName);
   208 #else
   214 #else
   209 	aMessage.ReadL(aFileNameArgNum, iFileName);
   215 	aMessage.ReadL(aFileNameArgNum, iFileName);
   210 #endif	
   216 #endif	
   211 	SQLPROFILER_REPORT_IPC(ESqlIpcRead, (aFileNameLen * sizeof(TText)));
   217 	SQLPROFILER_REPORT_IPC(ESqlIpcRead, (aFileNameLen * sizeof(TText)));
   212 	TParse parsedFileName;
   218 	TParse parsedFileName;
   221 			__SQLLEAVE(KErrArgument);	
   227 			__SQLLEAVE(KErrArgument);	
   222 			}
   228 			}
   223 		::CreatePrivateDataPathL(iFs, iDrive);
   229 		::CreatePrivateDataPathL(iFs, iDrive);
   224 		}
   230 		}
   225 	iReadOnly = ::IsReadOnlyFileL(iFs, FileName());
   231 	iReadOnly = ::IsReadOnlyFileL(iFs, FileName());
   226 #ifndef SQLSRV_STARTUP_TEST
       
   227 	::ExtractConfigParamsL(aConfigStr, iConfigParams, iConfig);
   232 	::ExtractConfigParamsL(aConfigStr, iConfigParams, iConfig);
   228 #endif	
       
   229 	}
   233 	}
   230 
   234 
   231 /**
   235 /**
   232 1. Initializes iFileName with the database file name.
   236 1. Initializes iFileName with the database file name.
   233 2. Initializes iDrive.
   237 2. Initializes iDrive.