qprotobufserializerimpl.cpp 5.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139
  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. void QProtobufSerializerImpl::deserializeListObject(QObject *object,
  73. const QtProtobuf::QProtobufMetaObject &metaObject,
  74. QtProtobuf::QProtobufSelfcheckIterator &it) const
  75. {
  76. deserializeObject(object, metaObject, it);
  77. }
  78. QByteArray QProtobufSerializerImpl::serializeMapPair(const QVariant &key,
  79. const QVariant &value,
  80. const QtProtobuf::QProtobufMetaProperty &metaProperty) const
  81. {
  82. Q_UNUSED(value)
  83. Q_UNUSED(metaProperty)
  84. Q_UNUSED(key)
  85. return QByteArray();
  86. }
  87. void QProtobufSerializerImpl::deserializeMapPair(QVariant &key,
  88. QVariant &value,
  89. QtProtobuf::QProtobufSelfcheckIterator &it) const
  90. {
  91. Q_UNUSED(value)
  92. Q_UNUSED(it)
  93. Q_UNUSED(key)
  94. }
  95. QByteArray QProtobufSerializerImpl::serializeEnum(QtProtobuf::int64 value,
  96. const QMetaEnum &/*metaEnum*/,
  97. const QtProtobuf::QProtobufMetaProperty &metaProperty) const
  98. {
  99. Q_UNUSED(value)
  100. Q_UNUSED(metaProperty)
  101. return QByteArray();
  102. }
  103. QByteArray QProtobufSerializerImpl::serializeEnumList(const QList<QtProtobuf::int64> &value,
  104. const QMetaEnum &/*metaEnum*/,
  105. const QtProtobuf::QProtobufMetaProperty &metaProperty) const
  106. {
  107. Q_UNUSED(value)
  108. Q_UNUSED(metaProperty)
  109. return QByteArray();
  110. }
  111. void QProtobufSerializerImpl::deserializeEnum(QtProtobuf::int64 &value,
  112. const QMetaEnum &/*metaEnum*/,
  113. QtProtobuf::QProtobufSelfcheckIterator &it) const
  114. {
  115. Q_UNUSED(value)
  116. Q_UNUSED(it)
  117. }
  118. void QProtobufSerializerImpl::deserializeEnumList(QList<QtProtobuf::int64> &value,
  119. const QMetaEnum &/*metaEnum*/,
  120. QtProtobuf::QProtobufSelfcheckIterator &it) const
  121. {
  122. Q_UNUSED(value)
  123. Q_UNUSED(it)
  124. }