|
1 /* |
|
2 * Copyright (c) 2009-2010 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: |
|
15 * Functions to read from the config file. |
|
16 * |
|
17 * |
|
18 */ |
|
19 |
|
20 #ifndef __CONFIG_H__ |
|
21 #define __CONFIG_H__ |
|
22 |
|
23 #include <e32def.h> |
|
24 #include <f32file.h> |
|
25 |
|
26 #include "globals.h" |
|
27 |
|
28 // Configuration file containing the URL for the server. Stored in private directory. |
|
29 _LIT(KConfigFile, "config.ini"); |
|
30 _LIT(KCfgTagUrl, "Url="); |
|
31 |
|
32 // Resume file fields |
|
33 _LIT(KRFieldWrapperDrive, "WrapperDrive="); |
|
34 _LIT(KRFieldBootstrap, "BootstrapVersion="); |
|
35 _LIT(KRFieldAppFileName, "AppFile="); |
|
36 _LIT(KRFieldDepFileName, "DepFile="); |
|
37 _LIT(KRFieldRootUid, "RootUid="); |
|
38 _LIT(KRFieldDepPkgs, "DepPkgs="); |
|
39 _LIT(KRFieldDepPkgUid, "DepPkgUid="); |
|
40 _LIT(KRFieldDepPkgStatus, "DepPkgStatus="); |
|
41 _LIT(KRFieldWrapperPkgUid, "WrapperPkgUid="); |
|
42 _LIT(KRFieldAppName, "AppName="); |
|
43 |
|
44 TInt WriteIntToConfigFile( RFile& aFile, const TDesC& aTag, const TUint32 aValue ); |
|
45 TInt WriteToConfigFile( RFile& aFile, const TDesC& aTag, const TDesC& aValue ); |
|
46 TInt EnsureNewLineAtEnd( RFile& aFile ); |
|
47 TInt ReadConfigFile( RFile& aFile, TDes& aBuffer, RArray< TPtrC >& aLineBuffer ); |
|
48 HBufC* ReadConfigFile( RFs& aFs, const TDesC& aFullPath, RArray< TPtrC >& aLineBuffer, TInt& aError ); |
|
49 TPtrC GetConfigValue( const TDesC& aTag, const RArray< TPtrC >& aLineBuffer, TInt& aError ); |
|
50 TInt CompareVersions( TVersion& version1,TVersion& version2 ); |
|
51 TBool SetVersion( const TDesC8& aVersionPtr, TVersion& aVer ); |
|
52 |
|
53 #endif |