|
1 /* |
|
2 * Copyright (c) 2005 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: encapsulates the attributes that can be set for |
|
15 * a landmark database. |
|
16 * |
|
17 * |
|
18 */ |
|
19 |
|
20 |
|
21 // INCLUDE FILES |
|
22 #include "EPos_TPosLmDatabaseSettings.h" |
|
23 #include <EPos_LandmarksErrors.h> |
|
24 |
|
25 |
|
26 |
|
27 // CONSTANTS |
|
28 |
|
29 |
|
30 // ================= MEMBER FUNCTIONS ======================= |
|
31 |
|
32 // C++ default constructor can NOT contain any code, that |
|
33 // might leave. |
|
34 // |
|
35 EXPORT_C TPosLmDatabaseSettings::TPosLmDatabaseSettings() |
|
36 { |
|
37 iAttributes = 0; |
|
38 iName = KNullDesC; |
|
39 TPtr8 buf(reinterpret_cast<TUint8*> (iReserved), |
|
40 KPOSLMDATABASESETTINGSRESERVEDSIZE, |
|
41 KPOSLMDATABASESETTINGSRESERVEDSIZE); |
|
42 buf.FillZ(); |
|
43 } |
|
44 |
|
45 |
|
46 // --------------------------------------------------------- |
|
47 // TPosLmDatabaseSettings::IsAttributeSet |
|
48 // |
|
49 // (other items were commented in a header). |
|
50 // --------------------------------------------------------- |
|
51 // |
|
52 EXPORT_C TBool TPosLmDatabaseSettings::IsAttributeSet( |
|
53 TAttribute aDbAttribute) const |
|
54 { |
|
55 __ASSERT_ALWAYS(aDbAttribute == EName, |
|
56 Panic(KPosLandmarksClientPanic, EPosInvalidEnumValue)); |
|
57 return ((iAttributes & aDbAttribute) != 0); |
|
58 } |
|
59 |
|
60 // --------------------------------------------------------- |
|
61 // TPosLmDatabaseSettings::UnsetAttribute |
|
62 // |
|
63 // (other items were commented in a header). |
|
64 // --------------------------------------------------------- |
|
65 // |
|
66 EXPORT_C void TPosLmDatabaseSettings::UnsetAttribute( |
|
67 TAttribute aDbAttribute) |
|
68 { |
|
69 __ASSERT_ALWAYS(aDbAttribute == EName, |
|
70 Panic(KPosLandmarksClientPanic, EPosInvalidEnumValue)); |
|
71 iAttributes &= ~aDbAttribute; |
|
72 } |
|
73 |
|
74 // --------------------------------------------------------- |
|
75 // TPosLmDatabaseSettings::DatabaseName |
|
76 // |
|
77 // (other items were commented in a header). |
|
78 // --------------------------------------------------------- |
|
79 // |
|
80 EXPORT_C TPtrC TPosLmDatabaseSettings::DatabaseName() const |
|
81 { |
|
82 return IsAttributeSet(EName) ? TPtrC(iName) : TPtrC(); |
|
83 } |
|
84 |
|
85 // --------------------------------------------------------- |
|
86 // TPosLmDatabaseSettings::SetDatabaseName |
|
87 // |
|
88 // (other items were commented in a header). |
|
89 // --------------------------------------------------------- |
|
90 // |
|
91 EXPORT_C void TPosLmDatabaseSettings::SetDatabaseName( |
|
92 const TPosLmDatabaseName& aDatabaseName) |
|
93 { |
|
94 iAttributes |= EName; |
|
95 iName = aDatabaseName; |
|
96 } |
|
97 |
|
98 // End of File |