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() |
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 { |