|
1 // Copyright (c) 2004-2009 Nokia Corporation and/or its subsidiary(-ies). |
|
2 // All rights reserved. |
|
3 // This component and the accompanying materials are made available |
|
4 // under the terms of "Eclipse Public License v1.0" |
|
5 // which accompanies this distribution, and is available |
|
6 // at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
7 // |
|
8 // Initial Contributors: |
|
9 // Nokia Corporation - initial contribution. |
|
10 // |
|
11 // Contributors: |
|
12 // |
|
13 // Description: |
|
14 // RDbPropsFactory class |
|
15 // |
|
16 // |
|
17 |
|
18 #ifndef __SD_DBPROPS_H__ |
|
19 #define __SD_DBPROPS_H__ |
|
20 |
|
21 #include "D32DBMS.H" |
|
22 #include "D32Security.h" |
|
23 |
|
24 using namespace DBSC; |
|
25 |
|
26 /** |
|
27 This structure describes an object, which conatains |
|
28 database properties, which can be collected from a database path and format string. |
|
29 @internalComponent |
|
30 */ |
|
31 struct TDbProps |
|
32 { |
|
33 TDbPolicyRequest iDbPolicyRequest; |
|
34 TDriveNumber iDriveNumber; |
|
35 TFileName iPath; |
|
36 TDbName iFormatStr; |
|
37 }; |
|
38 |
|
39 /** |
|
40 RDbPropsFactory class is used to parse the supplied database path and format string and |
|
41 collect from them some database properties, such as requested access type, drive number, |
|
42 security policy uid, path, format string |
|
43 @internalComponent |
|
44 */ |
|
45 class RDbPropsFactory |
|
46 { |
|
47 public: |
|
48 static void StripCommonPart(TDes& aDbName); |
|
49 static void ConstructCommonPart(TUid aPolicyUid, TDes& aRes); |
|
50 RDbPropsFactory(RFs&); |
|
51 void OpenL(); |
|
52 void Close(); |
|
53 TDbProps* ExtractLC(const TDesC& aPath, const TDesC& aFormatStr); |
|
54 TDbProps* ExtractLC(const TDesC& aPath, TUid aPolicyUid); |
|
55 void GetPrivatePathL(TDriveNumber aDriveNumber, TDes& aRes) const; |
|
56 |
|
57 private: |
|
58 void ExtractSecureL(const TDesC& aFormatStr, TDbProps& aDbProps); |
|
59 void ExtractNonSecureL(const TDesC& aPath, const TDesC& aFormatStr, TDbProps& aDbProps); |
|
60 void ConstructFullDbPathL(TDbProps& aDbProps); |
|
61 void ConstructFormatString(TDbProps& aDbProps, const TDesC& aFormatStr); |
|
62 |
|
63 private: |
|
64 RFs& iFs; |
|
65 TParse* iFileNameParser; |
|
66 HBufC* iPrivateDataPath; |
|
67 |
|
68 }; |
|
69 |
|
70 #endif//__SD_DBPROPS_H__ |