|
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 // |
|
15 |
|
16 /** |
|
17 @file |
|
18 @internalTechnology |
|
19 */ |
|
20 |
|
21 #if !defined(__CINIFILE_H__) |
|
22 #define __CINIFILE_H__ |
|
23 |
|
24 #include <e32base.h> |
|
25 #include "dbdef.h" |
|
26 |
|
27 /** |
|
28 Macro for build independent literal ADD_SECTION |
|
29 */ |
|
30 #define BEGIN_ADD _L("ADD_SECTION") |
|
31 |
|
32 /** |
|
33 Macro for build independent literal ADD_SECTION |
|
34 */ |
|
35 #define BEGIN_TEMPLATE _L("ADD_TEMPLATE") |
|
36 |
|
37 /** |
|
38 Macro for build independent literal ADD_SECTION |
|
39 */ |
|
40 #define BEGIN_SET _L("SET_SECTION") |
|
41 |
|
42 /** |
|
43 Macro for build independent literal END_ADD |
|
44 */ |
|
45 #define END_ADD _L("END_ADD") |
|
46 |
|
47 /** |
|
48 Macro for build independent literal END_TEMPLATE |
|
49 */ |
|
50 #define END_TEMPLATE _L("END_TEMPLATE") |
|
51 |
|
52 /** |
|
53 Macro for build independent literal END_SET |
|
54 */ |
|
55 #define END_SET _L("END_SET") |
|
56 |
|
57 /** |
|
58 Macro for build independent literal SET_CONDITION |
|
59 */ |
|
60 #define CONDITION _L("SET_CONDITION") |
|
61 |
|
62 /** |
|
63 Macro for build independent literal FIELD_COUNT |
|
64 */ |
|
65 #define FIELD_COUNT _L("FIELD_COUNT") |
|
66 |
|
67 #define E_UNKNOWN 0 |
|
68 |
|
69 #define E_ADD 1 |
|
70 |
|
71 #define E_SET 2 |
|
72 |
|
73 #define E_TEMPLATE 3 |
|
74 |
|
75 class LinkByTagResolver; |
|
76 |
|
77 NONSHARABLE_CLASS(CIniData) : public CBase |
|
78 /** |
|
79 @internalComponent |
|
80 */ |
|
81 { |
|
82 friend class LinkByTagResolver; |
|
83 public: |
|
84 // Constructor, pass in name of CFG file to open, relative to RAM root |
|
85 static CIniData* NewL(const TDesC& aName); |
|
86 virtual ~CIniData(); |
|
87 |
|
88 // methods for enumerating through ADD or SET sections |
|
89 // within a particular section |
|
90 TInt OpenSetBlock(const TDesC &aSection); |
|
91 TInt OpenTemplateBlock(const TDesC &aSection); |
|
92 TInt OpenAddBlock(const TDesC &aSection); |
|
93 TInt StepToNextBlock(); |
|
94 TInt GetSetting(const TDesC &aValue, TPtrC & aSetting); |
|
95 |
|
96 protected: |
|
97 CIniData(); |
|
98 |
|
99 private: |
|
100 HBufC* iName; |
|
101 HBufC* iToken; |
|
102 TPtr iPtr; |
|
103 TPtr section; |
|
104 TPtr block; |
|
105 TInt BlockState; |
|
106 TInt blockStart; |
|
107 TInt blockEnd; |
|
108 TInt scanStart; |
|
109 |
|
110 TInt OpenBlock(const TDesC &aSection); |
|
111 void ConstructL(const TDesC& aName); |
|
112 }; |
|
113 |
|
114 #endif |