33 iNameRef( KErrNotFound ), |
33 iNameRef( KErrNotFound ), |
34 iValueRef( KErrNotFound ) |
34 iValueRef( KErrNotFound ) |
35 { |
35 { |
36 } |
36 } |
37 |
37 |
38 |
|
39 // ----------------------------------------------------------------------------- |
38 // ----------------------------------------------------------------------------- |
40 // ChspsDomAttribute::ConstructL |
39 // ChspsDomAttribute::ConstructL |
41 // Symbian 2nd phase constructor can leave. |
40 // Symbian 2nd phase constructor can leave. |
42 // ----------------------------------------------------------------------------- |
41 // ----------------------------------------------------------------------------- |
43 // |
42 // |
44 void ChspsDomAttribute::ConstructL( const TDesC8& aName ) |
43 void ChspsDomAttribute::ConstructL( const TDesC8& aName ) |
45 { |
44 { |
46 iNameRef = iStringPool.AddStringL( aName ); |
45 iNameRef = iStringPool.AddStringL( aName ); |
47 } |
46 } |
|
47 |
|
48 // ----------------------------------------------------------------------------- |
|
49 // ChspsDomAttribute::ConstructL |
|
50 // Symbian 2nd phase constructor can leave. |
|
51 // ----------------------------------------------------------------------------- |
|
52 // |
|
53 void ChspsDomAttribute::ConstructL( const TInt aName ) |
|
54 { |
|
55 iNameRef = aName; |
|
56 } |
|
57 |
48 // ----------------------------------------------------------------------------- |
58 // ----------------------------------------------------------------------------- |
49 // ChspsDomAttribute::NewL |
59 // ChspsDomAttribute::NewL |
50 // Two-phased constructor. |
60 // Two-phased constructor. |
51 // ----------------------------------------------------------------------------- |
61 // ----------------------------------------------------------------------------- |
52 // |
62 // |
61 CleanupStack::Pop( self ); |
71 CleanupStack::Pop( self ); |
62 |
72 |
63 return self; |
73 return self; |
64 } |
74 } |
65 |
75 |
|
76 // ----------------------------------------------------------------------------- |
|
77 // ChspsDomAttribute::NewL |
|
78 // Two-phased constructor. |
|
79 // ----------------------------------------------------------------------------- |
|
80 // |
|
81 EXPORT_C ChspsDomAttribute* ChspsDomAttribute::NewL( |
|
82 const TInt aName, |
|
83 ChspsDomStringPool& aStringPool ) |
|
84 { |
|
85 ChspsDomAttribute* self = new( ELeave ) ChspsDomAttribute( aStringPool ); |
|
86 |
|
87 CleanupStack::PushL( self ); |
|
88 self->ConstructL( aName ); |
|
89 CleanupStack::Pop( self ); |
|
90 |
|
91 return self; |
|
92 } |
66 |
93 |
67 // ----------------------------------------------------------------------------- |
94 // ----------------------------------------------------------------------------- |
68 // ChspsDomAttribute::NewL |
95 // ChspsDomAttribute::NewL |
69 // Two-phased stream constructor. |
96 // Two-phased stream constructor. |
70 // ----------------------------------------------------------------------------- |
97 // ----------------------------------------------------------------------------- |
104 |
131 |
105 // ----------------------------------------------------------------------------- |
132 // ----------------------------------------------------------------------------- |
106 // ChspsDomAttribute::CloneL |
133 // ChspsDomAttribute::CloneL |
107 // ----------------------------------------------------------------------------- |
134 // ----------------------------------------------------------------------------- |
108 // |
135 // |
109 ChspsDomAttribute* ChspsDomAttribute::CloneL( ChspsDomStringPool& aStringPool ) |
136 ChspsDomAttribute* ChspsDomAttribute::CloneL( ChspsDomStringPool& aStringPool, |
110 { |
137 const TBool aFastClone ) |
111 const TDesC8& name = iStringPool.String( iNameRef ); |
138 { |
112 |
139 ChspsDomAttribute* clone = NULL; |
113 ChspsDomAttribute* clone = ChspsDomAttribute::NewL( name, aStringPool ); |
140 |
|
141 if( aFastClone ) |
|
142 { |
|
143 clone = ChspsDomAttribute::NewL( iNameRef, aStringPool ); |
|
144 } |
|
145 else |
|
146 { |
|
147 const TDesC8& name = iStringPool.String( iNameRef ); |
|
148 clone = ChspsDomAttribute::NewL( name, aStringPool ); |
|
149 } |
|
150 |
114 CleanupStack::PushL( clone ); |
151 CleanupStack::PushL( clone ); |
|
152 |
115 if ( iValueRef > KErrNotFound ) |
153 if ( iValueRef > KErrNotFound ) |
116 { |
154 { |
117 const TDesC8& value = iStringPool.String( iValueRef ); |
155 if( aFastClone ) |
118 clone->SetValueL( value ); |
156 { |
119 } |
157 clone->SetValueL( iValueRef ); |
|
158 } |
|
159 else |
|
160 { |
|
161 const TDesC8& value = iStringPool.String( iValueRef ); |
|
162 clone->SetValueL( value ); |
|
163 } |
|
164 } |
|
165 |
120 CleanupStack::Pop( clone ); |
166 CleanupStack::Pop( clone ); |
|
167 |
121 return clone; |
168 return clone; |
122 |
169 |
123 } |
170 } |
124 |
171 |
125 // ----------------------------------------------------------------------------- |
172 // ----------------------------------------------------------------------------- |
167 EXPORT_C void ChspsDomAttribute::SetValueL( const TDesC8& aValue ) |
214 EXPORT_C void ChspsDomAttribute::SetValueL( const TDesC8& aValue ) |
168 { |
215 { |
169 iValueRef = iStringPool.AddStringL( aValue ); |
216 iValueRef = iStringPool.AddStringL( aValue ); |
170 } |
217 } |
171 |
218 |
|
219 // ----------------------------------------------------------------------------- |
|
220 // ChspsDomAttribute::SetValueL |
|
221 // ----------------------------------------------------------------------------- |
|
222 // |
|
223 EXPORT_C void ChspsDomAttribute::SetValueL( const TInt aValue ) |
|
224 { |
|
225 iValueRef = aValue; |
|
226 } |
172 |
227 |
173 // ----------------------------------------------------------------------------- |
228 // ----------------------------------------------------------------------------- |
174 // ChspsDomAttribute::Size |
229 // ChspsDomAttribute::Size |
175 // ----------------------------------------------------------------------------- |
230 // ----------------------------------------------------------------------------- |
176 // |
231 // |