version 1.7, 2004/12/03 00:37:33
|
version 1.8, 2004/12/07 19:34:20
|
|
|
const Char16* p = stringNum.getChar16Data(); | const Char16* p = stringNum.getChar16Data(); |
const Char16* pStart = p; | const Char16* pStart = p; |
| |
|
if (String::equal(stringNum, String::EMPTY)) |
|
{ |
|
MessageLoaderParms mload(String("CQL.CQLUtilities.EMPTY_STRING"), |
|
String("String cannot be empty.")); |
|
throw CQLRuntimeException(mload); |
|
} |
|
|
if (!p) | if (!p) |
{ | { |
MessageLoaderParms mload(String("CQL.CQLUtilities.NULL_INPUT"), | MessageLoaderParms mload(String("CQL.CQLUtilities.NULL_INPUT"), |
String("String cannot be NULL or empty.")); |
String("String cannot be NULL.")); |
throw CQLRuntimeException(mload); | throw CQLRuntimeException(mload); |
} | } |
| |
|
|
if (*p == '-') | if (*p == '-') |
{ | { |
MessageLoaderParms mload(String("CQL.CQLUtilities.INVALID_NEG"), | MessageLoaderParms mload(String("CQL.CQLUtilities.INVALID_NEG"), |
String("String $0 cannot being with '-'."), |
String("String $0 cannot begin with '-'."), |
stringNum); | stringNum); |
throw CQLRuntimeException(mload); | throw CQLRuntimeException(mload); |
} | } |
|
|
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"), |
String("String $0 has a non-decimal digit character $1"), |
stringNum); |
stringNum, String(p)); |
throw CQLRuntimeException(mload); | throw CQLRuntimeException(mload); |
} | } |
| |
|
|
const Char16* p = stringNum.getChar16Data(); | const Char16* p = stringNum.getChar16Data(); |
const Char16* pStart = p; | const Char16* pStart = p; |
| |
|
if (String::equal(stringNum, String::EMPTY)) |
|
{ |
|
MessageLoaderParms mload(String("CQL.CQLUtilities.EMPTY_STRING"), |
|
String("String cannot be empty.")); |
|
throw CQLRuntimeException(mload); |
|
} |
|
|
if (!p) | if (!p) |
{ | { |
MessageLoaderParms mload(String("CQL.CQLUtilities.NULL_INPUT"), | MessageLoaderParms mload(String("CQL.CQLUtilities.NULL_INPUT"), |
String("String cannot be NULL or empty.")); |
String("String cannot be NULL.")); |
throw CQLRuntimeException(mload); | throw CQLRuntimeException(mload); |
} | } |
| |
|
|
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"), |
String("String $0 has a non-decimal digit character $1"), |
stringNum); |
stringNum, String(p)); |
throw CQLRuntimeException(mload); | throw CQLRuntimeException(mload); |
} | } |
| |
|
|
Boolean neg = false; | Boolean neg = false; |
const Char16* pStart = p; | const Char16* pStart = p; |
| |
if (!*p) |
if (String::equal(stringNum, String::EMPTY)) |
|
{ |
|
MessageLoaderParms mload(String("CQL.CQLUtilities.EMPTY_STRING"), |
|
String("String cannot be empty.")); |
|
throw CQLRuntimeException(mload); |
|
} |
|
|
|
if (!p) |
{ | { |
MessageLoaderParms mload(String("CQL.CQLUtilities.NULL_INPUT"), | MessageLoaderParms mload(String("CQL.CQLUtilities.NULL_INPUT"), |
String("String cannot be NULL or empty.")); |
String("String cannot be NULL.")); |
throw CQLRuntimeException(mload); | throw CQLRuntimeException(mload); |
} | } |
| |
|
|
p++; | p++; |
} | } |
} // end-if optional decimal point | } // end-if optional decimal point |
if (*p) |
if (*p && p - pStart <= stringNum.size()) |
{ | { |
|
// 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"), |
String("String $0 has a non-decimal digit character $1"), |
stringNum); |
stringNum, |
|
String(p)); |
throw CQLRuntimeException(mload); | throw CQLRuntimeException(mload); |
} | } |
// | // |
|
|
throw CQLRuntimeException(mload); | throw CQLRuntimeException(mload); |
} | } |
PEG_METHOD_EXIT(); | PEG_METHOD_EXIT(); |
|
printf("String %s = %.16e\n", (const char *)stringNum.getCString(), x); |
|
// printf("Num %e = \n", x); |
return x; | return x; |
} | } |
| |