summaryrefslogtreecommitdiffstats
path: root/src/corelib/tools/qstring.h
Commit message (Collapse)AuthorAgeFilesLines
* Update year in Nokia copyright messages.Jason McDonald2012-01-111-1/+1
| | | | | | | | | Simple search and replace. This commit doesn't touch 3rd-party files, nor translations (where the change is not so simple and will be handled in a separate commit). Change-Id: I4e48513b8078a44a8cd272326685b25338890148 Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
* make the previous change foolproofRitt Konstantin2011-06-091-0/+1
| | | | | | | | | | | | | | | in order to preserve the old behavior in a (corner) case where string was created from the raw data with a shorter lifecycle, just call QString's realloc() that will copy the data and thus guarantee it's consistence later. example: QCFString str; { QString qstr("I'm stupid"); str = QCFString(QString::fromRawData(qstr.data(), qstr.size()); } Merge-request: 2615 Reviewed-by: Denis Dzyubenko <denis.dzyubenko@nokia.com>
* Merge remote-tracking branch 'qt/4.8'Jyri Tahtela2011-05-191-5/+3
|\
| * QT_USE_QSTRINGBUILDER to fix source compatibilityOlivier Goffart2011-05-091-5/+3
| | | | | | | | | | | | | | | | | | | | | | In 4.8 we added support for using StringBuilder with QByteArray. But this is breaking source compatibility for people that used QT_USE_FAST_OPERATOR_PLUS in Qt 4.7. So we introduce a new macro Notice that QT_USE_FAST_CONCATENATION was not working without QT_USE_FAST_OPERATOR_PLUS, so we remove the checking of that macro. Reviewed-by: joao
* | Update licenseheader text in source files for qt4.8Jyri Tahtela2011-05-131-17/+17
|/ | | | | | | Updated version of LGPL and FDL licenseheaders. Apply release phase licenseheaders for all source files. Reviewed-by: Trust Me
* Fixes warningsOlivier Goffart2011-04-281-2/+2
| | | | | | | | | | In QString, it would comlain that: assuming signed overflow does not occur when assuming that (X - c) > X is always false Changing to unsigned comparison fix the warning Others are about unused variables Reviewed-by: Thiago
* Compile on Mac.Olivier Goffart2011-04-131-10/+0
| | | | | | | | Move the work around for old gcc from qstring.h to qbytearray.h Since QByteArray now also use the FAST_OPERATOR_PLUS, it also need to be undefined there. and since qstring.h includes qbytearray.h, it should be placed into qbytearray.h
* QStringBuilder: add operator += for QString and QByteArrayOlivier Goffart2011-04-061-0/+3
| | | | | | | | | | | | Optimize cases when we have. string += someString + someOtherString Avoid the allocation of one temporary string. Behaviour change: byteArray += someString + QByteArray("foo\0bar", 7) before, the array would end at foo because of the conversion to string Reviewed-by: hjk
* Merge remote branch 'origin/4.7' into qt-master-from-4.7Olivier Goffart2011-01-171-1/+1
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: examples/webkit/imageanalyzer/imageanalyzer.h examples/webkit/imageanalyzer/mainwindow.h mkspecs/unsupported/qws/linux-x86-openkode-g++/qplatformdefs.h src/corelib/io/qfsfileengine_iterator_unix.cpp src/corelib/io/qfsfileengine_iterator_win.cpp src/corelib/kernel/qcoreapplication.cpp src/network/access/qnetworkaccessdatabackend.cpp src/plugins/bearer/connman/qconnmanservice_linux.cpp src/plugins/platforms/openvglite/qwindowsurface_vglite.h src/s60installs/bwins/QtCoreu.def src/s60installs/eabi/QtCoreu.def src/s60installs/s60installs.pro tools/assistant/tools/assistant/helpviewer_qwv.h tools/qdoc3/test/qt-html-templates.qdocconf
| * Update copyright year to 2011.Jason McDonald2011-01-101-1/+1
| | | | | | | | Reviewed-by: Trust Me
* | Containers: add member-swapMarc Mutz2010-11-031-0/+1
| | | | | | | | | | | | | | Member-swap is required by the STL Sequence concept, but is also needed to write exception-safe code. Merge-request: 871 Reviewed-by: Olivier Goffart <olivier.goffart@nokia.com>
* | C++0x move operatorsOlivier Goffart2010-09-031-1/+4
| | | | | | | | | | | | | | This makes assignement faster from temporaries, as the operator is fully inline, and doesn't do any atomic operations. Reviewed-by: joao
* | Merge remote branch 'origin/4.7' into qt-master-from-4.7Olivier Goffart2010-08-301-0/+1
|\ \ | |/ | | | | | | | | | | Conflicts: qmake/generators/win32/msbuild_objectmodel.cpp qmake/generators/win32/msvc_vcxproj.cpp tests/auto/qnetworkreply/tst_qnetworkreply.cpp
| * Update comments in QString about alignment performance.Thiago Macieira2010-08-241-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | This commit makes no code change at all. Write down the conclusions from experimenting with the x86 SIMD instructions for faster string comparison routines. Long story short: we're already pretty good. The SSE4.2 string instructions are probably more useful for "implicit-length mode" (that is, the end of the string is marked by a NUL), rather than QString's "explicit-length mode".
* | Added encoding conversion functions to QStringRef.Denis Dzyubenko2010-08-241-0/+6
| | | | | | | | Reviewed-by: Olivier Goffart
* | Remove obsolete code & workarounds for unsupported versions of MS Visual C++miniak2010-08-031-8/+1
| | | | | | | | | | | | | | The minimum supported version of MS Visual C++ 2003, which is _MSC_VER 1310. Merge-request: 756 Reviewed-by: Olivier Goffart <olivier.goffart@nokia.com>
* | Merge remote branch 'origin/4.7' into qt-master-from-4.7Thiago Macieira2010-07-011-1/+1
|\ \ | |/ | | | | | | | | | | | | | | Conflicts: bin/syncqt src/gui/text/qtextlayout.cpp tools/assistant/tools/assistant/helpviewer_qwv.cpp tools/assistant/tools/assistant/helpviewer_qwv.h tools/configure/configureapp.cpp
| * Fix QString::isRightToLeft() to conform with Unicode Bidi algorithmLars Knoll2010-06-091-1/+1
| | | | | | | | | | | | | | Rules P2 and P3 demand us to ignore the LRE/LRO/RLE/RLO characters for determining the paragraph direction. Task-Number: Part of QT-3292
* | Add some convenience functions for QStringRefAnders Bakken2010-05-311-0/+46
|/ | | | | | | | | | | | | | | QStringRef was hard to use for a lot of real-world tasks since it lacked methods similar to the ones in QString for indexOf/lastIndexOf/contains/startsWith/endsWith This patch adds that functionality. I also copied the relevant test cases from QString for the new APIs and introduced a QStringRef test. Merge-request: 625 Reviewed-by: Olivier Goffart <olivier.goffart@nokia.com> Reviewed-by: ossi
* add QString::setRawData() and revive QByteArray::setRawData()Oswald Buddenhagen2010-04-291-0/+1
| | | | | this is solely for optimization purposes - saves a free()/malloc() pair each time an existing object is re-used.
* remove qt_winQString2MB() and qt_winMB2QString()Oswald Buddenhagen2010-03-111-6/+0
| | | | | | absorb qt_winQString2MB() code directly into the QTextCodec code Acked-by: thiago
* Enable QT_USE_FAST_CONCATENATION by default for compiling QtOlivier Goffart2010-02-211-0/+10
| | | | | | | | But disable it with GCC 4.0 as it is known to cause problems due to a compiler bug Reviewed-by: Joao Reviewed-by: hjk
* add QString(const QChar *) c'torOswald Buddenhagen2010-02-161-1/+2
| | | | | | | | | to complement the QString(const QChar *, int) one, which unfortunately clamps sizes below zero to zero instead of computing the length itself instead. Reviewed-by: denis Reviewed-by: joao
* add qt5 todoOswald Buddenhagen2010-02-121-1/+1
| | | | Reviewed-by: mariusSO
* Merge branch '4.6'Thiago Macieira2010-01-131-1/+1
|\ | | | | | | | | | | | | | | | | | | | | Conflicts: bin/syncqt doc/src/deployment/deployment.qdoc src/corelib/io/qfsfileengine_win.cpp src/corelib/xml/qxmlstream.cpp src/opengl/gl2paintengineex/qpaintengineex_opengl2_p.h tools/assistant/tools/assistant/centralwidget.cpp tools/linguist/lupdate/main.cpp
| * Update copyright year to 2010Jason McDonald2010-01-061-1/+1
| | | | | | | | Reviewed-by: Trust Me
* | add {QString,QByteArray,QList,QLinkedList,QHash,QMap,QVector}::isSharedWith()Oswald Buddenhagen2009-12-101-0/+1
|/ | | | | | | | | | | | | | | | these functions just compare the d pointers of two objects. this can be used to verify the validity of cached data: you keep a copy of the original data in your cache. consequently, any changes to the original data must detach, so this function reflects whether the cached data is still up-to-date. of course, this is not thread safe, as the data might change right after you check it, but that's a general problem of cache coherency which needs to be handled further up the stack. the functions are internal because the other detaching-related functions are internal as well for reasons beyond me. Reviewed-by: brad
* do not (fail to) compile qdatastream into qmake and cetestOswald Buddenhagen2009-11-131-1/+1
| | | | | for some reason, this did build on linux and windows, but symbian seems somewhat stricter.
* build lrelease bootstrappedOswald Buddenhagen2009-11-101-1/+1
| | | | | | | | needed for build-time qm generation in qt itself. the downsides are a) that the other bootstrapped tools grow by ~12kB (on x86) due to qdatastream being pulled in by qbytearray and qstring and b) that lrelease isn't l10n'd itself anymore (the latter could be fixed by building a non-qobject qtranslator).
* Fix MSVC compiler warning.Friedemann Kleint2009-11-051-1/+1
| | | | | Forward declare struct QAbstractConcatenable correctly. Reviewed-by: hjk <qtc-committer@nokia.com>
* Make QStringBuilder respect codecForCStringsHarald Fernengel2009-11-041-0/+1
| | | | | | | Now, it's a real drop-in replacement, with no known feature regressions :) Reviewed-By: hjk
* Update license headers again.Jason McDonald2009-09-091-4/+4
| | | | Reviewed-by: Trust Me
* Merge branch '4.5' into 4.6Thiago Macieira2009-08-311-13/+13
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: demos/boxes/glshaders.cpp demos/boxes/vector.h demos/embedded/fluidlauncher/pictureflow.cpp demos/embedded/fluidlauncher/pictureflow.h doc/src/desktop-integration.qdoc doc/src/distributingqt.qdoc doc/src/examples-overview.qdoc doc/src/examples.qdoc doc/src/frameworks-technologies/dbus-adaptors.qdoc doc/src/geometry.qdoc doc/src/groups.qdoc doc/src/objecttrees.qdoc doc/src/platform-notes.qdoc doc/src/plugins-howto.qdoc doc/src/qt3support.qdoc doc/src/qtdbus.qdoc doc/src/qtdesigner.qdoc doc/src/qtgui.qdoc doc/src/qtmain.qdoc doc/src/qtopengl.qdoc doc/src/qtsvg.qdoc doc/src/qtuiloader.qdoc doc/src/qundo.qdoc doc/src/richtext.qdoc doc/src/topics.qdoc src/corelib/tools/qdumper.cpp src/gui/embedded/qkbdpc101_qws.cpp src/gui/embedded/qkbdsl5000_qws.cpp src/gui/embedded/qkbdusb_qws.cpp src/gui/embedded/qkbdvr41xx_qws.cpp src/gui/embedded/qkbdyopy_qws.cpp src/gui/embedded/qmousebus_qws.cpp src/gui/embedded/qmousevr41xx_qws.cpp src/gui/embedded/qmouseyopy_qws.cpp src/gui/painting/qpaintengine_d3d.cpp src/gui/painting/qwindowsurface_d3d.cpp src/opengl/gl2paintengineex/glgc_shader_source.h src/opengl/gl2paintengineex/qglpexshadermanager.cpp src/opengl/gl2paintengineex/qglpexshadermanager_p.h src/opengl/gl2paintengineex/qglshader.cpp src/opengl/gl2paintengineex/qglshader_p.h src/opengl/util/fragmentprograms_p.h src/plugins/kbddrivers/linuxis/linuxiskbdhandler.cpp src/plugins/mousedrivers/linuxis/linuxismousehandler.cpp src/script/parser/qscript.g src/script/qscriptarray_p.h src/script/qscriptasm_p.h src/script/qscriptbuffer_p.h src/script/qscriptclass.cpp src/script/qscriptclassdata_p.h src/script/qscriptcompiler.cpp src/script/qscriptcompiler_p.h src/script/qscriptcontext.cpp src/script/qscriptcontext_p.cpp src/script/qscriptcontext_p.h src/script/qscriptcontextfwd_p.h src/script/qscriptecmaarray.cpp src/script/qscriptecmaarray_p.h src/script/qscriptecmaboolean.cpp src/script/qscriptecmacore.cpp src/script/qscriptecmadate.cpp src/script/qscriptecmadate_p.h src/script/qscriptecmaerror.cpp src/script/qscriptecmaerror_p.h src/script/qscriptecmafunction.cpp src/script/qscriptecmafunction_p.h src/script/qscriptecmaglobal.cpp src/script/qscriptecmaglobal_p.h src/script/qscriptecmamath.cpp src/script/qscriptecmamath_p.h src/script/qscriptecmanumber.cpp src/script/qscriptecmanumber_p.h src/script/qscriptecmaobject.cpp src/script/qscriptecmaobject_p.h src/script/qscriptecmaregexp.cpp src/script/qscriptecmaregexp_p.h src/script/qscriptecmastring.cpp src/script/qscriptecmastring_p.h src/script/qscriptengine.cpp src/script/qscriptengine_p.cpp src/script/qscriptengine_p.h src/script/qscriptenginefwd_p.h src/script/qscriptextenumeration.cpp src/script/qscriptextenumeration_p.h src/script/qscriptextqobject.cpp src/script/qscriptextqobject_p.h src/script/qscriptextvariant.cpp src/script/qscriptfunction.cpp src/script/qscriptfunction_p.h src/script/qscriptgc_p.h src/script/qscriptmember_p.h src/script/qscriptobject_p.h src/script/qscriptprettypretty.cpp src/script/qscriptprettypretty_p.h src/script/qscriptvalue.cpp src/script/qscriptvalueimpl.cpp src/script/qscriptvalueimpl_p.h src/script/qscriptvalueimplfwd_p.h src/script/qscriptvalueiteratorimpl.cpp src/script/qscriptxmlgenerator.cpp src/script/qscriptxmlgenerator_p.h tests/auto/linguist/lupdate/testdata/recursivescan/project.ui tests/auto/linguist/lupdate/testdata/recursivescan/sub/finddialog.cpp tests/auto/qkeyevent/tst_qkeyevent.cpp tools/linguist/shared/cpp.cpp
| * Update tech preview license header.Jason McDonald2009-08-311-13/+13
| | | | | | | | Reviewed-by: Trust Me
| * Update license headers.Jason McDonald2009-08-111-1/+1
| | | | | | | | Reviewed-by: Trust Me
* | Update contact URL in license headers.Jason McDonald2009-08-121-1/+1
| | | | | | | | Reviewed-by: Trust Me
* | Add QT_END_HEADER to fix compile on PowerPC Mac and make autotest pass.Volker Hilsheimer2009-07-091-0/+2
| |
* | Changed enum Qt::Uninitialized to enum Qt::InitializationMartin Smith2009-06-191-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | enum Qt::Uninitialized contains one value, which is also called Uninitialized. Because the type and the value used the same name, wherever the type Qt::Uninitialized was used in a function signature, you had to include the enum keyword. But qdoc's preprocessor doesn't like that, so you have to take the enum keyword out of the signatures. But then the compiler complains because the type and the value look the same. So I had to change the enum type name to Initialization, so the compiler can distinguish it from the value name. And qdoc likes that too.
* | Use enum Qt::Uninitialized instead of struct QString::Uninitializedhjk2009-06-181-2/+1
| | | | | | | | | | | | | | There is no BC issue as the changed constructor was introduced recently and there is no released version of Qt using it. Reviewed-by: mariusSO
* | Merge license header changes from 4.5Volker Hilsheimer2009-06-161-2/+2
|\ \ | |/
| * Update license headers as requested by the marketing department.Jason McDonald2009-06-161-2/+2
| | | | | | | | Reviewed-by: Trust Me
* | Introduce a new class QStringBuilder to speed up the creation ofhjk2009-05-281-3/+12
|/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | QString objects from smaller chunks. The QStringBuilder class: QStringBuilder uses expression templates (using the '%' operator) to postpone any actual concatenation until it is assigned to an actual QString. At that time it knows the exact sizes of all chunks, can compute the required space, allocates once a QString of appriopriate size and then copies over the chunk data one-by-one. In addition, QLatin1Literal is a drop-in replacement for QLatin1String (which we can't change for compatibility reasons) that knows its size, therefore saving a few cycles when computing the size of the resulting string. Some further saved cycles stem from inlining and reduced reference counting logic (the QString created from a QStringBuilder has typically ref count equal to 1, while QString::append() needs an extra test) Minor changes to the existing QString class: - Introduce QString constructor to create an uninitialized QString of a given size. This particular constructor is used by QStringBuilder class. - Introduce a QT_USE_FAST_CONCATENATION macro to disable the existing overloads of operator+() and helps finding the places where they are used in code. - Introduce QT_USE_FAST_OPERATOR_PLUS. This also disables the existing overloads of operator+() and creates a new templated operator+() with identical implementation of operator%(). This allows code that is compilable QT_CAST_{TO,FROM}_ASCII to use QStringBuilder almost transparently. The only case that is not covered is creating objects like QUrl that are implicitly constructible from a QString from a QStringBuilder result. This needs to be converted explicitly to a QString first, e.g. by using QUrl url(QString(QLatin1String("http://") + hostName)); Reviewed-by: MariusSO
* compile?Harald Fernengel2009-05-081-1/+1
|
* Fix reentrancy of QVector and QStringOlivier Goffart2009-05-081-1/+1
| | | | | | The d->capacity could be modified even if ref was more than 1 Reviewed-by: Marius Storm-Olsen
* Long live Qt 4.5!Lars Knoll2009-03-231-0/+1234