summaryrefslogtreecommitdiff
path: root/sal/inc/rtl/ustring.hxx
AgeCommit message (Collapse)Author
2013-04-24move URE headers to include/David Tardon
Change-Id: Ib48a12e902f2311c295b2007f08f44dee28f431d Reviewed-on: https://gerrit.libreoffice.org/3499 Reviewed-by: David Tardon <dtardon@redhat.com> Tested-by: David Tardon <dtardon@redhat.com>
2013-04-04remove HAVE_SFINAE_ANONYMOUS_BROKENLuboš Luňák
Since we no longer support the old Apple SDK using gcc-4.0.1, we can remove the cruft to work around its problems. Woohoo. Change-Id: Idf275e76449443f1f0314e75dab993f213a77eb7
2013-03-28Half-assed attempt at enforcing operator [] preconditionsStephan Bergmann
...inspired by comments to <https://gerrit.libreoffice.org/#/c/3068/> "String::AppendAscii cleanup in dbaccess," but it quickly becomes apparent that lots of code rely on s[s.getLength()] == 0, so live with a weakened precondition check for now. Change-Id: Ifad96c706b14433df4a084ab8054b32433b8b5b6
2013-03-25Add test case for toInt overflow detectionStephan Bergmann
Change-Id: I1c5b66888baac8aa1bc99c06579e0ef3638a4877
2013-03-25Clean up new toUInt64Stephan Bergmann
Change-Id: Ic908cb5cc9169ab1baae2c1c52070adfb9afba39
2013-03-20Deprecate confusing rtl::OUString::compareToAscii(asciiStr, maxLength)Stephan Bergmann
Change-Id: I3a41036ec03cdaefea94b19dbedf59e5a5e37dc8
2013-03-20use #if instead of #ifdef for testing config_xxx.hxx macrosLuboš Luňák
http://lists.freedesktop.org/archives/libreoffice/2013-March/047769.html Change-Id: I81ed4500878ff3193e028410a1f0205e28d17fc3
2013-02-26SAL_WARN_UNUSED_RESULT OUString copyEike Rathke
Change-Id: Ic511a4a399ae2d75de6050ac8e3f77ee13ec8275
2013-02-25fdo#60724 - change 'charcter' to 'character'sadam36
Changed all occurrences of 'charcter' found by git grep. All of them were used in comments only, so it should not break anything. Change-Id: Ief2c00d929ae7972c55a4920fc0eaa8d6b18ab82 Reviewed-on: https://gerrit.libreoffice.org/2372 Reviewed-by: Björn Michaelsen <bjoern.michaelsen@canonical.com> Tested-by: Björn Michaelsen <bjoern.michaelsen@canonical.com>
2013-02-07improve comments of isEmpty()Chr. Rossmanith
Change-Id: I6542470c2d4b27de25e263651e25baf85c7d018d
2013-02-06O(U)String::valueOf don't duplicate codeDavid Ostrovsky
Change-Id: I586fca181f63999a8f2d19d600b69f6788fd61d9 Reviewed-on: https://gerrit.libreoffice.org/1992 Reviewed-by: Luboš Luňák <l.lunak@suse.cz> Tested-by: Luboš Luňák <l.lunak@suse.cz>
2013-02-04remove sal_Bool from boolean() docs tooLuboš Luňák
2013-02-04OK for boolean() to take true bool argumentStephan Bergmann
...instead of sal_Bool; this would cause C4800 performance warnings with MSVC, but we disable them anyway. Also, added unit tests that are actually executed. Change-Id: Ib405132565918be72d93b3fc24180edcb6e565c7
2013-02-04Strings: boolean() as a replacement for valueOf(sal_Bool)David Ostrovsky
valueOf(?) has been superseded by number(?). O(U)String::valueOf(sal_Bool) has been deprecated without providing an alternative method. Use boolean() method as a replacement for it. Change-Id: I7eb74574fa8f1a3cf007cb0cbc32e681007ffb92 Signed-off-by: Stephan Bergmann <sbergman@redhat.com>
2013-02-04add OUString::toUInt64()David Ostrovsky
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>
2013-01-28cleanups for number() string functionLuboš Luňák
- add sal_uInt64 valueOf helper to handle its full value range - group deprecated valueOf() together - forward to the number() taking the largest type instead of repeating the same code every time - various doc improvements: - add missing @since - do not refer to non-existent number() overloads in docs - "use number" - "huh, of course I use a number?" - "code your own" - my own function? why? - + or += operators are not, strictly speaking, replacements for valueOf() Change-Id: Ib138a06c4ac4365cfffc534e6ab115d55180a70d
2013-01-21Revert "avoid -Wsign-promo warnings"Stephan Bergmann
This reverts commit 1efe9a15f86a7a9dc08b57fd1dd12336522ba515, which is obsoleted by 488823a140217e393298bc83e75084041a85ed45 "Remove -Wsign-promo."
2013-01-19microoptimization for "" OUString ctorLuboš Luňák
Now 'OUString()' and '""' should be exactly the same, and thus the latter better :). Change-Id: If42b2ca5889967aaa8ccdaf531b45c75c12d54fd
2013-01-18avoid warning about a comparison being always trueLuboš Luňák
Change-Id: Ie0bd47a16af56b7d3ae070d5b82ec46ed21834c0
2013-01-18avoid -Wsign-promo warningsLuboš Luňák
I actually find the warning to be obsolete nonsense (the manpage talks about cfront), but at least for now. Change-Id: I4390b1779f6f8de062afd441f6855cb760adf93d
2013-01-18long and long long can be the same size (and thus also sal_Int64)Luboš Luňák
Change-Id: I3961ec27d23915b038c3a803dc71e7d937ca331c
2013-01-18Create OUString and OString number(*) methods.Noel Grandin
API CHANGE: Adds new methods (several overloads) OString::number() OUString::number() and marks all of the existing fromValue() methods as deprecated. The purpose of this change is to clean up call sites by hiding the necessary casts. The casts are necessary because of overload resolution rules which are somewhat vague about which methods to choose when using integer types. See mailing list discussion here: http://nabble.documentfoundation.org/replacing-OUString-valueOf-static-cast-lt-sal-Int32-gt-td4027989.html Subject: "replacing OUString::valueOf(static_cast<sal_Int32>) ??" Change-Id: Id3d150a6525eb0334e41e2ec6640bb06cd790b43 Reviewed-on: https://gerrit.libreoffice.org/1625 Reviewed-by: Luboš Luňák <l.lunak@suse.cz> Tested-by: Luboš Luňák <l.lunak@suse.cz>
2012-12-17OUString::reverseCompareTo() string literal overload to match the AsciiL oneLuboš Luňák
Change-Id: Id5ca706aa3fd1831990db2310933c6b94ca376cb
2012-12-11use SAL_WARN_UNUSED_RESULT for OUString::replaceAllIvan Timofeev
Change-Id: I30754e4d0cb0c490e6c125ba034e2e0eac3751e7 Reviewed-on: https://gerrit.libreoffice.org/1297 Reviewed-by: Michael Stahl <mstahl@redhat.com> Tested-by: Michael Stahl <mstahl@redhat.com>
2012-12-06use rtl_(u)string_alloc where the contents clearly don't need to be clearedLuboš Luňák
Change-Id: I3e8d8f123aaa43ee3721fae6f220a8c5f959a0ea
2012-12-06support for fast string operator+ in operator+=/appendLuboš Luňák
Not much point in building a string instance that will be copied elsewhere immediatelly. Change-Id: I38b7d3696f2c619e6424eb3959b00cd2c7738c47
2012-12-06add doxygen tags to the internal fast string stuffLuboš Luňák
Change-Id: Ie5026c116f9cc7d5b10981d53881f8a0d7986a68
2012-12-06remove needless friend declarationLuboš Luňák
Change-Id: Ib816e8126193a3477fca1334d7526743da0d4423
2012-12-06reduce a bit the rtl vs rtlunittest mess in string headersLuboš Luňák
Change-Id: I27bf6d5466313a7e4a1363f481b2bd7eab142a5c
2012-12-04sal: warning C4267: return: conversion from 'size_t' to 'int'...Michael Stahl
... possible loss of data. Minimal fix that inserts casts when calling strlen; other option would be to change all length() to return size_t... Change-Id: I5d1e0b0c7175a1957aad3acd89884fcd37089454
2012-12-04fix non-fast string operator+ debug buildLuboš Luňák
the asserts I've added need string.h , which was not available in that case Change-Id: If8dbedcb48400e5edd0bde0214640c2c392fde2b
2012-12-04Fix fast concat of empty stringsStephan Bergmann
Change-Id: Ice9c6974f44be3bc4c9b3533de2a9beb5b146ca5
2012-12-03assert on strange lengths of string literalsLuboš Luňák
It's better to detect corner cases this way rather than get possibly incorrect results. And strlen() should be easy to optimize out for string literals. Change-Id: Id762e256207668a0cbefe4e13d5f2067f373e783
2012-12-03support for fast O(U)String concatenation using operator+Luboš Luňák
Operator+ now, instead of requiring O(U)String operands and returning another O(U)String object, keeps a track of the whole concatenation operation using temporary O(U)StringConcat objects and performs the whole operation only at the very end. Change-Id: I94b3348300a137498514d26e96459c1698328520
2012-12-03Improve English commentsNaser Sharifi
Corrected types and grammer errors in comments Change-Id: I47ce77a8d36d71677720be6dd80594ec76970376
2012-11-28add SAL_WARN_UNUSED_RESULT in OString and OUString where appropriateNorbert Thiebaud
String used to do some operation by modifying itself whereas OUString never does that and when a modificaiton is needed it create a new copy. so it is very easy when one convert String code to OUString code to miss stuff like sString.ToUpperCase() which need to be converted into sString = sString.toAsciiUpperCase() and not sString.toAsciiUpperCase() This patch make the compiler generate a warning in that later _wrong_ case Change-Id: I4a9c0b4c7d0b75ad8850ac23b86e8508a334f5fe Signed-off-by: Stephan Bergmann <sbergman@redhat.com>
2012-11-28Fix rtl::OUString::compareToIgnoreAsciiCaseStephan Bergmann
Change-Id: I40005ef4fad4d44314ec2fb2881fec82e926970e
2012-11-27OUString has a matchIgnoreAsciiCase but no compareTo version of itNorbert Thiebaud
Change-Id: Ie02dc3511e262a3b13df38ddbe0b3136f291ac9e
2012-11-21re-base on ALv2 code. Includes:Michael Meeks
Patch contributed by Herbert Duerr: #i118662# remove berkeleyDB from module xmlhelp (author=orwitt) http://svn.apache.org/viewvc?view=revision&revision=1213188 #i119141# remove ISCII converter for now http://svn.apache.org/viewvc?view=revision&revision=1306246 make exceptions for cppunittester verbose http://svn.apache.org/viewvc?view=revision&revision=1174831 Patches contributed by Pedro Giffuni: Avoid some uses of non portable #!/bin/bash in shell scripts. http://svn.apache.org/viewvc?view=revision&revision=1235297 Patch contributed by Oliver-Rainer Wittmann 88652: applied patch, remove unicows deps http://svn.apache.org/viewvc?view=revision&revision=1177585 drop OS/2 code, remove in-line assembler ARM atomics, and obsolete armarch header.
2012-11-20sal, cppuhelper, udkapi, offapi: s/@since 3.7/@since 4.0/Michael Stahl
Change-Id: Iefbe31af8d6ec421c6006423b6ee3a6375e3d453
2012-11-17valgrind: rtl_ustr_asciil_reverseEquals_WithLength is a death trapCaolán McNamara
Change-Id: If5c4c0b59aa91ec3775e2c15c4edb57bd7ac9aa7
2012-11-15Drop obsolete includes of deprecated rtl/memory.hStephan Bergmann
Change-Id: I532558f5502898e036e01d64faa854c68e7109c9
2012-10-09Add a 'fromIndex' parameter to OUString::replaceAllNoel Grandin
This method will be needed for forthcoming String->OUStringBuffer conversions. Change-Id: I001099baaca5cd402aebcd15c031d9060286a8f9
2012-10-09mark our string classes as SAL_WARN_UNUSEDLuboš Luňák
Change-Id: I420229dea6c5b3e45cec5989897bb31654851e32
2012-10-02update string copy semantics to be undefined in a non-crashing way.Michael Meeks
Change-Id: I03bb4db5931932280e368012cbaee6bef2854dd6
2012-09-18move ostream OUString operator<< directly to ustring.hxxLuboš Luňák
It apparently works that way, so there's no need to have an #include loop. Change-Id: I58d4f0461c14637872a139f0fbfb78f2a99fe28a
2012-09-14typo: Uniocde -> UnicodeAndras Timar
Change-Id: I1befdc4c9772c4bf66ee12bf0d2d4aa303903099
2012-09-06add O(U)String::startsWith() to complement endsWith()Luboš Luňák
There's match(), with the second argument defaulting to 0, which does the same, but that's pretty non-obvious. Change-Id: Idd4de9388f53e1b5dc5d48446d1001af32c0af3d
2012-07-23Make rtl::O[U]String::isEmpty return true boolStephan Bergmann
...instead of sal_Bool, to work around MSVC warning C4805: unsafe mix of type 'sal_Bool' and type 'bool'. Change-Id: Ia3477539ccc23aa9daec49d633f023d414f2b4bf
2012-07-16allow using rtl::OUString etc. simply as OUString, without rtl::Luboš Luňák
http://lists.freedesktop.org/archives/libreoffice/2012-April/029940.html The RTL_USING #define (set by gbuild for anything that's not public API) allows to use such classes simply by their name, without having to use the namespace or do explicit using rtl::OUString (which half of the sources do anyway). Change-Id: I7edaf12cd278489cdc1d5ff782f0a86361c13c0a