summaryrefslogtreecommitdiffstats
path: root/src/corelib/serialization/qdatastream.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/corelib/serialization/qdatastream.cpp')
-rw-r--r--src/corelib/serialization/qdatastream.cpp49
1 files changed, 49 insertions, 0 deletions
diff --git a/src/corelib/serialization/qdatastream.cpp b/src/corelib/serialization/qdatastream.cpp
index df286085bc4..3026e554bf3 100644
--- a/src/corelib/serialization/qdatastream.cpp
+++ b/src/corelib/serialization/qdatastream.cpp
@@ -1025,6 +1025,31 @@ QDataStream &QDataStream::operator>>(char *&s)
return readBytes(s, len);
}
+/*!
+ \overload
+
+ Reads a char from the stream into char \a chr.
+*/
+QDataStream &QDataStream::operator>>(char16_t &c)
+{
+ quint16 u;
+ *this >> u;
+ c = char16_t(u);
+ return *this;
+}
+
+/*!
+ \overload
+
+ Reads a char from the stream into char \a chr.
+*/
+QDataStream &QDataStream::operator>>(char32_t &c)
+{
+ quint32 u;
+ *this >> u;
+ c = char32_t(u);
+ return *this;
+}
/*!
Reads the buffer \a s from the stream and returns a reference to
@@ -1338,6 +1363,30 @@ QDataStream &QDataStream::operator<<(const char *s)
}
/*!
+ \overload
+ \since 6.0
+
+ Writes a character, \a c, to the stream. Returns a reference to
+ the stream
+*/
+QDataStream &QDataStream::operator<<(char16_t c)
+{
+ return *this << qint16(c);
+}
+
+/*!
+ \overload
+ \since 6.0
+
+ Writes a character, \a c, to the stream. Returns a reference to
+ the stream
+*/
+QDataStream &QDataStream::operator<<(char32_t c)
+{
+ return *this << qint32(c);
+}
+
+/*!
Writes the length specifier \a len and the buffer \a s to the
stream and returns a reference to the stream.