diff --git a/src/blackmisc/audiodevice.cpp b/src/blackmisc/audiodevice.cpp index a86da174b..61c318f06 100644 --- a/src/blackmisc/audiodevice.cpp +++ b/src/blackmisc/audiodevice.cpp @@ -3,10 +3,6 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ -/*! - \file -*/ - #include "audiodevice.h" #include "blackmisc/blackmiscfreefunctions.h" #include diff --git a/src/blackmisc/json.cpp b/src/blackmisc/json.cpp index 728f544e1..2b1002edb 100644 --- a/src/blackmisc/json.cpp +++ b/src/blackmisc/json.cpp @@ -3,10 +3,6 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ -/*! - \file -*/ - #include "json.h" namespace BlackMisc diff --git a/src/blackmisc/json.h b/src/blackmisc/json.h index 3301a675b..8a688407f 100644 --- a/src/blackmisc/json.h +++ b/src/blackmisc/json.h @@ -18,18 +18,15 @@ #include #include +/*! + * \defgroup JSON Streaming operators for JSON + */ + namespace BlackMisc { - /** - * \defgroup JSON Streaming operators for JSON - * @{ - */ - - // -> streaming for CValueObject in valueobject.h //! \name Streaming operators for QJsonValue (to value) //! \remarks JSONVALUE: QJsonValue / QJsonValueRef - //@{ template typename std::enable_if < std::is_same::value || std::is_same::value, JSONVALUE >::type const &operator>>(const JSONVALUE &json, int &value) @@ -93,10 +90,10 @@ namespace BlackMisc value = QDateTime::fromString(json.toString()); return json; } - //@} //! \brief Specialized JSON serialization for enum //! \remarks needs to be in global namespace + //! \ingroup JSON template typename std::enable_if::value, QJsonObject>::type &operator<<(QJsonObject &json, std::pair value) @@ -106,6 +103,7 @@ namespace BlackMisc } //! \brief Specialized JSON deserialization for enum + //! \ingroup JSON template typename std::enable_if < std::is_enum::value &&(std::is_same::value || std::is_same::value), JSONVALUE >::type const &operator>>(const JSONVALUE &json, ENUM &value) @@ -115,7 +113,8 @@ namespace BlackMisc } //! \name Streaming operators for QJsonArray (from value) - //@{ + //! \ingroup JSON + //! @{ QJsonArray &operator<<(QJsonArray &json, const int value); QJsonArray &operator<<(QJsonArray &json, const std::pair &value); QJsonArray &operator<<(QJsonArray &json, const qlonglong value); @@ -125,10 +124,11 @@ namespace BlackMisc QJsonArray &operator<<(QJsonArray &json, const double value); QJsonArray &operator<<(QJsonArray &json, const bool value); QJsonArray &operator<<(QJsonArray &json, const QDateTime &value); - //@} + //! @} //! \name Streaming operators for QJsonObject (from value) - //@{ + //! \ingroup JSON + //! @{ QJsonObject &operator<<(QJsonObject &json, const std::pair &value); QJsonObject &operator<<(QJsonObject &json, const std::pair &value); QJsonObject &operator<<(QJsonObject &json, const std::pair &value); @@ -138,13 +138,12 @@ namespace BlackMisc QJsonObject &operator<<(QJsonObject &json, const std::pair &value); QJsonObject &operator<<(QJsonObject &json, const std::pair &value); QJsonObject &operator<<(QJsonObject &json, const std::pair &value); - //@} - //! @} namespace Json { //! \brief Append to first JSON object (concatenate) + //! \ingroup JSON inline QJsonObject &appendJsonObject(QJsonObject &target, const QJsonObject &toBeAppended) { if (toBeAppended.isEmpty()) return target; diff --git a/src/blackmisc/tuple.h b/src/blackmisc/tuple.h index 21f84687e..4a9500928 100644 --- a/src/blackmisc/tuple.h +++ b/src/blackmisc/tuple.h @@ -135,13 +135,6 @@ namespace BlackMisc Q_UNUSED(object); return std::tuple<>(); } - static const QStringList members() - { - static_assert(std::is_void::value, // always false; is_void<> trick is just to make the condition dependent on the template parameter T - "Missing BLACK_DECLARE_TUPLE_CONVERSION macro for T"); - static QStringList members; - return members; - } static const QStringList jsonMembers() { static_assert(std::is_void::value, // always false; is_void<> trick is just to make the condition dependent on the template parameter T @@ -203,7 +196,7 @@ namespace BlackMisc /*! * \brief Convert to a JSON object - * \ingroup Tupels + * \ingroup Tuples */ template QJsonObject serializeJson(const QStringList &members, std::tuple tu) @@ -215,7 +208,7 @@ namespace BlackMisc /*! * Convert from JSON to object - * \ingroup Tupels + * \ingroup Tuples */ template void deserializeJson(const QJsonObject &json, const QStringList &members, std::tuple tu) @@ -485,11 +478,8 @@ namespace BlackMisc >> std::get<5>(tu) >> std::get<6>(tu) >> std::get<7>(tu) >> std::get<8>(tu) >> std::get<9>(tu); } - inline void deserializeJson(const QJsonObject &json, const QStringList &members, std::tuple<> tu) + inline void deserializeJson(const QJsonObject &, const QStringList &, std::tuple<>) { - Q_UNUSED(json); - Q_UNUSED(members); - Q_UNUSED(tu); } template @@ -667,9 +657,8 @@ namespace BlackMisc qHash(std::get<5>(tu)) ^ qHash(std::get<6>(tu)) ^ qHash(std::get<7>(tu)) ^ qHash(std::get<8>(tu)) ^ qHash(std::get<9>(tu)); } - inline QJsonObject serializeJson(const QStringList &members, std::tuple<>) + inline QJsonObject serializeJson(const QStringList &, std::tuple<>) { - Q_UNUSED(members); QJsonObject json; return json; } diff --git a/src/blackmisc/tuple_private.h b/src/blackmisc/tuple_private.h index 667a29a1c..f250ea2ad 100644 --- a/src/blackmisc/tuple_private.h +++ b/src/blackmisc/tuple_private.h @@ -112,8 +112,7 @@ namespace BlackMisc template static void serializeJson(QJsonObject &json, const QStringList &members, const Tu &tu) { - typedef typename std::decay < typename std::tuple_element < N - 1, Tu >::type >::type TARGET; - json << std::pair(members.at(N - 1), std::get < N - 1 > (tu)); + json << std::make_pair(members.at(N - 1), std::get < N - 1 > (tu)); TupleHelper < N - 1 >::serializeJson(json, members, tu); } @@ -138,19 +137,9 @@ namespace BlackMisc template static uint hash(const Tu &) { return 0; } template - static void serializeJson(QJsonObject &json, const QStringList &members, const Tu &tu) - { - Q_UNUSED(json); - Q_UNUSED(members); - Q_UNUSED(tu); - } + static void serializeJson(QJsonObject &, const QStringList &, const Tu &) {} template - static void deserializeJson(const QJsonObject &json, const QStringList &members, Tu &tu) - { - Q_UNUSED(json); - Q_UNUSED(members); - Q_UNUSED(tu); - } + static void deserializeJson(const QJsonObject &, const QStringList &, Tu &) {} }; #endif // Q_COMPILER_VARIADIC_TEMPLATES diff --git a/src/blackmisc/voiceroom.cpp b/src/blackmisc/voiceroom.cpp index e47cbd116..378ed8f6d 100644 --- a/src/blackmisc/voiceroom.cpp +++ b/src/blackmisc/voiceroom.cpp @@ -3,10 +3,6 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ -/*! - \file -*/ - #include "voiceroom.h" #include "blackmisc/blackmiscfreefunctions.h" #include