diff options
author | Sébastien Le Ray <sebastien-libreoffice@orniz.org> | 2011-02-17 10:41:21 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2011-02-18 10:20:15 +0000 |
commit | a6ba342adec9edad3e4bcf4d614d3525b4e66186 (patch) | |
tree | 2975f1c4b78c69358857e40285d685644ded7340 /comphelper/inc | |
parent | e5f8a07078033bc6774f9f5496d5e985f59be775 (diff) |
Added comphelper::string::decimalStringToNumber
Diffstat (limited to 'comphelper/inc')
-rw-r--r-- | comphelper/inc/comphelper/string.hxx | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/comphelper/inc/comphelper/string.hxx b/comphelper/inc/comphelper/string.hxx index e3c6787b2ef3..7944b1e2bddd 100644 --- a/comphelper/inc/comphelper/string.hxx +++ b/comphelper/inc/comphelper/string.hxx @@ -122,6 +122,27 @@ COMPHELPER_DLLPUBLIC ::rtl::OUString& COMPHELPER_DLLPUBLIC ::rtl::OUString convertCommaSeparated( ::com::sun::star::uno::Sequence< ::rtl::OUString > const & i_rSeq); +/** Convert a decimal string to a number. + + The string must be base-10, no sign but can contain any + codepoint listed in the "Number, Decimal Digit" Unicode + category. + + No verification is made about the validity of the string, + passing string not containing decimal digit code points + gives unspecified results + + If your string is guaranteed to contain only ASCII digit + use rtl::OUString::toInt32 instead. + + @param str The string to convert containing only decimal + digit codepoints. + + @return The value of the string as an int32. + */ +COMPHELPER_DLLPUBLIC sal_uInt32 decimalStringToNumber( + ::rtl::OUString const & str ); + /** Convert a single comma separated string to a sequence of strings. Note that no escaping of commas or anything fancy is done. |