qprotobufjsonserializerimpl.cpp 5.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143
  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 QProtobufQProtobufMetaObject &metaObject) const
  34. {
  35. Q_UNUSED(object)
  36. Q_UNUSED(metaObject)
  37. return QByteArray();
  38. }
  39. void QProtobufJsonSerializerImpl::deserializeMessage(QObject *object, const QProtobufQProtobufMetaObject &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 QProtobufQProtobufMetaObject &metaObject,
  48. const QProtobufQProtobufMetaProperty &/*metaProperty*/) const
  49. {
  50. Q_UNUSED(object)
  51. Q_UNUSED(metaObject)
  52. return QByteArray();
  53. }
  54. void QProtobufJsonSerializerImpl::deserializeObject(QObject *object,
  55. const QProtobufQProtobufMetaObject &metaObject,
  56. QProtobufQProtobufSelfcheckIterator &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 QProtobufQProtobufMetaObject &metaObject,
  64. const QProtobufQProtobufMetaProperty &metaProperty) const
  65. {
  66. Q_UNUSED(object)
  67. Q_UNUSED(metaObject)
  68. Q_UNUSED(metaProperty)
  69. return QByteArray();
  70. }
  71. bool QProtobufJsonSerializerImpl::deserializeListObject(QObject *object,
  72. const QProtobufQProtobufMetaObject &metaObject,
  73. QProtobufQProtobufSelfcheckIterator &it) const
  74. {
  75. Q_UNUSED(object)
  76. Q_UNUSED(it)
  77. Q_UNUSED(metaObject)
  78. return true;
  79. }
  80. QByteArray QProtobufJsonSerializerImpl::serializeMapPair(const QVariant &key, const QVariant &value,
  81. const QProtobufQProtobufMetaProperty &metaProperty) const
  82. {
  83. Q_UNUSED(key)
  84. Q_UNUSED(value)
  85. Q_UNUSED(metaProperty)
  86. return QByteArray();
  87. }
  88. bool QProtobufJsonSerializerImpl::deserializeMapPair(QVariant &key, QVariant &value,
  89. QProtobufQProtobufSelfcheckIterator &it) const
  90. {
  91. Q_UNUSED(key)
  92. Q_UNUSED(value)
  93. Q_UNUSED(it)
  94. return true;
  95. }
  96. QByteArray QProtobufJsonSerializerImpl::serializeEnum(QtProtobuf::int64 value,
  97. const QMetaEnum &metaEnum,
  98. const QProtobufQProtobufMetaProperty &metaProperty) const
  99. {
  100. Q_UNUSED(value)
  101. Q_UNUSED(metaEnum)
  102. Q_UNUSED(metaProperty)
  103. return QByteArray();
  104. }
  105. QByteArray QProtobufJsonSerializerImpl::serializeEnumList(const QList<QtProtobuf::int64> &value,
  106. const QMetaEnum &metaEnum,
  107. const QProtobufQProtobufMetaProperty &metaProperty) const
  108. {
  109. Q_UNUSED(value)
  110. Q_UNUSED(metaEnum)
  111. Q_UNUSED(metaProperty)
  112. return QByteArray();
  113. }
  114. void QProtobufJsonSerializerImpl::deserializeEnum(QtProtobuf::int64 &value,
  115. const QMetaEnum &metaEnum,
  116. QProtobufQProtobufSelfcheckIterator &it) const
  117. {
  118. Q_UNUSED(value)
  119. Q_UNUSED(metaEnum)
  120. Q_UNUSED(it)
  121. }
  122. void QProtobufJsonSerializerImpl::deserializeEnumList(QList<QtProtobuf::int64> &value,
  123. const QMetaEnum &metaEnum,
  124. QProtobufQProtobufSelfcheckIterator &it) const
  125. {
  126. Q_UNUSED(value)
  127. Q_UNUSED(metaEnum)
  128. Q_UNUSED(it)
  129. }