diff options
author | Ulf Hermann <ulf.hermann@qt.io> | 2019-10-14 15:12:02 +0200 |
---|---|---|
committer | Ulf Hermann <ulf.hermann@qt.io> | 2019-10-16 12:16:04 +0200 |
commit | 85ed676dff68b4d5cfa62112d758d80fb050594c (patch) | |
tree | e39e925a532f887cb407071f4ae56901aaa734f9 /src/corelib/serialization/qcborvalue.cpp | |
parent | 821c2eb1310e72a1123eac69ef2aab8fc52dd0aa (diff) |
Provide a feature for CBOR stream I/O
We need to turn it off in bootstrap code.
Change-Id: I826e49fbc5f6128e56f84b58d29358dd7b0b9dc5
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Diffstat (limited to 'src/corelib/serialization/qcborvalue.cpp')
-rw-r--r-- | src/corelib/serialization/qcborvalue.cpp | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/corelib/serialization/qcborvalue.cpp b/src/corelib/serialization/qcborvalue.cpp index 1b170739d2..b77cfd5c70 100644 --- a/src/corelib/serialization/qcborvalue.cpp +++ b/src/corelib/serialization/qcborvalue.cpp @@ -42,7 +42,10 @@ #include "qdatastream.h" #include "qcborarray.h" #include "qcbormap.h" + +#if QT_CONFIG(cborstream) #include "qcborstream.h" +#endif #include <qendian.h> #include <qlocale.h> @@ -758,6 +761,7 @@ QT_BEGIN_NAMESPACE using namespace QtCbor; +#if QT_CONFIG(cborstream) // in qcborstream.cpp extern void qt_cbor_stream_set_error(QCborStreamReaderPrivate *d, QCborError error); @@ -799,6 +803,7 @@ static void writeDoubleToCbor(QCborStreamWriter &writer, double d, QCborValue::E writer.append(d); } +#endif // QT_CONFIG(cborstream) static inline int typeOrder(Element e1, Element e2) { @@ -1221,6 +1226,7 @@ int QCborMap::compare(const QCborMap &other) const noexcept return compareContainer(d.data(), other.d.data()); } +#if QT_CONFIG(cborstream) static void encodeToCbor(QCborStreamWriter &writer, const QCborContainerPrivate *d, qsizetype idx, QCborValue::EncodingOptions opt) { @@ -1632,6 +1638,7 @@ void QCborContainerPrivate::decodeFromCbor(QCborStreamReader &reader) if (reader.lastError() == QCborError::NoError) reader.leaveContainer(); } +#endif // QT_CONFIG(cborstream) /*! Creates a QCborValue with byte array value \a ba. The value can later be @@ -2330,6 +2337,7 @@ QCborValueRef QCborValue::operator[](qint64 key) return { container, index }; } +#if QT_CONFIG(cborstream) /*! Decodes one item from the CBOR stream found in \a reader and returns the equivalent representation. This function is recursive: if the item is a map @@ -2567,6 +2575,7 @@ void QCborValueRef::toCbor(QCborStreamWriter &writer, QCborValue::EncodingOption { concrete().toCbor(writer, opt); } +#endif // QT_CONFIG(cborstream) void QCborValueRef::assign(QCborValueRef that, const QCborValue &other) { |