|
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 * COptions - Used to parse command liine options. |
|
16 * |
|
17 */ |
|
18 |
|
19 |
|
20 /** |
|
21 @file |
|
22 @released |
|
23 @internalTechnology |
|
24 */ |
|
25 |
|
26 #ifndef DBOPTIONS_H |
|
27 #define DBOPTIONS_H |
|
28 |
|
29 #pragma warning(disable: 4786) |
|
30 |
|
31 #include "logs.h" |
|
32 #include <string> |
|
33 #include <vector> |
|
34 |
|
35 class COptions |
|
36 { |
|
37 public: |
|
38 COptions(int aParamsCount, char** aParams); |
|
39 ~COptions(); |
|
40 |
|
41 public: |
|
42 std::string GetLogFileName(); |
|
43 CLogger::TLogLevel GetLogLevel(); |
|
44 std::string GetDbFileName(); |
|
45 std::vector<std::string> GetEnvFileNames(); |
|
46 std::string GetPrePovisionFileName(); |
|
47 bool IsDbAbsent(); |
|
48 bool IsPreProvisionInfoAvailable(); |
|
49 |
|
50 private: |
|
51 void ValidateOptions(int aParamsCount, char** aParams); |
|
52 void DisplayDetailedUsage(); |
|
53 void DisplayUsage(); |
|
54 void DisplayVersion(); |
|
55 void SetLogLevel(const char* aLogLevel); |
|
56 void CheckParamExists(int aParamsCount, int aCurrentCount); |
|
57 bool IsFileAbsent(const char* aFileName); |
|
58 |
|
59 private: |
|
60 bool iDbExist; |
|
61 bool iLoggingEnabled; |
|
62 bool iPreProvisionUpdate; |
|
63 std::vector<std::string> iXmlFileNames; |
|
64 std::string iPreProvisionFileName; |
|
65 std::string iScrDbName; |
|
66 CLogger::TLogLevel iLogLevel; |
|
67 std::string iLogFileName; |
|
68 |
|
69 private: |
|
70 static std::string iCurrentVersion; |
|
71 static std::string iDescription; |
|
72 static std::string iCopyright; |
|
73 static std::string iUsage; |
|
74 static std::string iGeneralInfo; |
|
75 }; |
|
76 |
|
77 #endif //DBOPTIONS_H |