(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.54 and 1.70

version 1.54, 2002/05/15 23:14:21 version 1.70, 2002/08/25 06:43:56
Line 1 
Line 1 
 //%///////////////////////////////////////////////////////////////////////////// //%/////////////////////////////////////////////////////////////////////////////
 // //
 // Copyright (c) 2000, 2001 BMC Software, Hewlett-Packard Company, IBM,  // Copyright (c) 2000, 2001, 2002 BMC Software, Hewlett-Packard Company, IBM,
 // The Open Group, Tivoli Systems // The Open Group, Tivoli Systems
 // //
 // Permission is hereby granted, free of charge, to any person obtaining a copy // Permission is hereby granted, free of charge, to any person obtaining a copy
Line 30 
Line 30 
 // //
 //%///////////////////////////////////////////////////////////////////////////// //%/////////////////////////////////////////////////////////////////////////////
 #include <Pegasus/Common/Config.h> #include <Pegasus/Common/Config.h>
 #include <cassert>  
 #include <cctype> #include <cctype>
 #include <cstdio> #include <cstdio>
 #include <cstdlib> #include <cstdlib>
Line 45 
Line 44 
 #include "CIMClass.h" #include "CIMClass.h"
 #include "CIMInstance.h" #include "CIMInstance.h"
 #include "CIMObject.h" #include "CIMObject.h"
 #include "CIMNamedInstance.h"  
 #include "CIMParamValue.h" #include "CIMParamValue.h"
  
   //#define PEGASUS_SINT64_MIN (-PEGASUS_SINT64_LITERAL(9223372036854775808))
   //#define PEGASUS_UINT64_MAX PEGASUS_UINT64_LITERAL(18446744073709551615)
   #define PEGASUS_SINT64_MIN (-PEGASUS_SINT64_LITERAL((Sint64) 0x8000000000000000))
   #define PEGASUS_UINT64_MAX PEGASUS_UINT64_LITERAL((Uint64) 0xFFFFFFFFFFFFFFFF)
   
 PEGASUS_USING_STD; PEGASUS_USING_STD;
 PEGASUS_NAMESPACE_BEGIN PEGASUS_NAMESPACE_BEGIN
  
Line 385 
Line 388 
 // //
 //------------------------------------------------------------------------------ //------------------------------------------------------------------------------
  
 String XmlReader::getClassOriginAttribute(  CIMName XmlReader::getClassOriginAttribute(
     Uint32 lineNumber,     Uint32 lineNumber,
     const XmlEntry& entry,     const XmlEntry& entry,
     const char* tagName)     const char* tagName)
Line 393 
Line 396 
     String name;     String name;
  
     if (!entry.getAttributeValue("CLASSORIGIN", name))     if (!entry.getAttributeValue("CLASSORIGIN", name))
         return String();          return CIMName();
  
     if (!CIMName::legal(name))     if (!CIMName::legal(name))
     {     {
Line 414 
Line 417 
 // //
 //------------------------------------------------------------------------------ //------------------------------------------------------------------------------
  
 String XmlReader::getReferenceClassAttribute(  CIMName XmlReader::getReferenceClassAttribute(
     Uint32 lineNumber,     Uint32 lineNumber,
     const XmlEntry& entry,     const XmlEntry& entry,
     const char* elementName)     const char* elementName)
Line 422 
Line 425 
     String name;     String name;
  
     if (!entry.getAttributeValue("REFERENCECLASS", name))     if (!entry.getAttributeValue("REFERENCECLASS", name))
         return String();          return CIMName();
  
     if (!CIMName::legal(name))     if (!CIMName::legal(name))
     {     {
Line 443 
Line 446 
 // //
 //------------------------------------------------------------------------------ //------------------------------------------------------------------------------
  
 String XmlReader::getSuperClassAttribute(  CIMName XmlReader::getSuperClassAttribute(
     Uint32 lineNumber,     Uint32 lineNumber,
     const XmlEntry& entry,     const XmlEntry& entry,
     const char* tagName)     const char* tagName)
Line 451 
Line 454 
     String superClass;     String superClass;
  
     if (!entry.getAttributeValue("SUPERCLASS", superClass))     if (!entry.getAttributeValue("SUPERCLASS", superClass))
         return String();          return CIMName();
  
     if (!CIMName::legal(superClass))     if (!CIMName::legal(superClass))
     {     {
Line 482 
Line 485 
 // //
 //------------------------------------------------------------------------------ //------------------------------------------------------------------------------
  
 CIMType XmlReader::getCimTypeAttribute(  Boolean XmlReader::getCimTypeAttribute(
     Uint32 lineNumber,     Uint32 lineNumber,
     const XmlEntry& entry,     const XmlEntry& entry,
       CIMType& cimType,  // Output parameter
     const char* tagName,     const char* tagName,
     const char* attributeName,     const char* attributeName,
     Boolean required)     Boolean required)
Line 501 
Line 505 
         }         }
         else         else
         {         {
             return CIMType::NONE;              return false;
         }         }
     }     }
  
     CIMType type = CIMType::NONE;      CIMType type = CIMTYPE_BOOLEAN;
       Boolean unrecognizedType = false;
  
     if (strcmp(typeName, "boolean") == 0)     if (strcmp(typeName, "boolean") == 0)
         type = CIMType::BOOLEAN;          type = CIMTYPE_BOOLEAN;
     else if (strcmp(typeName, "string") == 0)     else if (strcmp(typeName, "string") == 0)
         type = CIMType::STRING;          type = CIMTYPE_STRING;
     else if (strcmp(typeName, "char16") == 0)     else if (strcmp(typeName, "char16") == 0)
         type = CIMType::CHAR16;          type = CIMTYPE_CHAR16;
     else if (strcmp(typeName, "uint8") == 0)     else if (strcmp(typeName, "uint8") == 0)
         type = CIMType::UINT8;          type = CIMTYPE_UINT8;
     else if (strcmp(typeName, "sint8") == 0)     else if (strcmp(typeName, "sint8") == 0)
         type = CIMType::SINT8;          type = CIMTYPE_SINT8;
     else if (strcmp(typeName, "uint16") == 0)     else if (strcmp(typeName, "uint16") == 0)
         type = CIMType::UINT16;          type = CIMTYPE_UINT16;
     else if (strcmp(typeName, "sint16") == 0)     else if (strcmp(typeName, "sint16") == 0)
         type = CIMType::SINT16;          type = CIMTYPE_SINT16;
     else if (strcmp(typeName, "uint32") == 0)     else if (strcmp(typeName, "uint32") == 0)
         type = CIMType::UINT32;          type = CIMTYPE_UINT32;
     else if (strcmp(typeName, "sint32") == 0)     else if (strcmp(typeName, "sint32") == 0)
         type = CIMType::SINT32;          type = CIMTYPE_SINT32;
     else if (strcmp(typeName, "uint64") == 0)     else if (strcmp(typeName, "uint64") == 0)
         type = CIMType::UINT64;          type = CIMTYPE_UINT64;
     else if (strcmp(typeName, "sint64") == 0)     else if (strcmp(typeName, "sint64") == 0)
         type = CIMType::SINT64;          type = CIMTYPE_SINT64;
     else if (strcmp(typeName, "datetime") == 0)     else if (strcmp(typeName, "datetime") == 0)
         type = CIMType::DATETIME;          type = CIMTYPE_DATETIME;
     else if (strcmp(typeName, "real32") == 0)     else if (strcmp(typeName, "real32") == 0)
         type = CIMType::REAL32;          type = CIMTYPE_REAL32;
     else if (strcmp(typeName, "real64") == 0)     else if (strcmp(typeName, "real64") == 0)
         type = CIMType::REAL64;          type = CIMTYPE_REAL64;
     else if (strcmp(typeName, "reference") == 0)     else if (strcmp(typeName, "reference") == 0)
         type = CIMType::REFERENCE;          type = CIMTYPE_REFERENCE;
       else unrecognizedType = true;
  
     if ((type == CIMType::NONE) ||      if (unrecognizedType ||
         ((type == CIMType::REFERENCE) &&          ((type == CIMTYPE_REFERENCE) &&
          (strcmp(attributeName, "PARAMTYPE") != 0)))          (strcmp(attributeName, "PARAMTYPE") != 0)))
     {     {
         char message[MESSAGE_SIZE];         char message[MESSAGE_SIZE];
Line 548 
Line 554 
         throw XmlSemanticError(lineNumber, message);         throw XmlSemanticError(lineNumber, message);
     }     }
  
     return type;      cimType = type;
       return true;
 } }
  
 //------------------------------------------------------------------------------ //------------------------------------------------------------------------------
Line 585 
Line 592 
         return false;         return false;
  
     char buffer[62];     char buffer[62];
     sprintf(buffer, "Bad %s.%s attribute value", attributeName, tagName);      sprintf(buffer, "Invalid %s.%s attribute value", attributeName, tagName);
     throw XmlSemanticError(lineNumber, buffer);     throw XmlSemanticError(lineNumber, buffer);
     return false;     return false;
 } }
Line 735 
Line 742 
             while (isxdigit(*p))             while (isxdigit(*p))
             {             {
                 // Make sure we won't overflow when we multiply by 16                 // Make sure we won't overflow when we multiply by 16
                 if (x < PEGASUS_LLONG_MIN/16)                  if (x < PEGASUS_SINT64_MIN/16)
                 {                 {
                     return false;                     return false;
                 }                 }
Line 743 
Line 750 
  
                 // Make sure we don't overflow when we add the next digit                 // Make sure we don't overflow when we add the next digit
                 Sint64 newDigit = Sint64(_hexCharToNumeric(*p++));                 Sint64 newDigit = Sint64(_hexCharToNumeric(*p++));
                 if (PEGASUS_LLONG_MIN - x > -newDigit)                  if (PEGASUS_SINT64_MIN - x > -newDigit)
                 {                 {
                     return false;                     return false;
                 }                 }
Line 758 
Line 765 
             // overflow error             // overflow error
             if (!negative)             if (!negative)
             {             {
                 if (x == PEGASUS_LLONG_MIN)                  if (x == PEGASUS_SINT64_MIN)
                 {                 {
                     return false;                     return false;
                 }                 }
Line 786 
Line 793 
     while (isdigit(*p))     while (isdigit(*p))
     {     {
         // Make sure we won't overflow when we multiply by 10         // Make sure we won't overflow when we multiply by 10
         if (x < PEGASUS_LLONG_MIN/10)          if (x < PEGASUS_SINT64_MIN/10)
         {         {
             return false;             return false;
         }         }
Line 794 
Line 801 
  
         // Make sure we won't overflow when we add the next digit         // Make sure we won't overflow when we add the next digit
         Sint64 newDigit = (*p++ - '0');         Sint64 newDigit = (*p++ - '0');
         if (PEGASUS_LLONG_MIN - x > -newDigit)          if (PEGASUS_SINT64_MIN - x > -newDigit)
         {         {
             return false;             return false;
         }         }
Line 809 
Line 816 
     // overflow error     // overflow error
     if (!negative)     if (!negative)
     {     {
         if (x == PEGASUS_LLONG_MIN)          if (x == PEGASUS_SINT64_MIN)
         {         {
             return false;             return false;
         }         }
Line 855 
Line 862 
             while (isxdigit(*p))             while (isxdigit(*p))
             {             {
                 // Make sure we won't overflow when we multiply by 16                 // Make sure we won't overflow when we multiply by 16
                 if (x > PEGASUS_ULLONG_MAX/16)                  if (x > PEGASUS_UINT64_MAX/16)
                 {                 {
                     return false;                     return false;
                 }                 }
Line 863 
Line 870 
  
                 // We can't overflow when we add the next digit                 // We can't overflow when we add the next digit
                 Uint64 newDigit = Uint64(_hexCharToNumeric(*p++));                 Uint64 newDigit = Uint64(_hexCharToNumeric(*p++));
                 if (PEGASUS_ULLONG_MAX - x < newDigit)                  if (PEGASUS_UINT64_MAX - x < newDigit)
                 {                 {
                     return false;                     return false;
                 }                 }
Line 889 
Line 896 
     while (isdigit(*p))     while (isdigit(*p))
     {     {
         // Make sure we won't overflow when we multiply by 10         // Make sure we won't overflow when we multiply by 10
         if (x > PEGASUS_ULLONG_MAX/10)          if (x > PEGASUS_UINT64_MAX/10)
         {         {
             return false;             return false;
         }         }
Line 897 
Line 904 
  
         // Make sure we won't overflow when we add the next digit         // Make sure we won't overflow when we add the next digit
         Uint64 newDigit = (*p++ - '0');         Uint64 newDigit = (*p++ - '0');
         if (PEGASUS_ULLONG_MAX - x < newDigit)          if (PEGASUS_UINT64_MAX - x < newDigit)
         {         {
             return false;             return false;
         }         }
Line 932 
Line 939 
     // Create value per type     // Create value per type
     switch (type)     switch (type)
     {     {
         case CIMType::BOOLEAN:          case CIMTYPE_BOOLEAN:
         {         {
             if (CompareNoCase(valueString, "TRUE") == 0)             if (CompareNoCase(valueString, "TRUE") == 0)
                 return CIMValue(true);                 return CIMValue(true);
Line 940 
Line 947 
                 return CIMValue(false);                 return CIMValue(false);
             else             else
                 throw XmlSemanticError(                 throw XmlSemanticError(
                     lineNumber, "Bad boolean value");                      lineNumber, "Invalid boolean value");
         }         }
  
         case CIMType::STRING:          case CIMTYPE_STRING:
         {         {
             return CIMValue(valueString);              return CIMValue(String(valueString));
         }         }
  
         case CIMType::CHAR16:          case CIMTYPE_CHAR16:
         {         {
             if (strlen(valueString) != 1)             if (strlen(valueString) != 1)
                 throw XmlSemanticError(lineNumber, "Bad char16 value");                  throw XmlSemanticError(lineNumber, "Invalid char16 value");
  
             return CIMValue(Char16(valueString[0]));             return CIMValue(Char16(valueString[0]));
         }         }
  
         case CIMType::UINT8:          case CIMTYPE_UINT8:
         case CIMType::UINT16:          case CIMTYPE_UINT16:
         case CIMType::UINT32:          case CIMTYPE_UINT32:
         case CIMType::UINT64:          case CIMTYPE_UINT64:
         {         {
             Uint64 x;             Uint64 x;
  
             if (!stringToUnsignedInteger(valueString, x))             if (!stringToUnsignedInteger(valueString, x))
             {             {
                 throw XmlSemanticError(                 throw XmlSemanticError(
                     lineNumber, "Bad unsigned integer value");                      lineNumber, "Invalid unsigned integer value");
             }             }
  
             switch (type)             switch (type)
             {             {
                 case CIMType::UINT8:                  case CIMTYPE_UINT8:
                 {                 {
                     if (x >= (Uint64(1)<<8))                     if (x >= (Uint64(1)<<8))
                     {                     {
Line 980 
Line 987 
                     }                     }
                     return CIMValue(Uint8(x));                     return CIMValue(Uint8(x));
                 }                 }
                 case CIMType::UINT16:                  case CIMTYPE_UINT16:
                 {                 {
                     if (x >= (Uint64(1)<<16))                     if (x >= (Uint64(1)<<16))
                     {                     {
Line 989 
Line 996 
                     }                     }
                     return CIMValue(Uint16(x));                     return CIMValue(Uint16(x));
                 }                 }
                 case CIMType::UINT32:                  case CIMTYPE_UINT32:
                 {                 {
                     if (x >= (Uint64(1)<<32))                     if (x >= (Uint64(1)<<32))
                     {                     {
Line 998 
Line 1005 
                     }                     }
                     return CIMValue(Uint32(x));                     return CIMValue(Uint32(x));
                 }                 }
                 case CIMType::UINT64: return CIMValue(Uint64(x));                  case CIMTYPE_UINT64: return CIMValue(Uint64(x));
                 default: break;                 default: break;
             }             }
         }         }
  
         case CIMType::SINT8:          case CIMTYPE_SINT8:
         case CIMType::SINT16:          case CIMTYPE_SINT16:
         case CIMType::SINT32:          case CIMTYPE_SINT32:
         case CIMType::SINT64:          case CIMTYPE_SINT64:
         {         {
             Sint64 x;             Sint64 x;
  
             if (!stringToSignedInteger(valueString, x))             if (!stringToSignedInteger(valueString, x))
             {             {
                 throw XmlSemanticError(                 throw XmlSemanticError(
                     lineNumber, "Bad signed integer value");                      lineNumber, "Invalid signed integer value");
             }             }
  
             switch (type)             switch (type)
             {             {
                 case CIMType::SINT8:                  case CIMTYPE_SINT8:
                 {                 {
                     if(  (x >= (Sint64(1)<<7)) || (x < (-(Sint64(1)<<7))) )                     if(  (x >= (Sint64(1)<<7)) || (x < (-(Sint64(1)<<7))) )
                     {                     {
Line 1027 
Line 1034 
                     }                     }
                     return CIMValue(Sint8(x));                     return CIMValue(Sint8(x));
                 }                 }
                 case CIMType::SINT16:                  case CIMTYPE_SINT16:
                 {                 {
                     if(  (x >= (Sint64(1)<<15)) || (x < (-(Sint64(1)<<15))) )                     if(  (x >= (Sint64(1)<<15)) || (x < (-(Sint64(1)<<15))) )
                     {                     {
Line 1036 
Line 1043 
                     }                     }
                     return CIMValue(Sint16(x));                     return CIMValue(Sint16(x));
                 }                 }
                 case CIMType::SINT32:                  case CIMTYPE_SINT32:
                 {                 {
                     if(  (x >= (Sint64(1)<<31)) || (x < (-(Sint64(1)<<31))) )                     if(  (x >= (Sint64(1)<<31)) || (x < (-(Sint64(1)<<31))) )
                     {                     {
Line 1045 
Line 1052 
                     }                     }
                     return CIMValue(Sint32(x));                     return CIMValue(Sint32(x));
                 }                 }
                 case CIMType::SINT64: return CIMValue(Sint64(x));                  case CIMTYPE_SINT64: return CIMValue(Sint64(x));
                 default: break;                 default: break;
             }             }
         }         }
  
         case CIMType::DATETIME:          case CIMTYPE_DATETIME:
         {         {
             CIMDateTime tmp;             CIMDateTime tmp;
  
Line 1058 
Line 1065 
             {             {
                 tmp.set(valueString);                 tmp.set(valueString);
             }             }
             catch (BadDateTimeFormat&)              catch (InvalidDateTimeFormatException&)
             {             {
                 throw XmlSemanticError(lineNumber, "Bad datetime value");                  throw XmlSemanticError(lineNumber, "Invalid datetime value");
             }             }
  
             return CIMValue(tmp);             return CIMValue(tmp);
         }         }
  
         case CIMType::REAL32:          case CIMTYPE_REAL32:
         {         {
             Real64 x;             Real64 x;
  
             if (!stringToReal(valueString, x))             if (!stringToReal(valueString, x))
                 throw XmlSemanticError(lineNumber, "Bad real number value");                  throw XmlSemanticError(lineNumber, "Invalid real number value");
  
             return CIMValue(Real32(x));             return CIMValue(Real32(x));
         }         }
  
         case CIMType::REAL64:          case CIMTYPE_REAL64:
         {         {
             Real64 x;             Real64 x;
  
             if (!stringToReal(valueString, x))             if (!stringToReal(valueString, x))
                 throw XmlSemanticError(lineNumber, "Bad real number value");                  throw XmlSemanticError(lineNumber, "Invalid real number value");
  
             return CIMValue(x);             return CIMValue(x);
         }         }
Line 1195 
Line 1202 
     CIMValue& cimValue)     CIMValue& cimValue)
 { {
     // Can not test for value type, so assume String     // Can not test for value type, so assume String
     const CIMType type = CIMType::STRING;      const CIMType type = CIMTYPE_STRING;
  
     // Test for VALUE element     // Test for VALUE element
     if (XmlReader::getValueElement(parser, type, cimValue))     if (XmlReader::getValueElement(parser, type, cimValue))
Line 1261 
Line 1268 
 { {
     switch (type)     switch (type)
     {     {
         case CIMType::BOOLEAN:          case CIMTYPE_BOOLEAN:
             return StringArrayToValueAux(lineNumber, array, type, (Boolean*)0);             return StringArrayToValueAux(lineNumber, array, type, (Boolean*)0);
  
         case CIMType::STRING:          case CIMTYPE_STRING:
             return StringArrayToValueAux(lineNumber, array, type, (String*)0);             return StringArrayToValueAux(lineNumber, array, type, (String*)0);
  
         case CIMType::CHAR16:          case CIMTYPE_CHAR16:
             return StringArrayToValueAux(lineNumber, array, type, (Char16*)0);             return StringArrayToValueAux(lineNumber, array, type, (Char16*)0);
  
         case CIMType::UINT8:          case CIMTYPE_UINT8:
             return StringArrayToValueAux(lineNumber, array, type, (Uint8*)0);             return StringArrayToValueAux(lineNumber, array, type, (Uint8*)0);
  
         case CIMType::UINT16:          case CIMTYPE_UINT16:
             return StringArrayToValueAux(lineNumber, array, type, (Uint16*)0);             return StringArrayToValueAux(lineNumber, array, type, (Uint16*)0);
  
         case CIMType::UINT32:          case CIMTYPE_UINT32:
             return StringArrayToValueAux(lineNumber, array, type, (Uint32*)0);             return StringArrayToValueAux(lineNumber, array, type, (Uint32*)0);
  
         case CIMType::UINT64:          case CIMTYPE_UINT64:
             return StringArrayToValueAux(lineNumber, array, type, (Uint64*)0);             return StringArrayToValueAux(lineNumber, array, type, (Uint64*)0);
  
         case CIMType::SINT8:          case CIMTYPE_SINT8:
             return StringArrayToValueAux(lineNumber, array, type, (Sint8*)0);             return StringArrayToValueAux(lineNumber, array, type, (Sint8*)0);
  
         case CIMType::SINT16:          case CIMTYPE_SINT16:
             return StringArrayToValueAux(lineNumber, array, type, (Sint16*)0);             return StringArrayToValueAux(lineNumber, array, type, (Sint16*)0);
  
         case CIMType::SINT32:          case CIMTYPE_SINT32:
             return StringArrayToValueAux(lineNumber, array, type, (Sint32*)0);             return StringArrayToValueAux(lineNumber, array, type, (Sint32*)0);
  
         case CIMType::SINT64:          case CIMTYPE_SINT64:
             return StringArrayToValueAux(lineNumber, array, type, (Sint64*)0);             return StringArrayToValueAux(lineNumber, array, type, (Sint64*)0);
  
         case CIMType::DATETIME:          case CIMTYPE_DATETIME:
             return StringArrayToValueAux(lineNumber, array, type, (CIMDateTime*)0);             return StringArrayToValueAux(lineNumber, array, type, (CIMDateTime*)0);
  
         case CIMType::REAL32:          case CIMTYPE_REAL32:
             return StringArrayToValueAux(lineNumber, array, type, (Real32*)0);             return StringArrayToValueAux(lineNumber, array, type, (Real32*)0);
  
         case CIMType::REAL64:          case CIMTYPE_REAL64:
             return StringArrayToValueAux(lineNumber, array, type, (Real64*)0);             return StringArrayToValueAux(lineNumber, array, type, (Real64*)0);
  
         default:         default:
Line 1377 
Line 1384 
 // //
 //------------------------------------------------------------------------------ //------------------------------------------------------------------------------
  
 Uint32 XmlReader::getFlavor(  CIMFlavor XmlReader::getFlavor(
     XmlEntry& entry,     XmlEntry& entry,
     Uint32 lineNumber,     Uint32 lineNumber,
     const char* tagName)     const char* tagName)
Line 1404 
Line 1411 
  
     // Start with CIMFlavor::NONE.  Defaults are specified in the     // Start with CIMFlavor::NONE.  Defaults are specified in the
     // getCimBooleanAttribute() calls above.     // getCimBooleanAttribute() calls above.
     Uint32 flavor = CIMFlavor::NONE;      CIMFlavor flavor = CIMFlavor (CIMFlavor::NONE);
  
     if (overridable)     if (overridable)
         flavor |= CIMFlavor::OVERRIDABLE;          flavor.addFlavor (CIMFlavor::OVERRIDABLE);
         else         else
                 flavor |= CIMFlavor::DISABLEOVERRIDE;          flavor.addFlavor (CIMFlavor::DISABLEOVERRIDE);
  
     if (toSubClass)     if (toSubClass)
         flavor |= CIMFlavor::TOSUBCLASS;          flavor.addFlavor (CIMFlavor::TOSUBCLASS);
         else         else
                 flavor |= CIMFlavor::RESTRICTED;          flavor.addFlavor (CIMFlavor::RESTRICTED);
  
     if (toInstance)     if (toInstance)
         flavor |= CIMFlavor::TOINSTANCE;          flavor.addFlavor (CIMFlavor::TOINSTANCE);
  
     if (translatable)     if (translatable)
         flavor |= CIMFlavor::TRANSLATABLE;          flavor.addFlavor (CIMFlavor::TRANSLATABLE);
  
     return flavor;     return flavor;
 } }
Line 1442 
Line 1449 
 // //
 //------------------------------------------------------------------------------ //------------------------------------------------------------------------------
  
 Uint32 XmlReader::getOptionalScope(XmlParser& parser)  CIMScope XmlReader::getOptionalScope(XmlParser& parser)
 { {
     XmlEntry entry;     XmlEntry entry;
       CIMScope scope;
  
     if (!parser.next(entry))     if (!parser.next(entry))
         return false;          return scope;    // No SCOPE element found; return the empty scope
  
     Boolean isEmptyTag = entry.type == XmlEntry::EMPTY_TAG;     Boolean isEmptyTag = entry.type == XmlEntry::EMPTY_TAG;
  
Line 1455 
Line 1463 
         entry.type != XmlEntry::START_TAG) ||         entry.type != XmlEntry::START_TAG) ||
         strcmp(entry.text, "SCOPE") != 0)         strcmp(entry.text, "SCOPE") != 0)
     {     {
           // No SCOPE element found; return the empty scope
         parser.putBack(entry);         parser.putBack(entry);
         return 0;          return scope;
     }     }
  
     Uint32 line = parser.getLine();     Uint32 line = parser.getLine();
     Uint32 scope = 0;  
  
     if (getCimBooleanAttribute(line, entry, "SCOPE", "CLASS", false, false))     if (getCimBooleanAttribute(line, entry, "SCOPE", "CLASS", false, false))
         scope |= CIMScope::CLASS;          scope.addScope (CIMScope::CLASS);
  
     if (getCimBooleanAttribute(     if (getCimBooleanAttribute(
         line, entry, "SCOPE", "ASSOCIATION", false, false))         line, entry, "SCOPE", "ASSOCIATION", false, false))
         scope |= CIMScope::ASSOCIATION;          scope.addScope (CIMScope::ASSOCIATION);
  
     if (getCimBooleanAttribute(     if (getCimBooleanAttribute(
         line, entry, "SCOPE", "REFERENCE", false, false))         line, entry, "SCOPE", "REFERENCE", false, false))
         scope |= CIMScope::REFERENCE;          scope.addScope (CIMScope::REFERENCE);
  
     if (getCimBooleanAttribute(line, entry, "SCOPE", "PROPERTY", false, false))     if (getCimBooleanAttribute(line, entry, "SCOPE", "PROPERTY", false, false))
         scope |= CIMScope::PROPERTY;          scope.addScope (CIMScope::PROPERTY);
  
     if (getCimBooleanAttribute(line, entry, "SCOPE", "METHOD", false, false))     if (getCimBooleanAttribute(line, entry, "SCOPE", "METHOD", false, false))
         scope |= CIMScope::METHOD;          scope.addScope (CIMScope::METHOD);
  
     if (getCimBooleanAttribute(line, entry, "SCOPE", "PARAMETER", false, false))     if (getCimBooleanAttribute(line, entry, "SCOPE", "PARAMETER", false, false))
         scope |= CIMScope::PARAMETER;          scope.addScope (CIMScope::PARAMETER);
  
     if (getCimBooleanAttribute(line, entry, "SCOPE", "INDICATION",false, false))     if (getCimBooleanAttribute(line, entry, "SCOPE", "INDICATION",false, false))
         scope |= CIMScope::INDICATION;          scope.addScope (CIMScope::INDICATION);
  
     if (!isEmptyTag)     if (!isEmptyTag)
         expectEndTag(parser, "SCOPE");         expectEndTag(parser, "SCOPE");
Line 1520 
Line 1528 
  
     // Get QUALIFIER.TYPE attribute:     // Get QUALIFIER.TYPE attribute:
  
     CIMType type = getCimTypeAttribute(parser.getLine(), entry, "QUALIFIER");      CIMType type;
       getCimTypeAttribute(parser.getLine(), entry, type, "QUALIFIER");
  
     // Get QUALIFIER.PROPAGATED     // Get QUALIFIER.PROPAGATED
  
Line 1529 
Line 1538 
  
     // Get flavor oriented attributes:     // Get flavor oriented attributes:
  
     Uint32 flavor = getFlavor(entry, parser.getLine(), "QUALIFIER");      CIMFlavor flavor = getFlavor(entry, parser.getLine(), "QUALIFIER");
  
     // Get VALUE or VALUE.ARRAY element:     // Get VALUE or VALUE.ARRAY element:
  
Line 1568 
Line 1577 
         {         {
             container.addQualifier(qualifier);             container.addQualifier(qualifier);
         }         }
         catch (AlreadyExists&)          catch (AlreadyExistsException&)
         {         {
             throw XmlSemanticError(parser.getLine(), "duplicate qualifier");             throw XmlSemanticError(parser.getLine(), "duplicate qualifier");
         }         }
Line 1603 
Line 1612 
  
     // Get PROPERTY.CLASSORIGIN attribute:     // Get PROPERTY.CLASSORIGIN attribute:
  
     String classOrigin =      CIMName classOrigin =
         getClassOriginAttribute(parser.getLine(), entry, "PROPERTY");         getClassOriginAttribute(parser.getLine(), entry, "PROPERTY");
  
     // Get PROPERTY.PROPAGATED     // Get PROPERTY.PROPAGATED
Line 1613 
Line 1622 
  
     // Get PROPERTY.TYPE attribute:     // Get PROPERTY.TYPE attribute:
  
     CIMType type = getCimTypeAttribute(parser.getLine(), entry, "PROPERTY");      CIMType type;
       getCimTypeAttribute(parser.getLine(), entry, type, "PROPERTY");
  
     // Create property: Sets type and !isarray     // Create property: Sets type and !isarray
     // ATTN: KS P1 change to use the correct constructor  
  
     CIMValue value;      CIMValue value(type, false);
     value.setNullValue(type, false);      property = CIMProperty(name, value, 0, CIMName(), classOrigin, propagated);
     property = CIMProperty(  
         name, value, 0, String(), classOrigin, propagated);  
  
     if (!empty)     if (!empty)
     {     {
Line 1709 
Line 1716 
  
     // Get PROPERTY.TYPE attribute:     // Get PROPERTY.TYPE attribute:
  
     CIMType type = getCimTypeAttribute(parser.getLine(), entry, "PROPERTY.ARRAY");      CIMType type;
       getCimTypeAttribute(parser.getLine(), entry, type, "PROPERTY.ARRAY");
  
     // Get PROPERTY.ARRAYSIZE attribute:     // Get PROPERTY.ARRAYSIZE attribute:
  
Line 1718 
Line 1726 
  
     // Get PROPERTY.CLASSORIGIN attribute:     // Get PROPERTY.CLASSORIGIN attribute:
  
     String classOrigin      CIMName classOrigin
         = getClassOriginAttribute(parser.getLine(), entry, "PROPERTY.ARRAY");         = getClassOriginAttribute(parser.getLine(), entry, "PROPERTY.ARRAY");
  
     // Get PROPERTY.ARRAY.PROPAGATED     // Get PROPERTY.ARRAY.PROPAGATED
Line 1728 
Line 1736 
  
     // Create property:     // Create property:
  
     // ATTN: KS P1 4 March 2002 Change to use correct constructor.      CIMValue value(type, true, arraySize);
     // ATTN: KS P3 4 March 2002.  Why create extra value. Use same one.  
   
     CIMValue nullValue;  
     nullValue.setNullValue(type, true, arraySize);  
     property = CIMProperty(     property = CIMProperty(
         name, nullValue, arraySize, String(), classOrigin, propagated);          name, value, arraySize, CIMName(), classOrigin, propagated);
  
     if (!empty)     if (!empty)
     {     {
Line 1744 
Line 1748 
  
         // 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;  
   
         if (getValueArrayElement(parser, type, value))         if (getValueArrayElement(parser, type, value))
         {         {
             if (arraySize && arraySize != value.getArraySize())             if (arraySize && arraySize != value.getArraySize())
Line 2126 
Line 2126 
     if (!XmlReader::getInstanceNameElement(parser, className, keyBindings))     if (!XmlReader::getInstanceNameElement(parser, className, keyBindings))
         return false;         return false;
  
     instanceName.set(String(), String(), className, keyBindings);      instanceName.set(String(), CIMNamespaceName(), className, keyBindings);
     return true;     return true;
 } }
  
Line 2337 
Line 2337 
         parser.putBack(entry);         parser.putBack(entry);
         String className;         String className;
         getClassNameElement(parser, className);         getClassNameElement(parser, className);
         reference.set(String(), String(), className);          reference.set(String(), CIMNamespaceName(), className);
     }     }
     else if (strcmp(entry.text, "INSTANCEPATH") == 0)     else if (strcmp(entry.text, "INSTANCEPATH") == 0)
     {     {
Line 2355 
Line 2355 
         String className;         String className;
         Array<KeyBinding> keyBindings;         Array<KeyBinding> keyBindings;
         getInstanceNameElement(parser, className, keyBindings);         getInstanceNameElement(parser, className, keyBindings);
         reference.set(String(), String(), className, keyBindings);          reference.set(String(), CIMNamespaceName(), className, keyBindings);
     }     }
  
     expectEndTag(parser, "VALUE.REFERENCE");     expectEndTag(parser, "VALUE.REFERENCE");
Line 2432 
Line 2432 
  
     // Get PROPERTY.REFERENCECLASS attribute:     // Get PROPERTY.REFERENCECLASS attribute:
  
     String referenceClass = getReferenceClassAttribute(      CIMName referenceClass = getReferenceClassAttribute(
         parser.getLine(), entry, "PROPERTY.REFERENCE");         parser.getLine(), entry, "PROPERTY.REFERENCE");
  
     // Get PROPERTY.CLASSORIGIN attribute:     // Get PROPERTY.CLASSORIGIN attribute:
  
     String classOrigin =      CIMName classOrigin =
         getClassOriginAttribute(parser.getLine(), entry, "PROPERTY.REFERENCE");         getClassOriginAttribute(parser.getLine(), entry, "PROPERTY.REFERENCE");
  
     // Get PROPERTY.PROPAGATED     // Get PROPERTY.PROPAGATED
Line 2447 
Line 2447 
  
     // Create property:     // Create property:
  
     CIMValue value = CIMValue(CIMType::REFERENCE, false, 0);      CIMValue value = CIMValue(CIMTYPE_REFERENCE, false, 0);
 //    value.set(CIMObjectPath()); //    value.set(CIMObjectPath());
     property = CIMProperty(     property = CIMProperty(
         name, value, 0, referenceClass, classOrigin, propagated);         name, value, 0, referenceClass, classOrigin, propagated);
Line 2486 
Line 2486 
         {         {
             container.addProperty(property);             container.addProperty(property);
         }         }
         catch (AlreadyExists&)          catch (AlreadyExistsException&)
         {         {
             throw XmlSemanticError(parser.getLine(), "duplicate property");             throw XmlSemanticError(parser.getLine(), "duplicate property");
         }         }
Line 2521 
Line 2521 
  
     // Get PARAMETER.TYPE attribute:     // Get PARAMETER.TYPE attribute:
  
     CIMType type = getCimTypeAttribute(parser.getLine(), entry, "PARAMETER");      CIMType type;
       getCimTypeAttribute(parser.getLine(), entry, type, "PARAMETER");
  
     // Create parameter:     // Create parameter:
  
Line 2567 
Line 2568 
  
     // Get PARAMETER.ARRAY.TYPE attribute:     // Get PARAMETER.ARRAY.TYPE attribute:
  
     CIMType type = getCimTypeAttribute(parser.getLine(), entry, "PARAMETER.ARRAY");      CIMType type;
       getCimTypeAttribute(parser.getLine(), entry, type, "PARAMETER.ARRAY");
  
     // Get PARAMETER.ARRAYSIZE attribute:     // Get PARAMETER.ARRAYSIZE attribute:
  
Line 2617 
Line 2619 
  
     // Get PARAMETER.REFERENCECLASS attribute:     // Get PARAMETER.REFERENCECLASS attribute:
  
     String referenceClass = getReferenceClassAttribute(      CIMName referenceClass = getReferenceClassAttribute(
         parser.getLine(), entry, "PARAMETER.REFERENCE");         parser.getLine(), entry, "PARAMETER.REFERENCE");
  
     // Create parameter:     // Create parameter:
  
     parameter = CIMParameter(name, CIMType::REFERENCE, false, 0, referenceClass);      parameter = CIMParameter(name, CIMTYPE_REFERENCE, false, 0, referenceClass);
  
     if (!empty)     if (!empty)
     {     {
Line 2663 
Line 2665 
  
     // Get PARAMETER.REFERENCECLASS attribute:     // Get PARAMETER.REFERENCECLASS attribute:
  
     String referenceClass = getReferenceClassAttribute(      CIMName referenceClass = getReferenceClassAttribute(
         parser.getLine(), entry, "PARAMETER.REFARRAY");         parser.getLine(), entry, "PARAMETER.REFARRAY");
  
     // Get PARAMETER.ARRAYSIZE attribute:     // Get PARAMETER.ARRAYSIZE attribute:
Line 2674 
Line 2676 
  
     // Create parameter:     // Create parameter:
  
     parameter = CIMParameter(name, CIMType::REFERENCE, true, arraySize,      parameter = CIMParameter(name, CIMTYPE_REFERENCE, true, arraySize,
                              referenceClass);                              referenceClass);
  
     if (!empty)     if (!empty)
Line 2706 
Line 2708 
         {         {
             container.addParameter(parameter);             container.addParameter(parameter);
         }         }
         catch (AlreadyExists&)          catch (AlreadyExistsException&)
         {         {
             throw XmlSemanticError(parser.getLine(), "duplicate parameter");             throw XmlSemanticError(parser.getLine(), "duplicate parameter");
         }         }
Line 2745 
Line 2747 
  
     // Get TYPE attribute:     // Get TYPE attribute:
  
     CIMType type = getCimTypeAttribute(      CIMType type;
         parser.getLine(), entry, "QUALIFIER.DECLARATION");      getCimTypeAttribute(parser.getLine(), entry, type, "QUALIFIER.DECLARATION");
  
     // Get ISARRAY attribute:     // Get ISARRAY attribute:
  
Line 2762 
Line 2764 
  
     // Get flavor oriented attributes:     // Get flavor oriented attributes:
  
     Uint32 flavor = getFlavor(entry,parser.getLine(), "QUALIFIER.DECLARATION");      CIMFlavor flavor = getFlavor (entry, parser.getLine (),
           "QUALIFIER.DECLARATION");
  
     // No need to look for interior elements if empty tag:     // No need to look for interior elements if empty tag:
  
     Uint32 scope = CIMScope::NONE;      CIMScope scope = CIMScope ();
     CIMValue value;     CIMValue value;
       Boolean gotValue = false;
  
     if (!empty)     if (!empty)
     {     {
Line 2792 
Line 2796 
                     "VALUE.ARRAY size is not the same as "                     "VALUE.ARRAY size is not the same as "
                     "ARRAYSIZE attribute");                     "ARRAYSIZE attribute");
             }             }
   
               gotValue = true;
         }         }
         else if (getValueElement(parser, type, value))         else if (getValueElement(parser, type, value))
         {         {
Line 2800 
Line 2806 
                 throw XmlSemanticError(parser.getLine(),                 throw XmlSemanticError(parser.getLine(),
                     "ISARRAY attribute used but VALUE element encountered");                     "ISARRAY attribute used but VALUE element encountered");
             }             }
   
               gotValue = true;
         }         }
  
         // Now get the closing tag:         // Now get the closing tag:
Line 2807 
Line 2815 
         expectEndTag(parser, "QUALIFIER.DECLARATION");         expectEndTag(parser, "QUALIFIER.DECLARATION");
     }     }
  
     if (value.getType() == CIMType::NONE)      if (!gotValue)
     {     {
         if (isArray)         if (isArray)
             value.setNullValue(type, true, arraySize);             value.setNullValue(type, true, arraySize);
Line 2844 
Line 2852 
  
     String name = getCimNameAttribute(parser.getLine(), entry, "PROPERTY");     String name = getCimNameAttribute(parser.getLine(), entry, "PROPERTY");
  
     CIMType type = getCimTypeAttribute(parser.getLine(), entry, "PROPERTY");      CIMType type;
       getCimTypeAttribute(parser.getLine(), entry, type, "PROPERTY");
  
     String classOrigin =      CIMName classOrigin =
         getClassOriginAttribute(parser.getLine(), entry, "PROPERTY");         getClassOriginAttribute(parser.getLine(), entry, "PROPERTY");
  
     Boolean propagated = getCimBooleanAttribute(     Boolean propagated = getCimBooleanAttribute(
Line 2886 
Line 2895 
  
     String name = getCimNameAttribute(parser.getLine(), entry, "CLASS");     String name = getCimNameAttribute(parser.getLine(), entry, "CLASS");
  
     String superClass = getSuperClassAttribute(parser.getLine(), entry,"CLASS");      CIMName superClass = getSuperClassAttribute(parser.getLine(), entry,"CLASS");
  
     cimClass = CIMClass(name, superClass);     cimClass = CIMClass(name, superClass);
  
Line 2960 
Line 2969 
  
 Boolean XmlReader::getNamedInstanceElement( Boolean XmlReader::getNamedInstanceElement(
     XmlParser& parser,     XmlParser& parser,
     CIMNamedInstance& namedInstance)      CIMInstance& namedInstance)
 { {
     XmlEntry entry;     XmlEntry entry;
  
Line 2977 
Line 2986 
             "expected INSTANCENAME element");             "expected INSTANCENAME element");
     }     }
  
     CIMInstance instance;  
   
     // Get INSTANCE elements:     // Get INSTANCE elements:
  
     if (!getInstanceElement(parser, instance))      if (!getInstanceElement(parser, namedInstance))
     {     {
         throw XmlValidationError(parser.getLine(),         throw XmlValidationError(parser.getLine(),
             "expected INSTANCE element");             "expected INSTANCE element");
Line 2991 
Line 2998 
  
     expectEndTag(parser, "VALUE.NAMEDINSTANCE");     expectEndTag(parser, "VALUE.NAMEDINSTANCE");
  
     namedInstance.set(instanceName, instance);      namedInstance.setPath (instanceName);
  
     return true;     return true;
 } }
Line 3061 
Line 3068 
  
     if (!entry.getAttributeValue("ID", id))     if (!entry.getAttributeValue("ID", id))
         throw XmlValidationError(parser.getLine(),         throw XmlValidationError(parser.getLine(),
             "Bad or missing MESSAGE.ID attribute");              "Invalid or missing MESSAGE.ID attribute");
  
     // Get MESSAGE.PROTOCOLVERSION:     // Get MESSAGE.PROTOCOLVERSION:
  
     if (!entry.getAttributeValue("PROTOCOLVERSION", protocolVersion))     if (!entry.getAttributeValue("PROTOCOLVERSION", protocolVersion))
         throw XmlValidationError(parser.getLine(),         throw XmlValidationError(parser.getLine(),
             "Bad or missing MESSAGE.PROTOCOLVERSION attribute");              "Invalid or missing MESSAGE.PROTOCOLVERSION attribute");
  
     return true;     return true;
 } }
Line 3177 
Line 3184 
         result = false;         result = false;
     else     else
         throw XmlSemanticError(parser.getLine(),         throw XmlSemanticError(parser.getLine(),
             "Bad value for VALUE element: must be \"TRUE\" or \"FALSE\"");              "Invalid value for VALUE element: must be \"TRUE\" or \"FALSE\"");
  
     expectEndTag(parser, "VALUE");     expectEndTag(parser, "VALUE");
  
Line 3280 
Line 3287 
  
 Boolean XmlReader::getValueObjectWithPathElement( Boolean XmlReader::getValueObjectWithPathElement(
     XmlParser& parser,     XmlParser& parser,
     CIMObjectWithPath& objectWithPath)      CIMObject& objectWithPath)
 { {
     XmlEntry entry;     XmlEntry entry;
  
Line 3307 
Line 3314 
             throw XmlValidationError(parser.getLine(),             throw XmlValidationError(parser.getLine(),
                 "Expected INSTANCE element");                 "Expected INSTANCE element");
         }         }
         objectWithPath.set(reference, CIMObject(cimInstance));          objectWithPath = CIMObject (cimInstance);
           objectWithPath.setPath (reference);
     }     }
     else     else
     {     {
Line 3318 
Line 3326 
             throw XmlValidationError(parser.getLine(),             throw XmlValidationError(parser.getLine(),
                 "Expected CLASS element");                 "Expected CLASS element");
         }         }
         objectWithPath.set(reference, CIMObject(cimClass));          objectWithPath = CIMObject (cimClass);
           objectWithPath.setPath (reference);
     }     }
  
     expectEndTag(parser, "VALUE.OBJECTWITHPATH");     expectEndTag(parser, "VALUE.OBJECTWITHPATH");
Line 3336 
Line 3345 
  
 Boolean XmlReader::getValueObjectWithLocalPathElement( Boolean XmlReader::getValueObjectWithLocalPathElement(
     XmlParser& parser,     XmlParser& parser,
     CIMObjectWithPath& objectWithPath)      CIMObject& objectWithPath)
 { {
     XmlEntry entry;     XmlEntry entry;
  
Line 3363 
Line 3372 
             throw XmlValidationError(parser.getLine(),             throw XmlValidationError(parser.getLine(),
                 "Expected INSTANCE element");                 "Expected INSTANCE element");
         }         }
         objectWithPath.set(reference, CIMObject(cimInstance));          objectWithPath = CIMObject (cimInstance);
           objectWithPath.setPath (reference);
     }     }
     else     else
     {     {
Line 3374 
Line 3384 
             throw XmlValidationError(parser.getLine(),             throw XmlValidationError(parser.getLine(),
                 "Expected CLASS element");                 "Expected CLASS element");
         }         }
         objectWithPath.set(reference, CIMObject(cimClass));          objectWithPath = CIMObject (cimClass);
           objectWithPath.setPath (reference);
     }     }
  
     expectEndTag(parser, "VALUE.OBJECTWITHLOCALPATH");     expectEndTag(parser, "VALUE.OBJECTWITHLOCALPATH");
Line 3392 
Line 3403 
  
 void XmlReader::getObjectArray( void XmlReader::getObjectArray(
     XmlParser& parser,     XmlParser& parser,
     Array<CIMObjectWithPath>& objectArray)      Array<CIMObject>& objectArray)
 { {
     CIMObject object;     CIMObject object;
     CIMObjectWithPath objectWithPath;      CIMObject objectWithPath;
  
     objectArray.clear();     objectArray.clear();
  
     if (getValueObjectElement(parser, object))     if (getValueObjectElement(parser, object))
     {     {
         objectArray.append(CIMObjectWithPath(CIMObjectPath(), object));          objectArray.append(object);
         while (getValueObjectElement(parser, object))         while (getValueObjectElement(parser, object))
             objectArray.append(CIMObjectWithPath(CIMObjectPath(), object));              objectArray.append(object);
     }     }
     else if (getValueObjectWithPathElement(parser, objectWithPath))     else if (getValueObjectWithPathElement(parser, objectWithPath))
     {     {
Line 3433 
Line 3444 
  
     if (getClassNameElement(parser, className, false))     if (getClassNameElement(parser, className, false))
     {     {
         objectName.set(String(), String(), className);          objectName.set(String(), CIMNamespaceName(), className);
         return true;         return true;
     }     }
     else if (getInstanceNameElement(parser, objectName))     else if (getInstanceNameElement(parser, objectName))
Line 3610 
Line 3621 
  
     // Get PARAMVALUE.PARAMTYPE attribute:     // Get PARAMVALUE.PARAMTYPE attribute:
  
     type = getCimTypeAttribute(parser.getLine(), entry, "PARAMVALUE",      Boolean gotType = getCimTypeAttribute(parser.getLine(), entry, type,
                                "PARAMTYPE", false);                                            "PARAMVALUE", "PARAMTYPE", false);
  
     if (!empty)     if (!empty)
     {     {
         // Parse VALUE.REFERENCE and VALUE.REFARRAY type         // Parse VALUE.REFERENCE and VALUE.REFARRAY type
         if ( (type == CIMType::REFERENCE) || (type == CIMType::NONE) )          if ( (type == CIMTYPE_REFERENCE) || !gotType )
         {         {
             CIMObjectPath reference;             CIMObjectPath reference;
             if (XmlReader::getValueReferenceElement(parser, reference))             if (XmlReader::getValueReferenceElement(parser, reference))
             {             {
                 value.set(reference);                 value.set(reference);
                 type = CIMType::REFERENCE;                  type = CIMTYPE_REFERENCE;
                   gotType = true;
             }             }
             else if (XmlReader::getValueReferenceArrayElement(parser, value))             else if (XmlReader::getValueReferenceArrayElement(parser, value))
             {             {
                 type = CIMType::REFERENCE;                  type = CIMTYPE_REFERENCE;
                   gotType = true;
             }             }
             // If type==reference but no VALUE.REFERENCE found, use null value             // If type==reference but no VALUE.REFERENCE found, use null value
         }         }
  
         // Parse non-reference value         // Parse non-reference value
         if ( type != CIMType::REFERENCE )          if ( type != CIMTYPE_REFERENCE )
           {
               CIMType effectiveType;
               if (!gotType)
         {         {
             // If we don't know what type the value is, read it as a String             // If we don't know what type the value is, read it as a String
             CIMType effectiveType = type;                  effectiveType = CIMTYPE_STRING;
             if ( effectiveType == CIMType::NONE)              }
               else
             {             {
                 effectiveType = CIMType::STRING;                  effectiveType = type;
             }             }
  
             if ( !XmlReader::getValueArrayElement(parser, effectiveType, value) &&             if ( !XmlReader::getValueArrayElement(parser, effectiveType, value) &&
Line 3651 
Line 3668 
         expectEndTag(parser, "PARAMVALUE");         expectEndTag(parser, "PARAMVALUE");
     }     }
  
     paramValue = CIMParamValue(name, value, Boolean(type!=CIMType::NONE));      paramValue = CIMParamValue(name, value, gotType);
  
     return true;     return true;
 } }
Line 3680 
Line 3697 
     // Get RETURNVALUE.PARAMTYPE attribute:     // Get RETURNVALUE.PARAMTYPE attribute:
     // NOTE: Array type return values are not allowed (2/20/02)     // NOTE: Array type return values are not allowed (2/20/02)
  
     type = getCimTypeAttribute(parser.getLine(), entry, "RETURNVALUE",      Boolean gotType = getCimTypeAttribute(parser.getLine(), entry, type,
                                "PARAMTYPE", false);                                            "RETURNVALUE", "PARAMTYPE", false);
  
     // Parse VALUE.REFERENCE type     // Parse VALUE.REFERENCE type
     if ( (type == CIMType::REFERENCE) || (type == CIMType::NONE) )      if ( (type == CIMTYPE_REFERENCE) || !gotType )
     {     {
         CIMObjectPath reference;         CIMObjectPath reference;
         if (XmlReader::getValueReferenceElement(parser, reference))         if (XmlReader::getValueReferenceElement(parser, reference))
         {         {
             returnValue.set(reference);             returnValue.set(reference);
             type = CIMType::REFERENCE;              type = CIMTYPE_REFERENCE;
               gotType = true;
         }         }
         else if (type == CIMType::REFERENCE)          else if (type == CIMTYPE_REFERENCE)
         {         {
             throw XmlValidationError(parser.getLine(),             throw XmlValidationError(parser.getLine(),
                 "expected VALUE.REFERENCE element");                 "expected VALUE.REFERENCE element");
Line 3700 
Line 3718 
     }     }
  
     // Parse non-reference return value     // Parse non-reference return value
     if ( type != CIMType::REFERENCE )      if ( type != CIMTYPE_REFERENCE )
     {     {
         // If we don't know what type the value is, read it as a String          if (!gotType)
         if ( type == CIMType::NONE)  
         {         {
             type = CIMType::STRING;              // If we don't know what type the value is, read it as a String
               type = CIMTYPE_STRING;
         }         }
  
         if ( !XmlReader::getValueElement(parser, type, returnValue) )         if ( !XmlReader::getValueElement(parser, type, returnValue) )


Legend:
Removed from v.1.54  
changed lines
  Added in v.1.70

No CVS admin address has been configured
Powered by
ViewCVS 0.9.2