|
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 * |
|
16 */ |
|
17 |
|
18 |
|
19 /** |
|
20 @file |
|
21 @internalComponent |
|
22 @released |
|
23 */ |
|
24 |
|
25 #ifndef __OPTIONS_H__ |
|
26 #define __OPTIONS_H__ |
|
27 |
|
28 #include <iomanip> |
|
29 |
|
30 using std::ostream; |
|
31 |
|
32 int const MajorVersion=1; |
|
33 int const MinorVersion=2; |
|
34 int const BuildVersion=0; |
|
35 /** |
|
36 Exceptions raised while processing the command line |
|
37 @internalComponent |
|
38 */ |
|
39 enum CmdLineException |
|
40 { |
|
41 ECmdLineUnknownOption, |
|
42 ECmdLineMissingSIS, |
|
43 ECmdLineMultipleSIS, |
|
44 ECmdLineNoDirArgument, |
|
45 ECmdLineDirIsFile, |
|
46 ECmdLineNoPermission, |
|
47 ECmdLineInvalidDir, |
|
48 ECmdLineOtherDirFailure, |
|
49 ECmdLineMissingParamFile, |
|
50 ECmdLineInvalidSystemDrive, |
|
51 ECmdLineNoSisArgument, |
|
52 ECmdLineMissingParams |
|
53 }; |
|
54 |
|
55 /** |
|
56 Contains the command line options |
|
57 @internalComponent |
|
58 */ |
|
59 class Options |
|
60 { |
|
61 public: |
|
62 Options(int argc, wchar_t** argv); |
|
63 |
|
64 static void DisplayError (CmdLineException err); |
|
65 static void DisplayUsage (); |
|
66 static void DisplayVersion (); |
|
67 |
|
68 bool Verbose () const { return iVerboseFlag; } |
|
69 bool Version () const { return iVersion; } |
|
70 bool ExtractFiles () const { return iExtractFilesFlag; } |
|
71 bool PauseOnExit () const { return iPauseOnExit; } |
|
72 |
|
73 /** |
|
74 Return the iList exe flag to which is set to true when -l is specified |
|
75 as command line option |
|
76 @return Flag status of list option |
|
77 */ |
|
78 bool Listexe() const { return iList; } |
|
79 |
|
80 /** |
|
81 Return the iCreateECI flag to which is set to true when -l -y is specified |
|
82 as command line option |
|
83 @return Flag status of createECI |
|
84 */ |
|
85 bool CreateECI() const { return iCreateECI; } |
|
86 |
|
87 |
|
88 static const char* CommandName () { return "DumpSIS"; } |
|
89 |
|
90 const std::wstring& SISFileName () const { return iSISFileName; } |
|
91 const std::wstring& ExtractDirectory() { return iExtractDirectory; } |
|
92 |
|
93 private: |
|
94 void GetExtractDir(); |
|
95 |
|
96 private: |
|
97 bool iVerboseFlag; |
|
98 bool iVersion; |
|
99 bool iHelpFlag; |
|
100 bool iExtractFilesFlag; |
|
101 bool iPauseOnExit; |
|
102 bool iList; |
|
103 bool iCreateECI; |
|
104 std::wstring iSISFileName; |
|
105 std::wstring iExtractDirectory; |
|
106 }; |
|
107 |
|
108 #endif /* __OPTIONS_H__ */ |