|
1 /* |
|
2 * Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). |
|
3 * All rights reserved. |
|
4 * This component and the accompanying materials are made available |
|
5 * under the terms of the License "Eclipse Public License v1.0" |
|
6 * which accompanies this distribution, and is available |
|
7 * at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
8 * |
|
9 * Initial Contributors: |
|
10 * Nokia Corporation - initial contribution. |
|
11 * |
|
12 * Contributors: |
|
13 * |
|
14 * Description: |
|
15 * database.h |
|
16 * CDatabaseManager - The main purpose of this class is to load the appropriate sqlite library. |
|
17 * Load the appropriate functions which are to be used by the CDatabase class to access the |
|
18 * sqlite library. The second functions of this class is to provide as an interface to receive |
|
19 * data which is to be updated via the CDatabase class. |
|
20 * |
|
21 */ |
|
22 |
|
23 |
|
24 /** |
|
25 @file |
|
26 @released |
|
27 @internalTechnology |
|
28 */ |
|
29 |
|
30 #ifndef SCRDBMANAGER_H |
|
31 #define SCRDBMANAGER_H |
|
32 |
|
33 #pragma warning(disable: 4786) |
|
34 |
|
35 #include "dbprocessor.h" |
|
36 #include "xmlparser.h" |
|
37 #include "./sqlite/sqlite3.h" |
|
38 |
|
39 #include <string> |
|
40 |
|
41 class CDbLayer |
|
42 { |
|
43 public: |
|
44 CDbLayer(const std::string& aDllPath, const std::string& aSqlDbName); |
|
45 ~CDbLayer(); |
|
46 void CreateScrDatabase(const std::vector<std::string>& aCreateDbQueries); |
|
47 void PopulateScrDatabase(const std::vector<XmlDetails::TScrEnvironmentDetails>& aScrEnvDetails); |
|
48 void PopulatePreProvisionDetails(const XmlDetails::TScrPreProvisionDetail& aPreProvisionDetailList); |
|
49 private: |
|
50 void CreateDatabase(const std::string& aDbFileName); |
|
51 |
|
52 void PopulateDatabase(const std::vector<XmlDetails::TScrEnvironmentDetails>& aScrEnvDetails); |
|
53 |
|
54 void AddPreProvisionDetails(const XmlDetails::TScrPreProvisionDetail& aPreProvisionDetailList); |
|
55 |
|
56 void AddComponentDetails(const XmlDetails::TScrPreProvisionDetail::TComponent& aComponent, const std::wstring& aSoftwareTypeName); |
|
57 |
|
58 int GetInstalledDrives(const std::vector<XmlDetails::TScrPreProvisionDetail::TComponentFile>& aComponentFiles ); |
|
59 |
|
60 void AddComponentLocalizables |
|
61 ( |
|
62 int aComponentId, |
|
63 const std::vector<XmlDetails::TScrPreProvisionDetail::TComponentLocalizable>& aComponentLocalizable |
|
64 ); |
|
65 |
|
66 void AddComponentProperties |
|
67 ( |
|
68 int aComponentId, |
|
69 const std::vector<XmlDetails::TScrPreProvisionDetail::TComponentProperty>& aComponentProperty |
|
70 ); |
|
71 |
|
72 void AddComponentFiles(int aComponentId, const std::vector<XmlDetails::TScrPreProvisionDetail::TComponentFile>& aComponentFiles); |
|
73 |
|
74 void AddComponentDependencies(int aComponentId, const XmlDetails::TScrPreProvisionDetail::TComponentDependency& aComponentDependency, const std::wstring& aSoftwareTypeName); |
|
75 |
|
76 void AddComponentDependency |
|
77 ( |
|
78 int aComponentId, |
|
79 const XmlDetails::TScrPreProvisionDetail::TComponentDependency::TComponentDependencyDetail& aComponentDependencyDetail |
|
80 ); |
|
81 |
|
82 void AddLocation(int aComponentId, const std::wstring& aLocation); |
|
83 |
|
84 void AddFileProperties(int aComponentId, const std::vector<XmlDetails::TScrPreProvisionDetail::TComponentFile::TFileProperty>& aFileProperty); |
|
85 |
|
86 void ExecuteStatement(const std::string& aStmtStr); |
|
87 |
|
88 const std::wstring GetLocalTime(); |
|
89 |
|
90 private: |
|
91 CDbProcessor* iScrDbHandler; |
|
92 |
|
93 }; |
|
94 |
|
95 #endif //SCRDBMANAGER_H |