summaryrefslogtreecommitdiff
path: root/include/rtl/strbuf.hxx
AgeCommit message (Collapse)Author
2019-10-18make the *StringBuffer::operator OStringView methods explicitNoel Grandin
Change-Id: Iab56f58889e01192d1e3187bf07d9d75e1ec1c94 Reviewed-on: https://gerrit.libreoffice.org/81041 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-10-17loplugin:buffereadd find stuff involving adding *StringBufferNoel Grandin
and create conversion methods on *StringBuffer to make this work Change-Id: I3cf5ee3e139826168894b46eff8ee4bcde00cb7e Reviewed-on: https://gerrit.libreoffice.org/80949 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-10-11Forward constarray-handling append/insert code to basic methodsMike Kaganski
so that we only have small number of places where to track capacity change (I need that to try to analyze where the reallocations happen most often) Change-Id: I077d5ebab845cb7e1deaac363d46e1fb2dbbb0c7 Reviewed-on: https://gerrit.libreoffice.org/80593 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2019-09-24support O(U)String::number() for fast string concatenationLuboš Luňák
When I did the fast string concatenation, I didn't add any support for number(), which simply returned a O(U)String, and so it did the extra allocation/deallocation, although that could be avoided. In order to support this, number() now returns a special temporary return type, similarly to O(U)StringConcat, which allows delaying the concatenation the same way. Also similarly, the change of the return type in some cases requires explicit cast to the actual string type. Usage of OString::getStr() is so extensive in the codebase that I actually added it to the helper class, after that it's only relatively few cases. Change-Id: Iba6e158010e1e458089698c426803052b6f46031 Reviewed-on: https://gerrit.libreoffice.org/78873 Tested-by: Jenkins Reviewed-by: Luboš Luňák <l.lunak@collabora.com>
2019-07-17Fix typoAndrea Gelmini
Change-Id: Ib5c52f937cbbe3263d39e4778ae29097be7acadc Reviewed-on: https://gerrit.libreoffice.org/75769 Tested-by: Jenkins Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2019-04-03Revert "add more append methods to *StringBuffer"Noel Grandin
This reverts commit 8cfa7f4dc00f3dd37e57917ef25c806b0e9e6e73. comment from sberg: we already have 70519a43e0d89a6b5d89859a6851f8c757c6b0c7 "Replace OUStringBuffer::appendCopy with append(std::u16string_view)" (which can be extended to OStringBuffer if needed) Change-Id: Ifcc550a8cf26ef38ad49fde8b067f53c999c9276 Reviewed-on: https://gerrit.libreoffice.org/70178 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-04-03add more append methods to *StringBufferNoel Grandin
which performs the append without needing the creation of a temporary *String Change-Id: If9ad3222275f26659db2e7df8d34f068977c4d17 Reviewed-on: https://gerrit.libreoffice.org/69826 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-08-08tdf#42949 Fix IWYU warnings in include/rtl/*Gabor Kelemen
Found with bin/find-unneeded-includes Only removal proposals are dealt with here. Change-Id: Iae997959a0ec2c9edb1c795533692ec4e579449f Reviewed-on: https://gerrit.libreoffice.org/57313 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
2017-11-11Avoid using O[U]StringConcat lvalues containing dangling refs to temporariesStephan Bergmann
...in code accidentally using auto like > auto const aURL = uri->getUriReference() + "/" > + INetURLObject::encode( > m_sEmbeddedName, INetURLObject::PART_FPATH, > INetURLObject::EncodeMechanism::All); > > uno::Reference<uno::XInterface> xDataSource(xDatabaseContext->getByName(aURL), uno::UNO_QUERY); in <https://gerrit.libreoffice.org/#/c/44569/1> "Properly construct vnd.sun.star.pkg URL" did (causing hard to debug test failures there). So make functions taking O[U]StringConcat take those by rvalue reference. Unfortunately, that also needed adaption of various functions that just forward their arguments. And some code in sc/qa/unit/ucalc_formula.cxx used CPPUNIT_ASSERT_EQUAL on OUStringConcat arguments in cases where that happened to actually compile (because the structure of the two OUStringConcats was identical), which needed adaption too (but which would arguably better use CPPUNIT_ASSERT_EQUAL_MESSAGE, anyway). Change-Id: I8994d932aaedb2a491c7c81c167e93379d4fb6e3 Reviewed-on: https://gerrit.libreoffice.org/44608 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2017-10-23loplugin:includeform: UNO API include filesStephan Bergmann
Change these back to consistently use the "..." form to include other UNO API include files, for the benefit of external users of this API. Change-Id: I9c9188e895eb3495e20a71ad44abfa2f6061fa94
2017-05-26create SAL_RETURNS_NONNULL annotationNoel Grandin
and apply it to some methods in OString and OUString Change-Id: I30e91f961b6d310799d3641f68b7ed54b3080f3a Reviewed-on: https://gerrit.libreoffice.org/38020 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-03-21Only need an OStringBuffer in number2PolyPolygonStephan Bergmann
...so that later passing the OStringBuffer's aNum[i] to createSevenSegmentPolyPolygon (taking a first parameter of type char) doesn't need to implicitly convert from sal_Unicode to char. Requires addition of some missing OStringBuffer-related function variants in rtl/math.hxx and rtl/strbuf.hxx. Change-Id: I79e6b2a791abc62b6556a6668e4411cced490c11
2017-01-09New loplugin:externvar: salStephan Bergmann
Change-Id: Iefc33784f21e7a0b88c8d6308618926e38ab8554
2017-01-05Replace side-effect--only uses of makeStringAndClear() with setLength(0)Stephan Bergmann
Change-Id: Iaf8011f1bd6a10b324653899b7f51458f7d0b68a
2016-10-12Don't allow O[U]StringBuffer in string concatenationStephan Bergmann
...as OStringBuffer b("foo"); b = "bar" + b; doesn't work as one might expect (see the mail thread starting at <https://lists.freedesktop.org/archives/libreoffice/2016-October/075464.html> "concat of OUStringBuffer". That feature was LIBO_INTERNAL_ONLY, anyway. And of the affected places, MethodDescriptor::getSignature (codemaker/source/javamaker/javatype.cxx) was the only one that would actually have benefitted. Change-Id: Ib84266f43e40c42c2e428f0c0616db8cfa90adff
2016-09-20Related cid#1371287: Work around missing OStringBuffer move semanticsStephan Bergmann
...by adding more assign op overloads instead Change-Id: I3686d6c29adc47b1a8c48be4260614fd53589c8b
2015-11-10Missing includes (for NULL)Stephan Bergmann
Change-Id: Id2359f6ff4bddb2afbc0b346e17cd858f00179e3
2015-11-10loplugin:nullptr (automatic rewrite)Stephan Bergmann
Change-Id: I1bc6c87fcd6e5e96362623be94c59be216a3b2b8
2015-06-25Revert "Revert "Generalize OUStringLiteral1""Stephan Bergmann
This reverts commit 5cba714b4d03ed54debf71534ad8c8edc383a01e, now including a workaround for <https://gcc.gnu.org/bugzilla/show_bug.cgi?id=53658> "internal compiler error -- segmentation fault." Change-Id: I31f6d9ddcb0b884134703df2b9dc1800ba0a84be
2015-06-24Revert "Generalize OUStringLiteral1"Stephan Bergmann
This reverts commit 4d4f3512db0cf0bf47c2ba1b39c3813842903ef7, at least "gcc version 4.8.3 20140627 [gcc-4_8-branch revision 212064] (SUSE Linux)" fails with "include/rtl/stringutils.hxx:175:49: internal compiler error: Segmentation fault."
2015-06-24Generalize OUStringLiteral1Stephan Bergmann
...by making all places that accept a string literal via ConstCharArrayDetector also accept an OUStringLiteral1 via ConstCharArrayDetector (which required some tweaking of the ConstCharArrayDetector internals). That removes the need for special-purpose OUStringLiteral1 overloads, and will allow OUStringLiteral1 to be used in more places. Change-Id: I370de8480e02f8423cde5677dd38479b81bccdb2
2015-06-23Avoid conversion warning in O[U]String[Buffer] constructorsMatteo Casalin
Signed-off-by: Stephan Bergmann <sbergman@redhat.com>, modifying the patch to carefully keep the undefined behavior in the already existing additions that may potentially overflow, instead of making the static_cast<sal_Int32> introduction look like end - pData->buffer will be guaranteed to fit into sal_Int32 (which it is not). Change-Id: Id2fb64dc4585dae34257be6968a8905254a3b42d
2015-02-18TyposJulien Nabet
Change-Id: I845a85e1aad4a0708f2b43f7d94606b4b5513ee4
2015-02-06sal: add back the append / insert assertions that were...Michael Stahl
...removed in 2c03d6fb053319e61ed600a3c22c4fd39da84e4d. Change-Id: I09194c55ac574bbc0f3065360b329fab8f0ba10c
2015-02-05sal: add some argument checking assertions for strings and buffersMichael Stahl
Also remove some now redundant asserts from headers. Some of these actually trigger on unit tests so are commented out. Change-Id: I07c6b2b2bd175361691a141f22eec584e3ab8f0b
2015-01-23sal: remove GCC 4.6 check, it does not claim C++11 supportMichael Stahl
Change-Id: Ica0ff6a36e64c732000ef900fa7aeafaf6da3e04
2015-01-23sal: try to fix prematurely pushed 853c2fc71a96755a9dee629fd5d0e1cff9a48034Michael Stahl
Change-Id: Id00e2579edcc9856c0fa3985e34c4a2f3e7ae5ec
2015-01-23sal: try to avoid abuse of OUStringBuffer(int) ctorMichael Stahl
... to avoid bugs like commit f0d6e0e1e21afd0adf5bd01d771b2d83d8f13a48. Change-Id: I1e41d421609e09bf62a7a04ba34f3a8e8d118fd3
2014-12-19This is not java.lang.StringBufferStephan Bergmann
Change-Id: Iea1ebb8ec79647b279fde359aa4d617d9c360e56
2014-12-19No need for RTL_FAST_STRING in addition to LIBO_INTERNAL_ONLYStephan Bergmann
Change-Id: I5514898f588b21bafceefca95e3276826cb9a882
2014-12-19No need for RTL_USING in addition to LIBO_INTERNAL_ONLYStephan Bergmann
Change-Id: Iaa65658aed6bb4abb20a4d95dc9c6caf7c1c764b
2014-11-20Introduce OStringBuffer::appendUninitializedStephan Bergmann
...corresponding to the OUStringBuffer couterpart Change-Id: I3ab03343696e6755cf1ccc470e4decc2f41d2558
2014-11-17sal: remove pointless checking for __cplusplus in public C++ headersMichael Stahl
Change-Id: Ibbcdb4a3f46b7491396a1b1c7b4cdc1af05f30d3
2014-10-20Increase assert coverage of OStringBuffer argumentsMatthew J. Francis
Change-Id: Ifd3c9919ef104909efa8964e7a0cb5e723e3331d Signed-off-by: Stephan Bergmann <sbergman@redhat.com>
2014-07-17fix spelling structur -> structureNoel Grandin
Change-Id: I7aa4a9bf72732db95a67cee368f3a83a0d71bb9c
2014-07-08'internal' is a keyword in current C++/CLITor Lillqvist
Using it as a namespace in our rtl string headers breaks compilation of cli_ure/source/climaker/climaker_emit.cxx (and other C++/CLI sources we might have that include rtl string headers). Rename it to 'libreoffice_internal'. Change-Id: Ieae68bd612b05d326d570945c1d08a54bf011852
2014-06-05sal/rtl: remove SAL_THROW macroNoel Grandin
Change-Id: I70e41f087dbe188f8fc455150480faeae2b426ed
2014-01-23Let C++ inline functions return bool instead of sal_BoolStephan Bergmann
...to improve diagnosing misuses of boolean expressions in client code (cf. compilerplugins/clang/implicitboolconversion.cxx). This change should be transparent to client code. Missing overloads of insert() for bool have been added to OStringBuffer and OUStringBuffer (which required dropping one !VALID_CONVERSION check that would now pick that overload, but would be flagged by compilerplugins/clang/pointertobool.cxx). Change-Id: I2d64cd923b8f47bfaa31e753def6515c29a3f8c9
2013-12-10Fix addition of OStringBuffer::append(bool) overloadStephan Bergmann
...and while at it, improve generated documentation. Change-Id: I6b80b19f18cd41cd01e272bbb6e91aad2f7853f3
2013-12-10Add append(bool) to OStringBuffer.Muthu Subramanian
2013-12-10Revert unnecessary code.Muthu Subramanian
2013-12-10Fix build issue - add append(bool) to strbufMuthu Subramanian
2013-11-09fdo#65108 inter-module includes <> include/rtlNorbert Thiebaud
Change-Id: Ic90a365a237aa23846f97131146a5aa2c46b5fd2
2013-10-23fixincludeguards.sh: include - the restThomas Arnhold
Change-Id: If1ee11da444a7f96f2d8668b277540da0bb4dbe9
2013-05-29Tweak commentsStephan Bergmann
(Preventing documentation of macros via @cond ... @endcond is apparently at least broken in Doxygen 1.8.3 and working in Doxygen 1.8.4.) Change-Id: I2ee582119dba2c3d27db5298786d3076921af46d
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>