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.4 //EXP_PULL_BEGIN
|
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 karl 1.92.4.3
|
145 kumpf 1.40 static void appendClassElement(
|
146 mike 1.75 Buffer& out,
|
147 kumpf 1.40 const CIMConstClass& cimclass);
148
149 static void printClassElement(
150 const CIMConstClass& cimclass,
151 PEGASUS_STD(ostream)& os=PEGASUS_STD(cout));
152
153 static void appendInstanceElement(
|
154 mike 1.75 Buffer& out,
|
155 karl 1.92.4.2 const CIMConstInstance& instance,
156 Boolean includeQualifiers = true,
157 Boolean includeClassOrigin = true,
158 const CIMPropertyList& propertyList = CIMPropertyList());
159
|
160 kumpf 1.40
161 static void printInstanceElement(
162 const CIMConstInstance& instance,
|
163 kumpf 1.41 PEGASUS_STD(ostream)& os=PEGASUS_STD(cout));
164
165 static void appendObjectElement(
|
166 mike 1.75 Buffer& out,
|
167 karl 1.92.4.2 const CIMConstObject& object,
168 Boolean includeQualifiers = true,
169 Boolean includeClassOrigin = true,
170 const CIMPropertyList& propertyList = CIMPropertyList());
|
171 kumpf 1.41
172 static void appendPropertyElement(
|
173 mike 1.75 Buffer& out,
|
174 karl 1.92.4.2 const CIMConstProperty& property,
175 Boolean includeQualifiers = true,
176 Boolean includeClassOrigin = true);
|
177 kumpf 1.41
178 static void printPropertyElement(
179 const CIMConstProperty& property,
180 PEGASUS_STD(ostream)& os=PEGASUS_STD(cout));
181
182 static void appendMethodElement(
|
183 mike 1.75 Buffer& out,
|
184 kumpf 1.41 const CIMConstMethod& method);
185
186 static void printMethodElement(
187 const CIMConstMethod& method,
188 PEGASUS_STD(ostream)& os=PEGASUS_STD(cout));
189
190 static void appendParameterElement(
|
191 mike 1.75 Buffer& out,
|
192 kumpf 1.41 const CIMConstParameter& parameter);
193
194 static void printParameterElement(
195 const CIMConstParameter& parameter,
196 PEGASUS_STD(ostream)& os=PEGASUS_STD(cout));
197
198 static void appendParamValueElement(
|
199 mike 1.75 Buffer& out,
|
200 kumpf 1.41 const CIMParamValue& paramValue);
201
202 static void printParamValueElement(
203 const CIMParamValue& paramValue,
204 PEGASUS_STD(ostream)& os=PEGASUS_STD(cout));
205
206 static void appendQualifierElement(
|
207 mike 1.75 Buffer& out,
|
208 kumpf 1.41 const CIMConstQualifier& qualifier);
209
210 static void printQualifierElement(
211 const CIMConstQualifier& qualifier,
212 PEGASUS_STD(ostream)& os=PEGASUS_STD(cout));
213
214 static void appendQualifierDeclElement(
|
215 mike 1.75 Buffer& out,
|
216 kumpf 1.41 const CIMConstQualifierDecl& qualifierDecl);
217
218 static void printQualifierDeclElement(
219 const CIMConstQualifierDecl& qualifierDecl,
|
220 kumpf 1.40 PEGASUS_STD(ostream)& os=PEGASUS_STD(cout));
221
|
222 kumpf 1.42 static void appendQualifierFlavorEntity(
|
223 mike 1.75 Buffer& out,
|
224 kumpf 1.52 const CIMFlavor & flavor);
|
225 kumpf 1.42
|
226 kumpf 1.43 static void appendScopeElement(
|
227 mike 1.75 Buffer& out,
|
228 kumpf 1.51 const CIMScope & scope);
|
229 kumpf 1.43
|
230 kumpf 1.28 static void appendMethodCallHeader(
|
231 david.dillard 1.77 Buffer& out,
232 const char* host,
233 const CIMName& cimMethod,
234 const String& cimObject,
235 const String& authenticationHeader,
236 HttpMethod httpMethod,
|
237 kumpf 1.78 const AcceptLanguageList& acceptLanguages,
238 const ContentLanguageList& contentLanguages,
|
239 mike 1.88 Uint32 contentLength,
240 bool binaryRequest = false,
241 bool binaryResponse = false);
|
242 mike 1.21
|
243 w.white 1.68 static void appendMethodResponseHeader(
|
244 mike 1.75 Buffer& out,
|
245 w.white 1.68 HttpMethod httpMethod,
|
246 kumpf 1.78 const ContentLanguageList& contentLanguages,
|
247 w.white 1.68 Uint32 contentLength,
|
248 mike 1.88 Uint64 serverResponseTime = 0,
249 bool binaryResponse = false);
|
250 w.white 1.68
|
251 kumpf 1.34 static void appendHttpErrorResponseHeader(
|
252 david.dillard 1.77 Buffer& out,
253 const String& status,
254 const String& cimError = String::EMPTY,
255 const String& errorDetail = String::EMPTY);
|
256 kumpf 1.34
|
257 kumpf 1.28 static void appendUnauthorizedResponseHeader(
|
258 david.dillard 1.77 Buffer& out,
|
259 kumpf 1.28 const String& content);
|
260 mike 1.21
|
261 gerarda 1.63 #ifdef PEGASUS_KERBEROS_AUTHENTICATION
262 static void appendOKResponseHeader(
|
263 david.dillard 1.77 Buffer& out,
|
264 gerarda 1.63 const String& content);
265 #endif
|
266 kumpf 1.86
|
267 karl 1.83 static void appendParamTypeAndEmbeddedObjAttrib(
268 Buffer& out,
269 const CIMType& type);
|
270 gerarda 1.63
|
271 kumpf 1.26 static void appendReturnValueElement(
|
272 david.dillard 1.77 Buffer& out,
273 const CIMValue& value);
|
274 kumpf 1.26
275 static void appendBooleanIParameter(
|
276 david.dillard 1.77 Buffer& out,
277 const char* name,
278 Boolean flag);
|
279 karl 1.92.4.3 //EXP_PULL_BEGIN
|
280 karl 1.92.4.1 static void appendBooleanParameter(
281 Buffer& out,
282 const char* name,
283 Boolean flag);
284
285 static void appendBooleanIReturnValue(
286 Buffer& out,
287 const char* name,
288 Boolean flag);
289
290 static void appendUint32IParameter(
291 Buffer& out,
292 const char* name,
293 const Uint32Arg& val,
294 const Boolean required);
295 /* KS_PULL DELETE
296 static void appendUint64Parameter(
297 Buffer& out,
298 const char* name,
299 const Uint64 val);
300 */
301 karl 1.92.4.1 static void appendUint64ReturnValue(
302 Buffer& out,
303 const char* name,
304 const Uint64Arg& val);
|
305 karl 1.92.4.3 //EXP_PULL_END
|
306 karl 1.92.4.1
|
307 kumpf 1.26 static void appendStringIParameter(
|
308 david.dillard 1.77 Buffer& out,
309 const char* name,
310 const String& str);
|
311 mike 1.21
|
312 karl 1.92.4.3 //EXP_PULL_BEGIN
|
313 karl 1.92.4.1 static void appendStringIParameterIfNotEmpty(
314 Buffer& out,
315 const char* name,
316 const String& str);
317
318 static void appendStringParameter(
319 Buffer& out,
320 const char* name,
321 const String& str);
322 static void appendStringIReturnValue(
323 Buffer& out,
324 const char* name,
325 const String& str);
326 //EXP_PULL_END
|
327 kumpf 1.26 static void appendClassNameIParameter(
|
328 david.dillard 1.77 Buffer& out,
329 const char* name,
330 const CIMName& className);
|
331 mike 1.21
|
332 kumpf 1.26 static void appendInstanceNameIParameter(
|
333 david.dillard 1.77 Buffer& out,
334 const char* name,
335 const CIMObjectPath& instanceName);
|
336 mike 1.21
|
337 kumpf 1.26 static void appendObjectNameIParameter(
|
338 david.dillard 1.77 Buffer& out,
339 const char* name,
340 const CIMObjectPath& objectName);
|
341 mike 1.21
|
342 kumpf 1.26 static void appendClassIParameter(
|
343 david.dillard 1.77 Buffer& out,
344 const char* name,
345 const CIMConstClass& cimClass);
|
346 mike 1.21
|
347 kumpf 1.26 static void appendInstanceIParameter(
|
348 david.dillard 1.77 Buffer& out,
349 const char* name,
350 const CIMConstInstance& instance);
|
351 mike 1.21
|
352 kumpf 1.26 static void appendNamedInstanceIParameter(
|
353 david.dillard 1.77 Buffer& out,
354 const char* name,
355 const CIMInstance& namedInstance) ;
|
356 mike 1.22
|
357 kumpf 1.26 static void appendPropertyNameIParameter(
|
358 david.dillard 1.77 Buffer& out,
359 const CIMName& propertyName);
|
360 mike 1.21
|
361 kumpf 1.26 static void appendPropertyValueIParameter(
|
362 david.dillard 1.77 Buffer& out,
363 const char* name,
364 const CIMValue& value);
|
365 mike 1.21
|
366 kumpf 1.26 static void appendPropertyListIParameter(
|
367 david.dillard 1.77 Buffer& out,
368 const CIMPropertyList& propertyList);
|
369 mike 1.21
|
370 kumpf 1.26 static void appendQualifierDeclarationIParameter(
|
371 david.dillard 1.77 Buffer& out,
372 const char* name,
373 const CIMConstQualifierDecl& qualifierDecl);
|
374 kumpf 1.34
|
375 mike 1.75 static Buffer formatHttpErrorRspMessage(
|
376 david.dillard 1.77 const String& status,
377 const String& cimError = String::EMPTY,
378 const String& errorDetail = String::EMPTY);
|
379 mike 1.21
|
380 mike 1.75 static Buffer formatSimpleMethodReqMessage(
|
381 david.dillard 1.77 const char* host,
382 const CIMNamespaceName& nameSpace,
383 const CIMObjectPath& path,
384 const CIMName& methodName,
385 const Array<CIMParamValue>& parameters,
386 const String& messageId,
|
387 kumpf 1.59 HttpMethod httpMethod,
|
388 chuck 1.62 const String& authenticationHeader,
|
389 kumpf 1.78 const AcceptLanguageList& httpAcceptLanguages,
|
390 mike 1.88 const ContentLanguageList& httpContentLanguages,
391 bool binaryResponse);
|
392 mike 1.21
|
393 david.dillard 1.77 static Buffer formatSimpleMethodRspMessage(
394 const CIMName& methodName,
|
395 w.white 1.68 const String& messageId,
396 HttpMethod httpMethod,
|
397 kumpf 1.78 const ContentLanguageList& httpContentLanguages,
|
398 karl 1.92.4.1 const Buffer& bodyParams,
|
399 david.dillard 1.77 const Buffer& body,
400 Uint64 serverResponseTime,
401 Boolean isFirst = true,
402 Boolean isLast = true);
|
403 mike 1.21
|
404 mike 1.75 static Buffer formatSimpleMethodErrorRspMessage(
|
405 david.dillard 1.77 const CIMName& methodName,
406 const String& messageId,
|
407 kumpf 1.59 HttpMethod httpMethod,
|
408 david.dillard 1.77 const CIMException& cimException);
|
409 kumpf 1.27
|
410 mike 1.75 static Buffer formatSimpleIMethodReqMessage(
|
411 david.dillard 1.77 const char* host,
412 const CIMNamespaceName& nameSpace,
413 const CIMName& iMethodName,
414 const String& messageId,
|
415 kumpf 1.59 HttpMethod httpMethod,
|
416 mike 1.22 const String& authenticationHeader,
|
417 kumpf 1.78 const AcceptLanguageList& httpAcceptLanguages,
418 const ContentLanguageList& httpContentLanguages,
|
419 mike 1.88 const Buffer& body,
420 bool binaryResponse);
|
421 mike 1.21
|
422 david.dillard 1.77 static Buffer formatSimpleIMethodRspMessage(
423 const CIMName& iMethodName,
|
424 mike 1.21 const String& messageId,
|
425 kumpf 1.59 HttpMethod httpMethod,
|
426 kumpf 1.78 const ContentLanguageList& httpContentLanguages,
|
427 karl 1.92.4.1 const Buffer& rtnParams,
|
428 david.dillard 1.77 const Buffer& body,
429 Uint64 serverResponseTime,
430 Boolean isFirst = true,
431 Boolean isLast = true);
|
432 mike 1.21
|
433 mike 1.88
|
434 mike 1.75 static Buffer formatSimpleIMethodErrorRspMessage(
|
435 david.dillard 1.77 const CIMName& iMethodName,
436 const String& messageId,
|
437 kumpf 1.59 HttpMethod httpMethod,
|
438 david.dillard 1.77 const CIMException& cimException);
|
439 mike 1.22
|
440 kumpf 1.61 static void appendInstanceEParameter(
|
441 david.dillard 1.77 Buffer& out,
442 const char* name,
443 const CIMInstance& instance);
|
444 kumpf 1.61
|
445 kumpf 1.26 static void appendEMethodRequestHeader(
|
446 david.dillard 1.77 Buffer& out,
|
447 kumpf 1.38 const char* requestUri,
|
448 david.dillard 1.77 const char* host,
449 const CIMName& cimMethod,
|
450 kumpf 1.59 HttpMethod httpMethod,
|
451 mike 1.22 const String& authenticationHeader,
|
452 kumpf 1.78 const AcceptLanguageList& acceptLanguages,
453 const ContentLanguageList& contentLanguages,
|
454 david.dillard 1.77 Uint32 contentLength);
|
455 mike 1.22
|
456 kumpf 1.26 static void appendEMethodResponseHeader(
|
457 david.dillard 1.77 Buffer& out,
|
458 kumpf 1.59 HttpMethod httpMethod,
|
459 kumpf 1.78 const ContentLanguageList& contentLanguages,
|
460 david.dillard 1.77 Uint32 contentLength);
|
461 mike 1.22
|
462 mike 1.75 static Buffer formatSimpleEMethodReqMessage(
|
463 kumpf 1.38 const char* requestUri,
|
464 david.dillard 1.77 const char* host,
465 const CIMName& eMethodName,
466 const String& messageId,
467 HttpMethod httpMethod,
468 const String& authenticationHeader,
|
469 kumpf 1.78 const AcceptLanguageList& httpAcceptLanguages,
470 const ContentLanguageList& httpContentLanguages,
|
471 david.dillard 1.77 const Buffer& body);
|
472 mike 1.22
|
473 mike 1.75 static Buffer formatSimpleEMethodRspMessage(
|
474 david.dillard 1.77 const CIMName& eMethodName,
|
475 mike 1.22 const String& messageId,
|
476 kumpf 1.59 HttpMethod httpMethod,
|
477 kumpf 1.78 const ContentLanguageList& httpContentLanguages,
|
478 david.dillard 1.77 const Buffer& body);
|
479 kumpf 1.27
|
480 mike 1.75 static Buffer formatSimpleEMethodErrorRspMessage(
|
481 david.dillard 1.77 const CIMName& eMethodName,
482 const String& messageId,
|
483 kumpf 1.59 HttpMethod httpMethod,
|
484 david.dillard 1.77 const CIMException& cimException);
|
485 mike 1.22
|
486 kumpf 1.26 static String getNextMessageId();
|
487 mike 1.21
|
488 kumpf 1.57 /** Converts the given CIMKeyBinding type to one of the following:
|
489 kumpf 1.50 "boolean", "string", or "numeric"
490 */
|
491 thilo.boehm 1.87 static const StrLit keyBindingTypeToString (CIMKeyBinding::Type type);
|
492 kumpf 1.91
|
493 mike 1.21 private:
|
494 kumpf 1.28
495 static void _appendMessageElementBegin(
|
496 david.dillard 1.77 Buffer& out,
497 const String& messageId);
498 static void _appendMessageElementEnd(
499 Buffer& out);
|
500 kumpf 1.28
|
501 mike 1.75 static void _appendSimpleReqElementBegin(Buffer& out);
502 static void _appendSimpleReqElementEnd(Buffer& out);
|
503 kumpf 1.28
504 static void _appendMethodCallElementBegin(
|
505 david.dillard 1.77 Buffer& out,
506 const CIMName& name);
507
|
508 kumpf 1.28 static void _appendMethodCallElementEnd(
|
509 david.dillard 1.77 Buffer& out);
|
510 kumpf 1.28
511 static void _appendIMethodCallElementBegin(
|
512 david.dillard 1.77 Buffer& out,
513 const CIMName& name);
514 static void _appendIMethodCallElementEnd(
515 Buffer& out);
|
516 kumpf 1.28
|
517 karl 1.92.4.3 //EXP_PULL_BEGIN
|
518 karl 1.92.4.1 static void _appendParamValueElementBegin(
519 Buffer& out,
520 const char* name);
|
521 karl 1.92.4.4
|
522 karl 1.92.4.1 static void _appendParamValueElementEnd(
523 Buffer& out);
|
524 karl 1.92.4.4 //EXP_PULL_END
|
525 karl 1.92.4.1
|
526 kumpf 1.28 static void _appendIParamValueElementBegin(
|
527 david.dillard 1.77 Buffer& out,
528 const char* name);
|
529 karl 1.92.4.1
530 static void _appendIParamValueElementEnd(
|
531 david.dillard 1.77 Buffer& out);
|
532 kumpf 1.28
|
533 mike 1.75 static void _appendSimpleRspElementBegin(Buffer& out);
534 static void _appendSimpleRspElementEnd(Buffer& out);
|
535 kumpf 1.28
536 static void _appendMethodResponseElementBegin(
|
537 david.dillard 1.77 Buffer& out,
538 const CIMName& name);
539 static void _appendMethodResponseElementEnd(
540 Buffer& out);
|
541 kumpf 1.28
542 static void _appendIMethodResponseElementBegin(
|
543 david.dillard 1.77 Buffer& out,
544 const CIMName& name);
545 static void _appendIMethodResponseElementEnd(
546 Buffer& out);
|
547 kumpf 1.28
548 static void _appendErrorElement(
|
549 david.dillard 1.77 Buffer& out,
550 const CIMException& cimException);
|
551 kumpf 1.28
|
552 mike 1.75 static void _appendIReturnValueElementBegin(Buffer& out);
553 static void _appendIReturnValueElementEnd(Buffer& out);
|
554 kumpf 1.28
|
555 karl 1.92.4.4 //EXP_PULL_BEGIN
|
556 karl 1.92.4.1 static void _appendIReturnValueElementWithNameBegin(
557 Buffer& out,
558 const char* name);
|
559 karl 1.92.4.4 // EXP_PULL_END
560
|
561 mike 1.75 static void _appendSimpleExportReqElementBegin(Buffer& out);
562 static void _appendSimpleExportReqElementEnd(Buffer& out);
|
563 kumpf 1.28
564 static void _appendEMethodCallElementBegin(
|
565 david.dillard 1.77 Buffer& out,
566 const CIMName& name);
567
|
568 kumpf 1.28 static void _appendEMethodCallElementEnd(
|
569 david.dillard 1.77 Buffer& out);
|
570 kumpf 1.61
571 static void _appendEParamValueElementBegin(
|
572 david.dillard 1.77 Buffer& out,
573 const char* name);
574 static void _appendEParamValueElementEnd(
575 Buffer& out);
|
576 kumpf 1.28
|
577 mike 1.75 static void _appendSimpleExportRspElementBegin(Buffer& out);
578 static void _appendSimpleExportRspElementEnd(Buffer& out);
|
579 kumpf 1.28
580 static void _appendEMethodResponseElementBegin(
|
581 david.dillard 1.77 Buffer& out,
582 const CIMName& name);
583
|
584 kumpf 1.28 static void _appendEMethodResponseElementEnd(
|
585 david.dillard 1.77 Buffer& out);
|
586 mike 1.21
|
587 kumpf 1.85 XmlWriter();
|
588 mike 1.21 };
589
|
590 thilo.boehm 1.92 //==============================================================================
591 //
592 // _toString() routines:
593 //
594 //==============================================================================
595
596 inline void _toString(Buffer& out, Boolean x)
597 {
598 XmlWriter::append(out, x);
599 }
600
601 inline void _toString(Buffer& out, Uint8 x)
602 {
603 XmlWriter::append(out, Uint32(x));
604 }
605
606 inline void _toString(Buffer& out, Sint8 x)
607 {
608 XmlWriter::append(out, Sint32(x));
609 }
610
611 thilo.boehm 1.92 inline void _toString(Buffer& out, Uint16 x)
612 {
613 XmlWriter::append(out, Uint32(x));
614 }
615
616 inline void _toString(Buffer& out, Sint16 x)
617 {
618 XmlWriter::append(out, Sint32(x));
619 }
620
621 inline void _toString(Buffer& out, Uint32 x)
622 {
623 XmlWriter::append(out, x);
624 }
625
626 inline void _toString(Buffer& out, Sint32 x)
627 {
628 XmlWriter::append(out, x);
629 }
630
631 inline void _toString(Buffer& out, Uint64 x)
632 thilo.boehm 1.92 {
633 XmlWriter::append(out, x);
634 }
635
636 inline void _toString(Buffer& out, Sint64 x)
637 {
638 XmlWriter::append(out, x);
639 }
640
641 inline void _toString(Buffer& out, Real32 x)
642 {
643 XmlWriter::append(out, Real64(x));
644 }
645
646 inline void _toString(Buffer& out, Real64 x)
647 {
648 XmlWriter::append(out, x);
649 }
650
651 inline void _toString(Buffer& out, Char16 x)
652 {
653 thilo.boehm 1.92 // We need to convert the Char16 to UTF8 then append the UTF8
654 // character into the array.
655 // NOTE: The UTF8 character could be several bytes long.
656 // WARNING: This function will put in replacement character for
657 // all characters that have surogate pairs.
658
659 char str[6];
660 memset(str,0x00,sizeof(str));
661 char* charIN = (char *)&x;
662
663 const Uint16 *strsrc = (Uint16 *)charIN;
664 Uint16 *endsrc = (Uint16 *)&charIN[1];
665
666 Uint8 *strtgt = (Uint8 *)str;
667 Uint8 *endtgt = (Uint8 *)&str[5];
668
669 UTF16toUTF8(&strsrc, endsrc, &strtgt, endtgt);
670 out.append(str, UTF_8_COUNT_TRAIL_BYTES(str[0]) +1);
671 }
672
673 inline void _toString(Buffer& out, const String& x)
674 thilo.boehm 1.92 {
675 out << x;
676 }
677
678 inline void _toString(Buffer& out, const CIMDateTime& x)
679 {
680 out << x.toString();
681 }
682
683 inline void _toString(Buffer& out, const CIMObjectPath& x)
684 {
685 out << x.toString();
686 }
687
688 inline void _toString(Buffer& out, const CIMObject& x)
689 {
690 out << x.toString();
691 }
692 inline void _toString(Buffer& out, const CIMInstance& x)
693 {
694 out << CIMObject(x).toString();
695 thilo.boehm 1.92 }
696
697 template<class T>
698 void _toString(Buffer& out, const T* p, Uint32 size)
699 {
700 while (size--)
701 {
702 _toString(out, *p++);
703 out.append(' ');
704 }
705 }
|
706 kumpf 1.54
|
707 mike 1.21 PEGASUS_NAMESPACE_END
708
709 #endif /* Pegasus_XmlWriter_h */
|