(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.135 and 1.146

version 1.135, 2006/01/30 16:17:08 version 1.146, 2006/11/10 18:14:59
Line 29 
Line 29 
 // //
 //============================================================================== //==============================================================================
 // //
 // Author: Mike Brasher (mbrasher@bmc.com)  
 //  
 // 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)  
 //              Amit K Arora, IBM (amita@in.ibm.com) for PEP#101  
 //         Brian G. Campbell, EMC (campbell_brian@emc.com) - PEP140/phase1  
 //              Willis White (whiwill@us.ibm.com) PEP 127 and 128  
 //         Brian G. Campbell, EMC (campbell_brian@emc.com) - PEP140/phase2  
 //              Dave Sudlik, IBM (dsudlik@us.ibm.com)  
 //              David Dillard, Symantec Corp. (david_dillard@symantec.com)  
 //              Vijay Eli, vijayeli@in.ibm.com, fix for #2571  
 //  
 //%///////////////////////////////////////////////////////////////////////////// //%/////////////////////////////////////////////////////////////////////////////
  
 #include <Pegasus/Common/Config.h> #include <Pegasus/Common/Config.h>
Line 75 
Line 60 
 #include "Buffer.h" #include "Buffer.h"
 #include "StrLit.h" #include "StrLit.h"
 #include "LanguageParser.h" #include "LanguageParser.h"
   #include "IDFactory.h"
  
 PEGASUS_NAMESPACE_BEGIN PEGASUS_NAMESPACE_BEGIN
  
Line 250 
Line 236 
 static const int _isSpecialChar7[] = static const int _isSpecialChar7[] =
 { {
     1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,1,0,0,     1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,1,0,0,
     0,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,      0,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,1,0,0,0,0,0,0,0,0,0,0,0,
     0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,     0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
     0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,     0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,
 }; };
Line 294 
Line 280 
 } }
  
  
 // l10n  
 Buffer& operator<<(Buffer& out, const AcceptLanguageList& al) Buffer& operator<<(Buffer& out, const AcceptLanguageList& al)
 { {
     XmlWriter::append(out, LanguageParser::buildAcceptLanguageHeader(al));     XmlWriter::append(out, LanguageParser::buildAcceptLanguageHeader(al));
     return out;     return out;
 } }
  
 // l10n  
 Buffer& operator<<(Buffer& out, const ContentLanguageList& cl) Buffer& operator<<(Buffer& out, const ContentLanguageList& cl)
 { {
     XmlWriter::append(out, LanguageParser::buildContentLanguageHeader(cl));     XmlWriter::append(out, LanguageParser::buildContentLanguageHeader(cl));
Line 344 
Line 328 
     Uint8 *strtgt = (Uint8 *)str;     Uint8 *strtgt = (Uint8 *)str;
     Uint8 *endtgt = (Uint8 *)&str[5];     Uint8 *endtgt = (Uint8 *)&str[5];
  
     UTF16toUTF8(&strsrc,      UTF16toUTF8(
           &strsrc,
                 endsrc,                 endsrc,
                 &strtgt,                 &strtgt,
                 endtgt);                 endtgt);
Line 419 
Line 404 
     Uint8 *strtgt = (Uint8 *)str;     Uint8 *strtgt = (Uint8 *)str;
     Uint8 *endtgt = (Uint8 *)&str[5];     Uint8 *endtgt = (Uint8 *)&str[5];
  
     UTF16toUTF8(&strsrc,      UTF16toUTF8(
           &strsrc,
                 endsrc,                 endsrc,
                 &strtgt,                 &strtgt,
                 endtgt);                 endtgt);
Line 485 
Line 471 
 void XmlWriter::append(Buffer& out, Real64 x) void XmlWriter::append(Buffer& out, Real64 x)
 { {
     char buffer[128];     char buffer[128];
     // %.16e gives '[-]m.dddddddddddddddde+/-xx', which seems compatible with the format      // %.16e gives '[-]m.dddddddddddddddde+/-xx', which seems compatible
     // given in the CIM/XML spec, and the precision required by the CIM 2.2 spec      // with the format given in the CIM/XML spec, and the precision required
     // (8 byte IEEE floating point)      // by the CIM 2.2 spec (8 byte IEEE floating point)
     sprintf(buffer, "%.16e", x);     sprintf(buffer, "%.16e", x);
     append(out, buffer);     append(out, buffer);
 } }
Line 531 
Line 517 
             continue;             continue;
         }         }
  
         // Hanlde UTF8 case (if reached).          // Handle UTF8 case (if reached).
  
         if(((c >= FIRST_HIGH_SURROGATE) && (c <= LAST_HIGH_SURROGATE)) ||         if(((c >= FIRST_HIGH_SURROGATE) && (c <= LAST_HIGH_SURROGATE)) ||
            ((c >= FIRST_LOW_SURROGATE) && (c <= LAST_LOW_SURROGATE)))            ((c >= FIRST_LOW_SURROGATE) && (c <= LAST_LOW_SURROGATE)))
Line 658 
Line 644 
     0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,0,1,     0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,0,1,
 }; };
  
   // Perform the necessary URI encoding of characters in HTTP header values.
   // This is required by the HTTP/1.1 specification and the CIM/HTTP
   // Specification (section 3.3.2).
 static void _xmlWritter_encodeURIChar(String& outString, Sint8 char8) static void _xmlWritter_encodeURIChar(String& outString, Sint8 char8)
 { {
     Uint8 c = (Uint8)char8;     Uint8 c = (Uint8)char8;
Line 718 
Line 707 
             Char16 highSurrogate = uriString[i];             Char16 highSurrogate = uriString[i];
             Char16 lowSurrogate = uriString[++i];             Char16 lowSurrogate = uriString[++i];
  
             _xmlWritter_appendSurrogatePair(utf8, Uint16(highSurrogate),Uint16(lowSurrogate));              _xmlWritter_appendSurrogatePair(
                   utf8, Uint16(highSurrogate),Uint16(lowSurrogate));
         }         }
         else         else
         {         {
Line 751 
Line 741 
  
     char* nameSpaceCopy = strdup(nameSpace.getString().getCString());     char* nameSpaceCopy = strdup(nameSpace.getString().getCString());
  
 #if !defined(PEGASUS_COMPILER_MSVC)  #if !defined(PEGASUS_COMPILER_MSVC) && !defined(PEGASUS_OS_ZOS)
     char *last;     char *last;
     for (const char* p = strtok_r(nameSpaceCopy, "/", &last); p;     for (const char* p = strtok_r(nameSpaceCopy, "/", &last); p;
          p = strtok_r(NULL, "/", &last))          p = strtok_r(NULL, "/", &last))
Line 830 
Line 820 
             CIMObjectPath ref = keyBindings[i].getValue();             CIMObjectPath ref = keyBindings[i].getValue();
             appendValueReferenceElement(out, ref, true);             appendValueReferenceElement(out, ref, true);
         }         }
         else {          else
           {
             out << STRLIT("<KEYVALUE VALUETYPE=\"");             out << STRLIT("<KEYVALUE VALUETYPE=\"");
             out << keyBindingTypeToString(keyBindings[i].getType());             out << keyBindingTypeToString(keyBindings[i].getType());
             out << STRLIT("\">");             out << STRLIT("\">");
Line 1023 
Line 1014 
  
 inline void _xmlWritter_appendValue(Buffer& out, const CIMDateTime& x) inline void _xmlWritter_appendValue(Buffer& out, const CIMDateTime& x)
 { {
     out << x.toString();  //ATTN: append() method?      // It is not necessary to use XmlWriter::appendSpecial(), because
       // CIMDateTime values do not contain special characters.
       out << x.toString();
 } }
  
 inline void _xmlWritter_appendValue(Buffer& out, const CIMObjectPath& x) inline void _xmlWritter_appendValue(Buffer& out, const CIMObjectPath& x)
Line 1216 
Line 1209 
                 _xmlWritter_appendValueArray(out, a.getData(), a.size());                 _xmlWritter_appendValueArray(out, a.getData(), a.size());
                 break;                 break;
             }             }
   #ifdef PEGASUS_EMBEDDED_INSTANCE_SUPPORT
               case CIMTYPE_INSTANCE:
               {
                   Array<CIMInstance> a;
                   value.get(a);
                   _xmlWritter_appendValueArray(out, a.getData(), a.size());
                   break;
               }
   #endif // PEGASUS_EMBEDDED_INSTANCE_SUPPORT
             default:             default:
                 PEGASUS_ASSERT(false);                 PEGASUS_ASSERT(false);
         }         }
Line 1353 
Line 1354 
                 _xmlWritter_appendValue(out, v);                 _xmlWritter_appendValue(out, v);
                 break;                 break;
             }             }
   #ifdef PEGASUS_EMBEDDED_INSTANCE_SUPPORT
               case CIMTYPE_INSTANCE:
               {
                   CIMInstance v;
                   value.get(v);
                   _xmlWritter_appendValue(out, v);
                   break;
               }
   #endif // PEGASUS_EMBEDDED_INSTANCE_SUPPORT
             default:             default:
                 PEGASUS_ASSERT(false);                 PEGASUS_ASSERT(false);
         }         }
Line 1910 
Line 1919 
     }     }
     if (contentLanguages.size() > 0)     if (contentLanguages.size() > 0)
     {     {
         out << STRLIT("Content-Language: ") << contentLanguages << STRLIT("\r\n");          out << STRLIT("Content-Language: ") << contentLanguages <<
               STRLIT("\r\n");
     }     }
  
 #ifdef PEGASUS_DEBUG #ifdef PEGASUS_DEBUG
Line 1921 
Line 1931 
  
                 static const char *clientTransferEncodingOff =                 static const char *clientTransferEncodingOff =
                         getenv("PEGASUS_HTTP_TRANSFER_ENCODING_REQUEST");                         getenv("PEGASUS_HTTP_TRANSFER_ENCODING_REQUEST");
   
                 if (!clientTransferEncodingOff || *clientTransferEncodingOff != '0')                 if (!clientTransferEncodingOff || *clientTransferEncodingOff != '0')
 #endif #endif
  
Line 1939 
Line 1950 
     else     else
     {     {
         out << STRLIT("CIMOperation: MethodCall\r\n");         out << STRLIT("CIMOperation: MethodCall\r\n");
         out << STRLIT("CIMMethod: ") << encodeURICharacters(cimMethod.getString())          out << STRLIT("CIMMethod: ")
               << encodeURICharacters(cimMethod.getString())
             << STRLIT("\r\n");             << STRLIT("\r\n");
         out << STRLIT("CIMObject: ") << encodeURICharacters(cimObject)         out << STRLIT("CIMObject: ") << encodeURICharacters(cimObject)
             << STRLIT("\r\n");             << STRLIT("\r\n");
Line 1963 
Line 1975 
 { {
      char nn[] = { '0' + (rand() % 10), '0' + (rand() % 10), '\0' };      char nn[] = { '0' + (rand() % 10), '0' + (rand() % 10), '\0' };
      out << STRLIT("HTTP/1.1 " HTTP_STATUS_OK "\r\n");      out << STRLIT("HTTP/1.1 " HTTP_STATUS_OK "\r\n");
      STAT_SERVERTIME  
   #ifndef PEGASUS_DISABLE_PERFINST
        if (StatisticalData::current()->copyGSD)
        {
            out << STRLIT("WBEMServerResponseTime: ") <<
                CIMValue(serverResponseTime).toString() << STRLIT("\r\n");
        }
   #endif
   
      out << STRLIT("Content-Type: application/xml; charset=\"utf-8\"\r\n");      out << STRLIT("Content-Type: application/xml; charset=\"utf-8\"\r\n");
      OUTPUT_CONTENTLENGTH;      OUTPUT_CONTENTLENGTH;
  
      if (contentLanguages.size() > 0)      if (contentLanguages.size() > 0)
      {      {
          out << STRLIT("Content-Language: ") << contentLanguages << STRLIT("\r\n");           out << STRLIT("Content-Language: ") << contentLanguages <<
                STRLIT("\r\n");
      }      }
      if (httpMethod == HTTP_METHOD_M_POST)      if (httpMethod == HTTP_METHOD_M_POST)
      {      {
Line 2013 
Line 2034 
     }     }
     if (errorDetail != String::EMPTY)     if (errorDetail != String::EMPTY)
     {     {
         // ATTN-RK-P3-20020404: It is critical that this text not contain '\n'  
         // ATTN-RK-P3-20020404: Need to encode this value properly.  (See  
         // CIM/HTTP Specification section 3.3.2  
         out << STRLIT(PEGASUS_HTTPHEADERTAG_ERRORDETAIL ": ")         out << STRLIT(PEGASUS_HTTPHEADERTAG_ERRORDETAIL ": ")
             << encodeURICharacters(errorDetail) << STRLIT("\r\n");             << encodeURICharacters(errorDetail) << STRLIT("\r\n");
     }     }
Line 2308 
Line 2326 
     out << STRLIT("<ERROR");     out << STRLIT("<ERROR");
     out << STRLIT(" CODE=\"") << Uint32(cimException.getCode());     out << STRLIT(" CODE=\"") << Uint32(cimException.getCode());
     out.append('"');     out.append('"');
   
     String description = TraceableCIMException(cimException).getDescription();     String description = TraceableCIMException(cimException).getDescription();
   
     if (description != String::EMPTY)     if (description != String::EMPTY)
     {     {
         out << STRLIT(" DESCRIPTION=\"");         out << STRLIT(" DESCRIPTION=\"");
         appendSpecial(out, description);         appendSpecial(out, description);
         out.append('"');         out.append('"');
     }     }
   
       if (cimException.getErrorCount())
       {
           out << STRLIT(">");
   
           for (Uint32 i = 0, n = cimException.getErrorCount(); i < n; i++)
               appendInstanceElement(out, cimException.getError(i));
   
           out << STRLIT("</ERROR>");
       }
       else
     out << STRLIT("/>");     out << STRLIT("/>");
 } }
  
Line 2337 
Line 2368 
  
     CIMType type = value.getType();     CIMType type = value.getType();
     // If the property type is CIMObject, then     // If the property type is CIMObject, then
     //   encode the property in CIM-XML as a string with the EMBEDDEDOBJECT attribute      //   encode the property in CIM-XML as a string with the EMBEDDEDOBJECT
     //   (there is not currently a CIM-XML "object" datatype)      //   attribute (there is not currently a CIM-XML "object" datatype)
     // else     // else
     //   output the real type     //   output the real type
     if (type == CIMTYPE_OBJECT)     if (type == CIMTYPE_OBJECT)
Line 2346 
Line 2377 
         out << STRLIT(" PARAMTYPE=\"string\"");         out << STRLIT(" PARAMTYPE=\"string\"");
         out << STRLIT(" EMBEDDEDOBJECT=\"object\"");         out << STRLIT(" EMBEDDEDOBJECT=\"object\"");
     }     }
   #ifdef PEGASUS_EMBEDDED_INSTANCE_SUPPORT
       else if (type == CIMTYPE_INSTANCE)
       {
           out << STRLIT(" PARAMTYPE=\"string\"");
           out << STRLIT(" EMBEDDEDOBJECT=\"instance\"");
       }
   #endif // PEGASUS_EMBEDDED_INSTANCE_SUPPORT
     else     else
     {     {
         out << STRLIT(" PARAMTYPE=\"") << cimTypeToString (type);         out << STRLIT(" PARAMTYPE=\"") << cimTypeToString (type);
Line 2421 
Line 2459 
  
 //------------------------------------------------------------------------------ //------------------------------------------------------------------------------
 // //
 // appendQualifierNameIParameter()  
 //  
 //------------------------------------------------------------------------------  
   
 void XmlWriter::appendQualifierNameIParameter(  
     Buffer& out,  
     const char* name,  
     const String& qualifierName)  
 {  
     // <!ELEMENT IPARAMVALUE (VALUE|VALUE.ARRAY|VALUE.REFERENCE  
     //     |INSTANCENAME|CLASSNAME|QUALIFIER.DECLARATION  
     //     |CLASS|INSTANCE|VALUE.NAMEDINSTANCE)?>  
     //  
     // ATTN: notice that there is really no way to pass a qualifier name  
     // as an IPARAMVALUE element according to the spec (look above). So we  
     // just pass it as a class name. An answer must be obtained later.  
   
     _appendIParamValueElementBegin(out, name);  
     appendClassNameElement(out, qualifierName);  
     _appendIParamValueElementEnd(out);  
 }  
   
 //------------------------------------------------------------------------------  
 //  
 // appendClassNameIParameter() // appendClassNameIParameter()
 // //
 //------------------------------------------------------------------------------ //------------------------------------------------------------------------------
Line 2723 
Line 2737 
         {         {
                 // NOTE: temporarily put zero for content length. the http code                 // NOTE: temporarily put zero for content length. the http code
                 // will later decide to fill in the length or remove it altogether                 // will later decide to fill in the length or remove it altogether
                 appendMethodResponseHeader(out, httpMethod, httpContentLanguages, 0,          appendMethodResponseHeader(
                                                                                                                          serverResponseTime);              out, httpMethod, httpContentLanguages, 0, serverResponseTime);
                 _appendMessageElementBegin(out, messageId);                 _appendMessageElementBegin(out, messageId);
                 _appendSimpleRspElementBegin(out);                 _appendSimpleRspElementBegin(out);
                 _appendMethodResponseElementBegin(out, methodName);                 _appendMethodResponseElementBegin(out, methodName);
Line 2746 
Line 2760 
 } }
  
  
   
 //------------------------------------------------------------------------------ //------------------------------------------------------------------------------
 // //
 // XmlWriter::formatSimpleMethodErrorRspMessage() // XmlWriter::formatSimpleMethodErrorRspMessage()
Line 2770 
Line 2783 
     _appendSimpleRspElementEnd(out);     _appendSimpleRspElementEnd(out);
     _appendMessageElementEnd(out);     _appendMessageElementEnd(out);
  
 // l10n      appendMethodResponseHeader(
     appendMethodResponseHeader(tmp,          tmp,
         httpMethod,         httpMethod,
         cimException.getContentLanguages(),         cimException.getContentLanguages(),
         out.size());         out.size());
Line 2846 
Line 2859 
                 {                 {
                         // NOTE: temporarily put zero for content length. the http code                         // NOTE: temporarily put zero for content length. the http code
                         // will later decide to fill in the length or remove it altogether                         // will later decide to fill in the length or remove it altogether
                         appendMethodResponseHeader(out, httpMethod, httpContentLanguages, 0,          appendMethodResponseHeader(
                                                                                                                                  serverResponseTime);              out, httpMethod, httpContentLanguages, 0, serverResponseTime);
                         _appendMessageElementBegin(out, messageId);                         _appendMessageElementBegin(out, messageId);
                         _appendSimpleRspElementBegin(out);                         _appendSimpleRspElementBegin(out);
                         _appendIMethodResponseElementBegin(out, iMethodName);                         _appendIMethodResponseElementBegin(out, iMethodName);
  
                         // output the start of the return tag. Test if there is response data by:          // output the start of the return tag. Test if there is response data
           // by:
                         // 1. there is data on the first chunk OR                         // 1. there is data on the first chunk OR
                         // 2. there is no data on the first chunk but isLast is false implying                         // 2. there is no data on the first chunk but isLast is false implying
                         //    there is more non-empty data to come. If all subsequent chunks                         //    there is more non-empty data to come. If all subsequent chunks
Line 2902 
Line 2916 
     _appendSimpleRspElementEnd(out);     _appendSimpleRspElementEnd(out);
     _appendMessageElementEnd(out);     _appendMessageElementEnd(out);
  
 // l10n  
     appendMethodResponseHeader(tmp,     appendMethodResponseHeader(tmp,
          httpMethod,          httpMethod,
          cimException.getContentLanguages(),          cimException.getContentLanguages(),
Line 2957 
Line 2970 
     }     }
     if (contentLanguages.size() > 0)     if (contentLanguages.size() > 0)
     {     {
         out << STRLIT("Content-Language: ") << contentLanguages << STRLIT("\r\n");          out << STRLIT("Content-Language: ") << contentLanguages <<
               STRLIT("\r\n");
     }     }
  
 #ifdef PEGASUS_DEBUG #ifdef PEGASUS_DEBUG
Line 2977 
Line 2991 
         out << STRLIT("Man: http://www.dmtf.org/cim/mapping/http/v1.0; ns=");         out << STRLIT("Man: http://www.dmtf.org/cim/mapping/http/v1.0; ns=");
         out << nn << STRLIT("\r\n");         out << nn << STRLIT("\r\n");
         out << nn << STRLIT("-CIMExport: MethodRequest\r\n");         out << nn << STRLIT("-CIMExport: MethodRequest\r\n");
         out << nn << STRLIT("-CIMExportMethod: ") << cimMethod << STRLIT("\r\n");          out << nn << STRLIT("-CIMExportMethod: ") << cimMethod <<
               STRLIT("\r\n");
     }     }
     else     else
     {     {
Line 3015 
Line 3030 
  
     if (contentLanguages.size() > 0)     if (contentLanguages.size() > 0)
     {     {
         out << STRLIT("Content-Language: ") << contentLanguages << STRLIT("\r\n");          out << STRLIT("Content-Language: ") << contentLanguages <<
               STRLIT("\r\n");
     }     }
     if (httpMethod == HTTP_METHOD_M_POST)     if (httpMethod == HTTP_METHOD_M_POST)
     {     {
Line 3258 
Line 3274 
     _appendSimpleExportRspElementEnd(out);     _appendSimpleExportRspElementEnd(out);
     _appendMessageElementEnd(out);     _appendMessageElementEnd(out);
  
 // l10n      appendEMethodResponseHeader(
     appendEMethodResponseHeader(tmp,          tmp,
          httpMethod,          httpMethod,
          cimException.getContentLanguages(),          cimException.getContentLanguages(),
                  out.size());                  out.size());
Line 3298 
Line 3314 
 // //
 //------------------------------------------------------------------------------ //------------------------------------------------------------------------------
  
 void _xmlWritter_indent(PEGASUS_STD(ostream)& os, Uint32 level, Uint32 indentChars)  void _xmlWritter_indent(
       PEGASUS_STD(ostream)& os,
       Uint32 level,
       Uint32 indentChars)
 { {
     Uint32 n = level * indentChars;     Uint32 n = level * indentChars;
  
Line 3332 
Line 3351 
                 _xmlWritter_indent(os, stack.size(), indentChars);                 _xmlWritter_indent(os, stack.size(), indentChars);
  
                 os << "<?" << entry.text << " ";                 os << "<?" << entry.text << " ";
                 _xmlWritter_printAttributes(os, entry.attributes, entry.attributeCount);                  _xmlWritter_printAttributes(
                       os, entry.attributes, entry.attributeCount);
                 os << "?>";                 os << "?>";
                 break;                 break;
             }             }
Line 3346 
Line 3366 
                 if (entry.attributeCount)                 if (entry.attributeCount)
                     os << ' ';                     os << ' ';
  
                 _xmlWritter_printAttributes(os, entry.attributes, entry.attributeCount);                  _xmlWritter_printAttributes(
                       os, entry.attributes, entry.attributeCount);
                 os << ">";                 os << ">";
                 stack.push(entry.text);                 stack.push(entry.text);
                 break;                 break;
Line 3357 
Line 3378 
                 _xmlWritter_indent(os, stack.size(), indentChars);                 _xmlWritter_indent(os, stack.size(), indentChars);
  
                 os << "<" << entry.text << " ";                 os << "<" << entry.text << " ";
                 _xmlWritter_printAttributes(os, entry.attributes, entry.attributeCount);                  _xmlWritter_printAttributes(
                       os, entry.attributes, entry.attributeCount);
                 os << "/>";                 os << "/>";
                 break;                 break;
             }             }
Line 3375 
Line 3397 
  
             case XmlEntry::COMMENT:             case XmlEntry::COMMENT:
             {             {
   
                 _xmlWritter_indent(os, stack.size(), indentChars);                 _xmlWritter_indent(os, stack.size(), indentChars);
                 os << "<!--";                 os << "<!--";
                 _xmlWritter_appendSpecial(os, entry.text);                 _xmlWritter_appendSpecial(os, entry.text);
Line 3407 
Line 3428 
  
         os << PEGASUS_STD(endl);         os << PEGASUS_STD(endl);
     }     }
   
 } }
  
 //------------------------------------------------------------------------------ //------------------------------------------------------------------------------
Line 3416 
Line 3436 
 // //
 //------------------------------------------------------------------------------ //------------------------------------------------------------------------------
  
   static IDFactory _messageIDFactory(1000);
   
 String XmlWriter::getNextMessageId() String XmlWriter::getNextMessageId()
 { {
     // ATTN: make thread-safe:  
     static Uint32 messageId = 1000;  
   
     messageId++;  
   
     if (messageId < 1000)  
         messageId = 1001;  
   
     char buffer[16];     char buffer[16];
     sprintf(buffer, "%d", messageId);      sprintf(buffer, "%u", _messageIDFactory.getID());
     return buffer;     return buffer;
 } }
  


Legend:
Removed from v.1.135  
changed lines
  Added in v.1.146

No CVS admin address has been configured
Powered by
ViewCVS 0.9.2