summaryrefslogtreecommitdiffstats
path: root/src/corelib/json/qjsonarray.h
Commit message (Collapse)AuthorAgeFilesLines
* Create corelib/serialization and move existing file formats into itThiago Macieira2018-01-261-274/+0
| | | | | | | | | This is in preparation to adding CBOR support. We don't need yet another dir for CBOR and placing it in src/corelib/json is just wrong. Change-Id: I9741f017961b410c910dfffd14ffb9d870340fa6 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io> Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Replace Q_NULLPTR with nullptr where possibleKevin Funk2017-09-191-2/+2
| | | | | | | | | | | | | Remaining uses of Q_NULLPTR are in: src/corelib/global/qcompilerdetection.h (definition and documentation of Q_NULLPTR) tests/manual/qcursor/qcursorhighdpi/main.cpp (a test executable compilable both under Qt4 and Qt5) Change-Id: If6b074d91486e9b784138f4514f5c6d072acda9a Reviewed-by: Ville Voutilainen <ville.voutilainen@qt.io> Reviewed-by: Lars Knoll <lars.knoll@qt.io> Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
* QJson*: value semantics cleanupGiuseppe D'Angelo2017-04-191-0/+22
| | | | | | | | | | | | | | | | Re-add the move operations, add a swap(), mark as shared (we're already using them in containers). QJsonValue is slightly tricky, because it has an anonymous union, which can't be easily moved in C++. Use the implementation of the copy constructor as inspiration for the move. [ChangeLog][QtCore][JSON] QJsonArray, QJsonDocument, QJsonObject and QJsonValue now have move operations and a swap() member function. Change-Id: Idfb94a93370ace96100efbd6559ef05b4c5adc39 Reviewed-by: Marc Mutz <marc.mutz@kdab.com> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Merge remote-tracking branch 'origin/5.6' into 5.7Liang Qi2016-02-181-2/+4
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | This also reverts commit 018e670a26ff5a61b949100ae080f5e654e7bee8. The change was introduced in 5.6. After the refactoring, 14960f52, in 5.7 branch and a merge, it is not needed any more. Conflicts: .qmake.conf src/corelib/io/qstandardpaths_mac.mm src/corelib/tools/qsharedpointer_impl.h tests/auto/widgets/itemviews/qlistview/tst_qlistview.cpp Change-Id: If4fdff0ebf2b9b5df9f9db93ea0022d5ee3da2a4
| * Avoid size overflows when inserting into very large JSON objectsLars Knoll2016-02-181-2/+4
| | | | | | | | | | | | | | | | | | | | | | QJson has a size limitation for arrays and objects. Make sure we don't go over that size limit and create corrupt objects when inserting data. Change-Id: I45be3caefc282d8041f38acd120b985ed4389b8c Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com> Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | Updated license headersJani Heikkinen2016-01-151-14/+20
|/ | | | | | | | | | | From Qt 5.7 -> LGPL v2.1 isn't an option anymore, see http://blog.qt.io/blog/2016/01/13/new-agreement-with-the-kde-free-qt-foundation/ Updated license headers to use new LGPL header instead of LGPL21 one (in those files which will be under LGPL v3) Change-Id: I046ec3e47b1876cd7b4b0353a576b352e3a946d9 Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
* qjsonarray: Remove a copy-ctor in Qt6Sérgio Martins2015-07-221-1/+3
| | | | | | | Makes the class trivially-copyable Change-Id: I5b8ebadf351b65344f7ee30f0e7211738fdf54e4 Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
* QtCore: Use Q_NULLPTR instead of 0 in all public headersMarc Mutz2015-07-011-2/+2
| | | | | | | | | This is in preparation of adding -Wzero-as-null-pointer-constant (or similar) to the headers check. Task-number: QTBUG-45291 Change-Id: I0cc388ef9faf45cbcf425ad0dc77db3060c104a8 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Update copyright headersJani Heikkinen2015-02-111-7/+7
| | | | | | | | | | | | | | | | | | Qt copyrights are now in The Qt Company, so we could update the source code headers accordingly. In the same go we should also fix the links to point to qt.io. Outdated header.LGPL removed (use header.LGPL21 instead) Old header.LGPL3 renamed to header.LGPL3-COMM to match actual licensing combination. New header.LGPL-COMM taken in the use file which were using old header.LGPL3 (src/plugins/platforms/android/extract.cpp) Added new header.LGPL3 containing Commercial + LGPLv3 + GPLv2 license combination Change-Id: I6f49b819a8a20cc4f88b794a8f6726d975e8ffbe Reviewed-by: Matti Paaso <matti.paaso@theqtcompany.com>
* QJsonArray::(const_)iterator: add the typedef for the pointer typeGiuseppe D'Angelo2014-11-131-0/+2
| | | | | | | | | Mandatory as per the standard iterator requirements, was causing compilation errors in the STL algorithms. Task-number: QTBUG-41628 Change-Id: Iee12a3b822383f63c07e270244fd0e145a486b95 Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* Update license headers and add new license filesMatti Paaso2014-09-241-19/+11
| | | | | | | | | - Renamed LICENSE.LGPL to LICENSE.LGPLv21 - Added LICENSE.LGPLv3 - Removed LICENSE.GPL Change-Id: Iec3406e3eb3f133be549092015cefe33d259a3f2 Reviewed-by: Iikka Eklund <iikka.eklund@digia.com>
* Add operator-> to QJson iteratorsAllan Sandfeld Jensen2014-08-251-4/+10
| | | | | | | | | | | | | The iterators for QJsonArray and QJsonObject are currently lacking an operator-> definition. Unfortunately it is not possible to do in clean way without redefining either the iterators or QJsonValueRef class. This patch instead adds two fake pointer classes that are only used to handle the operator-> return value. Task-number: QTBUG-29573 Change-Id: Ief785a6afbbedc9e89cf3b6f3958c2c755997a66 Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* Add initializer list support in QJsonArrayJędrzej Nowacki2014-07-041-0/+14
| | | | | | | | | | | | | | It allows to create a QJsonArray instance in C++ by using a similar expression to JSON. For example: QJsonArray a = {1, 2, 4}; [ChangeLog][QtCore][QtJson] QJsonArray now supports C++11 initializer lists. Task-number: QTBUG-26606 Change-Id: Icc352e518d9649d24176c89e7113d200d5c50b0d Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Added convenience methods to QJsonArray for appending QJsonValuesMatt Broadstone2014-01-161-0/+8
| | | | | | | | | | | operators for +, +=, and << were added to QJsonArray to make it easier to work with, and more closely resemble the Qt container classes [ChangeLog][QtCore][QJsonArray] Added convenience methods to QJsonArray for appending QJsonValues Change-Id: I96e0a43015f7c0f980cbbef7f20bd2085ee04795 Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* Add JSON parsing support to qmake.Morten Johan Sørvig2013-10-171-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add qjson* implementation files from corelib/json to the qmake build. Add a read-only compile mode, enabled by defining QT_JSON_READONLY. Add qmake built-in function parseJson(file, into) which parses a json file into the given variable. qmake uses a flat key -> value-list implementation for storing variables, which means that some hackery is need to represent arbitrarily nested JSON. Use a special "_KEYS_" variable for arrays and objects: Arrays: ["item1", "item2"] $${array._KEYS_} -> 0 1 2 $${array.0} -> "item1" $${array.1} -> "item2" Objects: { "key1" : "value1", "key2" : "value2" } $${object._KEYS_} -> key1 key2 $${object.key1} -> value1 $${object.key2} -> value2 Change-Id: I0aa2e4e4ae14fa25be8242bc16d3cffce32504d2 Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* Remove QT_{BEGIN,END}_HEADER macro usageSergio Ahumada2013-01-291-4/+0
| | | | | | | | | | | The macro was made empty in ba3dc5f3b56d1fab6fe37fe7ae08096d7dc68bcb and is no longer necessary or used. Discussed-on: http://lists.qt-project.org/pipermail/development/2013-January/009284.html Change-Id: Id2bb2e2cabde059305d4af5f12593344ba30f001 Reviewed-by: Laszlo Papp <lpapp@kde.org> Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@digia.com> Reviewed-by: hjk <hjk121@nokiamail.com>
* Update copyright year in Digia's license headersSergio Ahumada2013-01-181-1/+1
| | | | | Change-Id: Ic804938fc352291d011800d21e549c10acac66fb Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* Change copyrights from Nokia to DigiaIikka Eklund2012-09-221-24/+24
| | | | | | | | Change copyrights and license headers from Nokia to Digia Change-Id: If1cc974286d29fd01ec6c19dd4719a67f4c3f00e Reviewed-by: Lars Knoll <lars.knoll@digia.com> Reviewed-by: Sergio Ahumada <sergio.ahumada@digia.com>
* Fixed most qdoc errors for the json classes.Lars Knoll2012-07-201-1/+1
| | | | | | Change-Id: Ibbbdd7212f6c5e25422bbaa9ccaf4822db52222a Reviewed-by: Casper van Donderen <casper.vandonderen@nokia.com> Reviewed-by: Richard J. Moore <rich@kde.org>
* Add JSON support to the bootstrap libraryLars Knoll2012-02-151-0/+1
| | | | | | | | | | | The JSON support will get used in moc to support the creation of plugin metadata that's embedded into the plugin itself. Change-Id: I3bc52b16ca0a43bc8bf9141b450045c6183b7823 Reviewed-by: João Abecasis <joao.abecasis@nokia.com> Reviewed-by: Bradley T. Hughes <bradley.hughes@nokia.com> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Update contact address in license headers.Jason McDonald2012-01-311-1/+1
| | | | | Change-Id: I35bf916087511f26bfeb49ceb3256d9a20fbc1c0 Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
* Remove "All rights reserved" line from license headers.Jason McDonald2012-01-301-1/+1
| | | | | | | | | | As in the past, to avoid rewriting various autotests that contain line-number information, an extra blank line has been inserted at the end of the license text to ensure that this commit does not change the total number of lines in the license header. Change-Id: I311e001373776812699d6efc045b5f742890c689 Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
* Fixed includes in public headersDenis Dzyubenko2012-01-271-1/+1
| | | | | Change-Id: I360c94d41691a618f1bec97da8317c9dcee658c0 Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
* Import json support from playground/qtbinaryjsonLars Knoll2012-01-241-0/+223
This imports the JSON support for Qt 5 from playground/qtbinaryjson. It adds a fast, fully compliant json parser, a convenient C++ API, conversion to and from QVariants and a binary format for JSON that is extremely fast to use together with the C++ API. Change-Id: If9e3a21a4241d388d0abaa446b6824f9cc6edb1c Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>