qprotobufjsonserializerimpl.cpp 5.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141
  1. /*
  2. * MIT License
  3. *
  4. * Copyright (c) 2019 Alexey Edelev <semlanik@gmail.com>
  5. *
  6. * This file is part of QtProtobuf project https://git.semlanik.org/semlanik/qtprotobuf
  7. *
  8. * Permission is hereby granted, free of charge, to any person obtaining a copy of this
  9. * software and associated documentation files (the "Software"), to deal in the Software
  10. * without restriction, including without limitation the rights to use, copy, modify,
  11. * merge, publish, distribute, sublicense, and/or sell copies of the Software, and
  12. * to permit persons to whom the Software is furnished to do so, subject to the following
  13. * conditions:
  14. *
  15. * The above copyright notice and this permission notice shall be included in all copies
  16. * or substantial portions of the Software.
  17. *
  18. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
  19. * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
  20. * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
  21. * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
  22. * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
  23. * DEALINGS IN THE SOFTWARE.
  24. */
  25. #include "qprotobufjsonserializerimpl.h"
  26. #include "qprotobufmetaobject.h"
  27. #include "qprotobufmetaproperty.h"
  28. #include <QMetaProperty>
  29. QProtobufJsonSerializerImpl::QProtobufJsonSerializerImpl()
  30. {
  31. }
  32. QByteArray QProtobufJsonSerializerImpl::serializeMessage(const QObject *object,
  33. const QtProtobuf::QProtobufMetaObject &metaObject) const
  34. {
  35. Q_UNUSED(object)
  36. Q_UNUSED(metaObject)
  37. return QByteArray();
  38. }
  39. void QProtobufJsonSerializerImpl::deserializeMessage(QObject *object, const QtProtobuf::QProtobufMetaObject &metaObject,
  40. const QByteArray &data) const
  41. {
  42. Q_UNUSED(object)
  43. Q_UNUSED(data)
  44. Q_UNUSED(metaObject)
  45. }
  46. QByteArray QProtobufJsonSerializerImpl::serializeObject(const QObject *object,
  47. const QtProtobuf::QProtobufMetaObject &metaObject,
  48. const QtProtobuf::QProtobufMetaProperty &/*metaProperty*/) const
  49. {
  50. Q_UNUSED(object)
  51. Q_UNUSED(metaObject)
  52. return QByteArray();
  53. }
  54. void QProtobufJsonSerializerImpl::deserializeObject(QObject *object,
  55. const QtProtobuf::QProtobufMetaObject &metaObject,
  56. QtProtobuf::QProtobufSelfcheckIterator &it) const
  57. {
  58. Q_UNUSED(object)
  59. Q_UNUSED(it)
  60. Q_UNUSED(metaObject)
  61. }
  62. QByteArray QProtobufJsonSerializerImpl::serializeListObject(const QObject *object,
  63. const QtProtobuf::QProtobufMetaObject &metaObject,
  64. const QtProtobuf::QProtobufMetaProperty &metaProperty) const
  65. {
  66. Q_UNUSED(object)
  67. Q_UNUSED(metaObject)
  68. Q_UNUSED(metaProperty)
  69. return QByteArray();
  70. }
  71. void QProtobufJsonSerializerImpl::deserializeListObject(QObject *object,
  72. const QtProtobuf::QProtobufMetaObject &metaObject,
  73. QtProtobuf::QProtobufSelfcheckIterator &it) const
  74. {
  75. Q_UNUSED(object)
  76. Q_UNUSED(it)
  77. Q_UNUSED(metaObject)
  78. }
  79. QByteArray QProtobufJsonSerializerImpl::serializeMapPair(const QVariant &key, const QVariant &value,
  80. const QtProtobuf::QProtobufMetaProperty &metaProperty) const
  81. {
  82. Q_UNUSED(key)
  83. Q_UNUSED(value)
  84. Q_UNUSED(metaProperty)
  85. return QByteArray();
  86. }
  87. void QProtobufJsonSerializerImpl::deserializeMapPair(QVariant &key, QVariant &value,
  88. QtProtobuf::QProtobufSelfcheckIterator &it) const
  89. {
  90. Q_UNUSED(key)
  91. Q_UNUSED(value)
  92. Q_UNUSED(it)
  93. }
  94. QByteArray QProtobufJsonSerializerImpl::serializeEnum(QtProtobuf::int64 value,
  95. const QMetaEnum &metaEnum,
  96. const QtProtobuf::QProtobufMetaProperty &metaProperty) const
  97. {
  98. Q_UNUSED(value)
  99. Q_UNUSED(metaEnum)
  100. Q_UNUSED(metaProperty)
  101. return QByteArray();
  102. }
  103. QByteArray QProtobufJsonSerializerImpl::serializeEnumList(const QList<QtProtobuf::int64> &value,
  104. const QMetaEnum &metaEnum,
  105. const QtProtobuf::QProtobufMetaProperty &metaProperty) const
  106. {
  107. Q_UNUSED(value)
  108. Q_UNUSED(metaEnum)
  109. Q_UNUSED(metaProperty)
  110. return QByteArray();
  111. }
  112. void QProtobufJsonSerializerImpl::deserializeEnum(QtProtobuf::int64 &value,
  113. const QMetaEnum &metaEnum,
  114. QtProtobuf::QProtobufSelfcheckIterator &it) const
  115. {
  116. Q_UNUSED(value)
  117. Q_UNUSED(metaEnum)
  118. Q_UNUSED(it)
  119. }
  120. void QProtobufJsonSerializerImpl::deserializeEnumList(QList<QtProtobuf::int64> &value,
  121. const QMetaEnum &metaEnum,
  122. QtProtobuf::QProtobufSelfcheckIterator &it) const
  123. {
  124. Q_UNUSED(value)
  125. Q_UNUSED(metaEnum)
  126. Q_UNUSED(it)
  127. }