|
1 /* |
|
2 * Copyright (c) 2002-2004 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: Source for CNSmlDbMetaHandler class |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 // INCLUDE FILES |
|
20 #include <badesca.h> |
|
21 |
|
22 #include <nsmldebug.h> |
|
23 #include "nsmldbcaps.h" |
|
24 #include "smldevinfdtd.h" |
|
25 #include "smlmetinfdtd.h" |
|
26 #include "smldevinftags.h" |
|
27 |
|
28 |
|
29 // ============================ MEMBER FUNCTIONS =============================== |
|
30 |
|
31 // ----------------------------------------------------------------------------- |
|
32 // CNSmlDbMetaHandler::CNSmlDbMetaHandler |
|
33 // ----------------------------------------------------------------------------- |
|
34 // |
|
35 EXPORT_C CNSmlDbMetaHandler::CNSmlDbMetaHandler() : iMetInf(0) |
|
36 { |
|
37 //_DBG_FILE("CNSmlDbMetaHandler::CNSmlDbMetaHandler(): begin"); |
|
38 //_DBG_FILE("CNSmlDbMetaHandler::CNSmlDbMetaHandler(): end"); |
|
39 } |
|
40 |
|
41 // ----------------------------------------------------------------------------- |
|
42 // CNSmlDbMetaHandler::CNSmlDbMetaHandler |
|
43 // ----------------------------------------------------------------------------- |
|
44 // |
|
45 EXPORT_C CNSmlDbMetaHandler::CNSmlDbMetaHandler( sml_metinf_metinf_s* aMetInf ) |
|
46 : iMetInf(aMetInf) |
|
47 { |
|
48 //_DBG_FILE("CNSmlDbMetaHandler::CNSmlDbMetaHandler(): begin"); |
|
49 //_DBG_FILE("CNSmlDbMetaHandler::CNSmlDbMetaHandler(): end"); |
|
50 } |
|
51 |
|
52 // ----------------------------------------------------------------------------- |
|
53 // CNSmlDbMetaHandler::Format |
|
54 // ----------------------------------------------------------------------------- |
|
55 // |
|
56 EXPORT_C TPtrC8 CNSmlDbMetaHandler::Format() const |
|
57 { |
|
58 //_DBG_FILE("CNSmlDbMetaHandler::Format(): begin"); |
|
59 if( iMetInf && iMetInf->format ) |
|
60 { |
|
61 //_DBG_FILE("CNSmlDbMetaHandler::Format(): end"); |
|
62 return iMetInf->format->Data(); |
|
63 } |
|
64 //_DBG_FILE("CNSmlDbMetaHandler::Format(): end"); |
|
65 return TPtrC8(); |
|
66 } |
|
67 |
|
68 // ----------------------------------------------------------------------------- |
|
69 // CNSmlDbMetaHandler::Type |
|
70 // ----------------------------------------------------------------------------- |
|
71 // |
|
72 EXPORT_C TPtrC8 CNSmlDbMetaHandler::Type() const |
|
73 { |
|
74 //_DBG_FILE("CNSmlDbMetaHandler::Type(): begin"); |
|
75 if( iMetInf && iMetInf->type ) |
|
76 { |
|
77 //_DBG_FILE("CNSmlDbMetaHandler::Type(): end"); |
|
78 return iMetInf->type->Data(); |
|
79 } |
|
80 //_DBG_FILE("CNSmlDbMetaHandler::Type(): end"); |
|
81 return TPtrC8(); |
|
82 } |
|
83 |
|
84 // ----------------------------------------------------------------------------- |
|
85 // CNSmlDbMetaHandler::Mark |
|
86 // ----------------------------------------------------------------------------- |
|
87 // |
|
88 EXPORT_C TPtrC8 CNSmlDbMetaHandler::Mark() const |
|
89 { |
|
90 //_DBG_FILE("CNSmlDbMetaHandler::Mark(): begin"); |
|
91 if( iMetInf && iMetInf->mark ) |
|
92 { |
|
93 //_DBG_FILE("CNSmlDbMetaHandler::Mark(): end"); |
|
94 return iMetInf->mark->Data(); |
|
95 } |
|
96 //_DBG_FILE("CNSmlDbMetaHandler::Mark(): end"); |
|
97 return TPtrC8(); |
|
98 } |
|
99 |
|
100 // ----------------------------------------------------------------------------- |
|
101 // CNSmlDbMetaHandler::Size |
|
102 // ----------------------------------------------------------------------------- |
|
103 // |
|
104 EXPORT_C TPtrC8 CNSmlDbMetaHandler::Size() const |
|
105 { |
|
106 //_DBG_FILE("CNSmlDbMetaHandler::Size(): begin"); |
|
107 if( iMetInf && iMetInf->size ) |
|
108 { |
|
109 //_DBG_FILE("CNSmlDbMetaHandler::Size(): end"); |
|
110 return iMetInf->size->Data(); |
|
111 } |
|
112 //_DBG_FILE("CNSmlDbMetaHandler::Size(): end"); |
|
113 return TPtrC8(); |
|
114 } |
|
115 |
|
116 // ----------------------------------------------------------------------------- |
|
117 // CNSmlDbMetaHandler::NextNonce |
|
118 // ----------------------------------------------------------------------------- |
|
119 // |
|
120 EXPORT_C TPtrC8 CNSmlDbMetaHandler::NextNonce() const |
|
121 { |
|
122 //_DBG_FILE("CNSmlDbMetaHandler::NextNonce(): begin"); |
|
123 if( iMetInf && iMetInf->nextnonce ) |
|
124 { |
|
125 //_DBG_FILE("CNSmlDbMetaHandler::NextNonce(): end"); |
|
126 return iMetInf->nextnonce->Data(); |
|
127 } |
|
128 //_DBG_FILE("CNSmlDbMetaHandler::NextNonce(): end"); |
|
129 return TPtrC8(); |
|
130 } |
|
131 |
|
132 // ----------------------------------------------------------------------------- |
|
133 // CNSmlDbMetaHandler::Version |
|
134 // ----------------------------------------------------------------------------- |
|
135 // |
|
136 EXPORT_C TPtrC8 CNSmlDbMetaHandler::Version() const |
|
137 { |
|
138 //_DBG_FILE("CNSmlDbMetaHandler::Version(): begin"); |
|
139 if( iMetInf && iMetInf->version ) |
|
140 { |
|
141 //_DBG_FILE("CNSmlDbMetaHandler::Version(): end"); |
|
142 return iMetInf->version->Data(); |
|
143 } |
|
144 //_DBG_FILE("CNSmlDbMetaHandler::Version(): end"); |
|
145 return TPtrC8(); |
|
146 } |
|
147 |
|
148 // ----------------------------------------------------------------------------- |
|
149 // CNSmlDbMetaHandler::MaxMsgSize |
|
150 // ----------------------------------------------------------------------------- |
|
151 // |
|
152 EXPORT_C TPtrC8 CNSmlDbMetaHandler::MaxMsgSize() const |
|
153 { |
|
154 //_DBG_FILE("CNSmlDbMetaHandler::MaxMsgSize(): begin"); |
|
155 if( iMetInf && iMetInf->maxmsgsize ) |
|
156 { |
|
157 //_DBG_FILE("CNSmlDbMetaHandler::MaxMsgSize(): end"); |
|
158 return iMetInf->maxmsgsize->Data(); |
|
159 } |
|
160 //_DBG_FILE("CNSmlDbMetaHandler::MaxMsgSize(): end"); |
|
161 return TPtrC8(); |
|
162 } |
|
163 |
|
164 // ----------------------------------------------------------------------------- |
|
165 // CNSmlDbMetaHandler::MaxObjSize |
|
166 // ----------------------------------------------------------------------------- |
|
167 // |
|
168 EXPORT_C TPtrC8 CNSmlDbMetaHandler::MaxObjSize() const |
|
169 { |
|
170 //_DBG_FILE("CNSmlDbMetaHandler::MaxObjSize(): begin"); |
|
171 if( iMetInf && iMetInf->maxobjsize ) |
|
172 { |
|
173 //_DBG_FILE("CNSmlDbMetaHandler::MaxObjSize(): end"); |
|
174 return iMetInf->maxobjsize->Data(); |
|
175 } |
|
176 //_DBG_FILE("CNSmlDbMetaHandler::MaxObjSize(): end"); |
|
177 return TPtrC8(); |
|
178 } |
|
179 |
|
180 // ----------------------------------------------------------------------------- |
|
181 // CNSmlDbMetaHandler::MemShared |
|
182 // ----------------------------------------------------------------------------- |
|
183 // |
|
184 EXPORT_C TPtrC8 CNSmlDbMetaHandler::MemShared() const |
|
185 { |
|
186 //_DBG_FILE("CNSmlDbMetaHandler::MemShared(): begin"); |
|
187 if( iMetInf && iMetInf->mem && iMetInf->mem->shared ) |
|
188 { |
|
189 //_DBG_FILE("CNSmlDbMetaHandler::MemShared(): end"); |
|
190 return iMetInf->mem->shared->Data(); |
|
191 } |
|
192 //_DBG_FILE("CNSmlDbMetaHandler::MemShared(): end"); |
|
193 return TPtrC8(); |
|
194 } |
|
195 |
|
196 // ----------------------------------------------------------------------------- |
|
197 // CNSmlDbMetaHandler::MemFreeMem |
|
198 // ----------------------------------------------------------------------------- |
|
199 // |
|
200 EXPORT_C TPtrC8 CNSmlDbMetaHandler::MemFreeMem() const |
|
201 { |
|
202 //_DBG_FILE("CNSmlDbMetaHandler::MemFreeMem(): begin"); |
|
203 if( iMetInf && iMetInf->mem && iMetInf->mem->free ) |
|
204 { |
|
205 //_DBG_FILE("CNSmlDbMetaHandler::MemFreeMem(): end"); |
|
206 return iMetInf->mem->free->Data(); |
|
207 } |
|
208 //_DBG_FILE("CNSmlDbMetaHandler::MemFreeMem(): end"); |
|
209 return TPtrC8(); |
|
210 } |
|
211 |
|
212 // ----------------------------------------------------------------------------- |
|
213 // CNSmlDbMetaHandler::MemFreeID |
|
214 // ----------------------------------------------------------------------------- |
|
215 // |
|
216 EXPORT_C TPtrC8 CNSmlDbMetaHandler::MemFreeID() const |
|
217 { |
|
218 //_DBG_FILE("CNSmlDbMetaHandler::MemFreeID(): begin"); |
|
219 if( iMetInf && iMetInf->mem && iMetInf->mem->freeid ) |
|
220 { |
|
221 //_DBG_FILE("CNSmlDbMetaHandler::MemFreeID(): end"); |
|
222 return iMetInf->mem->freeid->Data(); |
|
223 } |
|
224 //_DBG_FILE("CNSmlDbMetaHandler::MemFreeID(): end"); |
|
225 return TPtrC8(); |
|
226 } |
|
227 |
|
228 // ----------------------------------------------------------------------------- |
|
229 // CNSmlDbMetaHandler::AnchorNext |
|
230 // ----------------------------------------------------------------------------- |
|
231 // |
|
232 EXPORT_C TPtrC8 CNSmlDbMetaHandler::AnchorNext() const |
|
233 { |
|
234 //_DBG_FILE("CNSmlDbMetaHandler::AnchorNext(): begin"); |
|
235 if( iMetInf && iMetInf->anchor && iMetInf->anchor->next ) |
|
236 { |
|
237 //_DBG_FILE("CNSmlDbMetaHandler::AnchorNext(): end"); |
|
238 return iMetInf->anchor->next->Data(); |
|
239 } |
|
240 //_DBG_FILE("CNSmlDbMetaHandler::AnchorNext(): end"); |
|
241 return TPtrC8(); |
|
242 } |
|
243 |
|
244 // ----------------------------------------------------------------------------- |
|
245 // CNSmlDbMetaHandler::AnchorLast |
|
246 // ----------------------------------------------------------------------------- |
|
247 // |
|
248 EXPORT_C TPtrC8 CNSmlDbMetaHandler::AnchorLast() const |
|
249 { |
|
250 //_DBG_FILE("CNSmlDbMetaHandler::AnchorLast(): begin"); |
|
251 if( iMetInf && iMetInf->anchor && iMetInf->anchor->last ) |
|
252 { |
|
253 //_DBG_FILE("CNSmlDbMetaHandler::AnchorLast(): end"); |
|
254 return iMetInf->anchor->last->Data(); |
|
255 } |
|
256 //_DBG_FILE("CNSmlDbMetaHandler::AnchorLast(): end"); |
|
257 return TPtrC8(); |
|
258 } |
|
259 |
|
260 // ----------------------------------------------------------------------------- |
|
261 // CNSmlDbMetaHandler::GetEmiL |
|
262 // ----------------------------------------------------------------------------- |
|
263 // |
|
264 EXPORT_C void CNSmlDbMetaHandler::GetEmiL( CDesC8Array& aEMI ) const |
|
265 { |
|
266 //_DBG_FILE("CNSmlDbMetaHandler::GetEmiL(): begin"); |
|
267 aEMI.Reset(); |
|
268 if( iMetInf ) |
|
269 { |
|
270 for( SmlPcdataListPtr_t list = iMetInf->emi; list; list = list->next ) |
|
271 { |
|
272 if( list->data ) |
|
273 { |
|
274 aEMI.AppendL(list->data->Data()); |
|
275 } |
|
276 } |
|
277 } |
|
278 //_DBG_FILE("CNSmlDbMetaHandler::GetEmiL(): end"); |
|
279 } |
|
280 |
|
281 // End of File |