summaryrefslogtreecommitdiffstats
path: root/src/corelib/serialization/qtextstream.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/corelib/serialization/qtextstream.h')
-rw-r--r--src/corelib/serialization/qtextstream.h69
1 files changed, 26 insertions, 43 deletions
diff --git a/src/corelib/serialization/qtextstream.h b/src/corelib/serialization/qtextstream.h
index e69c6a67dc..7a0fc42a68 100644
--- a/src/corelib/serialization/qtextstream.h
+++ b/src/corelib/serialization/qtextstream.h
@@ -1,53 +1,21 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtCore module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2016 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
#ifndef QTEXTSTREAM_H
#define QTEXTSTREAM_H
#include <QtCore/qiodevicebase.h>
-#include <QtCore/qstring.h>
#include <QtCore/qchar.h>
#include <QtCore/qscopedpointer.h>
-#include <QtCore/qstringconverter.h>
+#include <QtCore/qstringconverter_base.h>
#include <stdio.h>
+#if 0
+// the macros around the class name throw off syncqt:
+#pragma qt_class(QTextStream)
+#endif
+
#ifdef Status
#error qtextstream.h must be included before any header file that defines Status
#endif
@@ -56,9 +24,20 @@ QT_BEGIN_NAMESPACE
class QIODevice;
class QLocale;
+class QString;
+
+#if !QT_DEPRECATED_SINCE(6, 9)
+# define QT_NO_INHERITABLE_TEXT_STREAM
+#endif
+
+#ifdef QT_NO_INHERITABLE_TEXT_STREAM
+# define QT_TEXT_STREAM_FINAL final
+#else
+# define QT_TEXT_STREAM_FINAL
+#endif
class QTextStreamPrivate;
-class Q_CORE_EXPORT QTextStream : public QIODeviceBase
+class Q_CORE_EXPORT QTextStream QT_TEXT_STREAM_FINAL : public QIODeviceBase
{
Q_DECLARE_PRIVATE(QTextStream)
@@ -95,7 +74,8 @@ public:
explicit QTextStream(QString *string, OpenMode openMode = ReadWrite);
explicit QTextStream(QByteArray *array, OpenMode openMode = ReadWrite);
explicit QTextStream(const QByteArray &array, OpenMode openMode = ReadOnly);
- virtual ~QTextStream();
+ QT6_ONLY(virtual)
+ ~QTextStream();
void setEncoding(QStringConverter::Encoding encoding);
QStringConverter::Encoding encoding() const;
@@ -153,6 +133,8 @@ public:
QTextStream &operator>>(QChar &ch);
QTextStream &operator>>(char &ch);
+ QTextStream &operator>>(char16_t &ch)
+ { QChar c; *this >> c; ch = c.unicode(); return *this; }
QTextStream &operator>>(signed short &i);
QTextStream &operator>>(unsigned short &i);
QTextStream &operator>>(signed int &i);
@@ -169,6 +151,7 @@ public:
QTextStream &operator<<(QChar ch);
QTextStream &operator<<(char ch);
+ QTextStream &operator<<(char16_t ch) { return *this << QChar(ch); }
QTextStream &operator<<(signed short i);
QTextStream &operator<<(unsigned short i);
QTextStream &operator<<(signed int i);
@@ -181,7 +164,7 @@ public:
QTextStream &operator<<(double f);
QTextStream &operator<<(const QString &s);
QTextStream &operator<<(QStringView s);
- QTextStream &operator<<(QLatin1String s);
+ QTextStream &operator<<(QLatin1StringView s);
QTextStream &operator<<(const QByteArray &array);
QTextStream &operator<<(const char *c);
QTextStream &operator<<(const void *ptr);