|
1 /* |
|
2 * Copyright (c) 2006 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: DEBUG utilities, for DEBUG version only |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 |
|
20 |
|
21 #ifndef simpledebugutils_H |
|
22 #define simpledebugutils_H |
|
23 |
|
24 #include <e32std.h> |
|
25 #include <s32file.h> |
|
26 |
|
27 // FORWARD DECLARATION |
|
28 class RFs; |
|
29 class RFileReadStream; |
|
30 |
|
31 #ifdef _DEBUG |
|
32 |
|
33 //********************************** |
|
34 // TSimpleLogger |
|
35 //********************************** |
|
36 class TSimpleLogger |
|
37 { |
|
38 public: |
|
39 static void Log(TRefByValue<const TDesC> aFmt,...); //lint !e960 |
|
40 static void Dump( const TDesC8& aData, RFs& aFs, TInt aMode ); |
|
41 }; |
|
42 |
|
43 #endif // _DEBUG |
|
44 |
|
45 //********************************** |
|
46 // CSimpleSettingFile |
|
47 // Constructor and destructor must be present in DEBUG version |
|
48 // also in order to keep ordinal numbers identical between UDEB |
|
49 // and UREL versions, although this class is used in UDEB method only. |
|
50 //********************************** |
|
51 class CSimpleSettingFile: public CBase |
|
52 { |
|
53 public: |
|
54 |
|
55 virtual ~CSimpleSettingFile(); |
|
56 |
|
57 #ifdef _DEBUG |
|
58 |
|
59 /** |
|
60 * Constructor. |
|
61 */ |
|
62 static CSimpleSettingFile* NewL( |
|
63 RFs& aFs ); |
|
64 |
|
65 /** |
|
66 * Opens a file. It is closed in destructor! |
|
67 */ |
|
68 void OpenL( TDesC& aResFile ); |
|
69 |
|
70 /** |
|
71 * Get the key value. Leave with KErrNotFound if not found. |
|
72 */ |
|
73 TPtrC8 KeyValueL( const TDesC8& aKey ); |
|
74 |
|
75 #endif // _DEBUG |
|
76 |
|
77 private: |
|
78 CSimpleSettingFile( RFs& aFs ); |
|
79 #ifdef _DEBUG |
|
80 void ReadRowL( TPtrC8& aKey, TPtrC8& aValue ); |
|
81 #endif // _DEBUG |
|
82 |
|
83 private: |
|
84 // Data |
|
85 RFs& iFs; |
|
86 RFileReadStream iReader; |
|
87 TBuf8<128> iRowBuffer; |
|
88 TFileName iFileName; |
|
89 TBool iOpen; |
|
90 }; |
|
91 |
|
92 #endif // simpledebugutils_H |
|
93 |
|
94 // End of File |