1 /* |
|
2 * Copyright (c) 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 "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: This file contains the header file of the COutput. |
|
15 * |
|
16 */ |
|
17 |
|
18 #ifndef OUTPUT_H |
|
19 #define OUTPUT_H |
|
20 |
|
21 // INCLUDES |
|
22 |
|
23 #include "StifLogger.h" |
|
24 #include "LoggerTracing.h" |
|
25 |
|
26 // CONSTANTS |
|
27 // Maximum length of the event ranking |
|
28 const TInt KMaxEventRanking = 5; |
|
29 |
|
30 // Maximum length of the space |
|
31 const TInt KMaxSpace = 1; |
|
32 |
|
33 // Maximum length of the HTML line break('<BR>' + '\n') |
|
34 const TInt KMaxHtmlLineBreak = 6; |
|
35 |
|
36 // Maximum length of the line break(13 or '\' and 10 or 'n' in Symbian OS) |
|
37 const TInt KMaxLineBreak = 2; |
|
38 |
|
39 // MACROS |
|
40 // None |
|
41 |
|
42 // DATA TYPES |
|
43 // None |
|
44 |
|
45 // FUNCTION PROTOTYPES |
|
46 // None |
|
47 |
|
48 // FORWARD DECLARATIONS |
|
49 // None |
|
50 |
|
51 // CLASS DECLARATION |
|
52 |
|
53 // DESCRIPTION |
|
54 // COutput is a STIF Test Framework StifLogger class. |
|
55 // Class contains a file logging operations. |
|
56 |
|
57 class COutput |
|
58 :public CBase |
|
59 { |
|
60 public: // Enumerations |
|
61 |
|
62 private: // Enumerations |
|
63 |
|
64 public: // Constructors and destructor |
|
65 |
|
66 /** |
|
67 * Two-phased constructor. |
|
68 */ |
|
69 static COutput* NewL( const TDesC& aTestPath, |
|
70 const TDesC& aTestFile, |
|
71 CStifLogger::TLoggerType aLoggerType, |
|
72 CStifLogger::TOutput aOutput, |
|
73 TBool aOverWrite, |
|
74 TBool aWithTimeStamp, |
|
75 TBool aWithLineBreak, |
|
76 TBool aWithEventRanking, |
|
77 TBool aThreadIdToLogFile, |
|
78 TBool aCreateLogDir, |
|
79 TInt aStaticBufferSize, |
|
80 TBool aUnicode ); |
|
81 |
|
82 /** |
|
83 * Destructor. |
|
84 */ |
|
85 virtual ~COutput(); |
|
86 |
|
87 public: // New functions |
|
88 |
|
89 /** |
|
90 * C++ default constructor. |
|
91 */ |
|
92 COutput(); |
|
93 |
|
94 /** |
|
95 * Pure virtual. Write log information or data to the file. |
|
96 * 16 bit. |
|
97 */ |
|
98 virtual TInt Write( TBool /* aWithTimeStamp */, |
|
99 TBool /* aWithTimeLineBreak */, |
|
100 TBool /* aWithEventRanking */, |
|
101 const TDesC& /* aData */ ) = 0; |
|
102 |
|
103 /** |
|
104 * Pure virtual. Write log information or data to the file. |
|
105 * 8 bit. |
|
106 */ |
|
107 virtual TInt Write( TBool /* aWithTimeStamp */, |
|
108 TBool /* aWithTimeLineBreak */, |
|
109 TBool /* aWithEventRanking */, |
|
110 const TDesC8& /* aData */ ) = 0; |
|
111 |
|
112 /** |
|
113 * Return output type. |
|
114 */ |
|
115 inline TInt OutputCreationResult( CStifLogger::TOutput& aType ) |
|
116 { |
|
117 aType = iType; |
|
118 return iCreationResult; |
|
119 }; |
|
120 |
|
121 /** |
|
122 * Set output type. |
|
123 */ |
|
124 inline void SetOutputCreationResult( TInt aResult, |
|
125 CStifLogger::TOutput aType ) |
|
126 { |
|
127 iType = aType; |
|
128 iCreationResult = aResult; |
|
129 }; |
|
130 |
|
131 public: // Functions from base classes |
|
132 |
|
133 protected: // New functions |
|
134 |
|
135 protected: // Functions from base classes |
|
136 |
|
137 private: |
|
138 |
|
139 public: // Data |
|
140 |
|
141 protected: // Data |
|
142 // Output type |
|
143 CStifLogger::TOutput iType; |
|
144 TInt iCreationResult; |
|
145 |
|
146 private: // Data |
|
147 |
|
148 public: // Friend classes |
|
149 |
|
150 protected: // Friend classes |
|
151 |
|
152 private: // Friend classes |
|
153 |
|
154 }; |
|
155 |
|
156 #endif // OUTPUT_H |
|
157 |
|
158 // End of File |
|