summaryrefslogtreecommitdiffstats
path: root/src/corelib/serialization/qcborvalue.cpp
Commit message (Collapse)AuthorAgeFilesLines
* QtCore: replace null and nullptr with \nullptr in documentationChristian Ehrlicher2019-02-181-2/+2
| | | | | | | Replace null and '\c nullptr' with \nullptr in the documentation. Change-Id: Ib9e0cfc2eb2830b213e6523773603d56180b0998 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* Merge remote-tracking branch 'origin/5.12' into 5.13Liang Qi2019-02-081-0/+12
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/android/templates/AndroidManifest.xml src/network/ssl/qsslsocket_mac.cpp src/widgets/styles/qstylesheetstyle.cpp tests/auto/corelib/kernel/qtimer/BLACKLIST tests/auto/testlib/selftests/blacklisted/tst_blacklisted.cpp tests/auto/testlib/selftests/expected_blacklisted.lightxml tests/auto/testlib/selftests/expected_blacklisted.tap tests/auto/testlib/selftests/expected_blacklisted.teamcity tests/auto/testlib/selftests/expected_blacklisted.txt tests/auto/testlib/selftests/expected_blacklisted.xml tests/auto/testlib/selftests/expected_blacklisted.xunitxml tests/auto/testlib/selftests/expected_float.tap tests/auto/testlib/selftests/expected_float.teamcity tests/auto/testlib/selftests/expected_float.txt tests/auto/testlib/selftests/expected_float.xunitxml Done-With: Christian Ehrlicher <ch.ehrlicher@gmx.de> Done-With: Edward Welbourne <edward.welbourne@qt.io> Done-With: Timur Pocheptsov <timur.pocheptsov@qt.io> Change-Id: If93cc432a56ae3ac1b6533d0028e4dc497415a52
| * qtlite: Fix build libs with -no-feature-regularexpressionMikhail Svetkin2019-01-271-0/+12
| | | | | | | | | | Change-Id: I427ff1f8f4986fbf466aba60a9d3de614c1e006f Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* | Merge remote-tracking branch 'origin/5.12' into devLiang Qi2018-11-221-2/+2
|\| | | | | | | | | | | | | | | | | | | Conflicts: src/corelib/io/qdir.cpp src/corelib/kernel/qtimer.cpp src/corelib/kernel/qtimer.h Done-With: Edward Welbourne <edward.welbourne@qt.io> Change-Id: I683d897760ec06593136d77955f8bc87fdef3f9f
| * Doc: QCbor classes: Fix \variable commandsTopi Reinio2018-11-061-2/+2
| | | | | | | | | | | | | | | | | | \variable must not include the variable type, QDoc will resolve that. This commit resolves four documentation warnings. Task-number: QTBUG-71502 Change-Id: I5e88cf66d3c3bb8f18495d5477e1271ac2cd9e74 Reviewed-by: Martin Smith <martin.smith@qt.io>
* | Fully support operator[] on QCborValue and QCborValueRefEdward Welbourne2018-11-011-9/+445
| | | | | | | | | | | | | | | | | | | | | | Added operator[] to QCborValueRef and mutating operator[] both there and in QCborValue. If the value (referenced) is not a container, it is replaced with a map and a reference into the result is returned. If the value is an array and the key is a string, negative, or more than 0xffff, the array is first converted to a map. Change-Id: Ibbc9e480fb25eb3d05547c8a1b99e762b2a68b68 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | Merge remote-tracking branch 'origin/5.12' into devLiang Qi2018-10-251-24/+7
|\| | | | | | | | | | | | | | | | | Conflicts: src/corelib/animation/qpropertyanimation.cpp src/gui/image/qicon.cpp tests/auto/widgets/itemviews/qtableview/tst_qtableview.cpp Change-Id: I3698172b7b44ebb487cb38f50fd2c4a9f8a35b21
| * Doc: Move literal code block to a separate fileCristian Maureira-Fredes2018-10-151-24/+7
| | | | | | | | | | | | | | | | | | | | | | We need to override this snippet for the documentation we generate for Qt for Python, and it is easier to have it on a separate file. Task-number: PYSIDE-801 Task-number: PYSIDE-691 Change-Id: Ideb5b6af25024279f167137d3b65660bb9c96a7e Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
* | doc: Revert to documenting the actual functionsMartin Smith2018-10-161-8/+42
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | A few member functions of QCborValue and QCborValueRef were given special declarations for qdoc to see so that they could be documented as a single function, but because clang is now used to parse c++, the special declarations caused parsing errors. The declarations for qdoc are removed in this update, but the functions are still documented with a single comment by grouping the \fn commands for the similar functions together in the single comment. Change-Id: If97ee2f2bfcd045d2259a4375b31b8884eeb1072 Reviewed-by: Paul Wicking <paul.wicking@qt.io> Reviewed-by: Martin Smith <martin.smith@qt.io>
* | Merge remote-tracking branch 'origin/5.12' into devQt Forward Merge Bot2018-10-091-0/+17
|\| | | | | | | Change-Id: I5cbfd39cf728036bbdfdeec8e8739568e0a3025b
| * Change QCborArray to pad with invalid on inserting past endEdward Welbourne2018-10-081-0/+17
| | | | | | | | | | | | | | | | | | Likewise have mutating operator[] insert an invalid entry at its target index, if beyond the end of the array. This makes it possible to fill an array from high index to low, for example. Change-Id: If71699c20e2623142214ce2c11c4d6e4a120c989 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | Implement QDataStream operator for main CBOR classesJędrzej Nowacki2018-10-031-1/+21
|/ | | | | | Change-Id: Ib3b68b1963625432c68d02be3bf2ec3c4baf1104 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* JSON: Add qHash functions for JSON and CBOR typesUlf Hermann2018-08-271-0/+47
| | | | | | | This way we can easily use them as keys in QHash and QSet. Change-Id: Ie744c3b5ad1176ba2ab035c7e650af483757a0c9 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* qdoc: Fix remaining qdoc warnings for QCborxxx classesMartin Smith2018-08-171-1/+11
| | | | | | | | | | Several \fn commands are added for functions and operators that were not documented. A few qdoc warnings remain in qcborstream.cpp, but these are because an enum class was used, and qdoc doesn't yet handle those correctly all the time. Change-Id: I02a740c595e36c1b383af242c2a6419d1f37b135 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* QCborValue: move the toDiagnosticNotation() function to its own fileThiago Macieira2018-07-301-225/+0
| | | | | | | | | | If we ever need to add QCborValue to the bootstrap library, it's unlikely that we'll need this part. And by splitting it, I can make the code handle more cases, that hadn't been properly handled before. Change-Id: I2f630efbbce54f14bfa9fffd154160c0ad893695 Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* CBOR: Use "noexcept" directlyThiago Macieira2018-07-141-6/+6
| | | | | | | | | | | All supported compilers support it. Doing this just for the new API. We should do it throughout Qt, but only if it won't interfere with the header review. Change-Id: Id59bdd8f1a804b809e22fffd153f9254688e5152 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* QCborValue/QDebug: restore decimal state after hexThiago Macieira2018-07-141-1/+1
| | | | | | | | | | Found by Coverity: >>> CID 190746: API usage errors (STREAM_FORMAT_STATE) >>> Changing format state of stream "dbg" for category basefield without later restoring it. Change-Id: If48c5c2e920c433298f1fffd153f74f9bbe7ef29 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* QCborArray & Map: implement move semanticsThiago Macieira2018-07-051-7/+29
| | | | | | | | | | | There isn't a lot of efficiency gain, since QCborValue was already refcounted. This saves two atomic operations and an out-of-line call. In the case of QCborValueRef (which includes QCborMap), because we reset the container pointer in inline code, the call to QCborValue::dispose() is also suppressed. Change-Id: Icc2c231dc2c44abdb087fffd1533eaba7a9c70fa Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* QCborValue: refactor extended types so isTag() is trueThiago Macieira2018-07-051-54/+25
| | | | | | | | | | | | | This makes QCborValue more future compatible, as code written today for tags that QCborValue does not recognize will continue to work if QCborValue gains support for it in the future. This change also obviates the need for reinterpretAsTag(), which I had not written unit tests for as I knew this change was coming. Change-Id: I052407b777ec43f78378fffd15302bdc34f66755 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* QCborArray & Map: implement efficient take() / extract()Thiago Macieira2018-07-041-0/+23
| | | | | | | | | | | | Questions: 1) should QCborMap::extract return value_type (a pair) instead of just the value? 2) should the both return the iterator to the next element too, like erase()? Change-Id: I052407b777ec43f78378fffd15302a9c14468db3 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* CBOR: Add QDebug operators for the Qt CBOR value-like typesThiago Macieira2018-07-041-0/+57
| | | | | | | | | | 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>
* QCborValue: store US-ASCII strings as 8-bitThiago Macieira2018-06-181-0/+19
| | | | | | | | | | | | They're easy to convert back to UTF-16, their length is the same, they occupy half the memory and they're easy to encode into CBOR (no transformation necessary). The code was copied from QJsonPrivate::Latin1String::operator=(). Change-Id: I56b444f9d6274221a3b7fffd150c52bcb6c97f37 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* QCborValue: fix warning about shadowing membersThiago Macieira2018-06-181-3/+6
| | | | | | | | | | | qcborvalue.h:145:9: error: declaration of 'taggedValue' shadows a member of 'this' [-Werror=shadow] Newer versions of GCC don't warn for variable shadowing a member function. Task-number: QTBUG-68889 Change-Id: I6efb28c3145047559ec0fffd153857b856267d6d Reviewed-by: Liang Qi <liang.qi@qt.io>
* Long live DOM API for CBOR!Thiago Macieira2018-06-081-0/+2550
This is very similar to QJsonDocument, but there's no QCborDocument. QCborValue is that. [ChangeLog][QtCore] Added QCborValue, QCborArray and QCborMap, classes that permit DOM-like access to CBOR data. The API is similar to QJsonValue, QJsonArray and QJsonObject, respectively. Change-Id: I9741f017961b410c910dfffd14ffca50dd8ef3ba Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>