summaryrefslogtreecommitdiffstats
path: root/src/corelib/serialization/qcborarray.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/corelib/serialization/qcborarray.cpp')
-rw-r--r--src/corelib/serialization/qcborarray.cpp125
1 files changed, 67 insertions, 58 deletions
diff --git a/src/corelib/serialization/qcborarray.cpp b/src/corelib/serialization/qcborarray.cpp
index 2e0de4f4fc..418da317e0 100644
--- a/src/corelib/serialization/qcborarray.cpp
+++ b/src/corelib/serialization/qcborarray.cpp
@@ -1,41 +1,5 @@
-/****************************************************************************
-**
-** Copyright (C) 2018 Intel Corporation.
-** 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) 2018 Intel Corporation.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
#include "qcborarray.h"
#include "qcborvalue_p.h"
@@ -49,24 +13,30 @@ using namespace QtCbor;
\class QCborArray
\inmodule QtCore
\ingroup cbor
+ \ingroup qtserialization
\reentrant
\since 5.12
\brief The QCborArray class is used to hold an array of CBOR elements.
+ \compares strong
+ \compareswith strong QCborValueConstRef
+ \endcompareswith
+
This class can be used to hold one sequential container in CBOR (an array).
CBOR is the Concise Binary Object Representation, a very compact form of
binary data encoding that is a superset of JSON. It was created by the IETF
Constrained RESTful Environments (CoRE) WG, which has used it in many new
RFCs. It is meant to be used alongside the
- \l{https://tools.ietf.org/html/rfc7252}{CoAP protocol}.
+ \l{RFC 7252}{CoAP protocol}.
QCborArray is very similar to \l QVariantList and \l QJsonArray and its API
is almost identical to those two classes. It can also be converted to and
from those two, though there may be loss of information in some
conversions.
- \sa QCborValue, QCborMap, QJsonArray, QList
+ \sa QCborValue, QCborMap, QJsonArray, QList, {Parsing and displaying CBOR data},
+ {Serialization Converter}, {Saving and Loading a Game}
*/
/*!
@@ -476,9 +446,9 @@ bool QCborArray::contains(const QCborValue &value) const
*/
/*!
- \fn bool QCborArray::operator==(const QCborArray &other) const
+ \fn bool QCborArray::operator==(const QCborArray &lhs, const QCborArray &rhs)
- Compares this array and \a other, comparing each element in sequence, and
+ Compares \a lhs and \a rhs arrays, comparing each element in sequence, and
returns true if both arrays contains the same elements, false otherwise.
For more information on CBOR equality in Qt, see, QCborValue::compare().
@@ -488,9 +458,9 @@ bool QCborArray::contains(const QCborValue &value) const
*/
/*!
- \fn bool QCborArray::operator!=(const QCborArray &other) const
+ \fn bool QCborArray::operator!=(const QCborArray &lhs, const QCborArray &rhs)
- Compares this array and \a other, comparing each element in sequence, and
+ Compares \a lhs and \a rhs arrays, comparing each element in sequence, and
returns true if the two arrays' contents are different, false otherwise.
For more information on CBOR equality in Qt, see, QCborValue::compare().
@@ -500,19 +470,58 @@ bool QCborArray::contains(const QCborValue &value) const
*/
/*!
- \fn bool QCborArray::operator<(const QCborArray &other) const
+ \fn bool QCborArray::operator<(const QCborArray &lhs, const QCborArray &rhs)
- Compares this array and \a other, comparing each element in sequence, and
- returns true if this array should be sorted before \a other, false
+ Compares \a lhs and \a rhs arrays, comparing each element in sequence, and
+ returns true if \a lhs array should be sorted before \a rhs, false
otherwise.
For more information on CBOR sorting order, see QCborValue::compare().
\sa compare(), QCborValue::operator==(), QCborMap::operator==(),
- operator==(), operator!=()
+ operator==(), operator!=(), operator<=()
*/
/*!
+ \fn bool QCborArray::operator<=(const QCborArray &lhs, const QCborArray &rhs)
+
+ Compares \a lhs and \a rhs arrays, comparing each element in sequence, and
+ returns true if \a lhs array should be sorted before \a rhs, or if both
+ arrays contains the same elements, false otherwise.
+
+ For more information on CBOR sorting order, see QCborValue::compare().
+
+ \sa compare(), QCborValue::operator==(), QCborMap::operator==(),
+ operator==(), operator!=(), operator<()
+*/
+
+/*!
+ \fn bool QCborArray::operator>(const QCborArray &lhs, const QCborArray &rhs)
+
+ Compares \a lhs and \a rhs arrays, comparing each element in sequence, and
+ returns true if \a lhs array should be sorted after \a rhs, false
+ otherwise.
+
+ For more information on CBOR sorting order, see QCborValue::compare().
+
+ \sa compare(), QCborValue::operator==(), QCborMap::operator==(),
+ operator==(), operator!=(), operator>=()
+*/
+
+/*!
+ \fn bool QCborArray::operator>=(const QCborArray &lhs, const QCborArray &rhs)
+
+ Compares \a lhs and \a rhs arrays, comparing each element in sequence, and
+ returns true if \a lhs array should be sorted after \a rhs, or if both
+ arrays contains the same elements, false otherwise.
+
+ For more information on CBOR sorting order, see QCborValue::compare().
+
+ \sa compare(), QCborValue::operator==(), QCborMap::operator==(),
+ operator==(), operator!=(), operator>()
+*/
+
+/*!
\typedef QCborArray::iterator
A synonym to QCborArray::Iterator.
@@ -809,7 +818,7 @@ void QCborArray::detach(qsizetype reserved)
*/
/*!
- \fn QCborValueRef QCborArray::Iterator::operator[](qsizetype j)
+ \fn QCborValueRef QCborArray::Iterator::operator[](qsizetype j) const
Returns a modifiable reference to the item at a position \a j steps forward
from the item pointed to by this iterator.
@@ -883,7 +892,7 @@ void QCborArray::detach(qsizetype reserved)
/*!
\fn QCborArray::Iterator &QCborArray::Iterator::operator++()
- The prefix ++ operator, \c{++it}, advances the iterator to the next item in
+ The prefix \c{++} operator, \c{++it}, advances the iterator to the next item in
the array and returns this iterator.
Calling this function on QCborArray::end() leads to undefined results.
@@ -895,14 +904,14 @@ void QCborArray::detach(qsizetype reserved)
\fn QCborArray::Iterator QCborArray::Iterator::operator++(int)
\overload
- The postfix ++ operator, \c{it++}, advances the iterator to the next item
+ The postfix \c{++} operator, \c{it++}, advances the iterator to the next item
in the array and returns an iterator to the previously current item.
*/
/*!
\fn QCborArray::Iterator &QCborArray::Iterator::operator--()
- The prefix -- operator, \c{--it}, makes the preceding item current and
+ The prefix \c{--} operator, \c{--it}, makes the preceding item current and
returns this iterator.
Calling this function on QCborArray::begin() leads to undefined results.
@@ -914,7 +923,7 @@ void QCborArray::detach(qsizetype reserved)
\fn QCborArray::Iterator QCborArray::Iterator::operator--(int)
\overload
- The postfix -- operator, \c{it--}, makes the preceding item current and
+ The postfix \c{--} operator, \c{it--}, makes the preceding item current and
returns an iterator to the previously current item.
*/
@@ -1055,7 +1064,7 @@ void QCborArray::detach(qsizetype reserved)
*/
/*!
- \fn const QCborValueRef QCborArray::ConstIterator::operator[](qsizetype j)
+ \fn QCborValueRef QCborArray::ConstIterator::operator[](qsizetype j) const
Returns the item at a position \a j steps forward from the item pointed to
by this iterator.
@@ -1123,7 +1132,7 @@ void QCborArray::detach(qsizetype reserved)
/*!
\fn QCborArray::ConstIterator &QCborArray::ConstIterator::operator++()
- The prefix ++ operator, \c{++it}, advances the iterator to the next item in
+ The prefix \c{++} operator, \c{++it}, advances the iterator to the next item in
the array and returns this iterator.
Calling this function on QCborArray::end() leads to undefined results.
@@ -1135,14 +1144,14 @@ void QCborArray::detach(qsizetype reserved)
\fn QCborArray::ConstIterator QCborArray::ConstIterator::operator++(int)
\overload
- The postfix ++ operator, \c{it++}, advances the iterator to the next item
+ The postfix \c{++} operator, \c{it++}, advances the iterator to the next item
in the array and returns an iterator to the previously current item.
*/
/*!
\fn QCborArray::ConstIterator &QCborArray::ConstIterator::operator--()
- The prefix -- operator, \c{--it}, makes the preceding item current and
+ The prefix \c{--} operator, \c{--it}, makes the preceding item current and
returns this iterator.
Calling this function on QCborArray::begin() leads to undefined results.
@@ -1154,7 +1163,7 @@ void QCborArray::detach(qsizetype reserved)
\fn QCborArray::ConstIterator QCborArray::ConstIterator::operator--(int)
\overload
- The postfix -- operator, \c{it--}, makes the preceding item current and
+ The postfix \c{--} operator, \c{it--}, makes the preceding item current and
returns an iterator to the previously current item.
*/