summaryrefslogtreecommitdiffstats
path: root/src/corelib/serialization/qcborcommon.h
Commit message (Collapse)AuthorAgeFilesLines
* Use SPDX license identifiersLucie Gérard2022-05-161-38/+2
| | | | | | | | | | | | | Replace the current license disclaimer in files by a SPDX-License-Identifier. Files that have to be modified by hand are modified. License files are organized under LICENSES directory. Task-number: QTBUG-67283 Change-Id: Id880c92784c40f3bbde861c0d93f58151c18b9f1 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Lars Knoll <lars.knoll@qt.io> Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
* Prevent repeated instantiations of some qRegisterNormalizedMetaType<>s [1/N] ↵Marc Mutz2022-01-211-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | (QtGui) Create macros that wrap the magic developed in 7d63efc16f65f98c657caa90e0d7e9b72a879ade and apply it to all Q_DECLARE_METATYPE invocations that show up in Clang -ftime-trace for a PCH'ed QtGui build. Effects on compile times: Clang 10 -ftme-trace: $ ClangBuildAnalyzer --analyze qtgui-before.trace | head -n6 Analyzing build trace from 'qtgui-before.trace'... **** Time summary: Compilation (523 times): Parsing (frontend): 628.3 s Codegen & opts (backend): 304.5 s $ ClangBuildAnalyzer --analyze qtgui-after.trace | head -n6 Analyzing build trace from 'qtgui-after.trace'... **** Time summary: Compilation (523 times): Parsing (frontend): 546.0 s Codegen & opts (backend): 304.4 s GCC 11 time (bash builtin): before: $ time for ((i=0; i < 3; ++i)) do touch src/gui/painting/qpolygon.h ; ninja libQt6Gui.so; done real 4m13,539s user 49m24,416s sys 3m18,177s after: $ time for ((i=0; i < 3; ++i)) do touch src/gui/painting/qpolygon.h ; ninja libQt6Gui.so; done real 3m55,697s user 45m19,941s sys 3m7,370s Task-number: QTBUG-97601 Pick-to: 6.3 Change-Id: Ia8e37a58937568a7ed21cfeb4b27274deca4d53b Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* CBOR: remove the X11 True and False for goodThiago Macieira2020-11-181-1/+0
| | | | | | | | | | I don't care if you still need X11 headers. If you do, you know your workarounds. Pick-to: 5.15 Fixes: QTBUG-88591 Change-Id: If51855da004b4f3fbf43fffd1648a357eab2d865 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
* Cbor: Export the datastream operators for QCborSimpleTypeUlf Hermann2020-10-181-2/+2
| | | | | | | | Otherwise they are not available to the tests. This is exposed by making the metatype interfaces constexpr. Change-Id: I1b3214f339985f2f8ffaf0640cf51e41e92198d0 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* Automatically register data/debug stream operations in QMetaTypeLars Knoll2020-08-241-1/+1
| | | | | | | | | | | | | | | | | | | | | | And remove the old manual registration code for those operators. Add some special handling for long/ulong, as these types could be streamed as a QVariant so far, but are not directly streamable through QDataStream. [ChangeLog][QtCore][QMetaType] The QMetaType::registerStreamOperators() and QMetaType::registerDebugStreamOperator() methods have been removed. The streaming operators for a type are now automatically registered together with the type registration. This implies that the operators should be visible wherever the type is visible and being used. [ChangeLog][Behavior Incompatible Changes] Because the QDataStream and QDebug serialization operators are automatically registered with QMetaType, the declarations of those functions must be present at any point where the type is used with QMetaType and QVariant. Change-Id: I4a0732651b20319af4a8397ff90b848ca4580d99 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* Change qHash() to work with size_t instead of uintLars Knoll2020-04-091-2/+2
| | | | | | | | | | | This is required, so that QHash and QSet can hold more than 2^32 items on 64 bit platforms. The actual hashing functions for strings are still 32bit, this will be changed in a follow-up commit. Change-Id: I4372125252486075ff3a0b45ecfa818359fe103b Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* Split cborstream feature in twoUlf Hermann2019-12-121-0/+2
| | | | | | | | | | | | | | | | | | | | | Reading of Cbor streams is substantially more complicated than writing as it requires float16 support. When writing Cbor, we can just choose to always write 32bit floats, even if we could compress the numbers into 16 bits. We need Cbor writing in the bootstrap library, but we cannot easily add float16 support. Furthermore, Cbor reading is required for plugin support, but not Cbor writing. It might make sense for some users to build a custom Qt with Cbor writing disabled. Therefore, provide two features, cborstreamreader and cborstreamwriter, split up the code in cborstream.{h|cpp} into several files, and enable Cbor writing in the bootstrap library. Change-Id: I15450afb0e328a84a22ebca9379cffc4f900a75a Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Merge remote-tracking branch 'origin/5.12' into devLiang Qi2018-11-101-0/+10
|\ | | | | | | | | | | | | | | | | | | Conflicts: src/corelib/serialization/qcborcommon.h src/corelib/tools/qlocale_data_p.h tests/auto/network/ssl/qsslsocket/tst_qsslsocket.cpp Done-with: Edward Welbourne <edward.welbourne@qt.io> Change-Id: Ibed987f6d77a0294f78f67d78625237616082416
| * Add qHash(QCborTag) and qHash(QCborSimpleType)Thiago Macieira2018-11-081-0/+10
| | | | | | | | | | | | | | | | Needed in qHash(QCborValue). Change-Id: If7e743cf8476463880ccfffd155eeca91369b356 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* | Implement QDataStream operator for QCborSimpleValueJędrzej Nowacki2018-10-031-0/+5
|/ | | | | | | That allows us to remove custom handling in QMetaType. Change-Id: Ic09fb96e1a05c6897803811d70aebbc6ea6e4f2e Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* CBOR: Avoid conflicts with X11 #defines in our enumsMichael Pyne2018-07-041-0/+14
| | | | | | | | | | Since the .cpp files in the implementation don't actually include the offending X11 headers they don't need the fix. This just adjusts the headers themselves to unbreak the namespace for just long enough to declare the right enums. Change-Id: If33757aa2289f8fe7b81836f9c08b0ad4592bc32 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Metatype: make the Qt CBOR value-like types built-in meta typesThiago Macieira2018-07-041-1/+0
| | | | | | | | This change only adds them to the registry and reserves the IDs. The next commit will handle conversions. Change-Id: I56b444f9d6274221a3b7fffd150d2d49f40940c2 Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* CBOR: Add QDebug operators for the Qt CBOR value-like typesThiago Macieira2018-07-041-0/+7
| | | | | | | | | | I added a function that returns the string identifiers for QCborKnownTags and QCborSimpleType, in order to facilitate writing a QTest::toString for those types, as neither enum is part of a Q_OBJECT or Q_GADGET class. Change-Id: I56b444f9d6274221a3b7fffd150d2d26a1925c19 Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* Long live QCborStreamWriter!Thiago Macieira2018-05-271-0/+127
CBOR is the Concise Binary Object Representation, a very compact form of binary data encoding that is compatible with JSON. It was created by the IETF Constrained RESTful Environments (CoRE) WG[1] and has since been used in many new RFCs by that group, especially COSE[2], and is meant to be used alongside CoAP[3]. This API is a very simple, thin wrapper around TinyCBOR[4]. See RFC 7049 <http://tools.ietf.org/html/rfc7049>. [1] https://datatracker.ietf.org/wg/core/charter/ [2] https://tools.ietf.org/html/rfc8152 [3] https://tools.ietf.org/html/rfc7252 [4] https://github.com/intel/tinycbor Change-Id: Ia0aac2f09e9245339951ffff13c651cfeab77d3b Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>