summaryrefslogtreecommitdiffstats
path: root/src/corelib/io/qtextstream_p.h
Commit message (Collapse)AuthorAgeFilesLines
* Make sure all private headers in Qt Core include qglobal_p.hThiago Macieira2016-06-251-0/+1
| | | | | | | | | | | | The rule was: - if the header included qglobal.h, turn that into qglobal_p.h - otherwise, insert the #include after the "We mean it" warning qglobal_p.h currently only includes qglobal.h. Change-Id: Ib056b47dde3341ef9a52ffff13ef677e471674b7 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Add Intel copyright to files that Intel has had non-trivial contributionThiago Macieira2016-01-211-0/+1
| | | | | | | | | I wrote a script to help find the files, but I reviewed the contributions manually to be sure I wasn't claiming copyright for search & replace, adding Q_DECL_NOTHROW or adding "We mean it" headers. Change-Id: I7a9e11d7b64a4cc78e24ffff142b506368fc8842 Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
* Updated license headersJani Heikkinen2016-01-151-14/+20
| | | | | | | | | | | From Qt 5.7 -> LGPL v2.1 isn't an option anymore, see http://blog.qt.io/blog/2016/01/13/new-agreement-with-the-kde-free-qt-foundation/ Updated license headers to use new LGPL header instead of LGPL21 one (in those files which will be under LGPL v3) Change-Id: I046ec3e47b1876cd7b4b0353a576b352e3a946d9 Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
* QTextStream: use new QString::resize(int, QChar) for paddingMarc Mutz2015-12-281-3/+1
| | | | | Change-Id: I17c90ea32614c45f038f5f3386749dfa74bad438 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
* QTextStream: optimize streaming of QLatin1String and const char*Marc Mutz2015-10-231-1/+3
| | | | | | | | | | | Instead of converting the QLatin1String to a QString at the first opportunity, keep it around until it is appended to one of the internal QStrings in write(). Avoids a memory allocation per QLatin1String / const char* streamed. Change-Id: Id973a9b743e5a6696defbc4ef4ed2db1ef54e9cc Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* QTextStream: Extract Method padding() from putString()Marc Mutz2015-10-221-0/+8
| | | | | | | | | | | | | This is in preparation of adding a putString(QLatin1String) overload. To keep the change simple, I kept the construction of the padChar chain per putString() call. It probably makes sense to have a QString::resize(int, QChar) to perform the padding operation in-place. Let's leave that for another changeset. Change-Id: I9ef66b8df38117e1669fd2bece6ee180a2ce3369 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Update copyright headersJani Heikkinen2015-02-111-7/+7
| | | | | | | | | | | | | | | | | | Qt copyrights are now in The Qt Company, so we could update the source code headers accordingly. In the same go we should also fix the links to point to qt.io. Outdated header.LGPL removed (use header.LGPL21 instead) Old header.LGPL3 renamed to header.LGPL3-COMM to match actual licensing combination. New header.LGPL-COMM taken in the use file which were using old header.LGPL3 (src/plugins/platforms/android/extract.cpp) Added new header.LGPL3 containing Commercial + LGPLv3 + GPLv2 license combination Change-Id: I6f49b819a8a20cc4f88b794a8f6726d975e8ffbe Reviewed-by: Matti Paaso <matti.paaso@theqtcompany.com>
* QTextStream: stream QStrings without modifying the user contentThiago Macieira2014-12-131-2/+4
| | | | | | | | | | | | | | | | | | QTextStream::operator<< calls QTextStreamPrivate::putString, which was taking a copy of the user's string and modifying it depending on padding. That is not necessary, since we're only talking about padding. Instead, calculate the left and right paddings. For the case of "accounting padding", we move the sign (if any) to the beginning of the left padding and skip it in the data. The one side-effect I can think of is that the stream could flush in the middle of the writing operation. The debugging section had to be removed because it doesn't make sense anymore. Change-Id: I57fdbf98ec6f054f4e085f2e465de3dcbb6225ce Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
* Merge remote-tracking branch 'origin/5.4' into devOswald Buddenhagen2014-09-291-19/+11
|\ | | | | | | | | | | | | | | | | | | | | Conflicts: src/corelib/tools/qbytearray.cpp src/gui/image/qimage.cpp src/gui/image/qppmhandler.cpp src/gui/kernel/qguiapplication.cpp src/gui/painting/qpaintengine_raster.cpp Change-Id: I7c1a8e7ebdfd7f7ae767fdb932823498a7660765
| * Update license headers and add new license filesMatti Paaso2014-09-241-19/+11
| | | | | | | | | | | | | | | | | | - Renamed LICENSE.LGPL to LICENSE.LGPLv21 - Added LICENSE.LGPLv3 - Removed LICENSE.GPL Change-Id: Iec3406e3eb3f133be549092015cefe33d259a3f2 Reviewed-by: Iikka Eklund <iikka.eklund@digia.com>
* | QTextStream: add fast path for writing char and QChar.David Faure2014-09-121-0/+2
|/ | | | | | | | | | | | Avoids allocating a QString for every char being written out. The benchmark went from 5.5 ms per iteration to 0.8 ms, and from 40 million instructions to 6 million. Found using Milian Wolff's heaptrack tool. Change-Id: I1784c47b944454bc947a607a22c39d249372ed55 Reviewed-by: Adam Majer <adamm@zombino.com> Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
* Repack structs with more than one padding holeThiago Macieira2013-12-031-30/+33
| | | | | | | | | | | | | | | | | | | | | | | | Sizes gained (measured on 64-bit systems) BezierEase: shrunk 8 bytes QRegExpCharClass: shrunk 8 bytes QRegularExpressionPrivate: shrunk 8 bytes QTimeLinePrivate: shrunk 8 bytes QUtcTimeZonePrivate: shrunk 8 bytes QTextStreamPrivate: shrunk 8 bytes QDirPrivate: shrunk 8 bytes QFileDevicePrivate: shrunk 8 bytes Not done: QRegExpEngine: 18 bytes in 6 holes (you deserve high memory usage if you're still using QRegExp) QTextBoundaryFinder: 8 bytes in 2 holes (public class) QIODevicePrivate: 6 bytes in 2 holes, but there's no gain in packing QProcessPrivate: too complex and my copy is modified QThreadData: awaiting change from Marc Change-Id: I2a388b5ce17dec0dafcef18ed2e80d0379aa7d1e Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Add class QDebugStateSaver for writing QDebug operators correctlyDavid Faure2013-01-141-0/+185
Had to move QTextStreamPrivate to a private header, to be able to use its new internal Params struct from qdebug.cpp Change-Id: If28e25f27bbd04b1825a5eb3e2ef83ecad72e7b2 Reviewed-by: Olivier Goffart <ogoffart@woboq.com> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>