(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.74 and 1.76.6.1

version 1.74, 2008/12/02 09:00:43 version 1.76.6.1, 2011/08/08 08:42:55
Line 37 
Line 37 
 #include "CIMName.h" #include "CIMName.h"
 #include "CIMValue.h" #include "CIMValue.h"
 #include "XmlReader.h" #include "XmlReader.h"
   #include <Pegasus/Common/StringConversion.h>
 #include "ArrayInternal.h" #include "ArrayInternal.h"
 #include "HostLocator.h" #include "HostLocator.h"
 #include "System.h" #include "System.h"
Line 324 
Line 325 
         {         {
             Uint64 xValue;             Uint64 xValue;
             Uint64 yValue;             Uint64 yValue;
             if (XmlReader::stringToUnsignedInteger(              if (StringConversion::stringToUnsignedInteger(
                     x.getValue().getCString(), xValue) &&                     x.getValue().getCString(), xValue) &&
                 XmlReader::stringToUnsignedInteger(                  StringConversion::stringToUnsignedInteger(
                     y.getValue().getCString(), yValue))                     y.getValue().getCString(), yValue))
             {             {
                 return (xValue == yValue);                 return (xValue == yValue);
Line 336 
Line 337 
         {         {
             Sint64 xValue;             Sint64 xValue;
             Sint64 yValue;             Sint64 yValue;
             if (XmlReader::stringToSignedInteger(              if (StringConversion::stringToSignedInteger(
                     x.getValue().getCString(), xValue) &&                     x.getValue().getCString(), xValue) &&
                 XmlReader::stringToSignedInteger(                  StringConversion::stringToSignedInteger(
                     y.getValue().getCString(), yValue))                     y.getValue().getCString(), yValue))
             {             {
                 return (xValue == yValue);                 return (xValue == yValue);
Line 470 
Line 471 
 { {
     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 501 
Line 507 
     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 550 
Line 564 
     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 590 
Line 608 
         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 622 
Line 651 
  
                     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 630 
Line 664 
             }             }
  
             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 684 
Line 725 
  
             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 713 
Line 761 
             if (*p == '-')             if (*p == '-')
             {             {
                 Sint64 x;                 Sint64 x;
                 if (!XmlReader::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 (!XmlReader::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 740 
Line 804 
         {         {
             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 773 
Line 842 
  
     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 784 
Line 857 
     {     {
         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 797 
Line 875 
     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 826 
Line 909 
         (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 994 
Line 1081 
             Uint64 uValue;             Uint64 uValue;
             Sint64 sValue;             Sint64 sValue;
             // First try converting to unsigned integer             // First try converting to unsigned integer
             if (XmlReader::stringToUnsignedInteger(              if (StringConversion::stringToUnsignedInteger(
                     ref._rep->_keyBindings[i]._rep->_value.getCString(),                     ref._rep->_keyBindings[i]._rep->_value.getCString(),
                         uValue))                         uValue))
             {             {
Line 1003 
Line 1090 
                 ref._rep->_keyBindings[i]._rep->_value = String(buffer);                 ref._rep->_keyBindings[i]._rep->_value = String(buffer);
             }             }
             // Next try converting to signed integer             // Next try converting to signed integer
             else if (XmlReader::stringToSignedInteger(              else if (StringConversion::stringToSignedInteger(
                          ref._rep->_keyBindings[i]._rep->_value.getCString(),                          ref._rep->_keyBindings[i]._rep->_value.getCString(),
                              sValue))                              sValue))
             {             {


Legend:
Removed from v.1.74  
changed lines
  Added in v.1.76.6.1

No CVS admin address has been configured
Powered by
ViewCVS 0.9.2