|
1 /* |
|
2 * Copyright (c) 2008 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 "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: Header for ChspsLiwDump. |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef HSPS_LIWDUMP_H |
|
20 #define HSPS_LIWDUMP_H |
|
21 |
|
22 // INCLUDES |
|
23 #include <e32std.h> |
|
24 #include <e32base.h> |
|
25 #include <liwservicehandler.h> |
|
26 |
|
27 // FORWARD DECLARATIONS |
|
28 class ChspsLogBus; |
|
29 class ChspsByteBuffer; |
|
30 |
|
31 // CLASS DECLARATION |
|
32 |
|
33 /** |
|
34 * Helper class for dumping LIW to logging bus. |
|
35 * |
|
36 * @lib hspsTools.lib |
|
37 * @since S60 5.0 |
|
38 * @ingroup group_homescreenpluginservice_tools |
|
39 */ |
|
40 class ChspsLiwDump : public CBase |
|
41 { |
|
42 public: |
|
43 /** |
|
44 * Destructor. |
|
45 */ |
|
46 IMPORT_C ~ChspsLiwDump(); |
|
47 |
|
48 /** |
|
49 * Two-phased constructor. |
|
50 * |
|
51 * @since S60 5.0 |
|
52 * @param aLogBus ChspsLogBus to be used as output channel. |
|
53 */ |
|
54 IMPORT_C static ChspsLiwDump* NewL( ChspsLogBus& aLogBus ); |
|
55 |
|
56 /** |
|
57 * Two-phased constructor. |
|
58 * |
|
59 * @since S60 5.0 |
|
60 * @param aLogBus ChspsLogBus to be used as output channel. |
|
61 */ |
|
62 IMPORT_C static ChspsLiwDump* NewLC( ChspsLogBus& aLogBus ); |
|
63 |
|
64 /** |
|
65 * Write liw list as binary to specified log bus. |
|
66 * |
|
67 * @since S60 5.0 |
|
68 * @param aLiwList A list to be printed. |
|
69 */ |
|
70 IMPORT_C void LogLiwListAsText( CLiwGenericParamList& aLiwList ); |
|
71 |
|
72 /** |
|
73 * Write liw list as binary to specified log bus. |
|
74 * |
|
75 * @since S60 5.0 |
|
76 * @param aLiwList A list to be printed. |
|
77 */ |
|
78 IMPORT_C void LogLiwListAsBinary( CLiwGenericParamList& aLiwList ); |
|
79 |
|
80 private: |
|
81 |
|
82 /** |
|
83 * Constructor for performing 1st stage construction |
|
84 * |
|
85 * @param aLogBus ChspsLogBus to be used as output channel. |
|
86 */ |
|
87 ChspsLiwDump( ChspsLogBus& aLogBus ); |
|
88 |
|
89 /** |
|
90 * EPOC default constructor for performing 2nd stage construction |
|
91 */ |
|
92 void ConstructL(); |
|
93 |
|
94 /** |
|
95 * Write liw list as binary to specified log bus. |
|
96 * |
|
97 * @param aLiwList A list to be printed. |
|
98 */ |
|
99 void LogLiwListAsTextL( CLiwGenericParamList& aLiwList ); |
|
100 |
|
101 /** |
|
102 * Write liw list as binary to specified log bus. |
|
103 * |
|
104 * @param aLiwList A list to be printed. |
|
105 */ |
|
106 void LogLiwListAsBinaryL( CLiwGenericParamList& aLiwList ); |
|
107 |
|
108 /** |
|
109 * Parses the variant type. |
|
110 * |
|
111 * @param value Variant to be printed. |
|
112 */ |
|
113 void PrintVariantL( TLiwVariant value ); |
|
114 |
|
115 /** |
|
116 * Prints liw map. |
|
117 * |
|
118 * @param value Map variant to be printed. |
|
119 */ |
|
120 void PrintMapL( TLiwVariant value ); |
|
121 |
|
122 /** |
|
123 * Prints liw string variant. |
|
124 * |
|
125 * @param value String variant to be printed. |
|
126 */ |
|
127 void PrintStringL( TLiwVariant value ); |
|
128 |
|
129 /** |
|
130 * Prints liw string variant. 8 bit variant. |
|
131 * |
|
132 * @param value String variant to be printed. |
|
133 */ |
|
134 void PrintString8L( TLiwVariant value ); |
|
135 |
|
136 /** |
|
137 * Prints liw list variant. |
|
138 * |
|
139 * @param value List variant to be printed. |
|
140 */ |
|
141 void PrintListL( TLiwVariant value ); |
|
142 |
|
143 /** |
|
144 * Appends indentation (delimiters) to the line of text. 8 bit variant. |
|
145 * |
|
146 * @param aText text to be printed. |
|
147 * @param aDepth intendation depth. |
|
148 * @param aDelim delimiter character or string. |
|
149 */ |
|
150 HBufC8* GetFixedText8LC( const TDesC8& aText, |
|
151 const TInt aDepth, |
|
152 const TDesC8& aDelim ); |
|
153 |
|
154 /** |
|
155 * Appends indentation (delimiters) to the line of text. |
|
156 * |
|
157 * @param aText text to be printed. |
|
158 * @param aDepth intendation depth. |
|
159 * @param aDelim delimiter character or string. |
|
160 */ |
|
161 HBufC* GetFixedTextLC( const TDesC& aText, |
|
162 const TInt aDepth, |
|
163 const TDesC& aDelim ); |
|
164 |
|
165 /** |
|
166 * Appends indentation (delimiters) to the line of text. |
|
167 * |
|
168 * @param aBuffer ChspsByteBuffer instance containing |
|
169 * source data for byte buffer. |
|
170 * @return HBufC* Created c++ array. |
|
171 */ |
|
172 HBufC* CreateCPlusPlusDumpL( ChspsByteBuffer& aBuffer ) const; |
|
173 |
|
174 private: |
|
175 /** |
|
176 * Log bus to be used. |
|
177 */ |
|
178 ChspsLogBus& iLogBus; |
|
179 |
|
180 /** |
|
181 * Depth level of indentation. |
|
182 */ |
|
183 TInt iDepth; |
|
184 }; |
|
185 |
|
186 #endif // HSPS_LIWDUMP_H |