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

Diff for /pegasus/src/Pegasus/CQL/CQLUtilities.cpp between version 1.8 and 1.9

version 1.8, 2004/12/07 19:34:20 version 1.9, 2004/12/10 07:09:28
Line 104 
Line 104 
   if (!isdigit(*p))   if (!isdigit(*p))
   {   {
      MessageLoaderParms mload(String("CQL.CQLUtilities.INVALID_NUM_FORMAT"),      MessageLoaderParms mload(String("CQL.CQLUtilities.INVALID_NUM_FORMAT"),
                               String("String $0 must begin with a decimal character following an optional sign"),                                String("String '$0' is badly formed.  It must be of the form; [+][0-9]*"),
                               stringNum);                               stringNum);
     throw CQLRuntimeException(mload);     throw CQLRuntimeException(mload);
   }   }
Line 146 
Line 146 
     if (*p && (*p != 'b') && (*p != 'B'))     if (*p && (*p != 'b') && (*p != 'B'))
     {     {
       MessageLoaderParms mload(String("CQL.CQLUtilities.INVALID_BIN_CHAR"),       MessageLoaderParms mload(String("CQL.CQLUtilities.INVALID_BIN_CHAR"),
                                String("String $0 has a non-binary digit character"),                                 String("Character '$0' in string '$1' is not a binary digit."),
                                stringNum);                                 String(p, 1), stringNum);
       throw CQLRuntimeException(mload);       throw CQLRuntimeException(mload);
     }     }
  
Line 168 
Line 168 
     if (!*p)     if (!*p)
     {     {
       MessageLoaderParms mload(String("CQL.CQLUtilities.INVALID_HEX_FORMAT"),       MessageLoaderParms mload(String("CQL.CQLUtilities.INVALID_HEX_FORMAT"),
                                String("String $0 needs a hexadecimal digit character following '0x'"),                                 String("String '$0' needs a hexadecimal digit character following '0x'"),
                                stringNum);                                stringNum);
       throw CQLRuntimeException(mload);       throw CQLRuntimeException(mload);
     }     }
Line 204 
Line 204 
     if (*p)     if (*p)
     {     {
       MessageLoaderParms mload(String("CQL.CQLUtilities.INVALID_HEX_CHAR"),       MessageLoaderParms mload(String("CQL.CQLUtilities.INVALID_HEX_CHAR"),
                                String("String $0 has a non-hexidecimal digit character"),                               String("Character '$0' in string '$1' is not a hexidecimal digit."),
                                stringNum);                               String(p, 1), stringNum);
       throw CQLRuntimeException(mload);       throw CQLRuntimeException(mload);
     }     }
  
Line 247 
Line 247 
   if (*p)   if (*p)
   {   {
       MessageLoaderParms mload(String("CQL.CQLUtilities.INVALID_DECIMAL_CHAR"),       MessageLoaderParms mload(String("CQL.CQLUtilities.INVALID_DECIMAL_CHAR"),
                                String("String $0 has a non-decimal digit character $1"),                               String("Character '$0' in string '$1' is not a decimal digit."),
                                stringNum, String(p));                               String(p, 1), stringNum);
       throw CQLRuntimeException(mload);       throw CQLRuntimeException(mload);
   }   }
  
Line 292 
Line 292 
   if (!isdigit(*p))   if (!isdigit(*p))
   {   {
      MessageLoaderParms mload(String("CQL.CQLUtilities.INVALID_NUM_FORMAT"),      MessageLoaderParms mload(String("CQL.CQLUtilities.INVALID_NUM_FORMAT"),
                               String("String $0 must begin with a decimal character following an optional sign"),                                String("String '$0' is badly formed.  It must be of the form; [+-][0-9]*"),
                               stringNum);                               stringNum);
     throw CQLRuntimeException(mload);     throw CQLRuntimeException(mload);
   }   }
Line 339 
Line 339 
     if (*p && (*p != 'b') && (*p != 'B'))     if (*p && (*p != 'b') && (*p != 'B'))
     {     {
       MessageLoaderParms mload(String("CQL.CQLUtilities.INVALID_BIN_CHAR"),       MessageLoaderParms mload(String("CQL.CQLUtilities.INVALID_BIN_CHAR"),
                                String("String $0 has a non-binary digit character"),                                 String("Character '$0' in string '$1' is not a binary digit."),
                                stringNum);                                 String(p, 1), stringNum);
       throw CQLRuntimeException(mload);       throw CQLRuntimeException(mload);
     }     }
  
Line 371 
Line 371 
     // Skip over the "0x"     // Skip over the "0x"
     p+=2;     p+=2;
  
     // At least one hexadecimal digit is required      // At least one hexidecimal digit is required
     if (!*p)     if (!*p)
     {     {
       MessageLoaderParms mload(String("CQL.CQLUtilities.INVALID_HEX_FORMAT"),       MessageLoaderParms mload(String("CQL.CQLUtilities.INVALID_HEX_FORMAT"),
                                String("String $0 needs a hexadecimal digit character following '0x'"),                                 String("String '$0' needs a hexidecimal digit character following '0x'"),
                                stringNum);                                stringNum);
       throw CQLRuntimeException(mload);       throw CQLRuntimeException(mload);
     }     }
Line 407 
Line 407 
       x = x - newDigit;       x = x - newDigit;
     }     }
  
     // If we found a non-hexadecimal digit, report an error      // If we found a non-hexidecimal digit, report an error
     if (*p)     if (*p)
     {     {
       MessageLoaderParms mload(String("CQL.CQLUtilities.INVALID_HEX_CHAR"),       MessageLoaderParms mload(String("CQL.CQLUtilities.INVALID_HEX_CHAR"),
                                String("String $0 has a non-hexidecimal digit character"),                               String("Character '$0' in string '$1' is not a hexidecimal digit."),
                                stringNum);                               String(p, 1), stringNum);
       throw CQLRuntimeException(mload);       throw CQLRuntimeException(mload);
     }     }
  
Line 468 
Line 468 
   if (*p)   if (*p)
   {   {
     MessageLoaderParms mload(String("CQL.CQLUtilities.INVALID_DECIMAL_CHAR"),     MessageLoaderParms mload(String("CQL.CQLUtilities.INVALID_DECIMAL_CHAR"),
                              String("String $0 has a non-decimal digit character $1"),                               String("Character '$0' in string '$1' is not a decimal digit."),
                              stringNum, String(p));                               String(p, 1), stringNum);
     throw CQLRuntimeException(mload);     throw CQLRuntimeException(mload);
   }   }
  
Line 565 
Line 565 
     if (!isdigit(*p++))     if (!isdigit(*p++))
     {     {
       MessageLoaderParms mload(String("CQL.CQLUtilities.INVALID_CHAR_POST_DOT"),       MessageLoaderParms mload(String("CQL.CQLUtilities.INVALID_CHAR_POST_DOT"),
                                String("String $0 must have a digit character following the decimal point."),                                 String("String '$0' must have a digit character following the decimal point."),
                                stringNum);                                stringNum);
       throw CQLRuntimeException(mload);       throw CQLRuntimeException(mload);
     }     }
Line 574 
Line 574 
       p++;       p++;
  
     // If there is an exponent now:     // If there is an exponent now:
   
     if (*p)     if (*p)
     {     {
       // Test exponent:       // Test exponent:
Line 582 
Line 581 
       if (*p != 'e' && *p != 'E')       if (*p != 'e' && *p != 'E')
       {       {
         MessageLoaderParms mload(String("CQL.CQLUtilities.INVALID_REAL_CHAR"),         MessageLoaderParms mload(String("CQL.CQLUtilities.INVALID_REAL_CHAR"),
                                  String("String $0 contains an invalid character for a real number."),                                   String("Character '$0' in string '$1` is invalid for a real number."),
                                  stringNum);                                   String(p-1, 1), stringNum);
         throw CQLRuntimeException(mload);         throw CQLRuntimeException(mload);
       }       }
   
       p++;       p++;
  
       // Skip optional sign:       // Skip optional sign:
Line 595 
Line 593 
         p++;         p++;
  
       // One or more digits required:       // One or more digits required:
   
       if (!isdigit(*p++))       if (!isdigit(*p++))
       {       {
         MessageLoaderParms mload(String("CQL.CQLUtilities.INVALID_REAL_EXP"),         MessageLoaderParms mload(String("CQL.CQLUtilities.INVALID_REAL_EXP"),
                                  String("String $0 must have a digit following the exponent symbol."),                                   String("String '$0' has an badly formed exponent.  It must be of the form [eE][+-][0-9]*..  Character '$1' is invalid."),
                                  stringNum);                                   stringNum, String(p, 1));
         throw CQLRuntimeException(mload);         throw CQLRuntimeException(mload);
       }       }
  
Line 612 
Line 609 
   {   {
   //  printf("This is char # %d\n", p - pStart);   //  printf("This is char # %d\n", p - pStart);
     MessageLoaderParms mload(String("CQL.CQLUtilities.INVALID_DECIMAL_CHAR"),     MessageLoaderParms mload(String("CQL.CQLUtilities.INVALID_DECIMAL_CHAR"),
                              String("String $0 has a non-decimal digit character $1"),                               String("Character '$0' in string '$1' is not a decimal digit."),
                              stringNum,                               String(p-1, 1), stringNum);
                              String(p));  
     throw CQLRuntimeException(mload);     throw CQLRuntimeException(mload);
   }   }
   //   //
Line 632 
Line 628 
     throw CQLRuntimeException(mload);     throw CQLRuntimeException(mload);
   }   }
   PEG_METHOD_EXIT();   PEG_METHOD_EXIT();
   printf("String %s = %.16e\n", (const char *)stringNum.getCString(), x);  //  printf("String %s = %.16e\n", (const char *)stringNum.getCString(), x);
 //  printf("Num %e = \n", x);  
   return x;   return x;
 } }
  


Legend:
Removed from v.1.8  
changed lines
  Added in v.1.9

No CVS admin address has been configured
Powered by
ViewCVS 0.9.2