CBOR: Add missing clear() methods to the two container classes
Change-Id: Id59bdd8f1a804b809e22fffd153fd5174b58014d Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
This commit is contained in:
parent
8d3b9841e1
commit
2dca4ef19c
@ -185,12 +185,22 @@ qsizetype QCborArray::size() const noexcept
|
||||
return d ? d->elements.size() : 0;
|
||||
}
|
||||
|
||||
/*!
|
||||
Empties this array.
|
||||
|
||||
\sa isEmpty()
|
||||
*/
|
||||
void QCborArray::clear()
|
||||
{
|
||||
d.reset();
|
||||
}
|
||||
|
||||
/*!
|
||||
\fn bool QCborArray::isEmpty() const
|
||||
|
||||
Returns true if this QCborArray is empty (that is if size() is 0).
|
||||
|
||||
\sa size()
|
||||
\sa size(), clear()
|
||||
*/
|
||||
|
||||
/*!
|
||||
|
@ -180,6 +180,7 @@ public:
|
||||
|
||||
qsizetype size() const noexcept;
|
||||
bool isEmpty() const { return size() == 0; }
|
||||
void clear();
|
||||
|
||||
QCborValue at(qsizetype i) const;
|
||||
QCborValue first() const { return at(0); }
|
||||
|
@ -270,7 +270,7 @@ QCborMap &QCborMap::operator=(const QCborMap &other) noexcept
|
||||
|
||||
Returns true if this map is empty (that is, size() is 0).
|
||||
|
||||
\sa size()
|
||||
\sa size(), clear()
|
||||
*/
|
||||
|
||||
/*!
|
||||
@ -283,6 +283,16 @@ qsizetype QCborMap::size() const noexcept
|
||||
return d ? d->elements.size() / 2 : 0;
|
||||
}
|
||||
|
||||
/*!
|
||||
Empties this map.
|
||||
|
||||
\sa isEmpty()
|
||||
*/
|
||||
void QCborMap::clear()
|
||||
{
|
||||
d.reset();
|
||||
}
|
||||
|
||||
/*!
|
||||
Returns a list of all keys in this map.
|
||||
|
||||
|
@ -184,6 +184,7 @@ public:
|
||||
|
||||
qsizetype size() const noexcept Q_DECL_PURE_FUNCTION;
|
||||
bool isEmpty() const { return size() == 0; }
|
||||
void clear();
|
||||
QVector<QCborValue> keys() const;
|
||||
|
||||
QCborValue value(qint64 key) const
|
||||
|
Loading…
Reference in New Issue
Block a user