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

Diff for /pegasus/src/Pegasus/Common/SCMOInternalXmlEncoder.cpp between version 1.3 and 1.3.4.1

version 1.3, 2009/12/15 16:56:31 version 1.3.4.1, 2011/10/11 18:18:09
Line 36 
Line 36 
  
 void SCMOInternalXmlEncoder::_putXMLInstance( void SCMOInternalXmlEncoder::_putXMLInstance(
     CIMBuffer& out,     CIMBuffer& out,
     const SCMOInstance& ci)      const SCMOInstance& ci,
       const CIMPropertyList& propertyList )
 { {
  
     if (ci.isUninitialized())     if (ci.isUninitialized())
Line 51 
Line 52 
         Buffer buf(4096);         Buffer buf(4096);
  
         // Serialize instance as XML.         // Serialize instance as XML.
         SCMOXmlWriter::appendInstanceElement(buf, ci);          if (propertyList.isNull())
           {
               Array<Uint32> emptyNodes;
               SCMOXmlWriter::appendInstanceElement(
                   buf,
                   ci,
                   false,
                   emptyNodes);
           }
           else
           {
               Array<propertyFilterNodesArray_t> propFilterNodesArrays;
               // This searches for an already created array of nodes,
               // if not found, creates it inside propFilterNodesArrays
               const Array<Uint32> & nodes=
                   SCMOXmlWriter::getFilteredNodesArray(
                       propFilterNodesArrays,
                       ci,
                       propertyList);
               SCMOXmlWriter::appendInstanceElement(
                   buf,
                   ci,
                   true,
                   nodes);
           }
         buf.append('\0');         buf.append('\0');
  
         out.putUint32(buf.size());         out.putUint32(buf.size());
Line 85 
Line 110 
  
 void SCMOInternalXmlEncoder::_putXMLNamedInstance( void SCMOInternalXmlEncoder::_putXMLNamedInstance(
     CIMBuffer& out,     CIMBuffer& out,
     const SCMOInstance& ci)      const Array<SCMOInstance> & ci,
       const CIMPropertyList& propertyList)
 { {
     if (ci.isUninitialized())      Array<propertyFilterNodesArray_t> propFilterNodesArrays;
       Array<Uint32> emptyNodes;
       for (Uint32 i = 0, n = ci.size(); i < n; i++)
       {
           if (ci[i].isUninitialized())
     {     {
         out.putUint32(0);         out.putUint32(0);
         out.putUint32(0);         out.putUint32(0);
Line 97 
Line 127 
     else     else
     {     {
         Buffer buf(4096);         Buffer buf(4096);
   
         // Serialize instance as XML.         // Serialize instance as XML.
               if (propertyList.isNull())
         SCMOXmlWriter::appendInstanceElement(buf, ci);              {
                   SCMOXmlWriter::appendInstanceElement(
                       buf,
                       ci[i],
                       false,
                       emptyNodes);
               }
               else
               {
                   // This searches for an already created array of nodes,
                   // if not found, creates it inside propFilterNodesArrays
                   const Array<Uint32> & nodes =
                       SCMOXmlWriter::getFilteredNodesArray(
                           propFilterNodesArrays,
                           ci[i],
                           propertyList);
                   SCMOXmlWriter::appendInstanceElement(
                       buf,
                       ci[i],
                       true,
                       nodes);
               }
         buf.append('\0');         buf.append('\0');
   
         out.putUint32(buf.size());         out.putUint32(buf.size());
         out.putBytes(buf.getData(), buf.size());         out.putBytes(buf.getData(), buf.size());
         buf.clear();         buf.clear();
  
         if (0 == ci.getClassName())              if (0 == ci[i].getClassName())
         {         {
             out.putUint32(0);             out.putUint32(0);
             out.putString(String());             out.putString(String());
Line 116 
Line 165 
         else         else
         {         {
             // Serialize object path as XML.             // Serialize object path as XML.
             SCMOXmlWriter::appendInstanceNameElement(buf, ci);                  SCMOXmlWriter::appendInstanceNameElement(buf, ci[i]);
             buf.append('\0');             buf.append('\0');
  
             out.putUint32(buf.size());             out.putUint32(buf.size());
Line 124 
Line 173 
  
             // Write hostname and namespace in UTF-16 format             // Write hostname and namespace in UTF-16 format
             Uint32 len=0;             Uint32 len=0;
             const char* hn = ci.getHostName_l(len);                  const char* hn = ci[i].getHostName_l(len);
             out.putUTF8AsString(hn, len);             out.putUTF8AsString(hn, len);
             const char * ns = ci.getNameSpace_l(len);                  const char * ns = ci[i].getNameSpace_l(len);
             out.putUTF8AsString(ns, len);             out.putUTF8AsString(ns, len);
         }         }
     }     }
 } }
   }
  
 void SCMOInternalXmlEncoder::_putXMLObject( void SCMOInternalXmlEncoder::_putXMLObject(
     CIMBuffer& out,     CIMBuffer& out,
     const SCMOInstance& co)      const Array<SCMOInstance> & co,
       const CIMPropertyList& propertyList)
   {
       Array<propertyFilterNodesArray_t> propFilterNodesArrays;
       Array<Uint32> emptyNodes;
       for (Uint32 i = 0, n = co.size(); i < n; i++)
 { {
     if (co.isUninitialized())          if (co[i].isUninitialized())
     {     {
         out.putUint32(0);         out.putUint32(0);
         out.putUint32(0);         out.putUint32(0);
Line 148 
Line 203 
         Buffer buf(4096);         Buffer buf(4096);
  
         // Serialize instance as XML.         // Serialize instance as XML.
               if (propertyList.isNull())
               {
                   SCMOXmlWriter::appendObjectElement(
                       buf,
                       co[i],
                       false,
                       emptyNodes);
               }
               else
               {
                   // This searches for an already created array of nodes,
                   // if not found, creates it inside propFilterNodesArrays
                   const Array<Uint32> & nodes =
                       SCMOXmlWriter::getFilteredNodesArray(
                           propFilterNodesArrays,
                           co[i],
                           propertyList);
                   SCMOXmlWriter::appendObjectElement(
                       buf,
                       co[i],
                       true,
                       nodes);
               }
  
         SCMOXmlWriter::appendObjectElement(buf, co);  
         buf.append('\0');         buf.append('\0');
   
         out.putUint32(buf.size());         out.putUint32(buf.size());
         out.putBytes(buf.getData(), buf.size());         out.putBytes(buf.getData(), buf.size());
         buf.clear();         buf.clear();
  
         if (0 == co.getClassName())              if (0 == co[i].getClassName())
         {         {
             out.putUint32(0);             out.putUint32(0);
             out.putString(String());             out.putString(String());
Line 165 
Line 241 
         else         else
         {         {
             // Serialize object path as XML.             // Serialize object path as XML.
             _appendValueReferenceElement(buf, co);                  _appendValueReferenceElement(buf, co[i]);
             buf.append('\0');             buf.append('\0');
  
             out.putUint32(buf.size());             out.putUint32(buf.size());
Line 173 
Line 249 
  
             // Write hostname and namespace in UTF-16 format             // Write hostname and namespace in UTF-16 format
             Uint32 len=0;             Uint32 len=0;
             const char* hn = co.getHostName_l(len);                  const char* hn = co[i].getHostName_l(len);
             out.putUTF8AsString(hn, len);             out.putUTF8AsString(hn, len);
             const char * ns = co.getNameSpace_l(len);                  const char * ns = co[i].getNameSpace_l(len);
             out.putUTF8AsString(ns, len);             out.putUTF8AsString(ns, len);
         }         }
     }     }
 } }
   }
  
 void SCMOInternalXmlEncoder::_appendValueReferenceElement( void SCMOInternalXmlEncoder::_appendValueReferenceElement(
     Buffer& out,     Buffer& out,


Legend:
Removed from v.1.3  
changed lines
  Added in v.1.3.4.1

No CVS admin address has been configured
Powered by
ViewCVS 0.9.2