(file) Return to XmlWriter.h CVS log (file) (dir) Up to [Pegasus] / pegasus / src / Pegasus / Common

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

No CVS admin address has been configured
Powered by
ViewCVS 0.9.2