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

Diff for /pegasus/src/Pegasus/Common/CIMObjectPath.cpp between version 1.76 and 1.76.4.3

version 1.76, 2009/12/15 11:39:33 version 1.76.4.3, 2013/06/03 22:35:12
Line 276 
Line 276 
         case CIMTYPE_INSTANCE:         case CIMTYPE_INSTANCE:
             // From PEP 194: EmbeddedObjects cannot be keys.             // From PEP 194: EmbeddedObjects cannot be keys.
             return false;             return false;
             break;  
         default:  // Numerics         default:  // Numerics
             if (getType() != NUMERIC) return false;             if (getType() != NUMERIC) return false;
             kbValue = XmlReader::stringToValue(0, getValue().getCString(),             kbValue = XmlReader::stringToValue(0, getValue().getCString(),
Line 314 
Line 313 
             // If CIMObjectPath parsing fails, just compare strings             // If CIMObjectPath parsing fails, just compare strings
             return String::equal(x.getValue(), y.getValue());             return String::equal(x.getValue(), y.getValue());
         }         }
         break;  
     case CIMKeyBinding::BOOLEAN:     case CIMKeyBinding::BOOLEAN:
         // Case-insensitive comparison is sufficient for booleans         // Case-insensitive comparison is sufficient for booleans
         return String::equalNoCase(x.getValue(), y.getValue());         return String::equalNoCase(x.getValue(), y.getValue());
         break;  
     case CIMKeyBinding::NUMERIC:     case CIMKeyBinding::NUMERIC:
         // Note: This comparison assumes XML syntax for integers         // Note: This comparison assumes XML syntax for integers
         // First try comparing as unsigned integers         // First try comparing as unsigned integers
Line 348 
Line 345 
         // Note: Keys may not be real values, so don't try comparing as reals         // Note: Keys may not be real values, so don't try comparing as reals
         // We couldn't parse the numbers, so just compare the strings         // We couldn't parse the numbers, so just compare the strings
         return String::equal(x.getValue(), y.getValue());         return String::equal(x.getValue(), y.getValue());
         break;  
     default:  // CIMKeyBinding::STRING     default:  // CIMKeyBinding::STRING
         return String::equal(x.getValue(), y.getValue());         return String::equal(x.getValue(), y.getValue());
         break;  
     }     }
  
     PEGASUS_UNREACHABLE(return false;)     PEGASUS_UNREACHABLE(return false;)
Line 471 
Line 466 
 { {
     if ((host != String::EMPTY) && !CIMObjectPathRep::isValidHostname(host))     if ((host != String::EMPTY) && !CIMObjectPathRep::isValidHostname(host))
     {     {
         throw MalformedObjectNameException(host);          MessageLoaderParms mlParms(
               "Common.CIMObjectPath.INVALID_HOSTNAME",
               "$0, reason:\"invalid hostname\"",
               host);
   
           throw MalformedObjectNameException(mlParms);
     }     }
  
     _rep = _copyOnWriteCIMObjectPathRep(_rep);     _rep = _copyOnWriteCIMObjectPathRep(_rep);
Line 502 
Line 502 
     char* slash = strchr(p, '/');     char* slash = strchr(p, '/');
     if (!slash)     if (!slash)
     {     {
         throw MalformedObjectNameException(objectName);          MessageLoaderParms mlParms(
               "Common.CIMObjectPath.MISSING_SLASH_AFTER_HOST",
               "$0, reason:\"missing slash after hostname\"",
               objectName);
           throw MalformedObjectNameException(mlParms);
     }     }
  
     String hostname = String(p, (Uint32)(slash - p));     String hostname = String(p, (Uint32)(slash - p));
     if (!CIMObjectPathRep::isValidHostname(hostname))     if (!CIMObjectPathRep::isValidHostname(hostname))
     {     {
         throw MalformedObjectNameException(objectName);          MessageLoaderParms mlParms(
               "Common.CIMObjectPath.INVALID_HOSTNAME",
               "$0, reason:\"invalid hostname\"",
               objectName);
           throw MalformedObjectNameException(mlParms);
     }     }
     host = hostname;     host = hostname;
  
Line 551 
Line 559 
     String namespaceName = String(p, (Uint32)(colon - p));     String namespaceName = String(p, (Uint32)(colon - p));
     if (!CIMNamespaceName::legal(namespaceName))     if (!CIMNamespaceName::legal(namespaceName))
     {     {
         throw MalformedObjectNameException(objectName);          MessageLoaderParms mlParms(
               "Common.CIMObjectPath.INVALID_NAMESPACE",
               "$0, reason:\"invalid namespace name\"",
               objectName);
           throw MalformedObjectNameException(mlParms);
     }     }
     nameSpace = namespaceName;     nameSpace = namespaceName;
  
Line 591 
Line 603 
         char* equalsign = strchr(p, '=');         char* equalsign = strchr(p, '=');
         if (!equalsign)         if (!equalsign)
         {         {
             throw MalformedObjectNameException(objectName);              MessageLoaderParms mlParms(
                   "Common.CIMObjectPath.INVALID_KEYVALUEPAIR",
                   "$0, reason:\"invalid key-value pair, missing equal sign\"",
                   objectName);
               throw MalformedObjectNameException(mlParms);
         }         }
  
         *equalsign = 0;         *equalsign = 0;
  
         if (!CIMName::legal(p))         if (!CIMName::legal(p))
             throw MalformedObjectNameException(objectName);          {
               MessageLoaderParms mlParms(
                   "Common.CIMObjectPath.INVALID_KEYNAME",
                   "$0, reason:\"invalid key-value pair, invalid key name:$1\"",
                   objectName,
                   p);
               throw MalformedObjectNameException(mlParms);
           }
  
         CIMName keyName (p);         CIMName keyName (p);
  
Line 623 
Line 646 
  
                     if ((*p != '\\') && (*p != '"'))                     if ((*p != '\\') && (*p != '"'))
                     {                     {
                         throw MalformedObjectNameException(objectName);                          MessageLoaderParms mlParms(
                               "Common.CIMObjectPath.INVALID_KEYVALUE",
                               "$0, reason:\"invalid key-value pair, "
                                   "malformed value\"",
                               objectName);
                           throw MalformedObjectNameException(mlParms);
                     }                     }
                 }                 }
  
Line 631 
Line 659 
             }             }
  
             if (*p++ != '"')             if (*p++ != '"')
                 throw MalformedObjectNameException(objectName);              {
                   MessageLoaderParms mlParms(
                       "Common.CIMObjectPath.INVALID_KEYVALUEPAIR_MISSINGQUOTE",
                       "$0, reason:\"invalid key-value pair, "
                           "missing quote in key value\"",
                       objectName);
                   throw MalformedObjectNameException(mlParms);
               }
  
             // Convert the UTF-8 value to a UTF-16 String             // Convert the UTF-8 value to a UTF-16 String
  
Line 685 
Line 720 
  
             if (!(((strncmp(p, "TRUE", n) == 0) && n == 4) ||             if (!(((strncmp(p, "TRUE", n) == 0) && n == 4) ||
                   ((strncmp(p, "FALSE", n) == 0) && n == 5)))                   ((strncmp(p, "FALSE", n) == 0) && n == 5)))
                 throw MalformedObjectNameException(objectName);              {
                   MessageLoaderParms mlParms(
                       "Common.CIMObjectPath.INVALID_BOOLVALUE",
                       "$0, reason:\"invalid key-value pair, "
                           "value should be TRUE or FALSE\"",
                       objectName);
                   throw MalformedObjectNameException(mlParms);
               }
  
             valueString.assign(p, n);             valueString.assign(p, n);
  
Line 715 
Line 757 
             {             {
                 Sint64 x;                 Sint64 x;
                 if (!StringConversion::stringToSignedInteger(p, x))                 if (!StringConversion::stringToSignedInteger(p, x))
                     throw MalformedObjectNameException(objectName);                  {
                       MessageLoaderParms mlParms(
                           "Common.CIMObjectPath.INVALID_NEGATIVNUMBER_VALUE",
                           "$0, reason:\"invalid key-value pair, "
                               "invalid negative number value $1\"",
                           objectName,
                           p);
                       throw MalformedObjectNameException(mlParms);
                   }
             }             }
             else             else
             {             {
                 Uint64 x;                 Uint64 x;
                 if (!StringConversion::stringToUnsignedInteger(p, x))                 if (!StringConversion::stringToUnsignedInteger(p, x))
                     throw MalformedObjectNameException(objectName);                  {
                       MessageLoaderParms mlParms(
                           "Common.CIMObjectPath.INVALID_NEGATIVNUMBER_VALUE",
                           "$0, reason:\"invalid key-value pair, "
                               "invalid number value $1\"",
                           objectName,
                           p);
                       throw MalformedObjectNameException(mlParms);
                   }
             }             }
  
             valueString.assign(p, n);             valueString.assign(p, n);
Line 741 
Line 799 
         {         {
             if (*p++ != ',')             if (*p++ != ',')
             {             {
                 throw MalformedObjectNameException(objectName);                  MessageLoaderParms mlParms(
                       "Common.CIMObjectPath.INVALID_KEYVALUEPAIR_MISSCOMMA",
                       "$0, reason:\"invalid key-value pair, "
                           "next key-value pair has to start with comma\"",
                       objectName);
                   throw MalformedObjectNameException(mlParms);
             }             }
         }         }
     }     }
Line 774 
Line 837 
  
     if (gotHost && !gotNamespace)     if (gotHost && !gotNamespace)
     {     {
         throw MalformedObjectNameException(objectName);          MessageLoaderParms mlParms(
               "Common.CIMObjectPath.MISSING_NAMESPACE",
               "$0, reason:\"host specified, missing namespace\"",
               objectName);
           throw MalformedObjectNameException(mlParms);
     }     }
  
     // Extract the class name:     // Extract the class name:
Line 785 
Line 852 
     {     {
         if (!CIMName::legal(p))         if (!CIMName::legal(p))
         {         {
             throw MalformedObjectNameException(objectName);              MessageLoaderParms mlParms(
                   "Common.CIMObjectPath.INVALID_CLASSNAME",
                   "$0, reason:\"class name $1 not a legal CIM name\"",
                   objectName,
                   p);
               throw MalformedObjectNameException(mlParms);
         }         }
  
         // ATTN: remove this later: a reference should only be able to hold         // ATTN: remove this later: a reference should only be able to hold
Line 798 
Line 870 
     String className = String(p, (Uint32)(dot - p));     String className = String(p, (Uint32)(dot - p));
     if (!CIMName::legal(className))     if (!CIMName::legal(className))
     {     {
         throw MalformedObjectNameException(objectName);          MessageLoaderParms mlParms(
               "Common.CIMObjectPath.INVALID_CLASSNAME",
               "$0, reason:\"class name $1 not a legal CIM name\"",
               objectName,
               className);
           throw MalformedObjectNameException(mlParms);
     }     }
     _rep->_className = className;     _rep->_className = className;
  
Line 827 
Line 904 
         (host != System::getHostName()) &&         (host != System::getHostName()) &&
         !CIMObjectPathRep::isValidHostname(host))         !CIMObjectPathRep::isValidHostname(host))
     {     {
         throw MalformedObjectNameException(host);          MessageLoaderParms mlParms(
               "Common.CIMObjectPath.INVALID_HOSTNAME",
               "$0, reason:\"invalid hostname\"",
               host);
           throw MalformedObjectNameException(mlParms);
     }     }
     _rep = _copyOnWriteCIMObjectPathRep(_rep);     _rep = _copyOnWriteCIMObjectPathRep(_rep);
  
Line 897 
Line 978 
     //  ATTN-CAKG-P2-20020726:  The following condition does not correctly     //  ATTN-CAKG-P2-20020726:  The following condition does not correctly
     //  distinguish instanceNames from classNames in every case     //  distinguish instanceNames from classNames in every case
     //  The instanceName of a singleton instance of a keyless class has no     //  The instanceName of a singleton instance of a keyless class has no
     //  key bindings      //  key bindings. See BUG_3302
     //     //
     if (_rep->_keyBindings.size () != 0)     if (_rep->_keyBindings.size () != 0)
     {     {


Legend:
Removed from v.1.76  
changed lines
  Added in v.1.76.4.3

No CVS admin address has been configured
Powered by
ViewCVS 0.9.2