From 0014d81b1907621ea567ee157fc85113744a6af2 Mon Sep 17 00:00:00 2001 From: Martin Smith Date: Fri, 28 Sep 2018 10:25:36 +0200 Subject: doc: Revert to documenting the actual functions A few member functions of QCborValue and QCborValueRef were given special declarations for qdoc to see so that they could be documented as a single function, but because clang is now used to parse c++, the special declarations caused parsing errors. The declarations for qdoc are removed in this update, but the functions are still documented with a single comment by grouping the \fn commands for the similar functions together in the single comment. Change-Id: If97ee2f2bfcd045d2259a4375b31b8884eeb1072 Reviewed-by: Paul Wicking Reviewed-by: Martin Smith --- src/corelib/serialization/qcborvalue.cpp | 50 +++++++++++++++++++++++++++----- src/corelib/serialization/qcborvalue.h | 10 ------- 2 files changed, 42 insertions(+), 18 deletions(-) (limited to 'src/corelib/serialization') diff --git a/src/corelib/serialization/qcborvalue.cpp b/src/corelib/serialization/qcborvalue.cpp index 935f761585..73ac3125e4 100644 --- a/src/corelib/serialization/qcborvalue.cpp +++ b/src/corelib/serialization/qcborvalue.cpp @@ -1990,12 +1990,24 @@ QUuid QCborValue::toUuid(const QUuid &defaultValue) const return QUuid::fromRfc4122(byteData->asByteArrayView()); } -QCborArray QCborValue::toArray() const -{ - return toArray(QCborArray()); -} +/*! + \fn QCborArray QCborValue::toArray() const + \fn QCborArray QCborValue::toArray(const QCborArray &defaultValue) const + + Returns the array value stored in this QCborValue, if it is of the array + type. Otherwise, it returns \a defaultValue. + + Note that this function performs no conversion from other types to + QCborArray. + + \sa isArray(), isByteArray(), isMap(), isContainer(), toMap() + */ /*! + \fn QCborArray QCborValueRef::toArray() const + \fn QCborArray QCborValueRef::toArray(const QCborArray &defaultValue) const + \internal + Returns the array value stored in this QCborValue, if it is of the array type. Otherwise, it returns \a defaultValue. @@ -2004,6 +2016,11 @@ QCborArray QCborValue::toArray() const \sa isArray(), isByteArray(), isMap(), isContainer(), toMap() */ +QCborArray QCborValue::toArray() const +{ + return toArray(QCborArray()); +} + QCborArray QCborValue::toArray(const QCborArray &defaultValue) const { if (!isArray()) @@ -2015,12 +2032,24 @@ QCborArray QCborValue::toArray(const QCborArray &defaultValue) const return dd ? QCborArray(*dd) : defaultValue; } -QCborMap QCborValue::toMap() const -{ - return toMap(QCborMap()); -} +/*! + \fn QCborMap QCborValue::toMap() const + \fn QCborMap QCborValue::toMap(const QCborMap &defaultValue) const + + Returns the map value stored in this QCborValue, if it is of the map type. + Otherwise, it returns \a defaultValue. + + Note that this function performs no conversion from other types to + QCborMap. + + \sa isMap(), isArray(), isContainer(), toArray() + */ /*! + \fn QCborMap QCborValueRef::toMap() const + \fn QCborMap QCborValueRef::toMap(const QCborMap &defaultValue) const + \internal + Returns the map value stored in this QCborValue, if it is of the map type. Otherwise, it returns \a defaultValue. @@ -2029,6 +2058,11 @@ QCborMap QCborValue::toMap() const \sa isMap(), isArray(), isContainer(), toArray() */ +QCborMap QCborValue::toMap() const +{ + return toMap(QCborMap()); +} + QCborMap QCborValue::toMap(const QCborMap &defaultValue) const { if (!isMap()) diff --git a/src/corelib/serialization/qcborvalue.h b/src/corelib/serialization/qcborvalue.h index 0aacbbe66e..5c7f9a3791 100644 --- a/src/corelib/serialization/qcborvalue.h +++ b/src/corelib/serialization/qcborvalue.h @@ -237,16 +237,11 @@ public: QRegularExpression toRegularExpression(const QRegularExpression &defaultValue = {}) const; QUuid toUuid(const QUuid &defaultValue = {}) const; -#ifdef Q_QDOC - QCborArray toArray(const QCborArray &a = {}) const; - QCborMap toMap(const QCborMap &m = {}) const; -#else // only forward-declared, need split functions QCborArray toArray() const; QCborArray toArray(const QCborArray &defaultValue) const; QCborMap toMap() const; QCborMap toMap(const QCborMap &defaultValue) const; -#endif const QCborValue operator[](const QString &key) const; const QCborValue operator[](QLatin1String key) const; @@ -386,16 +381,11 @@ public: QUuid toUuid(const QUuid &defaultValue = {}) const { return concrete().toUuid(defaultValue); } -#ifdef Q_QDOC - QCborArray toArray(const QCborArray &a = {}) const; - QCborMap toMap(const QCborMap &m = {}) const; -#else // only forward-declared, need split functions. Implemented in qcbor{array,map}.h QCborArray toArray() const; QCborArray toArray(const QCborArray &a) const; QCborMap toMap() const; QCborMap toMap(const QCborMap &m) const; -#endif int compare(const QCborValue &other) const { return concrete().compare(other); } -- cgit v1.2.3