1 martin 1.89 //%LICENSE////////////////////////////////////////////////////////////////
|
2 martin 1.90 //
|
3 martin 1.89 // Licensed to The Open Group (TOG) under one or more contributor license
4 // agreements. Refer to the OpenPegasusNOTICE.txt file distributed with
5 // this work for additional information regarding copyright ownership.
6 // Each contributor licenses this file to you under the OpenPegasus Open
7 // Source License; you may not use this file except in compliance with the
8 // License.
|
9 martin 1.90 //
|
10 martin 1.89 // Permission is hereby granted, free of charge, to any person obtaining a
11 // copy of this software and associated documentation files (the "Software"),
12 // to deal in the Software without restriction, including without limitation
13 // the rights to use, copy, modify, merge, publish, distribute, sublicense,
14 // and/or sell copies of the Software, and to permit persons to whom the
15 // Software is furnished to do so, subject to the following conditions:
|
16 martin 1.90 //
|
17 martin 1.89 // The above copyright notice and this permission notice shall be included
18 // in all copies or substantial portions of the Software.
|
19 martin 1.90 //
|
20 martin 1.89 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
|
21 martin 1.90 // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
22 martin 1.89 // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
23 // IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
24 // CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
25 // TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
26 // SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
27 martin 1.90 //
|
28 martin 1.89 //////////////////////////////////////////////////////////////////////////
|
29 mike 1.21 //
30 //%/////////////////////////////////////////////////////////////////////////////
31
32 #ifndef Pegasus_XmlWriter_h
33 #define Pegasus_XmlWriter_h
34
35 #include <iostream>
36 #include <Pegasus/Common/Config.h>
|
37 kumpf 1.53 #include <Pegasus/Common/InternalException.h>
|
38 kumpf 1.55 #include <Pegasus/Common/ArrayInternal.h>
|
39 mike 1.21 #include <Pegasus/Common/String.h>
|
40 kumpf 1.41 #include <Pegasus/Common/CIMObject.h>
41 #include <Pegasus/Common/CIMClass.h>
42 #include <Pegasus/Common/CIMInstance.h>
43 #include <Pegasus/Common/CIMProperty.h>
44 #include <Pegasus/Common/CIMMethod.h>
45 #include <Pegasus/Common/CIMParameter.h>
46 #include <Pegasus/Common/CIMQualifier.h>
47 #include <Pegasus/Common/CIMQualifierDecl.h>
48 #include <Pegasus/Common/CIMValue.h>
|
49 kumpf 1.44 #include <Pegasus/Common/CIMObjectPath.h>
|
50 mike 1.22 #include <Pegasus/Common/CIMPropertyList.h>
|
51 kumpf 1.29 #include <Pegasus/Common/CIMParamValue.h>
|
52 thilo.boehm 1.92 #include <Pegasus/Common/CommonUTF.h>
|
53 kumpf 1.59 #include <Pegasus/Common/Message.h>
|
54 kumpf 1.49 #include <Pegasus/Common/Linkage.h>
|
55 kumpf 1.78 #include <Pegasus/Common/ContentLanguageList.h>
56 #include <Pegasus/Common/AcceptLanguageList.h>
|
57 mike 1.75 #include <Pegasus/Common/Buffer.h>
|
58 mike 1.76 #include <Pegasus/Common/StrLit.h>
|
59 kumpf 1.86 #include <Pegasus/Common/XmlGenerator.h>
|
60 karl 1.92.4.1 #include <Pegasus/Common/NumericArg.h>
|
61 mike 1.21
62 PEGASUS_NAMESPACE_BEGIN
63
|
64 kumpf 1.86 class PEGASUS_COMMON_LINKAGE XmlWriter : public XmlGenerator
|
65 mike 1.21 {
66 public:
67
|
68 kumpf 1.28 static void appendLocalNameSpacePathElement(
|
69 david.dillard 1.77 Buffer& out,
70 const CIMNamespaceName& nameSpace);
|
71 mike 1.21
|
72 kumpf 1.28 static void appendNameSpacePathElement(
|
73 david.dillard 1.77 Buffer& out,
74 const String& host,
75 const CIMNamespaceName& nameSpace);
|
76 mike 1.21
|
77 kumpf 1.28 static void appendClassNameElement(
|
78 david.dillard 1.77 Buffer& out,
79 const CIMName& className);
|
80 mike 1.21
|
81 kumpf 1.28 static void appendInstanceNameElement(
|
82 david.dillard 1.77 Buffer& out,
83 const CIMObjectPath& instanceName);
|
84 kumpf 1.26
|
85 kumpf 1.28 static void appendClassPathElement(
|
86 david.dillard 1.77 Buffer& out,
87 const CIMObjectPath& classPath);
|
88 mike 1.21
|
89 kumpf 1.28 static void appendInstancePathElement(
|
90 david.dillard 1.77 Buffer& out,
91 const CIMObjectPath& instancePath);
|
92 mike 1.21
|
93 kumpf 1.28 static void appendLocalClassPathElement(
|
94 david.dillard 1.77 Buffer& out,
95 const CIMObjectPath& classPath);
|
96 mike 1.21
|
97 kumpf 1.28 static void appendLocalInstancePathElement(
|
98 david.dillard 1.77 Buffer& out,
99 const CIMObjectPath& instancePath);
|
100 mike 1.21
|
101 kumpf 1.29 static void appendLocalObjectPathElement(
|
102 david.dillard 1.77 Buffer& out,
103 const CIMObjectPath& objectPath);
|
104 kumpf 1.39
105 static void appendValueElement(
|
106 mike 1.75 Buffer& out,
|
107 kumpf 1.39 const CIMValue& value);
108
109 static void printValueElement(
110 const CIMValue& value,
111 PEGASUS_STD(ostream)& os=PEGASUS_STD(cout));
|
112 kumpf 1.29
|
113 kumpf 1.41 static void appendValueObjectWithPathElement(
|
114 mike 1.75 Buffer& out,
|
115 karl 1.92.4.2 const CIMObject& objectWithPath,
116 Boolean includeQualifiers = true,
117 Boolean includeClassOrigin = true,
118 const CIMPropertyList& propertyList = CIMPropertyList());
|
119 kumpf 1.41
120 static void appendValueReferenceElement(
|
121 mike 1.75 Buffer& out,
|
122 kumpf 1.44 const CIMObjectPath& reference,
|
123 kumpf 1.41 Boolean putValueWrapper);
124
125 static void printValueReferenceElement(
|
126 kumpf 1.44 const CIMObjectPath& reference,
|
127 kumpf 1.41 PEGASUS_STD(ostream)& os=PEGASUS_STD(cout));
128
129 static void appendValueNamedInstanceElement(
|
130 mike 1.75 Buffer& out,
|
131 karl 1.92.4.2 const CIMInstance& namedInstance,
132 Boolean includeQualifiers = true,
133 Boolean includeClassOrigin = true,
134 const CIMPropertyList& propertyList = CIMPropertyList());
|
135 kumpf 1.41
|
136 karl 1.92.4.2 //EXP_PULL // KS_TODO relate this to the one above.
|
137 karl 1.92.4.1 static void appendValueInstanceWithPathElement(
138 Buffer& out,
|
139 karl 1.92.4.2 const CIMInstance& namedInstance,
140 Boolean includeQualifiers = true,
141 Boolean includeClassOrigin = true,
142 const CIMPropertyList& propertyList = CIMPropertyList());
|
143 karl 1.92.4.1 //EXP_PULL_END
|
144 kumpf 1.40 static void appendClassElement(
|
145 mike 1.75 Buffer& out,
|
146 kumpf 1.40 const CIMConstClass& cimclass);
147
148 static void printClassElement(
149 const CIMConstClass& cimclass,
150 PEGASUS_STD(ostream)& os=PEGASUS_STD(cout));
151
152 static void appendInstanceElement(
|
153 mike 1.75 Buffer& out,
|
154 karl 1.92.4.2 const CIMConstInstance& instance,
155 Boolean includeQualifiers = true,
156 Boolean includeClassOrigin = true,
157 const CIMPropertyList& propertyList = CIMPropertyList());
158
|
159 kumpf 1.40
160 static void printInstanceElement(
161 const CIMConstInstance& instance,
|
162 kumpf 1.41 PEGASUS_STD(ostream)& os=PEGASUS_STD(cout));
163
164 static void appendObjectElement(
|
165 mike 1.75 Buffer& out,
|
166 karl 1.92.4.2 const CIMConstObject& object,
167 Boolean includeQualifiers = true,
168 Boolean includeClassOrigin = true,
169 const CIMPropertyList& propertyList = CIMPropertyList());
|
170 kumpf 1.41
171 static void appendPropertyElement(
|
172 mike 1.75 Buffer& out,
|
173 karl 1.92.4.2 const CIMConstProperty& property,
174 Boolean includeQualifiers = true,
175 Boolean includeClassOrigin = true);
|
176 kumpf 1.41
177 static void printPropertyElement(
178 const CIMConstProperty& property,
179 PEGASUS_STD(ostream)& os=PEGASUS_STD(cout));
180
181 static void appendMethodElement(
|
182 mike 1.75 Buffer& out,
|
183 kumpf 1.41 const CIMConstMethod& method);
184
185 static void printMethodElement(
186 const CIMConstMethod& method,
187 PEGASUS_STD(ostream)& os=PEGASUS_STD(cout));
188
189 static void appendParameterElement(
|
190 mike 1.75 Buffer& out,
|
191 kumpf 1.41 const CIMConstParameter& parameter);
192
193 static void printParameterElement(
194 const CIMConstParameter& parameter,
195 PEGASUS_STD(ostream)& os=PEGASUS_STD(cout));
196
197 static void appendParamValueElement(
|
198 mike 1.75 Buffer& out,
|
199 kumpf 1.41 const CIMParamValue& paramValue);
200
201 static void printParamValueElement(
202 const CIMParamValue& paramValue,
203 PEGASUS_STD(ostream)& os=PEGASUS_STD(cout));
204
205 static void appendQualifierElement(
|
206 mike 1.75 Buffer& out,
|
207 kumpf 1.41 const CIMConstQualifier& qualifier);
208
209 static void printQualifierElement(
210 const CIMConstQualifier& qualifier,
211 PEGASUS_STD(ostream)& os=PEGASUS_STD(cout));
212
213 static void appendQualifierDeclElement(
|
214 mike 1.75 Buffer& out,
|
215 kumpf 1.41 const CIMConstQualifierDecl& qualifierDecl);
216
217 static void printQualifierDeclElement(
218 const CIMConstQualifierDecl& qualifierDecl,
|
219 kumpf 1.40 PEGASUS_STD(ostream)& os=PEGASUS_STD(cout));
220
|
221 kumpf 1.42 static void appendQualifierFlavorEntity(
|
222 mike 1.75 Buffer& out,
|
223 kumpf 1.52 const CIMFlavor & flavor);
|
224 kumpf 1.42
|
225 kumpf 1.43 static void appendScopeElement(
|
226 mike 1.75 Buffer& out,
|
227 kumpf 1.51 const CIMScope & scope);
|
228 kumpf 1.43
|
229 kumpf 1.28 static void appendMethodCallHeader(
|
230 david.dillard 1.77 Buffer& out,
231 const char* host,
232 const CIMName& cimMethod,
233 const String& cimObject,
234 const String& authenticationHeader,
235 HttpMethod httpMethod,
|
236 kumpf 1.78 const AcceptLanguageList& acceptLanguages,
237 const ContentLanguageList& contentLanguages,
|
238 mike 1.88 Uint32 contentLength,
239 bool binaryRequest = false,
240 bool binaryResponse = false);
|
241 mike 1.21
|
242 w.white 1.68 static void appendMethodResponseHeader(
|
243 mike 1.75 Buffer& out,
|
244 w.white 1.68 HttpMethod httpMethod,
|
245 kumpf 1.78 const ContentLanguageList& contentLanguages,
|
246 w.white 1.68 Uint32 contentLength,
|
247 mike 1.88 Uint64 serverResponseTime = 0,
248 bool binaryResponse = false);
|
249 w.white 1.68
|
250 kumpf 1.34 static void appendHttpErrorResponseHeader(
|
251 david.dillard 1.77 Buffer& out,
252 const String& status,
253 const String& cimError = String::EMPTY,
254 const String& errorDetail = String::EMPTY);
|
255 kumpf 1.34
|
256 kumpf 1.28 static void appendUnauthorizedResponseHeader(
|
257 david.dillard 1.77 Buffer& out,
|
258 kumpf 1.28 const String& content);
|
259 mike 1.21
|
260 gerarda 1.63 #ifdef PEGASUS_KERBEROS_AUTHENTICATION
261 static void appendOKResponseHeader(
|
262 david.dillard 1.77 Buffer& out,
|
263 gerarda 1.63 const String& content);
264 #endif
|
265 kumpf 1.86
|
266 karl 1.83 static void appendParamTypeAndEmbeddedObjAttrib(
267 Buffer& out,
268 const CIMType& type);
|
269 gerarda 1.63
|
270 kumpf 1.26 static void appendReturnValueElement(
|
271 david.dillard 1.77 Buffer& out,
272 const CIMValue& value);
|
273 kumpf 1.26
274 static void appendBooleanIParameter(
|
275 david.dillard 1.77 Buffer& out,
276 const char* name,
277 Boolean flag);
|
278 mike 1.21
|
279 karl 1.92.4.1 static void appendBooleanParameter(
280 Buffer& out,
281 const char* name,
282 Boolean flag);
283
284 static void appendBooleanIReturnValue(
285 Buffer& out,
286 const char* name,
287 Boolean flag);
288
289 static void appendUint32IParameter(
290 Buffer& out,
291 const char* name,
292 const Uint32Arg& val,
293 const Boolean required);
294 /* KS_PULL DELETE
295 static void appendUint64Parameter(
296 Buffer& out,
297 const char* name,
298 const Uint64 val);
299 */
300 karl 1.92.4.1 static void appendUint64ReturnValue(
301 Buffer& out,
302 const char* name,
303 const Uint64Arg& val);
304
|
305 kumpf 1.26 static void appendStringIParameter(
|
306 david.dillard 1.77 Buffer& out,
307 const char* name,
308 const String& str);
|
309 mike 1.21
|
310 karl 1.92.4.1 //EXP_PULL
311 static void appendStringIParameterIfNotEmpty(
312 Buffer& out,
313 const char* name,
314 const String& str);
315
316 static void appendStringParameter(
317 Buffer& out,
318 const char* name,
319 const String& str);
320 static void appendStringIReturnValue(
321 Buffer& out,
322 const char* name,
323 const String& str);
324 //EXP_PULL_END
|
325 kumpf 1.26 static void appendClassNameIParameter(
|
326 david.dillard 1.77 Buffer& out,
327 const char* name,
328 const CIMName& className);
|
329 mike 1.21
|
330 kumpf 1.26 static void appendInstanceNameIParameter(
|
331 david.dillard 1.77 Buffer& out,
332 const char* name,
333 const CIMObjectPath& instanceName);
|
334 mike 1.21
|
335 kumpf 1.26 static void appendObjectNameIParameter(
|
336 david.dillard 1.77 Buffer& out,
337 const char* name,
338 const CIMObjectPath& objectName);
|
339 mike 1.21
|
340 kumpf 1.26 static void appendClassIParameter(
|
341 david.dillard 1.77 Buffer& out,
342 const char* name,
343 const CIMConstClass& cimClass);
|
344 mike 1.21
|
345 kumpf 1.26 static void appendInstanceIParameter(
|
346 david.dillard 1.77 Buffer& out,
347 const char* name,
348 const CIMConstInstance& instance);
|
349 mike 1.21
|
350 kumpf 1.26 static void appendNamedInstanceIParameter(
|
351 david.dillard 1.77 Buffer& out,
352 const char* name,
353 const CIMInstance& namedInstance) ;
|
354 mike 1.22
|
355 kumpf 1.26 static void appendPropertyNameIParameter(
|
356 david.dillard 1.77 Buffer& out,
357 const CIMName& propertyName);
|
358 mike 1.21
|
359 kumpf 1.26 static void appendPropertyValueIParameter(
|
360 david.dillard 1.77 Buffer& out,
361 const char* name,
362 const CIMValue& value);
|
363 mike 1.21
|
364 kumpf 1.26 static void appendPropertyListIParameter(
|
365 david.dillard 1.77 Buffer& out,
366 const CIMPropertyList& propertyList);
|
367 mike 1.21
|
368 kumpf 1.26 static void appendQualifierDeclarationIParameter(
|
369 david.dillard 1.77 Buffer& out,
370 const char* name,
371 const CIMConstQualifierDecl& qualifierDecl);
|
372 kumpf 1.34
|
373 mike 1.75 static Buffer formatHttpErrorRspMessage(
|
374 david.dillard 1.77 const String& status,
375 const String& cimError = String::EMPTY,
376 const String& errorDetail = String::EMPTY);
|
377 mike 1.21
|
378 mike 1.75 static Buffer formatSimpleMethodReqMessage(
|
379 david.dillard 1.77 const char* host,
380 const CIMNamespaceName& nameSpace,
381 const CIMObjectPath& path,
382 const CIMName& methodName,
383 const Array<CIMParamValue>& parameters,
384 const String& messageId,
|
385 kumpf 1.59 HttpMethod httpMethod,
|
386 chuck 1.62 const String& authenticationHeader,
|
387 kumpf 1.78 const AcceptLanguageList& httpAcceptLanguages,
|
388 mike 1.88 const ContentLanguageList& httpContentLanguages,
389 bool binaryResponse);
|
390 mike 1.21
|
391 david.dillard 1.77 static Buffer formatSimpleMethodRspMessage(
392 const CIMName& methodName,
|
393 w.white 1.68 const String& messageId,
394 HttpMethod httpMethod,
|
395 kumpf 1.78 const ContentLanguageList& httpContentLanguages,
|
396 karl 1.92.4.1 const Buffer& bodyParams,
|
397 david.dillard 1.77 const Buffer& body,
398 Uint64 serverResponseTime,
399 Boolean isFirst = true,
400 Boolean isLast = true);
|
401 mike 1.21
|
402 mike 1.75 static Buffer formatSimpleMethodErrorRspMessage(
|
403 david.dillard 1.77 const CIMName& methodName,
404 const String& messageId,
|
405 kumpf 1.59 HttpMethod httpMethod,
|
406 david.dillard 1.77 const CIMException& cimException);
|
407 kumpf 1.27
|
408 mike 1.75 static Buffer formatSimpleIMethodReqMessage(
|
409 david.dillard 1.77 const char* host,
410 const CIMNamespaceName& nameSpace,
411 const CIMName& iMethodName,
412 const String& messageId,
|
413 kumpf 1.59 HttpMethod httpMethod,
|
414 mike 1.22 const String& authenticationHeader,
|
415 kumpf 1.78 const AcceptLanguageList& httpAcceptLanguages,
416 const ContentLanguageList& httpContentLanguages,
|
417 mike 1.88 const Buffer& body,
418 bool binaryResponse);
|
419 mike 1.21
|
420 david.dillard 1.77 static Buffer formatSimpleIMethodRspMessage(
421 const CIMName& iMethodName,
|
422 mike 1.21 const String& messageId,
|
423 kumpf 1.59 HttpMethod httpMethod,
|
424 kumpf 1.78 const ContentLanguageList& httpContentLanguages,
|
425 karl 1.92.4.1 const Buffer& rtnParams,
|
426 david.dillard 1.77 const Buffer& body,
427 Uint64 serverResponseTime,
428 Boolean isFirst = true,
429 Boolean isLast = true);
|
430 mike 1.21
|
431 mike 1.88
|
432 mike 1.75 static Buffer formatSimpleIMethodErrorRspMessage(
|
433 david.dillard 1.77 const CIMName& iMethodName,
434 const String& messageId,
|
435 kumpf 1.59 HttpMethod httpMethod,
|
436 david.dillard 1.77 const CIMException& cimException);
|
437 mike 1.22
|
438 kumpf 1.61 static void appendInstanceEParameter(
|
439 david.dillard 1.77 Buffer& out,
440 const char* name,
441 const CIMInstance& instance);
|
442 kumpf 1.61
|
443 kumpf 1.26 static void appendEMethodRequestHeader(
|
444 david.dillard 1.77 Buffer& out,
|
445 kumpf 1.38 const char* requestUri,
|
446 david.dillard 1.77 const char* host,
447 const CIMName& cimMethod,
|
448 kumpf 1.59 HttpMethod httpMethod,
|
449 mike 1.22 const String& authenticationHeader,
|
450 kumpf 1.78 const AcceptLanguageList& acceptLanguages,
451 const ContentLanguageList& contentLanguages,
|
452 david.dillard 1.77 Uint32 contentLength);
|
453 mike 1.22
|
454 kumpf 1.26 static void appendEMethodResponseHeader(
|
455 david.dillard 1.77 Buffer& out,
|
456 kumpf 1.59 HttpMethod httpMethod,
|
457 kumpf 1.78 const ContentLanguageList& contentLanguages,
|
458 david.dillard 1.77 Uint32 contentLength);
|
459 mike 1.22
|
460 mike 1.75 static Buffer formatSimpleEMethodReqMessage(
|
461 kumpf 1.38 const char* requestUri,
|
462 david.dillard 1.77 const char* host,
463 const CIMName& eMethodName,
464 const String& messageId,
465 HttpMethod httpMethod,
466 const String& authenticationHeader,
|
467 kumpf 1.78 const AcceptLanguageList& httpAcceptLanguages,
468 const ContentLanguageList& httpContentLanguages,
|
469 david.dillard 1.77 const Buffer& body);
|
470 mike 1.22
|
471 mike 1.75 static Buffer formatSimpleEMethodRspMessage(
|
472 david.dillard 1.77 const CIMName& eMethodName,
|
473 mike 1.22 const String& messageId,
|
474 kumpf 1.59 HttpMethod httpMethod,
|
475 kumpf 1.78 const ContentLanguageList& httpContentLanguages,
|
476 david.dillard 1.77 const Buffer& body);
|
477 kumpf 1.27
|
478 mike 1.75 static Buffer formatSimpleEMethodErrorRspMessage(
|
479 david.dillard 1.77 const CIMName& eMethodName,
480 const String& messageId,
|
481 kumpf 1.59 HttpMethod httpMethod,
|
482 david.dillard 1.77 const CIMException& cimException);
|
483 mike 1.22
|
484 kumpf 1.26 static String getNextMessageId();
|
485 mike 1.21
|
486 kumpf 1.57 /** Converts the given CIMKeyBinding type to one of the following:
|
487 kumpf 1.50 "boolean", "string", or "numeric"
488 */
|
489 thilo.boehm 1.87 static const StrLit keyBindingTypeToString (CIMKeyBinding::Type type);
|
490 kumpf 1.91
|
491 mike 1.21 private:
|
492 kumpf 1.28
493 static void _appendMessageElementBegin(
|
494 david.dillard 1.77 Buffer& out,
495 const String& messageId);
496 static void _appendMessageElementEnd(
497 Buffer& out);
|
498 kumpf 1.28
|
499 mike 1.75 static void _appendSimpleReqElementBegin(Buffer& out);
500 static void _appendSimpleReqElementEnd(Buffer& out);
|
501 kumpf 1.28
502 static void _appendMethodCallElementBegin(
|
503 david.dillard 1.77 Buffer& out,
504 const CIMName& name);
505
|
506 kumpf 1.28 static void _appendMethodCallElementEnd(
|
507 david.dillard 1.77 Buffer& out);
|
508 kumpf 1.28
509 static void _appendIMethodCallElementBegin(
|
510 david.dillard 1.77 Buffer& out,
511 const CIMName& name);
512 static void _appendIMethodCallElementEnd(
513 Buffer& out);
|
514 kumpf 1.28
|
515 karl 1.92.4.1 static void _appendParamValueElementBegin(
516 Buffer& out,
517 const char* name);
518
519 static void _appendParamValueElementEnd(
520 Buffer& out);
521
|
522 kumpf 1.28 static void _appendIParamValueElementBegin(
|
523 david.dillard 1.77 Buffer& out,
524 const char* name);
|
525 karl 1.92.4.1
526 static void _appendIParamValueElementEnd(
|
527 david.dillard 1.77 Buffer& out);
|
528 kumpf 1.28
|
529 mike 1.75 static void _appendSimpleRspElementBegin(Buffer& out);
530 static void _appendSimpleRspElementEnd(Buffer& out);
|
531 kumpf 1.28
532 static void _appendMethodResponseElementBegin(
|
533 david.dillard 1.77 Buffer& out,
534 const CIMName& name);
535 static void _appendMethodResponseElementEnd(
536 Buffer& out);
|
537 kumpf 1.28
538 static void _appendIMethodResponseElementBegin(
|
539 david.dillard 1.77 Buffer& out,
540 const CIMName& name);
541 static void _appendIMethodResponseElementEnd(
542 Buffer& out);
|
543 kumpf 1.28
544 static void _appendErrorElement(
|
545 david.dillard 1.77 Buffer& out,
546 const CIMException& cimException);
|
547 kumpf 1.28
|
548 mike 1.75 static void _appendIReturnValueElementBegin(Buffer& out);
549 static void _appendIReturnValueElementEnd(Buffer& out);
|
550 kumpf 1.28
|
551 karl 1.92.4.1 //EXP_PULL
552
553 static void _appendIReturnValueElementWithNameBegin(
554 Buffer& out,
555 const char* name);
556 // EXP_PULL_END
|
557 mike 1.75 static void _appendSimpleExportReqElementBegin(Buffer& out);
558 static void _appendSimpleExportReqElementEnd(Buffer& out);
|
559 kumpf 1.28
560 static void _appendEMethodCallElementBegin(
|
561 david.dillard 1.77 Buffer& out,
562 const CIMName& name);
563
|
564 kumpf 1.28 static void _appendEMethodCallElementEnd(
|
565 david.dillard 1.77 Buffer& out);
|
566 kumpf 1.61
567 static void _appendEParamValueElementBegin(
|
568 david.dillard 1.77 Buffer& out,
569 const char* name);
570 static void _appendEParamValueElementEnd(
571 Buffer& out);
|
572 kumpf 1.28
|
573 mike 1.75 static void _appendSimpleExportRspElementBegin(Buffer& out);
574 static void _appendSimpleExportRspElementEnd(Buffer& out);
|
575 kumpf 1.28
576 static void _appendEMethodResponseElementBegin(
|
577 david.dillard 1.77 Buffer& out,
578 const CIMName& name);
579
|
580 kumpf 1.28 static void _appendEMethodResponseElementEnd(
|
581 david.dillard 1.77 Buffer& out);
|
582 mike 1.21
|
583 kumpf 1.85 XmlWriter();
|
584 mike 1.21 };
585
|
586 thilo.boehm 1.92 //==============================================================================
587 //
588 // _toString() routines:
589 //
590 //==============================================================================
591
592 inline void _toString(Buffer& out, Boolean x)
593 {
594 XmlWriter::append(out, x);
595 }
596
597 inline void _toString(Buffer& out, Uint8 x)
598 {
599 XmlWriter::append(out, Uint32(x));
600 }
601
602 inline void _toString(Buffer& out, Sint8 x)
603 {
604 XmlWriter::append(out, Sint32(x));
605 }
606
607 thilo.boehm 1.92 inline void _toString(Buffer& out, Uint16 x)
608 {
609 XmlWriter::append(out, Uint32(x));
610 }
611
612 inline void _toString(Buffer& out, Sint16 x)
613 {
614 XmlWriter::append(out, Sint32(x));
615 }
616
617 inline void _toString(Buffer& out, Uint32 x)
618 {
619 XmlWriter::append(out, x);
620 }
621
622 inline void _toString(Buffer& out, Sint32 x)
623 {
624 XmlWriter::append(out, x);
625 }
626
627 inline void _toString(Buffer& out, Uint64 x)
628 thilo.boehm 1.92 {
629 XmlWriter::append(out, x);
630 }
631
632 inline void _toString(Buffer& out, Sint64 x)
633 {
634 XmlWriter::append(out, x);
635 }
636
637 inline void _toString(Buffer& out, Real32 x)
638 {
639 XmlWriter::append(out, Real64(x));
640 }
641
642 inline void _toString(Buffer& out, Real64 x)
643 {
644 XmlWriter::append(out, x);
645 }
646
647 inline void _toString(Buffer& out, Char16 x)
648 {
649 thilo.boehm 1.92 // We need to convert the Char16 to UTF8 then append the UTF8
650 // character into the array.
651 // NOTE: The UTF8 character could be several bytes long.
652 // WARNING: This function will put in replacement character for
653 // all characters that have surogate pairs.
654
655 char str[6];
656 memset(str,0x00,sizeof(str));
657 char* charIN = (char *)&x;
658
659 const Uint16 *strsrc = (Uint16 *)charIN;
660 Uint16 *endsrc = (Uint16 *)&charIN[1];
661
662 Uint8 *strtgt = (Uint8 *)str;
663 Uint8 *endtgt = (Uint8 *)&str[5];
664
665 UTF16toUTF8(&strsrc, endsrc, &strtgt, endtgt);
666 out.append(str, UTF_8_COUNT_TRAIL_BYTES(str[0]) +1);
667 }
668
669 inline void _toString(Buffer& out, const String& x)
670 thilo.boehm 1.92 {
671 out << x;
672 }
673
674 inline void _toString(Buffer& out, const CIMDateTime& x)
675 {
676 out << x.toString();
677 }
678
679 inline void _toString(Buffer& out, const CIMObjectPath& x)
680 {
681 out << x.toString();
682 }
683
684 inline void _toString(Buffer& out, const CIMObject& x)
685 {
686 out << x.toString();
687 }
688 inline void _toString(Buffer& out, const CIMInstance& x)
689 {
690 out << CIMObject(x).toString();
691 thilo.boehm 1.92 }
692
693 template<class T>
694 void _toString(Buffer& out, const T* p, Uint32 size)
695 {
696 while (size--)
697 {
698 _toString(out, *p++);
699 out.append(' ');
700 }
701 }
|
702 kumpf 1.54
|
703 mike 1.21 PEGASUS_NAMESPACE_END
704
705 #endif /* Pegasus_XmlWriter_h */
|