|
1 /* |
|
2 * Copyright (c) 2005,2006 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: Entity reference data class |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 |
|
20 // INCLUDE FILES |
|
21 #include "hspsdtdentity.h" |
|
22 |
|
23 |
|
24 // ============================ MEMBER FUNCTIONS =============================== |
|
25 |
|
26 // ----------------------------------------------------------------------------- |
|
27 // ChspsDtdEntity::ChspsDtdEntity |
|
28 // C++ default constructor can NOT contain any code, that |
|
29 // might leave. |
|
30 // ----------------------------------------------------------------------------- |
|
31 // |
|
32 ChspsDtdEntity::ChspsDtdEntity() |
|
33 { |
|
34 } |
|
35 |
|
36 // ----------------------------------------------------------------------------- |
|
37 // ChspsDtdEntity::ConstructL |
|
38 // Symbian 2nd phase constructor can leave. |
|
39 // ----------------------------------------------------------------------------- |
|
40 // |
|
41 void ChspsDtdEntity::ConstructL() |
|
42 { |
|
43 } |
|
44 |
|
45 // ----------------------------------------------------------------------------- |
|
46 // ChspsDtdEntity::NewL |
|
47 // Two-phased constructor. |
|
48 // ----------------------------------------------------------------------------- |
|
49 // |
|
50 ChspsDtdEntity* ChspsDtdEntity::NewL() |
|
51 { |
|
52 ChspsDtdEntity* self = new( ELeave ) ChspsDtdEntity; |
|
53 |
|
54 CleanupStack::PushL( self ); |
|
55 self->ConstructL(); |
|
56 CleanupStack::Pop( self ); |
|
57 |
|
58 return self; |
|
59 } |
|
60 |
|
61 |
|
62 // Destructor |
|
63 ChspsDtdEntity::~ChspsDtdEntity() |
|
64 { |
|
65 delete iEntity; |
|
66 delete iValue; |
|
67 } |
|
68 |
|
69 |
|
70 // ----------------------------------------------------------------------------- |
|
71 // ChspsDtdEntity::SetEntityL |
|
72 // (other items were commented in a header). |
|
73 // ----------------------------------------------------------------------------- |
|
74 // |
|
75 void ChspsDtdEntity::SetEntityL( const TDesC8& aEntity ) |
|
76 { |
|
77 delete iEntity; |
|
78 iEntity = NULL; |
|
79 iEntity = aEntity.AllocL(); |
|
80 } |
|
81 |
|
82 // ----------------------------------------------------------------------------- |
|
83 // ChspsDtdEntity::Entity |
|
84 // (other items were commented in a header). |
|
85 // ----------------------------------------------------------------------------- |
|
86 // |
|
87 const TDesC8& ChspsDtdEntity::Entity() |
|
88 { |
|
89 if ( iEntity ) |
|
90 { |
|
91 return *iEntity; |
|
92 } |
|
93 else |
|
94 { |
|
95 return KNullDesC8; |
|
96 } |
|
97 } |
|
98 // ----------------------------------------------------------------------------- |
|
99 // ChspsDtdEntity::SetValueL |
|
100 // (other items were commented in a header). |
|
101 // ----------------------------------------------------------------------------- |
|
102 // |
|
103 void ChspsDtdEntity::SetValueL( const TDesC8& aValue ) |
|
104 { |
|
105 delete iValue; |
|
106 iValue = NULL; |
|
107 iValue = aValue.AllocL(); |
|
108 } |
|
109 // ----------------------------------------------------------------------------- |
|
110 // ChspsDtdEntity::Value |
|
111 // (other items were commented in a header). |
|
112 // ----------------------------------------------------------------------------- |
|
113 // |
|
114 const TDesC8& ChspsDtdEntity::Value() |
|
115 { |
|
116 if ( iValue ) |
|
117 { |
|
118 return *iValue; |
|
119 } |
|
120 else |
|
121 { |
|
122 return KNullDesC8; |
|
123 } |
|
124 } |
|
125 |
|
126 // End of File |