equal
deleted
inserted
replaced
|
1 /* |
|
2 * Copyright (c) 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 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef MIFHANDLER_H |
|
20 #define MIFHANDLER_H |
|
21 #include <string> |
|
22 #include <vector> |
|
23 using namespace std; |
|
24 |
|
25 class MifIdx |
|
26 { |
|
27 public: |
|
28 int iOffset; |
|
29 int iLength; |
|
30 }; |
|
31 |
|
32 typedef vector<MifIdx> MifIndex; |
|
33 |
|
34 struct MifHeaderV2 |
|
35 { |
|
36 public: |
|
37 int iUid; |
|
38 int iVersion; |
|
39 int iOffset; |
|
40 int iArrayLen; |
|
41 }; |
|
42 |
|
43 struct MifHeaderV3 |
|
44 { |
|
45 int iIndexDllUid; |
|
46 }; |
|
47 |
|
48 struct MifHeader |
|
49 { |
|
50 MifHeaderV2 iV2; |
|
51 MifHeaderV3 iV3; |
|
52 }; |
|
53 |
|
54 class MifHandler |
|
55 { |
|
56 public: |
|
57 void Read(const string& mifName); |
|
58 const MifIndex& Index(); |
|
59 void Modify(const string& dllUid); |
|
60 void Write(const string& mifName); |
|
61 private: |
|
62 void BackupOriginal(const string& mifName); |
|
63 private: |
|
64 MifHeader iHeader; |
|
65 MifIndex iIndex; |
|
66 int iIndexBytes; |
|
67 int iDataBytes; |
|
68 vector<char> iData; |
|
69 }; |
|
70 |
|
71 #endif |