(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.142 and 1.156

version 1.142, 2006/10/30 13:02:53 version 1.156, 2008/03/05 21:31:45
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 51 
Line 36 
 #include <cstdio> #include <cstdio>
 #include "Constants.h" #include "Constants.h"
 #include "CIMClass.h" #include "CIMClass.h"
 #include "CIMError.h"  
 #include "CIMClassRep.h" #include "CIMClassRep.h"
 #include "CIMInstance.h" #include "CIMInstance.h"
 #include "CIMInstanceRep.h" #include "CIMInstanceRep.h"
Line 77 
Line 61 
 #include "StrLit.h" #include "StrLit.h"
 #include "LanguageParser.h" #include "LanguageParser.h"
 #include "IDFactory.h" #include "IDFactory.h"
   #include "StringConversion.h"
  
 PEGASUS_NAMESPACE_BEGIN PEGASUS_NAMESPACE_BEGIN
  
Line 108 
Line 93 
 struct SpecialChar struct SpecialChar
 { {
     const char* str;     const char* str;
     size_t size;      Uint32 size;
 }; };
  
 // Defines encodings of special characters. Just use a 7-bit ASCII character // Defines encodings of special characters. Just use a 7-bit ASCII character
Line 271 
Line 256 
     return out;     return out;
 } }
  
 Buffer& operator<<(Buffer& out, const Indentor& x)  
 {  
     XmlWriter::append(out, x);  
     return out;  
 }  
   
 Buffer& operator<<(Buffer& out, const Buffer& x) Buffer& operator<<(Buffer& out, const Buffer& x)
 { {
     out.append(x.getData(), x.size());     out.append(x.getData(), x.size());
Line 296 
Line 275 
 } }
  
  
 // 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 346 
Line 323 
     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 374 
Line 352 
 { {
     if ( ((c < 0x20) && (c >= 0)) || (c == 0x7f) )     if ( ((c < 0x20) && (c >= 0)) || (c == 0x7f) )
     {     {
         char charref[7];          char scratchBuffer[22];
         sprintf(charref, "&#%u;", static_cast<Uint8>(c));          Uint32 outputLength;
         os << charref;          const char * output = Uint8ToString(scratchBuffer,
                                               static_cast<Uint8>(c),
                                               outputLength);
           os << "&#" << output << ";";
     }     }
     else     else
     {     {
Line 421 
Line 402 
     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 436 
Line 418 
         _xmlWritter_appendSpecialChar(os, *str++);         _xmlWritter_appendSpecialChar(os, *str++);
 } }
  
   // On windows sprintf outputs 3 digit precision exponent prepending
   // zeros. Make it 2 digit precision if first digit is zero in the exponent.
   #ifdef PEGASUS_OS_TYPE_WINDOWS
   inline void _xmlWriter_normalizeRealValueString(char *str)
   {
       // skip initial sign value...
       if (*str == '-' || *str == '+')
       {
           ++str;
       }
       while (*str && *str != '+' && *str != '-')
       {
           ++str;
       }
       if (*str && * ++str == '0')
       {
           *str = *(str+1);
           *(str+1) = *(str+2);
           *(str+2) = 0;
       }
   }
   #endif
   
 void XmlWriter::append(Buffer& out, const Char16& x) void XmlWriter::append(Buffer& out, const Char16& x)
 { {
     _xmlWritter_appendChar(out, x);     _xmlWritter_appendChar(out, x);
Line 443 
Line 448 
  
 void XmlWriter::append(Buffer& out, Boolean x) void XmlWriter::append(Buffer& out, Boolean x)
 { {
     append(out, (x ? "TRUE" : "FALSE"));      if (x)
           out.append(STRLIT_ARGS("TRUE"));
       else
           out.append(STRLIT_ARGS("FALSE"));
 } }
  
 void XmlWriter::append(Buffer& out, Uint32 x) void XmlWriter::append(Buffer& out, Uint32 x)
 { {
     char buffer[32];      Uint32 outputLength=0;
     sprintf(buffer, "%u", x);      char buffer[22];
     append(out, buffer);      const char * output = Uint32ToString(buffer, x, outputLength);
       out.append(output, outputLength);
 } }
  
 void XmlWriter::append(Buffer& out, Sint32 x) void XmlWriter::append(Buffer& out, Sint32 x)
 { {
     char buffer[32];      Uint32 outputLength=0;
     sprintf(buffer, "%d", x);      char buffer[22];
     append(out, buffer);      const char * output = Sint32ToString(buffer, x, outputLength);
       out.append(output, outputLength);
 } }
  
 void XmlWriter::append(Buffer& out, Uint64 x) void XmlWriter::append(Buffer& out, Uint64 x)
 { {
     char buffer[32];  // Should need 21 chars max      Uint32 outputLength=0;
     sprintf(buffer, "%" PEGASUS_64BIT_CONVERSION_WIDTH "u", x);      char buffer[22];
     append(out, buffer);      const char * output = Uint64ToString(buffer, x, outputLength);
       out.append(output, outputLength);
 } }
  
 void XmlWriter::append(Buffer& out, Sint64 x) void XmlWriter::append(Buffer& out, Sint64 x)
 { {
     char buffer[32];  // Should need 21 chars max      Uint32 outputLength=0;
     sprintf(buffer, "%" PEGASUS_64BIT_CONVERSION_WIDTH "d", x);      char buffer[22];
     append(out, buffer);      const char * output = Sint64ToString(buffer, x, outputLength);
       out.append(output, outputLength);
 } }
  
 void XmlWriter::append(Buffer& out, Real32 x) void XmlWriter::append(Buffer& out, Real32 x)
Line 481 
Line 493 
     // given in the CIM/XML spec, and the precision required by the CIM 2.2 spec     // given in the CIM/XML spec, and the precision required by the CIM 2.2 spec
     // (4 byte IEEE floating point)     // (4 byte IEEE floating point)
     sprintf(buffer, "%.7e", x);     sprintf(buffer, "%.7e", x);
   #ifdef PEGASUS_OS_TYPE_WINDOWS
       _xmlWriter_normalizeRealValueString(buffer);
   #endif
     append(out, buffer);     append(out, buffer);
 } }
  
 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);
   #ifdef PEGASUS_OS_TYPE_WINDOWS
       _xmlWriter_normalizeRealValueString(buffer);
   #endif
     append(out, buffer);     append(out, buffer);
 } }
  
Line 533 
Line 551 
             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 553 
Line 571 
     }     }
 } }
  
 void XmlWriter::append(Buffer& out, const Indentor& x)  
 {  
     for (Uint32 i = 0; i < 4 * x.getLevel(); i++)  
         out.append(' ');  
 }  
   
 void XmlWriter::appendSpecial(Buffer& out, const Char16& x) void XmlWriter::appendSpecial(Buffer& out, const Char16& x)
 { {
     _xmlWritter_appendSpecialChar(out, x);     _xmlWritter_appendSpecialChar(out, x);
Line 723 
Line 735 
             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 835 
Line 848 
             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 1391 
Line 1405 
 { {
     Buffer tmp;     Buffer tmp;
     appendValueElement(tmp, value);     appendValueElement(tmp, value);
     tmp.append('\0');  
     os << tmp.getData() << PEGASUS_STD(endl);     os << tmp.getData() << PEGASUS_STD(endl);
 } }
  
Line 1486 
Line 1499 
 { {
     Buffer tmp;     Buffer tmp;
     appendValueReferenceElement(tmp, reference, true);     appendValueReferenceElement(tmp, reference, true);
     tmp.append('\0');  
     indentedPrint(os, tmp.getData());     indentedPrint(os, tmp.getData());
 } }
  
Line 1524 
Line 1536 
  
 void XmlWriter::appendClassElement( void XmlWriter::appendClassElement(
     Buffer& out,     Buffer& out,
     const CIMConstClass& cimclass)      const CIMConstClass& cimClass)
   {
       CheckRep(cimClass._rep);
       const CIMClassRep* rep = cimClass._rep;
   
       // Class opening element:
   
       out << STRLIT("<CLASS NAME=\"")
           << rep->getClassName()
           << STRLIT("\" ");
   
       if (!rep->getSuperClassName().isNull())
 { {
     cimclass._checkRep();          out << STRLIT(" SUPERCLASS=\"")
     cimclass._rep->toXml(out);              << rep->getSuperClassName()
               << STRLIT("\" ");
       }
   
       out << STRLIT(">\n");
   
       // Append Class Qualifiers:
   
       for (Uint32 i = 0, n = rep->getQualifierCount(); i < n; i++)
           XmlWriter::appendQualifierElement(out, rep->getQualifier(i));
   
       // Append Property definitions:
   
       for (Uint32 i = 0, n = rep->getPropertyCount(); i < n; i++)
           XmlWriter::appendPropertyElement(out, rep->getProperty(i));
   
       // Append Method definitions:
   
       for (Uint32 i = 0, n = rep->getMethodCount(); i < n; i++)
           XmlWriter::appendMethodElement(out, rep->getMethod(i));
   
       // Class closing element:
   
       out << STRLIT("</CLASS>\n");
 } }
  
 void XmlWriter::printClassElement( void XmlWriter::printClassElement(
Line 1536 
Line 1582 
 { {
     Buffer tmp;     Buffer tmp;
     appendClassElement(tmp, cimclass);     appendClassElement(tmp, cimclass);
     tmp.append('\0');  
     indentedPrint(os, tmp.getData(), 4);     indentedPrint(os, tmp.getData(), 4);
 } }
  
Line 1555 
Line 1600 
     Buffer& out,     Buffer& out,
     const CIMConstInstance& instance)     const CIMConstInstance& instance)
 { {
     instance._checkRep();      CheckRep(instance._rep);
     instance._rep->toXml(out);      const CIMInstanceRep* rep = instance._rep;
   
       // Class opening element:
   
       out << STRLIT("<INSTANCE CLASSNAME=\"")
           << rep->getClassName()
           << STRLIT("\" >\n");
   
       // Append Instance Qualifiers:
   
       for (Uint32 i = 0, n = rep->getQualifierCount(); i < n; i++)
           XmlWriter::appendQualifierElement(out, rep->getQualifier(i));
   
       // Append Properties:
   
       for (Uint32 i = 0, n = rep->getPropertyCount(); i < n; i++)
           XmlWriter::appendPropertyElement(out, rep->getProperty(i));
   
       // Instance closing element:
   
       out << STRLIT("</INSTANCE>\n");
 } }
  
 void XmlWriter::printInstanceElement( void XmlWriter::printInstanceElement(
Line 1565 
Line 1630 
 { {
     Buffer tmp;     Buffer tmp;
     appendInstanceElement(tmp, instance);     appendInstanceElement(tmp, instance);
     tmp.append('\0');  
     os << tmp.getData() << PEGASUS_STD(endl);     os << tmp.getData() << PEGASUS_STD(endl);
 } }
  
Line 1626 
Line 1690 
     Buffer& out,     Buffer& out,
     const CIMConstProperty& property)     const CIMConstProperty& property)
 { {
     property._checkRep();      CheckRep(property._rep);
     property._rep->toXml(out);      const CIMPropertyRep* rep = property._rep;
   
       if (rep->getValue().isArray())
       {
           out << STRLIT("<PROPERTY.ARRAY NAME=\"")
               << rep->getName()
               << STRLIT("\" ");
   
           if (rep->getValue().getType() == CIMTYPE_OBJECT)
           {
               // If the property array type is CIMObject, then
               //     encode the property in CIM-XML as a string array with the
               //     EmbeddedObject attribute (there is not currently a CIM-XML
               //     "object" datatype)
   
               Array<CIMObject> a;
               rep->getValue().get(a);
               out << STRLIT(" TYPE=\"string\"");
               // If the Embedded Object is an instance, always add the
               // EmbeddedObject attribute.
               if (a.size() > 0 && a[0].isInstance())
               {
                   out << STRLIT(" EmbeddedObject=\"object\"");
                   out << STRLIT(" EMBEDDEDOBJECT=\"object\"");
               }
   #ifndef PEGASUS_SNIA_INTEROP_COMPATIBILITY
               else
   #endif
               {
                   // Else the Embedded Object is a class, always add the
                   // EmbeddedObject qualifier.  Note that if the macro
                   // PEGASUS_SNIA_INTEROP_COMPATIBILITY is defined, then
                   // the EmbeddedObject qualifier will always be added,
                   // whether it's a class or an instance.
                   if (rep->findQualifier(CIMName("EmbeddedObject")) ==
                           PEG_NOT_FOUND)
                   {
                       // Note that addQualifiers() cannot be called on a const
                       // CIMQualifierRep.  In this case we really do want to add
                       // the EmbeddedObject qualifier, so we cast away the
                       // constness.
                       CIMPropertyRep* tmpRep = const_cast<CIMPropertyRep*>(rep);
                       tmpRep->addQualifier(
                           CIMQualifier(CIMName("EmbeddedObject"), true));
                   }
               }
           }
   #ifdef PEGASUS_EMBEDDED_INSTANCE_SUPPORT
           else if (rep->getValue().getType() == CIMTYPE_INSTANCE)
           {
               // If the property array type is CIMInstance, then
               //   encode the property in CIM-XML as a string array with the
               //   EmbeddedObject attribute (there is not currently a CIM-XML
               //   "instance" datatype)
   
               Array<CIMInstance> a;
               rep->getValue().get(a);
               out << STRLIT(" TYPE=\"string\"");
   
               // add the EmbeddedObject attribute
               if (a.size() > 0)
               {
                   out << STRLIT(" EmbeddedObject=\"instance\"");
                   out << STRLIT(" EMBEDDEDOBJECT=\"instance\"");
   
                   // Note that if the macro PEGASUS_SNIA_INTEROP_COMPATIBILITY is
                   // defined, then the EmbeddedInstance qualifier will be added
   # ifdef PEGASUS_SNIA_INTEROP_COMPATIBILITY
                   if (rep->findQualifier(CIMName("EmbeddedInstance")) ==
                           PEG_NOT_FOUND)
                   {
                       // Note that addQualifiers() cannot be called on a const
                       // CIMQualifierRep.  In this case we really do want to add
                       // the EmbeddedInstance qualifier, so we cast away the
                       // constness.
   
                       // For now, we assume that all the embedded instances in
                       // the array are of the same type
                       CIMPropertyRep* tmpRep = const_cast<CIMPropertyRep*>(rep);
                       tmpRep->addQualifier(CIMQualifier(
                           CIMName("EmbeddedInstance"),
                           a[0].getClassName().getString()));
                   }
   # endif
               }
           }
   #endif // PEGASUS_EMBEDDED_INSTANCE_SUPPORT
           else
           {
               out << STRLIT(" TYPE=\"")
                   << cimTypeToString(rep->getValue().getType());
               out.append('"');
           }
   
           if (rep->getArraySize())
           {
               char buffer[32];
               sprintf(buffer, "%d", rep->getArraySize());
               out << STRLIT(" ARRAYSIZE=\"") << buffer;
               out.append('"');
           }
   
           if (!rep->getClassOrigin().isNull())
           {
               out << STRLIT(" CLASSORIGIN=\"") << rep->getClassOrigin();
               out.append('"');
           }
   
           if (rep->getPropagated())
           {
               out << STRLIT(" PROPAGATED=\"true\"");
           }
   
           out << STRLIT(">\n");
   
           for (Uint32 i = 0, n = rep->getQualifierCount(); i < n; i++)
               XmlWriter::appendQualifierElement(out, rep->getQualifier(i));
   
           XmlWriter::appendValueElement(out, rep->getValue());
   
           out << STRLIT("</PROPERTY.ARRAY>\n");
       }
       else if (rep->getValue().getType() == CIMTYPE_REFERENCE)
       {
           out << STRLIT("<PROPERTY.REFERENCE");
   
           out << STRLIT(" NAME=\"") << rep->getName() << STRLIT("\" ");
   
           if (!rep->getReferenceClassName().isNull())
           {
               out << STRLIT(" REFERENCECLASS=\"") << rep->getReferenceClassName();
               out.append('"');
           }
   
           if (!rep->getClassOrigin().isNull())
           {
               out << STRLIT(" CLASSORIGIN=\"") << rep->getClassOrigin();
               out.append('"');
           }
   
           if (rep->getPropagated())
           {
               out << STRLIT(" PROPAGATED=\"true\"");
           }
   
           out << STRLIT(">\n");
   
           for (Uint32 i = 0, n = rep->getQualifierCount(); i < n; i++)
               XmlWriter::appendQualifierElement(out, rep->getQualifier(i));
   
           XmlWriter::appendValueElement(out, rep->getValue());
   
           out << STRLIT("</PROPERTY.REFERENCE>\n");
       }
       else
       {
           out << STRLIT("<PROPERTY NAME=\"") << rep->getName() << STRLIT("\" ");
   
           if (!rep->getClassOrigin().isNull())
           {
               out << STRLIT(" CLASSORIGIN=\"") << rep->getClassOrigin();
               out.append('"');
           }
   
           if (rep->getPropagated())
           {
               out << STRLIT(" PROPAGATED=\"true\"");
           }
   
           if (rep->getValue().getType() == CIMTYPE_OBJECT)
           {
               // If the property type is CIMObject, then
               //   encode the property in CIM-XML as a string with the
               //   EmbeddedObject attribute (there is not currently a CIM-XML
               //   "object" datatype)
   
               CIMObject a;
               rep->getValue().get(a);
               out << STRLIT(" TYPE=\"string\"");
   
               // If the Embedded Object is an instance, always add the
               // EmbeddedObject attribute.
               if (a.isInstance())
               {
                   out << STRLIT(" EmbeddedObject=\"object\"");
                   out << STRLIT(" EMBEDDEDOBJECT=\"object\"");
               }
               // Else the Embedded Object is a class, always add the
               // EmbeddedObject qualifier.
   #ifndef PEGASUS_SNIA_INTEROP_COMPATIBILITY
               else
   #endif
               {
                   // Note that if the macro PEGASUS_SNIA_INTEROP_COMPATIBILITY
                   // is defined, then the EmbeddedObject qualifier will always
                   // be added, whether it's a class or an instance.
                   if (rep->findQualifier(CIMName("EmbeddedObject")) ==
                           PEG_NOT_FOUND)
                   {
                       // Note that addQualifiers() cannot be called on a const
                       // CIMQualifierRep.  In this case we really do want to add
                       // the EmbeddedObject qualifier, so we cast away the
                       // constness.
                       CIMPropertyRep* tmpRep = const_cast<CIMPropertyRep*>(rep);
                       tmpRep->addQualifier(
                           CIMQualifier(CIMName("EmbeddedObject"), true));
                   }
               }
           }
   #ifdef PEGASUS_EMBEDDED_INSTANCE_SUPPORT
           else if (rep->getValue().getType() == CIMTYPE_INSTANCE)
           {
               CIMInstance a;
               rep->getValue().get(a);
               out << " TYPE=\"string\"";
               out << " EmbeddedObject=\"instance\"";
               out << " EMBEDDEDOBJECT=\"instance\"";
   
   # ifdef PEGASUS_SNIA_INTEROP_COMPATIBILITY
               if (rep->findQualifier(CIMName("EmbeddedObject")) == PEG_NOT_FOUND)
               {
                   // Note that addQualifiers() cannot be called on a const
                   // CIMQualifierRep.  In this case we really do want to add
                   // the EmbeddedInstance qualifier, so we cast away the
                   // constness.
                   CIMPropertyRep* tmpRep = const_cast<CIMPropertyRep*>(rep);
                   tmpRep->addQualifier(CIMQualifier(
                       CIMName("EmbeddedInstance"),
                       a.getClassName().getString()));
               }
   # endif
           }
   #endif // PEGASUS_EMBEDDED_INSTANCE_SUPPORT
           else
           {
               out << STRLIT(" TYPE=\"")
                   << cimTypeToString(rep->getValue().getType());
               out.append('"');
           }
   
           out << STRLIT(">\n");
   
           for (Uint32 i = 0, n = rep->getQualifierCount(); i < n; i++)
               XmlWriter::appendQualifierElement(out, rep->getQualifier(i));
   
           XmlWriter::appendValueElement(out, rep->getValue());
   
           out << STRLIT("</PROPERTY>\n");
       }
 } }
  
 void XmlWriter::printPropertyElement( void XmlWriter::printPropertyElement(
Line 1636 
Line 1948 
 { {
     Buffer tmp;     Buffer tmp;
     appendPropertyElement(tmp, property);     appendPropertyElement(tmp, property);
     tmp.append('\0');  
     os << tmp.getData() << PEGASUS_STD(endl);     os << tmp.getData() << PEGASUS_STD(endl);
 } }
  
Line 1658 
Line 1969 
     Buffer& out,     Buffer& out,
     const CIMConstMethod& method)     const CIMConstMethod& method)
 { {
     method._checkRep();      CheckRep(method._rep);
     method._rep->toXml(out);      const CIMMethodRep* rep = method._rep;
   
       out << STRLIT("<METHOD NAME=\"") << rep->getName();
       out.append('"');
   
       out << STRLIT(" TYPE=\"") << cimTypeToString(rep->getType());
       out.append('"');
   
       if (!rep->getClassOrigin().isNull())
       {
           out << STRLIT(" CLASSORIGIN=\"") << rep->getClassOrigin();
           out.append('"');
       }
   
       if (rep->getPropagated())
       {
           out << STRLIT(" PROPAGATED=\"true\"");
       }
   
       out << STRLIT(">\n");
   
       for (Uint32 i = 0, n = rep->getQualifierCount(); i < n; i++)
           XmlWriter::appendQualifierElement(out, rep->getQualifier(i));
   
       for (Uint32 i = 0, n = rep->getParameterCount(); i < n; i++)
           XmlWriter::appendParameterElement(out, rep->getParameter(i));
   
       out << STRLIT("</METHOD>\n");
 } }
  
 void XmlWriter::printMethodElement( void XmlWriter::printMethodElement(
Line 1668 
Line 2006 
 { {
     Buffer tmp;     Buffer tmp;
     appendMethodElement(tmp, method);     appendMethodElement(tmp, method);
     tmp.append('\0');  
     os << tmp.getData() << PEGASUS_STD(endl);     os << tmp.getData() << PEGASUS_STD(endl);
 } }
  
Line 1704 
Line 2041 
     Buffer& out,     Buffer& out,
     const CIMConstParameter& parameter)     const CIMConstParameter& parameter)
 { {
     parameter._checkRep();      CheckRep(parameter._rep);
     parameter._rep->toXml(out);      const CIMParameterRep* rep = parameter._rep;
   
       if (rep->isArray())
       {
           if (rep->getType() == CIMTYPE_REFERENCE)
           {
               out << STRLIT("<PARAMETER.REFARRAY NAME=\"") << rep->getName();
               out.append('"');
   
               if (!rep->getReferenceClassName().isNull())
               {
                   out << STRLIT(" REFERENCECLASS=\"");
                   out << rep->getReferenceClassName().getString();
                   out.append('"');
               }
   
               if (rep->getArraySize())
               {
                   char buffer[32];
                   int n = sprintf(buffer, "%d", rep->getArraySize());
                   out << STRLIT(" ARRAYSIZE=\"");
                   out.append(buffer, n);
                   out.append('"');
               }
   
               out << STRLIT(">\n");
   
               for (Uint32 i = 0, n = rep->getQualifierCount(); i < n; i++)
                   XmlWriter::appendQualifierElement(out, rep->getQualifier(i));
   
               out << STRLIT("</PARAMETER.REFARRAY>\n");
           }
           else
           {
               out << STRLIT("<PARAMETER.ARRAY");
               out << STRLIT(" NAME=\"") << rep->getName();
               out << STRLIT("\" ");
               out << STRLIT(" TYPE=\"") << cimTypeToString(rep->getType());
               out.append('"');
   
               if (rep->getArraySize())
               {
                   char buffer[32];
                   sprintf(buffer, "%d", rep->getArraySize());
                   out << STRLIT(" ARRAYSIZE=\"") << buffer;
                   out.append('"');
               }
   
               out << STRLIT(">\n");
   
               for (Uint32 i = 0, n = rep->getQualifierCount(); i < n; i++)
                   XmlWriter::appendQualifierElement(out, rep->getQualifier(i));
   
               out << STRLIT("</PARAMETER.ARRAY>\n");
           }
       }
       else if (rep->getType() == CIMTYPE_REFERENCE)
       {
           out << STRLIT("<PARAMETER.REFERENCE");
           out << STRLIT(" NAME=\"") << rep->getName();
           out.append('"');
   
           if (!rep->getReferenceClassName().isNull())
           {
               out << STRLIT(" REFERENCECLASS=\"");
               out << rep->getReferenceClassName().getString();
               out.append('"');
           }
           out << STRLIT(">\n");
   
           for (Uint32 i = 0, n = rep->getQualifierCount(); i < n; i++)
               XmlWriter::appendQualifierElement(out, rep->getQualifier(i));
   
           out << STRLIT("</PARAMETER.REFERENCE>\n");
       }
       else
       {
           out << STRLIT("<PARAMETER");
           out << STRLIT(" NAME=\"") << rep->getName();
           out << STRLIT("\" ");
           out << STRLIT(" TYPE=\"") << cimTypeToString(rep->getType());
           out << STRLIT("\">\n");
   
           for (Uint32 i = 0, n = rep->getQualifierCount(); i < n; i++)
               XmlWriter::appendQualifierElement(out, rep->getQualifier(i));
   
           out << STRLIT("</PARAMETER>\n");
       }
 } }
  
 void XmlWriter::printParameterElement( void XmlWriter::printParameterElement(
Line 1714 
Line 2138 
 { {
     Buffer tmp;     Buffer tmp;
     appendParameterElement(tmp, parameter);     appendParameterElement(tmp, parameter);
     tmp.append('\0');  
     os << tmp.getData() << PEGASUS_STD(endl);     os << tmp.getData() << PEGASUS_STD(endl);
 } }
  
Line 1724 
Line 2147 
 // //
 //     <!ELEMENT PARAMVALUE (VALUE|VALUE.REFERENCE|VALUE.ARRAY|VALUE.REFARRAY)?> //     <!ELEMENT PARAMVALUE (VALUE|VALUE.REFERENCE|VALUE.ARRAY|VALUE.REFARRAY)?>
 //     <!ATTLIST PARAMVALUE //     <!ATTLIST PARAMVALUE
 //              %CIMName;>  //         %CIMName;
   //         %EmbeddedObject; #IMPLIED
   //         %ParamType;>
 // //
 //------------------------------------------------------------------------------ //------------------------------------------------------------------------------
  
Line 1732 
Line 2157 
     Buffer& out,     Buffer& out,
     const CIMParamValue& paramValue)     const CIMParamValue& paramValue)
 { {
     paramValue._checkRep();      CheckRep(paramValue._rep);
     paramValue._rep->toXml(out);      const CIMParamValueRep* rep = paramValue._rep;
   
       out << STRLIT("<PARAMVALUE NAME=\"") << rep->getParameterName();
       out.append('"');
   
       CIMType type = rep->getValue().getType();
   
       if (rep->isTyped())
       {
           XmlWriter::appendParamTypeAndEmbeddedObjAttrib(out, type);
       }
   
       out << STRLIT(">\n");
       XmlWriter::appendValueElement(out, rep->getValue());
   
       out << STRLIT("</PARAMVALUE>\n");
 } }
  
 void XmlWriter::printParamValueElement( void XmlWriter::printParamValueElement(
Line 1742 
Line 2182 
 { {
     Buffer tmp;     Buffer tmp;
     appendParamValueElement(tmp, paramValue);     appendParamValueElement(tmp, paramValue);
     tmp.append('\0');  
     os << tmp.getData() << PEGASUS_STD(endl);     os << tmp.getData() << PEGASUS_STD(endl);
 } }
  
Line 1763 
Line 2202 
     Buffer& out,     Buffer& out,
     const CIMConstQualifier& qualifier)     const CIMConstQualifier& qualifier)
 { {
     qualifier._checkRep();      CheckRep(qualifier._rep);
     qualifier._rep->toXml(out);      const CIMQualifierRep* rep = qualifier._rep;
   
       out << STRLIT("<QUALIFIER NAME=\"") << rep->getName();
       out.append('"');
       out << STRLIT(" TYPE=\"") << cimTypeToString(rep->getValue().getType());
       out.append('"');
   
       if (rep->getPropagated())
       {
           out << STRLIT(" PROPAGATED=\"true\"");
       }
   
       XmlWriter::appendQualifierFlavorEntity(out, rep->getFlavor());
   
       out << STRLIT(">\n");
   
       XmlWriter::appendValueElement(out, rep->getValue());
   
       out << STRLIT("</QUALIFIER>\n");
 } }
  
 void XmlWriter::printQualifierElement( void XmlWriter::printQualifierElement(
Line 1773 
Line 2230 
 { {
     Buffer tmp;     Buffer tmp;
     appendQualifierElement(tmp, qualifier);     appendQualifierElement(tmp, qualifier);
     tmp.append('\0');  
     os << tmp.getData() << PEGASUS_STD(endl);     os << tmp.getData() << PEGASUS_STD(endl);
 } }
  
Line 1795 
Line 2251 
     Buffer& out,     Buffer& out,
     const CIMConstQualifierDecl& qualifierDecl)     const CIMConstQualifierDecl& qualifierDecl)
 { {
     qualifierDecl._checkRep();      CheckRep(qualifierDecl._rep);
     qualifierDecl._rep->toXml(out);      const CIMQualifierDeclRep* rep = qualifierDecl._rep;
   
       out << STRLIT("<QUALIFIER.DECLARATION NAME=\"") << rep->getName();
       out.append('"');
       out << STRLIT(" TYPE=\"") << cimTypeToString(rep->getValue().getType());
       out.append('"');
   
       if (rep->getValue().isArray())
       {
           out << STRLIT(" ISARRAY=\"true\"");
   
           if (rep->getArraySize())
           {
               char buffer[64];
               int n = sprintf(buffer, " ARRAYSIZE=\"%d\"", rep->getArraySize());
               out.append(buffer, n);
           }
       }
   
       XmlWriter::appendQualifierFlavorEntity(out, rep->getFlavor());
   
       out << STRLIT(">\n");
   
       XmlWriter::appendScopeElement(out, rep->getScope());
       XmlWriter::appendValueElement(out, rep->getValue());
   
       out << STRLIT("</QUALIFIER.DECLARATION>\n");
 } }
  
 void XmlWriter::printQualifierDeclElement( void XmlWriter::printQualifierDeclElement(
Line 1805 
Line 2287 
 { {
     Buffer tmp;     Buffer tmp;
     appendQualifierDeclElement(tmp, qualifierDecl);     appendQualifierDeclElement(tmp, qualifierDecl);
     tmp.append('\0');  
     os << tmp.getData() << PEGASUS_STD(endl);     os << tmp.getData() << PEGASUS_STD(endl);
 } }
  
Line 1933 
Line 2414 
     }     }
     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 1963 
Line 2445 
     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 2001 
Line 2484 
  
      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 2075 
Line 2559 
     const String& content)     const String& content)
 { {
     out << STRLIT("HTTP/1.1 " HTTP_STATUS_UNAUTHORIZED "\r\n");     out << STRLIT("HTTP/1.1 " HTTP_STATUS_UNAUTHORIZED "\r\n");
       Uint32 contentLength = 0;
       OUTPUT_CONTENTLENGTH;
     out << content << STRLIT("\r\n");     out << content << STRLIT("\r\n");
     out << STRLIT("\r\n");     out << STRLIT("\r\n");
  
Line 2336 
Line 2822 
  
     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('"');
     }     }
     out << STRLIT(">");  
  
     ((CIMException*)&cimException)->addError(CIMError().getInstance());      if (cimException.getErrorCount())
       {
           out << STRLIT(">");
  
     for (Uint32 i = 0, n = cimException.getErrorCount(); i < n; i++)     for (Uint32 i = 0, n = cimException.getErrorCount(); i < n; i++)
     {  
         appendInstanceElement(out, cimException.getError(i));         appendInstanceElement(out, cimException.getError(i));
     }  
  
     out << STRLIT("</ERROR>");     out << STRLIT("</ERROR>");
 } }
       else
           out << STRLIT("/>");
   }
  
 //------------------------------------------------------------------------------  //----------------------------------------------------------------------
 //  
 // appendReturnValueElement()  
 // //
 // <!ELEMENT RETURNVALUE (VALUE|VALUE.REFERENCE)>  // appendParmType
 // <!ATTLIST RETURNVALUE  // Appends the Param type and EmbeddedObject Info
   // to the buffer
 //     %EmbeddedObject; #IMPLIED //     %EmbeddedObject; #IMPLIED
 //     %ParamType;> //     %ParamType;>
 // //
 //------------------------------------------------------------------------------  //---------------------------------------------------------------------
   void XmlWriter::appendParamTypeAndEmbeddedObjAttrib(
 void XmlWriter::appendReturnValueElement(  
     Buffer& out,     Buffer& out,
     const CIMValue& value)      const CIMType& type)
 { {
     out << STRLIT("<RETURNVALUE");  
  
     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).
       //   Because of an error in Pegasus we were earlier outputting
       //   upper case "EMBEDDEDOBJECT" as the attribute name. The
       //   spec calls for mixed case "EmbeddedObject. Fixed in
       //   bug 7131 to output EmbeddedObject  attribute in upper
       //   case and mixed case. Receiver will ignore one or the
       //   other.
     // else     // else
     //   output the real type     //   output the real type
     if (type == CIMTYPE_OBJECT)     if (type == CIMTYPE_OBJECT)
     {     {
   
         out << STRLIT(" PARAMTYPE=\"string\"");         out << STRLIT(" PARAMTYPE=\"string\"");
           out << STRLIT(" EmbeddedObject=\"object\"");
         out << STRLIT(" EMBEDDEDOBJECT=\"object\"");         out << STRLIT(" EMBEDDEDOBJECT=\"object\"");
     }     }
 #ifdef PEGASUS_EMBEDDED_INSTANCE_SUPPORT #ifdef PEGASUS_EMBEDDED_INSTANCE_SUPPORT
     else if (type == CIMTYPE_INSTANCE)     else if (type == CIMTYPE_INSTANCE)
     {     {
         out << STRLIT(" PARAMTYPE=\"string\"");         out << STRLIT(" PARAMTYPE=\"string\"");
           out << STRLIT(" EmbeddedObject=\"instance\"");
         out << STRLIT(" EMBEDDEDOBJECT=\"instance\"");         out << STRLIT(" EMBEDDEDOBJECT=\"instance\"");
     }     }
 #endif // PEGASUS_EMBEDDED_INSTANCE_SUPPORT #endif // PEGASUS_EMBEDDED_INSTANCE_SUPPORT
Line 2397 
Line 2892 
         out << STRLIT(" PARAMTYPE=\"") << cimTypeToString (type);         out << STRLIT(" PARAMTYPE=\"") << cimTypeToString (type);
         out.append('"');         out.append('"');
     }     }
   }
   
   //------------------------------------------------------------------------------
   //
   // appendReturnValueElement()
   //
   // <!ELEMENT RETURNVALUE (VALUE|VALUE.REFERENCE)>
   // <!ATTLIST RETURNVALUE
   //     %EmbeddedObject; #IMPLIED
   //     %ParamType;>
   //
   //------------------------------------------------------------------------------
   
   
   void XmlWriter::appendReturnValueElement(
       Buffer& out,
       const CIMValue& value)
   {
       out << STRLIT("<RETURNVALUE");
   
       CIMType type = value.getType();
   
       appendParamTypeAndEmbeddedObjAttrib(out, type);
  
     out << STRLIT(">\n");     out << STRLIT(">\n");
  
Line 2745 
Line 3263 
         {         {
                 // 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 2768 
Line 3286 
 } }
  
  
   
 //------------------------------------------------------------------------------ //------------------------------------------------------------------------------
 // //
 // XmlWriter::formatSimpleMethodErrorRspMessage() // XmlWriter::formatSimpleMethodErrorRspMessage()
Line 2792 
Line 3309 
     _appendSimpleRspElementEnd(out);     _appendSimpleRspElementEnd(out);
     _appendMessageElementEnd(out);     _appendMessageElementEnd(out);
  
 // l10n      appendMethodResponseHeader(
     appendMethodResponseHeader(tmp,          tmp,
         httpMethod,         httpMethod,
         cimException.getContentLanguages(),         cimException.getContentLanguages(),
         out.size());         out.size());
Line 2868 
Line 3385 
                 {                 {
                         // 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 2924 
Line 3442 
     _appendSimpleRspElementEnd(out);     _appendSimpleRspElementEnd(out);
     _appendMessageElementEnd(out);     _appendMessageElementEnd(out);
  
 // l10n  
     appendMethodResponseHeader(tmp,     appendMethodResponseHeader(tmp,
          httpMethod,          httpMethod,
          cimException.getContentLanguages(),          cimException.getContentLanguages(),
Line 2979 
Line 3496 
     }     }
     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 2999 
Line 3517 
         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 3037 
Line 3556 
  
     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 3280 
Line 3800 
     _appendSimpleExportRspElementEnd(out);     _appendSimpleExportRspElementEnd(out);
     _appendMessageElementEnd(out);     _appendMessageElementEnd(out);
  
 // l10n      appendEMethodResponseHeader(
     appendEMethodResponseHeader(tmp,          tmp,
          httpMethod,          httpMethod,
          cimException.getContentLanguages(),          cimException.getContentLanguages(),
                  out.size());                  out.size());
Line 3320 
Line 3840 
 // //
 //------------------------------------------------------------------------------ //------------------------------------------------------------------------------
  
 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 3354 
Line 3877 
                 _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 3368 
Line 3892 
                 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 3379 
Line 3904 
                 _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 3397 
Line 3923 
  
             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 3429 
Line 3954 
  
         os << PEGASUS_STD(endl);         os << PEGASUS_STD(endl);
     }     }
   
 } }
  
 //------------------------------------------------------------------------------ //------------------------------------------------------------------------------
Line 3442 
Line 3966 
  
 String XmlWriter::getNextMessageId() String XmlWriter::getNextMessageId()
 { {
     char buffer[16];      char scratchBuffer[22];
     sprintf(buffer, "%u", _messageIDFactory.getID());      Uint32 n;
     return buffer;      const char * startP = Uint32ToString(scratchBuffer,
                                            _messageIDFactory.getID(),
                                            n);
       return String(startP, n);
 } }
  
 //------------------------------------------------------------------------------ //------------------------------------------------------------------------------


Legend:
Removed from v.1.142  
changed lines
  Added in v.1.156

No CVS admin address has been configured
Powered by
ViewCVS 0.9.2