qprotobufserializerimpl.cpp 5.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141
  1. /*
  2. * MIT License
  3. *
  4. * Copyright (c) 2019 Alexey Edelev <semlanik@gmail.com>, Viktor Kopp <vifactor@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 "qprotobufserializerimpl.h"
  26. #include "qprotobufmetaproperty.h"
  27. #include "qprotobufmetaobject.h"
  28. QProtobufSerializerImpl::QProtobufSerializerImpl()
  29. {
  30. }
  31. QProtobufSerializerImpl::~QProtobufSerializerImpl()
  32. {
  33. }
  34. QByteArray QProtobufSerializerImpl::serializeMessage(const QObject *object,
  35. const QtProtobuf::QProtobufMetaObject &metaObject) const
  36. {
  37. Q_UNUSED(object)
  38. Q_UNUSED(metaObject)
  39. return QByteArray();
  40. }
  41. void QProtobufSerializerImpl::deserializeMessage(QObject *object,
  42. const QtProtobuf::QProtobufMetaObject &metaObject,
  43. const QByteArray &data) const
  44. {
  45. Q_UNUSED(object)
  46. Q_UNUSED(data)
  47. Q_UNUSED(metaObject)
  48. }
  49. QByteArray QProtobufSerializerImpl::serializeObject(const QObject *object,
  50. const QtProtobuf::QProtobufMetaObject &metaObject,
  51. const QtProtobuf::QProtobufMetaProperty &metaProperty) const
  52. {
  53. Q_UNUSED(object)
  54. Q_UNUSED(metaProperty)
  55. Q_UNUSED(metaObject)
  56. return QByteArray();
  57. }
  58. void QProtobufSerializerImpl::deserializeObject(QObject *object,
  59. const QtProtobuf::QProtobufMetaObject &metaObject,
  60. QtProtobuf::QProtobufSelfcheckIterator &it) const
  61. {
  62. Q_UNUSED(object)
  63. Q_UNUSED(it)
  64. Q_UNUSED(metaObject)
  65. }
  66. QByteArray QProtobufSerializerImpl::serializeListObject(const QObject *object,
  67. const QtProtobuf::QProtobufMetaObject &metaObject,
  68. const QtProtobuf::QProtobufMetaProperty &metaProperty) const
  69. {
  70. return serializeObject(object, metaObject, metaProperty);
  71. }
  72. bool QProtobufSerializerImpl::deserializeListObject(QObject *object,
  73. const QtProtobuf::QProtobufMetaObject &metaObject,
  74. QtProtobuf::QProtobufSelfcheckIterator &it) const
  75. {
  76. deserializeObject(object, metaObject, it);
  77. return true;
  78. }
  79. QByteArray QProtobufSerializerImpl::serializeMapPair(const QVariant &key,
  80. const QVariant &value,
  81. const QtProtobuf::QProtobufMetaProperty &metaProperty) const
  82. {
  83. Q_UNUSED(value)
  84. Q_UNUSED(metaProperty)
  85. Q_UNUSED(key)
  86. return QByteArray();
  87. }
  88. bool QProtobufSerializerImpl::deserializeMapPair(QVariant &key,
  89. QVariant &value,
  90. QtProtobuf::QProtobufSelfcheckIterator &it) const
  91. {
  92. Q_UNUSED(value)
  93. Q_UNUSED(it)
  94. Q_UNUSED(key)
  95. return true;
  96. }
  97. QByteArray QProtobufSerializerImpl::serializeEnum(QtProtobuf::int64 value,
  98. const QMetaEnum &/*metaEnum*/,
  99. const QtProtobuf::QProtobufMetaProperty &metaProperty) const
  100. {
  101. Q_UNUSED(value)
  102. Q_UNUSED(metaProperty)
  103. return QByteArray();
  104. }
  105. QByteArray QProtobufSerializerImpl::serializeEnumList(const QList<QtProtobuf::int64> &value,
  106. const QMetaEnum &/*metaEnum*/,
  107. const QtProtobuf::QProtobufMetaProperty &metaProperty) const
  108. {
  109. Q_UNUSED(value)
  110. Q_UNUSED(metaProperty)
  111. return QByteArray();
  112. }
  113. void QProtobufSerializerImpl::deserializeEnum(QtProtobuf::int64 &value,
  114. const QMetaEnum &/*metaEnum*/,
  115. QtProtobuf::QProtobufSelfcheckIterator &it) const
  116. {
  117. Q_UNUSED(value)
  118. Q_UNUSED(it)
  119. }
  120. void QProtobufSerializerImpl::deserializeEnumList(QList<QtProtobuf::int64> &value,
  121. const QMetaEnum &/*metaEnum*/,
  122. QtProtobuf::QProtobufSelfcheckIterator &it) const
  123. {
  124. Q_UNUSED(value)
  125. Q_UNUSED(it)
  126. }