Add native StringToI64 (#2449)
* Add native StringToInt64Ex * Delete useless test code * Rename native StringToInt64Ex to StringToI64 * Add documentation for out-of-bounds situations.
This commit is contained in:
@@ -211,6 +211,10 @@ native int StringToIntEx(const char[] str, int &result, int nBase=10);
|
||||
/**
|
||||
* Converts a string to a 64-bit integer.
|
||||
*
|
||||
* @note If the value is outside the range of representable values,
|
||||
* If the value is positive, this function will return INT64_MAX.
|
||||
* If the value is negative, this function will return INT64_MIN.
|
||||
*
|
||||
* @param str String to convert.
|
||||
* @param result Array to store the upper and lower
|
||||
* 32-bits of the 64-bit integer.
|
||||
@@ -219,6 +223,20 @@ native int StringToIntEx(const char[] str, int &result, int nBase=10);
|
||||
*/
|
||||
native int StringToInt64(const char[] str, int result[2], int nBase=10);
|
||||
|
||||
/**
|
||||
* Converts a string to an int64 type value.
|
||||
*
|
||||
* @note If the value is outside the range of representable values,
|
||||
* If the value is positive, this function will return INT64_MAX.
|
||||
* If the value is negative, this function will return INT64_MIN.
|
||||
*
|
||||
* @param str String to convert.
|
||||
* @param nBase Numerical base to use. 10 is default.
|
||||
* @param nConsumed Number of characters consumed.
|
||||
* @return int64 conversion of string, or 0 on failure.
|
||||
*/
|
||||
native int64 StringToI64(const char[] str, int nBase=10, int &nConsumed=0);
|
||||
|
||||
/**
|
||||
* Converts an integer to a string.
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user