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

Diff for /pegasus/src/Pegasus/Common/XmlReader.cpp between version 1.34 and 1.35

version 1.34, 2002/03/06 05:12:05 version 1.35, 2002/03/07 00:42:12
Line 768 
Line 768 
 // ATTN-C: note that integers are truncated without warning. What should be // ATTN-C: note that integers are truncated without warning. What should be
 // done in this case? In C they are truncated without warning by design. // done in this case? In C they are truncated without warning by design.
 // //
   // Return: CIMValue. If the string input is zero length creates a CIMValue
   //         with value defined by the type.  Else the value is inserted.
   //
   //         Note that this does not set the CIMValue Null if the string is empty.
   //
 //------------------------------------------------------------------------------ //------------------------------------------------------------------------------
  
 CIMValue XmlReader::stringToValue( CIMValue XmlReader::stringToValue(
Line 777 
Line 782 
 { {
     // ATTN-B: accepting only UTF-8 for now! (affects string and char16):     // ATTN-B: accepting only UTF-8 for now! (affects string and char16):
  
       // If strlen == 0, set to default value for type
   
     if (strlen(valueString)==0)     if (strlen(valueString)==0)
     {     {
         // This needs to reflect the Null result. KSTESTNULL  
         // ATTN: review the other code for this characteristic  
         // In all cases, XML with an empty entry is NULL <VALUE></VALUE>  
         return CIMValue(type, false);  
         /* KS 27 Feb 2002 Droped this code in favor of inserting the Null version  
         switch (type)         switch (type)
         {         {
             case CIMType::BOOLEAN: return CIMValue(false);             case CIMType::BOOLEAN: return CIMValue(false);
Line 800 
Line 802 
             case CIMType::REAL32: return CIMValue(Real32(0));             case CIMType::REAL32: return CIMValue(Real32(0));
             case CIMType::REAL64: return CIMValue(Real64(0));             case CIMType::REAL64: return CIMValue(Real64(0));
         }         }
         */  
     }     }
  
       // Create value per type
     switch (type)     switch (type)
     {     {
         case CIMType::BOOLEAN:         case CIMType::BOOLEAN:
Line 925 
Line 927 
 // //
 //     <!ELEMENT VALUE (#PCDATA)> //     <!ELEMENT VALUE (#PCDATA)>
 // //
   // Return: false if no value element.
   //
 //------------------------------------------------------------------------------ //------------------------------------------------------------------------------
  
 Boolean XmlReader::getValueElement( Boolean XmlReader::getValueElement(
Line 932 
Line 936 
     CIMType type,     CIMType type,
     CIMValue& value)     CIMValue& value)
 { {
     // Get VALUE start tag:      // Get VALUE start tag: Return false if no VALUE start Tag
  
     XmlEntry entry;     XmlEntry entry;
     if (!testStartTagOrEmptyTag(parser, entry, "VALUE"))     if (!testStartTagOrEmptyTag(parser, entry, "VALUE"))
Line 1140 
Line 1144 
 // //
 //     <!ELEMENT VALUE.ARRAY (VALUE*)> //     <!ELEMENT VALUE.ARRAY (VALUE*)>
 // //
   //  Return: Boolean. Returns false if there is no VALUE.ARRAY start element
   //
 //------------------------------------------------------------------------------ //------------------------------------------------------------------------------
  
 Boolean XmlReader::getValueArrayElement( Boolean XmlReader::getValueArrayElement(
Line 1147 
Line 1153 
     CIMType type,     CIMType type,
     CIMValue& value)     CIMValue& value)
 { {
       // Clears any values from the Array. Assumes this is array CIMValue
     value.clear();     value.clear();
  
     // Get VALUE.ARRAY open tag:     // Get VALUE.ARRAY open tag:
Line 1154 
Line 1161 
     XmlEntry entry;     XmlEntry entry;
     Array<const char*> stringArray;     Array<const char*> stringArray;
  
       // If no VALUE.ARRAY start tag, return false
     if (!testStartTagOrEmptyTag(parser, entry, "VALUE.ARRAY"))     if (!testStartTagOrEmptyTag(parser, entry, "VALUE.ARRAY"))
         return false;         return false;
  
     //ATTN: P1 KS KSTESTNULL - Need to relook at this one.     //ATTN: P1 KS KSTESTNULL - Need to relook at this one.
     //if (entry.type == XmlEntry::EMPTY_TAG)      if (entry.type == XmlEntry::EMPTY_TAG)
     //    return true;          return true;
  
     if (entry.type != XmlEntry::EMPTY_TAG)     if (entry.type != XmlEntry::EMPTY_TAG)
     {     {
Line 1225 
Line 1233 
     Boolean translatable = getCimBooleanAttribute(     Boolean translatable = getCimBooleanAttribute(
         lineNumber, entry, tagName, "TRANSLATABLE", false, false);         lineNumber, entry, tagName, "TRANSLATABLE", false, false);
  
     Uint32 flavor = 0;      // ATTN: KS P1 5 Mar 2002 Should this not be CIMFlavor::DEFAULTS??
       Uint32 flavor = CIMFlavor::DEFAULTS;
  
     if (overridable)     if (overridable)
         flavor |= CIMFlavor::OVERRIDABLE;         flavor |= CIMFlavor::OVERRIDABLE;
Line 1350 
Line 1359 
  
     // Get VALUE or VALUE.ARRAY element:     // Get VALUE or VALUE.ARRAY element:
  
       // ATTN: KS P1 4 March 2002 - Requires either value or array element or
       // generates exception.  Correct for spec but means no NULL values on qualifier
       // values. Alternative is to set NULL value and continue
   
     CIMValue value;     CIMValue value;
  
     if (!getValueElement(parser, type, value) &&     if (!getValueElement(parser, type, value) &&
Line 1433 
Line 1446 
  
     CIMType type = getCimTypeAttribute(parser.getLine(), entry, "PROPERTY");     CIMType type = getCimTypeAttribute(parser.getLine(), entry, "PROPERTY");
  
     // Create property:      // Create property: Sets type and !isarray
       // ATTN: KS P1 change to use the correct constructor
  
     CIMValue value;     CIMValue value;
     value.setNullValue(type, false);     value.setNullValue(type, false);
Line 1446 
Line 1460 
  
         getQualifierElements(parser, property);         getQualifierElements(parser, property);
  
         // Get value:          // Get value:  Insert value if getValueElement exists (returns True)
  
         if (getValueElement(parser, type, value))         if (getValueElement(parser, type, value))
             property.setValue(value);             property.setValue(value);
Line 1545 
Line 1559 
  
     // Create property:     // Create property:
  
       // ATTN: KS P1 4 March 2002 Change to use correct constructor.
       // ATTN: KS P3 4 March 2002.  Why create extra value. Use same one.
   
     CIMValue nullValue;     CIMValue nullValue;
     nullValue.setNullValue(type, true, arraySize);     nullValue.setNullValue(type, true, arraySize);
     property = CIMProperty(     property = CIMProperty(
Line 1558 
Line 1575 
  
         // Get value:         // Get value:
  
           // ATTN: KS P1 4 March 2002. Does not set array type into value.
           // ATTN: Thus, if it returns false, the CIMValue is nothing.
         CIMValue value;         CIMValue value;
  
         if (getValueArrayElement(parser, type, value))         if (getValueArrayElement(parser, type, value))


Legend:
Removed from v.1.34  
changed lines
  Added in v.1.35

No CVS admin address has been configured
Powered by
ViewCVS 0.9.2