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

Diff for /pegasus/src/Pegasus/Common/XmlWriter.h between version 1.69 and 1.92.4.12

version 1.69, 2004/10/17 20:39:18 version 1.92.4.12, 2014/08/19 18:07:57
Line 1 
Line 1 
 //%2004////////////////////////////////////////////////////////////////////////  //%LICENSE////////////////////////////////////////////////////////////////
 // //
 // Copyright (c) 2000, 2001, 2002 BMC Software; Hewlett-Packard Development  // Licensed to The Open Group (TOG) under one or more contributor license
 // Company, L.P.; IBM Corp.; The Open Group; Tivoli Systems.  // agreements.  Refer to the OpenPegasusNOTICE.txt file distributed with
 // Copyright (c) 2003 BMC Software; Hewlett-Packard Development Company, L.P.;  // this work for additional information regarding copyright ownership.
 // IBM Corp.; EMC Corporation, The Open Group.  // Each contributor licenses this file to you under the OpenPegasus Open
 // Copyright (c) 2004 BMC Software; Hewlett-Packard Development Company, L.P.;  // Source License; you may not use this file except in compliance with the
 // IBM Corp.; EMC Corporation; VERITAS Software Corporation; The Open Group.  // License.
 // //
 // Permission is hereby granted, free of charge, to any person obtaining a copy  // Permission is hereby granted, free of charge, to any person obtaining a
 // of this software and associated documentation files (the "Software"), to  // copy of this software and associated documentation files (the "Software"),
 // deal in the Software without restriction, including without limitation the  // to deal in the Software without restriction, including without limitation
 // rights to use, copy, modify, merge, publish, distribute, sublicense, and/or  // the rights to use, copy, modify, merge, publish, distribute, sublicense,
 // sell copies of the Software, and to permit persons to whom the Software is  // and/or sell copies of the Software, and to permit persons to whom the
 // furnished to do so, subject to the following conditions:  // Software is furnished to do so, subject to the following conditions:
 // //
 // THE ABOVE COPYRIGHT NOTICE AND THIS PERMISSION NOTICE SHALL BE INCLUDED IN  // The above copyright notice and this permission notice shall be included
 // ALL COPIES OR SUBSTANTIAL PORTIONS OF THE SOFTWARE. THE SOFTWARE IS PROVIDED  // in all copies or substantial portions of the Software.
 // "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT  
 // LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR  
 // PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT  
 // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN  
 // ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION  
 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.  
 // //
 //==============================================================================  // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
 //  // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
 // Author: Mike Brasher (mbrasher@bmc.com)  // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
   // IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
   // CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
   // TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
   // SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 // //
 // Modified By:  //////////////////////////////////////////////////////////////////////////
 //         Nitin Upasani, Hewlett-Packard Company (Nitin_Upasani@hp.com)  
 //         Nag Boranna, Hewlett-Packard Company (nagaraja_boranna@hp.com)  
 //         Roger Kumpf, Hewlett-Packard Company (roger_kumpf@hp.com)  
 //         Carol Ann Krug Graves, Hewlett-Packard Company  
 //             (carolann_graves@hp.com)  
 //         Brian G. Campbell, EMC (campbell_brian@emc.com) - PEP140/phase1  
 //                 Willis White (whiwill@us.ibm.com) PEP 127 and 128  
 // //
 //%///////////////////////////////////////////////////////////////////////////// //%/////////////////////////////////////////////////////////////////////////////
  
Line 46 
Line 37 
 #include <Pegasus/Common/InternalException.h> #include <Pegasus/Common/InternalException.h>
 #include <Pegasus/Common/ArrayInternal.h> #include <Pegasus/Common/ArrayInternal.h>
 #include <Pegasus/Common/String.h> #include <Pegasus/Common/String.h>
 #include <Pegasus/Common/Indentor.h>  
 #include <Pegasus/Common/CIMObject.h> #include <Pegasus/Common/CIMObject.h>
 #include <Pegasus/Common/CIMClass.h> #include <Pegasus/Common/CIMClass.h>
 #include <Pegasus/Common/CIMInstance.h> #include <Pegasus/Common/CIMInstance.h>
Line 59 
Line 49 
 #include <Pegasus/Common/CIMObjectPath.h> #include <Pegasus/Common/CIMObjectPath.h>
 #include <Pegasus/Common/CIMPropertyList.h> #include <Pegasus/Common/CIMPropertyList.h>
 #include <Pegasus/Common/CIMParamValue.h> #include <Pegasus/Common/CIMParamValue.h>
   #include <Pegasus/Common/CommonUTF.h>
 #include <Pegasus/Common/Message.h> #include <Pegasus/Common/Message.h>
 #include <Pegasus/Common/Linkage.h> #include <Pegasus/Common/Linkage.h>
 #include <Pegasus/Common/ContentLanguages.h>  // l10n  #include <Pegasus/Common/ContentLanguageList.h>
 #include <Pegasus/Common/AcceptLanguages.h>   // l10n  #include <Pegasus/Common/AcceptLanguageList.h>
   #include <Pegasus/Common/Buffer.h>
   #include <Pegasus/Common/StrLit.h>
   #include <Pegasus/Common/XmlGenerator.h>
   #include <Pegasus/Common/UintArgs.h>
  
 PEGASUS_NAMESPACE_BEGIN PEGASUS_NAMESPACE_BEGIN
  
 // l10n - added accept language and content language support below  class PEGASUS_COMMON_LINKAGE XmlWriter : public XmlGenerator
   
 class PEGASUS_COMMON_LINKAGE XmlWriter  
 { {
 public: public:
  
     static void append(Array<Sint8>& out, const Char16& x);  
   
     static void append(Array<Sint8>& out, char x)  
     {  
       out.append(x);  
     }  
   
     static void append(Array<Sint8>& out, Boolean x);  
   
     static void append(Array<Sint8>& out, Uint32 x);  
   
     static void append(Array<Sint8>& out, Sint32 x);  
   
     static void append(Array<Sint8>& out, Uint64 x);  
   
     static void append(Array<Sint8>& out, Sint64 x);  
   
     static void append(Array<Sint8>& out, Real32 x);  
   
     static void append(Array<Sint8>& out, Real64 x);  
   
     static void append(Array<Sint8>& out, const char* str);  
   
     static void append(Array<Sint8>& out, const String& str);  
   
     static void append(Array<Sint8>& out, const Indentor& x);  
   
     static void appendSpecial(Array<Sint8>& out, const Char16& x);  
   
     static void appendSpecial(Array<Sint8>& out, char x);  
   
     static void appendSpecial(Array<Sint8>& out, const char* str);  
   
     static void appendSpecial(Array<Sint8>& out, const String& str);  
   
     static String encodeURICharacters(Array<Sint8> uriString);  
     static String encodeURICharacters(String uriString);  
   
     static void appendLocalNameSpacePathElement(     static void appendLocalNameSpacePathElement(
         Array<Sint8>& out,          Buffer& out,
         const CIMNamespaceName& nameSpace);         const CIMNamespaceName& nameSpace);
  
     static void appendNameSpacePathElement(     static void appendNameSpacePathElement(
         Array<Sint8>& out,          Buffer& out,
         const String& host,         const String& host,
         const CIMNamespaceName& nameSpace);         const CIMNamespaceName& nameSpace);
  
     static void appendClassNameElement(     static void appendClassNameElement(
         Array<Sint8>& out,          Buffer& out,
         const CIMName& className);         const CIMName& className);
  
     static void appendInstanceNameElement(     static void appendInstanceNameElement(
         Array<Sint8>& out,          Buffer& out,
         const CIMObjectPath& instanceName);         const CIMObjectPath& instanceName);
  
     static void appendClassPathElement(     static void appendClassPathElement(
         Array<Sint8>& out,          Buffer& out,
         const CIMObjectPath& classPath);         const CIMObjectPath& classPath);
  
     static void appendInstancePathElement(     static void appendInstancePathElement(
         Array<Sint8>& out,          Buffer& out,
         const CIMObjectPath& instancePath);         const CIMObjectPath& instancePath);
  
     static void appendLocalClassPathElement(     static void appendLocalClassPathElement(
         Array<Sint8>& out,          Buffer& out,
         const CIMObjectPath& classPath);         const CIMObjectPath& classPath);
  
     static void appendLocalInstancePathElement(     static void appendLocalInstancePathElement(
         Array<Sint8>& out,          Buffer& out,
         const CIMObjectPath& instancePath);         const CIMObjectPath& instancePath);
  
     static void appendLocalObjectPathElement(     static void appendLocalObjectPathElement(
         Array<Sint8>& out,          Buffer& out,
         const CIMObjectPath& objectPath);         const CIMObjectPath& objectPath);
  
     static void appendValueElement(     static void appendValueElement(
         Array<Sint8>& out,          Buffer& out,
         const CIMValue& value);         const CIMValue& value);
  
     static void printValueElement(     static void printValueElement(
Line 156 
Line 111 
         PEGASUS_STD(ostream)& os=PEGASUS_STD(cout));         PEGASUS_STD(ostream)& os=PEGASUS_STD(cout));
  
     static void appendValueObjectWithPathElement(     static void appendValueObjectWithPathElement(
         Array<Sint8>& out,          Buffer& out,
         const CIMObject& objectWithPath);          const CIMObject& objectWithPath,
           Boolean includeQualifiers = true,
           Boolean includeClassOrigin = true,
           Boolean isClassObject = false,
           const CIMPropertyList& propertyList = CIMPropertyList());
  
       // Appends classPath or instancePath based on isClassPath param
     static void appendValueReferenceElement(     static void appendValueReferenceElement(
         Array<Sint8>& out,          Buffer& out,
         const CIMObjectPath& reference,         const CIMObjectPath& reference,
         Boolean putValueWrapper);          Boolean isClassPath);
   
       // Append either classPath or InstancePath Element depending on
       // isClassPath value.
       static void appendClassOrInstancePathElement(
           Buffer& out,
           const CIMObjectPath& reference,
           Boolean isClassPath);
  
     static void printValueReferenceElement(     static void printValueReferenceElement(
         const CIMObjectPath& reference,         const CIMObjectPath& reference,
           Boolean isClassPath,
         PEGASUS_STD(ostream)& os=PEGASUS_STD(cout));         PEGASUS_STD(ostream)& os=PEGASUS_STD(cout));
  
     static void appendValueNamedInstanceElement(     static void appendValueNamedInstanceElement(
         Array<Sint8>& out,          Buffer& out,
         const CIMInstance& namedInstance);          const CIMInstance& namedInstance,
           Boolean includeQualifiers = true,
           Boolean includeClassOrigin = true,
           const CIMPropertyList& propertyList = CIMPropertyList());
   
   //EXP_PULL_BEGIN
       static void appendValueInstanceWithPathElement(
           Buffer& out,
           const CIMInstance& namedInstance,
           Boolean includeQualifiers = true,
           Boolean includeClassOrigin = true,
           const CIMPropertyList& propertyList = CIMPropertyList());
   //EXP_PULL_END
  
     static void appendClassElement(     static void appendClassElement(
         Array<Sint8>& out,          Buffer& out,
         const CIMConstClass& cimclass);         const CIMConstClass& cimclass);
  
     static void printClassElement(     static void printClassElement(
Line 181 
Line 161 
         PEGASUS_STD(ostream)& os=PEGASUS_STD(cout));         PEGASUS_STD(ostream)& os=PEGASUS_STD(cout));
  
     static void appendInstanceElement(     static void appendInstanceElement(
         Array<Sint8>& out,          Buffer& out,
         const CIMConstInstance& instance);          const CIMConstInstance& instance,
           Boolean includeQualifiers = true,
           Boolean includeClassOrigin = true,
           const CIMPropertyList& propertyList = CIMPropertyList());
   
  
     static void printInstanceElement(     static void printInstanceElement(
         const CIMConstInstance& instance,         const CIMConstInstance& instance,
         PEGASUS_STD(ostream)& os=PEGASUS_STD(cout));         PEGASUS_STD(ostream)& os=PEGASUS_STD(cout));
  
     static void appendObjectElement(     static void appendObjectElement(
         Array<Sint8>& out,          Buffer& out,
         const CIMConstObject& object);          const CIMConstObject& object,
           Boolean includeQualifiers = true,
           Boolean includeClassOrigin = true,
           const CIMPropertyList& propertyList = CIMPropertyList());
  
     static void appendPropertyElement(     static void appendPropertyElement(
         Array<Sint8>& out,          Buffer& out,
         const CIMConstProperty& property);          const CIMConstProperty& property,
           Boolean includeQualifiers = true,
           Boolean includeClassOrigin = true);
  
     static void printPropertyElement(     static void printPropertyElement(
         const CIMConstProperty& property,         const CIMConstProperty& property,
         PEGASUS_STD(ostream)& os=PEGASUS_STD(cout));         PEGASUS_STD(ostream)& os=PEGASUS_STD(cout));
  
     static void appendMethodElement(     static void appendMethodElement(
         Array<Sint8>& out,          Buffer& out,
         const CIMConstMethod& method);         const CIMConstMethod& method);
  
     static void printMethodElement(     static void printMethodElement(
Line 209 
Line 198 
         PEGASUS_STD(ostream)& os=PEGASUS_STD(cout));         PEGASUS_STD(ostream)& os=PEGASUS_STD(cout));
  
     static void appendParameterElement(     static void appendParameterElement(
         Array<Sint8>& out,          Buffer& out,
         const CIMConstParameter& parameter);         const CIMConstParameter& parameter);
  
     static void printParameterElement(     static void printParameterElement(
Line 217 
Line 206 
         PEGASUS_STD(ostream)& os=PEGASUS_STD(cout));         PEGASUS_STD(ostream)& os=PEGASUS_STD(cout));
  
     static void appendParamValueElement(     static void appendParamValueElement(
         Array<Sint8>& out,          Buffer& out,
         const CIMParamValue& paramValue);         const CIMParamValue& paramValue);
  
     static void printParamValueElement(     static void printParamValueElement(
Line 225 
Line 214 
         PEGASUS_STD(ostream)& os=PEGASUS_STD(cout));         PEGASUS_STD(ostream)& os=PEGASUS_STD(cout));
  
     static void appendQualifierElement(     static void appendQualifierElement(
         Array<Sint8>& out,          Buffer& out,
         const CIMConstQualifier& qualifier);         const CIMConstQualifier& qualifier);
  
     static void printQualifierElement(     static void printQualifierElement(
Line 233 
Line 222 
         PEGASUS_STD(ostream)& os=PEGASUS_STD(cout));         PEGASUS_STD(ostream)& os=PEGASUS_STD(cout));
  
     static void appendQualifierDeclElement(     static void appendQualifierDeclElement(
         Array<Sint8>& out,          Buffer& out,
         const CIMConstQualifierDecl& qualifierDecl);         const CIMConstQualifierDecl& qualifierDecl);
  
     static void printQualifierDeclElement(     static void printQualifierDeclElement(
Line 241 
Line 230 
         PEGASUS_STD(ostream)& os=PEGASUS_STD(cout));         PEGASUS_STD(ostream)& os=PEGASUS_STD(cout));
  
     static void appendQualifierFlavorEntity(     static void appendQualifierFlavorEntity(
         Array<Sint8>& out,          Buffer& out,
         const CIMFlavor & flavor);         const CIMFlavor & flavor);
  
     static void appendScopeElement(     static void appendScopeElement(
         Array<Sint8>& out,          Buffer& out,
         const CIMScope & scope);         const CIMScope & scope);
  
     static void appendMethodCallHeader(     static void appendMethodCallHeader(
         Array<Sint8>& out,          Buffer& out,
         const char* host,         const char* host,
         const CIMName& cimMethod,         const CIMName& cimMethod,
         const String& cimObject,         const String& cimObject,
         const String& authenticationHeader,         const String& authenticationHeader,
         HttpMethod httpMethod,         HttpMethod httpMethod,
     const AcceptLanguages & acceptLanguages,          const AcceptLanguageList& acceptLanguages,
     const ContentLanguages & contentLanguages,          const ContentLanguageList& contentLanguages,
         Uint32 contentLength);          Uint32 contentLength,
           bool binaryRequest = false,
     static void appendMethodResponseHeader(          bool binaryResponse = false);
         Array<Sint8>& out,  
         HttpMethod httpMethod,  
     const ContentLanguages & contentLanguages,  
         Uint32 contentLength);  
  
         // added to accommidate sending WBEMServerResponseTime PEP #128  
     static void appendMethodResponseHeader(     static void appendMethodResponseHeader(
         Array<Sint8>& out,          Buffer& out,
         HttpMethod httpMethod,         HttpMethod httpMethod,
     const ContentLanguages & contentLanguages,          const ContentLanguageList& contentLanguages,
         Uint32 contentLength,         Uint32 contentLength,
         Uint64 serverResponseTime);          Uint64 serverResponseTime = 0,
           bool binaryResponse = false);
  
     static void appendHttpErrorResponseHeader(     static void appendHttpErrorResponseHeader(
         Array<Sint8>& out,          Buffer& out,
         const String& status,         const String& status,
         const String& cimError = String::EMPTY,         const String& cimError = String::EMPTY,
         const String& errorDetail = String::EMPTY);         const String& errorDetail = String::EMPTY);
  
     static void appendUnauthorizedResponseHeader(     static void appendUnauthorizedResponseHeader(
         Array<Sint8>& out,          Buffer& out,
           const String& errorDetail,
         const String& content);         const String& content);
  
 #ifdef PEGASUS_KERBEROS_AUTHENTICATION      static void appendParamTypeAndEmbeddedObjAttrib(
     static void appendOKResponseHeader(          Buffer& out,
         Array<Sint8>& out,          const CIMType& type);
         const String& content);  
 #endif  
  
     static void appendReturnValueElement(     static void appendReturnValueElement(
         Array<Sint8>& out,          Buffer& out,
         const CIMValue& value);         const CIMValue& value);
  
     static void appendBooleanIParameter(     static void appendBooleanIParameter(
         Array<Sint8>& out,          Buffer& out,
         const char* name,         const char* name,
         Boolean flag);         Boolean flag);
   //EXP_PULL_BEGIN
       static void appendBooleanParameter(
           Buffer& out,
           const char* name,
           Boolean flag);
   
       static void appendBooleanIReturnValue(
           Buffer& out,
           const char* name,
           Boolean flag);
   
       static void appendUint32IParameter(
           Buffer& out,
           const char* name,
           Uint32 val);
   
       static void appendUint32ArgIParameter(
           Buffer& out,
           const char* name,
           const Uint32Arg& val,
           const Boolean required);
   
       static void appendUint64ReturnValue(
           Buffer& out,
           const char* name,
           const Uint64Arg& val);
   //EXP_PULL_END
  
     static void appendStringIParameter(     static void appendStringIParameter(
         Array<Sint8>& out,          Buffer& out,
         const char* name,         const char* name,
         const String& str);         const String& str);
  
     static void appendQualifierNameIParameter(  //EXP_PULL_BEGIN
         Array<Sint8>& out,      static void appendStringIParameterIfNotEmpty(
           Buffer& out,
         const char* name,         const char* name,
         const String& qualifierName);          const String& str);
   
       static void appendStringParameter(
           Buffer& out,
           const char* name,
           const String& str);
       static void appendStringIReturnValue(
           Buffer& out,
           const char* name,
           const String& str);
   //EXP_PULL_END
  
     static void appendClassNameIParameter(     static void appendClassNameIParameter(
         Array<Sint8>& out,          Buffer& out,
         const char* name,         const char* name,
         const CIMName& className);         const CIMName& className);
  
     static void appendInstanceNameIParameter(     static void appendInstanceNameIParameter(
         Array<Sint8>& out,          Buffer& out,
         const char* name,         const char* name,
         const CIMObjectPath& instanceName);         const CIMObjectPath& instanceName);
  
     static void appendObjectNameIParameter(  
         Array<Sint8>& out,  
         const char* name,  
         const CIMObjectPath& objectName);  
   
     static void appendClassIParameter(     static void appendClassIParameter(
         Array<Sint8>& out,          Buffer& out,
         const char* name,         const char* name,
         const CIMConstClass& cimClass);         const CIMConstClass& cimClass);
  
     static void appendInstanceIParameter(     static void appendInstanceIParameter(
         Array<Sint8>& out,          Buffer& out,
         const char* name,         const char* name,
         const CIMConstInstance& instance);         const CIMConstInstance& instance);
  
     static void appendNamedInstanceIParameter(     static void appendNamedInstanceIParameter(
         Array<Sint8>& out,          Buffer& out,
         const char* name,         const char* name,
         const CIMInstance& namedInstance) ;         const CIMInstance& namedInstance) ;
  
     static void appendPropertyNameIParameter(     static void appendPropertyNameIParameter(
         Array<Sint8>& out,          Buffer& out,
         const CIMName& propertyName);         const CIMName& propertyName);
  
     static void appendPropertyValueIParameter(     static void appendPropertyValueIParameter(
         Array<Sint8>& out,          Buffer& out,
         const char* name,         const char* name,
         const CIMValue& value);         const CIMValue& value);
  
     static void appendPropertyListIParameter(     static void appendPropertyListIParameter(
         Array<Sint8>& out,          Buffer& out,
         const CIMPropertyList& propertyList);         const CIMPropertyList& propertyList);
  
     static void appendQualifierDeclarationIParameter(     static void appendQualifierDeclarationIParameter(
         Array<Sint8>& out,          Buffer& out,
         const char* name,         const char* name,
         const CIMConstQualifierDecl& qualifierDecl);         const CIMConstQualifierDecl& qualifierDecl);
  
     static Array<Sint8> formatHttpErrorRspMessage(      static Buffer formatHttpErrorRspMessage(
         const String& status,         const String& status,
         const String& cimError = String::EMPTY,         const String& cimError = String::EMPTY,
         const String& errorDetail = String::EMPTY);         const String& errorDetail = String::EMPTY);
  
     static Array<Sint8> formatSimpleMethodReqMessage(      static Buffer formatSimpleMethodReqMessage(
         const char* host,         const char* host,
         const CIMNamespaceName& nameSpace,         const CIMNamespaceName& nameSpace,
         const CIMObjectPath& path,         const CIMObjectPath& path,
Line 370 
Line 387 
         const String& messageId,         const String& messageId,
         HttpMethod httpMethod,         HttpMethod httpMethod,
         const String& authenticationHeader,         const String& authenticationHeader,
     const AcceptLanguages& httpAcceptLanguages,          const AcceptLanguageList& httpAcceptLanguages,
     const ContentLanguages& httpContentLanguages);          const ContentLanguageList& httpContentLanguages,
           bool binaryResponse);
     static Array<Sint8> formatSimpleMethodRspMessage(  
         const CIMName& methodName,  
         const String& messageId,  
         HttpMethod httpMethod,  
         const ContentLanguages & httpContentLanguages,  
         const Array<Sint8>& body,  
         Boolean isFirst = true,  
         Boolean isLast = true);  
  
         //PEP 128 - sending serverResponseTime (WBEMServerResponseTime) in respons header      static Buffer formatSimpleMethodRspMessage(
         static Array<Sint8> formatSimpleMethodRspMessage(  
         const CIMName& methodName,         const CIMName& methodName,
         const String& messageId,         const String& messageId,
         HttpMethod httpMethod,         HttpMethod httpMethod,
         const ContentLanguages & httpContentLanguages,          const ContentLanguageList& httpContentLanguages,
         const Array<Sint8>& body,          const Buffer& bodyParams,
           const Buffer& body,
         Uint64 serverResponseTime,         Uint64 serverResponseTime,
         Boolean isFirst = true,         Boolean isFirst = true,
         Boolean isLast = true);         Boolean isLast = true);
  
     static Array<Sint8> formatSimpleMethodErrorRspMessage(      static Buffer formatSimpleMethodErrorRspMessage(
         const CIMName& methodName,         const CIMName& methodName,
         const String& messageId,         const String& messageId,
         HttpMethod httpMethod,         HttpMethod httpMethod,
         const CIMException& cimException);         const CIMException& cimException);
  
     static Array<Sint8> formatSimpleIMethodReqMessage(      static Buffer formatSimpleIMethodReqMessage(
         const char* host,         const char* host,
         const CIMNamespaceName& nameSpace,         const CIMNamespaceName& nameSpace,
         const CIMName& iMethodName,         const CIMName& iMethodName,
         const String& messageId,         const String& messageId,
         HttpMethod httpMethod,         HttpMethod httpMethod,
         const String& authenticationHeader,         const String& authenticationHeader,
     const AcceptLanguages& httpAcceptLanguages,          const AcceptLanguageList& httpAcceptLanguages,
     const ContentLanguages& httpContentLanguages,          const ContentLanguageList& httpContentLanguages,
         const Array<Sint8>& body);          const Buffer& body,
           bool binaryResponse);
         static Array<Sint8> formatSimpleIMethodRspMessage(  
         const CIMName& iMethodName,  
         const String& messageId,  
         HttpMethod httpMethod,  
         const ContentLanguages & httpContentLanguages,  
         const Array<Sint8>& body,  
         Boolean isFirst = true,  
         Boolean isLast = true);  
  
     //PEP 128 - sending serverResponseTime (WBEMServerResponseTime) in respons header      static Buffer formatSimpleIMethodRspMessage(
         static Array<Sint8> formatSimpleIMethodRspMessage(  
         const CIMName& iMethodName,         const CIMName& iMethodName,
         const String& messageId,         const String& messageId,
         HttpMethod httpMethod,         HttpMethod httpMethod,
         const ContentLanguages & httpContentLanguages,          const ContentLanguageList& httpContentLanguages,
         const Array<Sint8>& body,          const Buffer& rtnParams,
           const Buffer& body,
         Uint64 serverResponseTime,         Uint64 serverResponseTime,
         Boolean isFirst = true,         Boolean isFirst = true,
         Boolean isLast = true);         Boolean isLast = true);
  
     static Array<Sint8> formatSimpleIMethodErrorRspMessage(  
       static Buffer formatSimpleIMethodErrorRspMessage(
         const CIMName& iMethodName,         const CIMName& iMethodName,
         const String& messageId,         const String& messageId,
         HttpMethod httpMethod,         HttpMethod httpMethod,
         const CIMException& cimException);         const CIMException& cimException);
  
     static void appendInstanceEParameter(     static void appendInstanceEParameter(
         Array<Sint8>& out,          Buffer& out,
         const char* name,         const char* name,
         const CIMInstance& instance);         const CIMInstance& instance);
  
     static void appendEMethodRequestHeader(     static void appendEMethodRequestHeader(
         Array<Sint8>& out,          Buffer& out,
         const char* requestUri,         const char* requestUri,
         const char* host,         const char* host,
         const CIMName& cimMethod,         const CIMName& cimMethod,
         HttpMethod httpMethod,         HttpMethod httpMethod,
         const String& authenticationHeader,         const String& authenticationHeader,
     const AcceptLanguages& acceptLanguages,          const AcceptLanguageList& acceptLanguages,
     const ContentLanguages& contentLanguages,          const ContentLanguageList& contentLanguages,
         Uint32 contentLength);         Uint32 contentLength);
  
     static void appendEMethodResponseHeader(     static void appendEMethodResponseHeader(
         Array<Sint8>& out,          Buffer& out,
         HttpMethod httpMethod,         HttpMethod httpMethod,
     const ContentLanguages& contentLanguages,          const ContentLanguageList& contentLanguages,
         Uint32 contentLength);         Uint32 contentLength);
  
     static Array<Sint8> formatSimpleEMethodReqMessage(      static Buffer formatSimpleEMethodReqMessage(
         const char* requestUri,         const char* requestUri,
         const char* host,         const char* host,
         const CIMName& eMethodName,         const CIMName& eMethodName,
         const String& messageId,         const String& messageId,
         HttpMethod httpMethod,         HttpMethod httpMethod,
         const String& authenticationHeader,         const String& authenticationHeader,
     const AcceptLanguages& httpAcceptLanguages,          const AcceptLanguageList& httpAcceptLanguages,
     const ContentLanguages& httpContentLanguages,          const ContentLanguageList& httpContentLanguages,
         const Array<Sint8>& body);          const Buffer& body);
  
     static Array<Sint8> formatSimpleEMethodRspMessage(      static Buffer formatSimpleEMethodRspMessage(
         const CIMName& eMethodName,         const CIMName& eMethodName,
         const String& messageId,         const String& messageId,
         HttpMethod httpMethod,         HttpMethod httpMethod,
     const ContentLanguages& httpContentLanguages,          const ContentLanguageList& httpContentLanguages,
         const Array<Sint8>& body);          const Buffer& body);
  
     static Array<Sint8> formatSimpleEMethodErrorRspMessage(      static Buffer formatSimpleEMethodErrorRspMessage(
         const CIMName& eMethodName,         const CIMName& eMethodName,
         const String& messageId,         const String& messageId,
         HttpMethod httpMethod,         HttpMethod httpMethod,
         const CIMException& cimException);         const CIMException& cimException);
  
     static void indentedPrint(  
         PEGASUS_STD(ostream)& os,  
         const char* text,  
         Uint32 indentChars = 2);  
   
     static String getNextMessageId();     static String getNextMessageId();
  
     /** Converts the given CIMKeyBinding type to one of the following:     /** Converts the given CIMKeyBinding type to one of the following:
         "boolean", "string", or "numeric"         "boolean", "string", or "numeric"
     */     */
     static const char* keyBindingTypeToString (CIMKeyBinding::Type type);      static const StrLit keyBindingTypeToString (CIMKeyBinding::Type type);
  
 private: private:
  
     static void _appendMessageElementBegin(     static void _appendMessageElementBegin(
         Array<Sint8>& out,          Buffer& out,
         const String& messageId);         const String& messageId);
     static void _appendMessageElementEnd(     static void _appendMessageElementEnd(
         Array<Sint8>& out);          Buffer& out);
  
     static void _appendSimpleReqElementBegin(Array<Sint8>& out);      static void _appendSimpleReqElementBegin(Buffer& out);
     static void _appendSimpleReqElementEnd(Array<Sint8>& out);      static void _appendSimpleReqElementEnd(Buffer& out);
  
     static void _appendMethodCallElementBegin(     static void _appendMethodCallElementBegin(
         Array<Sint8>& out,          Buffer& out,
         const CIMName& name);         const CIMName& name);
   
     static void _appendMethodCallElementEnd(     static void _appendMethodCallElementEnd(
         Array<Sint8>& out);          Buffer& out);
  
     static void _appendIMethodCallElementBegin(     static void _appendIMethodCallElementBegin(
         Array<Sint8>& out,          Buffer& out,
         const CIMName& name);         const CIMName& name);
     static void _appendIMethodCallElementEnd(     static void _appendIMethodCallElementEnd(
         Array<Sint8>& out);          Buffer& out);
   
   //EXP_PULL_BEGIN
       static void _appendParamValueElementBegin(
           Buffer& out,
           const char* name);
   
       static void _appendParamValueElementEnd(
           Buffer& out);
   //EXP_PULL_END
  
     static void _appendIParamValueElementBegin(     static void _appendIParamValueElementBegin(
         Array<Sint8>& out,          Buffer& out,
         const char* name);         const char* name);
   
     static void _appendIParamValueElementEnd(     static void _appendIParamValueElementEnd(
         Array<Sint8>& out);          Buffer& out);
  
     static void _appendSimpleRspElementBegin(Array<Sint8>& out);      static void _appendSimpleRspElementBegin(Buffer& out);
     static void _appendSimpleRspElementEnd(Array<Sint8>& out);      static void _appendSimpleRspElementEnd(Buffer& out);
  
     static void _appendMethodResponseElementBegin(     static void _appendMethodResponseElementBegin(
         Array<Sint8>& out,          Buffer& out,
         const CIMName& name);         const CIMName& name);
     static void _appendMethodResponseElementEnd(     static void _appendMethodResponseElementEnd(
         Array<Sint8>& out);          Buffer& out);
  
     static void _appendIMethodResponseElementBegin(     static void _appendIMethodResponseElementBegin(
         Array<Sint8>& out,          Buffer& out,
         const CIMName& name);         const CIMName& name);
     static void _appendIMethodResponseElementEnd(     static void _appendIMethodResponseElementEnd(
         Array<Sint8>& out);          Buffer& out);
  
     static void _appendErrorElement(     static void _appendErrorElement(
         Array<Sint8>& out,          Buffer& out,
         const CIMException& cimException);         const CIMException& cimException);
  
     static void _appendIReturnValueElementBegin(Array<Sint8>& out);      static void _appendIReturnValueElementBegin(Buffer& out);
     static void _appendIReturnValueElementEnd(Array<Sint8>& out);      static void _appendIReturnValueElementEnd(Buffer& out);
   
   //EXP_PULL_BEGIN
       static void _appendIReturnValueElementWithNameBegin(
           Buffer& out,
           const char* name);
   // EXP_PULL_END
  
     static void _appendSimpleExportReqElementBegin(Array<Sint8>& out);      static void _appendSimpleExportReqElementBegin(Buffer& out);
     static void _appendSimpleExportReqElementEnd(Array<Sint8>& out);      static void _appendSimpleExportReqElementEnd(Buffer& out);
  
     static void _appendEMethodCallElementBegin(     static void _appendEMethodCallElementBegin(
         Array<Sint8>& out,          Buffer& out,
         const CIMName& name);         const CIMName& name);
   
     static void _appendEMethodCallElementEnd(     static void _appendEMethodCallElementEnd(
         Array<Sint8>& out);          Buffer& out);
  
     static void _appendEParamValueElementBegin(     static void _appendEParamValueElementBegin(
         Array<Sint8>& out,          Buffer& out,
         const char* name);         const char* name);
     static void _appendEParamValueElementEnd(     static void _appendEParamValueElementEnd(
         Array<Sint8>& out);          Buffer& out);
  
     static void _appendSimpleExportRspElementBegin(Array<Sint8>& out);      static void _appendSimpleExportRspElementBegin(Buffer& out);
     static void _appendSimpleExportRspElementEnd(Array<Sint8>& out);      static void _appendSimpleExportRspElementEnd(Buffer& out);
  
     static void _appendEMethodResponseElementBegin(     static void _appendEMethodResponseElementBegin(
         Array<Sint8>& out,          Buffer& out,
         const CIMName& name);         const CIMName& name);
   
     static void _appendEMethodResponseElementEnd(     static void _appendEMethodResponseElementEnd(
         Array<Sint8>& out);          Buffer& out);
   
       static void appendInstancePath(
           Buffer& out,
           const CIMObjectPath& reference);
   
       static void appendClassPath(
           Buffer& out,
           const CIMObjectPath& reference);
  
     XmlWriter() { }      XmlWriter();
 }; };
  
 PEGASUS_COMMON_LINKAGE Array<Sint8>& operator<<(  //==============================================================================
     Array<Sint8>& out,  //
     const char* x);  // _toString() routines:
   //
   //==============================================================================
  
 PEGASUS_COMMON_LINKAGE Array<Sint8>& operator<<(Array<Sint8>& out, char x);  inline void _toString(Buffer& out, Boolean x)
   {
       XmlWriter::append(out, x);
   }
  
 PEGASUS_COMMON_LINKAGE Array<Sint8>& operator<<(Array<Sint8>& out, const Char16& x);  inline void _toString(Buffer& out, Uint8 x)
   {
       XmlWriter::append(out, Uint32(x));
   }
  
 PEGASUS_COMMON_LINKAGE Array<Sint8>& operator<<(  inline void _toString(Buffer& out, Sint8 x)
     Array<Sint8>& out,  {
     const String& x);      XmlWriter::append(out, Sint32(x));
   }
  
 PEGASUS_COMMON_LINKAGE Array<Sint8>& operator<<(  inline void _toString(Buffer& out, Uint16 x)
     Array<Sint8>& out,  {
     const Indentor& x);      XmlWriter::append(out, Uint32(x));
   }
  
 PEGASUS_COMMON_LINKAGE Array<Sint8>& operator<<(  inline void _toString(Buffer& out, Sint16 x)
     Array<Sint8>& out,  {
     const Array<Sint8>& x);      XmlWriter::append(out, Sint32(x));
   }
  
 PEGASUS_COMMON_LINKAGE Array<Sint8>& operator<<(  inline void _toString(Buffer& out, Uint32 x)
     Array<Sint8>& out,  {
     Uint32 x);      XmlWriter::append(out, x);
   }
  
 PEGASUS_COMMON_LINKAGE Array<Sint8>& operator<<(  inline void _toString(Buffer& out, Sint32 x)
     Array<Sint8>& out,  {
     const CIMName& name);      XmlWriter::append(out, x);
   }
  
 PEGASUS_COMMON_LINKAGE PEGASUS_STD(ostream)& operator<<(  inline void _toString(Buffer& out, Uint64 x)
     PEGASUS_STD(ostream)& os,  {
     const CIMDateTime& x);      XmlWriter::append(out, x);
   }
  
 PEGASUS_COMMON_LINKAGE PEGASUS_STD(ostream)& operator<<(  inline void _toString(Buffer& out, Sint64 x)
     PEGASUS_STD(ostream)& os,  {
     const CIMName& name);      XmlWriter::append(out, x);
   }
   
   inline void _toString(Buffer& out, Real32 x)
   {
       XmlWriter::append(out, Real64(x));
   }
   
   inline void _toString(Buffer& out, Real64 x)
   {
       XmlWriter::append(out, x);
   }
  
 PEGASUS_COMMON_LINKAGE PEGASUS_STD(ostream)& operator<<(  inline void _toString(Buffer& out, Char16 x)
     PEGASUS_STD(ostream)& os,  {
     const CIMNamespaceName& name);      // We need to convert the Char16 to UTF8 then append the UTF8
       // character into the array.
       // NOTE: The UTF8 character could be several bytes long.
       // WARNING: This function will put in replacement character for
       // all characters that have surogate pairs.
   
       char str[6];
       memset(str,0x00,sizeof(str));
       char* charIN = (char *)&x;
   
       const Uint16 *strsrc = (Uint16 *)charIN;
       Uint16 *endsrc = (Uint16 *)&charIN[1];
   
       Uint8 *strtgt = (Uint8 *)str;
       Uint8 *endtgt = (Uint8 *)&str[5];
   
       UTF16toUTF8(&strsrc, endsrc, &strtgt, endtgt);
       out.append(str, UTF_8_COUNT_TRAIL_BYTES(str[0]) +1);
   }
   
   inline void _toString(Buffer& out, const String& x)
   {
       out << x;
   }
   
   inline void _toString(Buffer& out, const CIMDateTime& x)
   {
       out << x.toString();
   }
   
   inline void _toString(Buffer& out, const CIMObjectPath& x)
   {
       out << x.toString();
   }
   
   inline void _toString(Buffer& out, const CIMObject& x)
   {
       out << x.toString();
   }
   inline void _toString(Buffer& out, const CIMInstance& x)
   {
       out << CIMObject(x).toString();
   }
   
   template<class T>
   void _toString(Buffer& out, const T* p, Uint32 size)
   {
       while (size--)
       {
           _toString(out, *p++);
           out.append(' ');
       }
   }
  
 PEGASUS_NAMESPACE_END PEGASUS_NAMESPACE_END
  


Legend:
Removed from v.1.69  
changed lines
  Added in v.1.92.4.12

No CVS admin address has been configured
Powered by
ViewCVS 0.9.2