(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.82.6.1 and 1.87

version 1.82.6.1, 2008/02/25 23:38:57 version 1.87, 2008/10/17 07:16:35
Line 39 
Line 39 
 #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 58 
Line 57 
 #include <Pegasus/Common/AcceptLanguageList.h> #include <Pegasus/Common/AcceptLanguageList.h>
 #include <Pegasus/Common/Buffer.h> #include <Pegasus/Common/Buffer.h>
 #include <Pegasus/Common/StrLit.h> #include <Pegasus/Common/StrLit.h>
   #include <Pegasus/Common/XmlGenerator.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(Buffer& out, const Char16& x);  
   
     static void append(Buffer& out, char x)  
     {  
       out.append(x);  
     }  
   
     static void append(Buffer& out, Boolean x);  
   
     static void append(Buffer& out, Uint32 x);  
   
     static void append(Buffer& out, Sint32 x);  
   
     static void append(Buffer& out, Uint64 x);  
   
     static void append(Buffer& out, Sint64 x);  
   
     static void append(Buffer& out, Real32 x);  
   
     static void append(Buffer& out, Real64 x);  
   
     static void append(Buffer& out, const char* str);  
   
     static void append(Buffer& out, const String& str);  
   
     static void append(Buffer& out, const Indentor& x);  
   
     static void appendSpecial(Buffer& out, const Char16& x);  
   
     static void appendSpecial(Buffer& out, char x);  
   
     static void appendSpecial(Buffer& out, const char* str);  
   
     static void appendSpecial(Buffer& out, const String& str);  
   
     static String encodeURICharacters(const Buffer& uriString);  
     static String encodeURICharacters(const String& uriString);  
   
     static void appendLocalNameSpacePathElement(     static void appendLocalNameSpacePathElement(
         Buffer& out,         Buffer& out,
         const CIMNamespaceName& nameSpace);         const CIMNamespaceName& nameSpace);
Line 254 
Line 214 
         const ContentLanguageList& contentLanguages,         const ContentLanguageList& contentLanguages,
         Uint32 contentLength);         Uint32 contentLength);
  
     // added to accommodate sending WBEMServerResponseTime PEP #128  
     static void appendMethodResponseHeader(     static void appendMethodResponseHeader(
         Buffer& out,         Buffer& out,
         HttpMethod httpMethod,         HttpMethod httpMethod,
Line 278 
Line 237 
         const String& content);         const String& content);
 #endif #endif
  
       static void appendParamTypeAndEmbeddedObjAttrib(
           Buffer& out,
           const CIMType& type);
   
     static void appendReturnValueElement(     static void appendReturnValueElement(
         Buffer& out,         Buffer& out,
         const CIMValue& value);         const CIMValue& value);
Line 357 
Line 320 
         const AcceptLanguageList& httpAcceptLanguages,         const AcceptLanguageList& httpAcceptLanguages,
         const ContentLanguageList& httpContentLanguages);         const ContentLanguageList& httpContentLanguages);
  
     // PEP 128 - sending serverResponseTime (WBEMServerResponseTime) in  
     // response header  
     static Buffer formatSimpleMethodRspMessage(     static Buffer formatSimpleMethodRspMessage(
         const CIMName& methodName,         const CIMName& methodName,
         const String& messageId,         const String& messageId,
Line 386 
Line 347 
         const ContentLanguageList& httpContentLanguages,         const ContentLanguageList& httpContentLanguages,
         const Buffer& body);         const Buffer& body);
  
     // PEP 128 - sending serverResponseTime (WBEMServerResponseTime) in  
     // response header  
     static Buffer formatSimpleIMethodRspMessage(     static Buffer formatSimpleIMethodRspMessage(
         const CIMName& iMethodName,         const CIMName& iMethodName,
         const String& messageId,         const String& messageId,
Line 450 
Line 409 
         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:
  
Line 540 
Line 494 
     static void _appendEMethodResponseElementEnd(     static void _appendEMethodResponseElementEnd(
         Buffer& out);         Buffer& out);
  
     XmlWriter() { }      XmlWriter();
 }; };
  
 PEGASUS_COMMON_LINKAGE Buffer& operator<<(  
     Buffer& out,  
     const char* x);  
   
 inline Buffer& operator<<(Buffer& out, char x)  
 {  
     out.append(x);  
     return out;  
 }  
   
 inline Buffer& operator<<(Buffer& out, const char* s)  
 {  
     out.append(s, (Uint32)strlen(s));  
     return out;  
 }  
   
 PEGASUS_COMMON_LINKAGE Buffer& operator<<(  
     Buffer& out,  
     const AcceptLanguageList& al);  
   
 PEGASUS_COMMON_LINKAGE Buffer& operator<<(  
     Buffer& out,  
     const ContentLanguageList& cl);  
   
 PEGASUS_COMMON_LINKAGE Buffer& operator<<(Buffer& out, const Char16& x);  
   
 PEGASUS_COMMON_LINKAGE Buffer& operator<<(  
     Buffer& out,  
     const String& x);  
   
 PEGASUS_COMMON_LINKAGE Buffer& operator<<(  
     Buffer& out,  
     const Indentor& x);  
   
 PEGASUS_COMMON_LINKAGE Buffer& operator<<(  
     Buffer& out,  
     const Buffer& x);  
   
 PEGASUS_COMMON_LINKAGE Buffer& operator<<(  
     Buffer& out,  
     Uint32 x);  
   
 PEGASUS_COMMON_LINKAGE Buffer& operator<<(  
     Buffer& out,  
     const CIMName& name);  
   
 PEGASUS_COMMON_LINKAGE PEGASUS_STD(ostream)& operator<<(  
     PEGASUS_STD(ostream)& os,  
     const CIMDateTime& x);  
   
 PEGASUS_COMMON_LINKAGE PEGASUS_STD(ostream)& operator<<(  
     PEGASUS_STD(ostream)& os,  
     const CIMName& name);  
   
 PEGASUS_COMMON_LINKAGE PEGASUS_STD(ostream)& operator<<(  
     PEGASUS_STD(ostream)& os,  
     const CIMNamespaceName& name);  
   
 // This is a shortcut macro for outputing content length. This  
 // pads the output number to the max characters representing a Uint32 number  
 // so that it can be overwritten easily with a transfer encoding line later  
 // on in HTTPConnection if required. This is strictly for performance since  
 // messages can be very large. This overwriting shortcut allows us to NOT have  
 // to repackage a large message later.  
   
 #define OUTPUT_CONTENTLENGTH                                               \  
 {                                                                          \  
     char contentLengthP[11];                                               \  
     int n = sprintf(contentLengthP,"%.10u", contentLength);                \  
     out << STRLIT("content-length: ");                                     \  
     out.append(contentLengthP, n);                                         \  
     out << STRLIT("\r\n");                                                 \  
 }  
  
 PEGASUS_NAMESPACE_END PEGASUS_NAMESPACE_END
  


Legend:
Removed from v.1.82.6.1  
changed lines
  Added in v.1.87

No CVS admin address has been configured
Powered by
ViewCVS 0.9.2