|
1 /* |
|
2 * Copyright (c) 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: Landmarks Server's utilities |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef EPOS_POSLMSERVERUTILITIES_ |
|
20 #define EPOS_POSLMSERVERUTILITIES_ |
|
21 |
|
22 #include <e32base.h> |
|
23 #include <f32file.h> |
|
24 #include <d32dbms.h> |
|
25 |
|
26 class CPosLmLocalDbAccess; |
|
27 |
|
28 class PosLmServerUtility |
|
29 { |
|
30 public: |
|
31 |
|
32 enum TLmOperation |
|
33 { |
|
34 ECreateFieldsLmIdIndex, |
|
35 /**< Create index in fields table on Lm ID field */ |
|
36 ECreateCategoriesLmIdIndex, |
|
37 /**< Create index in categories table on Lm ID field */ |
|
38 }; |
|
39 |
|
40 public: // New functions |
|
41 |
|
42 /** |
|
43 * Method to estimate disk size impact for creating |
|
44 * foreign index in a table. |
|
45 * @return Estimated number of bytes. |
|
46 */ |
|
47 static TInt EstimatedDiskSizeOfIndex( |
|
48 TLmOperation aOperation, |
|
49 TInt aCountOfRecords ); |
|
50 |
|
51 /** |
|
52 * Reads the data of a long text column. |
|
53 * |
|
54 * @param[in] aView Prepared view. |
|
55 * @param[in] aCol The number of the column to read from. |
|
56 * @return Data from the column. |
|
57 */ |
|
58 static HBufC* ReadFromLongTextColumnLC( |
|
59 RDbRowSet& aView, |
|
60 TDbColNo aCol ); |
|
61 |
|
62 /** Returns number of rows in a table |
|
63 * @param aTableName Name of the table which rowcount is needed */ |
|
64 static TUint GetTableRowCountL( |
|
65 CPosLmLocalDbAccess& aDbAccess, |
|
66 const TDesC& aTableName ); |
|
67 |
|
68 static TUint TotalLandmarkCountL( CPosLmLocalDbAccess& aDbAccess ); |
|
69 |
|
70 /** Checks whether given index exists on given table */ |
|
71 static TBool IndexExistsL( |
|
72 const RDbNamedDatabase& aDatabase, |
|
73 const TDesC& aTable, |
|
74 const TDesC& aIndex ); |
|
75 |
|
76 /** |
|
77 * Reads the data of a long text column. |
|
78 * |
|
79 * @param[in] aView Prepared view. |
|
80 * @param[in] aCol The number of the column to read from. |
|
81 * @return Data from the column. |
|
82 */ |
|
83 //Duplicate Declaration |
|
84 /*HBufC* ReadFromLongTextColumnLC( |
|
85 RDbRowSet& aView, |
|
86 TDbColNo aCol );*/ |
|
87 }; |
|
88 |
|
89 #endif /*EPOS_POSLMSERVERUTILITIES_*/ |