persistentstorage/sql/OsLayer/os_symbian.cpp
branchRCL_3
changeset 12 31a8f755b7fe
parent 10 fa9941cf3867
child 16 6b6fd149daa2
equal deleted inserted replaced
11:667e88a979d7 12:31a8f755b7fe
  1318 		}
  1318 		}
  1319 	return *(last + 1) == 0 ? EFhMainDbStr : EFhStr;
  1319 	return *(last + 1) == 0 ? EFhMainDbStr : EFhStr;
  1320 	}
  1320 	}
  1321 
  1321 
  1322 /**
  1322 /**
  1323 Replaces all invalid characters in aFileName.
  1323 Removes all invalid characters in aFileName.
  1324 If the file name contains handles (so that's a private secure database related name), the additional
  1324 If the file name contains handles (so that's a private secure database related name), the additional
  1325 information (handles, flags, object addresses) has to be excluded from the name in order to make it usable 
  1325 information (handles, flags, object addresses) has to be excluded from the name in order to make it usable 
  1326 by the file system.
  1326 by the file system. 
  1327 
  1327 
  1328 @param aFileName Output parameter. The cleaned file name will be copied there.
  1328 The private file name format is (see FhExtractAndStore() comments):
       
  1329 
       
  1330 "|<R/O flag><RMessage2 pointer><drive><app SID><file_name><file_ext>|"
       
  1331 
       
  1332 Before opening or creating a file, SQLite will call TVfs::FullPathName() passing to the function the name of
       
  1333 the file and expecting the full file name (including path) as an output from the function.
       
  1334 After the TVfs::FullPathName() call, the full file name, returned to SQLite, will have the following format:
       
  1335 
       
  1336 "|<drive><path><file_name><file_ext>|"
       
  1337 
       
  1338 FhConvertToFileName() is called from TVfs::Open() and will remove the leading and trialing '|' characters from
       
  1339 the file name.
       
  1340 
       
  1341 @param aFileName Input/Output parameter. The cleaned file name will be copied there.
  1329 @param aPrivateDir The SQL server private data cage.
  1342 @param aPrivateDir The SQL server private data cage.
  1330 
  1343 
  1331 @see TVfs::Open()
  1344 @see TVfs::Open()
  1332 @see TFhStrType
  1345 @see TFhStrType
  1333 @see FhStringProps()
  1346 @see FhStringProps()
  1350 			}
  1363 			}
  1351 		}
  1364 		}
  1352 	}
  1365 	}
  1353 
  1366 
  1354 /**
  1367 /**
  1355 Extracts the read-only flag and RMessage address from aDbFileName and stores them in single COsLayerData instance.
  1368 Extracts the read-only flag and RMessage address from aDbFileName and stores them in the single COsLayerData instance.
  1356 
  1369 
  1357 @param aDbFileName Input/output parameter. The file name. 
  1370 @param aDbFileName Input/output parameter. The file name. 
  1358 				   It will be reformatted and won't contain the already extracted data.
  1371 				   It will be reformatted and won't contain the already extracted data.
  1359 				   The aDbFileName format is:
  1372 				   The aDbFileName format is:
  1360 @code
  1373 @code
  2233 		err = msg != NULL ? TVfs::DoOpenFromHandle(dbFile, *msg, readOnly) : KErrGeneral;
  2246 		err = msg != NULL ? TVfs::DoOpenFromHandle(dbFile, *msg, readOnly) : KErrGeneral;
  2234 		}
  2247 		}
  2235 	else
  2248 	else
  2236 		{
  2249 		{
  2237 		if(fhStrType == EFhStr)
  2250 		if(fhStrType == EFhStr)
  2238 			{//Not the main db file. Replace invalid characters in the file name
  2251 			{//Not the main db file. Remove invalid characters in the file name
  2239 			::FhConvertToFileName(fname, osLayerData.iSysPrivDir);//If fname does not have a path, iSysPrivDir will be used
  2252 			::FhConvertToFileName(fname, osLayerData.iSysPrivDir);//If fname does not have a path, iSysPrivDir will be used
  2240 			}
  2253 			}
  2241 		TInt fmode = EFileRead;
  2254 		TInt fmode = EFileRead;
  2242 		if(aFlags & SQLITE_OPEN_READWRITE)
  2255 		if(aFlags & SQLITE_OPEN_READWRITE)
  2243 			{
  2256 			{