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

Diff for /pegasus/src/Pegasus/Compiler/valueFactory.cpp between version 1.44 and 1.45

version 1.44, 2008/12/02 09:01:21 version 1.45, 2012/12/05 21:10:53
Line 223 
Line 223 
 // ----------------------------------------------------------------- // -----------------------------------------------------------------
 CIMValue* valueFactory::_buildArrayValue( CIMValue* valueFactory::_buildArrayValue(
     CIMType type,     CIMType type,
     unsigned int arrayDimension,  
     const String& rep)     const String& rep)
 { {
     String sval;     String sval;
Line 231 
Line 230 
     Uint32 strsize = rep.size();     Uint32 strsize = rep.size();
     Uint32 end = strsize;     Uint32 end = strsize;
  
     /* KS Changed all of the following from whil {...} to do {...}  
      * while (start < end);  
      * The combination of the testing and nexcsv meant the last entry was not  
      * processed.  
      */  
     switch (type)     switch (type)
     {     {
         case CIMTYPE_BOOLEAN:         case CIMTYPE_BOOLEAN:
Line 451 
Line 445 
       const String *repp)       const String *repp)
 { {
   const String &rep = *repp;   const String &rep = *repp;
   //cout << "valueFactory, value = " << rep << endl;  
   CIMDateTime dt;   CIMDateTime dt;
   if (arrayDimension == -1) { // this is not an array type  
  
     CIMValue * rtn;
   
     // if arrayDimension == -1 this is not an array type
     if (arrayDimension == -1)
     {
     if (isNULL)     if (isNULL)
     {     {
        return new CIMValue(type, false);         rtn = new CIMValue(type, false);
     }     }
  
     switch(type) {      else
     case CIMTYPE_UINT8:  return new CIMValue((Uint8)  stringToUint(rep, type));      {
     case CIMTYPE_SINT8:  return new CIMValue((Sint8)  stringToSint(rep, type));          switch(type)
     case CIMTYPE_UINT16: return new CIMValue((Uint16) stringToUint(rep, type));          {
     case CIMTYPE_SINT16: return new CIMValue((Sint16) stringToSint(rep, type));              case CIMTYPE_UINT8:
     case CIMTYPE_UINT32: return new CIMValue((Uint32) stringToUint(rep, type));                  rtn = new CIMValue((Uint8)  stringToUint(rep, type));
     case CIMTYPE_SINT32: return new CIMValue((Sint32) stringToSint(rep, type));                  break;
     case CIMTYPE_UINT64: return new CIMValue((Uint64) stringToUint(rep, type));              case CIMTYPE_SINT8:
     case CIMTYPE_SINT64: return new CIMValue((Sint64) stringToSint(rep, type));                  rtn = new CIMValue((Sint8)  stringToSint(rep, type));
     case CIMTYPE_REAL32: return new CIMValue((Real32) stringToReal(rep, type));                  break;
     case CIMTYPE_REAL64: return new CIMValue((Real64) stringToReal(rep, type));              case CIMTYPE_UINT16:return
     case CIMTYPE_CHAR16: return new CIMValue((Char16) rep[0]);                  rtn = new CIMValue((Uint16) stringToUint(rep, type));
     case CIMTYPE_BOOLEAN: return new CIMValue((Boolean) (rep[0] == 'T'?1:0));                  break;
     case CIMTYPE_STRING: return new CIMValue(rep);              case CIMTYPE_SINT16:
     case CIMTYPE_DATETIME: return new CIMValue(CIMDateTime(rep));                  rtn = new CIMValue((Sint16) stringToSint(rep, type));
     case CIMTYPE_REFERENCE: return new CIMValue(CIMObjectPath(rep));                  break;
 //  PEP 194:              case CIMTYPE_UINT32:
 //  Note that "object" (ie. CIMTYPE_OBJECT) is not a real CIM datatype, just a                  rtn = new CIMValue((Uint32) stringToUint(rep, type));
 //  Pegasus internal representation of an embedded object, so it won't be                  break;
 //  found here.              case CIMTYPE_SINT32:
                   rtn = new CIMValue((Sint32) stringToSint(rep, type));
                   break;
               case CIMTYPE_UINT64:
                   rtn = new CIMValue((Uint64) stringToUint(rep, type));
                   break;
               case CIMTYPE_SINT64:
                   rtn = new CIMValue((Sint64) stringToSint(rep, type));
                   break;
               case CIMTYPE_REAL32:
                   rtn = new CIMValue((Real32) stringToReal(rep, type));
                   break;
               case CIMTYPE_REAL64:
                   rtn = new CIMValue((Real64) stringToReal(rep, type));
                   break;
               case CIMTYPE_CHAR16:
                   rtn = new CIMValue((Char16) rep[0]);
                   break;
               case CIMTYPE_BOOLEAN:
                   rtn = new CIMValue((Boolean) (rep[0] == 'T'?1:0));
                   break;
               case CIMTYPE_STRING:
                   rtn = new CIMValue(rep);
                   break;
               case CIMTYPE_DATETIME:
                   rtn = new CIMValue(CIMDateTime(rep));
                   break;
               case CIMTYPE_REFERENCE:
                   rtn = new CIMValue(CIMObjectPath(rep));
                   break;
               //  PEP 194:  CIMTYPE_OBJECT is not a DMTF CIM datatype,
               // just an OpenPegasus internal representation of an embedded
               // object, so it won't be  found here.
     case CIMTYPE_OBJECT:     case CIMTYPE_OBJECT:
     case CIMTYPE_INSTANCE:     case CIMTYPE_INSTANCE:
                   rtn = new CIMValue((Uint32) 0);    // return empty CIMValue
         break;         break;
               default:
                   rtn = new CIMValue((Uint32) 0);    // default
           }
     }     }
     return(new CIMValue((Uint32) 0));    // default  
   }   }
   else  
   { // an array type, either fixed or variable  
  
       // KS If empty string set CIMValue type but Null attribute.    // else array type
     else
     {
         // If empty string set CIMValue type but Null attribute.
       if (isNULL)       if (isNULL)
           return new CIMValue(type, true, arrayDimension);        {
             rtn = new CIMValue(type, true, (Uint32)arrayDimension);
     return _buildArrayValue(type, (unsigned int)arrayDimension, rep);        }
         else
         {
           rtn = _buildArrayValue(type, rep);
         }
   }   }
     return rtn;
 } }


Legend:
Removed from v.1.44  
changed lines
  Added in v.1.45

No CVS admin address has been configured
Powered by
ViewCVS 0.9.2