First public contribution.
1 // Copyright (c) 2007-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.
25 #ifndef SYSCONFIGIMPL_H
26 #define SYSCONFIGIMPL_H
30 #include "uloggersysconfig.h"
31 #include <bsul/inifile.h>
32 #include "uloggershared.h"
39 NONSHARABLE_CLASS(CConfigSettingsImpl) : public CBase
42 /**Standard Symbian OS construction method.*/
43 static CConfigSettingsImpl* NewL();
45 TBool Next(TPtrC8& aSetting,TPtrC8& aSettingValue);
49 ~CConfigSettingsImpl();
51 friend class CConfigImpl;
52 CConfigSettingsImpl();
53 BSUL::CIniSecIter8* iIniSecIter;
57 NONSHARABLE_CLASS(CConfigImpl) : public CBase
60 static CConfigImpl* NewL(RHeap* aHeap,TFileName& aFilename);
63 // Allow Objects to register for configuration change notifications
66 TInt GetKeyValue(const TDesC8& aSectionName,const TDesC8& aKey,TPtrC8& aValue);
67 TInt GetSection(const TDesC8& aSectionName,CConfigSettingsIter& aSection);
68 TInt GetKeyCount(const TDesC8& aSectionName,TPtrC8& aLastKey);
71 TInt SetKeyValue(const TDesC8& aSectionName,const TDesC8& aKey, const TDesC8& aValue);
72 TInt RemoveKey(const TDesC8& aSectionName,const TDesC8& aKeyName);
73 TInt RemoveSection(const TDesC8& aSectionName);
76 TInt GetPointerToKeyName(const TDesC8& aSectionName,const TDesC8& aKeyName,TPtrC8& aKeyPointer);
77 TInt CheckValueExist(const TDesC8& aSectionName,const TDesC8& aValue,TInt& aKeyCount);
79 TInt PersistIniFile();
80 TInt GenerateInternalKey(const TDesC8& aSection,TBuf8<15>& aKeyName);
81 void GetSystemDrive(TDriveName& aSystemDrive);
84 CConfigImpl(RHeap* aHeap,TFileName& aFileName) :
85 iHeap(aHeap),iFileName(aFileName) {}
87 void LoadConfigFileL();
88 void GetConfigFileName(TFileName& aFileName);
91 /** Mutex for controlling write access */
93 /** Pointer to private heap */
95 /** Handle to file server */
97 /** Ini-file parser */
98 BSUL::CIniDocument8* iIniFileDocument;
105 #endif // SYSCONFIGIMPL_H