(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.4.2.9 and 1.10

version 1.4.2.9, 2013/10/17 19:13:47 version 1.10, 2014/09/30 11:04:31
Line 41 
Line 41 
 #include "Tracer.h" #include "Tracer.h"
  
 PEGASUS_NAMESPACE_BEGIN PEGASUS_NAMESPACE_BEGIN
   
 void SCMOXmlWriter::buildPropertyFilterNodesArray( void SCMOXmlWriter::buildPropertyFilterNodesArray(
      Array<Uint32> & nodes,      Array<Uint32> & nodes,
      const SCMOClass * classPtr,      const SCMOClass * classPtr,
Line 51 
Line 52 
         Uint32 node = 0;         Uint32 node = 0;
         const CIMName & name = propertyList[i];         const CIMName & name = propertyList[i];
         SCMO_RC rc =         SCMO_RC rc =
             classPtr->_getProperyNodeIndex(              classPtr->_getPropertyNodeIndex(
                 node,                 node,
                 (const char *)name.getString().getCString());                 (const char *)name.getString().getCString());
         if(rc == SCMO_OK)         if(rc == SCMO_OK)
Line 174 
Line 175 
 } }
 //EXP_PULL_END //EXP_PULL_END
  
 // KS_TODO - Show the XML statement for this function  
 void SCMOXmlWriter::appendValueSCMOInstanceElement( void SCMOXmlWriter::appendValueSCMOInstanceElement(
     Buffer& out,     Buffer& out,
     const SCMOInstance& scmoInstance,     const SCMOInstance& scmoInstance,
Line 224 
Line 224 
             if (SCMO_OK == smrc)             if (SCMO_OK == smrc)
             {             {
                 SCMOInstance * ref = kbValue->extRefPtr;                 SCMOInstance * ref = kbValue->extRefPtr;
                 appendValueReferenceElement(out, *ref, true);                  appendValueReferenceElement(out, *ref);
             }             }
         }         }
         else         else
Line 291 
Line 291 
     // Append Properties:     // Append Properties:
     if(!filtered)     if(!filtered)
     {     {
         for (Uint32 i=0,k=scmoInstance.inst.hdr->numberProperties;i<k;i++)          for (Uint32 i=0,k=scmoInstance.getPropertyCount();i<k;i++)
         {         {
             SCMOXmlWriter::appendPropertyElement(out,scmoInstance,i);             SCMOXmlWriter::appendPropertyElement(out,scmoInstance,i);
         }         }
Line 389 
Line 389 
 //              %Propagated;> //              %Propagated;>
 // //
 //------------------------------------------------------------------------------ //------------------------------------------------------------------------------
   
 void SCMOXmlWriter::appendPropertyElement( void SCMOXmlWriter::appendPropertyElement(
     Buffer& out,     Buffer& out,
     const SCMOInstance& scmoInstance,     const SCMOInstance& scmoInstance,
     Uint32 pos)     Uint32 pos)
 { {
     CIMType propertyType;  
  
     // This is an absolute pointer at a SCMBValue      // Absolute pointer to the property SCMBValue
     SCMBValue * propertyValue;     SCMBValue * propertyValue;
     const char * propertyValueBase;     const char * propertyValueBase;
     // This is an absolute pointer at a SCMBValue  
       // Absolute pointer at a SCMBValue
     SCMBClassProperty * propertyDef;     SCMBClassProperty * propertyDef;
     // This is the absolute pointer at which the class info for the given      // Absolute pointer to the the class info for the given
     // instance starts     // instance starts
     const char* clsbase = scmoInstance.inst.hdr->theClass.ptr->cls.base;     const char* clsbase = scmoInstance.inst.hdr->theClass.ptr->cls.base;
  
Line 411 
Line 412 
         &propertyValueBase,         &propertyValueBase,
         &propertyDef);         &propertyDef);
  
     propertyType = propertyValue->valueType;      bool noClassExists = scmoInstance.inst.hdr->flags.noClassForInstance;
       bool includeClassOrigin = scmoInstance.inst.hdr->flags.includeClassOrigin;
       bool includeQualifiers = scmoInstance.inst.hdr->flags.includeQualifiers;
       // This one either false or comes from class definition
       bool propagated = false;
   
       // Get property name and set any output parameter values
       const char * pName;
       Uint32 pLen;
       if (scmoInstance._isClassDefinedProperty(pos))
       {
           // Get name from class Definition
           pName = &(clsbase[propertyDef->name.start]);
           pLen = (propertyDef->name.size-1);
           propagated = propertyDef->flags.propagated;
       }
       else
       {
           // Get name from Instance
           SCMBUserPropertyElement* pElement =
               scmoInstance._getUserDefinedPropertyElementAt(pos);
   
           pName = _getCharString(pElement->name,scmoInstance.inst.base);
           pLen = pElement->name.size-1;
           includeQualifiers = false;
       }
       // KS_TODO clarify classOrigin acquisition.
       CIMType propertyType = propertyValue->valueType;
  
     if (propertyValue->flags.isArray)     if (propertyValue->flags.isArray)
     {     {
Line 419 
Line 447 
  
         out << STRLIT("<PROPERTY.ARRAY NAME=\"");         out << STRLIT("<PROPERTY.ARRAY NAME=\"");
  
         out.append(          out.append(pName, pLen);
             &(clsbase[propertyDef->name.start]),  
             (propertyDef->name.size-1));  
  
         out.append('"',' ');         out.append('"',' ');
         //out << STRLIT("\" ");         //out << STRLIT("\" ");
Line 457 
Line 483 
                               " EMBEDDEDOBJECT=\"instance\"");                               " EMBEDDEDOBJECT=\"instance\"");
             }             }
         }         }
           // Every CYMType but CIMOBject, CIMInstance
         else         else
         {         {
             out.append(' ');             out.append(' ');
Line 470 
Line 497 
             out.append('"');             out.append('"');
         }         }
  
           if (includeClassOrigin)
         if (scmoInstance.inst.hdr->flags.includeClassOrigin)  
         {         {
             if (propertyDef->originClassName.start != 0)             if (propertyDef->originClassName.start != 0)
             {             {
Line 482 
Line 508 
                 out.append('"');                 out.append('"');
             }             }
         }         }
         if (propertyDef->flags.propagated)  
           if (propagated)
         {         {
             out << STRLIT(" PROPAGATED=\"true\"");             out << STRLIT(" PROPAGATED=\"true\"");
         }         }
Line 491 
Line 518 
         //out << STRLIT(">\n");         //out << STRLIT(">\n");
  
         // Append Instance Qualifiers:         // Append Instance Qualifiers:
         if (scmoInstance.inst.hdr->flags.includeQualifiers)          if (includeQualifiers)
         {         {
             SCMBQualifier * theArray=             SCMBQualifier * theArray=
                 (SCMBQualifier*)                 (SCMBQualifier*)
Line 508 
Line 535 
         SCMOXmlWriter::appendValueElement(out,*propertyValue,propertyValueBase);         SCMOXmlWriter::appendValueElement(out,*propertyValue,propertyValueBase);
         out << STRLIT("</PROPERTY.ARRAY>\n");         out << STRLIT("</PROPERTY.ARRAY>\n");
     }     }
   
       // else Not an array type
     else if (propertyType == CIMTYPE_REFERENCE)     else if (propertyType == CIMTYPE_REFERENCE)
     {     {
         out << STRLIT("<PROPERTY.REFERENCE NAME=\"");         out << STRLIT("<PROPERTY.REFERENCE NAME=\"");
         out.append(          out.append(pName, pLen);
             &(clsbase[propertyDef->name.start]),  
             (propertyDef->name.size-1));  
         out.append('"',' ');         out.append('"',' ');
         //out << STRLIT("\" ");         //out << STRLIT("\" ");
  
         if (0 != propertyDef->refClassName.start)          if ((!noClassExists) && (0 != propertyDef->refClassName.start))
         {         {
             out << STRLIT(" REFERENCECLASS=\"");             out << STRLIT(" REFERENCECLASS=\"");
             out.append(             out.append(
Line 526 
Line 553 
             out.append('"');             out.append('"');
         }         }
  
         if (scmoInstance.inst.hdr->flags.includeClassOrigin)          if (includeClassOrigin)
         {         {
             if (propertyDef->originClassName.start != 0)             if (propertyDef->originClassName.start != 0)
             {             {
Line 537 
Line 564 
                 out.append('"');                 out.append('"');
             }             }
         }         }
         if (propertyDef->flags.propagated)          if (propagated)
         {         {
             out << STRLIT(" PROPAGATED=\"true\"");             out << STRLIT(" PROPAGATED=\"true\"");
         }         }
         out.append('>','\n');         out.append('>','\n');
         //out << STRLIT(">\n");         //out << STRLIT(">\n");
   
         // Append Instance Qualifiers:         // Append Instance Qualifiers:
         if (scmoInstance.inst.hdr->flags.includeQualifiers)          if (includeQualifiers)
         {         {
             SCMBQualifier * theArray=             SCMBQualifier * theArray=
                 (SCMBQualifier*)                 (SCMBQualifier*)
Line 565 
Line 593 
     {     {
         out << STRLIT("<PROPERTY NAME=\"");         out << STRLIT("<PROPERTY NAME=\"");
  
         out.append(          out.append(pName, pLen);
             &(clsbase[propertyDef->name.start]),  
             (propertyDef->name.size-1));  
  
         out.append('"',' ');         out.append('"',' ');
         //out << STRLIT("\" ");         //out << STRLIT("\" ");
  
         if (scmoInstance.inst.hdr->flags.includeClassOrigin)          // User-defined properties will not includeClassOrigin
           if (includeClassOrigin)
         {         {
             if (propertyDef->originClassName.start != 0)             if (propertyDef->originClassName.start != 0)
             {             {
Line 583 
Line 610 
                 out.append('"');                 out.append('"');
             }             }
         }         }
         if (propertyDef->flags.propagated)          if (propagated)
         {         {
             out << STRLIT(" PROPAGATED=\"true\"");             out << STRLIT(" PROPAGATED=\"true\"");
         }         }
Line 619 
Line 646 
         //out << STRLIT(">\n");         //out << STRLIT(">\n");
  
         // Append Instance Qualifiers:         // Append Instance Qualifiers:
         if (scmoInstance.inst.hdr->flags.includeQualifiers)          if (includeQualifiers)
         {         {
             SCMBQualifier * theArray=             SCMBQualifier * theArray=
                 (SCMBQualifier*)                 (SCMBQualifier*)
                     &(clsbase[propertyDef->qualifierArray.start]);                     &(clsbase[propertyDef->qualifierArray.start]);
             // need to iterate              // Iterate through all qualifiers
             for (Uint32 i=0, n=propertyDef->numberOfQualifiers;i<n;i++)             for (Uint32 i=0, n=propertyDef->numberOfQualifiers;i<n;i++)
             {             {
                 SCMOXmlWriter::appendQualifierElement(                 SCMOXmlWriter::appendQualifierElement(
Line 673 
Line 700 
         SCMOInstance * ref = value.value.extRefPtr;         SCMOInstance * ref = value.value.extRefPtr;
         if (ref)         if (ref)
         {         {
             appendValueReferenceElement(out, *ref, true);              appendValueReferenceElement(out, *ref);
         }         }
     }     }
     else     else
Line 698 
Line 725 
 //------------------------------------------------------------------------------ //------------------------------------------------------------------------------
 void SCMOXmlWriter::appendValueReferenceElement( void SCMOXmlWriter::appendValueReferenceElement(
     Buffer& out,     Buffer& out,
     const SCMOInstance& ref,      const SCMOInstance& ref)
     Boolean putValueWrapper)  
 {  
     if (putValueWrapper)  
     {     {
         out << STRLIT("<VALUE.REFERENCE>\n");         out << STRLIT("<VALUE.REFERENCE>\n");
   
       appendClassOrInstancePathElement(out, ref);
   
       out << STRLIT("</VALUE.REFERENCE>\n");
     }     }
  
   // Append either a class or instance Path Element
   void SCMOXmlWriter::appendClassOrInstancePathElement(
       Buffer& out,
       const SCMOInstance& ref)
   {
     // See if it is a class or instance reference (instance references have     // See if it is a class or instance reference (instance references have
     // key-bindings; class references do not).     // key-bindings; class references do not).
  
Line 744 
Line 777 
             appendInstanceNameElement(out, ref);             appendInstanceNameElement(out, ref);
         }         }
     }     }
     if (putValueWrapper)  
     {  
         out << STRLIT("</VALUE.REFERENCE>\n");  
     }  
 } }
  
 // appendLocalInstancePathElement() // appendLocalInstancePathElement()
Line 857 
Line 886 
 { {
     out << STRLIT("<VALUE.OBJECTWITHPATH>\n");     out << STRLIT("<VALUE.OBJECTWITHPATH>\n");
  
     appendValueReferenceElement(out, objectWithPath, false);      appendClassOrInstancePathElement(out, objectWithPath);
     appendObjectElement(out, objectWithPath,filtered,nodes);     appendObjectElement(out, objectWithPath,filtered,nodes);
  
     out << STRLIT("</VALUE.OBJECTWITHPATH>\n");     out << STRLIT("</VALUE.OBJECTWITHPATH>\n");
Line 1369 
Line 1398 
                 SCMOInstance * ref = arr->extRefPtr;                 SCMOInstance * ref = arr->extRefPtr;
                 if (ref)                 if (ref)
                 {                 {
                     appendValueReferenceElement(out, *ref, true);                      appendValueReferenceElement(out, *ref);
                 }                 }
                 arr++;                 arr++;
             }             }


Legend:
Removed from v.1.4.2.9  
changed lines
  Added in v.1.10

No CVS admin address has been configured
Powered by
ViewCVS 0.9.2