summaryrefslogtreecommitdiffstats
path: root/src/corelib/tools/qstring.h
Commit message (Collapse)AuthorAgeFilesLines
* 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