(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.4 and 1.1.2.5

version 1.1.2.4, 2009/09/29 08:29:32 version 1.1.2.5, 2009/10/13 13:39:24
Line 141 
Line 141 
     }     }
  
     // 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 417 
Line 417 
     }     }
     else if (propertyType == CIMTYPE_REFERENCE)     else if (propertyType == CIMTYPE_REFERENCE)
     {     {
 /*      TODO: Implement writing 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 607 
Line 624 
         CIMObjectPath v;         CIMObjectPath v;
         value.get(v);         value.get(v);
         _xmlWritter_appendValue(out, v);         _xmlWritter_appendValue(out, v);
           ----> same as: XmlWriter::appendValueReferenceElement(out, x, true);
 */ */
     }     }
     else     else
Line 620 
Line 638 
     }     }
 } }
  
   //------------------------------------------------------------------------------
   //
   // 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);
           }
   /*      TODO: Implement
           else if (!reference.getNameSpace().isNull())
           {
               appendLocalClassPathElement(out, reference);
           }
           else
           {
               appendClassNameElement(out, reference.getClassName());
           }
   */
       }
       else
       {
           // instance
           if (0 != ref.inst.hdr->hostName.start)
           {
               // appendInstancePathElement(out, reference);
           }
   /*      TODO: Implement
           else if (!reference.getNameSpace().isNull())
           {
               appendLocalInstancePathElement(out, reference);
           }
           else
           {
               appendInstanceNameElement(out, reference);
           }
   */
       }
       if (putValueWrapper)
           out << STRLIT("</VALUE.REFERENCE>\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-1);
       out << STRLIT("</CLASSPATH>\n");
   }
   
 void SCMOXmlWriter::appendSCMBUnion( void SCMOXmlWriter::appendSCMBUnion(
     Buffer& out,     Buffer& out,
     const SCMBUnion & u,     const SCMBUnion & u,


Legend:
Removed from v.1.1.2.4  
changed lines
  Added in v.1.1.2.5

No CVS admin address has been configured
Powered by
ViewCVS 0.9.2