Fix build without features.cborstreamwriter

Change-Id: I970d21d7ac97a602a5f374f6c89cd4bfdcd847b8
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
This commit is contained in:
Tasuku Suzuki 2020-06-04 02:50:26 +09:00
parent 35608c0761
commit 832d3b482e
8 changed files with 16 additions and 0 deletions

View File

@ -1220,11 +1220,13 @@ QDebug operator<<(QDebug dbg, const QCborArray &a)
#endif
#ifndef QT_NO_DATASTREAM
#if QT_CONFIG(cborstreamwriter)
QDataStream &operator<<(QDataStream &stream, const QCborArray &value)
{
stream << value.toCborValue().toCbor();
return stream;
}
#endif
QDataStream &operator>>(QDataStream &stream, QCborArray &value)
{

View File

@ -301,7 +301,9 @@ Q_CORE_EXPORT QDebug operator<<(QDebug, const QCborArray &a);
#endif
#ifndef QT_NO_DATASTREAM
#if QT_CONFIG(cborstreamwriter)
Q_CORE_EXPORT QDataStream &operator<<(QDataStream &, const QCborArray &);
#endif
Q_CORE_EXPORT QDataStream &operator>>(QDataStream &, QCborArray &);
#endif

View File

@ -1764,11 +1764,13 @@ QDebug operator<<(QDebug dbg, const QCborMap &m)
#endif
#ifndef QT_NO_DATASTREAM
#if QT_CONFIG(cborstreamwriter)
QDataStream &operator<<(QDataStream &stream, const QCborMap &value)
{
stream << value.toCborValue().toCbor();
return stream;
}
#endif
QDataStream &operator>>(QDataStream &stream, QCborMap &value)
{

View File

@ -357,7 +357,9 @@ Q_CORE_EXPORT QDebug operator<<(QDebug, const QCborMap &m);
#endif
#ifndef QT_NO_DATASTREAM
#if QT_CONFIG(cborstreamwriter)
Q_CORE_EXPORT QDataStream &operator<<(QDataStream &, const QCborMap &);
#endif
Q_CORE_EXPORT QDataStream &operator>>(QDataStream &, QCborMap &);
#endif

View File

@ -3164,11 +3164,13 @@ QDebug operator<<(QDebug dbg, QCborKnownTags tag)
#endif
#ifndef QT_NO_DATASTREAM
#if QT_CONFIG(cborstreamwriter)
QDataStream &operator<<(QDataStream &stream, const QCborValue &value)
{
stream << QCborValue(value).toCbor();
return stream;
}
#endif
QDataStream &operator>>(QDataStream &stream, QCborValue &value)
{

View File

@ -487,7 +487,9 @@ Q_CORE_EXPORT QDebug operator<<(QDebug, const QCborValue &v);
#endif
#ifndef QT_NO_DATASTREAM
#if QT_CONFIG(cborstreamwriter)
Q_CORE_EXPORT QDataStream &operator<<(QDataStream &, const QCborValue &);
#endif
Q_CORE_EXPORT QDataStream &operator>>(QDataStream &, QCborValue &);
#endif

View File

@ -337,6 +337,7 @@ bool QShaderDescription::isValid() const
|| !d->combinedImageSamplers.isEmpty() || !d->storageImages.isEmpty();
}
#if QT_CONFIG(cborstreamwriter)
/*!
\return a serialized binary version of the data in CBOR (Concise Binary
Object Representation) format.
@ -347,6 +348,7 @@ QByteArray QShaderDescription::toCbor() const
{
return QCborValue::fromJsonValue(d->makeDoc().object()).toCbor();
}
#endif
/*!
\return a serialized JSON text version of the data.

View File

@ -69,7 +69,9 @@ public:
bool isValid() const;
#if QT_CONFIG(cborstreamwriter)
QByteArray toCbor() const;
#endif
void serialize(QDataStream *stream) const;
QByteArray toJson() const;