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

Diff for /pegasus/src/Pegasus/Common/XmlWriter.cpp between version 1.88 and 1.88.6.1

version 1.88, 2003/04/30 18:26:55 version 1.88.6.1, 2003/07/29 15:08:29
Line 108 
Line 108 
     return out;     return out;
 } }
  
   
   // l10n
   Array<Sint8>& operator<<(Array<Sint8>& out, const AcceptLanguages& al)
   {
       XmlWriter::append(out, al.toString ());
       return out;
   }
   
   // l10n
   Array<Sint8>& operator<<(Array<Sint8>& out, const ContentLanguages& cl)
   {
       XmlWriter::append(out, cl.toString ());
       return out;
   }
   
   
 PEGASUS_STD(ostream)& operator<<(PEGASUS_STD(ostream)& os, const CIMDateTime& x) PEGASUS_STD(ostream)& operator<<(PEGASUS_STD(ostream)& os, const CIMDateTime& x)
 { {
     return os << x.toString();     return os << x.toString();
Line 1460 
Line 1476 
     }     }
 } }
  
   // l10n - added content language and accept language support to
   // the header methods below
   
 //------------------------------------------------------------------------------ //------------------------------------------------------------------------------
 // //
 // appendMethodCallHeader() // appendMethodCallHeader()
Line 1475 
Line 1494 
     const String& cimObject,     const String& cimObject,
     const String& authenticationHeader,     const String& authenticationHeader,
     HttpMethod httpMethod,     HttpMethod httpMethod,
       const AcceptLanguages & acceptLanguages,
       const ContentLanguages & contentLanguages,
     Uint32 contentLength)     Uint32 contentLength)
 { {
     char nn[] = { '0' + (rand() % 10), '0' + (rand() % 10), '\0' };     char nn[] = { '0' + (rand() % 10), '0' + (rand() % 10), '\0' };
Line 1500 
Line 1521 
     out << "HOST: " << host << "\r\n";     out << "HOST: " << host << "\r\n";
     out << "Content-Type: application/xml; charset=\"utf-8\"\r\n";     out << "Content-Type: application/xml; charset=\"utf-8\"\r\n";
     out << "Content-Length: " << contentLength << "\r\n";     out << "Content-Length: " << contentLength << "\r\n";
       if (acceptLanguages.size() > 0)
       {
           out << "Accept-Language: " << acceptLanguages << "\r\n";
       }
       if (contentLanguages.size() > 0)
       {
           out << "Content-Language: " << contentLanguages << "\r\n";
       }
     if (httpMethod == HTTP_METHOD_M_POST)     if (httpMethod == HTTP_METHOD_M_POST)
     {     {
         out << "Man: http://www.dmtf.org/cim/mapping/http/v1.0; ns=";         out << "Man: http://www.dmtf.org/cim/mapping/http/v1.0; ns=";
Line 1524 
Line 1553 
     out << "\r\n";     out << "\r\n";
 } }
  
   
 //------------------------------------------------------------------------------ //------------------------------------------------------------------------------
 // //
 // appendMethodResponseHeader() // appendMethodResponseHeader()
Line 1535 
Line 1565 
 void XmlWriter::appendMethodResponseHeader( void XmlWriter::appendMethodResponseHeader(
     Array<Sint8>& out,     Array<Sint8>& out,
     HttpMethod httpMethod,     HttpMethod httpMethod,
       const ContentLanguages & contentLanguages,
     Uint32 contentLength)     Uint32 contentLength)
 { {
     char nn[] = { '0' + (rand() % 10), '0' + (rand() % 10), '\0' };     char nn[] = { '0' + (rand() % 10), '0' + (rand() % 10), '\0' };
Line 1543 
Line 1574 
     STAT_SERVERTIME     STAT_SERVERTIME
     out << "Content-Type: application/xml; charset=\"utf-8\"\r\n";     out << "Content-Type: application/xml; charset=\"utf-8\"\r\n";
     out << "Content-Length: " << contentLength << "\r\n";     out << "Content-Length: " << contentLength << "\r\n";
       if (contentLanguages.size() > 0)
       {
           out << "Content-Language: " << contentLanguages << "\r\n";
       }
     if (httpMethod == HTTP_METHOD_M_POST)     if (httpMethod == HTTP_METHOD_M_POST)
     {     {
         out << "Ext:\r\n";         out << "Ext:\r\n";
Line 2160 
Line 2195 
     return out;     return out;
 } }
  
   // l10n - add content language support to the format methods below
   
 //------------------------------------------------------------------------------ //------------------------------------------------------------------------------
 // //
 // XmlWriter::formatSimpleMethodReqMessage() // XmlWriter::formatSimpleMethodReqMessage()
Line 2175 
Line 2212 
     const Array<CIMParamValue>& parameters,     const Array<CIMParamValue>& parameters,
     const String& messageId,     const String& messageId,
     HttpMethod httpMethod,     HttpMethod httpMethod,
     const String& authenticationHeader)      const String& authenticationHeader,
       const AcceptLanguages& httpAcceptLanguages,
       const ContentLanguages& httpContentLanguages)
 { {
     Array<Sint8> out;     Array<Sint8> out;
     Array<Sint8> tmp;     Array<Sint8> tmp;
Line 2202 
Line 2241 
         localObjectPath.toString(),         localObjectPath.toString(),
         authenticationHeader,         authenticationHeader,
         httpMethod,         httpMethod,
           httpAcceptLanguages,
           httpContentLanguages,
         out.size());         out.size());
     tmp << out;     tmp << out;
  
Line 2212 
Line 2253 
     const CIMName& methodName,     const CIMName& methodName,
     const String& messageId,     const String& messageId,
     HttpMethod httpMethod,     HttpMethod httpMethod,
       const ContentLanguages & httpContentLanguages,
     const Array<Sint8>& body)     const Array<Sint8>& body)
 { {
     Array<Sint8> out;     Array<Sint8> out;
Line 2225 
Line 2267 
     _appendSimpleRspElementEnd(out);     _appendSimpleRspElementEnd(out);
     _appendMessageElementEnd(out);     _appendMessageElementEnd(out);
  
     appendMethodResponseHeader(tmp, httpMethod, out.size());      appendMethodResponseHeader(tmp,
           httpMethod,
           httpContentLanguages,
           out.size());
     tmp << out;     tmp << out;
  
     return tmp;     return tmp;
Line 2254 
Line 2299 
     _appendSimpleRspElementEnd(out);     _appendSimpleRspElementEnd(out);
     _appendMessageElementEnd(out);     _appendMessageElementEnd(out);
  
     appendMethodResponseHeader(tmp, httpMethod, out.size());  // l10n
       appendMethodResponseHeader(tmp,
           httpMethod,
           cimException.getContentLanguages(),
           out.size());
     tmp << out;     tmp << out;
  
     return tmp;     return tmp;
Line 2273 
Line 2322 
     const String& messageId,     const String& messageId,
     HttpMethod httpMethod,     HttpMethod httpMethod,
     const String& authenticationHeader,     const String& authenticationHeader,
       const AcceptLanguages& httpAcceptLanguages,
       const ContentLanguages& httpContentLanguages,
     const Array<Sint8>& body)     const Array<Sint8>& body)
 { {
     Array<Sint8> out;     Array<Sint8> out;
Line 2294 
Line 2345 
         nameSpace.getString(),         nameSpace.getString(),
         authenticationHeader,         authenticationHeader,
         httpMethod,         httpMethod,
           httpAcceptLanguages,
           httpContentLanguages,
         out.size());         out.size());
     tmp << out;     tmp << out;
  
Line 2310 
Line 2363 
     const CIMName& iMethodName,     const CIMName& iMethodName,
     const String& messageId,     const String& messageId,
     HttpMethod httpMethod,     HttpMethod httpMethod,
       const ContentLanguages & httpContentLanguages,
     const Array<Sint8>& body)     const Array<Sint8>& body)
 { {
     Array<Sint8> out;     Array<Sint8> out;
Line 2328 
Line 2382 
     _appendSimpleRspElementEnd(out);     _appendSimpleRspElementEnd(out);
     _appendMessageElementEnd(out);     _appendMessageElementEnd(out);
  
     appendMethodResponseHeader(tmp, httpMethod, out.size());      appendMethodResponseHeader(tmp,
                    httpMethod,
                    httpContentLanguages,
            out.size());
     tmp << out;     tmp << out;
  
     return tmp;     return tmp;
Line 2357 
Line 2414 
     _appendSimpleRspElementEnd(out);     _appendSimpleRspElementEnd(out);
     _appendMessageElementEnd(out);     _appendMessageElementEnd(out);
  
     appendMethodResponseHeader(tmp, httpMethod, out.size());  // l10n
       appendMethodResponseHeader(tmp,
            httpMethod,
            cimException.getContentLanguages(),
            out.size());
     tmp << out;     tmp << out;
  
     return tmp;     return tmp;
Line 2384 
Line 2445 
     const CIMName& cimMethod,     const CIMName& cimMethod,
     HttpMethod httpMethod,     HttpMethod httpMethod,
     const String& authenticationHeader,     const String& authenticationHeader,
       const AcceptLanguages& acceptLanguages,
       const ContentLanguages& contentLanguages,
     Uint32 contentLength)     Uint32 contentLength)
 { {
     char nn[] = { '0' + (rand() % 10), '0' + (rand() % 10), '\0' };     char nn[] = { '0' + (rand() % 10), '0' + (rand() % 10), '\0' };
Line 2399 
Line 2462 
     out << "HOST: " << host << "\r\n";     out << "HOST: " << host << "\r\n";
     out << "Content-Type: application/xml; charset=\"utf-8\"\r\n";     out << "Content-Type: application/xml; charset=\"utf-8\"\r\n";
     out << "Content-Length: " << contentLength << "\r\n";     out << "Content-Length: " << contentLength << "\r\n";
       if (acceptLanguages.size() > 0)
       {
           out << "Accept-Language: " << acceptLanguages << "\r\n";
       }
       if (contentLanguages.size() > 0)
       {
           out << "Content-Language: " << contentLanguages << "\r\n";
       }
     if (httpMethod == HTTP_METHOD_M_POST)     if (httpMethod == HTTP_METHOD_M_POST)
     {     {
         out << "Man: http://www.hp.com; ns=";         out << "Man: http://www.hp.com; ns=";
Line 2430 
Line 2501 
 void XmlWriter::appendEMethodResponseHeader( void XmlWriter::appendEMethodResponseHeader(
     Array<Sint8>& out,     Array<Sint8>& out,
     HttpMethod httpMethod,     HttpMethod httpMethod,
       const ContentLanguages& contentLanguages,
     Uint32 contentLength)     Uint32 contentLength)
 { {
     char nn[] = { '0' + (rand() % 10), '0' + (rand() % 10), '\0' };     char nn[] = { '0' + (rand() % 10), '0' + (rand() % 10), '\0' };
Line 2437 
Line 2509 
     out << "HTTP/1.1 " HTTP_STATUS_OK "\r\n";     out << "HTTP/1.1 " HTTP_STATUS_OK "\r\n";
     out << "Content-Type: application/xml; charset=\"utf-8\"\r\n";     out << "Content-Type: application/xml; charset=\"utf-8\"\r\n";
     out << "Content-Length: " << contentLength << "\r\n";     out << "Content-Length: " << contentLength << "\r\n";
       if (contentLanguages.size() > 0)
       {
           out << "Content-Language: " << contentLanguages << "\r\n";
       }
     if (httpMethod == HTTP_METHOD_M_POST)     if (httpMethod == HTTP_METHOD_M_POST)
     {     {
         out << "Ext:\r\n";         out << "Ext:\r\n";
Line 2592 
Line 2668 
     const String& messageId,     const String& messageId,
     HttpMethod httpMethod,     HttpMethod httpMethod,
     const String& authenticationHeader,     const String& authenticationHeader,
       const AcceptLanguages& httpAcceptLanguages,
       const ContentLanguages& httpContentLanguages,
     const Array<Sint8>& body)     const Array<Sint8>& body)
 { {
     Array<Sint8> out;     Array<Sint8> out;
Line 2612 
Line 2690 
         eMethodName,         eMethodName,
         httpMethod,         httpMethod,
         authenticationHeader,         authenticationHeader,
           httpAcceptLanguages,
           httpContentLanguages,
         out.size());         out.size());
     tmp << out;     tmp << out;
  
Line 2628 
Line 2708 
     const CIMName& eMethodName,     const CIMName& eMethodName,
     const String& messageId,     const String& messageId,
     HttpMethod httpMethod,     HttpMethod httpMethod,
       const ContentLanguages& httpContentLanguages,
     const Array<Sint8>& body)     const Array<Sint8>& body)
 { {
     Array<Sint8> out;     Array<Sint8> out;
Line 2641 
Line 2722 
     _appendSimpleExportRspElementEnd(out);     _appendSimpleExportRspElementEnd(out);
     _appendMessageElementEnd(out);     _appendMessageElementEnd(out);
  
     appendEMethodResponseHeader(tmp, httpMethod, out.size());      appendEMethodResponseHeader(tmp,
           httpMethod,
           httpContentLanguages,
           out.size());
     tmp << out;     tmp << out;
  
     return tmp;     return tmp;
Line 2670 
Line 2754 
     _appendSimpleExportRspElementEnd(out);     _appendSimpleExportRspElementEnd(out);
     _appendMessageElementEnd(out);     _appendMessageElementEnd(out);
  
     appendEMethodResponseHeader(tmp, httpMethod, out.size());  // l10n
       appendEMethodResponseHeader(tmp,
            httpMethod,
            cimException.getContentLanguages(),
                    out.size());
     tmp << out;     tmp << out;
  
     return tmp;     return tmp;


Legend:
Removed from v.1.88  
changed lines
  Added in v.1.88.6.1

No CVS admin address has been configured
Powered by
ViewCVS 0.9.2