|
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 "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 #ifndef CPOSPSYCRLOG_H |
|
21 #define CPOSPSYCRLOG_H |
|
22 |
|
23 // INCLUDES |
|
24 #include <e32base.h> |
|
25 #include <f32file.h> |
|
26 |
|
27 // S60 3.0 |
|
28 |
|
29 // CONSTANTS |
|
30 _LIT(KDelim, "********************************************************************\r\n"); |
|
31 |
|
32 _LIT(KInfoMessage, "Info: "); |
|
33 _LIT(KWarningMessage, "Warning: "); |
|
34 _LIT(KErrorMessage, "Error: "); |
|
35 |
|
36 _LIT(KNewLine, "\r\n"); |
|
37 const TInt KSummaryBufSize = 120; |
|
38 const TInt KMaxNumberSize = 10; |
|
39 |
|
40 // CLASS DECLARATION |
|
41 |
|
42 /** |
|
43 * Class that handles logging of test results to file. |
|
44 */ |
|
45 class CPosPSYCRLog : public CBase |
|
46 { |
|
47 public: // Constructors and destructor |
|
48 |
|
49 /** |
|
50 * C++ default constructor. |
|
51 */ |
|
52 CPosPSYCRLog(); |
|
53 |
|
54 /** |
|
55 * Two-phased constructor. |
|
56 */ |
|
57 static CPosPSYCRLog* NewL(); |
|
58 |
|
59 /** |
|
60 * Destructor. |
|
61 */ |
|
62 virtual ~CPosPSYCRLog(); |
|
63 |
|
64 public: // New functions |
|
65 |
|
66 void OpenLogL(TUid aUid); |
|
67 |
|
68 void CloseLog(); |
|
69 |
|
70 void AppendInfoMsgL(TDesC &aMsg); |
|
71 void AppendWarningMsgL(TDesC &aMsg); |
|
72 void AppendErrorMsgL(TDesC &aMsg); |
|
73 |
|
74 |
|
75 private: |
|
76 |
|
77 /** |
|
78 * By default EPOC constructor is private. |
|
79 */ |
|
80 void ConstructL(); |
|
81 |
|
82 void AppendLineL( |
|
83 /* IN */ const TDesC& aLine |
|
84 ); |
|
85 |
|
86 void AppendLineL( |
|
87 /* IN */ const TInt aNumber |
|
88 ); |
|
89 |
|
90 // By default, prohibit copy constructor |
|
91 CPosPSYCRLog( const CPosPSYCRLog& ); |
|
92 |
|
93 // Prohibit assigment operator |
|
94 CPosPSYCRLog& operator= ( const CPosPSYCRLog& ); |
|
95 |
|
96 private: // Data |
|
97 |
|
98 RFile iCurrentLogFile; |
|
99 RFs iFileSession; |
|
100 TInt iCurrentPosition; |
|
101 TInt iInfo; |
|
102 TInt iWarning; |
|
103 TInt iError; |
|
104 |
|
105 }; |
|
106 |
|
107 #endif // CPOSPSYLOG_H |
|
108 |
|
109 // End of File |