diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2013-03-25 16:20:31 +0100 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2013-03-25 17:33:29 +0100 |
commit | 476081b19bd71d5c1eb7d82eee4821f099ecde78 (patch) | |
tree | 4fa9e632549472ac80f4e5b530ae70143e9c341c /sal/inc | |
parent | 89e17604d12bf77308a982107319fdc55f735713 (diff) |
Clean up new toUInt64
Change-Id: Ic908cb5cc9169ab1baae2c1c52070adfb9afba39
Diffstat (limited to 'sal/inc')
-rw-r--r-- | sal/inc/rtl/string.h | 21 | ||||
-rw-r--r-- | sal/inc/rtl/string.hxx | 16 | ||||
-rw-r--r-- | sal/inc/rtl/ustring.h | 14 | ||||
-rw-r--r-- | sal/inc/rtl/ustring.hxx | 2 |
4 files changed, 47 insertions, 6 deletions
diff --git a/sal/inc/rtl/string.h b/sal/inc/rtl/string.h index a16d61e0bb99..93cffa1a17b4 100644 --- a/sal/inc/rtl/string.h +++ b/sal/inc/rtl/string.h @@ -762,6 +762,27 @@ SAL_DLLPUBLIC sal_Int32 SAL_CALL rtl_str_toInt32( SAL_DLLPUBLIC sal_Int64 SAL_CALL rtl_str_toInt64( const sal_Char * str, sal_Int16 radix ) SAL_THROW_EXTERN_C(); +/** Interpret a string as an unsigned long integer. + + This function cannot be used for language-specific conversion. The string + must be null-terminated. + + @param str + a null-terminated string. + + @param radix + the radix. Must be between RTL_USTR_MIN_RADIX (2) and RTL_USTR_MAX_RADIX + (36), inclusive. + + @return + the unsigned long integer value represented by the string, or 0 if the + string does not represent an unsigned long integer. + + @since LibreOffice 4.1 + */ +SAL_DLLPUBLIC sal_uInt64 SAL_CALL rtl_str_toUInt64( + const sal_Char * str, sal_Int16 radix ) SAL_THROW_EXTERN_C(); + /** Interpret a string as a float. This function cannot be used for language-specific conversion. The string diff --git a/sal/inc/rtl/string.hxx b/sal/inc/rtl/string.hxx index cbb8cd580f76..01ee46477f34 100644 --- a/sal/inc/rtl/string.hxx +++ b/sal/inc/rtl/string.hxx @@ -1371,6 +1371,22 @@ public: } /** + Returns the uint64 value from this string. + + This function can't be used for language specific conversion. + + @param radix the radix (between 2 and 36) + @return the uint64 represented from this string. + 0 if this string represents no number. + + @since LibreOffice 4.1 + */ + sal_uInt64 toUInt64( sal_Int16 radix = 10 ) const SAL_THROW(()) + { + return rtl_str_toUInt64( pData->buffer, radix ); + } + + /** Returns the float value from this string. This function can't be used for language specific conversion. diff --git a/sal/inc/rtl/ustring.h b/sal/inc/rtl/ustring.h index f6bf956c0c51..da6720b3bcf6 100644 --- a/sal/inc/rtl/ustring.h +++ b/sal/inc/rtl/ustring.h @@ -1073,7 +1073,7 @@ SAL_DLLPUBLIC sal_Bool SAL_CALL rtl_ustr_toBoolean( SAL_DLLPUBLIC sal_Int32 SAL_CALL rtl_ustr_toInt32( const sal_Unicode * str, sal_Int16 radix ) SAL_THROW_EXTERN_C(); -/** Interpret a string as an unsigned long integer. +/** Interpret a string as a long integer. This function cannot be used for language-specific conversion. The string must be null-terminated. @@ -1089,10 +1089,10 @@ SAL_DLLPUBLIC sal_Int32 SAL_CALL rtl_ustr_toInt32( the long integer value represented by the string, or 0 if the string does not represent a long integer. */ -SAL_DLLPUBLIC sal_uInt64 SAL_CALL rtl_ustr_toUInt64( +SAL_DLLPUBLIC sal_Int64 SAL_CALL rtl_ustr_toInt64( const sal_Unicode * str, sal_Int16 radix ) SAL_THROW_EXTERN_C(); -/** Interpret a string as a long integer. +/** Interpret a string as an unsigned long integer. This function cannot be used for language-specific conversion. The string must be null-terminated. @@ -1105,10 +1105,12 @@ SAL_DLLPUBLIC sal_uInt64 SAL_CALL rtl_ustr_toUInt64( (36), inclusive. @return - the long integer value represented by the string, or 0 if the string does - not represent a long integer. + the unsigned long integer value represented by the string, or 0 if the + string does not represent an unsigned long integer. + + @since LibreOffice 4.1 */ -SAL_DLLPUBLIC sal_Int64 SAL_CALL rtl_ustr_toInt64( +SAL_DLLPUBLIC sal_uInt64 SAL_CALL rtl_ustr_toUInt64( const sal_Unicode * str, sal_Int16 radix ) SAL_THROW_EXTERN_C(); /** Interpret a string as a float. diff --git a/sal/inc/rtl/ustring.hxx b/sal/inc/rtl/ustring.hxx index 4d9650e535c8..2afd95cc62f0 100644 --- a/sal/inc/rtl/ustring.hxx +++ b/sal/inc/rtl/ustring.hxx @@ -1857,6 +1857,8 @@ public: @param radix the radix (between 2 and 36) @return the uint64 represented from this string. 0 if this string represents no number. + + @since LibreOffice 4.1 */ sal_uInt64 toUInt64( sal_Int16 radix = 10 ) const SAL_THROW(()) { |