|
1 /* |
|
2 * Copyright (c) 2005-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: Contact field data |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 // INCLUDES |
|
20 #include "MVPbkContactFieldTextData.h" |
|
21 #include "MVPbkContactFieldBinaryData.h" |
|
22 #include "MVPbkContactFieldDateTimeData.h" |
|
23 #include "MVPbkContactFieldUriData.h" |
|
24 #include "VPbkError.h" |
|
25 |
|
26 EXPORT_C MVPbkContactFieldTextData& MVPbkContactFieldTextData::Cast |
|
27 (MVPbkContactFieldData& aFieldData) |
|
28 { |
|
29 __ASSERT_ALWAYS( aFieldData.DataType() == EVPbkFieldStorageTypeText, |
|
30 VPbkError::Panic(VPbkError::EFieldDataTypeMismatch) ); |
|
31 return static_cast<MVPbkContactFieldTextData&>(aFieldData); |
|
32 } |
|
33 |
|
34 EXPORT_C const MVPbkContactFieldTextData& MVPbkContactFieldTextData::Cast |
|
35 (const MVPbkContactFieldData& aFieldData) |
|
36 { |
|
37 __ASSERT_ALWAYS( aFieldData.DataType() == EVPbkFieldStorageTypeText, |
|
38 VPbkError::Panic(VPbkError::EFieldDataTypeMismatch) ); |
|
39 return static_cast<const MVPbkContactFieldTextData&>(aFieldData); |
|
40 } |
|
41 |
|
42 EXPORT_C MVPbkContactFieldBinaryData& MVPbkContactFieldBinaryData::Cast |
|
43 (MVPbkContactFieldData& aFieldData) |
|
44 { |
|
45 __ASSERT_ALWAYS( aFieldData.DataType() == EVPbkFieldStorageTypeBinary, |
|
46 VPbkError::Panic(VPbkError::EFieldDataTypeMismatch) ); |
|
47 return static_cast<MVPbkContactFieldBinaryData&>(aFieldData); |
|
48 } |
|
49 |
|
50 EXPORT_C const MVPbkContactFieldBinaryData& MVPbkContactFieldBinaryData::Cast |
|
51 (const MVPbkContactFieldData& aFieldData) |
|
52 { |
|
53 __ASSERT_ALWAYS( aFieldData.DataType() == EVPbkFieldStorageTypeBinary, |
|
54 VPbkError::Panic(VPbkError::EFieldDataTypeMismatch) ); |
|
55 return static_cast<const MVPbkContactFieldBinaryData&>(aFieldData); |
|
56 } |
|
57 |
|
58 EXPORT_C MVPbkContactFieldDateTimeData& MVPbkContactFieldDateTimeData::Cast |
|
59 (MVPbkContactFieldData& aFieldData) |
|
60 { |
|
61 __ASSERT_ALWAYS( aFieldData.DataType() == EVPbkFieldStorageTypeDateTime, |
|
62 VPbkError::Panic(VPbkError::EFieldDataTypeMismatch) ); |
|
63 return static_cast<MVPbkContactFieldDateTimeData&>(aFieldData); |
|
64 } |
|
65 |
|
66 EXPORT_C const MVPbkContactFieldDateTimeData& MVPbkContactFieldDateTimeData::Cast |
|
67 (const MVPbkContactFieldData& aFieldData) |
|
68 { |
|
69 __ASSERT_ALWAYS( aFieldData.DataType() == EVPbkFieldStorageTypeDateTime, |
|
70 VPbkError::Panic(VPbkError::EFieldDataTypeMismatch) ); |
|
71 return static_cast<const MVPbkContactFieldDateTimeData&>(aFieldData); |
|
72 } |
|
73 |
|
74 EXPORT_C MVPbkContactFieldUriData& MVPbkContactFieldUriData::Cast |
|
75 (MVPbkContactFieldData& aFieldData) |
|
76 { |
|
77 __ASSERT_ALWAYS( aFieldData.DataType() == EVPbkFieldStorageTypeUri, |
|
78 VPbkError::Panic(VPbkError::EFieldDataTypeMismatch) ); |
|
79 return static_cast<MVPbkContactFieldUriData&>(aFieldData); |
|
80 } |
|
81 |
|
82 EXPORT_C const MVPbkContactFieldUriData& MVPbkContactFieldUriData::Cast |
|
83 (const MVPbkContactFieldData& aFieldData) |
|
84 { |
|
85 __ASSERT_ALWAYS( aFieldData.DataType() == EVPbkFieldStorageTypeUri, |
|
86 VPbkError::Panic(VPbkError::EFieldDataTypeMismatch) ); |
|
87 return static_cast<const MVPbkContactFieldUriData&>(aFieldData); |
|
88 } |
|
89 |