|
1 /* |
|
2 * Copyright (c) 2007-2007 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 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef JAVAINIFILEUTILS_H |
|
20 #define JAVAINIFILEUTILS_H |
|
21 |
|
22 #include <string> |
|
23 #include "javaosheaders.h" |
|
24 |
|
25 |
|
26 namespace java |
|
27 { |
|
28 namespace util |
|
29 { |
|
30 |
|
31 class FileContent |
|
32 { |
|
33 public: |
|
34 FileContent(char* content) : mContent(content) {} |
|
35 ~FileContent() |
|
36 { |
|
37 delete mContent; |
|
38 mContent = 0; |
|
39 } |
|
40 char* getContent() |
|
41 { |
|
42 return mContent; |
|
43 } |
|
44 |
|
45 private: |
|
46 char* mContent; |
|
47 }; |
|
48 |
|
49 const char* const PREWARM = "Prewarm"; |
|
50 const char* const UI_PREWARM = "Uiprewarm"; |
|
51 const char* const PREWARM_CAPTAIN_CONTROL = "PrewarmCaptainControl"; |
|
52 const char* const START_SCREEN_ENABLED = "StartScreenEnabled"; |
|
53 const char* const SIMPLE_START_SCREEN = "SimpleStartScreen"; |
|
54 const char* const START_SCREEN_SKIN_ENABLED = "StartScreenSkinEnabled"; |
|
55 const char* const START_SCREEN_UPDATE_INTERVAL = "StartScreenUpdateInterval"; |
|
56 |
|
57 class JavaIniFileUtils |
|
58 { |
|
59 public: |
|
60 OS_IMPORT static int getProperty(const std::string& property); |
|
61 OS_IMPORT static void setProperty(const std::string& property, int value); |
|
62 |
|
63 public: |
|
64 |
|
65 private: |
|
66 static FileContent readFileContent(bool create=false); |
|
67 static void writeFileContent(const char* content); |
|
68 static char* getPosition(FileContent& content, const std::string& property); |
|
69 |
|
70 }; |
|
71 |
|
72 } //end namespace util |
|
73 } //end namespace java |
|
74 |
|
75 #endif // JAVAINIFILEUTILS_H |
|
76 |