|
1 /* |
|
2 * Copyright (c) 2007-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 * Cmdlinewriter class declaration. |
|
16 * @internalComponent |
|
17 * @released |
|
18 * |
|
19 */ |
|
20 |
|
21 |
|
22 #ifndef CMDLINEWRITER_H |
|
23 #define CMDLINEWRITER_H |
|
24 |
|
25 #include "reportwriter.h" |
|
26 #include "common.h" |
|
27 |
|
28 /** |
|
29 Constants for Cmd Line report section. |
|
30 */ |
|
31 const String KCmdHeader(" Executable Attribute Value Status"); |
|
32 const String KCmdLineDelimiter("-------------------------------------------------------------------------------"); |
|
33 const String KCmdHeaderNoStatus(" Executable Attribute Value "); |
|
34 const String KCmdLineDelimiterNoStatus("--------------------------------------------------"); |
|
35 const String KCmdImageName("Image Name: "); |
|
36 const String KCmdLine("Command line"); |
|
37 const int KCmdGenBufferSize=260; |
|
38 // width to fill the values displayed as 0x00000056 |
|
39 const unsigned int KCmdFormatEightWidth = 8; |
|
40 // width to print the attribute names |
|
41 const unsigned int KCmdFormatTwelveWidth = 12; |
|
42 // width to print the executable names and attribute names when executable name is not emitted |
|
43 const unsigned int KCmdFormatTwentyTwoWidth = 22; |
|
44 //width to print the status after the attribute values are printed for SID and VID |
|
45 const unsigned int KCmdFormatThirtyWidth = 30; |
|
46 // this check is taken for formatting the values (like SID and VID) other that the dependency names. |
|
47 const String KCmdDepName("Dependency"); |
|
48 const String KCmdDbgName("DBG"); |
|
49 const String KCmdDbgDisplayName("Debug Flag"); |
|
50 |
|
51 typedef std::stringstream OstrStream; |
|
52 |
|
53 /** |
|
54 class command line writer |
|
55 |
|
56 @internalComponent |
|
57 @released |
|
58 */ |
|
59 class CmdLineWriter: public ReportWriter |
|
60 { |
|
61 public: |
|
62 |
|
63 CmdLineWriter(unsigned int aInputOptions); |
|
64 ~CmdLineWriter(void); |
|
65 void StartReport(void); |
|
66 void EndReport(void); |
|
67 void StartImage(const String& aImageName); |
|
68 void EndImage(void); |
|
69 void StartExecutable(const unsigned int aSerNo, const String& aExeName); |
|
70 void EndExecutable(void); |
|
71 |
|
72 void FormatAndWriteElement(const String& aElement); |
|
73 void WriteExeAttribute(ExeAttribute& aOneSetExeAtt); |
|
74 void WriteDelimiter(void); |
|
75 void WriteNote(void); |
|
76 const String& ReportType(void); |
|
77 |
|
78 private: |
|
79 |
|
80 // Output streams for cmd line output. |
|
81 OstrStream iFormatMessage; |
|
82 // For Dependencies align. |
|
83 bool iForDepAlign; |
|
84 // For formating purpose. |
|
85 unsigned int iFormatSize; |
|
86 // Buffer pointer for formating purpose. |
|
87 char* iBuffer; |
|
88 //Hold the report type |
|
89 String iRptType; |
|
90 //Contains the input options |
|
91 unsigned int iCmdOptions; |
|
92 }; |
|
93 |
|
94 #endif // CMDLINEWRITER_H |