|
1 /* |
|
2 * Copyright (c) 2005-2009 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 * Switches |
|
16 * |
|
17 */ |
|
18 |
|
19 |
|
20 |
|
21 #ifndef __CDYNAMICSCONFIGFILE_H__ |
|
22 #define __CDYNAMICSCONFIGFILE_H__ |
|
23 |
|
24 /****************************************************************************************************** |
|
25 * |
|
26 * System Includes |
|
27 * |
|
28 *****************************************************************************************************/ |
|
29 #include <string> |
|
30 using namespace std; |
|
31 |
|
32 |
|
33 /****************************************************************************************************** |
|
34 * |
|
35 * Types |
|
36 * |
|
37 *****************************************************************************************************/ |
|
38 typedef enum { |
|
39 // These values must precisely match FUE_ errors |
|
40 DCE_NONE, |
|
41 DCE_READ_ERROR, |
|
42 DCE_WRITE_ERROR, |
|
43 DCE_OPEN_ERROR, |
|
44 DCE_OPEN_TEMP_ERROR, |
|
45 DCE_OPEN_SOURCE_ERROR, // 5 |
|
46 DCE_RENAME_ERROR, |
|
47 DCE_END_OF_FILE, |
|
48 |
|
49 // These are specific errors |
|
50 DCE_INVALID_STATE, |
|
51 DCE_COPY_ERROR, |
|
52 DCE_MULTIPLE_MATCHES, // 10 |
|
53 DCE_START_TAG_NOT_FOUND, |
|
54 DCE_MULTIPLE_START_TAGS_FOUND, |
|
55 DCE_END_TAG_NOT_FOUND, |
|
56 DCE_MULTIPLE_END_TAGS_FOUND, |
|
57 DCE_ENTRY_NOT_FOUND, // 15 |
|
58 } TDCFError; |
|
59 |
|
60 typedef enum { |
|
61 DCS_INIT, |
|
62 DCS_REFERENCE_FILE_SET, |
|
63 DCS_ACTIVE_LOCAL_COPY, |
|
64 } TDCFStatus; |
|
65 |
|
66 |
|
67 /****************************************************************************************************** |
|
68 * |
|
69 * class CDynamicsConfigFile |
|
70 * |
|
71 *****************************************************************************************************/ |
|
72 class CDynamicsConfigFile |
|
73 { |
|
74 public: |
|
75 CDynamicsConfigFile(); |
|
76 ~CDynamicsConfigFile(); |
|
77 |
|
78 // Management |
|
79 TDCFError SetReferenceFile( string aReferenceFile ); |
|
80 TDCFError CreateLocalCopy( int *aSystemError ); |
|
81 TDCFError RemoveLocalCopy( int *aSystemError ); |
|
82 |
|
83 // Les fonctionnaires |
|
84 TDCFError SetSingleOption( string aLabel, string aValue, int *aSystemError ); |
|
85 TDCFError RemoveSingleOption( string aLabel, int *aSystemError ); |
|
86 TDCFError AddListOption( string aBlockStartTag, string aBlockEndTag, string aLineItem, int *aSystemError ); |
|
87 TDCFError RemoveListOption( string aBlockStartTag, string aBlockEndTag, string aFirstToken, int *aSystemError ); |
|
88 const char *GetLocalFilename(); |
|
89 |
|
90 private: |
|
91 |
|
92 // Stateless helpers |
|
93 TDCFError GenerateLocalFilenameTemplate( char *aBuffer, int aSize ); |
|
94 |
|
95 // Members |
|
96 string iReferenceFilename; |
|
97 string iLocalFilename; |
|
98 TDCFStatus iStatus; |
|
99 }; |
|
100 |
|
101 #endif //__CDYNAMICSCONFIGFILE_H__ |