summaryrefslogtreecommitdiff
path: root/sal/inc
diff options
context:
space:
mode:
authorDavid Ostrovsky <david@ostrovsky.org>2013-02-04 11:14:53 +0100
committerLuboš Luňák <l.lunak@suse.cz>2013-02-04 11:54:11 +0000
commit55576105d3c9b0a116d7707a6c46b67f7b20a0ce (patch)
tree5f17795a5bcd6d4aec0c394f92f1a9fbc7f1a5c9 /sal/inc
parent6ef465646855c73a774700fff35ba43eb36eb0d4 (diff)
add OUString::toUInt64()
Change-Id: I2051e161219d424d2c2b69faf6f939cfe21fa5f7 Reviewed-on: https://gerrit.libreoffice.org/1980 Reviewed-by: Luboš Luňák <l.lunak@suse.cz> Tested-by: Luboš Luňák <l.lunak@suse.cz>
Diffstat (limited to 'sal/inc')
-rw-r--r--sal/inc/rtl/ustring.h19
-rw-r--r--sal/inc/rtl/ustring.hxx14
2 files changed, 33 insertions, 0 deletions
diff --git a/sal/inc/rtl/ustring.h b/sal/inc/rtl/ustring.h
index ab2707d00eb2..35be5fed1e8a 100644
--- a/sal/inc/rtl/ustring.h
+++ b/sal/inc/rtl/ustring.h
@@ -1073,6 +1073,25 @@ 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.
+
+ 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 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(
+ const sal_Unicode * str, sal_Int16 radix ) SAL_THROW_EXTERN_C();
+
/** Interpret a string as a long integer.
This function cannot be used for language-specific conversion. The string
diff --git a/sal/inc/rtl/ustring.hxx b/sal/inc/rtl/ustring.hxx
index 192ba2bee0e2..8190d208ae68 100644
--- a/sal/inc/rtl/ustring.hxx
+++ b/sal/inc/rtl/ustring.hxx
@@ -1843,6 +1843,20 @@ 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.
+ */
+ sal_uInt64 toUInt64( sal_Int16 radix = 10 ) const SAL_THROW(())
+ {
+ return rtl_ustr_toUInt64( pData->buffer, radix );
+ }
+
+ /**
Returns the float value from this string.
This function can't be used for language specific conversion.