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

Diff for /pegasus/src/Pegasus/Common/SCMOXmlWriter.cpp between version 1.1.2.3 and 1.1.2.11

version 1.1.2.3, 2009/09/29 08:18:49 version 1.1.2.11, 2009/10/21 15:12:50
Line 55 
Line 55 
     out << STRLIT("<INSTANCENAME CLASSNAME=\"");     out << STRLIT("<INSTANCENAME CLASSNAME=\"");
     Uint64 len;     Uint64 len;
     const char * className = scmoInstance.getClassName_l(len);     const char * className = scmoInstance.getClassName_l(len);
     out.append(className,len-1);      out.append(className,len);
     out << STRLIT("\">\n");     out << STRLIT("\">\n");
  
     for (Uint32 i = 0, n = scmoInstance.getKeyBindingCount(); i < n; i++)     for (Uint32 i = 0, n = scmoInstance.getKeyBindingCount(); i < n; i++)
Line 65 
Line 65 
         CIMType kbType;         CIMType kbType;
         Uint32 kbNameLen;         Uint32 kbNameLen;
  
         scmoInstance._getKeyBindingDataAtNodeIndex(          SCMO_RC smrc = scmoInstance._getKeyBindingDataAtNodeIndex(
             i,             i,
             &kbName,             &kbName,
             kbNameLen,             kbNameLen,
Line 78 
Line 78 
  
         if (kbType == CIMTYPE_REFERENCE)         if (kbType == CIMTYPE_REFERENCE)
         {         {
             /*              if (SCMO_OK == smrc)
             TODO: NEED RESOLvE the value down to a SCMO....              {
             CIMObjectPath ref = keyBindings[i].getValue();                  SCMOInstance * ref = kbValue->extRefPtr;
             appendValueReferenceElement(out, ref, true);                  appendValueReferenceElement(out, *ref, true);
             */              }
         }         }
         else         else
         {         {
Line 90 
Line 90 
             out << xmlWriterKeyTypeStrings(kbType);             out << xmlWriterKeyTypeStrings(kbType);
             out << STRLIT("\">");             out << STRLIT("\">");
  
               if (SCMO_OK == smrc)
               {
             SCMOXmlWriter::appendSCMBUnion(             SCMOXmlWriter::appendSCMBUnion(
                 out,                 out,
                 *kbValue,                 *kbValue,
                 kbType,                 kbType,
                 scmoInstance.inst.base);                 scmoInstance.inst.base);
               }
             out << STRLIT("</KEYVALUE>\n");             out << STRLIT("</KEYVALUE>\n");
         }         }
         out << STRLIT("</KEYBINDING>\n");         out << STRLIT("</KEYBINDING>\n");
Line 122 
Line 124 
     out << STRLIT("<INSTANCE CLASSNAME=\"");     out << STRLIT("<INSTANCE CLASSNAME=\"");
     Uint64 len;     Uint64 len;
     const char * className = scmoInstance.getClassName_l(len);     const char * className = scmoInstance.getClassName_l(len);
     out.append(className,len-1);      out.append(className,len);
     out << STRLIT("\" >\n");     out << STRLIT("\" >\n");
  
     // Append Instance Qualifiers:     // Append Instance Qualifiers:
Line 141 
Line 143 
     }     }
  
     // Append Properties:     // Append Properties:
     for (Uint32 i=0,k=scmoInstance.inst.hdr->numberProperties;i<k;i++)      for (Uint32 i=0,k=scmoInstance.getPropertyCount();i<k;i++)
     {     {
         if (scmoInstance.inst.hdr->flags.isFiltered &&         if (scmoInstance.inst.hdr->flags.isFiltered &&
             !scmoInstance._isPropertyInFilter(i))             !scmoInstance._isPropertyInFilter(i))
Line 207 
Line 209 
  
     out << STRLIT(">\n");     out << STRLIT(">\n");
     // append the value of the qualifier     // append the value of the qualifier
       SCMOXmlWriter::appendValueElement(out, theQualifier.value, base);
     // TODO: Implement and call appendValueElement  
     //SCMOXmlWriter::appendValueElement(out, theQualifier.value, clsbase);  
  
     out << STRLIT("</QUALIFIER>\n");     out << STRLIT("</QUALIFIER>\n");
 } }
Line 241 
Line 241 
 //              %Propagated;> //              %Propagated;>
 // //
 //------------------------------------------------------------------------------ //------------------------------------------------------------------------------
   
 void SCMOXmlWriter::appendPropertyElement( void SCMOXmlWriter::appendPropertyElement(
     Buffer& out,     Buffer& out,
     const SCMOInstance& scmoInstance,     const SCMOInstance& scmoInstance,
     Uint32 pos)     Uint32 pos)
 { {
     // Get most of the property data from the instance  
     const char* propertyName;  
     Uint32 propertyNameLen;  
     CIMType propertyType;     CIMType propertyType;
       Buffer embeddedQualifierOutput;
  
     // This is an absolute pointer at a SCMBValue     // This is an absolute pointer at a SCMBValue
     SCMBValue * propertyValue;     SCMBValue * propertyValue;
Line 261 
Line 258 
     // instance starts     // instance starts
     const char* clsbase = scmoInstance.inst.hdr->theClass->cls.base;     const char* clsbase = scmoInstance.inst.hdr->theClass->cls.base;
  
     SCMO_RC rc = scmoInstance.getPropertyAt(      scmoInstance._getPropertyAt(
         pos,         pos,
         &propertyValue,         &propertyValue,
         &propertyValueBase,         &propertyValueBase,
Line 269 
Line 266 
  
     propertyType = propertyValue->valueType;     propertyType = propertyValue->valueType;
  
   
     if (propertyValue->flags.isArray)     if (propertyValue->flags.isArray)
     {     {
           Uint32 arraySize=propertyValue->valueArraySize;
   
         out << STRLIT("<PROPERTY.ARRAY NAME=\"");         out << STRLIT("<PROPERTY.ARRAY NAME=\"");
  
         out.append(         out.append(
Line 281 
Line 279 
         out << STRLIT("\" ");         out << STRLIT("\" ");
         if (propertyType == CIMTYPE_OBJECT)         if (propertyType == CIMTYPE_OBJECT)
         {         {
 /*  
             // If the property array type is CIMObject, then             // If the property array type is CIMObject, then
             //    encode the property in CIM-XML as a string array with the             //    encode the property in CIM-XML as a string array with the
             //    EmbeddedObject attribute (there is not currently a CIM-XML             //    EmbeddedObject attribute (there is not currently a CIM-XML
             //    "object" datatype)             //    "object" datatype)
   
             Array<CIMObject> a;  
             rep->getValue().get(a);  
             out << STRLIT(" TYPE=\"string\"");             out << STRLIT(" TYPE=\"string\"");
             // If the Embedded Object is an instance, always add the             // If the Embedded Object is an instance, always add the
             // EmbeddedObject attribute.             // EmbeddedObject attribute.
             if (a.size() > 0 && a[0].isInstance())              SCMOInstance * instPtr = propertyValue->value.extRefPtr;
               if ((0 != instPtr) &&
                       (arraySize > 0) &&
                           !(instPtr->inst.hdr->flags.isClassOnly))
             {             {
                 out << STRLIT(" EmbeddedObject=\"object\""                 out << STRLIT(" EmbeddedObject=\"object\""
                               " EMBEDDEDOBJECT=\"object\"");                               " 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(PEGASUS_QUALIFIERNAME_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(PEGASUS_QUALIFIERNAME_EMBEDDEDOBJECT,  
                                      true));  
                 }  
             }  
 */  
         }         }
         else if (propertyType == CIMTYPE_INSTANCE)         else if (propertyType == CIMTYPE_INSTANCE)
         {         {
 /*  
             // If the property array type is CIMInstance, then             // If the property array type is CIMInstance, then
             //   encode the property in CIM-XML as a string array with the             //   encode the property in CIM-XML as a string array with the
             //   EmbeddedObject attribute (there is not currently a CIM-XML             //   EmbeddedObject attribute (there is not currently a CIM-XML
             //   "instance" datatype)             //   "instance" datatype)
   
             Array<CIMInstance> a;  
             rep->getValue().get(a);  
             out << STRLIT(" TYPE=\"string\"");             out << STRLIT(" TYPE=\"string\"");
   
             // add the EmbeddedObject attribute             // add the EmbeddedObject attribute
             if (a.size() > 0)              if (arraySize > 0)
             {             {
                 out << STRLIT(" EmbeddedObject=\"instance\""                 out << STRLIT(" EmbeddedObject=\"instance\""
                               " EMBEDDEDOBJECT=\"instance\"");                               " 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(  
                         PEGASUS_QUALIFIERNAME_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(  
                         PEGASUS_QUALIFIERNAME_EMBEDDEDINSTANCE,  
                         a[0].getClassName().getString()));  
                 }  
 # endif  
             }             }
 */  
         }         }
         else         else
         {         {
Line 369 
Line 315 
             out << xmlWriterTypeStrings(propertyType);             out << xmlWriterTypeStrings(propertyType);
         }         }
  
         Uint32 arraySize=propertyValue->valueArraySize;  
   
         if (0 != arraySize)         if (0 != arraySize)
         {         {
             out << STRLIT(" ARRAYSIZE=\"");             out << STRLIT(" ARRAYSIZE=\"");
Line 412 
Line 356 
                     clsbase);                     clsbase);
             }             }
         }         }
   
         SCMOXmlWriter::appendValueElement(out,*propertyValue,propertyValueBase);         SCMOXmlWriter::appendValueElement(out,*propertyValue,propertyValueBase);
   
         out << STRLIT("</PROPERTY.ARRAY>\n");         out << STRLIT("</PROPERTY.ARRAY>\n");
     }     }
     else if (propertyType == CIMTYPE_REFERENCE)     else if (propertyType == CIMTYPE_REFERENCE)
     {     {
 /*          out << STRLIT("<PROPERTY.REFERENCE NAME=\"");
         out << STRLIT("<PROPERTY.REFERENCE"          out.append(
                       " NAME=\"") << rep->getName() << STRLIT("\" ");              &(clsbase[propertyDef->name.start]),
               propertyDef->name.length-1);
           out << STRLIT("\" ");
  
         if (!rep->getReferenceClassName().isNull())          if (0 != propertyDef->refClassName.start)
         {         {
             out << STRLIT(" REFERENCECLASS=\"")              out << STRLIT(" REFERENCECLASS=\"");
                 << rep->getReferenceClassName();              out.append(
                   &(clsbase[propertyDef->refClassName.start]),
                   propertyDef->refClassName.length-1);
             out.append('"');             out.append('"');
         }         }
  
         if (!rep->getClassOrigin().isNull())          if (scmoInstance.inst.hdr->flags.includeClassOrigin)
         {         {
             out << STRLIT(" CLASSORIGIN=\"") << rep->getClassOrigin();              if (propertyDef->originClassName.start != 0)
               {
                   out << STRLIT(" CLASSORIGIN=\"");
                   out.append(
                       &(clsbase[propertyDef->originClassName.start]),
                       propertyDef->originClassName.length-1);
             out.append('"');             out.append('"');
         }         }
           }
         if (rep->getPropagated())          if (propertyDef->flags.propagated)
         {         {
             out << STRLIT(" PROPAGATED=\"true\"");             out << STRLIT(" PROPAGATED=\"true\"");
         }         }
   
         out << STRLIT(">\n");         out << STRLIT(">\n");
           // Append Instance Qualifiers:
         for (Uint32 i = 0, n = rep->getQualifierCount(); i < n; i++)          if (scmoInstance.inst.hdr->flags.includeQualifiers)
             XmlWriter::appendQualifierElement(out, rep->getQualifier(i));          {
               SCMBQualifier * theArray=
         XmlWriter::appendValueElement(out, rep->getValue());                  (SCMBQualifier*)
                       &(clsbase[propertyDef->qualifierArray.start]);
               // need to iterate
               for (Uint32 i=0, n=propertyDef->numberOfQualifiers;i<n;i++)
               {
                   SCMOXmlWriter::appendQualifierElement(
                       out,
                       theArray[i],
                       clsbase);
               }
           }
           SCMOXmlWriter::appendValueElement(out,*propertyValue,propertyValueBase);
         out << STRLIT("</PROPERTY.REFERENCE>\n");         out << STRLIT("</PROPERTY.REFERENCE>\n");
 */  
     }     }
     else     else
     {     {
Line 479 
Line 438 
  
         if (propertyType == CIMTYPE_OBJECT)         if (propertyType == CIMTYPE_OBJECT)
         {         {
 /*  
             // 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             //   encode the property in CIM-XML as a string with the
             //   EmbeddedObject attribute (there is not currently a CIM-XML             //   EmbeddedObject attribute (there is not currently a CIM-XML
             //   "object" datatype)             //   "object" datatype)
   
             CIMObject a;  
             rep->getValue().get(a);  
             out << STRLIT(" TYPE=\"string\"");             out << STRLIT(" TYPE=\"string\"");
   
             // If the Embedded Object is an instance, always add the             // If the Embedded Object is an instance, always add the
             // EmbeddedObject attribute.             // EmbeddedObject attribute.
             if (a.isInstance())              SCMOInstance * a = propertyValue->value.extRefPtr;
               if (a && !(a->inst.hdr->flags.isClassOnly))
             {             {
                 out << STRLIT(" EmbeddedObject=\"object\""                 out << STRLIT(" EmbeddedObject=\"object\""
                               " EMBEDDEDOBJECT=\"object\"");                               " 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(PEGASUS_QUALIFIERNAME_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(PEGASUS_QUALIFIERNAME_EMBEDDEDOBJECT,  
                                      true));  
                 }  
             }  
 */  
             }  
             else if (propertyType == CIMTYPE_INSTANCE)             else if (propertyType == CIMTYPE_INSTANCE)
             {             {
 /*  
                 CIMInstance a;  
                 rep->getValue().get(a);  
                 out << STRLIT(" TYPE=\"string\""                 out << STRLIT(" TYPE=\"string\""
                               " EmbeddedObject=\"instance\""                               " EmbeddedObject=\"instance\""
                               " EMBEDDEDOBJECT=\"instance\"");                               " EMBEDDEDOBJECT=\"instance\"");
   
 # ifdef PEGASUS_SNIA_INTEROP_COMPATIBILITY  
                 if (rep->findQualifier(PEGASUS_QUALIFIERNAME_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(  
                         PEGASUS_QUALIFIERNAME_EMBEDDEDINSTANCE,  
                         a.getClassName().getString()));  
                 }                 }
 # endif  
 */  
         }         }
         else         else
         {         {
Line 586 
Line 499 
  
 void SCMOXmlWriter::appendValueElement( void SCMOXmlWriter::appendValueElement(
     Buffer& out,     Buffer& out,
     SCMBValue & value,      const SCMBValue & value,
     const char * base)     const char * base)
 { {
     if (value.flags.isNull)     if (value.flags.isNull)
Line 604 
Line 517 
     }     }
     else if (value.valueType == CIMTYPE_REFERENCE)     else if (value.valueType == CIMTYPE_REFERENCE)
     {     {
 /*          SCMOInstance * ref = value.value.extRefPtr;
         // Has to be separate because it uses VALUE.REFERENCE tag          if (ref)
         CIMObjectPath v;          {
         value.get(v);              appendValueReferenceElement(out, *ref, true);
         _xmlWritter_appendValue(out, v);          }
 */  
     }     }
     else     else
     {     {
Line 622 
Line 534 
     }     }
 } }
  
   //------------------------------------------------------------------------------
   //
   // appendValueReferenceElement()
   //
   //    <!ELEMENT VALUE.REFERENCE
   //        (CLASSPATH|LOCALCLASSPATH|CLASSNAME|INSTANCEPATH|LOCALINSTANCEPATH|
   //         INSTANCENAME)>
   //
   //------------------------------------------------------------------------------
   void SCMOXmlWriter::appendValueReferenceElement(
       Buffer& out,
       const SCMOInstance& ref,
       Boolean putValueWrapper)
   {
       if (putValueWrapper)
       {
           out << STRLIT("<VALUE.REFERENCE>\n");
       }
   
       // See if it is a class or instance reference (instance references have
       // key-bindings; class references do not).
   
       // differentiate between instance and class using the SCMO flag
       if (ref.inst.hdr->flags.isClassOnly)
       {
           // class
           if (0 != ref.inst.hdr->hostName.start)
           {
               appendClassPathElement(out, ref);
           }
           else if (0 != ref.inst.hdr->instNameSpace.start)
           {
               appendLocalClassPathElement(out, ref);
           }
           else
           {
               Uint64 classNameLength=0;
               const char* className = ref.getClassName_l(classNameLength);
               appendClassNameElement(out, className, classNameLength);
           }
       }
       else
       {
           // instance
           if (0 != ref.inst.hdr->hostName.start)
           {
               appendInstancePathElement(out, ref);
           }
           else if (0 != ref.inst.hdr->instNameSpace.start)
           {
               appendLocalInstancePathElement(out, ref);
           }
           else
           {
               appendInstanceNameElement(out, ref);
           }
       }
       if (putValueWrapper)
       {
           out << STRLIT("</VALUE.REFERENCE>\n");
       }
   }
   
   // appendLocalInstancePathElement()
   //     <!ELEMENT LOCALINSTANCEPATH (LOCALNAMESPACEPATH, INSTANCENAME)>
   void SCMOXmlWriter::appendLocalInstancePathElement(
       Buffer& out,
       const SCMOInstance& instancePath)
   {
       out << STRLIT("<LOCALINSTANCEPATH>\n");
       Uint64 nsLength=0;
       const char* ns=instancePath.getNameSpace_l(nsLength);
       appendLocalNameSpacePathElement(out, ns, nsLength);
       appendInstanceNameElement(out, instancePath);
       out << STRLIT("</LOCALINSTANCEPATH>\n");
   }
   
   // appendInstancePathElement()
   //     <!ELEMENT INSTANCEPATH (NAMESPACEPATH,INSTANCENAME)>
   void SCMOXmlWriter::appendInstancePathElement(
       Buffer& out,
       const SCMOInstance& instancePath)
   {
       out << STRLIT("<INSTANCEPATH>\n");
   
       Uint64 hostnameLength=0;
       const char* hostname=instancePath.getHostName_l(hostnameLength);
       Uint64 nsLength=0;
       const char* ns=instancePath.getNameSpace_l(nsLength);
       appendNameSpacePathElement(out,hostname,hostnameLength,ns,nsLength);
   
       appendInstanceNameElement(out, instancePath);
       out << STRLIT("</INSTANCEPATH>\n");
   }
   
   // appendValueObjectWithPathElement()
   //     <!ELEMENT VALUE.OBJECTWITHPATH
   //         ((CLASSPATH,CLASS)|(INSTANCEPATH,INSTANCE))>
   void SCMOXmlWriter::appendValueObjectWithPathElement(
       Buffer& out,
       const SCMOInstance& objectWithPath)
   {
       out << STRLIT("<VALUE.OBJECTWITHPATH>\n");
   
       appendValueReferenceElement(out, objectWithPath, false);
       appendObjectElement(out, objectWithPath);
   
       out << STRLIT("</VALUE.OBJECTWITHPATH>\n");
   }
   
   // appendObjectElement()
   // May refer to a CLASS or an INSTANCE
   void SCMOXmlWriter::appendObjectElement(
       Buffer& out,
       const SCMOInstance& object)
   {
       if (object.inst.hdr->flags.isClassOnly)
       {
           appendClassElement(out, object);
       }
       else
       {
           appendInstanceElement(out, object);
       }
   }
   
   //------------------------------------------------------------------------------
   //
   // appendClassElement()
   //
   //     <!ELEMENT CLASS
   //         (QUALIFIER*,(PROPERTY|PROPERTY.ARRAY|PROPERTY.REFERENCE)*,METHOD*)>
   //     <!ATTLIST CLASS
   //         %CIMName;
   //         %SuperClass;>
   //
   //------------------------------------------------------------------------------
   
   void SCMOXmlWriter::appendClassElement(
       Buffer& out,
       const SCMOInstance& cimClass)
   {
   
       SCMBClass_Main* theClass = cimClass.inst.hdr->theClass->cls.hdr;
       const char* clsBase = cimClass.inst.hdr->theClass->cls.base;
   
       // Class opening element:
       out << STRLIT("<CLASS NAME=\"");
       out.append(
           &(clsBase[theClass->className.start]),
           theClass->className.length-1);
   
       out << STRLIT("\" ");
       if (0 != theClass->superClassName.start)
       {
           out << STRLIT(" SUPERCLASS=\"");
           out.append(
               &(clsBase[theClass->superClassName.start]),
               theClass->superClassName.length-1);
           out << STRLIT("\" ");
       }
       out << STRLIT(">\n");
   
       // Append class qualifiers
       SCMBQualifier *theArray =
           (SCMBQualifier*)&(clsBase[theClass->qualifierArray.start]);
       for (Uint32 i=0, n=theClass->numberOfQualifiers;i<n;i++)
       {
           SCMOXmlWriter::appendQualifierElement(out,theArray[i],clsBase);
       }
   
       // Append Property definitions:
       for (Uint32 i=0,k=cimClass.getPropertyCount();i<k;i++)
       {
               SCMOXmlWriter::appendPropertyElement(out,cimClass,i);
       }
   
       // ATTN: No method definitions with SCMO today, so do nothing with them
       //       Actually this code does not serve a purpose, but is kept here
       //       for completeness.
   
       // Class closing element:
       out << STRLIT("</CLASS>\n");
   }
   
   // appendLocalClassPathElement()
   //     <!ELEMENT LOCALCLASSPATH (LOCALNAMESPACEPATH, CLASSNAME)>
   void SCMOXmlWriter::appendLocalClassPathElement(
       Buffer& out,
       const SCMOInstance& classPath)
   {
       out << STRLIT("<LOCALCLASSPATH>\n");
       Uint64 hostnameLength=0;
       const char* hostname=classPath.getHostName_l(hostnameLength);
       Uint64 nsLength=0;
       const char* ns=classPath.getNameSpace_l(nsLength);
   
       appendNameSpacePathElement(out,hostname,hostnameLength,ns,nsLength);
   
       Uint64 classNameLength=0;
       const char* className = classPath.getClassName_l(classNameLength);
       appendClassNameElement(out, className, classNameLength);
       out << STRLIT("</LOCALCLASSPATH>\n");
   }
   
   // appendClassPathElement()
   //     <!ELEMENT CLASSPATH (NAMESPACEPATH,CLASSNAME)>
   void SCMOXmlWriter::appendClassPathElement(
       Buffer& out,
       const SCMOInstance& classPath)
   {
       out << STRLIT("<CLASSPATH>\n");
   
       Uint64 hostnameLength=0;
       const char* hostname=classPath.getHostName_l(hostnameLength);
       Uint64 nsLength=0;
       const char* ns=classPath.getNameSpace_l(nsLength);
   
       appendNameSpacePathElement(out,hostname,hostnameLength,ns,nsLength);
   
       Uint64 classNameLength=0;
       const char* className = classPath.getClassName_l(classNameLength);
   
       appendClassNameElement(out, className, classNameLength);
       out << STRLIT("</CLASSPATH>\n");
   }
   
 void SCMOXmlWriter::appendSCMBUnion( void SCMOXmlWriter::appendSCMBUnion(
     Buffer& out,     Buffer& out,
     const SCMBUnion & u,     const SCMBUnion & u,
Line 632 
Line 771 
     {     {
         case CIMTYPE_BOOLEAN:         case CIMTYPE_BOOLEAN:
         {         {
               if (u.simple.hasValue)
               {
             SCMOXmlWriter::append(out, u.simple.val.bin);             SCMOXmlWriter::append(out, u.simple.val.bin);
               }
             break;             break;
         }         }
  
         case CIMTYPE_UINT8:         case CIMTYPE_UINT8:
         {         {
               if (u.simple.hasValue)
               {
             SCMOXmlWriter::append(out, u.simple.val.u8);             SCMOXmlWriter::append(out, u.simple.val.u8);
               }
             break;             break;
         }         }
  
         case CIMTYPE_SINT8:         case CIMTYPE_SINT8:
         {         {
               if (u.simple.hasValue)
               {
             SCMOXmlWriter::append(out, u.simple.val.s8);             SCMOXmlWriter::append(out, u.simple.val.s8);
               }
             break;             break;
         }         }
  
         case CIMTYPE_UINT16:         case CIMTYPE_UINT16:
         {         {
               if (u.simple.hasValue)
               {
             SCMOXmlWriter::append(out, u.simple.val.u16);             SCMOXmlWriter::append(out, u.simple.val.u16);
               }
             break;             break;
         }         }
  
         case CIMTYPE_SINT16:         case CIMTYPE_SINT16:
         {         {
               if (u.simple.hasValue)
               {
             SCMOXmlWriter::append(out, u.simple.val.s16);             SCMOXmlWriter::append(out, u.simple.val.s16);
               }
             break;             break;
         }         }
  
         case CIMTYPE_UINT32:         case CIMTYPE_UINT32:
         {         {
               if (u.simple.hasValue)
               {
             SCMOXmlWriter::append(out, u.simple.val.u32);             SCMOXmlWriter::append(out, u.simple.val.u32);
               }
             break;             break;
         }         }
  
         case CIMTYPE_SINT32:         case CIMTYPE_SINT32:
         {         {
               if (u.simple.hasValue)
               {
             SCMOXmlWriter::append(out, u.simple.val.s32);             SCMOXmlWriter::append(out, u.simple.val.s32);
               }
             break;             break;
         }         }
  
         case CIMTYPE_UINT64:         case CIMTYPE_UINT64:
         {         {
               if (u.simple.hasValue)
               {
             SCMOXmlWriter::append(out, u.simple.val.u64);             SCMOXmlWriter::append(out, u.simple.val.u64);
               }
             break;             break;
         }         }
  
         case CIMTYPE_SINT64:         case CIMTYPE_SINT64:
         {         {
               if (u.simple.hasValue)
               {
             SCMOXmlWriter::append(out, u.simple.val.s64);             SCMOXmlWriter::append(out, u.simple.val.s64);
               }
             break;             break;
         }         }
  
         case CIMTYPE_REAL32:         case CIMTYPE_REAL32:
         {         {
               if (u.simple.hasValue)
               {
             SCMOXmlWriter::append(out, u.simple.val.r32);             SCMOXmlWriter::append(out, u.simple.val.r32);
               }
             break;             break;
         }         }
  
         case CIMTYPE_REAL64:         case CIMTYPE_REAL64:
         {         {
               if (u.simple.hasValue)
               {
             SCMOXmlWriter::append(out, u.simple.val.r64);             SCMOXmlWriter::append(out, u.simple.val.r64);
               }
             break;             break;
         }         }
  
         case CIMTYPE_CHAR16:         case CIMTYPE_CHAR16:
         {         {
               if (u.simple.hasValue)
               {
             SCMOXmlWriter::appendSpecial(             SCMOXmlWriter::appendSpecial(
                 out,                 out,
                 u.simple.val.c16);                 u.simple.val.c16);
               }
             break;             break;
         }         }
  
         case CIMTYPE_STRING:         case CIMTYPE_STRING:
         {         {
               if (u.stringValue.start)
               {
             SCMOXmlWriter::appendSpecial(             SCMOXmlWriter::appendSpecial(
                 out,                 out,
                 &(base[u.stringValue.start]),                 &(base[u.stringValue.start]),
                 u.stringValue.length-1);                 u.stringValue.length-1);
               }
             break;             break;
         }         }
  
Line 723 
Line 901 
             out.append(buffer,sizeof(buffer)-1);             out.append(buffer,sizeof(buffer)-1);
             break;             break;
         }         }
 /*          // Object and Instance are both written the same way, namely as
           // object element which then is encoded using appendSpecial
         case CIMTYPE_OBJECT:         case CIMTYPE_OBJECT:
         {  
             CIMObject v;  
             value.get(v);  
             _xmlWritter_appendValue(out, v);  
             break;  
         }  
         case CIMTYPE_INSTANCE:         case CIMTYPE_INSTANCE:
         {         {
             CIMInstance v;              Buffer toEncodeObject(4000);
             value.get(v);              SCMOInstance * obj = u.extRefPtr;
             _xmlWritter_appendValue(out, v);              if (obj)
               {
                   appendObjectElement(toEncodeObject, *obj);
                   SCMOXmlWriter::appendSpecial(
                       out,
                       toEncodeObject.getData(),
                       toEncodeObject.size());
               }
             break;             break;
         }         }
         default:         default:
             PEGASUS_ASSERT(false);              // CIMTYPE_REFERENCE has been handled upfront, do nothing here
 */              break;
     }     }
 } }
  
Line 958 
Line 1138 
             out << STRLIT("</VALUE.ARRAY>\n");             out << STRLIT("</VALUE.ARRAY>\n");
             break;             break;
         }         }
 /*          case CIMTYPE_REFERENCE:
         case CIMTYPE_OBJECT:  
         {         {
             CIMObject v;              out << STRLIT("<VALUE.REFARRAY>\n");
             value.get(v);              while (numElements--)
             _xmlWritter_appendValue(out, v);              {
             break;                  SCMOInstance * ref = arr->extRefPtr;
                   if (ref)
                   {
                       appendValueReferenceElement(out, *ref, true);
                   }
                   arr++;
         }         }
               out << STRLIT("</VALUE.REFARRAY>\n");
           }
           case CIMTYPE_OBJECT:
         case CIMTYPE_INSTANCE:         case CIMTYPE_INSTANCE:
         {         {
             CIMInstance v;              out << STRLIT("<VALUE.ARRAY>\n");
             value.get(v);              Buffer toEncodeObject(4000);
             _xmlWritter_appendValue(out, v);              while (numElements--)
               {
                   toEncodeObject.clear();
                   out << STRLIT("<VALUE>");
                   SCMOInstance * obj = arr->extRefPtr;
                   if (obj)
                   {
                       appendObjectElement(toEncodeObject, *obj);
                       SCMOXmlWriter::appendSpecial(
                           out,
                           toEncodeObject.getData(),
                           toEncodeObject.size());
                   }
                   arr++;
                   out << STRLIT("</VALUE>\n");
               }
               out << STRLIT("</VALUE.ARRAY>\n");
             break;             break;
         }         }
         default:         default:
             PEGASUS_ASSERT(false);              PEGASUS_DEBUG_ASSERT(false);
 */  
     }     }
  
 } }


Legend:
Removed from v.1.1.2.3  
changed lines
  Added in v.1.1.2.11

No CVS admin address has been configured
Powered by
ViewCVS 0.9.2