(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.22 and 1.28

version 1.22, 2002/09/20 19:40:11 version 1.28, 2003/09/09 21:01:07
Line 77 
Line 77 
     {     {
         switch (str[i])         switch (str[i])
         {         {
             case '\n':              case '\\':
                 result.append("\\n");                  result.append("\\\\");
                 break;  
   
             case '\r':  
                 result.append("\\r");  
                 break;  
   
             case '\t':  
                 result.append("\\t");  
                 break;                 break;
  
             case '"':             case '"':
Line 105 
Line 97 
 { {
     Uint32 n = x.size();     Uint32 n = x.size();
  
       //
       //  If the key is a reference, the keys in the reference must also be
       //  sorted
       //
       for (Uint32 k = 0; k < n ; k++)
           if (x[k].getType () == CIMKeyBinding::REFERENCE)
           {
               CIMObjectPath tmp (x[k].getValue ());
               Array <CIMKeyBinding> keyBindings = tmp.getKeyBindings ();
               _BubbleSort (keyBindings);
               tmp.setKeyBindings (keyBindings);
               x[k].setValue (tmp.toString ());
           }
   
     if (n < 2)     if (n < 2)
         return;         return;
  
Line 451 
Line 457 
     p += 2;     p += 2;
  
     //----------------------------------------------------------------------     //----------------------------------------------------------------------
     // Validate the hostname. Hostnames must match the following      // Validate the hostname. A domain is allowed after the hostname.
     // regular expression: "[A-Za-z][A-Za-z0-9-]*"      // Eg. xyz.company.com
       // Hostnames must match the following regular expression:
       // ^([A-Za-z][A-Za-z0-9-]*)(\.[A-Za-z][A-Za-z0-9-]*)*$
     //----------------------------------------------------------------------     //----------------------------------------------------------------------
  
     char* q = p;     char* q = p;
  
       Boolean foundDot = true;
       while (foundDot == true)
       {
           foundDot = false;
   
     if (!isalpha(*q))     if (!isalpha(*q))
         throw MalformedObjectNameException(objectName);         throw MalformedObjectNameException(objectName);
  
     q++;     q++;
  
     while (isalnum(*q) || *q == '-')     while (isalnum(*q) || *q == '-')
           {
               q++;
           }
   
           if (*q == '.')
           {
         q++;         q++;
               foundDot = true;
           }
        }
  
     // We now expect a port (or default the port).     // We now expect a port (or default the port).
  
Line 519 
Line 541 
         return false;         return false;
     }     }
  
       // A ':' as part of a keybinding value should not be interpreted as
       // a namespace delimiter.  Since keybinding pairs follow the first '.'
       // in the object path string, the ':' delimiter only counts if it
       // appears before the '.'.
   
       char* dot = strchr(p, '.');
       if (dot && (dot < colon))
       {
           return false;
       }
   
     //----------------------------------------------------------------------     //----------------------------------------------------------------------
     // Validate the namespace path.  Namespaces must match the following     // Validate the namespace path.  Namespaces must match the following
     // regular expression: "[A-Za-z_]+(/[A-Za-z_]+)*"     // regular expression: "[A-Za-z_]+(/[A-Za-z_]+)*"
     //----------------------------------------------------------------------     //----------------------------------------------------------------------
  
     String namespaceName = String(p, colon - p);      String namespaceName = String(p, (Uint32)(colon - p));
     if (!CIMNamespaceName::legal(namespaceName))     if (!CIMNamespaceName::legal(namespaceName))
     {     {
         throw MalformedObjectNameException(objectName);         throw MalformedObjectNameException(objectName);
Line 633 
Line 666 
  
             while (*p && *p != '"')             while (*p && *p != '"')
             {             {
                 // ATTN: need to handle special characters here:  
   
                 if (*p == '\\')                 if (*p == '\\')
                   {
                     *p++;                     *p++;
  
                       if ((*p != '\\') && (*p != '"'))
                       {
                           throw MalformedObjectNameException(objectName);
                       }
                   }
   
                 valueString.append(*p++);                 valueString.append(*p++);
             }             }
  
Line 652 
Line 690 
  
             while (*p && *p != '"')             while (*p && *p != '"')
             {             {
                 // ATTN: need to handle special characters here:  
   
                 if (*p == '\\')                 if (*p == '\\')
                   {
                     *p++;                     *p++;
  
                       if ((*p != '\\') && (*p != '"'))
                       {
                           throw MalformedObjectNameException(objectName);
                       }
                   }
   
                 valueString.append(*p++);                 valueString.append(*p++);
             }             }
  
Line 748 
Line 791 
  
     // Convert to a C String first:     // Convert to a C String first:
  
     char* p = strdup(objectName.getCString());      CString pCString = objectName.getCStringUTF8();
     Destroyer<char> destroyer(p);      char* p = const_cast<char*>((const char*) pCString);
     Boolean gotHost;     Boolean gotHost;
     Boolean gotNamespace;     Boolean gotNamespace;
  
Line 779 
Line 822 
         return;         return;
     }     }
  
     String className = String(p, dot - p);      String className = String(p, (Uint32)(dot - p));
     if (!CIMName::legal(className))     if (!CIMName::legal(className))
     {     {
         throw MalformedObjectNameException(objectName);         throw MalformedObjectNameException(objectName);
Line 915 
Line 958 
     // ATTN-RK-P2-20020510: Need to make hostname and namespace lower case?     // ATTN-RK-P2-20020510: Need to make hostname and namespace lower case?
  
     String classNameLower = ref._rep->_className.getString ();     String classNameLower = ref._rep->_className.getString ();
     classNameLower.toLower();      classNameLower.toLower(); // ICU_TODO:
     ref._rep->_className = classNameLower;     ref._rep->_className = classNameLower;
  
     for (Uint32 i = 0, n = ref._rep->_keyBindings.size(); i < n; i++)     for (Uint32 i = 0, n = ref._rep->_keyBindings.size(); i < n; i++)


Legend:
Removed from v.1.22  
changed lines
  Added in v.1.28

No CVS admin address has been configured
Powered by
ViewCVS 0.9.2