First public contribution.
1 // Copyright (c) 2005-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".
8 // Initial Contributors:
9 // Nokia Corporation - initial contribution.
14 // Ini file parser header file
38 class CIniSecIter8Impl;
40 Section iterator for 8 bit ini file. This class provides an iterator
41 to navigate through the settings within a section inside an 8 bit ini file.
43 NONSHARABLE_CLASS(CIniSecIter8): public CBase
46 IMPORT_C static CIniSecIter8* NewL(const TDesC8& aSectionName,const CIniDocument8* aIniDocument);
47 IMPORT_C ~CIniSecIter8();
49 IMPORT_C TBool Next(TPtrC8& aKey,TPtrC8& aValue);
51 IMPORT_C void Reset();
54 CIniSecIter8Impl* iImpl;
57 class CIniDocument8Impl;
59 Dom parser for 8 bit ini file. This class provides the functionality to read
60 and write settings of an 8 bit ini file.
62 NONSHARABLE_CLASS(CIniDocument8): public CBase
65 IMPORT_C static CIniDocument8* NewL(RFs& aFs,const TDesC& aFileName);
66 IMPORT_C ~CIniDocument8();
67 IMPORT_C TInt Externalise(const TDesC& aFileName);
70 IMPORT_C TInt GetSectionList(RArray<TPtrC8>& aSectionList) const;
71 IMPORT_C TInt GetKeyValue(const TDesC8& aSectionName,const TDesC8& aKey,TPtrC8& aValue) const;
74 IMPORT_C TInt AddSection(const TDesC8& aSectionName);
75 IMPORT_C TInt RemoveSection(const TDesC8& aSectionName);
76 IMPORT_C TInt SetKey(const TDesC8& aSectionName,const TDesC8& aKey,const TDesC8& aValue);
77 IMPORT_C TInt RemoveKey(const TDesC8& aSectionName,const TDesC8& aKey);
78 IMPORT_C TBool CompareDocs(CIniDocument8& aDoc);
80 friend class CIniSecIter8Impl;
82 CIniDocument8Impl* iImpl;
85 class CIniSecIter16Impl;
87 Section iterator for 16 bit ini file. This class provides an iterator
88 to navigate through the settings within a section inside an 16 bit ini file.
90 NONSHARABLE_CLASS(CIniSecIter16): public CBase
93 IMPORT_C static CIniSecIter16* NewL(const TDesC16& aSectionName,const CIniDocument16* aIniDocument);
94 IMPORT_C ~CIniSecIter16();
96 IMPORT_C TBool Next(TPtrC16& aKey,TPtrC16& aValue);
98 IMPORT_C void Reset();
101 CIniSecIter16Impl* iImpl;
104 class CIniDocument16Impl;
106 Dom parser for 16 bit ini file. This class provides the functionality to read
107 and write settings of an 16 bit ini file.
109 NONSHARABLE_CLASS(CIniDocument16): public CBase
112 IMPORT_C static CIniDocument16* NewL(RFs& aFs,const TDesC& aFileName);
113 IMPORT_C ~CIniDocument16();
114 IMPORT_C TInt Externalise(const TDesC& aFileName);
117 IMPORT_C TInt GetSectionList(RArray<TPtrC16>& aSectionList) const;
118 IMPORT_C TInt GetKeyValue(const TDesC16& aSectionName,const TDesC16& aKey,TPtrC16& aValue) const;
121 IMPORT_C TInt AddSection(const TDesC16& aSectionName);
122 IMPORT_C TInt RemoveSection(const TDesC16& aSectionName);
123 IMPORT_C TInt SetKey(const TDesC16& aSectionName,const TDesC16& aKey,const TDesC16& aValue);
124 IMPORT_C TInt RemoveKey(const TDesC16& aSectionName,const TDesC16& aKey);
125 IMPORT_C TBool CompareDocs(CIniDocument16& aDoc);
127 friend class CIniSecIter16Impl;
129 CIniDocument16Impl* iImpl;
134 A light weight parser for reading setting values from an 8 bit ini file. Note that this does not
135 guarantee checking that the ini file is wellformed. See CIniFile16 for a class that handles both
138 NONSHARABLE_CLASS(CIniFile8): public CBase
141 IMPORT_C static CIniFile8* NewL(RFs& aFs,const TDesC& aFileName);
142 IMPORT_C ~CIniFile8();
143 IMPORT_C TInt FindVar(const TDesC8& aSectionName,const TDesC8& aKeyName,TPtrC8& aValue) const;
146 CIniFile8Impl* iImpl;
149 class CIniFile16Impl;
151 A light weight parser for reading setting values from a 16 or 8 bit ini file. The aConvert8To16
152 parameter of NewL controls whether or not 8 bit files are accepted. Note that this does
153 not guarantee checking that the ini file is wellformed.
155 NONSHARABLE_CLASS(CIniFile16): public CBase
158 IMPORT_C static CIniFile16* NewL(RFs& aFs,const TDesC& aFileName);
159 IMPORT_C static CIniFile16* NewL(RFs& aFs,const TDesC& aFileName,TBool aConvert8To16);
160 IMPORT_C ~CIniFile16();
161 IMPORT_C TInt FindVar(const TDesC16& aSectionName,const TDesC16& aKeyName,TPtrC16& aValue) const;
164 CIniFile16Impl* iImpl;