summaryrefslogtreecommitdiffstats
path: root/src/corelib/serialization/qtextstream.h
Commit message (Collapse)AuthorAgeFilesLines
* Remove unneeded include of qfloat16.hVolker Hilsheimer2023-02-281-1/+0
| | | | | | | | Amends 5838074912905686475a2cb4ae9780c2532d424b. Pick-to: 6.5 Change-Id: Ib591aeb9ecb2f7910cd6fe50f578f283b9acd6ff Reviewed-by: Marc Mutz <marc.mutz@qt.io>
* QTextStream: make dtor non-virtual come Qt 7Marc Mutz2023-02-151-2/+18
| | | | | | | | | | | | | | | | | | | | | | | | There's no reason to treat QTextStream polymorphically: it has no virtual functions other than the dtor. So don't. Removing the vtable is BiC, so we can only do it come Qt 7, but let's warn already, and "deprecate" the virtual'ness (indirectly) by marking the class final as an opt-in. The extra macro beside the class name throws off syncqt, so add a #pragma qt_class. [ChangeLog][Deprecation Notice] Inheriting QTextStream is deprecated. QTextStream will no longer have a virtual destructor in Qt 7. If your code inherits QTextStream, port to a design that doesn't require a polymorphic QTextStream. You may define the macro QT_NO_INHERITABLE_TEXT_STREAM to mark QTextStream as final to assist you in checking for such code. This is the default if you're compiling with QT_DISABLE_DEPRECATED_UP_TO set to Qt 6.9. Fixes: QTBUG-111051 Change-Id: Ib32b8c0e49990d791cdc502bf40cb250f034404b Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* qfloat16: add QTextStream & QDebug streaming operatorsThiago Macieira2022-11-281-0/+1
| | | | | Change-Id: Ieba79baf5ac34264a988fffd172655bdcaf12a59 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
* Use SPDX license identifiersLucie Gérard2022-05-161-38/+2
| | | | | | | | | | | | | Replace the current license disclaimer in files by a SPDX-License-Identifier. Files that have to be modified by hand are modified. License files are organized under LICENSES directory. Task-number: QTBUG-67283 Change-Id: Id880c92784c40f3bbde861c0d93f58151c18b9f1 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Lars Knoll <lars.knoll@qt.io> Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
* QTextStream: complete char16_t supportMarc Mutz2022-05-041-0/+2
| | | | | | | | | | ... by providing also op>> for char16_t. [ChangeLog][QtCore][QTextStream] Added op>>(char16_t&). Change-Id: I2f6cc2b2cdacd5190d364f94c1830f6de62d3b7e Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* QTextStream: fix streaming of char16_t'sMarc Mutz2022-05-031-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | Clazy complains about all uses of QLatin1Char these days, but if one actually applies the fixit to turn out << QLatin1Char(' '); into out << u' '; the space is now streamed as an int (20), not as a space. Fix by providing an explicit char16_t overload. [ChangeLog][QtCore][QTextStream] Added op<<(char16_t). [ChangeLog][Important Behavior Changes] QTextStream streams char16_t's as QChars now instead of outputting the numeric value. If you want to preserve the old behavior, cast the char16_t to a numeric type, such as ushort or int, and stream that. This is backwards-compatible. Pick-to: 6.3 Change-Id: I42d422cdebb27d38ac1714b22ef186642ec407e7 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
* QtCore: Replace remaining uses of QLatin1String with QLatin1StringViewSona Kurazyan2022-03-261-1/+1
| | | | | | | Task-number: QTBUG-98434 Change-Id: Ib7c5fc0aaca6ef33b93c7486e99502c555bf20bc Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Marc Mutz <marc.mutz@qt.io>
* qtextstream.h: streamline includesFabian Kosmale2022-02-101-2/+2
| | | | | | | | | | | [ChangeLog][Potentially Source-Incompatible Changes] The qtextstream header no longer includes <QString>, <QStringEncoder> and <QStringDecoder>. Code which relied on the implicit inclusion of those classes might now need to include the headers explicitly. Task-number: QTBUG-97601 Change-Id: Ifb8c8452026195a772c0588dbbbc53fb51cac548 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* QTextStream: purge deprecated APIEdward Welbourne2020-08-311-37/+0
| | | | | | | All deprecated in 5.15, for removal in 6.0 Change-Id: I40415d388cfcf3e428bce3327297a775ec756eeb Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Disentangle QIODevice dependenciesLars Knoll2020-08-151-8/+10
| | | | | | | | | | | | | | | | | Move the QIODevice::OpenMode enum into a base class, so that we can remove the full QIODevice (and thus QObject) dependency from qdatastream.h and qtextstream.h. This is required so that we can include QDataStream in qmetatype.h without getting circular dependencies. As a nice side effect, QDataStream and QTextStream can now inherit QIODeviceBase and provide the OpenMode enum directly in their class scope. Change-Id: Ifa68b7b1d8d95687ed032f6c9206f92e63bfacdf Reviewed-by: Paul Wicking <paul.wicking@qt.io> Reviewed-by: Maurice Kalinowski <maurice.kalinowski@qt.io>
* Replace Qt CONSTEXPR defines with constexprAllan Sandfeld Jensen2020-08-141-2/+2
| | | | | | | | Both normal and relaxed constexpr are required by our new minimum of C++17. Change-Id: Ic028b88a2e7a6cb7d5925f3133b9d54859a81744 Reviewed-by: Sona Kurazyan <sona.kurazyan@qt.io>
* Remove more QStringRef overloads that aren't requiredLars Knoll2020-06-111-1/+0
| | | | | | | | The QStringView versions will do the job just fine :) Task-number: QTBUG-84319 Change-Id: I376b310deb27683fd98bbcc55e0f56014cacecc3 Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
* Get rid of some QTextCodec leftoversLars Knoll2020-05-141-4/+0
| | | | | | | There's no real dependency to QTextCodec in those files anymore. Change-Id: Ifaf19ab554fd108fa26095db4e2bd4a3e9ea427f Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Get rid of QTextCodec in QTextStreamLars Knoll2020-05-141-5/+0
| | | | | | | | Use QStringConverter instead. Also change the default encoding of QTextStream to utf8. Change-Id: I30682e75fe0462d1a937539f773640c83a2d82e1 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Start porting QTextStream away from QTextCodecLars Knoll2020-05-141-0/+3
| | | | | | | | | | | | As a first step add setEncoding/encoding() methods that use the QStringConverter::Encoding enum, and port all uses of setCodec()/ codec() over to the new API. Internally QTextStream still uses QTextCodec, this will be ported over to QStringConverter in a follow-up change. Change-Id: Icd764cf47b449b57f4ebd010c2dad89e6717d6c0 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Switch to using versioned deprecated macrosAllan Sandfeld Jensen2020-04-091-24/+24
| | | | | | Change-Id: I4728e6ecc7218a6c98fd3a10e50e6edd1704fb83 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Doc: Document QTestStream manipulators under the Qt namespaceTopi Reinio2020-04-071-2/+2
| | | | | | | | | | | | | The global variants of the manipulators have been deprecated in favor of the ones in the Qt namespace. However, only one set was documented (the deprecated ones). Ensure documentation for both sets is generated, and link to the Qt:: manipulators in QTextStream documentation. Fixes: QTBUG-82532 Change-Id: I430d15f6d9a34411d1d7265031249e600f6874ef Reviewed-by: Kai Koehne <kai.koehne@qt.io>
* Mark the old style unprefixed stream functions deprecatedAllan Sandfeld Jensen2019-12-161-12/+30
| | | | | | | | Requires a third definition for the source-compatible but deprecated version. Change-Id: I260ae79f4547f99eed701b10e0b25222f81cd5ff Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Disable Clang warning for 'using namespace' in qtextstream.hJüri Valdmann2019-10-251-0/+3
| | | | | | | | | This header file intentionally puts a 'using namespace' into the global namespace, the artful cleverness of which Clang doesn't properly appreciate. Teach Clang a lesson by disabling the warning. Change-Id: I9754ac5fc9d4c53654854082e1145d8b5fef186d Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
* Replace Q_DECL_NOEXCEPT with noexcept in corelibAllan Sandfeld Jensen2019-04-031-2/+2
| | | | | | | In preparation of Qt6 move away from pre-C++11 macros. Change-Id: I44126693c20c18eca5620caab4f7e746218e0ce3 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Clean up QTextStream functionsAllan Sandfeld Jensen2019-03-231-0/+19
| | | | | | | | | They are the only Qt symbols neither prefixed with q or with the Qt namespace. This changes preserves source and binary compatibility while making it possible to define conflicting symbols. Change-Id: I6d4181206e63faa922fa0c8b644e0a4b88826a97 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* Merge remote-tracking branch 'origin/5.11' into 5.12Liang Qi2018-11-091-1/+1
|\ | | | | | | | | | | | | | | | | | | Conflicts: .qmake.conf qmake/Makefile.unix src/gui/text/qtextdocument.cpp src/gui/text/qtextdocument.h Change-Id: Iba26da0ecbf2aa4ff4b956391cfb373f977f88c9
| * Modernize the "textcodec" featureLiang Qi2018-11-071-1/+1
| | | | | | | | | | | | | | | | | | Also clean up QTextCodec usage in qmake build and some includes of qtextcodec.h. Change-Id: I0475b82690024054add4e85a8724c8ea3adcf62a Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
* | Add QTextStream operators for QStringViewFriedemann Kleint2018-07-201-0/+1
|/ | | | | Change-Id: I72d597fa21521a04b7f7c0e41bd45ee9dabb6222 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Create corelib/serialization and move existing file formats into itThiago Macieira2018-01-261-0/+287
This is in preparation to adding CBOR support. We don't need yet another dir for CBOR and placing it in src/corelib/json is just wrong. Change-Id: I9741f017961b410c910dfffd14ffb9d870340fa6 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io> Reviewed-by: Lars Knoll <lars.knoll@qt.io>