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

Diff for /pegasus/src/Pegasus/Common/CIMName.cpp between version 1.18 and 1.19

version 1.18, 2002/09/13 23:55:37 version 1.19, 2003/08/12 17:45:57
Line 31 
Line 31 
  
 #include <cctype> #include <cctype>
 #include "CIMName.h" #include "CIMName.h"
   #include "CommonUTF.h"
  
 PEGASUS_NAMESPACE_BEGIN PEGASUS_NAMESPACE_BEGIN
  
Line 118 
Line 119 
 Boolean CIMName::legal(const String& name) Boolean CIMName::legal(const String& name)
 { {
     Uint32 length = name.size();     Uint32 length = name.size();
       Uint32 i = 0;
  
     if (length == 0 || !(isalpha(name[0]) || name[0] == '_'))  
         return false;  
  
     for (Uint32 i=1; i<length; i++)      if (length == 0)
     {  
         // ATTN-RK-20020729: Is this check necessary?  Add it to namespace name?  
         if (name[i] > PEGASUS_MAX_PRINTABLE_CHAR)  
             return false;             return false;
  
         if (!(isalnum(name[i]) || name[i] == '_'))      CString temp = name.getCStringUTF8();
       const char* UTF8name = temp;
   
       char currentChar;
   
       while(i<length)
       {
           UTF8_NEXT(UTF8name,i,currentChar);
           if (!(String::isUTF8(&UTF8name[i])))
             return false;             return false;
     }     }
  
Line 229 
Line 234 
  
 Boolean CIMNamespaceName::legal(const String& name) Boolean CIMNamespaceName::legal(const String& name)
 { {
       Uint32 i = 0;
     Uint32 length = name.size();     Uint32 length = name.size();
     if (length == 0) return true;    // ATTN: Cheap hack!     if (length == 0) return true;    // ATTN: Cheap hack!
  
     // ATTN-RK-20020729: Hack: Skip leading '/' because spec is ambiguous      if (length == 0) return true;    // ATTN: Cheap hack!
     Uint32 start = 0;  
     if (name[0] == '/')  
     {  
         start++;  
     }  
   
     for (Uint32 i=start; i<length; )  
     {  
         if (!name[i] || (!isalpha(name[i]) && name[i] != '_'))  
         {  
             return false;  
         }  
  
         i++;      CString temp = name.getCStringUTF8();
       const char* UTF8name = temp;
  
         while (isalnum(name[i]) || name[i] == '_')      char currentChar;
         {  
             i++;  
         }  
  
         if (name[i] == '/')      while(i<length)
         {         {
             i++;          UTF8_NEXT(UTF8name,i,currentChar);
         }          if (!(String::isUTF8(&UTF8name[i])))
               return false;
     }     }
  
     return true;     return true;


Legend:
Removed from v.1.18  
changed lines
  Added in v.1.19

No CVS admin address has been configured
Powered by
ViewCVS 0.9.2