|
1 /* |
|
2 * Copyright (c) 2004-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 * processes command line parameters |
|
16 * |
|
17 */ |
|
18 |
|
19 |
|
20 /** |
|
21 @file |
|
22 @internalComponent |
|
23 @released |
|
24 */ |
|
25 |
|
26 #ifndef __PARAMETER_H__ |
|
27 #define __PARAMETER_H__ |
|
28 |
|
29 #ifndef __TOOLS2_LINUX__ |
|
30 #include <tchar.h> |
|
31 #endif // __TOOLS2_LINUX__ |
|
32 |
|
33 #include <string> |
|
34 #include "sissignaturealgorithm.h" |
|
35 #include "utility_interface.h" |
|
36 |
|
37 class CParameter |
|
38 { |
|
39 public: |
|
40 CParameter (); |
|
41 |
|
42 bool CommandLine (int argc, _TCHAR* argv[]); |
|
43 bool Sign () const; |
|
44 bool Unsign () const; |
|
45 bool Verbose () const; |
|
46 bool Report () const; |
|
47 bool Dump () const; |
|
48 const std::wstring& Sis () const; |
|
49 const std::wstring& Certificate () const; |
|
50 const std::wstring& Key () const; |
|
51 const std::wstring& PassPhrase () const; |
|
52 const std::wstring& Output () const; |
|
53 CSISSignatureAlgorithm::TAlgorithm Algorithm () const; |
|
54 |
|
55 /** |
|
56 Return the certificate extarct flag to which is set to true when -p is specified |
|
57 as command line option |
|
58 */ |
|
59 static bool ExtractCert(){return iExtractCert;} |
|
60 |
|
61 private: |
|
62 |
|
63 void ShowBanner (); |
|
64 std::string GetVersionInfo (char *aRequest); |
|
65 |
|
66 private: |
|
67 bool iSign; |
|
68 bool iUnsign; |
|
69 bool iReport; |
|
70 bool iVerbose; |
|
71 bool iDump; |
|
72 std::wstring iSISFileName; |
|
73 std::wstring iCertificate; |
|
74 std::wstring iKey; |
|
75 std::wstring iPassPhrase; |
|
76 std::wstring iOutput; |
|
77 CSISSignatureAlgorithm::TAlgorithm iAlgorithm; |
|
78 static bool iExtractCert; |
|
79 }; |
|
80 |
|
81 inline bool CParameter::Sign () const |
|
82 { |
|
83 return iSign; |
|
84 } |
|
85 |
|
86 inline bool CParameter::Unsign () const |
|
87 { |
|
88 return iUnsign; |
|
89 } |
|
90 |
|
91 inline bool CParameter::Verbose () const |
|
92 { |
|
93 return iVerbose; |
|
94 } |
|
95 |
|
96 inline bool CParameter::Report () const |
|
97 { |
|
98 return iReport; |
|
99 } |
|
100 |
|
101 inline const std::wstring& CParameter::Sis () const |
|
102 { |
|
103 return iSISFileName; |
|
104 } |
|
105 |
|
106 inline const std::wstring& CParameter::Certificate () const |
|
107 { |
|
108 return iCertificate; |
|
109 } |
|
110 |
|
111 inline const std::wstring& CParameter::Key () const |
|
112 { |
|
113 return iKey; |
|
114 } |
|
115 |
|
116 inline const std::wstring& CParameter::PassPhrase () const |
|
117 { |
|
118 return iPassPhrase; |
|
119 } |
|
120 |
|
121 inline const std::wstring& CParameter::Output () const |
|
122 { |
|
123 return iOutput; |
|
124 } |
|
125 |
|
126 inline CSISSignatureAlgorithm::TAlgorithm CParameter::Algorithm () const |
|
127 { |
|
128 return iAlgorithm; |
|
129 } |
|
130 |
|
131 inline bool CParameter::Dump () const |
|
132 { |
|
133 return iDump; |
|
134 } |
|
135 |
|
136 #endif // __PARAMETER_H__ |