diff options
Diffstat (limited to 'src/corelib/serialization')
-rw-r--r-- | src/corelib/serialization/qcborcommon.cpp | 4 | ||||
-rw-r--r-- | src/corelib/serialization/qcbormap.cpp | 2 | ||||
-rw-r--r-- | src/corelib/serialization/qcborstreamreader.cpp | 2 | ||||
-rw-r--r-- | src/corelib/serialization/qdatastream.cpp | 8 | ||||
-rw-r--r-- | src/corelib/serialization/qxmlstream.cpp | 2 | ||||
-rw-r--r-- | src/corelib/serialization/qxmlutils.cpp | 15 | ||||
-rw-r--r-- | src/corelib/serialization/qxmlutils_p.h | 2 |
7 files changed, 19 insertions, 16 deletions
diff --git a/src/corelib/serialization/qcborcommon.cpp b/src/corelib/serialization/qcborcommon.cpp index a4c450c9af..f410be0376 100644 --- a/src/corelib/serialization/qcborcommon.cpp +++ b/src/corelib/serialization/qcborcommon.cpp @@ -145,7 +145,7 @@ QDataStream &operator>>(QDataStream &ds, QCborSimpleType &st) \value PositiveBignum A positive number of arbitrary length, encoded as a byte array in network byte order. For example, the number 2\sup{64} is represented by a byte array containing the byte value 0x01 followed by 8 zero bytes. - \value NegativeBignum A negative number of arbirary length, encoded as the absolute value + \value NegativeBignum A negative number of arbitrary length, encoded as the absolute value of that number, minus one. For example, a byte array containing byte value 0x02 followed by 8 zero bytes represents the number -2\sup{65} - 1. @@ -230,7 +230,7 @@ QDataStream &operator>>(QDataStream &ds, QCborSimpleType &st) element. \value UnexpectedBreak The CBOR stream contains a Break where it is not allowed (data is corrupt and the error is not recoverable). - \value UnknownType The CBOR stream contains an unknown/unparseable Type (data is corrupt + \value UnknownType The CBOR stream contains an unknown/unparsable Type (data is corrupt and the and the error is not recoverable). \value IllegalType The CBOR stream contains a known type in a position it is not allowed to exist (data is corrupt and the error is not recoverable). diff --git a/src/corelib/serialization/qcbormap.cpp b/src/corelib/serialization/qcbormap.cpp index d669c7bf49..a13313c213 100644 --- a/src/corelib/serialization/qcbormap.cpp +++ b/src/corelib/serialization/qcbormap.cpp @@ -1591,7 +1591,7 @@ void QCborMap::detach(qsizetype reserved) /*! \fn QCborMap::ConstIterator::value_type QCborMap::ConstIterator::operator*() const - Returns a pair containing the curent item's key and value. + Returns a pair containing the current item's key and value. \sa key(), value() */ diff --git a/src/corelib/serialization/qcborstreamreader.cpp b/src/corelib/serialization/qcborstreamreader.cpp index 993a05a337..93736ea5e8 100644 --- a/src/corelib/serialization/qcborstreamreader.cpp +++ b/src/corelib/serialization/qcborstreamreader.cpp @@ -829,7 +829,7 @@ QCborStreamReader::QCborStreamReader(const QByteArray &data) Creates a QCborStreamReader object that will parse the CBOR stream found by reading from \a device. QCborStreamReader does not take ownership of \a - device, so it must remain valid until this oject is destroyed. + device, so it must remain valid until this object is destroyed. */ QCborStreamReader::QCborStreamReader(QIODevice *device) : d(new QCborStreamReaderPrivate(device)) diff --git a/src/corelib/serialization/qdatastream.cpp b/src/corelib/serialization/qdatastream.cpp index 5082a8cb0d..314c32e158 100644 --- a/src/corelib/serialization/qdatastream.cpp +++ b/src/corelib/serialization/qdatastream.cpp @@ -138,9 +138,9 @@ QT_BEGIN_NAMESPACE \snippet code/src_corelib_io_qdatastream.cpp 4 You can select which byte order to use when serializing data. The - default setting is big endian (MSB first). Changing it to little - endian breaks the portability (unless the reader also changes to - little endian). We recommend keeping this setting unless you have + default setting is big-endian (MSB first). Changing it to little-endian + breaks the portability (unless the reader also changes to + little-endian). We recommend keeping this setting unless you have special requirements. \target raw @@ -513,7 +513,7 @@ void QDataStream::setStatus(Status status) The \a bo parameter can be QDataStream::BigEndian or QDataStream::LittleEndian. - The default setting is big endian. We recommend leaving this + The default setting is big-endian. We recommend leaving this setting unless you have special requirements. \sa byteOrder() diff --git a/src/corelib/serialization/qxmlstream.cpp b/src/corelib/serialization/qxmlstream.cpp index 7cd457ba3a..0ac5548178 100644 --- a/src/corelib/serialization/qxmlstream.cpp +++ b/src/corelib/serialization/qxmlstream.cpp @@ -3473,7 +3473,7 @@ void QXmlStreamWriter::setAutoFormatting(bool enable) /*! \since 4.4 - Returns \c true if auto formattting is enabled, otherwise \c false. + Returns \c true if auto formatting is enabled, otherwise \c false. */ bool QXmlStreamWriter::autoFormatting() const { diff --git a/src/corelib/serialization/qxmlutils.cpp b/src/corelib/serialization/qxmlutils.cpp index 01c84251fd..185c71bdbc 100644 --- a/src/corelib/serialization/qxmlutils.cpp +++ b/src/corelib/serialization/qxmlutils.cpp @@ -271,13 +271,16 @@ bool QXmlUtils::isLetter(const QChar c) \sa {http://www.w3.org/TR/REC-xml/#NT-Char}, {Extensible Markup Language (XML) 1.0 (Fourth Edition), [2] Char} */ -bool QXmlUtils::isChar(const QChar c) +bool QXmlUtils::isChar(const char32_t c) { - return (c.unicode() >= 0x0020 && c.unicode() <= 0xD7FF) - || c.unicode() == 0x0009 - || c.unicode() == 0x000A - || c.unicode() == 0x000D - || (c.unicode() >= 0xE000 && c.unicode() <= 0xFFFD); + // The valid range is defined by https://www.w3.org/TR/REC-xml/#NT-Char as following: + // Char ::= #x9 | #xA | #xD | [#x20-#xD7FF] | [#xE000-#xFFFD] | [#x10000-#x10FFFF] + return (c >= 0x0020 && c <= 0xD7FF) + || c == 0x0009 + || c == 0x000A + || c == 0x000D + || (c >= 0xE000 && c <= 0xFFFD) + || (c >= 0x10000 && c <= 0x10FFFF); } /*! diff --git a/src/corelib/serialization/qxmlutils_p.h b/src/corelib/serialization/qxmlutils_p.h index db6bddd5be..1883a1d05b 100644 --- a/src/corelib/serialization/qxmlutils_p.h +++ b/src/corelib/serialization/qxmlutils_p.h @@ -69,7 +69,7 @@ class Q_CORE_EXPORT QXmlUtils { public: static bool isEncName(QStringView encName); - static bool isChar(const QChar c); + static bool isChar(const char32_t c); static bool isNameChar(const QChar c); static bool isLetter(const QChar c); static bool isNCName(QStringView ncName); |