1 /* |
1 /* |
2 * Copyright (c) 2009-2010 Nokia Corporation and/or its subsidiary(-ies). |
2 * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). |
3 * All rights reserved. |
3 * All rights reserved. |
4 * This component and the accompanying materials are made available |
4 * This component and the accompanying materials are made available |
5 * under the terms of the License "Eclipse Public License v1.0" |
5 * under the terms of the License "Eclipse Public License v1.0" |
6 * which accompanies this distribution, and is available |
6 * which accompanies this distribution, and is available |
7 * at the URL "http://www.eclipse.org/legal/epl-v10.html". |
7 * at the URL "http://www.eclipse.org/legal/epl-v10.html". |
47 COptions options(argc, argv); |
47 COptions options(argc, argv); |
48 |
48 |
49 std::string logFileName(options.GetLogFileName()); |
49 std::string logFileName(options.GetLogFileName()); |
50 std::auto_ptr<CLogger> logger(new CLogger(logFileName, options.GetLogLevel())); |
50 std::auto_ptr<CLogger> logger(new CLogger(logFileName, options.GetLogLevel())); |
51 |
51 |
52 #ifdef __LINUX__ |
52 std::string dllPath = "sqlite3.dll"; |
53 std::string dllPath = "sqlite-3.6.1.so"; |
|
54 #else |
|
55 std::string dllPath = "sqlite3.dll"; |
|
56 #endif |
|
57 |
|
58 std::auto_ptr<CDbLayer> db( new CDbLayer(dllPath, options.GetDbFileName())); |
53 std::auto_ptr<CDbLayer> db( new CDbLayer(dllPath, options.GetDbFileName())); |
59 std::auto_ptr<CScrXmlParser> xmlParser( new CScrXmlParser()); |
54 std::auto_ptr<CScrXmlParser> xmlParser( new CScrXmlParser()); |
60 |
55 |
61 if(options.IsDbAbsent()) |
56 if(options.IsDbAbsent()) |
62 { |
57 { |
63 #ifdef __LINUX__ |
|
64 std::string dbFileName = epocRootStr + "epoc32/tools/create_db.xml"; |
|
65 #else |
|
66 std::string dbFileName = epocRootStr + "epoc32\\tools\\create_db.xml"; |
58 std::string dbFileName = epocRootStr + "epoc32\\tools\\create_db.xml"; |
67 #endif |
|
68 |
|
69 std::auto_ptr<SchemaDetails> schema(xmlParser->ParseDbSchema(dbFileName)); |
59 std::auto_ptr<SchemaDetails> schema(xmlParser->ParseDbSchema(dbFileName)); |
70 db->CreateScrDatabase(*schema); |
60 db->CreateScrDatabase(*schema); |
71 } |
61 } |
72 |
62 |
73 std::vector<std::string> xmlFileNames = options.GetEnvFileNames(); |
63 std::vector<std::string> xmlFileNames = options.GetEnvFileNames(); |