summaryrefslogtreecommitdiffstats
path: root/src/corelib/tools/qstring.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Add qt_string_normalize to do in-place Unicode normalization.Thiago Macieira2009-07-211-20/+26
| | | | | This way, we can improve QUrl parsing performance by avoiding unnecessary copies.
* Fix warnings for mingwThierry Bastian2009-07-161-2/+2
|
* Changed the implementation of the unicode text codecs to share more code ↵Denis Dzyubenko2009-07-161-84/+6
| | | | | | | | | | with qstring. The qstring unicode conversion functions used to have its own implementation, which did the same as QUtf*Codecs, so with the change all of them will share the same implementation. Reviewed-by: Thiago Macieira
* fix warnings for mingw in QtCoreThierry Bastian2009-07-151-1/+1
|
* src/corelib: Remove QT_WA and non-Unicode code paths, dropping Win9x and NT ↵miniak2009-07-011-20/+6
| | | | | | | | | | | | support Also: QString::fromUtf16() -> QString::fromWCharArray() WCHAR & TCHAR -> wchar_t LPTSTR/LPCTSTR -> LPWSTR/LPCWSTR Documentation update Merge-request: 604 Reviewed-by: Marius Storm-Olsen <marius@trolltech.com>
* Merge branch '4.5'Thiago Macieira2009-06-241-1/+1
|\ | | | | | | | | Conflicts: tests/auto/qsqldatabase/tst_databases.h
| * Fix comparison of different-sized QStringRefs.Thiago Macieira2009-06-241-1/+1
| | | | | | | | | | | | | | Two strings are only equal if they have the same size. Task-number: 256763 Reviewed-by: TrustMe
* | Changed enum Qt::Uninitialized to enum Qt::InitializationMartin Smith2009-06-191-6/+5
| | | | | | | | | | | | | | | | | | | | | | | | 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.
* | Don't initialize data that will be overwritten immediately.hjk2009-06-181-12/+6
| | | | | | | | Reviewed-by: mariusSO
* | Use enum Qt::Uninitialized instead of struct QString::Uninitializedhjk2009-06-181-1/+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
* | doc: Added explanation of QStringBuilder in QStringMartin Smith2009-06-181-0/+68
| | | | | | | | | | | | | | | | The QStringBuilder class documentation is marked \internal. A section has been added to the documentation for QString that explains how to use the reimplemented '%' operator of QStringBuilder to obtain more efficient string concatenation operations.
* | 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-0/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* | Reintroduce the unaligned-unaligned 32-bit code that I had removed out of ↵Thiago Macieira2009-05-221-16/+29
| | | | | | | | | | | | | | | | | | | | | | | | | | | | ignorance. If both pointers are out of 4-byte alignment, doing the first load will align them so we can do 32-bit comparisons. Lars's code had this before, but I misunderstood it and removed, thinking it was doing misaligned accesses. I experimented with moving the tail comparison above the 32-bit comparison to save a register, but it made things worse. Reviewed-By: Bradley T. Hughes
* | Optimise QString comparison based on the results from the benchmarkThiago Macieira2009-05-221-125/+38
| | | | | | | | Reviewed-By: Bradley T. Hughes
* | Don't use memcmp it's terribly slow.Lars Knoll2009-05-221-6/+146
|/ | | | | | | Added qMemEquals method that returns true if the two memory regions contain the same content. Reviewed-By: Thiago Macieira
* Correcting bug in QString::fromWCharArray documentationMorten Engvoldsen2009-05-121-1/+3
| | | | | | | Clearifying details about bit size of the wchar_t input and the way they are handled. Task-number:227709 Rev-by: Marius Storm-Olsen
* Fix regression in QString::replace(int, int, QChar) when string is emptyPaul Olav Tvete2009-04-151-18/+16
| | | | | | | | | | When QString::replace was optimized, this specific overload missed out on sanity checking of the arguments. Task-number: 249517 Reviewed-by: Joao Reviewed-by: hjk BT: yes
* Explicitely mentioned in the doc that the format string for qDebug,Denis Dzyubenko2009-03-301-1/+2
| | | | | | qWarning and qFatal should be in Latin1. Reviewed-by: Thiago
* Long live Qt 4.5!Lars Knoll2009-03-231-0/+8083