|
1 // Copyright (c) 1997-2009 Nokia Corporation and/or its subsidiary(-ies). |
|
2 // All rights reserved. |
|
3 // This component and the accompanying materials are made available |
|
4 // under the terms of "Eclipse Public License v1.0" |
|
5 // which accompanies this distribution, and is available |
|
6 // at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
7 // |
|
8 // Initial Contributors: |
|
9 // Nokia Corporation - initial contribution. |
|
10 // |
|
11 // Contributors: |
|
12 // |
|
13 // Description: |
|
14 // Local CTestIniData class, derived from CIniData.lib |
|
15 // |
|
16 // |
|
17 |
|
18 #if !defined(__CTESTINIDATA_H__) |
|
19 #define __CTESTINIDATA_H__ |
|
20 |
|
21 #include <e32base.h> |
|
22 |
|
23 enum TTestIniPanic |
|
24 { |
|
25 ESectionNameTooBig, |
|
26 EKeyNameTooBig, |
|
27 }; |
|
28 |
|
29 class CTestIniData : public CBase |
|
30 { |
|
31 public: |
|
32 // Constructor, pass in name of ini file to open |
|
33 // Default search path is 'c:\system\data' on target filesystem |
|
34 // ie. 'NewL(_L("c:\\system\\data\\ttools.ini"))' is equivalent |
|
35 // to 'NewL(_L("ttools.ini"))' |
|
36 static CTestIniData* NewL(const TDesC& aName); |
|
37 virtual ~CTestIniData(); |
|
38 |
|
39 // Panic |
|
40 void Panic(TTestIniPanic aPanic); |
|
41 |
|
42 // Read text value reguardless of section |
|
43 // Returns: True(Success) or false(Failure) |
|
44 TBool FindVar(const TDesC &aKeyName, // Key to look for |
|
45 TPtrC &aResult); // Buffer to store value |
|
46 |
|
47 // Read integer value reguardless of section |
|
48 // Returns: True(Success) or false(Failure) |
|
49 TBool FindVar(const TDesC &aKeyName, // Key to look for |
|
50 TInt &aResult); // Int ref to store result |
|
51 |
|
52 // Read text value under section |
|
53 // Returns: True(Success) or false(Failure) |
|
54 TBool FindVar(const TDesC &aSection, // Section to look under |
|
55 const TDesC &aKeyName, // Key to look for |
|
56 TPtrC &aResult); // Buffer to store result |
|
57 |
|
58 // Read integer value under section |
|
59 // Returns: True(Success) or false(Failure) |
|
60 TBool FindVar(const TDesC &aSection, // Section to look under |
|
61 const TDesC &aKeyName, // Key to look for |
|
62 TInt &aResult); // Int ref to store result |
|
63 |
|
64 protected: |
|
65 CTestIniData(); |
|
66 void ConstructL(const TDesC& aName); |
|
67 private: |
|
68 HBufC* iName; |
|
69 HBufC* iToken; |
|
70 TPtr iPtr; |
|
71 }; |
|
72 |
|
73 #endif |