├── src ├── imports │ ├── jsondb │ │ ├── jsondb.json │ │ ├── qmldir │ │ ├── jsondb.pro │ │ └── plugin.h │ └── imports.pro ├── 3rdparty │ ├── 3rdparty.pro │ └── zlib │ │ ├── zlib.pri │ │ └── crc32.h ├── src.pro ├── jsonstream │ ├── jsonstream.pri │ └── jsonstream.pro ├── partition │ ├── schema │ │ ├── View.json │ │ ├── notification.json │ │ ├── RootCapability.json │ │ ├── Capability.json │ │ └── Index.json │ ├── jsondb.qrc │ ├── partition.pro │ ├── jsondbscriptengine.h │ ├── jsondbpartitionspec.h │ └── jsondbutils_p.h ├── hbtree │ ├── hbtree.pri │ └── orderedlist.cpp ├── daemon │ ├── daemon.pro │ └── jsondbsignals.h ├── client │ └── client.pro └── common │ └── jsondbsocketname_p.h ├── .tag ├── examples ├── client │ ├── client.pro │ └── chat │ │ └── chat.pro ├── examples.pro ├── declarative │ ├── partitions.json │ ├── flickr │ │ ├── content │ │ │ ├── images │ │ │ │ ├── gloss.png │ │ │ │ ├── noise.png │ │ │ │ ├── quit.png │ │ │ │ ├── stripes.png │ │ │ │ ├── lineedit.png │ │ │ │ ├── lineedit.sci │ │ │ │ ├── particle.png │ │ │ │ ├── titlebar.png │ │ │ │ ├── titlebar.sci │ │ │ │ ├── toolbutton.png │ │ │ │ ├── toolbutton.sci │ │ │ │ └── squareParticle.png │ │ │ └── qmldir │ │ └── flickr.qmlproject │ ├── desktop-inspector │ │ ├── README.txt │ │ ├── desktop-inspector.qmlproject │ │ └── content │ │ │ ├── Button.qml │ │ │ └── Header.qml │ ├── joinview │ │ └── joinview.qmlproject │ ├── cachingmodel │ │ ├── cachingmodel.qmlproject │ │ └── Button.qml │ ├── contactsmodel │ │ ├── contactsmodel.qmlproject │ │ └── Button.qml │ ├── notifications │ │ ├── notifications.qmlproject │ │ └── Button.qml │ ├── collationindex │ │ ├── collationindex.qmlproject │ │ └── content │ │ │ └── Button.qml │ ├── simplelistmodel │ │ ├── simplelistmodel.qmlproject │ │ └── content │ │ │ └── Button.qml │ ├── streamingquery │ │ ├── streamingquery.qmlproject │ │ └── content │ │ │ └── Button.qml │ ├── reduce-phone │ │ └── reduce-phone.qmlproject │ ├── simpleindex │ │ └── simpleindex.qmlproject │ └── map-phone │ │ └── map-phone.qmlproject ├── capabilities │ ├── RootCapability.json │ ├── SystemCapability.json │ └── UserCapability.json └── jsondb-client │ ├── example.json │ └── example.qml ├── .qmake.conf ├── tests ├── auto │ ├── headersclean │ │ └── headersclean.pro │ ├── partition │ │ ├── json-validation │ │ │ ├── type-array-bool-invalid.json │ │ │ ├── type-bool-false-valid.json │ │ │ ├── type-bool-true-valid.json │ │ │ ├── type-mixed-number-valid.json │ │ │ ├── type-number-number-valid.json │ │ │ ├── array-items-empty-empty-valid.json │ │ │ ├── array-items-number-empty-valid.json │ │ │ ├── required-number-valid.json │ │ │ ├── required-object-valid.json │ │ │ ├── type-array-integer-invalid.json │ │ │ ├── type-array-number-invalid.json │ │ │ ├── type-array-string-invalid.json │ │ │ ├── type-bool-integer-invalid.json │ │ │ ├── type-bool-number-invalid.json │ │ │ ├── type-bool-string-invalid.json │ │ │ ├── type-integer-bool-invalid.json │ │ │ ├── type-integer-double-invalid.json │ │ │ ├── type-integer-integer-valid.json │ │ │ ├── type-mixed-double-invalid.json │ │ │ ├── type-number-bool-invalid.json │ │ │ ├── type-number-double-valid.json │ │ │ ├── type-object-bool-invalid.json │ │ │ ├── type-object-double-invalid.json │ │ │ ├── type-object-number-invalid.json │ │ │ ├── type-string-bool-invalid.json │ │ │ ├── type-string-double-invalid.json │ │ │ ├── type-string-integer-invalid.json │ │ │ ├── array-items-empty-numbers-valid.json │ │ │ ├── array-items-object-empty-valid.json │ │ │ ├── format-string-time-invalid.json │ │ │ ├── format-string-version-invalid.json │ │ │ ├── type-array-object-invalid.json │ │ │ ├── type-mixed-string-valid.json │ │ │ ├── type-object-string-invalid.json │ │ │ ├── type-string-string-valid.json │ │ │ ├── array-boundaries-twoOrLess-empty-valid.json │ │ │ ├── array-boundaries-twoOrLess-two-valid.json │ │ │ ├── array-boundaries-twoOrMore-empty-invalid.json │ │ │ ├── array-boundaries-twoOrMore-one-invalid.json │ │ │ ├── array-boundaries-twoOrMore-two-valid.json │ │ │ ├── array-items-number-numbers-valid.json │ │ │ ├── format-string-date-invalid.json │ │ │ ├── format-string-date-valid.json │ │ │ ├── format-string-time-valid.json │ │ │ ├── format-string-version-valid.json │ │ │ ├── integer-boundaries-oneOrMore-one-valid.json │ │ │ ├── integer-boundaries-oneOrMore-two-valid.json │ │ │ ├── integer-boundaries-oneOrMore-zero-invalid.json │ │ │ ├── numbers-boundaries-oneOrMore-one-valid.json │ │ │ ├── numbers-boundaries-oneOrMore-two-valid.json │ │ │ ├── required-missing-invalid.json │ │ │ ├── type-array-array-valid.json │ │ │ ├── type-bool-array-invalid.json │ │ │ ├── type-integer-array-invalid.json │ │ │ ├── type-integer-object-invalid.json │ │ │ ├── type-mixed-array-invalid.json │ │ │ ├── type-number-array-invalid.json │ │ │ ├── type-number-object-invalid.json │ │ │ ├── type-number-string-invalid.json │ │ │ ├── type-object-array-invalid.json │ │ │ ├── type-object-object-valid.json │ │ │ ├── type-string-array-invalid.json │ │ │ ├── type-string-object-invalid.json │ │ │ ├── array-items-number-object-invalid.json │ │ │ ├── array-items-number-string-invalid.json │ │ │ ├── array-items-object-numbers-invalid.json │ │ │ ├── integer-boundaries-lessThenOne-zero-valid.json │ │ │ ├── integer-boundaries-moreThenOne-one-invalid.json │ │ │ ├── integer-boundaries-moreThenOne-two-valid.json │ │ │ ├── integer-boundaries-moreThenOne-zero-invalid.json │ │ │ ├── numbers-boundaries-moreThenOne-one-invalid.json │ │ │ ├── numbers-boundaries-moreThenOne-two-valid.json │ │ │ ├── numbers-boundaries-oneOrMore-zero-invalid.json │ │ │ ├── string-boundaries-pattern-a-valid.json │ │ │ ├── type-mixed-object-invalid.json │ │ │ ├── array-boundaries-twoOrLess-five-invalid.json │ │ │ ├── array-boundaries-twoOrMore-five-valid.json │ │ │ ├── array-items-object-strings-invalid.json │ │ │ ├── format-string-regex-valid.json │ │ │ ├── integer-boundaries-lessThenOne-one-invalid.json │ │ │ ├── integer-boundaries-lessThenOne-two-invalid.json │ │ │ ├── integer-boundaries-oneOrLess-one-valid.json │ │ │ ├── integer-boundaries-oneOrLess-two-invalid.json │ │ │ ├── numbers-boundaries-lessThenOne-one-invalid.json │ │ │ ├── numbers-boundaries-lessThenOne-two-invalid.json │ │ │ ├── numbers-boundaries-lessThenOne-zero-valid.json │ │ │ ├── numbers-boundaries-moreThenOne-zero-invalid.json │ │ │ ├── numbers-boundaries-oneOrLess-one-valid.json │ │ │ ├── numbers-boundaries-oneOrLess-two-invalid.json │ │ │ ├── numbers-boundaries-oneOrLess-zero-valid.json │ │ │ ├── required-nested-valid.json │ │ │ ├── required-notimportent-number-invalid.json │ │ │ ├── string-boundaries-max5chars-silo-valid.json │ │ │ ├── string-boundaries-max5chars-silos-valid.json │ │ │ ├── string-boundaries-min5chars-silo-invalid.json │ │ │ ├── string-boundaries-min5chars-silos-valid.json │ │ │ ├── string-boundaries-pattern-aaa-valid.json │ │ │ ├── string-boundaries-pattern-ab-invalid.json │ │ │ ├── type-integer-string-invalid.json │ │ │ ├── array-items-empty-mixed-valid.json │ │ │ ├── array-items-number-highnumbers-invalid.json │ │ │ ├── format-string-date-time-invalid.json │ │ │ ├── format-string-regex-invalid.json │ │ │ ├── type-bool-object-invalid.json │ │ │ ├── format-string-date-time-valid.json │ │ │ ├── format-string-identifier-invalid.json │ │ │ ├── format-string-identifier-valid.json │ │ │ ├── format-string-nonnegativeinteger-invalid.json │ │ │ ├── format-string-nonnegativeinteger-valid.json │ │ │ ├── array-items-number-mixed-invalid.json │ │ │ ├── format-string-uuid-invalid.json │ │ │ ├── format-string-uuid-valid.json │ │ │ ├── string-boundaries-min5chars-toolong-valid.json │ │ │ ├── string-boundaries-max5chars-toolong-invalid.json │ │ │ ├── array-items-object-missingfoo-valid.json │ │ │ ├── array-items-object-missingid-invalid.json │ │ │ ├── array-items-object-std-valid.json │ │ │ ├── array-boundaries-schema.json │ │ │ ├── required-schema.json │ │ │ ├── string-boundaries-schema.json │ │ │ ├── integer-boundaries-schema.json │ │ │ ├── numbers-boundaries-schema.json │ │ │ ├── array-items-schema.json │ │ │ ├── type-schema.json │ │ │ └── format-string-schema.json │ │ ├── json-validation.qrc │ │ ├── partition.qrc │ │ ├── schemas │ │ │ ├── TestView.json │ │ │ ├── address.json │ │ │ ├── contact.json │ │ │ └── ephemeral.json │ │ ├── json │ │ │ ├── map-array-conversion.json │ │ │ ├── pk-capability.json │ │ │ ├── multi-map.json │ │ │ ├── index-casesensitive.json │ │ │ ├── reduce.json │ │ │ ├── reduce-data.json │ │ │ ├── reduce-array.json │ │ │ ├── index-casepreference.json │ │ │ ├── reduce-subprop.json │ │ │ ├── map-sametarget.json │ │ │ ├── map-join.json │ │ │ ├── map-join-sourceuuids.json │ │ │ ├── map-reduce.json │ │ │ ├── map-reduce-schema.json │ │ │ └── array.json │ │ └── partition.pro │ ├── jsondblistmodel │ │ ├── partitions.json │ │ ├── jsondblistmodel.pro │ │ └── list-objects.json │ ├── jsondbnotification │ │ ├── partitions.json │ │ └── jsondbnotification.pro │ ├── jsondbpartition │ │ ├── partitions.json │ │ └── jsondbpartition.pro │ ├── jsondbqueryobject │ │ ├── partitions.json │ │ └── jsondbqueryobject.pro │ ├── cmake │ │ ├── cmake.pro │ │ ├── CMakeLists.txt │ │ └── test_modules │ │ │ ├── CMakeLists.txt │ │ │ └── main.cpp │ ├── qjsondbrequest │ │ ├── partitions.json │ │ └── qjsondbrequest.pro │ ├── qjsondbflushrequest │ │ ├── partitions.json │ │ └── qjsondbflushrequest.pro │ ├── queries │ │ ├── queries.qrc │ │ └── queries.pro │ ├── accesscontrol │ │ ├── accesscontrol.qrc │ │ ├── accesscontrol.pro │ │ └── json │ │ │ ├── index-test.json │ │ │ ├── capabilities-indexes.json │ │ │ ├── capabilities-view.json │ │ │ ├── capabilities-test.json │ │ │ ├── view-test2.json │ │ │ └── view-test.json │ ├── jsondbcachinglistmodel │ │ ├── partitions.json │ │ ├── jsondbcachinglistmodel.pro │ │ └── list-objects.json │ ├── jsondbsortinglistmodel │ │ ├── partitions.json │ │ ├── jsondbsortinglistmodel.pro │ │ └── list-objects.json │ ├── jsondbscriptengine │ │ ├── test_inject.js │ │ └── jsondbscriptengine.pro │ ├── qjsondbwatcher │ │ ├── partitions.json │ │ └── qjsondbwatcher.pro │ ├── client │ │ ├── partitions.json │ │ ├── create-test.json │ │ ├── client.pro │ │ └── json │ │ │ └── index-test.json │ ├── hbtree │ │ └── hbtree.pro │ ├── jsonstream │ │ └── jsonstream.pro │ ├── auto.pro │ └── storage │ │ └── storage.pro ├── benchmarks │ ├── client │ │ ├── partitions.json │ │ └── client.pro │ ├── benchmarks.pro │ ├── jsondbcachinglistmodel │ │ ├── partitions.json │ │ └── jsondbcachinglistmodel.pro │ ├── jsondbsortinglistmodel │ │ ├── partitions.json │ │ └── jsondbsortinglistmodel.pro │ ├── partition │ │ ├── partition.qrc │ │ └── partition.pro │ ├── btrees │ │ └── btrees.pro │ ├── jsondbobject │ │ └── jsondbobject.pro │ └── tests.xml ├── tests.pro ├── manual │ ├── outofspace │ │ ├── README │ │ ├── query.sh │ │ └── create.sh │ └── bits │ │ ├── bits.pro │ │ └── build.sh ├── shared │ ├── shared.pri │ └── json │ │ └── list-objects.json └── json.qrc ├── tools ├── tools.pro ├── aodbread │ └── aodbread.pro ├── adb-dump │ └── adb-dump.pro └── jsondb-client │ └── jsondb-client.pro ├── config.tests ├── icu │ ├── icu.pro │ └── main.cpp └── libedit │ ├── libedit.pro │ └── libedit.cpp ├── doc ├── images │ ├── example-streamingquery.png │ └── example-simplelistmodel.png ├── doc.pri ├── jsondb-dita.qdocconf ├── src │ ├── reduce-example.qdoc │ ├── example-chat.qdoc │ ├── external-resources.qdoc │ ├── example-simplelistmodel.qdoc │ ├── example-desktop-inspector.qdoc │ ├── example-streamingquery.qdoc │ ├── map-example.qdoc │ ├── join-example.qdoc │ └── index-example.qdoc ├── global │ └── qt-html-templates-offline.qdocconf ├── JsonDB-CommandLine-Client.txt └── jsondb.qdocconf ├── qtjsondb.pro └── sync.profile /src/imports/jsondb/jsondb.json: -------------------------------------------------------------------------------- 1 | {} 2 | -------------------------------------------------------------------------------- /.tag: -------------------------------------------------------------------------------- 1 | 58223ab8aaafe3d313863a9b757e9c9bd6243766 2 | -------------------------------------------------------------------------------- /src/3rdparty/3rdparty.pro: -------------------------------------------------------------------------------- 1 | TEMPLATE = subdirs 2 | 3 | -------------------------------------------------------------------------------- /src/imports/jsondb/qmldir: -------------------------------------------------------------------------------- 1 | plugin jsondbplugin 2 | -------------------------------------------------------------------------------- /examples/client/client.pro: -------------------------------------------------------------------------------- 1 | TEMPLATE = subdirs 2 | SUBDIRS = chat 3 | -------------------------------------------------------------------------------- /examples/examples.pro: -------------------------------------------------------------------------------- 1 | TEMPLATE = subdirs 2 | SUBDIRS = client 3 | -------------------------------------------------------------------------------- /.qmake.conf: -------------------------------------------------------------------------------- 1 | load(qt_build_config) 2 | 3 | MODULE_VERSION = 0.0.0 4 | -------------------------------------------------------------------------------- /src/imports/imports.pro: -------------------------------------------------------------------------------- 1 | TEMPLATE = subdirs 2 | SUBDIRS += jsondb 3 | 4 | -------------------------------------------------------------------------------- /tests/auto/headersclean/headersclean.pro: -------------------------------------------------------------------------------- 1 | QT = jsondb 2 | load(qt_headersclean) 3 | -------------------------------------------------------------------------------- /tests/auto/partition/json-validation/type-array-bool-invalid.json: -------------------------------------------------------------------------------- 1 | { "array": false} -------------------------------------------------------------------------------- /tests/auto/partition/json-validation/type-bool-false-valid.json: -------------------------------------------------------------------------------- 1 | { "boolean": false } -------------------------------------------------------------------------------- /tests/auto/partition/json-validation/type-bool-true-valid.json: -------------------------------------------------------------------------------- 1 | { "boolean": true } -------------------------------------------------------------------------------- /tests/auto/partition/json-validation/type-mixed-number-valid.json: -------------------------------------------------------------------------------- 1 | { "mixed": 3 } -------------------------------------------------------------------------------- /tests/auto/partition/json-validation/type-number-number-valid.json: -------------------------------------------------------------------------------- 1 | { "number": 404 } -------------------------------------------------------------------------------- /tools/tools.pro: -------------------------------------------------------------------------------- 1 | TEMPLATE = subdirs 2 | config_libedit:SUBDIRS += jsondb-client 3 | -------------------------------------------------------------------------------- /config.tests/icu/icu.pro: -------------------------------------------------------------------------------- 1 | TEMPLATE = app 2 | TARGET = icu 3 | SOURCES += main.cpp 4 | -------------------------------------------------------------------------------- /tests/auto/partition/json-validation/array-items-empty-empty-valid.json: -------------------------------------------------------------------------------- 1 | { "empty": [] } -------------------------------------------------------------------------------- /tests/auto/partition/json-validation/array-items-number-empty-valid.json: -------------------------------------------------------------------------------- 1 | { "number": [] } -------------------------------------------------------------------------------- /tests/auto/partition/json-validation/required-number-valid.json: -------------------------------------------------------------------------------- 1 | { "important": 123 } 2 | -------------------------------------------------------------------------------- /tests/auto/partition/json-validation/required-object-valid.json: -------------------------------------------------------------------------------- 1 | { "important": {} } 2 | -------------------------------------------------------------------------------- /tests/auto/partition/json-validation/type-array-integer-invalid.json: -------------------------------------------------------------------------------- 1 | { "array": 123 } -------------------------------------------------------------------------------- /tests/auto/partition/json-validation/type-array-number-invalid.json: -------------------------------------------------------------------------------- 1 | { "array": 1.23 } -------------------------------------------------------------------------------- /tests/auto/partition/json-validation/type-array-string-invalid.json: -------------------------------------------------------------------------------- 1 | { "array": "sin(x)" } -------------------------------------------------------------------------------- /tests/auto/partition/json-validation/type-bool-integer-invalid.json: -------------------------------------------------------------------------------- 1 | { "boolean": 12344 } -------------------------------------------------------------------------------- /tests/auto/partition/json-validation/type-bool-number-invalid.json: -------------------------------------------------------------------------------- 1 | { "boolean": 123.44 } -------------------------------------------------------------------------------- /tests/auto/partition/json-validation/type-bool-string-invalid.json: -------------------------------------------------------------------------------- 1 | { "boolean": "true" } -------------------------------------------------------------------------------- /tests/auto/partition/json-validation/type-integer-bool-invalid.json: -------------------------------------------------------------------------------- 1 | { "integer": true } -------------------------------------------------------------------------------- /tests/auto/partition/json-validation/type-integer-double-invalid.json: -------------------------------------------------------------------------------- 1 | { "integer": 40.4 } -------------------------------------------------------------------------------- /tests/auto/partition/json-validation/type-integer-integer-valid.json: -------------------------------------------------------------------------------- 1 | { "integer": 404 } -------------------------------------------------------------------------------- /tests/auto/partition/json-validation/type-mixed-double-invalid.json: -------------------------------------------------------------------------------- 1 | { "mixed": 34.4 } -------------------------------------------------------------------------------- /tests/auto/partition/json-validation/type-number-bool-invalid.json: -------------------------------------------------------------------------------- 1 | { "number": false } -------------------------------------------------------------------------------- /tests/auto/partition/json-validation/type-number-double-valid.json: -------------------------------------------------------------------------------- 1 | { "number": 40.4 } -------------------------------------------------------------------------------- /tests/auto/partition/json-validation/type-object-bool-invalid.json: -------------------------------------------------------------------------------- 1 | { "object": true } -------------------------------------------------------------------------------- /tests/auto/partition/json-validation/type-object-double-invalid.json: -------------------------------------------------------------------------------- 1 | { "object": 12.3 } -------------------------------------------------------------------------------- /tests/auto/partition/json-validation/type-object-number-invalid.json: -------------------------------------------------------------------------------- 1 | { "object": 123 } -------------------------------------------------------------------------------- /tests/auto/partition/json-validation/type-string-bool-invalid.json: -------------------------------------------------------------------------------- 1 | { "string": false } -------------------------------------------------------------------------------- /tests/auto/partition/json-validation/type-string-double-invalid.json: -------------------------------------------------------------------------------- 1 | { "string":40.4 } -------------------------------------------------------------------------------- /tests/auto/partition/json-validation/type-string-integer-invalid.json: -------------------------------------------------------------------------------- 1 | { "string":404 } -------------------------------------------------------------------------------- /tests/auto/partition/json-validation/array-items-empty-numbers-valid.json: -------------------------------------------------------------------------------- 1 | { "empty": [1,2,3] } -------------------------------------------------------------------------------- /tests/auto/partition/json-validation/array-items-object-empty-valid.json: -------------------------------------------------------------------------------- 1 | { "object": [ ] } -------------------------------------------------------------------------------- /tests/auto/partition/json-validation/format-string-time-invalid.json: -------------------------------------------------------------------------------- 1 | { "time": "17.50" } 2 | -------------------------------------------------------------------------------- /tests/auto/partition/json-validation/format-string-version-invalid.json: -------------------------------------------------------------------------------- 1 | { "version": "2"} 2 | -------------------------------------------------------------------------------- /tests/auto/partition/json-validation/type-array-object-invalid.json: -------------------------------------------------------------------------------- 1 | { "array": {"foo": 123 } } -------------------------------------------------------------------------------- /tests/auto/partition/json-validation/type-mixed-string-valid.json: -------------------------------------------------------------------------------- 1 | { "mixed": "magic string" } -------------------------------------------------------------------------------- /tests/auto/partition/json-validation/type-object-string-invalid.json: -------------------------------------------------------------------------------- 1 | { "object": "sin(x)" } -------------------------------------------------------------------------------- /tests/auto/partition/json-validation/type-string-string-valid.json: -------------------------------------------------------------------------------- 1 | { "string":"kartofel" } -------------------------------------------------------------------------------- /tests/auto/partition/json-validation/array-boundaries-twoOrLess-empty-valid.json: -------------------------------------------------------------------------------- 1 | {"twoOrLess":[]} -------------------------------------------------------------------------------- /tests/auto/partition/json-validation/array-boundaries-twoOrLess-two-valid.json: -------------------------------------------------------------------------------- 1 | {"twoOrLess":[1,2]} -------------------------------------------------------------------------------- /tests/auto/partition/json-validation/array-boundaries-twoOrMore-empty-invalid.json: -------------------------------------------------------------------------------- 1 | {"twoOrMore":[]} -------------------------------------------------------------------------------- /tests/auto/partition/json-validation/array-boundaries-twoOrMore-one-invalid.json: -------------------------------------------------------------------------------- 1 | {"twoOrMore":[1]} -------------------------------------------------------------------------------- /tests/auto/partition/json-validation/array-boundaries-twoOrMore-two-valid.json: -------------------------------------------------------------------------------- 1 | {"twoOrMore":[1,2]} -------------------------------------------------------------------------------- /tests/auto/partition/json-validation/array-items-number-numbers-valid.json: -------------------------------------------------------------------------------- 1 | { "number": [1,2,3] } -------------------------------------------------------------------------------- /tests/auto/partition/json-validation/format-string-date-invalid.json: -------------------------------------------------------------------------------- 1 | { "date": "13-03-2012" } 2 | -------------------------------------------------------------------------------- /tests/auto/partition/json-validation/format-string-date-valid.json: -------------------------------------------------------------------------------- 1 | { "date": "2012-03-13" } 2 | -------------------------------------------------------------------------------- /tests/auto/partition/json-validation/format-string-time-valid.json: -------------------------------------------------------------------------------- 1 | { "time": "10:50:23.123" } 2 | -------------------------------------------------------------------------------- /tests/auto/partition/json-validation/format-string-version-valid.json: -------------------------------------------------------------------------------- 1 | { "version": "1.23.4"} 2 | -------------------------------------------------------------------------------- /tests/auto/partition/json-validation/integer-boundaries-oneOrMore-one-valid.json: -------------------------------------------------------------------------------- 1 | {"oneOrMore":1} -------------------------------------------------------------------------------- /tests/auto/partition/json-validation/integer-boundaries-oneOrMore-two-valid.json: -------------------------------------------------------------------------------- 1 | {"oneOrMore":2} -------------------------------------------------------------------------------- /tests/auto/partition/json-validation/integer-boundaries-oneOrMore-zero-invalid.json: -------------------------------------------------------------------------------- 1 | {"oneOrMore":0} -------------------------------------------------------------------------------- /tests/auto/partition/json-validation/numbers-boundaries-oneOrMore-one-valid.json: -------------------------------------------------------------------------------- 1 | {"oneOrMore":1.1} -------------------------------------------------------------------------------- /tests/auto/partition/json-validation/numbers-boundaries-oneOrMore-two-valid.json: -------------------------------------------------------------------------------- 1 | {"oneOrMore":2.1} -------------------------------------------------------------------------------- /tests/auto/partition/json-validation/required-missing-invalid.json: -------------------------------------------------------------------------------- 1 | { "notSoImportant": 123 } 2 | -------------------------------------------------------------------------------- /tests/auto/partition/json-validation/type-array-array-valid.json: -------------------------------------------------------------------------------- 1 | { "array": [1, 3, 5, 7, 11, 13] } -------------------------------------------------------------------------------- /tests/auto/partition/json-validation/type-bool-array-invalid.json: -------------------------------------------------------------------------------- 1 | { "boolean": [1, 1, 2, 3, 5, 8] } -------------------------------------------------------------------------------- /tests/auto/partition/json-validation/type-integer-array-invalid.json: -------------------------------------------------------------------------------- 1 | { "integer": ["foo","bar"] } -------------------------------------------------------------------------------- /tests/auto/partition/json-validation/type-integer-object-invalid.json: -------------------------------------------------------------------------------- 1 | { "integer": {"foo":"bar"} } -------------------------------------------------------------------------------- /tests/auto/partition/json-validation/type-mixed-array-invalid.json: -------------------------------------------------------------------------------- 1 | { "mixed": ["magic string", 3] } -------------------------------------------------------------------------------- /tests/auto/partition/json-validation/type-number-array-invalid.json: -------------------------------------------------------------------------------- 1 | { "number": ["foo","bar"] } -------------------------------------------------------------------------------- /tests/auto/partition/json-validation/type-number-object-invalid.json: -------------------------------------------------------------------------------- 1 | { "number": {"foo":"bar"} } -------------------------------------------------------------------------------- /tests/auto/partition/json-validation/type-number-string-invalid.json: -------------------------------------------------------------------------------- 1 | { "number": "kartoflanka" } -------------------------------------------------------------------------------- /tests/auto/partition/json-validation/type-object-array-invalid.json: -------------------------------------------------------------------------------- 1 | { "object": [123, "sin(x)"] } -------------------------------------------------------------------------------- /tests/auto/partition/json-validation/type-object-object-valid.json: -------------------------------------------------------------------------------- 1 | { "object": {"x":"sin(x)"} } -------------------------------------------------------------------------------- /tests/auto/partition/json-validation/type-string-array-invalid.json: -------------------------------------------------------------------------------- 1 | { "string": ["foo", "bar"] } -------------------------------------------------------------------------------- /tests/auto/partition/json-validation/type-string-object-invalid.json: -------------------------------------------------------------------------------- 1 | { "string": {"foo":"bar"} } -------------------------------------------------------------------------------- /tests/auto/partition/json-validation/array-items-number-object-invalid.json: -------------------------------------------------------------------------------- 1 | { "number": [{"string":1}] } -------------------------------------------------------------------------------- /tests/auto/partition/json-validation/array-items-number-string-invalid.json: -------------------------------------------------------------------------------- 1 | { "number": ["string", 1] } -------------------------------------------------------------------------------- /tests/auto/partition/json-validation/array-items-object-numbers-invalid.json: -------------------------------------------------------------------------------- 1 | { "object": [ 1, 5, 4] } -------------------------------------------------------------------------------- /tests/auto/partition/json-validation/integer-boundaries-lessThenOne-zero-valid.json: -------------------------------------------------------------------------------- 1 | { "lessThenOne": 0 } -------------------------------------------------------------------------------- /tests/auto/partition/json-validation/integer-boundaries-moreThenOne-one-invalid.json: -------------------------------------------------------------------------------- 1 | {"moreThenOne":1} -------------------------------------------------------------------------------- /tests/auto/partition/json-validation/integer-boundaries-moreThenOne-two-valid.json: -------------------------------------------------------------------------------- 1 | {"moreThenOne":2} -------------------------------------------------------------------------------- /tests/auto/partition/json-validation/integer-boundaries-moreThenOne-zero-invalid.json: -------------------------------------------------------------------------------- 1 | {"moreThenOne":0} -------------------------------------------------------------------------------- /tests/auto/partition/json-validation/numbers-boundaries-moreThenOne-one-invalid.json: -------------------------------------------------------------------------------- 1 | {"moreThenOne":1.1} -------------------------------------------------------------------------------- /tests/auto/partition/json-validation/numbers-boundaries-moreThenOne-two-valid.json: -------------------------------------------------------------------------------- 1 | {"moreThenOne":2.1} -------------------------------------------------------------------------------- /tests/auto/partition/json-validation/numbers-boundaries-oneOrMore-zero-invalid.json: -------------------------------------------------------------------------------- 1 | {"oneOrMore":0.1} -------------------------------------------------------------------------------- /tests/auto/partition/json-validation/string-boundaries-pattern-a-valid.json: -------------------------------------------------------------------------------- 1 | { "regexpPattern" : "a" } -------------------------------------------------------------------------------- /tests/auto/partition/json-validation/type-mixed-object-invalid.json: -------------------------------------------------------------------------------- 1 | { "mixed": {"say":"magic word"} } -------------------------------------------------------------------------------- /tests/auto/jsondblistmodel/partitions.json: -------------------------------------------------------------------------------- 1 | [ 2 | { "name" :"com.example.shared.1", "path":"." } 3 | ] 4 | -------------------------------------------------------------------------------- /tests/auto/jsondbnotification/partitions.json: -------------------------------------------------------------------------------- 1 | [ 2 | { "name" :"com.nokia.shared", "path":"." } 3 | ] 4 | -------------------------------------------------------------------------------- /tests/auto/jsondbpartition/partitions.json: -------------------------------------------------------------------------------- 1 | [ 2 | { "name" :"com.nokia.shared.1", "path":"." } 3 | ] 4 | -------------------------------------------------------------------------------- /tests/auto/jsondbqueryobject/partitions.json: -------------------------------------------------------------------------------- 1 | [ 2 | { "name" :"com.nokia.shared", "path":"." } 3 | ] 4 | -------------------------------------------------------------------------------- /tests/auto/partition/json-validation/array-boundaries-twoOrLess-five-invalid.json: -------------------------------------------------------------------------------- 1 | {"twoOrLess":[1,2,3,4,5]} -------------------------------------------------------------------------------- /tests/auto/partition/json-validation/array-boundaries-twoOrMore-five-valid.json: -------------------------------------------------------------------------------- 1 | {"twoOrMore":[1,2,3,4,5]} -------------------------------------------------------------------------------- /tests/auto/partition/json-validation/array-items-object-strings-invalid.json: -------------------------------------------------------------------------------- 1 | { "object": [ "id", "foo" ] } -------------------------------------------------------------------------------- /tests/auto/partition/json-validation/format-string-regex-valid.json: -------------------------------------------------------------------------------- 1 | { "regex": "^([0-9]+([.][0-9]+)+)$"} 2 | -------------------------------------------------------------------------------- /tests/auto/partition/json-validation/integer-boundaries-lessThenOne-one-invalid.json: -------------------------------------------------------------------------------- 1 | { "lessThenOne": 1 } -------------------------------------------------------------------------------- /tests/auto/partition/json-validation/integer-boundaries-lessThenOne-two-invalid.json: -------------------------------------------------------------------------------- 1 | { "lessThenOne": 2 } -------------------------------------------------------------------------------- /tests/auto/partition/json-validation/integer-boundaries-oneOrLess-one-valid.json: -------------------------------------------------------------------------------- 1 | { "oneOrLess": 1 } 2 | -------------------------------------------------------------------------------- /tests/auto/partition/json-validation/integer-boundaries-oneOrLess-two-invalid.json: -------------------------------------------------------------------------------- 1 | { "oneOrLess": 2 } 2 | -------------------------------------------------------------------------------- /tests/auto/partition/json-validation/numbers-boundaries-lessThenOne-one-invalid.json: -------------------------------------------------------------------------------- 1 | { "lessThenOne": 1.1 } -------------------------------------------------------------------------------- /tests/auto/partition/json-validation/numbers-boundaries-lessThenOne-two-invalid.json: -------------------------------------------------------------------------------- 1 | { "lessThenOne": 2.1 } -------------------------------------------------------------------------------- /tests/auto/partition/json-validation/numbers-boundaries-lessThenOne-zero-valid.json: -------------------------------------------------------------------------------- 1 | { "lessThenOne": 0.1 } -------------------------------------------------------------------------------- /tests/auto/partition/json-validation/numbers-boundaries-moreThenOne-zero-invalid.json: -------------------------------------------------------------------------------- 1 | {"moreThenOne":0.1} -------------------------------------------------------------------------------- /tests/auto/partition/json-validation/numbers-boundaries-oneOrLess-one-valid.json: -------------------------------------------------------------------------------- 1 | { "oneOrLess": 1.1 } 2 | -------------------------------------------------------------------------------- /tests/auto/partition/json-validation/numbers-boundaries-oneOrLess-two-invalid.json: -------------------------------------------------------------------------------- 1 | { "oneOrLess": 2.1 } 2 | -------------------------------------------------------------------------------- /tests/auto/partition/json-validation/numbers-boundaries-oneOrLess-zero-valid.json: -------------------------------------------------------------------------------- 1 | { "oneOrLess": 0.1 } 2 | -------------------------------------------------------------------------------- /tests/auto/partition/json-validation/required-nested-valid.json: -------------------------------------------------------------------------------- 1 | { "important": {"important": "important"} } -------------------------------------------------------------------------------- /tests/auto/partition/json-validation/required-notimportent-number-invalid.json: -------------------------------------------------------------------------------- 1 | { "notimportant": 123 } 2 | -------------------------------------------------------------------------------- /tests/auto/partition/json-validation/string-boundaries-max5chars-silo-valid.json: -------------------------------------------------------------------------------- 1 | { "max5chars" : "silo" } -------------------------------------------------------------------------------- /tests/auto/partition/json-validation/string-boundaries-max5chars-silos-valid.json: -------------------------------------------------------------------------------- 1 | { "max5chars" : "silos" } -------------------------------------------------------------------------------- /tests/auto/partition/json-validation/string-boundaries-min5chars-silo-invalid.json: -------------------------------------------------------------------------------- 1 | { "min5chars" : "silo" } -------------------------------------------------------------------------------- /tests/auto/partition/json-validation/string-boundaries-min5chars-silos-valid.json: -------------------------------------------------------------------------------- 1 | { "min5chars" : "silos" } -------------------------------------------------------------------------------- /tests/auto/partition/json-validation/string-boundaries-pattern-aaa-valid.json: -------------------------------------------------------------------------------- 1 | { "regexpPattern" : "aaa" } -------------------------------------------------------------------------------- /tests/auto/partition/json-validation/string-boundaries-pattern-ab-invalid.json: -------------------------------------------------------------------------------- 1 | { "regexpPattern" : "ab" } -------------------------------------------------------------------------------- /tests/auto/partition/json-validation/type-integer-string-invalid.json: -------------------------------------------------------------------------------- 1 | { "integer": "o radosci iskro bogow" } -------------------------------------------------------------------------------- /tests/auto/partition/json-validation/array-items-empty-mixed-valid.json: -------------------------------------------------------------------------------- 1 | { "empty": [1, "foo", {"foo": 1}, 2, 3] } -------------------------------------------------------------------------------- /tests/auto/partition/json-validation/array-items-number-highnumbers-invalid.json: -------------------------------------------------------------------------------- 1 | { "number": [1, 2, 124123, 4] } -------------------------------------------------------------------------------- /tests/auto/partition/json-validation/format-string-date-time-invalid.json: -------------------------------------------------------------------------------- 1 | { "date-time": "2012.03.13, 10:50"} 2 | -------------------------------------------------------------------------------- /tests/auto/partition/json-validation/format-string-regex-invalid.json: -------------------------------------------------------------------------------- 1 | { "regex": "^([0-9]+([.][0-9]+)+$"} 2 | -------------------------------------------------------------------------------- /tests/auto/partition/json-validation/type-bool-object-invalid.json: -------------------------------------------------------------------------------- 1 | { "boolean": {"three":"is a magic number"} } -------------------------------------------------------------------------------- /tests/benchmarks/client/partitions.json: -------------------------------------------------------------------------------- 1 | [ { "name" : "com.nokia.shared.1", "path":".", "default" : true } ] 2 | -------------------------------------------------------------------------------- /tests/auto/partition/json-validation/format-string-date-time-valid.json: -------------------------------------------------------------------------------- 1 | { "date-time": "2012-03-13T10:50:23Z" } 2 | -------------------------------------------------------------------------------- /tests/auto/partition/json-validation/format-string-identifier-invalid.json: -------------------------------------------------------------------------------- 1 | { "identifier": "myTestIdentifier"} 2 | -------------------------------------------------------------------------------- /tests/auto/partition/json-validation/format-string-identifier-valid.json: -------------------------------------------------------------------------------- 1 | { "identifier": "my.test.identifier"} 2 | -------------------------------------------------------------------------------- /tests/auto/partition/json-validation/format-string-nonnegativeinteger-invalid.json: -------------------------------------------------------------------------------- 1 | { "nonnegativeinteger": "-5"} 2 | -------------------------------------------------------------------------------- /tests/auto/partition/json-validation/format-string-nonnegativeinteger-valid.json: -------------------------------------------------------------------------------- 1 | { "nonnegativeinteger": "12345"} 2 | -------------------------------------------------------------------------------- /tests/tests.pro: -------------------------------------------------------------------------------- 1 | TEMPLATE = subdirs 2 | benchmarks.CONFIG += no_check_target 3 | SUBDIRS += auto benchmarks 4 | 5 | -------------------------------------------------------------------------------- /config.tests/libedit/libedit.pro: -------------------------------------------------------------------------------- 1 | CONFIG -= x11 qt 2 | SOURCES = libedit.cpp 3 | OBJECTS_DIR = obj 4 | LIBS += -ledit 5 | -------------------------------------------------------------------------------- /doc/images/example-streamingquery.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qt/qtjsondb/master/doc/images/example-streamingquery.png -------------------------------------------------------------------------------- /tests/auto/cmake/cmake.pro: -------------------------------------------------------------------------------- 1 | 2 | # Cause make to do nothing. 3 | TEMPLATE = subdirs 4 | 5 | CONFIG += ctest_testcase 6 | -------------------------------------------------------------------------------- /tests/auto/partition/json-validation/array-items-number-mixed-invalid.json: -------------------------------------------------------------------------------- 1 | { "number": [1, "foo", {"a":"A"}, [1,2,4], 3] } -------------------------------------------------------------------------------- /tests/auto/partition/json-validation/format-string-uuid-invalid.json: -------------------------------------------------------------------------------- 1 | { "uuid": "550e84-00e29b-41d4-a716-446655440000"} 2 | -------------------------------------------------------------------------------- /tests/auto/partition/json-validation/format-string-uuid-valid.json: -------------------------------------------------------------------------------- 1 | { "uuid": "550e8400-e29b-41d4-a716-446655440000"} 2 | -------------------------------------------------------------------------------- /tests/auto/partition/json-validation/string-boundaries-min5chars-toolong-valid.json: -------------------------------------------------------------------------------- 1 | { "min5chars" : "The rest is silence." } -------------------------------------------------------------------------------- /doc/images/example-simplelistmodel.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qt/qtjsondb/master/doc/images/example-simplelistmodel.png -------------------------------------------------------------------------------- /tests/auto/partition/json-validation/string-boundaries-max5chars-toolong-invalid.json: -------------------------------------------------------------------------------- 1 | { "max5chars" : "The rest is silence." } -------------------------------------------------------------------------------- /tests/auto/qjsondbrequest/partitions.json: -------------------------------------------------------------------------------- 1 | [ 2 | { "name" :"com.qt-project.shared", "path":".", "default" : true } 3 | ] 4 | -------------------------------------------------------------------------------- /tests/auto/qjsondbflushrequest/partitions.json: -------------------------------------------------------------------------------- 1 | [ 2 | { "name" :"com.qt-project.shared", "path":".", "default" : true } 3 | ] 4 | -------------------------------------------------------------------------------- /examples/declarative/partitions.json: -------------------------------------------------------------------------------- 1 | [ 2 | { "name" :"com.nokia.shared", "path":"." }, 3 | { "name" :"com.nokia.shared2", "path":"." } 4 | ] 5 | -------------------------------------------------------------------------------- /src/3rdparty/zlib/zlib.pri: -------------------------------------------------------------------------------- 1 | INCLUDEPATH += $$PWD 2 | 3 | HEADERS += \ 4 | $$PWD/crc32.h 5 | 6 | SOURCES += \ 7 | $$PWD/crc32.c 8 | 9 | -------------------------------------------------------------------------------- /tests/auto/queries/queries.qrc: -------------------------------------------------------------------------------- 1 | 2 | 3 | dataset.json 4 | 5 | 6 | -------------------------------------------------------------------------------- /examples/declarative/flickr/content/images/gloss.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qt/qtjsondb/master/examples/declarative/flickr/content/images/gloss.png -------------------------------------------------------------------------------- /examples/declarative/flickr/content/images/noise.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qt/qtjsondb/master/examples/declarative/flickr/content/images/noise.png -------------------------------------------------------------------------------- /examples/declarative/flickr/content/images/quit.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qt/qtjsondb/master/examples/declarative/flickr/content/images/quit.png -------------------------------------------------------------------------------- /tests/auto/accesscontrol/accesscontrol.qrc: -------------------------------------------------------------------------------- 1 | 2 | 3 | json 4 | 5 | 6 | -------------------------------------------------------------------------------- /tests/benchmarks/benchmarks.pro: -------------------------------------------------------------------------------- 1 | TEMPLATE = subdirs 2 | SUBDIRS += partition client jsondbcachinglistmodel jsondbsortinglistmodel btrees jsondbobject 3 | -------------------------------------------------------------------------------- /examples/declarative/flickr/content/images/stripes.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qt/qtjsondb/master/examples/declarative/flickr/content/images/stripes.png -------------------------------------------------------------------------------- /tests/auto/partition/json-validation.qrc: -------------------------------------------------------------------------------- 1 | 2 | 3 | json-validation 4 | 5 | -------------------------------------------------------------------------------- /examples/declarative/flickr/content/images/lineedit.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qt/qtjsondb/master/examples/declarative/flickr/content/images/lineedit.png -------------------------------------------------------------------------------- /examples/declarative/flickr/content/images/lineedit.sci: -------------------------------------------------------------------------------- 1 | border.left: 10 2 | border.top: 10 3 | border.bottom: 10 4 | border.right: 10 5 | source: lineedit.png 6 | -------------------------------------------------------------------------------- /examples/declarative/flickr/content/images/particle.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qt/qtjsondb/master/examples/declarative/flickr/content/images/particle.png -------------------------------------------------------------------------------- /examples/declarative/flickr/content/images/titlebar.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qt/qtjsondb/master/examples/declarative/flickr/content/images/titlebar.png -------------------------------------------------------------------------------- /examples/declarative/flickr/content/images/titlebar.sci: -------------------------------------------------------------------------------- 1 | border.left: 10 2 | border.top: 12 3 | border.bottom: 12 4 | border.right: 10 5 | source: titlebar.png 6 | -------------------------------------------------------------------------------- /examples/declarative/flickr/content/images/toolbutton.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qt/qtjsondb/master/examples/declarative/flickr/content/images/toolbutton.png -------------------------------------------------------------------------------- /examples/declarative/flickr/content/images/toolbutton.sci: -------------------------------------------------------------------------------- 1 | border.left: 15 2 | border.top: 4 3 | border.bottom: 4 4 | border.right: 15 5 | source: toolbutton.png 6 | -------------------------------------------------------------------------------- /src/src.pro: -------------------------------------------------------------------------------- 1 | TEMPLATE = subdirs 2 | CONFIG += ordered 3 | SUBDIRS += 3rdparty jsonstream partition client daemon 4 | 5 | qtHaveModule(quick): SUBDIRS += imports 6 | -------------------------------------------------------------------------------- /tests/auto/jsondbcachinglistmodel/partitions.json: -------------------------------------------------------------------------------- 1 | [ 2 | { "name" :"com.nokia.shared.1", "path":"." }, 3 | { "name" :"com.nokia.shared.2", "path":"." } 4 | ] 5 | -------------------------------------------------------------------------------- /tests/auto/jsondbsortinglistmodel/partitions.json: -------------------------------------------------------------------------------- 1 | [ 2 | { "name" :"com.nokia.shared.1", "path":"." }, 3 | { "name" :"com.nokia.shared.2", "path":"." } 4 | ] 5 | -------------------------------------------------------------------------------- /examples/declarative/flickr/content/images/squareParticle.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qt/qtjsondb/master/examples/declarative/flickr/content/images/squareParticle.png -------------------------------------------------------------------------------- /tests/benchmarks/jsondbcachinglistmodel/partitions.json: -------------------------------------------------------------------------------- 1 | [ 2 | { "name" :"com.nokia.shared.1", "path":"." }, 3 | { "name" :"com.nokia.shared.2", "path":"." } 4 | ] 5 | -------------------------------------------------------------------------------- /tests/benchmarks/jsondbsortinglistmodel/partitions.json: -------------------------------------------------------------------------------- 1 | [ 2 | { "name" :"com.nokia.shared.1", "path":"." }, 3 | { "name" :"com.nokia.shared.2", "path":"." } 4 | ] 5 | -------------------------------------------------------------------------------- /tests/manual/outofspace/README: -------------------------------------------------------------------------------- 1 | This test checks if JsonDb handles out of space situations. 2 | Make sure jsondb and jsondb-client are in your PATH and then run runTest.sh 3 | -------------------------------------------------------------------------------- /src/jsonstream/jsonstream.pri: -------------------------------------------------------------------------------- 1 | INCLUDEPATH += $$PWD 2 | LIBS_PRIVATE += -L$$shadowed($$PWD) -lQtJsonDbJsonStream 3 | POST_TARGETDEPS += $$shadowed($$PWD)/libQtJsonDbJsonStream.a 4 | -------------------------------------------------------------------------------- /tests/auto/partition/partition.qrc: -------------------------------------------------------------------------------- 1 | 2 | 3 | json 4 | schemas 5 | 6 | 7 | -------------------------------------------------------------------------------- /src/partition/schema/View.json: -------------------------------------------------------------------------------- 1 | { 2 | "type": "object", 3 | "properties": { 4 | "sourceUuids": { 5 | "type": "array" 6 | }, 7 | "key": { 8 | } 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /examples/client/chat/chat.pro: -------------------------------------------------------------------------------- 1 | TEMPLATE = app 2 | TARGET = jsondb-chat 3 | QT += jsondb 4 | 5 | SOURCES += main.cpp \ 6 | chatclient.cpp 7 | 8 | HEADERS += \ 9 | chatclient.h 10 | -------------------------------------------------------------------------------- /tests/auto/jsondbscriptengine/test_inject.js: -------------------------------------------------------------------------------- 1 | (function() { 2 | isEqual = function(a, b) { 3 | if (a === null || b === null) return false; 4 | return a === b; 5 | }; 6 | }).call(this); 7 | -------------------------------------------------------------------------------- /tests/auto/partition/schemas/TestView.json: -------------------------------------------------------------------------------- 1 | { 2 | "type": "object", 3 | "extends": "View", 4 | "properties": { 5 | "name": { 6 | "type": "string" 7 | } 8 | } 9 | } 10 | 11 | -------------------------------------------------------------------------------- /tests/auto/qjsondbwatcher/partitions.json: -------------------------------------------------------------------------------- 1 | [ 2 | { "name" :"com.qt-project.shared", "path":".", "default" : true }, 3 | { "name" :"com.qt-project.removable", "path":"/nonexistentdir", "removable" : true } 4 | ] 5 | -------------------------------------------------------------------------------- /tests/auto/partition/json-validation/array-items-object-missingfoo-valid.json: -------------------------------------------------------------------------------- 1 | { "object": [ 2 | { "id": 1, "foo": "pong!" }, 3 | { "id": 2 }, 4 | { "id": 3 }, 5 | { "id": 4, "foo": "pong!" } 6 | ] 7 | } -------------------------------------------------------------------------------- /tests/auto/partition/json-validation/array-items-object-missingid-invalid.json: -------------------------------------------------------------------------------- 1 | { "object": [ 2 | { "id": 1, "foo": "pong!" }, 3 | { "id": 2, "foo": "pong!" }, 4 | { "foo": "pong!" }, 5 | { "id": 4, "foo": "pong!" } 6 | ] 7 | } -------------------------------------------------------------------------------- /tests/auto/client/partitions.json: -------------------------------------------------------------------------------- 1 | [ 2 | { "name" : "test-jsondb-client", "path":".", "default": true }, 3 | { "name" : "com.example.autotest.Partition1", "path":"." }, 4 | { "name" : "com.example.autotest.Partition2", "path":"." } 5 | ] 6 | -------------------------------------------------------------------------------- /tests/auto/partition/json-validation/array-items-object-std-valid.json: -------------------------------------------------------------------------------- 1 | { "object": [ 2 | { "id": 1, "foo": "pong!" }, 3 | { "id": 2, "foo": "pong!" }, 4 | { "id": 3, "foo": "pong!" }, 5 | { "id": 4, "foo": "pong!" } 6 | ] 7 | } -------------------------------------------------------------------------------- /tests/benchmarks/partition/partition.qrc: -------------------------------------------------------------------------------- 1 | 2 | 3 | ../../auto/partition/json 4 | ../../auto/partition/schemas 5 | 6 | 7 | -------------------------------------------------------------------------------- /src/partition/schema/notification.json: -------------------------------------------------------------------------------- 1 | { 2 | "type": "object", 3 | "ephemeral": "true", 4 | "properties": { 5 | "actions": { 6 | "type": "array" 7 | }, 8 | "query": { 9 | "type": "string" 10 | } 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /tests/auto/cmake/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | 2 | cmake_minimum_required(VERSION 2.8) 3 | 4 | project(qmake_cmake_files) 5 | 6 | enable_testing() 7 | 8 | find_package(Qt5Core REQUIRED) 9 | 10 | include("${_Qt5CTestMacros}") 11 | 12 | expect_pass(test_modules) 13 | -------------------------------------------------------------------------------- /qtjsondb.pro: -------------------------------------------------------------------------------- 1 | load(configure) 2 | qtCompileTest(icu) 3 | qtCompileTest(libedit) 4 | 5 | load(qt_parts) 6 | 7 | win32 { 8 | message("QtJsonDb is not currently supported on Windows - will not be built") 9 | SUBDIRS = 10 | } 11 | 12 | include(doc/doc.pri) 13 | -------------------------------------------------------------------------------- /tests/manual/bits/bits.pro: -------------------------------------------------------------------------------- 1 | DESTDIR = bin 2 | 3 | CONFIG -= app_bundle 4 | CONFIG -= qt 5 | CONFIG += debug 6 | 7 | include($$PWD/../../../src/3rdparty/btree/btree.pri) 8 | 9 | SOURCES += \ 10 | main.cpp \ 11 | 12 | DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0 13 | -------------------------------------------------------------------------------- /tools/aodbread/aodbread.pro: -------------------------------------------------------------------------------- 1 | TARGET = aodbread 2 | 3 | QT = testlib 4 | CONFIG -= app_bundle 5 | CONFIG += debug 6 | 7 | DEFINES += SRCDIR=\\\"$$PWD/\\\" 8 | 9 | include($$PWD/../../src/3rdparty/btree/btree.pri) 10 | 11 | SOURCES += \ 12 | main.cpp 13 | 14 | -------------------------------------------------------------------------------- /tests/auto/hbtree/hbtree.pro: -------------------------------------------------------------------------------- 1 | include($$PWD/../../../src/hbtree/hbtree.pri) 2 | 3 | TARGET = tst_hbtree 4 | 5 | QT = core testlib 6 | CONFIG -= app_bundle 7 | CONFIG += testcase 8 | 9 | SOURCES += \ 10 | main.cpp 11 | DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0 12 | -------------------------------------------------------------------------------- /examples/capabilities/RootCapability.json: -------------------------------------------------------------------------------- 1 | { 2 | "_type": "Capability", 3 | "name": "root", 4 | "partition": "all", 5 | "accessRules": { 6 | "rw": { 7 | "read": [".*"], 8 | "write": [".*"] 9 | }, 10 | "setOwner": { 11 | "setOwner": [".*"] 12 | } 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /src/partition/schema/RootCapability.json: -------------------------------------------------------------------------------- 1 | { 2 | "_type": "Capability", 3 | "name": "root", 4 | "partition": "all", 5 | "accessRules": { 6 | "rw": { 7 | "read": [".*"], 8 | "write": [".*"] 9 | }, 10 | "setOwner": { 11 | "setOwner": [".*"] 12 | } 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /tests/auto/client/create-test.json: -------------------------------------------------------------------------------- 1 | { 2 | "type": "object", 3 | "properties": { 4 | "create-test": { 5 | "type": "number", 6 | "required": true 7 | }, 8 | "another-field": { 9 | "type": "string", 10 | "format": "uri", 11 | "required": true 12 | } 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /tests/auto/jsonstream/jsonstream.pro: -------------------------------------------------------------------------------- 1 | TARGET = tst_jsonstream 2 | 3 | QT = qml network testlib 4 | CONFIG -= app_bundle 5 | CONFIG += testcase 6 | 7 | include($$PWD/../../../src/jsonstream/jsonstream.pri) 8 | 9 | SOURCES += \ 10 | test-jsonstream.cpp 11 | 12 | DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0 13 | -------------------------------------------------------------------------------- /examples/declarative/flickr/content/qmldir: -------------------------------------------------------------------------------- 1 | ImageDetails ImageDetails.qml 2 | LikeOMeter LikeOMeter.qml 3 | Loading Loading.qml 4 | MediaButton MediaButton.qml 5 | MediaLineEdit MediaLineEdit.qml 6 | Progress Progress.qml 7 | RssModel RssModel.qml 8 | ScrollBar ScrollBar.qml 9 | Slider Slider.qml 10 | Star Star.qml 11 | -------------------------------------------------------------------------------- /src/partition/jsondb.qrc: -------------------------------------------------------------------------------- 1 | 2 | 3 | schema/notification.json 4 | schema/View.json 5 | schema/Capability.json 6 | schema/RootCapability.json 7 | schema/Index.json 8 | 9 | 10 | -------------------------------------------------------------------------------- /tests/auto/partition/json-validation/array-boundaries-schema.json: -------------------------------------------------------------------------------- 1 | { 2 | "description": "Check an array items count", 3 | "type": "object", 4 | "properties": { 5 | "twoOrLess": { 6 | "maxItems": 2 7 | }, 8 | "twoOrMore": { 9 | "minItems": 2 10 | } 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /tests/benchmarks/btrees/btrees.pro: -------------------------------------------------------------------------------- 1 | include($$PWD/../../../src/hbtree/hbtree.pri) 2 | include($$PWD/../../../src/3rdparty/btree/btree.pri) 3 | 4 | TARGET = tst_bench_btrees 5 | 6 | QT = core testlib 7 | CONFIG -= app_bundle 8 | CONFIG += testcase 9 | 10 | SOURCES += \ 11 | main.cpp 12 | DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0 13 | -------------------------------------------------------------------------------- /tests/auto/partition/json-validation/required-schema.json: -------------------------------------------------------------------------------- 1 | { 2 | "description": "check if a required property exists", 3 | "type": "object", 4 | "properties": { 5 | "important": { 6 | "required": true 7 | }, 8 | "notimportant": { 9 | "required": false 10 | } 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /tests/shared/shared.pri: -------------------------------------------------------------------------------- 1 | QT += jsondb jsondb-private 2 | 3 | INCLUDEPATH += $$PWD 4 | 5 | HEADERS += \ 6 | $$PWD/util.h \ 7 | $$PWD/qmltestutil.h 8 | 9 | HEADERS += $$PWD/testhelper.h 10 | SOURCES += $$PWD/testhelper.cpp 11 | 12 | RESOURCES += \ 13 | $$PWD/../json.qrc 14 | 15 | DEFINES += JSONDB_DAEMON_BASE=\\\"$$QT.jsondb.bins\\\" 16 | -------------------------------------------------------------------------------- /tests/auto/partition/schemas/address.json: -------------------------------------------------------------------------------- 1 | { 2 | "type": "object", 3 | "properties": { 4 | "name": { 5 | "properties": { 6 | "street": { 7 | "indexed": true, 8 | "type": "string" 9 | }, 10 | "number": { 11 | "type": "number" 12 | } 13 | } 14 | } 15 | } 16 | } 17 | 18 | -------------------------------------------------------------------------------- /tests/auto/queries/queries.pro: -------------------------------------------------------------------------------- 1 | TARGET = tst_queries 2 | 3 | QT = network qml testlib jsondbpartition 4 | CONFIG -= app_bundle 5 | CONFIG += testcase 6 | 7 | DEFINES += SRCDIR=\\\"$$PWD/\\\" 8 | 9 | RESOURCES = queries.qrc 10 | 11 | SOURCES += \ 12 | testjsondbqueries.cpp 13 | 14 | OTHER_FILES += \ 15 | dataset.json 16 | DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0 17 | -------------------------------------------------------------------------------- /tests/auto/partition/schemas/contact.json: -------------------------------------------------------------------------------- 1 | { 2 | "type": "object", 3 | "properties": { 4 | "name": { 5 | "properties": { 6 | "first": { 7 | "indexed": true, 8 | "type": "string" 9 | }, 10 | "last": { 11 | "indexed": true, 12 | "type": "string" 13 | } 14 | } 15 | } 16 | } 17 | } 18 | 19 | -------------------------------------------------------------------------------- /tests/auto/accesscontrol/accesscontrol.pro: -------------------------------------------------------------------------------- 1 | TARGET = tst_accesscontrol 2 | CONFIG += debug 3 | 4 | QT = network qml testlib jsondbpartition jsondbpartition-private 5 | CONFIG -= app_bundle 6 | CONFIG += testcase 7 | 8 | DEFINES += SRCDIR=\\\"$$PWD/\\\" 9 | 10 | RESOURCES+= accesscontrol.qrc 11 | SOURCES += \ 12 | testjsondb.cpp \ 13 | 14 | DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0 15 | -------------------------------------------------------------------------------- /src/jsonstream/jsonstream.pro: -------------------------------------------------------------------------------- 1 | TARGET = QtJsonDbJsonStream 2 | 3 | TEMPLATE = lib 4 | CONFIG += static 5 | 6 | QT = core network 7 | 8 | HEADERS += jsonstream.h 9 | SOURCES += jsonstream.cpp 10 | 11 | # We don't need to install this tool, it's only used for building. 12 | # However we do have to make sure that 'make install' builds it. 13 | dummytarget.CONFIG = dummy_install 14 | INSTALLS += dummytarget 15 | -------------------------------------------------------------------------------- /tests/auto/partition/schemas/ephemeral.json: -------------------------------------------------------------------------------- 1 | { 2 | "type": "object", 3 | "ephemeral": "true", 4 | "properties": { 5 | "name": { 6 | "properties": { 7 | "first": { 8 | "indexed": true, 9 | "type": "string" 10 | }, 11 | "last": { 12 | "indexed": true, 13 | "type": "string" 14 | } 15 | } 16 | } 17 | } 18 | } 19 | 20 | -------------------------------------------------------------------------------- /tools/adb-dump/adb-dump.pro: -------------------------------------------------------------------------------- 1 | include($$PWD/../../src/3rdparty/btree/btree.pri) 2 | 3 | TARGET = adb-dump 4 | DESTDIR = $$QT.jsondb.bins 5 | 6 | target.path = $$[QT_INSTALL_PREFIX]/bin 7 | INSTALLS += target 8 | 9 | QT = core 10 | 11 | mac:CONFIG -= app_bundle 12 | 13 | !mac:LIBS += -lcrypto 14 | 15 | INCLUDEPATH += ../../src/daemon 16 | 17 | HEADERS += ../../src/daemon/aodb.h 18 | 19 | SOURCES += main.cpp ../../src/daemon/aodb.cpp 20 | -------------------------------------------------------------------------------- /tests/auto/partition/json/map-array-conversion.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "_type": "_schemaType", 4 | "name": "com.test.TestView", 5 | "schema": { 6 | "type": "object", 7 | "extends": {"$ref": "View" } 8 | } 9 | }, 10 | { 11 | "_type": "Map", 12 | "targetType": "com.test.TestView", 13 | "map": { 14 | "com.test.Test": "function(test) { jsondb.emit({result: [10, true, \"hello\",null]}) }" 15 | } 16 | } 17 | ] 18 | -------------------------------------------------------------------------------- /tools/jsondb-client/jsondb-client.pro: -------------------------------------------------------------------------------- 1 | TARGET = jsondb-client 2 | DESTDIR = $$QT.jsondb.bins 3 | 4 | target.path = $$[QT_INSTALL_PREFIX]/bin 5 | INSTALLS += target 6 | 7 | QT = core jsondb qml 8 | 9 | LIBS += -ledit 10 | 11 | mac:CONFIG -= app_bundle 12 | 13 | HEADERS += client.h 14 | SOURCES += main.cpp client.cpp 15 | 16 | !contains(DEFINES, QTJSONDB_NO_DEPRECATED) { 17 | HEADERS += jsondbproxy.h 18 | SOURCES += jsondbproxy.cpp 19 | } 20 | 21 | -------------------------------------------------------------------------------- /examples/declarative/desktop-inspector/README.txt: -------------------------------------------------------------------------------- 1 | This is a "desktop" inspector application for JsonDb. It can be used 2 | to view the JSON database while simultaneously running other 3 | applications. 4 | 5 | The column along the left allows you to show (green square) or hide 6 | (red square) all objects of a certain type. The text box allows you 7 | to type in arbitrary queries, the results of which are then displayed. 8 | Queries can also be saved for later use. 9 | -------------------------------------------------------------------------------- /examples/declarative/flickr/flickr.qmlproject: -------------------------------------------------------------------------------- 1 | import QmlProject 1.0 2 | 3 | Project { 4 | /* Include .qml, .js, and image files from current directory and subdirectories */ 5 | QmlFiles { 6 | directory: "." 7 | } 8 | JavaScriptFiles { 9 | directory: "." 10 | } 11 | ImageFiles { 12 | directory: "." 13 | } 14 | /* List of plugin directories passed to QML runtime */ 15 | // importPaths: [ " ../exampleplugin " ] 16 | } 17 | -------------------------------------------------------------------------------- /examples/declarative/joinview/joinview.qmlproject: -------------------------------------------------------------------------------- 1 | import QmlProject 1.0 2 | 3 | Project { 4 | /* Include .qml, .js, and image files from current directory and subdirectories */ 5 | QmlFiles { 6 | directory: "." 7 | } 8 | JavaScriptFiles { 9 | directory: "." 10 | } 11 | ImageFiles { 12 | directory: "." 13 | } 14 | /* List of plugin directories passed to QML runtime */ 15 | // importPaths: [ " ../exampleplugin " ] 16 | } 17 | -------------------------------------------------------------------------------- /examples/declarative/cachingmodel/cachingmodel.qmlproject: -------------------------------------------------------------------------------- 1 | import QmlProject 1.0 2 | 3 | Project { 4 | /* Include .qml, .js, and image files from current directory and subdirectories */ 5 | QmlFiles { 6 | directory: "." 7 | } 8 | JavaScriptFiles { 9 | directory: "." 10 | } 11 | ImageFiles { 12 | directory: "." 13 | } 14 | /* List of plugin directories passed to QML runtime */ 15 | // importPaths: [ " ../exampleplugin " ] 16 | } 17 | -------------------------------------------------------------------------------- /examples/declarative/contactsmodel/contactsmodel.qmlproject: -------------------------------------------------------------------------------- 1 | import QmlProject 1.0 2 | 3 | Project { 4 | /* Include .qml, .js, and image files from current directory and subdirectories */ 5 | QmlFiles { 6 | directory: "." 7 | } 8 | JavaScriptFiles { 9 | directory: "." 10 | } 11 | ImageFiles { 12 | directory: "." 13 | } 14 | /* List of plugin directories passed to QML runtime */ 15 | // importPaths: [ " ../exampleplugin " ] 16 | } 17 | -------------------------------------------------------------------------------- /examples/declarative/notifications/notifications.qmlproject: -------------------------------------------------------------------------------- 1 | import QmlProject 1.0 2 | 3 | Project { 4 | /* Include .qml, .js, and image files from current directory and subdirectories */ 5 | QmlFiles { 6 | directory: "." 7 | } 8 | JavaScriptFiles { 9 | directory: "." 10 | } 11 | ImageFiles { 12 | directory: "." 13 | } 14 | /* List of plugin directories passed to QML runtime */ 15 | // importPaths: [ " ../exampleplugin " ] 16 | } 17 | -------------------------------------------------------------------------------- /examples/declarative/collationindex/collationindex.qmlproject: -------------------------------------------------------------------------------- 1 | import QmlProject 1.0 2 | 3 | Project { 4 | /* Include .qml, .js, and image files from current directory and subdirectories */ 5 | QmlFiles { 6 | directory: "." 7 | } 8 | JavaScriptFiles { 9 | directory: "." 10 | } 11 | ImageFiles { 12 | directory: "." 13 | } 14 | /* List of plugin directories passed to QML runtime */ 15 | // importPaths: [ " ../exampleplugin " ] 16 | } 17 | -------------------------------------------------------------------------------- /examples/declarative/simplelistmodel/simplelistmodel.qmlproject: -------------------------------------------------------------------------------- 1 | import QmlProject 1.0 2 | 3 | Project { 4 | /* Include .qml, .js, and image files from current directory and subdirectories */ 5 | QmlFiles { 6 | directory: "." 7 | } 8 | JavaScriptFiles { 9 | directory: "." 10 | } 11 | ImageFiles { 12 | directory: "." 13 | } 14 | /* List of plugin directories passed to QML runtime */ 15 | // importPaths: [ " ../exampleplugin " ] 16 | } 17 | -------------------------------------------------------------------------------- /examples/declarative/streamingquery/streamingquery.qmlproject: -------------------------------------------------------------------------------- 1 | import QmlProject 1.0 2 | 3 | Project { 4 | /* Include .qml, .js, and image files from current directory and subdirectories */ 5 | QmlFiles { 6 | directory: "." 7 | } 8 | JavaScriptFiles { 9 | directory: "." 10 | } 11 | ImageFiles { 12 | directory: "." 13 | } 14 | /* List of plugin directories passed to QML runtime */ 15 | // importPaths: [ " ../exampleplugin " ] 16 | } 17 | -------------------------------------------------------------------------------- /examples/declarative/desktop-inspector/desktop-inspector.qmlproject: -------------------------------------------------------------------------------- 1 | import QmlProject 1.0 2 | 3 | Project { 4 | /* Include .qml, .js, and image files from current directory and subdirectories */ 5 | QmlFiles { 6 | directory: "." 7 | } 8 | JavaScriptFiles { 9 | directory: "." 10 | } 11 | ImageFiles { 12 | directory: "." 13 | } 14 | /* List of plugin directories passed to QML runtime */ 15 | // importPaths: [ " ../exampleplugin " ] 16 | } 17 | -------------------------------------------------------------------------------- /tests/auto/jsondbscriptengine/jsondbscriptengine.pro: -------------------------------------------------------------------------------- 1 | TARGET = tst_jsondbscriptengine 2 | 3 | QT = testlib jsondbpartition jsondbpartition-private 4 | CONFIG -= app_bundle 5 | CONFIG += testcase 6 | 7 | DEFINES += SRCDIR=\\\"$$PWD/\\\" 8 | 9 | SOURCES += \ 10 | test-jsondbscriptengine.cpp 11 | 12 | OTHER_FILES += \ 13 | test_inject.js 14 | 15 | data.files = $$OTHER_FILES 16 | data.path = $$[QT_INSTALL_TESTS]/$$TARGET 17 | INSTALLS += data 18 | DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0 19 | -------------------------------------------------------------------------------- /tests/benchmarks/jsondbobject/jsondbobject.pro: -------------------------------------------------------------------------------- 1 | TARGET = tst_bench_object 2 | 3 | QT = network qml testlib jsondbpartition 4 | CONFIG -= app_bundle 5 | CONFIG += testcase 6 | 7 | DEFINES += SRCDIR=\\\"$$PWD/\\\" 8 | 9 | # HACK, remove when jsondbpartition separates private api from public api 10 | include(../../../src/3rdparty/btree/btree.pri) 11 | include(../../../src/hbtree/hbtree.pri) 12 | 13 | SOURCES += \ 14 | bench_jsondbobject.cpp \ 15 | 16 | DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0 17 | -------------------------------------------------------------------------------- /examples/declarative/reduce-phone/reduce-phone.qmlproject: -------------------------------------------------------------------------------- 1 | import QmlProject 1.1 2 | 3 | Project { 4 | mainFile: "reduce-phone.qml" 5 | 6 | /* Include .qml, .js, and image files from current directory and subdirectories */ 7 | QmlFiles { 8 | directory: "." 9 | } 10 | JavaScriptFiles { 11 | directory: "." 12 | } 13 | ImageFiles { 14 | directory: "." 15 | } 16 | /* List of plugin directories passed to QML runtime */ 17 | // importPaths: [ "../exampleplugin" ] 18 | } 19 | -------------------------------------------------------------------------------- /examples/declarative/simpleindex/simpleindex.qmlproject: -------------------------------------------------------------------------------- 1 | import QmlProject 1.1 2 | 3 | Project { 4 | mainFile: "simpleindex.qml" 5 | 6 | /* Include .qml, .js, and image files from current directory and subdirectories */ 7 | QmlFiles { 8 | directory: "." 9 | } 10 | JavaScriptFiles { 11 | directory: "." 12 | } 13 | ImageFiles { 14 | directory: "." 15 | } 16 | /* List of plugin directories passed to QML runtime */ 17 | // importPaths: [ "../exampleplugin" ] 18 | } 19 | -------------------------------------------------------------------------------- /src/hbtree/hbtree.pri: -------------------------------------------------------------------------------- 1 | INCLUDEPATH += $$PWD/ 2 | 3 | include($$PWD/../3rdparty/zlib/zlib.pri) 4 | 5 | HEADERS += \ 6 | $$PWD/hbtreeglobal.h \ 7 | $$PWD/orderedlist_p.h \ 8 | $$PWD/hbtree.h \ 9 | $$PWD/hbtreetransaction.h \ 10 | $$PWD/hbtreecursor.h \ 11 | $$PWD/hbtree_p.h \ 12 | $$PWD/hbtreeassert_p.h 13 | 14 | SOURCES += \ 15 | $$PWD/orderedlist.cpp \ 16 | $$PWD/hbtree.cpp \ 17 | $$PWD/hbtreetransaction.cpp \ 18 | $$PWD/hbtreecursor.cpp \ 19 | $$PWD/hbtreeassert.cpp 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /tests/benchmarks/client/client.pro: -------------------------------------------------------------------------------- 1 | TEMPLATE = app 2 | TARGET = tst_bench_client 3 | 4 | QT = core network testlib jsondb jsondb-private 5 | 6 | DEFINES += JSONDB_DAEMON_BASE=\\\"$$QT.jsondb.bins\\\" 7 | 8 | CONFIG += testcase 9 | CONFIG -= app_bundle 10 | 11 | include($$PWD/../../shared/shared.pri) 12 | 13 | SOURCES += client-benchmark.cpp 14 | OTHER_FILES += partitions.json 15 | 16 | data.files = $$OTHER_FILES 17 | data.path = $$[QT_INSTALL_TESTS]/$$TARGET 18 | INSTALLS += data 19 | DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0 20 | -------------------------------------------------------------------------------- /tests/auto/cmake/test_modules/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | 2 | cmake_minimum_required(VERSION 2.8) 3 | 4 | project(test_modules) 5 | 6 | find_package(Qt5Core REQUIRED) 7 | 8 | find_package(Qt5JsonDb REQUIRED) 9 | 10 | include_directories( 11 | ${Qt5JsonDb_INCLUDE_DIRS} 12 | ) 13 | 14 | add_definitions( 15 | ${Qt5JsonDb_DEFINITIONS} 16 | ) 17 | 18 | set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${Qt5Core_EXECUTABLE_COMPILE_FLAGS}") 19 | 20 | add_executable(mainapp main.cpp) 21 | target_link_libraries(mainapp 22 | ${Qt5JsonDb_LIBRARIES} 23 | ) 24 | -------------------------------------------------------------------------------- /doc/doc.pri: -------------------------------------------------------------------------------- 1 | OTHER_FILES += \ 2 | $$PWD/jsondb.qdocconf \ 3 | $$PWD/jsondb-dita.qdocconf \ 4 | $$PWD/src/*.qdoc 5 | 6 | qtPrepareTool(QDOC, qdoc) 7 | docs_target.target = docs 8 | docs_target.commands = $$QDOC $$PWD/jsondb.qdocconf 9 | 10 | ditadocs_target.target = ditadocs 11 | ditadocs_target.commands = $$QDOC $$PWD/jsondb-dita.qdocconf 12 | 13 | QMAKE_EXTRA_TARGETS = docs_target ditadocs_target 14 | QMAKE_CLEAN += \ 15 | "-r $$PWD/html" \ 16 | "-r $$PWD/ditaxml" 17 | 18 | -------------------------------------------------------------------------------- /tests/auto/auto.pro: -------------------------------------------------------------------------------- 1 | TEMPLATE = subdirs 2 | SUBDIRS = \ 3 | client \ 4 | cmake \ 5 | partition \ 6 | accesscontrol \ 7 | jsondblistmodel \ 8 | jsondbsortinglistmodel \ 9 | jsondbcachinglistmodel \ 10 | jsondbpartition \ 11 | jsondbnotification \ 12 | jsondbqueryobject \ 13 | jsondbscriptengine \ 14 | queries \ 15 | qjsondbrequest \ 16 | qjsondbwatcher \ 17 | qjsondbflushrequest \ 18 | jsonstream \ 19 | hbtree \ 20 | headersclean \ 21 | storage 22 | 23 | testcocoon: SUBDIRS -= headersclean 24 | -------------------------------------------------------------------------------- /tests/benchmarks/partition/partition.pro: -------------------------------------------------------------------------------- 1 | TARGET = tst_bench_partition 2 | 3 | QT = network qml testlib jsondbpartition jsondbpartition-private 4 | CONFIG -= app_bundle 5 | CONFIG += testcase 6 | 7 | DEFINES += SRCDIR=\\\"$$PWD/\\\" 8 | 9 | RESOURCES+=../../json.qrc partition.qrc 10 | 11 | # HACK, remove when jsondbpartition separates private api from public api 12 | include(../../../src/3rdparty/btree/btree.pri) 13 | include(../../../src/hbtree/hbtree.pri) 14 | 15 | SOURCES += \ 16 | bench_partition.cpp \ 17 | 18 | DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0 19 | -------------------------------------------------------------------------------- /tests/json.qrc: -------------------------------------------------------------------------------- 1 | 2 | 3 | auto/client/create-test.json 4 | auto/client/json 5 | shared/json/list-objects.json 6 | auto/jsondblistmodel/list-objects.json 7 | auto/jsondbsortinglistmodel/list-objects.json 8 | auto/queries/dataset.json 9 | auto/partition/json/map-reduce.json 10 | 11 | 12 | -------------------------------------------------------------------------------- /tests/auto/partition/json-validation/string-boundaries-schema.json: -------------------------------------------------------------------------------- 1 | { 2 | "title": "Check string boundaries", 3 | "description": "Checks for 5.16 - 5.18 points of spec", 4 | "type": "object", 5 | "properties": { 6 | "max5chars": { 7 | "type": "string", 8 | "maxLength": 5 9 | }, 10 | "min5chars": { 11 | "type": "string", 12 | "minLength": 5 13 | }, 14 | "regexpPattern": { 15 | "type": "string", 16 | "pattern": "[a]+" 17 | } 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /tests/auto/qjsondbflushrequest/qjsondbflushrequest.pro: -------------------------------------------------------------------------------- 1 | TARGET = tst_qjsondbflushrequest 2 | 3 | QT = network testlib jsondb-private 4 | CONFIG -= app_bundle 5 | CONFIG += testcase 6 | 7 | include($$PWD/../../shared/shared.pri) 8 | 9 | DEFINES += SRCDIR=\\\"$$PWD/\\\" 10 | 11 | RESOURCES += ../partition/partition.qrc 12 | 13 | SOURCES += testqjsondbflushrequest.cpp 14 | 15 | OTHER_FILES += \ 16 | partitions.json 17 | 18 | data.files = $$OTHER_FILES 19 | data.path = $$[QT_INSTALL_TESTS]/$$TARGET 20 | INSTALLS += data 21 | 22 | DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0 23 | -------------------------------------------------------------------------------- /examples/declarative/map-phone/map-phone.qmlproject: -------------------------------------------------------------------------------- 1 | /* File generated by Qt Creator, version 2.3.1 */ 2 | 3 | import QmlProject 1.1 4 | 5 | Project { 6 | mainFile: "map-phone.qml" 7 | 8 | /* Include .qml, .js, and image files from current directory and subdirectories */ 9 | QmlFiles { 10 | directory: "." 11 | } 12 | JavaScriptFiles { 13 | directory: "." 14 | } 15 | ImageFiles { 16 | directory: "." 17 | } 18 | /* List of plugin directories passed to QML runtime */ 19 | // importPaths: [ "../exampleplugin" ] 20 | } 21 | -------------------------------------------------------------------------------- /tests/auto/accesscontrol/json/index-test.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "_type": "Index", 4 | "objectType": "Phone", 5 | "name": "name", 6 | "propertyName": "name", 7 | "propertyType": "string" 8 | }, 9 | { 10 | "_type": "Index", 11 | "name": "another", 12 | "objectType": ["Phone", "Contact"], 13 | "propertyName": "field", 14 | "propertyType": "string", 15 | "locale": "en_US", 16 | "collation": "default", 17 | "casePreference": "IgnoreCase" 18 | }, 19 | { 20 | "_type": "Index", 21 | "name": "noObjectType", 22 | "propertyName": "field", 23 | "propertyType": "string" 24 | } 25 | ] 26 | -------------------------------------------------------------------------------- /tests/auto/qjsondbrequest/qjsondbrequest.pro: -------------------------------------------------------------------------------- 1 | TARGET = tst_qjsondbrequest 2 | 3 | QT = network testlib jsondb-private 4 | CONFIG -= app_bundle 5 | CONFIG += testcase 6 | 7 | include($$PWD/../../shared/shared.pri) 8 | 9 | DEFINES += JSONDB_DAEMON_BASE=\\\"$$QT.jsondb.bins\\\" 10 | DEFINES += SRCDIR=\\\"$$PWD/\\\" 11 | 12 | RESOURCES += ../partition/partition.qrc 13 | 14 | SOURCES += testqjsondbrequest.cpp 15 | 16 | OTHER_FILES += \ 17 | partitions.json 18 | 19 | data.files = $$OTHER_FILES 20 | data.path = $$[QT_INSTALL_TESTS]/$$TARGET 21 | INSTALLS += data 22 | DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0 23 | -------------------------------------------------------------------------------- /tests/auto/qjsondbwatcher/qjsondbwatcher.pro: -------------------------------------------------------------------------------- 1 | TARGET = tst_qjsondbwatcher 2 | 3 | QT = network testlib jsondb-private 4 | CONFIG -= app_bundle 5 | CONFIG += testcase 6 | 7 | include($$PWD/../../shared/shared.pri) 8 | 9 | DEFINES += JSONDB_DAEMON_BASE=\\\"$$QT.jsondb.bins\\\" 10 | DEFINES += SRCDIR=\\\"$$PWD/\\\" 11 | 12 | RESOURCES += ../partition/partition.qrc 13 | 14 | SOURCES += testqjsondbwatcher.cpp 15 | 16 | OTHER_FILES += \ 17 | partitions.json 18 | 19 | data.files = $$OTHER_FILES 20 | data.path = $$[QT_INSTALL_TESTS]/$$TARGET 21 | INSTALLS += data 22 | DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0 23 | -------------------------------------------------------------------------------- /tests/auto/partition/json-validation/integer-boundaries-schema.json: -------------------------------------------------------------------------------- 1 | { 2 | "description": "Check numbers boundaries", 3 | "type": "object", 4 | "properties": { 5 | "oneOrLess": { 6 | "type": "number", 7 | "maximum": 1 8 | }, 9 | "lessThenOne": { 10 | "type": "number", 11 | "exclusiveMaximum": 1 12 | }, 13 | "oneOrMore": { 14 | "type": "number", 15 | "minimum": 1 16 | }, 17 | "moreThenOne": { 18 | "type": "number", 19 | "exclusiveMinimum": 1 20 | } 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /tests/auto/partition/json-validation/numbers-boundaries-schema.json: -------------------------------------------------------------------------------- 1 | { 2 | "description": "Check numbers boundaries", 3 | "type": "object", 4 | "properties": { 5 | "oneOrLess": { 6 | "type": "number", 7 | "maximum": 1.1 8 | }, 9 | "lessThenOne": { 10 | "type": "number", 11 | "exclusiveMaximum": 1.1 12 | }, 13 | "oneOrMore": { 14 | "type": "number", 15 | "minimum": 1.1 16 | }, 17 | "moreThenOne": { 18 | "type": "number", 19 | "exclusiveMinimum": 1.1 20 | } 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /src/partition/schema/Capability.json: -------------------------------------------------------------------------------- 1 | { 2 | "type": "object", 3 | "properties": { 4 | "name": { 5 | "type": "string", 6 | "description": "Name of the capability" 7 | }, 8 | "partition": { 9 | "type":"string", 10 | "description": "partition where this capability should be used" 11 | }, 12 | 13 | "accessRules": { 14 | "type": "object", 15 | "patternProperties": { 16 | ".*": { 17 | "type": "array", 18 | "items": { 19 | "type": "string", 20 | "description": "A JsonDb query string. Objects matching this query will be allowed for this access type." 21 | } 22 | } 23 | } 24 | } 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /tests/auto/accesscontrol/json/capabilities-indexes.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "_type": "Capability", 4 | "name": "indexes", 5 | "partition": "all", 6 | "accessRules": { 7 | "rw": { 8 | "read": ["[?_type startsWith \"Phone\"]", "[?_type = \"Contact\"]", "[?_type = \"Index\"]"], 9 | "write": ["[?_type = \"Index\"]"] 10 | } 11 | } 12 | }, 13 | { 14 | "_type": "Capability", 15 | "name": "noindexes", 16 | "partition": "all", 17 | "accessRules": { 18 | "rw": { 19 | "read": ["[?_type startsWith \"Phone\"]", "[?_type = \"Index\"]"], 20 | "write": ["[?_type = \"Index\"]"] 21 | } 22 | } 23 | } 24 | ] 25 | -------------------------------------------------------------------------------- /src/imports/jsondb/jsondb.pro: -------------------------------------------------------------------------------- 1 | CXX_MODULE = jsondb 2 | TARGET = jsondbplugin 3 | 4 | QT += network qml jsondb jsondb-private 5 | 6 | HEADERS += \ 7 | jsondbpartition.h \ 8 | jsondbnotification.h \ 9 | plugin.h \ 10 | jsondatabase.h \ 11 | jsondbqueryobject.h \ 12 | jsondbsortinglistmodel_p.h \ 13 | jsondbsortinglistmodel.h \ 14 | jsondblistmodel.h 15 | 16 | SOURCES += \ 17 | jsondbpartition.cpp \ 18 | jsondbnotification.cpp \ 19 | plugin.cpp \ 20 | jsondatabase.cpp \ 21 | jsondbqueryobject.cpp \ 22 | jsondbsortinglistmodel.cpp \ 23 | jsondblistmodel.cpp 24 | 25 | load(qml_plugin) 26 | 27 | OTHER_FILES += jsondb.json 28 | -------------------------------------------------------------------------------- /tests/auto/client/client.pro: -------------------------------------------------------------------------------- 1 | TARGET = tst_client 2 | 3 | QT = network testlib jsondb-private 4 | CONFIG -= app_bundle 5 | CONFIG += testcase 6 | 7 | include($$PWD/../../shared/shared.pri) 8 | 9 | DEFINES += JSONDB_DAEMON_BASE=\\\"$$QT.jsondb.bins\\\" 10 | DEFINES += SRCDIR=\\\"$$PWD/\\\" 11 | 12 | # allow overriding the prefix for /etc/passwd and friends 13 | NSS_PREFIX = $$(NSS_PREFIX) 14 | DEFINES += NSS_PREFIX=\\\"$$NSS_PREFIX\\\" 15 | 16 | SOURCES += test-jsondb-client.cpp 17 | 18 | OTHER_FILES += \ 19 | partitions.json 20 | 21 | data.files = $$OTHER_FILES 22 | data.path = $$[QT_INSTALL_TESTS]/$$TARGET 23 | INSTALLS += data 24 | DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0 25 | -------------------------------------------------------------------------------- /examples/jsondb-client/example.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "_type" : "MyContact", 4 | "firstName" : "John", 5 | "lastName" : "Smith", 6 | "age" : 55 7 | }, 8 | { 9 | "_type" : "MyContact", 10 | "firstName" : "Bob", 11 | "lastName" : "Jones", 12 | "age" : 32 13 | }, 14 | { 15 | "_type" : "MyContact", 16 | "firstName" : "Sam", 17 | "lastName" : "Johnson", 18 | "age" : 28 19 | }, 20 | { 21 | "_type" : "MyContact", 22 | "firstName" : "Jane", 23 | "lastName" : "Smith", 24 | "age" : 54 25 | }, 26 | { 27 | "_type" : "MyContact", 28 | "firstName" : "Judy", 29 | "lastName" : "Jones", 30 | "age" : 34 31 | } 32 | ] 33 | -------------------------------------------------------------------------------- /tests/auto/jsondblistmodel/jsondblistmodel.pro: -------------------------------------------------------------------------------- 1 | TARGET = tst_jsondblistmodel 2 | 3 | INCLUDEPATH += ../../shared/ 4 | 5 | QT = core network testlib gui qml jsondb 6 | CONFIG -= app_bundle 7 | CONFIG += testcase 8 | 9 | include($$PWD/../../shared/shared.pri) 10 | 11 | DEFINES += JSONDB_DAEMON_BASE=\\\"$$QT.jsondb.bins\\\" 12 | DEFINES += SRCDIR=\\\"$$PWD/\\\" 13 | 14 | HEADERS += testjsondblistmodel.h \ 15 | $$PWD/../../shared/requestwrapper.h 16 | SOURCES += testjsondblistmodel.cpp 17 | 18 | OTHER_FILES += \ 19 | partitions.json 20 | 21 | data.files = $$OTHER_FILES 22 | data.path = $$[QT_INSTALL_TESTS]/$$TARGET 23 | INSTALLS += data 24 | DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0 25 | -------------------------------------------------------------------------------- /tests/auto/jsondbpartition/jsondbpartition.pro: -------------------------------------------------------------------------------- 1 | TARGET = tst_jsondbpartition 2 | 3 | INCLUDEPATH += ../../shared/ 4 | 5 | QT = core network testlib gui qml jsondb 6 | CONFIG -= app_bundle 7 | CONFIG += testcase 8 | 9 | include($$PWD/../../shared/shared.pri) 10 | 11 | DEFINES += JSONDB_DAEMON_BASE=\\\"$$QT.jsondb.bins\\\" 12 | DEFINES += SRCDIR=\\\"$$PWD/\\\" 13 | 14 | HEADERS += testjsondbpartition.h \ 15 | $$PWD/../../shared/requestwrapper.h 16 | SOURCES += testjsondbpartition.cpp 17 | 18 | OTHER_FILES += \ 19 | partitions.json 20 | 21 | data.files = $$OTHER_FILES 22 | data.path = $$[QT_INSTALL_TESTS]/$$TARGET 23 | INSTALLS += data 24 | DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0 25 | -------------------------------------------------------------------------------- /tests/auto/partition/json/pk-capability.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "_type": "_schemaType", 4 | "name": "PrimaryKeyTest", 5 | "schema": { 6 | "type": "object", 7 | "primaryKey": ["_type", "name"], 8 | "properties": { 9 | "name": { 10 | "type": "string", 11 | "description": "Name of the object" 12 | } 13 | } 14 | } 15 | }, 16 | { 17 | "_type": "PrimaryKeyTest", 18 | "name": "foobar", 19 | "otherStuff": { 20 | "dataflow": { 21 | "number": "6.847" 22 | } 23 | } 24 | } 25 | ] 26 | -------------------------------------------------------------------------------- /tests/benchmarks/jsondbcachinglistmodel/jsondbcachinglistmodel.pro: -------------------------------------------------------------------------------- 1 | TARGET = tst_bench_jsondbcachinglistmodel 2 | 3 | QT = core network testlib gui qml jsondb 4 | CONFIG -= app_bundle 5 | CONFIG += testcase 6 | 7 | include($$PWD/../../shared/shared.pri) 8 | 9 | DEFINES += JSONDB_DAEMON_BASE=\\\"$$QT.jsondb.bins\\\" 10 | DEFINES += SRCDIR=\\\"$$PWD/\\\" 11 | 12 | HEADERS += jsondbcachinglistmodel-bench.h \ 13 | $$PWD/../../shared/requestwrapper.h 14 | SOURCES += jsondbcachinglistmodel-bench.cpp 15 | 16 | OTHER_FILES += partitions.json 17 | 18 | data.files = $$OTHER_FILES 19 | data.path = $$[QT_INSTALL_TESTS]/$$TARGET 20 | INSTALLS += data 21 | DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0 22 | -------------------------------------------------------------------------------- /tests/benchmarks/jsondbsortinglistmodel/jsondbsortinglistmodel.pro: -------------------------------------------------------------------------------- 1 | TARGET = tst_bench_jsondbsortinglistmodel 2 | 3 | QT = core network testlib gui qml jsondb 4 | CONFIG -= app_bundle 5 | CONFIG += testcase 6 | 7 | include($$PWD/../../shared/shared.pri) 8 | 9 | DEFINES += JSONDB_DAEMON_BASE=\\\"$$QT.jsondb.bins\\\" 10 | DEFINES += SRCDIR=\\\"$$PWD/\\\" 11 | 12 | HEADERS += jsondbsortinglistmodel-bench.h \ 13 | $$PWD/../../shared/requestwrapper.h 14 | SOURCES += jsondbsortinglistmodel-bench.cpp 15 | 16 | OTHER_FILES += partitions.json 17 | 18 | data.files = $$OTHER_FILES 19 | data.path = $$[QT_INSTALL_TESTS]/$$TARGET 20 | INSTALLS += data 21 | DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0 22 | -------------------------------------------------------------------------------- /tests/auto/jsondbqueryobject/jsondbqueryobject.pro: -------------------------------------------------------------------------------- 1 | TARGET = tst_jsondbqueryobject 2 | 3 | INCLUDEPATH += ../../shared/ 4 | 5 | QT = core network testlib gui qml jsondb 6 | CONFIG -= app_bundle 7 | CONFIG += testcase 8 | 9 | include($$PWD/../../shared/shared.pri) 10 | 11 | DEFINES += JSONDB_DAEMON_BASE=\\\"$$QT.jsondb.bins\\\" 12 | DEFINES += SRCDIR=\\\"$$PWD/\\\" 13 | 14 | HEADERS += testjsondbqueryobject.h \ 15 | $$PWD/../../shared/requestwrapper.h 16 | SOURCES += testjsondbqueryobject.cpp 17 | 18 | OTHER_FILES += \ 19 | partitions.json 20 | 21 | data.files = $$OTHER_FILES 22 | data.path = $$[QT_INSTALL_TESTS]/$$TARGET 23 | INSTALLS += data 24 | DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0 25 | -------------------------------------------------------------------------------- /tests/auto/jsondbnotification/jsondbnotification.pro: -------------------------------------------------------------------------------- 1 | TARGET = tst_jsondbnotification 2 | 3 | INCLUDEPATH += ../../shared/ 4 | 5 | QT = core network testlib gui qml jsondb 6 | CONFIG -= app_bundle 7 | CONFIG += testcase 8 | 9 | include($$PWD/../../shared/shared.pri) 10 | 11 | DEFINES += JSONDB_DAEMON_BASE=\\\"$$QT.jsondb.bins\\\" 12 | DEFINES += SRCDIR=\\\"$$PWD/\\\" 13 | 14 | HEADERS += testjsondbnotification.h \ 15 | $$PWD/../../shared/requestwrapper.h 16 | SOURCES += testjsondbnotification.cpp 17 | 18 | OTHER_FILES += \ 19 | partitions.json 20 | 21 | data.files = $$OTHER_FILES 22 | data.path = $$[QT_INSTALL_TESTS]/$$TARGET 23 | INSTALLS += data 24 | DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0 25 | -------------------------------------------------------------------------------- /tests/auto/jsondbsortinglistmodel/jsondbsortinglistmodel.pro: -------------------------------------------------------------------------------- 1 | TARGET = tst_jsondbsortinglistmodel 2 | 3 | INCLUDEPATH += ../../shared/ 4 | 5 | QT = core network testlib gui qml jsondb 6 | CONFIG -= app_bundle 7 | CONFIG += testcase 8 | 9 | include($$PWD/../../shared/shared.pri) 10 | 11 | DEFINES += JSONDB_DAEMON_BASE=\\\"$$QT.jsondb.bins\\\" 12 | DEFINES += SRCDIR=\\\"$$PWD/\\\" 13 | 14 | HEADERS += testjsondbsortinglistmodel.h \ 15 | $$PWD/../../shared/requestwrapper.h 16 | SOURCES += testjsondbsortinglistmodel.cpp 17 | 18 | OTHER_FILES += \ 19 | partitions.json 20 | 21 | data.files = $$OTHER_FILES 22 | data.path = $$[QT_INSTALL_TESTS]/$$TARGET 23 | INSTALLS += data 24 | DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0 25 | -------------------------------------------------------------------------------- /tests/auto/partition/json/multi-map.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "_type": "_schemaType", 4 | "name": "MultiMapView1", 5 | "schema": { 6 | "type": "object", 7 | "extends": {"$ref": "View"} 8 | } 9 | }, 10 | { 11 | "_type": "_schemaType", 12 | "name": "MultiMapView2", 13 | "schema": { 14 | "type": "object", 15 | "extends": {"$ref": "View"} 16 | } 17 | }, 18 | { 19 | "_type": "Map", 20 | "targetType": "MultiMapView1", 21 | "map": {"MultiMapSourceType": "function (o) { jsondb.emit({key: o }); }"} 22 | }, 23 | { 24 | "_type": "Map", 25 | "targetType": "MultiMapView2", 26 | "map": {"MultiMapSourceType": "function (o) { jsondb.emit({key: o }); }"} 27 | } 28 | ] 29 | -------------------------------------------------------------------------------- /tests/auto/jsondbcachinglistmodel/jsondbcachinglistmodel.pro: -------------------------------------------------------------------------------- 1 | TARGET = tst_jsondbcachinglistmodel 2 | 3 | INCLUDEPATH += ../../shared/ 4 | 5 | QT = core network testlib gui qml jsondb-private 6 | CONFIG -= app_bundle 7 | CONFIG += testcase 8 | 9 | include($$PWD/../../shared/shared.pri) 10 | 11 | DEFINES += JSONDB_DAEMON_BASE=\\\"$$QT.jsondb.bins\\\" 12 | DEFINES += SRCDIR=\\\"$$PWD/\\\" 13 | 14 | HEADERS += testjsondbcachinglistmodel.h \ 15 | $$PWD/../../shared/requestwrapper.h 16 | SOURCES += testjsondbcachinglistmodel.cpp 17 | 18 | OTHER_FILES += \ 19 | partitions.json 20 | 21 | data.files = $$OTHER_FILES 22 | data.path = $$[QT_INSTALL_TESTS]/$$TARGET 23 | INSTALLS += data 24 | DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0 25 | -------------------------------------------------------------------------------- /tests/auto/partition/json-validation/array-items-schema.json: -------------------------------------------------------------------------------- 1 | { 2 | "description": "Check specification of array:items (5.5)", 3 | "type": "object", 4 | "properties": { 5 | "empty": { 6 | "description": "that is a stupid edge case, but it should work", 7 | "items": {} 8 | }, 9 | "number": { 10 | "items": { 11 | "type": "number", 12 | "maximum": 10 13 | } 14 | }, 15 | "object": { 16 | "items": { 17 | "properties": { 18 | "id": { "type": "integer", "required" : true }, 19 | "foo": { "type": "string"} 20 | } 21 | } 22 | } 23 | } 24 | } -------------------------------------------------------------------------------- /tests/auto/storage/storage.pro: -------------------------------------------------------------------------------- 1 | #------------------------------------------------- 2 | # 3 | # Project created by QtCreator 2012-05-09T16:09:50 4 | # 5 | #------------------------------------------------- 6 | 7 | QT += testlib 8 | 9 | QT -= gui 10 | 11 | TARGET = tst_storage 12 | CONFIG += console 13 | CONFIG -= app_bundle 14 | CONFIG += testcase 15 | 16 | include($$PWD/../../shared/shared.pri) 17 | 18 | DEFINES += JSONDB_DAEMON_BASE=\\\"$$QT.jsondb.bins\\\" 19 | DEFINES += SRCDIR=\\\"$$PWD/\\\" 20 | 21 | # allow overriding the prefix for /etc/passwd and friends 22 | NSS_PREFIX = $$(NSS_PREFIX) 23 | DEFINES += NSS_PREFIX=\\\"$$NSS_PREFIX\\\" 24 | 25 | TEMPLATE = app 26 | 27 | SOURCES += tst_storage.cpp 28 | DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0 29 | -------------------------------------------------------------------------------- /src/partition/schema/Index.json: -------------------------------------------------------------------------------- 1 | { 2 | "type": "object", 3 | "properties": { 4 | "name": { 5 | "type": "string", 6 | "description": "Name of the index. Default to the value of propertyName, if non-empty. Required if propertyFunction is specified." 7 | }, 8 | "propertyName": { 9 | "type": "string", 10 | "description": "Property to index." 11 | }, 12 | "propertyFunction": { 13 | "type": "string", 14 | "description": "String that evaluates to a function that emits the index values. Mutually exclusive with propertyName." 15 | }, 16 | "propertyType": { 17 | "type": "string", 18 | "description": "Type of values stored in that property." 19 | }, 20 | "objectType": { 21 | "description": "Object type to index. Optional." 22 | } 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /tests/auto/partition/partition.pro: -------------------------------------------------------------------------------- 1 | TARGET = tst_partition 2 | CONFIG += debug 3 | 4 | QT = network qml testlib jsondbpartition jsondbpartition-private 5 | CONFIG -= app_bundle 6 | CONFIG += testcase 7 | 8 | DEFINES += SRCDIR=\\\"$$PWD/\\\" 9 | 10 | RESOURCES += json-validation.qrc partition.qrc 11 | 12 | unix:!mac:contains(QT_CONFIG,icu) { 13 | LIBS += -licuuc -licui18n 14 | } else { 15 | DEFINES += NO_COLLATION_SUPPORT 16 | } 17 | 18 | # HACK, remove when jsondbpartition separates private api from public api 19 | include(../../../src/3rdparty/btree/btree.pri) 20 | include(../../../src/hbtree/hbtree.pri) 21 | 22 | SOURCES += \ 23 | testpartition.cpp \ 24 | 25 | config_icu { 26 | LIBS += -licuuc -licui18n 27 | } else { 28 | DEFINES += NO_COLLATION_SUPPORT 29 | } 30 | 31 | DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0 32 | -------------------------------------------------------------------------------- /tests/auto/partition/json-validation/type-schema.json: -------------------------------------------------------------------------------- 1 | { 2 | "description": "check if a property type is correct", 3 | "type": "object", 4 | "properties": { 5 | "string": { 6 | "type": "string" 7 | }, 8 | "number": { 9 | "type": "number" 10 | }, 11 | "integer": { 12 | "type": "integer" 13 | }, 14 | "boolean": { 15 | "type": "boolean" 16 | }, 17 | "object": { 18 | "type": "object" 19 | }, 20 | "array": { 21 | "type": "array" 22 | }, 23 | "null": { 24 | "type": "null" 25 | }, 26 | "any": { 27 | "type": "any" 28 | }, 29 | "mixed": { 30 | "type": ["string", "integer"] 31 | } 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /sync.profile: -------------------------------------------------------------------------------- 1 | %modules = ( # path to module name map 2 | "QtJsonDb" => "$basedir/src/client", 3 | "QtJsonDbPartition" => "$basedir/src/partition", 4 | ); 5 | %moduleheaders = ( # restrict the module headers to those found in relative path 6 | ); 7 | %classnames = ( 8 | "qjsondbglobal.h" => "QtJsonDbGlobal", 9 | ); 10 | $publicclassregexp = "QJsonDb.+"; 11 | # Module dependencies. 12 | # Every module that is required to build this module should have one entry. 13 | # Each of the module version specifiers can take one of the following values: 14 | # - A specific Git revision. 15 | # - any git symbolic ref resolvable from the module's repository (e.g. "refs/heads/master" to track master branch) 16 | # 17 | %dependencies = ( 18 | "qtbase" => "refs/heads/stable", 19 | "qtdeclarative" => "refs/heads/stable", 20 | "qtxmlpatterns" => "refs/heads/stable", 21 | ); 22 | -------------------------------------------------------------------------------- /src/daemon/daemon.pro: -------------------------------------------------------------------------------- 1 | TARGET = jsondb 2 | DESTDIR = $$QT.jsondb.bins 3 | target.path = $$[QT_INSTALL_PREFIX]/bin 4 | INSTALLS += target 5 | 6 | include($$PWD/../jsonstream/jsonstream.pri) 7 | 8 | QT = core network jsondbpartition jsondbpartition-private 9 | 10 | mac:CONFIG -= app_bundle 11 | 12 | # HACK, remove when jsondbpartition separates private api from public api 13 | include(../3rdparty/btree/btree.pri) 14 | include(../hbtree/hbtree.pri) 15 | INCLUDEPATH += $$PWD/../common 16 | 17 | HEADERS += \ 18 | $$PWD/dbserver.h \ 19 | $$PWD/jsondbephemeralpartition.h \ 20 | $$PWD/jsondbsignals.h \ 21 | $$PWD/../common/jsondbsocketname_p.h \ 22 | $$PWD/clientjsonstream.h 23 | 24 | SOURCES += \ 25 | $$PWD/main.cpp \ 26 | $$PWD/dbserver.cpp \ 27 | $$PWD/jsondbephemeralpartition.cpp \ 28 | $$PWD/jsondbsignals.cpp \ 29 | $$PWD/clientjsonstream.cpp 30 | 31 | systemd { 32 | DEFINES += USE_SYSTEMD 33 | LIBS += -lsystemd-daemon 34 | } 35 | -------------------------------------------------------------------------------- /tests/auto/accesscontrol/json/capabilities-view.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "_type": "Capability", 4 | "name": "views", 5 | "partition": "all", 6 | "accessRules": { 7 | "rw": { 8 | "read": ["[?_type startsWith \"Phone\"]", "[?_type = \"Contact\"]", "[?_type = \"_schemaType\"]", "[?_type = \"Map\"]", "[?_type = \"Reduce\"]"], 9 | "write": ["[?_type startsWith \"Phone\"]", "[?_type = \"Contact\"]", "[?_type = \"_schemaType\"]", "[?_type = \"Map\"]", "[?_type = \"Reduce\"]"] 10 | } 11 | } 12 | }, 13 | { 14 | "_type": "Capability", 15 | "name": "noviews", 16 | "partition": "all", 17 | "accessRules": { 18 | "rw": { 19 | "read": ["[?_type = \"Contact\"]", "[?_type = \"_schemaType\"]", "[?_type = \"Map\"]", "[?_type = \"Reduce\"]"], 20 | "write": ["[?_type = \"Contact\"]", "[?_type = \"_schemaType\"]", "[?_type = \"Map\"]", "[?_type = \"Reduce\"]", "[?_type = \"PhoneCount3\"]"] 21 | } 22 | } 23 | } 24 | ] 25 | -------------------------------------------------------------------------------- /tests/auto/partition/json/index-casesensitive.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "_type": "IndexCaseSensitive", 4 | "field": "aaa" 5 | }, 6 | { 7 | "_type": "IndexCaseSensitive", 8 | "field": "aBB" 9 | }, 10 | { 11 | "_type": "IndexCaseSensitive", 12 | "field": "Aba" 13 | }, 14 | { 15 | "_type": "IndexCaseSensitive", 16 | "field": "Aab" 17 | }, 18 | { 19 | "_type": "IndexCaseSensitive", 20 | "field": "AAA" 21 | }, 22 | { 23 | "_type": "IndexCaseSensitive", 24 | "field": "Aaa" 25 | }, 26 | { 27 | "_type": "IndexCaseSensitive", 28 | "field": "AAa" 29 | }, 30 | { 31 | "_type": "Index", 32 | "name": "caseSensitiveIndex", 33 | "propertyName": "field", 34 | "propertyType": "string", 35 | "caseSensitive": true 36 | }, 37 | { 38 | "_type": "Index", 39 | "name": "caseInSensitiveIndex", 40 | "propertyName": "field", 41 | "propertyType": "string", 42 | "caseSensitive": false 43 | } 44 | ] -------------------------------------------------------------------------------- /tests/auto/partition/json/reduce.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "_type": "_schemaType", 4 | "name": "MyContactCount", 5 | "schema": { 6 | "type": "object", 7 | "extends": "View", 8 | "properties": { 9 | "name": { 10 | "type": "string" 11 | } 12 | } 13 | } 14 | }, 15 | { 16 | "_type": "Reduce", 17 | "targetType": "MyContactCount", 18 | "sourceType": "MyContact", 19 | "sourceKeyName": "firstName", 20 | "targetKeyName": "firstName", 21 | "targetValueName": "count", 22 | "add": "function add (k, z, c) { if (!z) {z = 0}; z += 1; if (z) return z;}", 23 | "subtract": "function subtract (k, z, c) { if (!z) {z = 0}; z -= 1; if (z) return z;}", 24 | "addFlattened": "function add (k, z, c) { if (!z) {z = {_uuid: jsondb.createUuidFromString('MyContactCount:'+k), count: 0}}; z.count += 1; if (z.count) return z;}", 25 | "subtractFlattened": "function subtract (k, z, c) { if (!z) {z = {_uuid: jsondb.createUuidFromString('MyContactCount:'+k), count: 0}}; z.count -= 1; if (z.count) return z;}" 26 | } 27 | ] 28 | -------------------------------------------------------------------------------- /tests/auto/accesscontrol/json/capabilities-test.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "_type": "Capability", 4 | "name": "contacts", 5 | "partition": "all", 6 | "accessRules": { 7 | "rw": { 8 | "read": ["[?_type=\"Contact\"]"], 9 | "write": ["[?_type=\"Contact\"]"] 10 | } 11 | } 12 | }, 13 | { 14 | "_type": "Capability", 15 | "name": "email", 16 | "partition": "all", 17 | "accessRules": { 18 | "rw": { 19 | "read": ["[?_type=\"Email\"]"], 20 | "write": ["[?_type=\"Email\"]"] 21 | }, 22 | "send": { 23 | "write": ["[?_type=\"OutgoingEmail\"]"] 24 | } 25 | } 26 | }, 27 | { 28 | "_type": "Capability", 29 | "name": "own_domain", 30 | "partition": "all", 31 | "accessRules": { 32 | "rw": { 33 | "read": ["[?%owner startsWith %typeDomain]"], 34 | "write": ["[?%owner startsWith %typeDomain]"] 35 | } 36 | } 37 | }, 38 | { 39 | "_type": "CapabilitiesTest", 40 | "identifier": "test1", 41 | "capabilities": { 42 | "email": ["send"], 43 | "contacts": ["rw"] 44 | } 45 | } 46 | ] 47 | -------------------------------------------------------------------------------- /tests/auto/client/json/index-test.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "_type": "Index", 4 | "objectType": "com.test.indextest", 5 | "propertyName": "test1", 6 | "propertyType": "string" 7 | }, 8 | { 9 | "_type": "Index", 10 | "objectType": "com.test.indextest", 11 | "propertyName": "test2.nested", 12 | "propertyType": "string" 13 | }, 14 | { 15 | "_type": "_schemaType", 16 | "name": "com.test.IndexedView", 17 | "schema": { 18 | "type": "object", 19 | "extends": {"$ref": "View"} 20 | } 21 | }, 22 | { 23 | "_type": "Map", 24 | "targetType": "com.test.IndexedView", 25 | "map": { 26 | "com.test.indextest": "function (o) { var v = {'test3': {'nested': o.test2.nested}}; jsondb.emit(v); }" 27 | } 28 | }, 29 | { 30 | "_type": "Index", 31 | "propertyName": "test3.nested", 32 | "propertyType": "string", 33 | "objectType": "com.test.IndexedView" 34 | }, 35 | { 36 | "_type": "com.test.indextest", 37 | "test1": "abc", 38 | "test2": {"nested": "123"} 39 | }, 40 | { 41 | "_type": "com.test.indextest", 42 | "test1": "def", 43 | "test2": {"nested": "456"} 44 | } 45 | ] 46 | -------------------------------------------------------------------------------- /tests/auto/accesscontrol/json/view-test2.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "_type": "_schemaType", 4 | "name": "Phone2", 5 | "schema": { 6 | "type": "object", 7 | "extends": "View" 8 | } 9 | }, 10 | { 11 | "_type": "_schemaType", 12 | "name": "PhoneCount2", 13 | "schema": { 14 | "type": "object", 15 | "extends": "View" 16 | } 17 | }, 18 | { 19 | "_type": "Map", 20 | "targetType": "Phone3", 21 | "map": {"Contact": "function (c) {\ 22 | for (var i in c.phoneNumbers) {\ 23 | var phone = c.phoneNumbers[i];\ 24 | var id = c.displayName + ':' + phone.number; \ 25 | var uuid = jsondb.createUuidFromString(id); \ 26 | jsondb.emit({_uuid: uuid, key: phone.number, displayName: c.displayName});\ 27 | }\ 28 | }"} 29 | }, 30 | { 31 | "_type": "Reduce", 32 | "targetType": "PhoneCount3", 33 | "sourceType": "Phone", 34 | "sourceKeyName": "key", 35 | "add": "function add (k, z, c) { if (!z) {z = {count: 0}}; z.count += 1; return z;}", 36 | "subtract": "function subtract (k, z, c) { if (!z) {z = {count: 0}}; z.count -= 1; if (z.count) return z;}" 37 | } 38 | ] 39 | -------------------------------------------------------------------------------- /tests/shared/json/list-objects.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "_type":"com.example.social.ApplicationFeatures", 4 | "features":[ 5 | { 6 | "feature":"provide Facebook", 7 | "objectType":"com.example.accounts.Account", 8 | "properties":[ 9 | { 10 | "allowMultiple":false, 11 | "description":"Facebook account provider", 12 | "iconUrl":"accounts.facebookprovider.png" 13 | }], 14 | "supported":["share"] 15 | }], 16 | "features-file-version":1, 17 | "identifier":"accounts.facebookprovider", 18 | "name":"Facebook" 19 | }, 20 | { 21 | "_type":"com.example.social.ApplicationFeatures", 22 | "features":[ 23 | { 24 | "feature":"provide Gmail", 25 | "objectType":"com.example.accounts.Account", 26 | "properties":[ 27 | { 28 | "allowMultiple":false, 29 | "description":"Gmail account provider", 30 | "iconUrl":"accounts.gmailprovider.png" 31 | }], 32 | "supported":["share"] 33 | }], 34 | "features-file-version":1, 35 | "identifier":"accounts.gmailprovider", 36 | "name":"Gmail" 37 | } 38 | ] 39 | 40 | -------------------------------------------------------------------------------- /tests/auto/jsondblistmodel/list-objects.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "_type":"com.example.social.ApplicationFeatures", 4 | "features":[ 5 | { 6 | "feature":"provide Facebook", 7 | "objectType":"com.example.accounts.Account", 8 | "properties":[ 9 | { 10 | "allowMultiple":false, 11 | "description":"Facebook account provider", 12 | "iconUrl":"accounts.facebookprovider.png" 13 | }], 14 | "supported":["share"] 15 | }], 16 | "features-file-version":1, 17 | "identifier":"accounts.facebookprovider", 18 | "name":"Facebook" 19 | }, 20 | { 21 | "_type":"com.example.social.ApplicationFeatures", 22 | "features":[ 23 | { 24 | "feature":"provide Gmail", 25 | "objectType":"com.example.accounts.Account", 26 | "properties":[ 27 | { 28 | "allowMultiple":false, 29 | "description":"Gmail account provider", 30 | "iconUrl":"accounts.gmailprovider.png" 31 | }], 32 | "supported":["share"] 33 | }], 34 | "features-file-version":1, 35 | "identifier":"accounts.gmailprovider", 36 | "name":"Gmail" 37 | } 38 | ] 39 | 40 | -------------------------------------------------------------------------------- /tests/auto/jsondbsortinglistmodel/list-objects.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "_type":"com.example.social.ApplicationFeatures", 4 | "features":[ 5 | { 6 | "feature":"provide Facebook", 7 | "objectType":"com.example.accounts.Account", 8 | "properties":[ 9 | { 10 | "allowMultiple":false, 11 | "description":"Facebook account provider", 12 | "iconUrl":"accounts.facebookprovider.png" 13 | }], 14 | "supported":["share"] 15 | }], 16 | "features-file-version":1, 17 | "identifier":"accounts.facebookprovider", 18 | "name":"Facebook" 19 | }, 20 | { 21 | "_type":"com.example.social.ApplicationFeatures", 22 | "features":[ 23 | { 24 | "feature":"provide Gmail", 25 | "objectType":"com.example.accounts.Account", 26 | "properties":[ 27 | { 28 | "allowMultiple":false, 29 | "description":"Gmail account provider", 30 | "iconUrl":"accounts.gmailprovider.png" 31 | }], 32 | "supported":["share"] 33 | }], 34 | "features-file-version":1, 35 | "identifier":"accounts.gmailprovider", 36 | "name":"Gmail" 37 | } 38 | ] 39 | 40 | -------------------------------------------------------------------------------- /tests/auto/jsondbcachinglistmodel/list-objects.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "_type":"com.nokia.mp.social.ApplicationFeatures", 4 | "features":[ 5 | { 6 | "feature":"provide Facebook", 7 | "objectType":"com.nokia.mp.accounts.Account", 8 | "properties":[ 9 | { 10 | "allowMultiple":false, 11 | "description":"Facebook account provider", 12 | "iconUrl":"accounts.facebookprovider.png" 13 | }], 14 | "supported":["share"] 15 | }], 16 | "features-file-version":1, 17 | "identifier":"accounts.facebookprovider", 18 | "name":"Facebook" 19 | }, 20 | { 21 | "_type":"com.nokia.mp.social.ApplicationFeatures", 22 | "features":[ 23 | { 24 | "feature":"provide Gmail", 25 | "objectType":"com.nokia.mp.accounts.Account", 26 | "properties":[ 27 | { 28 | "allowMultiple":false, 29 | "description":"Gmail account provider", 30 | "iconUrl":"accounts.gmailprovider.png" 31 | }], 32 | "supported":["share"] 33 | }], 34 | "features-file-version":1, 35 | "identifier":"accounts.gmailprovider", 36 | "name":"Gmail" 37 | } 38 | ] 39 | 40 | -------------------------------------------------------------------------------- /tests/auto/partition/json-validation/format-string-schema.json: -------------------------------------------------------------------------------- 1 | { 2 | "description": "check if the string format is correct", 3 | "type": "object", 4 | "properties": { 5 | "date-time": { 6 | "type": "string", 7 | "format": "date-time" 8 | }, 9 | "date": { 10 | "type": "string", 11 | "format": "date" 12 | }, 13 | "time": { 14 | "type": "string", 15 | "format": "time" 16 | }, 17 | "url": { 18 | "type": "string", 19 | "format": "url" 20 | }, 21 | "uri": { 22 | "type": "string", 23 | "format": "uri" 24 | }, 25 | "uuid": { 26 | "type": "string", 27 | "format": "uuid" 28 | }, 29 | "regex": { 30 | "type": "string", 31 | "format": "regex" 32 | }, 33 | "identifier": { 34 | "type": "string", 35 | "format": "identifier" 36 | }, 37 | "version": { 38 | "type": "string", 39 | "format": "version" 40 | }, 41 | "nonnegativeinteger": { 42 | "type": "string", 43 | "format": "nonnegativeinteger" 44 | } 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /doc/jsondb-dita.qdocconf: -------------------------------------------------------------------------------- 1 | # Name of the project. 2 | project = QtJsonDb 3 | 4 | # Directories in which to search for files to document. 5 | # Paths are relative to the location of this file. 6 | exampledirs += ../examples 7 | headerdirs += ./src \ 8 | ../src/client \ 9 | ../src/imports/jsondb 10 | imagedirs += images 11 | sourcedirs += ./src \ 12 | ../src/client \ 13 | ../src/imports/jsondb 14 | 15 | Cpp.ignoretokens = \ 16 | QT_BEGIN_HEADER \ 17 | QT_END_HEADER \ 18 | QT_BEGIN_NAMESPACE_JSONDB \ 19 | QT_END_NAMESPACE_JSONDB \ 20 | Q_ADDON_JSONDB_EXPORT 21 | 22 | 23 | #Do not change the variables after this line unless you know what you are doing. 24 | 25 | outputdir = ditaxml 26 | outputformats = DITAXML 27 | 28 | exampledirs += ../examples 29 | headerdirs += ./src \ 30 | ../src/client \ 31 | ../src/imports 32 | sourcedirs += ./src \ 33 | ../src/client \ 34 | ../src/imports 35 | 36 | HTML.nobreadcrumbs = "true" 37 | 38 | examples.fileextensions = "*.cpp *.h *.js *.svg *.xml *.ui *.qml" 39 | examples.imageextensions = "*.png *.jpeg *.jpg *.gif *.mng" 40 | headers.fileextensions = "*.h *.ch *.h++ *.hh *.hpp *.hxx" 41 | sources.fileextensions = "*.cpp *.qdoc *.mm *.qml" 42 | 43 | -------------------------------------------------------------------------------- /tests/auto/partition/json/reduce-data.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "_type": "MyContact", 4 | "firstName": "John", 5 | "lastName": "Smith" 6 | }, 7 | { 8 | "_type": "MyContact", 9 | "firstName": "Harry", 10 | "lastName": "Smith" 11 | }, 12 | { 13 | "_type": "MyContact", 14 | "firstName": "John", 15 | "lastName": "Jones" 16 | }, 17 | { 18 | "_type": "MyContact", 19 | "firstName": "Tom", 20 | "lastName": "Jones" 21 | }, 22 | { 23 | "_type": "MyContact", 24 | "firstName": "Roger", 25 | "lastName": "Moore" 26 | }, 27 | { 28 | "_type": "MyContact", 29 | "firstName": "John", 30 | "lastName": "Moore" 31 | }, 32 | { 33 | "_type": "MyContact", 34 | "firstName": "Tom", 35 | "lastName": "Smith" 36 | }, 37 | { 38 | "_type": "MyContact", 39 | "firstName": "John", 40 | "lastName": "Roberts" 41 | }, 42 | { 43 | "_type": "MyContact", 44 | "firstName": "Robert", 45 | "lastName": "Johns" 46 | }, 47 | { 48 | "_type": "MyContact", 49 | "firstName": "Robert", 50 | "lastName": "Smith" 51 | }, 52 | { 53 | "_type": "MyContact", 54 | "firstName": "Robert", 55 | "lastName": "Thomas" 56 | }, 57 | { 58 | "_type": "MyContact", 59 | "firstName": "Thomas", 60 | "lastName": "Roberts" 61 | } 62 | ] 63 | -------------------------------------------------------------------------------- /tests/auto/partition/json/reduce-array.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "_type": "_schemaType", 4 | "name": "ArrayView", 5 | "schema": { 6 | "type": "object", 7 | "extends": "View", 8 | "properties": { 9 | "arrayProp": { "type": "array" } 10 | } 11 | } 12 | }, 13 | { 14 | "_type": "Reduce", 15 | "sourceType": "Human", 16 | "sourceKeyName": "lastName", 17 | "targetType": "ArrayView", 18 | "add": " \ 19 | function add(key, previous, value) { \ 20 | if (!previous) previous = { firstNames: [] } \ 21 | previous.firstNames.push(value.firstName); \ 22 | return previous; \ 23 | } ", 24 | "subtract": " \ 25 | function subtract(key, previous, value) { \ 26 | var idx; \ 27 | if ((idx = previous.firstNames.indexOf(value.firstName)) >= 0) \ 28 | previous.firstNames.splice(idx, 1); \ 29 | return previous; \ 30 | } " 31 | }, 32 | { 33 | "_type": "Human", 34 | "firstName": "Bob", 35 | "lastName": "Smith" 36 | }, 37 | { 38 | "_type": "Human", 39 | "firstName": "Hank", 40 | "lastName": "Jones" 41 | }, 42 | { 43 | "_type": "Human", 44 | "firstName": "Roger", 45 | "lastName": "Smith" 46 | }, 47 | { 48 | "_type": "Human", 49 | "firstName": "Julio", 50 | "lastName": "Jones" 51 | } 52 | ] 53 | -------------------------------------------------------------------------------- /tests/auto/partition/json/index-casepreference.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "_type": "IndexCasePreference", 4 | "field": "aaa" 5 | }, 6 | { 7 | "_type": "IndexCasePreference", 8 | "field": "aBB" 9 | }, 10 | { 11 | "_type": "IndexCasePreference", 12 | "field": "Aba" 13 | }, 14 | { 15 | "_type": "IndexCasePreference", 16 | "field": "Aab" 17 | }, 18 | { 19 | "_type": "IndexCasePreference", 20 | "field": "AAA" 21 | }, 22 | { 23 | "_type": "IndexCasePreference", 24 | "field": "Aaa" 25 | }, 26 | { 27 | "_type": "IndexCasePreference", 28 | "field": "AAa" 29 | }, 30 | { 31 | "_type": "Index", 32 | "name": "casePreferenceIndex1", 33 | "propertyName": "field", 34 | "propertyType": "string", 35 | "locale": "en_US", 36 | "collation": "default", 37 | "casePreference": "IgnoreCase" 38 | }, 39 | { 40 | "_type": "Index", 41 | "name": "casePreferenceIndex2", 42 | "propertyName": "field", 43 | "propertyType": "string", 44 | "locale": "en_US", 45 | "collation": "default", 46 | "casePreference": "PreferUpperCase" 47 | }, 48 | { 49 | "_type": "Index", 50 | "name": "casePreferenceIndex3", 51 | "propertyName": "field", 52 | "propertyType": "string", 53 | "locale": "en_US", 54 | "collation": "default", 55 | "casePreference": "PreferLowerCase" 56 | } 57 | ] -------------------------------------------------------------------------------- /tests/auto/partition/json/reduce-subprop.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "_type": "Contact", 4 | "displayName": "Joe Smith", 5 | "name": { 6 | "firstName": "joe", 7 | "lastName": "smith" 8 | } 9 | }, 10 | { 11 | "_type": "Contact", 12 | "displayName": "Nancy Doe", 13 | "name": { 14 | "firstName": "nancy", 15 | "lastName": "doe" 16 | } 17 | }, 18 | { 19 | "_type": "Contact", 20 | "displayName": "Nancy Doe", 21 | "name": { 22 | "firstName": "joe", 23 | "lastName": "harrison" 24 | } 25 | }, 26 | { 27 | "_type": "Contact", 28 | "displayName": "Nancy Doe", 29 | "name": { 30 | "firstName": "nancy", 31 | "lastName": "williams" 32 | } 33 | }, 34 | { 35 | "_type": "Contact", 36 | "displayName": "Nancy Doe", 37 | "name": { 38 | "firstName": "doug", 39 | "lastName": "johnson" 40 | } 41 | }, 42 | { 43 | "_type": "_schemaType", 44 | "name": "NameCount", 45 | "schema": { 46 | "type": "object", 47 | "extends": "View" 48 | } 49 | }, 50 | { 51 | "_type": "Reduce", 52 | "targetType": "NameCount", 53 | "sourceType": "Contact", 54 | "sourceKeyName": "name.firstName", 55 | "add": "function add (k, z, c) { if (!z) { z = { count: 0 } }; z.count += 1; return z;}", 56 | "subtract": "function subtract (k, z, c) { if (!z) {z = {count: 0}}; z.count -= 1; if (z.count) return z;}" 57 | } 58 | ] 59 | -------------------------------------------------------------------------------- /src/client/client.pro: -------------------------------------------------------------------------------- 1 | MODULE = jsondb 2 | TARGET = QtJsonDb 3 | VERSION = 1.0.0 4 | 5 | QT = core 6 | QT_FOR_PRIVATE = network qml jsondbpartition 7 | 8 | load(qt_module) 9 | 10 | include(../jsonstream/jsonstream.pri) 11 | INCLUDEPATH += $$PWD/../common 12 | 13 | HEADERS += \ 14 | qjsondbglobal.h \ 15 | qjsondbstrings_p.h \ 16 | qjsondbconnection_p.h \ 17 | qjsondbconnection.h \ 18 | qjsondbrequest_p.h \ 19 | qjsondbrequest.h \ 20 | qjsondbreadrequest_p.h \ 21 | qjsondbreadrequest.h \ 22 | qjsondbwriterequest_p.h \ 23 | qjsondbwriterequest.h \ 24 | qjsondbflushrequest_p_p.h \ 25 | qjsondbflushrequest_p.h \ 26 | qjsondbwatcher_p.h \ 27 | qjsondbwatcher.h \ 28 | qjsondbobject.h \ 29 | qjsondbprivatepartition_p.h \ 30 | qjsondbstandardpaths_p.h \ 31 | qjsondblogrequest_p.h \ 32 | qjsondblogrequest_p_p.h \ 33 | qjsondbquerymodel_p_p.h \ 34 | qjsondbmodelcache_p.h \ 35 | qjsondbmodelutils_p.h \ 36 | qjsondbquerymodel_p.h 37 | 38 | 39 | SOURCES += \ 40 | qjsondbconnection.cpp \ 41 | qjsondbrequest.cpp \ 42 | qjsondbreadrequest.cpp \ 43 | qjsondbwriterequest.cpp \ 44 | qjsondbflushrequest_p.cpp \ 45 | qjsondbwatcher.cpp \ 46 | qjsondbobject.cpp \ 47 | qjsondbprivatepartition.cpp \ 48 | qjsondbstandardpaths.cpp \ 49 | qjsondblogrequest.cpp \ 50 | qjsondbmodelcache_p.cpp \ 51 | qjsondbmodelutils_p.cpp \ 52 | qjsondbquerymodel_p.cpp 53 | 54 | DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0 55 | -------------------------------------------------------------------------------- /doc/src/reduce-example.qdoc: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | ** 3 | ** Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies). 4 | ** Contact: http://www.qt-project.org/legal 5 | ** 6 | ** This file is part of the documentation of the Qt Toolkit. 7 | ** 8 | ** $QT_BEGIN_LICENSE:FDL$ 9 | ** Commercial License Usage 10 | ** Licensees holding valid commercial Qt licenses may use this file in 11 | ** accordance with the commercial license agreement provided with the 12 | ** Software or, alternatively, in accordance with the terms contained in 13 | ** a written agreement between you and Digia. For licensing terms and 14 | ** conditions see http://qt.digia.com/licensing. For further information 15 | ** use the contact form at http://qt.digia.com/contact-us. 16 | ** 17 | ** GNU Free Documentation License Usage 18 | ** Alternatively, this file may be used under the terms of the GNU Free 19 | ** Documentation License version 1.3 as published by the Free Software 20 | ** Foundation and appearing in the file included in the packaging of 21 | ** this file. Please review the following information to ensure 22 | ** the GNU Free Documentation License version 1.3 requirements 23 | ** will be met: http://www.gnu.org/copyleft/fdl.html. 24 | ** $QT_END_LICENSE$ 25 | ** 26 | ****************************************************************************/ 27 | 28 | /*! 29 | 30 | \page creating-a-reduce.html 31 | \title Creating a Reduce View 32 | 33 | \example declarative/reduce-phone 34 | 35 | */ 36 | -------------------------------------------------------------------------------- /tests/auto/partition/json/map-sametarget.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "_type": "_schemaType", 4 | "name": "ContactView", 5 | "schema": { 6 | "type": "object", 7 | "extends": "View" 8 | } 9 | }, 10 | { 11 | "_type": "_schemaType", 12 | "name": "ContactView2", 13 | "schema": { 14 | "type": "object", 15 | "extends": "View" 16 | } 17 | }, 18 | { 19 | "_type": "Map", 20 | "targetType": "ContactView", 21 | "map": {"Contact2": "function (c) { jsondb.emit({key: c.name.lastName, displayName: c.displayName, contact2: true }); }"} 22 | }, 23 | { 24 | "_type": "Map", 25 | "targetType": "ContactView", 26 | "map": {"Contact3": "function (c) { jsondb.emit({key: c.name.lastName, displayName: c.displayName, firstName: c.name.firstName, contact3: true }); }"} 27 | }, 28 | { 29 | "_type": "Contact2", 30 | "displayName": "Joe Smith", 31 | "name": { 32 | "firstName": "joe", 33 | "lastName": "smith" 34 | } 35 | }, 36 | { 37 | "_type": "Contact3", 38 | "displayName": "Nancy Doe", 39 | "name": { 40 | "firstName": "nancy", 41 | "lastName": "doe" 42 | } 43 | }, 44 | { 45 | "_type": "Contact2", 46 | "displayName": "Joe Johnson", 47 | "name": { 48 | "firstName": "joe", 49 | "lastName": "johnson" 50 | } 51 | }, 52 | { 53 | "_type": "Contact3", 54 | "displayName": "Nancy Jones", 55 | "name": { 56 | "firstName": "nancy", 57 | "lastName": "jones" 58 | } 59 | } 60 | ] 61 | -------------------------------------------------------------------------------- /doc/src/example-chat.qdoc: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | ** 3 | ** Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies). 4 | ** Contact: http://www.qt-project.org/legal 5 | ** 6 | ** This file is part of the documentation of the Qt Toolkit. 7 | ** 8 | ** $QT_BEGIN_LICENSE:FDL$ 9 | ** Commercial License Usage 10 | ** Licensees holding valid commercial Qt licenses may use this file in 11 | ** accordance with the commercial license agreement provided with the 12 | ** Software or, alternatively, in accordance with the terms contained in 13 | ** a written agreement between you and Digia. For licensing terms and 14 | ** conditions see http://qt.digia.com/licensing. For further information 15 | ** use the contact form at http://qt.digia.com/contact-us. 16 | ** 17 | ** GNU Free Documentation License Usage 18 | ** Alternatively, this file may be used under the terms of the GNU Free 19 | ** Documentation License version 1.3 as published by the Free Software 20 | ** Foundation and appearing in the file included in the packaging of 21 | ** this file. Please review the following information to ensure 22 | ** the GNU Free Documentation License version 1.3 requirements 23 | ** will be met: http://www.gnu.org/copyleft/fdl.html. 24 | ** $QT_END_LICENSE$ 25 | ** 26 | ****************************************************************************/ 27 | 28 | /*! 29 | \example client/chat 30 | \title Chat 31 | \brief The Chat example provides a comprehensive example for the C++ Client API 32 | 33 | */ 34 | -------------------------------------------------------------------------------- /tests/auto/accesscontrol/json/view-test.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "_type": "_schemaType", 4 | "name": "Phone", 5 | "schema": { 6 | "type": "object", 7 | "extends": "View" 8 | } 9 | }, 10 | { 11 | "_type": "_schemaType", 12 | "name": "PhoneCount", 13 | "schema": { 14 | "type": "object", 15 | "extends": "View" 16 | } 17 | }, 18 | { 19 | "_type": "_schemaType", 20 | "name": "Phone3", 21 | "schema": { 22 | "type": "object", 23 | "extends": "View" 24 | } 25 | }, 26 | { 27 | "_type": "_schemaType", 28 | "name": "PhoneCount3", 29 | "schema": { 30 | "type": "object", 31 | "extends": "View" 32 | } 33 | }, 34 | { 35 | "_type": "Map", 36 | "targetType": "Phone", 37 | "map": {"Contact": "function (c) {\ 38 | for (var i in c.phoneNumbers) {\ 39 | var phone = c.phoneNumbers[i];\ 40 | var id = c.displayName + ':' + phone.number; \ 41 | var uuid = jsondb.createUuidFromString(id); \ 42 | jsondb.emit({_uuid: uuid, key: phone.number, displayName: c.displayName});\ 43 | }\ 44 | }"} 45 | }, 46 | { 47 | "_type": "Reduce", 48 | "targetType": "PhoneCount", 49 | "sourceType": "Phone", 50 | "sourceKeyName": "key", 51 | "add": "function add (k, z, c) { if (!z) {z = {count: 0}}; z.count += 1; return z;}", 52 | "subtract": "function subtract (k, z, c) { if (!z) {z = {count: 0}}; z.count -= 1; if (z.count) return z;}" 53 | } 54 | ] 55 | -------------------------------------------------------------------------------- /doc/src/external-resources.qdoc: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | ** 3 | ** Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies). 4 | ** Contact: http://www.qt-project.org/legal 5 | ** 6 | ** This file is part of the documentation of the Qt Toolkit. 7 | ** 8 | ** $QT_BEGIN_LICENSE:FDL$ 9 | ** Commercial License Usage 10 | ** Licensees holding valid commercial Qt licenses may use this file in 11 | ** accordance with the commercial license agreement provided with the 12 | ** Software or, alternatively, in accordance with the terms contained in 13 | ** a written agreement between you and Digia. For licensing terms and 14 | ** conditions see http://qt.digia.com/licensing. For further information 15 | ** use the contact form at http://qt.digia.com/contact-us. 16 | ** 17 | ** GNU Free Documentation License Usage 18 | ** Alternatively, this file may be used under the terms of the GNU Free 19 | ** Documentation License version 1.3 as published by the Free Software 20 | ** Foundation and appearing in the file included in the packaging of 21 | ** this file. Please review the following information to ensure 22 | ** the GNU Free Documentation License version 1.3 requirements 23 | ** will be met: http://www.gnu.org/copyleft/fdl.html. 24 | ** $QT_END_LICENSE$ 25 | ** 26 | ****************************************************************************/ 27 | 28 | /*! 29 | \externalpage http://www.unicode.org/reports/tr35/tr35-16.html#Key_Type_Definitions 30 | \title Unicode Locale Data Markup Language (LDML): Key Type Definitions 31 | */ 32 | -------------------------------------------------------------------------------- /examples/capabilities/SystemCapability.json: -------------------------------------------------------------------------------- 1 | { 2 | "_type": "Capability", 3 | "name": "system", 4 | "partition": "all", 5 | "accessRules": { 6 | "setOwner": { 7 | "read": [".*"], 8 | "write": [".*"], 9 | "setOwner": [".*"] 10 | } 11 | } 12 | } 13 | { 14 | "_type": "Capability", 15 | "name": "system", 16 | "partition": "com.example.System", 17 | "accessRules": { 18 | "rw": { 19 | "read": [".*"], 20 | "write": ["[?_type startsWith \"public.\"]", 21 | "[?%owner startsWith %typeDomain]"] 22 | } 23 | } 24 | } 25 | { 26 | "_type": "Capability", 27 | "name": "system", 28 | "partition": "com.example.User", 29 | "accessRules": { 30 | "rw": { 31 | "read": [".*"], 32 | "write": ["[?_type startsWith \"public.\"]", 33 | "[?%owner startsWith %typeDomain]"] 34 | } 35 | } 36 | } 37 | { 38 | "_type": "Capability", 39 | "name": "system", 40 | "partition": "com.example.Shared", 41 | "accessRules": { 42 | "rw": { 43 | "read": [".*"], 44 | "write": [".*"] 45 | } 46 | } 47 | } 48 | { 49 | "_type": "Capability", 50 | "name": "system", 51 | "partition": "com.example.Ephemeral", 52 | "accessRules": { 53 | "rw": { 54 | "read": [".*"], 55 | "write": [".*"] 56 | } 57 | } 58 | } 59 | { 60 | "_type": "Capability", 61 | "name": "system", 62 | "partition": "com.example.Card", 63 | "accessRules": { 64 | "rw": { 65 | "read": [".*"], 66 | "write": ["[?_type startsWith \"public.\"]", 67 | "[?%owner startsWith %typeDomain]"] 68 | } 69 | } 70 | } 71 | -------------------------------------------------------------------------------- /doc/src/example-simplelistmodel.qdoc: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | ** 3 | ** Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies). 4 | ** Contact: http://www.qt-project.org/legal 5 | ** 6 | ** This file is part of the documentation of the Qt Toolkit. 7 | ** 8 | ** $QT_BEGIN_LICENSE:FDL$ 9 | ** Commercial License Usage 10 | ** Licensees holding valid commercial Qt licenses may use this file in 11 | ** accordance with the commercial license agreement provided with the 12 | ** Software or, alternatively, in accordance with the terms contained in 13 | ** a written agreement between you and Digia. For licensing terms and 14 | ** conditions see http://qt.digia.com/licensing. For further information 15 | ** use the contact form at http://qt.digia.com/contact-us. 16 | ** 17 | ** GNU Free Documentation License Usage 18 | ** Alternatively, this file may be used under the terms of the GNU Free 19 | ** Documentation License version 1.3 as published by the Free Software 20 | ** Foundation and appearing in the file included in the packaging of 21 | ** this file. Please review the following information to ensure 22 | ** the GNU Free Documentation License version 1.3 requirements 23 | ** will be met: http://www.gnu.org/copyleft/fdl.html. 24 | ** $QT_END_LICENSE$ 25 | ** 26 | ****************************************************************************/ 27 | 28 | /*! 29 | \example declarative/simplelistmodel 30 | \title Simple List Model Example 31 | \brief The Simple List Model Example demonstrates adding a contact with random-generated name to the database. 32 | 33 | \image{example-simplelistmodel.png} 34 | */ 35 | -------------------------------------------------------------------------------- /doc/src/example-desktop-inspector.qdoc: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | ** 3 | ** Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies). 4 | ** Contact: http://www.qt-project.org/legal 5 | ** 6 | ** This file is part of the documentation of the Qt Toolkit. 7 | ** 8 | ** $QT_BEGIN_LICENSE:FDL$ 9 | ** Commercial License Usage 10 | ** Licensees holding valid commercial Qt licenses may use this file in 11 | ** accordance with the commercial license agreement provided with the 12 | ** Software or, alternatively, in accordance with the terms contained in 13 | ** a written agreement between you and Digia. For licensing terms and 14 | ** conditions see http://qt.digia.com/licensing. For further information 15 | ** use the contact form at http://qt.digia.com/contact-us. 16 | ** 17 | ** GNU Free Documentation License Usage 18 | ** Alternatively, this file may be used under the terms of the GNU Free 19 | ** Documentation License version 1.3 as published by the Free Software 20 | ** Foundation and appearing in the file included in the packaging of 21 | ** this file. Please review the following information to ensure 22 | ** the GNU Free Documentation License version 1.3 requirements 23 | ** will be met: http://www.gnu.org/copyleft/fdl.html. 24 | ** $QT_END_LICENSE$ 25 | ** 26 | ****************************************************************************/ 27 | 28 | /*! 29 | \example declarative/desktop-inspector 30 | \title Desktop Database Inspector Example 31 | \brief The Desktop Database Inspector Example demonstrates how to view any kind of object in the database. 32 | 33 | \image{example-desktop-inspector.png} 34 | */ 35 | -------------------------------------------------------------------------------- /doc/src/example-streamingquery.qdoc: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | ** 3 | ** Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies). 4 | ** Contact: http://www.qt-project.org/legal 5 | ** 6 | ** This file is part of the documentation of the Qt Toolkit. 7 | ** 8 | ** $QT_BEGIN_LICENSE:FDL$ 9 | ** Commercial License Usage 10 | ** Licensees holding valid commercial Qt licenses may use this file in 11 | ** accordance with the commercial license agreement provided with the 12 | ** Software or, alternatively, in accordance with the terms contained in 13 | ** a written agreement between you and Digia. For licensing terms and 14 | ** conditions see http://qt.digia.com/licensing. For further information 15 | ** use the contact form at http://qt.digia.com/contact-us. 16 | ** 17 | ** GNU Free Documentation License Usage 18 | ** Alternatively, this file may be used under the terms of the GNU Free 19 | ** Documentation License version 1.3 as published by the Free Software 20 | ** Foundation and appearing in the file included in the packaging of 21 | ** this file. Please review the following information to ensure 22 | ** the GNU Free Documentation License version 1.3 requirements 23 | ** will be met: http://www.gnu.org/copyleft/fdl.html. 24 | ** $QT_END_LICENSE$ 25 | ** 26 | ****************************************************************************/ 27 | 28 | /*! 29 | \example declarative/streamingquery 30 | \title Streaming Query 31 | \brief The Streaming Query Example demonstrates how to use the streaming API offered by the Query Item 32 | 33 | \image{example-streamingquery.png} 34 | 35 | Also demonstrates the use of the Query item's binding property 36 | 37 | */ 38 | -------------------------------------------------------------------------------- /doc/src/map-example.qdoc: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | ** 3 | ** Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies). 4 | ** Contact: http://www.qt-project.org/legal 5 | ** 6 | ** This file is part of the documentation of the Qt Toolkit. 7 | ** 8 | ** $QT_BEGIN_LICENSE:FDL$ 9 | ** Commercial License Usage 10 | ** Licensees holding valid commercial Qt licenses may use this file in 11 | ** accordance with the commercial license agreement provided with the 12 | ** Software or, alternatively, in accordance with the terms contained in 13 | ** a written agreement between you and Digia. For licensing terms and 14 | ** conditions see http://qt.digia.com/licensing. For further information 15 | ** use the contact form at http://qt.digia.com/contact-us. 16 | ** 17 | ** GNU Free Documentation License Usage 18 | ** Alternatively, this file may be used under the terms of the GNU Free 19 | ** Documentation License version 1.3 as published by the Free Software 20 | ** Foundation and appearing in the file included in the packaging of 21 | ** this file. Please review the following information to ensure 22 | ** the GNU Free Documentation License version 1.3 requirements 23 | ** will be met: http://www.gnu.org/copyleft/fdl.html. 24 | ** $QT_END_LICENSE$ 25 | ** 26 | ****************************************************************************/ 27 | 28 | /*! 29 | 30 | \page creating-maps.html 31 | \title Creating a Map View 32 | 33 | (file source: examples/declarative/map-phone/map-phone.qml) 34 | \snippet declarative/map-phone/map-phone.qml Creating a Map Object 35 | 36 | (file source: examples/declarative/map-phone/map-phone.qml) 37 | \snippet declarative/map-phone/map-phone.qml Installing the Map Object 38 | 39 | \example declarative/map-phone 40 | 41 | */ 42 | -------------------------------------------------------------------------------- /doc/global/qt-html-templates-offline.qdocconf: -------------------------------------------------------------------------------- 1 | # 2 | # W A R N I N G 3 | # ------------- 4 | # 5 | # A common HTML template for modules in this repository. 6 | # This template is common among the Qt 5 modules. 7 | # 8 | # A change in this template must be replicated in all of the repositories. 9 | # 10 | # We mean it. 11 | # 12 | 13 | HTML.templatedir = ../../../doc 14 | 15 | HTML.nobreadcrumbs = "true" 16 | 17 | HTML.stylesheets = global/style/offline.css 18 | 19 | HTML.headerstyles = \ 20 | " \n" 21 | 22 | HTML.endheader = \ 23 | "\n" \ 24 | 25 | HTML.footer = \ 26 | "
\n" \ 27 | "

\n" \ 28 | " © 2012 Digia Plc and/or its\n" \ 29 | " subsidiaries. Documentation contributions included herein are the copyrights of\n" \ 30 | " their respective owners.

\n" \ 31 | "
\n" \ 32 | "

\n" \ 33 | " The documentation provided herein is licensed under the terms of the\n" \ 34 | " GNU Free Documentation\n" \ 35 | " License version 1.3 as published by the Free Software Foundation.

\n" \ 36 | "

\n" \ 37 | " Documentation sources may be obtained from \n" \ 38 | " www.qt-project.org.

\n" \ 39 | "
\n" \ 40 | "

\n" \ 41 | " Digia, Qt and their respective logos are trademarks of Digia Plc \n" \ 42 | " in Finland and/or other countries worldwide. All other trademarks are property\n" \ 43 | " of their respective owners. Privacy Policy

\n" \ 45 | "
\n" \ 46 | -------------------------------------------------------------------------------- /examples/capabilities/UserCapability.json: -------------------------------------------------------------------------------- 1 | { 2 | "_type": "Capability", 3 | "name": "user", 4 | "partition": "com.example.System", 5 | "accessRules": { 6 | "rw": { 7 | "read": ["[?_type = \"Partition\"]"] 8 | } 9 | } 10 | } 11 | { 12 | "_type": "Capability", 13 | "name": "user", 14 | "partition": "com.example.User", 15 | "accessRules": { 16 | "rw": { 17 | "read": [".*"], 18 | "write": ["[?_type startsWith \"public.\"]", 19 | "[?%owner startsWith %typeDomain]"] 20 | }, 21 | "setOwner": { 22 | "setOwner": ["[?_type startsWith \"public.\"]", 23 | "[?%owner startsWith %typeDomain]"] 24 | } 25 | } 26 | } 27 | { 28 | "_type": "Capability", 29 | "name": "system", 30 | "partition": "com.example.Public", 31 | "accessRules": { 32 | "rw": { 33 | "read": [".*"], 34 | "write": [".*"] 35 | }, 36 | "setOwner": { 37 | "setOwner": [".*"] 38 | } 39 | } 40 | } 41 | { 42 | "_type": "Capability", 43 | "name": "user", 44 | "partition": "com.example.Ephemeral", 45 | "accessRules": { 46 | "rw": { 47 | "read": [".*"], 48 | "write": [".*"] 49 | }, 50 | "setOwner": { 51 | "setOwner": [".*"] 52 | } 53 | } 54 | } 55 | { 56 | "_type": "Capability", 57 | "name": "user", 58 | "partition": "com.example.Card", 59 | "accessRules": { 60 | "rw": { 61 | "read": [".*"], 62 | "write": ["[?_type startsWith \"public.\"]", 63 | "[?%owner startsWith %typeDomain]"] 64 | }, 65 | "setOwner": { 66 | "setOwner": ["[?_type startsWith \"public.\"]", 67 | "[?%owner startsWith %typeDomain]"] 68 | } 69 | } 70 | } 71 | { 72 | "_type": "Capability", 73 | "name": "user", 74 | "partition": "%owner", 75 | "accessRules": { 76 | "rw": { 77 | "read": [".*"], 78 | "write": [".*"], 79 | "setOwner": [".*"] 80 | } 81 | } 82 | } 83 | -------------------------------------------------------------------------------- /doc/src/join-example.qdoc: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | ** 3 | ** Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies). 4 | ** Contact: http://www.qt-project.org/legal 5 | ** 6 | ** This file is part of the documentation of the Qt Toolkit. 7 | ** 8 | ** $QT_BEGIN_LICENSE:FDL$ 9 | ** Commercial License Usage 10 | ** Licensees holding valid commercial Qt licenses may use this file in 11 | ** accordance with the commercial license agreement provided with the 12 | ** Software or, alternatively, in accordance with the terms contained in 13 | ** a written agreement between you and Digia. For licensing terms and 14 | ** conditions see http://qt.digia.com/licensing. For further information 15 | ** use the contact form at http://qt.digia.com/contact-us. 16 | ** 17 | ** GNU Free Documentation License Usage 18 | ** Alternatively, this file may be used under the terms of the GNU Free 19 | ** Documentation License version 1.3 as published by the Free Software 20 | ** Foundation and appearing in the file included in the packaging of 21 | ** this file. Please review the following information to ensure 22 | ** the GNU Free Documentation License version 1.3 requirements 23 | ** will be met: http://www.gnu.org/copyleft/fdl.html. 24 | ** $QT_END_LICENSE$ 25 | ** 26 | ****************************************************************************/ 27 | 28 | /*! 29 | 30 | \page creating-a-join.html 31 | \title Creating a Join View 32 | 33 | (file source: examples/declarative/joinview/joinview.qml) 34 | \snippet declarative/joinview/joinview.qml Creating a Join Object 35 | 36 | \section3 Installing the Schema Object 37 | (file source: examples/declarative/joinview/joinview.qml) 38 | \snippet declarative/joinview/joinview.qml Installing the View Schema 39 | 40 | \section3 Installing the Join Object 41 | (file source: examples/declarative/joinview/joinview.qml) 42 | \snippet declarative/joinview/joinview.qml Installing the Join Object 43 | 44 | \example declarative/joinview 45 | 46 | */ 47 | -------------------------------------------------------------------------------- /src/partition/partition.pro: -------------------------------------------------------------------------------- 1 | MODULE = jsondbpartition 2 | TARGET = QtJsonDbPartition 3 | VERSION = 1.0.0 4 | QT = core qml 5 | CONFIG += internal_module 6 | 7 | load(qt_module) 8 | 9 | include(../3rdparty/btree/btree.pri) 10 | include(../hbtree/hbtree.pri) 11 | 12 | RESOURCES = jsondb.qrc 13 | 14 | HEADERS += \ 15 | jsondbutils_p.h \ 16 | jsondbowner.h \ 17 | jsondbproxy.h \ 18 | jsondbindex.h \ 19 | jsondbindex_p.h \ 20 | jsondbobject.h \ 21 | jsondbpartition.h \ 22 | jsondbquery.h \ 23 | jsondbstat.h \ 24 | jsondbview.h \ 25 | jsondbmapdefinition.h \ 26 | jsondbnotification.h \ 27 | jsondbobjectkey.h \ 28 | jsondbobjecttable.h \ 29 | jsondbbtree.h \ 30 | jsondbobjecttypes_impl_p.h \ 31 | jsondbobjecttypes_p.h \ 32 | jsondbreducedefinition.h \ 33 | jsondbschemamanager_impl_p.h \ 34 | jsondbschemamanager_p.h \ 35 | jsondbscriptengine.h \ 36 | jsondbsettings.h \ 37 | jsondbindexquery.h \ 38 | jsondberrors.h \ 39 | jsondbstrings.h \ 40 | jsondbpartitionglobal.h \ 41 | jsondbcollator.h \ 42 | jsondbcollator_p.h \ 43 | jsondbpartition_p.h \ 44 | jsondbpartitionspec.h \ 45 | jsondbquerytokenizer_p.h \ 46 | jsondbqueryparser.h \ 47 | jsondbschema_p.h \ 48 | jsondbcheckpoints_p.h 49 | 50 | SOURCES += \ 51 | jsondbowner.cpp \ 52 | jsondbproxy.cpp \ 53 | jsondbindex.cpp \ 54 | jsondbobject.cpp \ 55 | jsondbpartition.cpp \ 56 | jsondbquery.cpp \ 57 | jsondbview.cpp \ 58 | jsondbmapdefinition.cpp \ 59 | jsondbnotification.cpp \ 60 | jsondbobjecttable.cpp \ 61 | jsondbbtree.cpp \ 62 | jsondbreducedefinition.cpp \ 63 | jsondbscriptengine.cpp \ 64 | jsondbsettings.cpp \ 65 | jsondbindexquery.cpp \ 66 | jsondberrors.cpp \ 67 | jsondbstrings.cpp \ 68 | jsondbcollator.cpp \ 69 | jsondbquerytokenizer.cpp \ 70 | jsondbqueryparser.cpp 71 | 72 | config_icu { 73 | LIBS += -licuuc -licui18n 74 | } else { 75 | DEFINES += NO_COLLATION_SUPPORT 76 | } 77 | -------------------------------------------------------------------------------- /doc/src/index-example.qdoc: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | ** 3 | ** Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies). 4 | ** Contact: http://www.qt-project.org/legal 5 | ** 6 | ** This file is part of the documentation of the Qt Toolkit. 7 | ** 8 | ** $QT_BEGIN_LICENSE:FDL$ 9 | ** Commercial License Usage 10 | ** Licensees holding valid commercial Qt licenses may use this file in 11 | ** accordance with the commercial license agreement provided with the 12 | ** Software or, alternatively, in accordance with the terms contained in 13 | ** a written agreement between you and Digia. For licensing terms and 14 | ** conditions see http://qt.digia.com/licensing. For further information 15 | ** use the contact form at http://qt.digia.com/contact-us. 16 | ** 17 | ** GNU Free Documentation License Usage 18 | ** Alternatively, this file may be used under the terms of the GNU Free 19 | ** Documentation License version 1.3 as published by the Free Software 20 | ** Foundation and appearing in the file included in the packaging of 21 | ** this file. Please review the following information to ensure 22 | ** the GNU Free Documentation License version 1.3 requirements 23 | ** will be met: http://www.gnu.org/copyleft/fdl.html. 24 | ** $QT_END_LICENSE$ 25 | ** 26 | ****************************************************************************/ 27 | 28 | /*! 29 | 30 | \page indexing-objects.html 31 | \title Creating an Index 32 | 33 | The following code snippet creates an index on the value of the 34 | "identifier" property of any object that contains the identifier 35 | property: 36 | 37 | (file source: examples/declarative/simpleindex/simpleindex.qml) 38 | \snippet declarative/simpleindex/simpleindex.qml Creating a Simple Index Object 39 | 40 | The following code snippet creates an index on the value of the 41 | "identifier" property converted to uppercase: 42 | (file source: examples/declarative/simpleindex/simpleindex.qml) 43 | \snippet declarative/simpleindex/simpleindex.qml Creating an Index Using a Property Function 44 | 45 | \example declarative/simpleindex 46 | 47 | */ 48 | -------------------------------------------------------------------------------- /tests/auto/partition/json/map-join.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "name": "John", 4 | "_type": "Person" 5 | }, 6 | { 7 | "name": "Robert", 8 | "_type": "Person" 9 | }, 10 | { 11 | "name": "Ben", 12 | "_type": "Person" 13 | }, 14 | { 15 | "name": "Sam", 16 | "_type": "Person" 17 | }, 18 | { 19 | "name": "Frank", 20 | "_type": "Person" 21 | }, 22 | { 23 | "name": "Steve", 24 | "_type": "Person" 25 | }, 26 | { 27 | "name": "Gary", 28 | "_type": "Person" 29 | }, 30 | { 31 | "name": "Bruce", 32 | "_type": "Person" 33 | }, 34 | { 35 | "name": "Paul", 36 | "_type": "Person" 37 | }, 38 | { 39 | "name": "George", 40 | "_type": "Person" 41 | }, 42 | { 43 | "_type": "_schemaType", 44 | "name": "FoafPerson", 45 | "schema": { 46 | "_type": "object", 47 | "extends": "View", 48 | "properties": { 49 | "value" : { 50 | "type": "object", 51 | "properties": { 52 | "friend": { 53 | "type": "string" 54 | } 55 | } 56 | } 57 | } 58 | } 59 | }, 60 | { 61 | "_type": "Map", 62 | "targetType": "FoafPerson", 63 | "join": { 64 | "Person": " \ 65 | function map(p, context) { \ 66 | //console.log('p: ' + JSON.stringify(p)); \ 67 | //console.log('p.friend: ' + JSON.stringify(p.friend)); \ 68 | //console.log('context: ' + JSON.stringify(context)); \ 69 | if (!context) { \ 70 | if (p.friend) { \ 71 | jsondb.lookup({'index':'_uuid', 'value': p.friend, 'objectType': 'Person'}, { person: p }); \ 72 | }; \ 73 | jsondb.lookup({'index':'friend', 'value': p._uuid, 'objectType': 'Person'}, { friend: p }); \ 74 | } else { \ 75 | if (context.friend) \ 76 | jsondb.emit({name: p.name, friend: p.friend, foaf: context.friend.friend, foo: null }); \ 77 | else \ 78 | jsondb.emit({name: context.person.name, friend: context.person.friend, foaf: p.friend, foo: undefined }); \ 79 | } \ 80 | }" 81 | } 82 | } 83 | ] 84 | -------------------------------------------------------------------------------- /src/hbtree/orderedlist.cpp: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | ** 3 | ** Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies). 4 | ** Contact: http://www.qt-project.org/legal 5 | ** 6 | ** This file is part of the QtAddOn.JsonDb module of the Qt Toolkit. 7 | ** 8 | ** $QT_BEGIN_LICENSE:LGPL$ 9 | ** Commercial License Usage 10 | ** Licensees holding valid commercial Qt licenses may use this file in 11 | ** accordance with the commercial license agreement provided with the 12 | ** Software or, alternatively, in accordance with the terms contained in 13 | ** a written agreement between you and Digia. For licensing terms and 14 | ** conditions see http://qt.digia.com/licensing. For further information 15 | ** use the contact form at http://qt.digia.com/contact-us. 16 | ** 17 | ** GNU Lesser General Public License Usage 18 | ** Alternatively, this file may be used under the terms of the GNU Lesser 19 | ** General Public License version 2.1 as published by the Free Software 20 | ** Foundation and appearing in the file LICENSE.LGPL included in the 21 | ** packaging of this file. Please review the following information to 22 | ** ensure the GNU Lesser General Public License version 2.1 requirements 23 | ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. 24 | ** 25 | ** In addition, as a special exception, Digia gives you certain additional 26 | ** rights. These rights are described in the Digia Qt LGPL Exception 27 | ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. 28 | ** 29 | ** GNU General Public License Usage 30 | ** Alternatively, this file may be used under the terms of the GNU 31 | ** General Public License version 3.0 as published by the Free Software 32 | ** Foundation and appearing in the file LICENSE.GPL included in the 33 | ** packaging of this file. Please review the following information to 34 | ** ensure the GNU General Public License version 3.0 requirements will be 35 | ** met: http://www.gnu.org/copyleft/gpl.html. 36 | ** 37 | ** 38 | ** $QT_END_LICENSE$ 39 | ** 40 | ****************************************************************************/ 41 | 42 | #include "orderedlist_p.h" 43 | -------------------------------------------------------------------------------- /tests/auto/partition/json/map-join-sourceuuids.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "_type": "_schemaType", 4 | "name": "MagicView", 5 | "schema": { 6 | "type": "object", 7 | "extends": "View", 8 | "properties": { 9 | "key": { 10 | "type": "string" 11 | }, 12 | "foo": { 13 | "type": "string" 14 | }, 15 | "bar": { 16 | "type": "string" 17 | } 18 | } 19 | } 20 | }, 21 | { 22 | "_type": "_schemaType", 23 | "name": "Foo", 24 | "schema": { 25 | "type": "object", 26 | "properties": { 27 | "magic": { 28 | "type": "string", 29 | "indexed": true 30 | } 31 | } 32 | } 33 | }, 34 | { 35 | "_type": "_schemaType", 36 | "name": "Bar", 37 | "schema": { 38 | "type": "object", 39 | "extends": "Foo" 40 | } 41 | }, 42 | { 43 | "_type": "Map", 44 | "targetType": "MagicView", 45 | "join": { 46 | "Foo": " \ 47 | function map(obj, context) { \ 48 | var foo, bar; \ 49 | foo = obj; \ 50 | if (!context) { \ 51 | // callback to the Bar function below with foo as the context \ 52 | jsondb.lookup({'index':'magic', 'value':foo.magic, 'objectType': 'Bar'}, foo); \ 53 | } else { \ 54 | bar = context; \ 55 | jsondb.emit({ key: foo.magic, foo: foo._uuid, bar: bar._uuid, barExtra: bar.extra }); \ 56 | } \ 57 | } ", 58 | "Bar": " \ 59 | function map(obj, context) { \ 60 | var foo, bar; \ 61 | bar = obj; \ 62 | if (!context) { \ 63 | // callback to the Foo function above with bar as the context \ 64 | jsondb.lookup({'index':'magic', 'value':bar.magic, 'objectType': 'Foo'}, bar); \ 65 | } else { \ 66 | foo = context; \ 67 | jsondb.emit({ key: foo.magic, foo: foo._uuid, bar: bar._uuid, barExtra: bar.extra }); \ 68 | } \ 69 | } " 70 | } 71 | }, 72 | { 73 | "_type": "Bar", 74 | "magic": "xyzzy" 75 | }, 76 | { 77 | "_type": "Foo", 78 | "magic": "xyzzy" 79 | } 80 | ] 81 | -------------------------------------------------------------------------------- /config.tests/icu/main.cpp: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | ** 3 | ** Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies). 4 | ** Contact: http://www.qt-project.org/legal 5 | ** 6 | ** This file is part of the QtJsonDb module of the Qt Toolkit. 7 | ** 8 | ** $QT_BEGIN_LICENSE:LGPL$ 9 | ** Commercial License Usage 10 | ** Licensees holding valid commercial Qt licenses may use this file in 11 | ** accordance with the commercial license agreement provided with the 12 | ** Software or, alternatively, in accordance with the terms contained in 13 | ** a written agreement between you and Digia. For licensing terms and 14 | ** conditions see http://qt.digia.com/licensing. For further information 15 | ** use the contact form at http://qt.digia.com/contact-us. 16 | ** 17 | ** GNU Lesser General Public License Usage 18 | ** Alternatively, this file may be used under the terms of the GNU Lesser 19 | ** General Public License version 2.1 as published by the Free Software 20 | ** Foundation and appearing in the file LICENSE.LGPL included in the 21 | ** packaging of this file. Please review the following information to 22 | ** ensure the GNU Lesser General Public License version 2.1 requirements 23 | ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. 24 | ** 25 | ** In addition, as a special exception, Digia gives you certain additional 26 | ** rights. These rights are described in the Digia Qt LGPL Exception 27 | ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. 28 | ** 29 | ** GNU General Public License Usage 30 | ** Alternatively, this file may be used under the terms of the GNU 31 | ** General Public License version 3.0 as published by the Free Software 32 | ** Foundation and appearing in the file LICENSE.GPL included in the 33 | ** packaging of this file. Please review the following information to 34 | ** ensure the GNU General Public License version 3.0 requirements will be 35 | ** met: http://www.gnu.org/copyleft/gpl.html. 36 | ** 37 | ** 38 | ** $QT_END_LICENSE$ 39 | ** 40 | ****************************************************************************/ 41 | 42 | #include 43 | 44 | int main() 45 | { 46 | return 0; 47 | } 48 | -------------------------------------------------------------------------------- /tests/benchmarks/tests.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | Client API performance 01 7 | cd /var/lib/qt5jsondb-tests/benchmarks/client; date && ./tst_bench_client && date 8 | 9 | 10 | Server-side performance 11 | cd /var/lib/qt5jsondb-tests/benchmarks/partition; date && ./tst_bench_partition && date 12 | 13 | 14 | JsonDbCachingListModel performance 15 | cd /var/lib/qt5jsondb-tests/benchmarks/jsondbcachinglistmodel; date && ./tst_bench_jsondbcachinglistmodel -platform minimal && date 16 | 17 | 18 | JsonDbCachingListModel performance 19 | cd /var/lib/qt5jsondb-tests/benchmarks/jsondbsortinglistmodel; date && ./tst_bench_jsondbsortinglistmodel -platform minimal && date 20 | 21 | 22 | JsonDbObject performance 23 | cd /var/lib/qt5jsondb-tests/benchmarks/jsondbobject; date && ./tst_bench_object && date 24 | 25 | 26 | Btrees performance 27 | cd /var/lib/qt5jsondb-tests/benchmarks/btrees; date && ./tst_bench_btrees && date 28 | 29 | 30 | 31 | 32 | -------------------------------------------------------------------------------- /config.tests/libedit/libedit.cpp: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | ** 3 | ** Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies). 4 | ** Contact: http://www.qt-project.org/legal 5 | ** 6 | ** This file is part of the config.tests of the Qt Toolkit. 7 | ** 8 | ** $QT_BEGIN_LICENSE:LGPL$ 9 | ** Commercial License Usage 10 | ** Licensees holding valid commercial Qt licenses may use this file in 11 | ** accordance with the commercial license agreement provided with the 12 | ** Software or, alternatively, in accordance with the terms contained in 13 | ** a written agreement between you and Digia. For licensing terms and 14 | ** conditions see http://qt.digia.com/licensing. For further information 15 | ** use the contact form at http://qt.digia.com/contact-us. 16 | ** 17 | ** GNU Lesser General Public License Usage 18 | ** Alternatively, this file may be used under the terms of the GNU Lesser 19 | ** General Public License version 2.1 as published by the Free Software 20 | ** Foundation and appearing in the file LICENSE.LGPL included in the 21 | ** packaging of this file. Please review the following information to 22 | ** ensure the GNU Lesser General Public License version 2.1 requirements 23 | ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. 24 | ** 25 | ** In addition, as a special exception, Digia gives you certain additional 26 | ** rights. These rights are described in the Digia Qt LGPL Exception 27 | ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. 28 | ** 29 | ** GNU General Public License Usage 30 | ** Alternatively, this file may be used under the terms of the GNU 31 | ** General Public License version 3.0 as published by the Free Software 32 | ** Foundation and appearing in the file LICENSE.GPL included in the 33 | ** packaging of this file. Please review the following information to 34 | ** ensure the GNU General Public License version 3.0 requirements will be 35 | ** met: http://www.gnu.org/copyleft/gpl.html. 36 | ** 37 | ** 38 | ** $QT_END_LICENSE$ 39 | ** 40 | ****************************************************************************/ 41 | 42 | #include 43 | 44 | int main(int, char**) 45 | { 46 | History *hist = history_init(); 47 | return 0; 48 | } 49 | -------------------------------------------------------------------------------- /tests/auto/partition/json/map-reduce.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "_type": "Contact", 4 | "displayName": "Joe Smith", 5 | "name": { 6 | "firstName": "joe", 7 | "lastName": "smith" 8 | }, 9 | "preferredNumber": "+15555551212", 10 | "phoneNumbers": [ 11 | { 12 | "type": "mobile", 13 | "number": "+15555551212" 14 | }, 15 | { 16 | "type": "work", 17 | "number": "+17812232323" 18 | }, 19 | { 20 | "type": "home", 21 | "number": "+16174532300" 22 | } 23 | ] 24 | }, 25 | { 26 | "_type": "Contact", 27 | "displayName": "Nancy Doe", 28 | "name": { 29 | "firstName": "nancy", 30 | "lastName": "doe" 31 | }, 32 | "preferredNumber": "+14567891234", 33 | "phoneNumbers": [ 34 | { 35 | "type": "mobile", 36 | "number": "+14567891234" 37 | }, 38 | { 39 | "type": "home", 40 | "number": "+16174532322" 41 | } 42 | ] 43 | }, 44 | { 45 | "_type": "_schemaType", 46 | "name": "Phone", 47 | "schema": { 48 | "type": "object", 49 | "extends": {"$ref": "View"} 50 | } 51 | }, 52 | { 53 | "_type": "_schemaType", 54 | "name": "PhoneCount", 55 | "schema": { 56 | "type": "object", 57 | "extends": {"$ref": "View"} 58 | } 59 | }, 60 | { 61 | "_type": "Map", 62 | "targetType": "Phone", 63 | "map": {"Contact": "function (c) {\ 64 | for (var i in c.phoneNumbers) {\ 65 | var phone = c.phoneNumbers[i];\ 66 | var id = c.displayName + ':' + phone.number; \ 67 | var uuid = jsondb.createUuidFromString(id); \ 68 | jsondb.emit({_uuid: uuid, key: phone.number, displayName: c.displayName});\ 69 | }\ 70 | }"} 71 | }, 72 | { 73 | "_type": "Reduce", 74 | "targetType": "PhoneCount", 75 | "sourceType": "Phone", 76 | "sourceKeyName": "key", 77 | "add": "function add (k, z, c) { if (!z) {z = {count: 0}}; z.count += 1; return z;}", 78 | "subtract": "function subtract (k, z, c) { if (!z) {z = {count: 0}}; z.count -= 1; if (z.count) return z;}" 79 | } 80 | ] 81 | -------------------------------------------------------------------------------- /tests/manual/outofspace/query.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | ############################################################################# 3 | ## 4 | ## Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies). 5 | ## Contact: http://www.qt-project.org/legal 6 | ## 7 | ## This file is part of the QtAddOn.Jsondb module of the Qt Toolkit. 8 | ## 9 | ## $QT_BEGIN_LICENSE:LGPL$ 10 | ## Commercial License Usage 11 | ## Licensees holding valid commercial Qt licenses may use this file in 12 | ## accordance with the commercial license agreement provided with the 13 | ## Software or, alternatively, in accordance with the terms contained in 14 | ## a written agreement between you and Digia. For licensing terms and 15 | ## conditions see http://qt.digia.com/licensing. For further information 16 | ## use the contact form at http://qt.digia.com/contact-us. 17 | ## 18 | ## GNU Lesser General Public License Usage 19 | ## Alternatively, this file may be used under the terms of the GNU Lesser 20 | ## General Public License version 2.1 as published by the Free Software 21 | ## Foundation and appearing in the file LICENSE.LGPL included in the 22 | ## packaging of this file. Please review the following information to 23 | ## ensure the GNU Lesser General Public License version 2.1 requirements 24 | ## will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. 25 | ## 26 | ## In addition, as a special exception, Digia gives you certain additional 27 | ## rights. These rights are described in the Digia Qt LGPL Exception 28 | ## version 1.1, included in the file LGPL_EXCEPTION.txt in this package. 29 | ## 30 | ## GNU General Public License Usage 31 | ## Alternatively, this file may be used under the terms of the GNU 32 | ## General Public License version 3.0 as published by the Free Software 33 | ## Foundation and appearing in the file LICENSE.GPL included in the 34 | ## packaging of this file. Please review the following information to 35 | ## ensure the GNU General Public License version 3.0 requirements will be 36 | ## met: http://www.gnu.org/copyleft/gpl.html. 37 | ## 38 | ## 39 | ## $QT_END_LICENSE$ 40 | ## 41 | ############################################################################# 42 | 43 | JSONDB_CLIENT=jsondb-client 44 | 45 | echo "Querying elements" 46 | $JSONDB_CLIENT -terminate query "[?_type=\"duck\"]" 47 | 48 | echo "Done" 49 | 50 | -------------------------------------------------------------------------------- /src/3rdparty/zlib/crc32.h: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | ** 3 | ** Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies). 4 | ** Contact: http://www.qt-project.org/legal 5 | ** 6 | ** This file is part of the QtAddOn.JsonDb module of the Qt Toolkit. 7 | ** 8 | ** $QT_BEGIN_LICENSE:LGPL$ 9 | ** Commercial License Usage 10 | ** Licensees holding valid commercial Qt licenses may use this file in 11 | ** accordance with the commercial license agreement provided with the 12 | ** Software or, alternatively, in accordance with the terms contained in 13 | ** a written agreement between you and Digia. For licensing terms and 14 | ** conditions see http://qt.digia.com/licensing. For further information 15 | ** use the contact form at http://qt.digia.com/contact-us. 16 | ** 17 | ** GNU Lesser General Public License Usage 18 | ** Alternatively, this file may be used under the terms of the GNU Lesser 19 | ** General Public License version 2.1 as published by the Free Software 20 | ** Foundation and appearing in the file LICENSE.LGPL included in the 21 | ** packaging of this file. Please review the following information to 22 | ** ensure the GNU Lesser General Public License version 2.1 requirements 23 | ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. 24 | ** 25 | ** In addition, as a special exception, Digia gives you certain additional 26 | ** rights. These rights are described in the Digia Qt LGPL Exception 27 | ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. 28 | ** 29 | ** GNU General Public License Usage 30 | ** Alternatively, this file may be used under the terms of the GNU 31 | ** General Public License version 3.0 as published by the Free Software 32 | ** Foundation and appearing in the file LICENSE.GPL included in the 33 | ** packaging of this file. Please review the following information to 34 | ** ensure the GNU General Public License version 3.0 requirements will be 35 | ** met: http://www.gnu.org/copyleft/gpl.html. 36 | ** 37 | ** 38 | ** $QT_END_LICENSE$ 39 | ** 40 | ****************************************************************************/ 41 | 42 | #ifndef ZLIB_CRC32_H 43 | #define ZLIB_CRC32_H 44 | 45 | extern "C" 46 | unsigned long crc32_little(unsigned long crc, const unsigned char *buf, unsigned len); 47 | 48 | 49 | #endif 50 | -------------------------------------------------------------------------------- /tests/manual/bits/build.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | ############################################################################# 3 | ## 4 | ## Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies). 5 | ## Contact: http://www.qt-project.org/legal 6 | ## 7 | ## This file is part of the QtAddOn.Jsondb module of the Qt Toolkit. 8 | ## 9 | ## $QT_BEGIN_LICENSE:LGPL$ 10 | ## Commercial License Usage 11 | ## Licensees holding valid commercial Qt licenses may use this file in 12 | ## accordance with the commercial license agreement provided with the 13 | ## Software or, alternatively, in accordance with the terms contained in 14 | ## a written agreement between you and Digia. For licensing terms and 15 | ## conditions see http://qt.digia.com/licensing. For further information 16 | ## use the contact form at http://qt.digia.com/contact-us. 17 | ## 18 | ## GNU Lesser General Public License Usage 19 | ## Alternatively, this file may be used under the terms of the GNU Lesser 20 | ## General Public License version 2.1 as published by the Free Software 21 | ## Foundation and appearing in the file LICENSE.LGPL included in the 22 | ## packaging of this file. Please review the following information to 23 | ## ensure the GNU Lesser General Public License version 2.1 requirements 24 | ## will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. 25 | ## 26 | ## In addition, as a special exception, Digia gives you certain additional 27 | ## rights. These rights are described in the Digia Qt LGPL Exception 28 | ## version 1.1, included in the file LGPL_EXCEPTION.txt in this package. 29 | ## 30 | ## GNU General Public License Usage 31 | ## Alternatively, this file may be used under the terms of the GNU 32 | ## General Public License version 3.0 as published by the Free Software 33 | ## Foundation and appearing in the file LICENSE.GPL included in the 34 | ## packaging of this file. Please review the following information to 35 | ## ensure the GNU General Public License version 3.0 requirements will be 36 | ## met: http://www.gnu.org/copyleft/gpl.html. 37 | ## 38 | ## 39 | ## $QT_END_LICENSE$ 40 | ## 41 | ############################################################################# 42 | 43 | rm -f bin/bits32 bin/bits64 44 | rm -f btree.o main.o 45 | qmake TARGET=bits64 && make 46 | rm -f btree.o main.o 47 | qmake TARGET=bits32 -spec linux-g++-32 && make 48 | -------------------------------------------------------------------------------- /tests/auto/cmake/test_modules/main.cpp: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | ** 3 | ** Copyright (C) 2012 Klarälvdalens Datakonsult AB, a KDAB Group company, info@kdab.com, author Stephen Kelly 4 | ** Contact: http://www.qt-project.org/legal 5 | ** 6 | ** This file is part of the test suite of the Qt Toolkit. 7 | ** 8 | ** $QT_BEGIN_LICENSE:LGPL$ 9 | ** Commercial License Usage 10 | ** Licensees holding valid commercial Qt licenses may use this file in 11 | ** accordance with the commercial license agreement provided with the 12 | ** Software or, alternatively, in accordance with the terms contained in 13 | ** a written agreement between you and Digia. For licensing terms and 14 | ** conditions see http://qt.digia.com/licensing. For further information 15 | ** use the contact form at http://qt.digia.com/contact-us. 16 | ** 17 | ** GNU Lesser General Public License Usage 18 | ** Alternatively, this file may be used under the terms of the GNU Lesser 19 | ** General Public License version 2.1 as published by the Free Software 20 | ** Foundation and appearing in the file LICENSE.LGPL included in the 21 | ** packaging of this file. Please review the following information to 22 | ** ensure the GNU Lesser General Public License version 2.1 requirements 23 | ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. 24 | ** 25 | ** In addition, as a special exception, Digia gives you certain additional 26 | ** rights. These rights are described in the Digia Qt LGPL Exception 27 | ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. 28 | ** 29 | ** GNU General Public License Usage 30 | ** Alternatively, this file may be used under the terms of the GNU 31 | ** General Public License version 3.0 as published by the Free Software 32 | ** Foundation and appearing in the file LICENSE.GPL included in the 33 | ** packaging of this file. Please review the following information to 34 | ** ensure the GNU General Public License version 3.0 requirements will be 35 | ** met: http://www.gnu.org/copyleft/gpl.html. 36 | ** 37 | ** 38 | ** $QT_END_LICENSE$ 39 | ** 40 | ****************************************************************************/ 41 | 42 | #include 43 | 44 | int main(int argc, char **argv) 45 | { 46 | QtJsonDb::QJsonDbObject jsonDbObject; 47 | 48 | return 0; 49 | } 50 | -------------------------------------------------------------------------------- /tests/manual/outofspace/create.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | ############################################################################# 3 | ## 4 | ## Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies). 5 | ## Contact: http://www.qt-project.org/legal 6 | ## 7 | ## This file is part of the QtAddOn.Jsondb module of the Qt Toolkit. 8 | ## 9 | ## $QT_BEGIN_LICENSE:LGPL$ 10 | ## Commercial License Usage 11 | ## Licensees holding valid commercial Qt licenses may use this file in 12 | ## accordance with the commercial license agreement provided with the 13 | ## Software or, alternatively, in accordance with the terms contained in 14 | ## a written agreement between you and Digia. For licensing terms and 15 | ## conditions see http://qt.digia.com/licensing. For further information 16 | ## use the contact form at http://qt.digia.com/contact-us. 17 | ## 18 | ## GNU Lesser General Public License Usage 19 | ## Alternatively, this file may be used under the terms of the GNU Lesser 20 | ## General Public License version 2.1 as published by the Free Software 21 | ## Foundation and appearing in the file LICENSE.LGPL included in the 22 | ## packaging of this file. Please review the following information to 23 | ## ensure the GNU Lesser General Public License version 2.1 requirements 24 | ## will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. 25 | ## 26 | ## In addition, as a special exception, Digia gives you certain additional 27 | ## rights. These rights are described in the Digia Qt LGPL Exception 28 | ## version 1.1, included in the file LGPL_EXCEPTION.txt in this package. 29 | ## 30 | ## GNU General Public License Usage 31 | ## Alternatively, this file may be used under the terms of the GNU 32 | ## General Public License version 3.0 as published by the Free Software 33 | ## Foundation and appearing in the file LICENSE.GPL included in the 34 | ## packaging of this file. Please review the following information to 35 | ## ensure the GNU General Public License version 3.0 requirements will be 36 | ## met: http://www.gnu.org/copyleft/gpl.html. 37 | ## 38 | ## 39 | ## $QT_END_LICENSE$ 40 | ## 41 | ############################################################################# 42 | 43 | COUNTER=0 44 | TOTAL=$1 45 | JSONDB_CLIENT=jsondb-client 46 | 47 | echo "Creating $TOTAL elements" 48 | while [ $COUNTER -lt $TOTAL ]; do 49 | echo "Creating $COUNTER element" 50 | $JSONDB_CLIENT -terminate create "{\"_type\": \"duck\", \"name\": \"$COUNTER\"}" 51 | let COUNTER=COUNTER+1 52 | done 53 | 54 | echo "Done" 55 | 56 | -------------------------------------------------------------------------------- /src/common/jsondbsocketname_p.h: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | ** 3 | ** Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies). 4 | ** Contact: http://www.qt-project.org/legal 5 | ** 6 | ** This file is part of the QtAddOn.JsonDb module of the Qt Toolkit. 7 | ** 8 | ** $QT_BEGIN_LICENSE:LGPL$ 9 | ** Commercial License Usage 10 | ** Licensees holding valid commercial Qt licenses may use this file in 11 | ** accordance with the commercial license agreement provided with the 12 | ** Software or, alternatively, in accordance with the terms contained in 13 | ** a written agreement between you and Digia. For licensing terms and 14 | ** conditions see http://qt.digia.com/licensing. For further information 15 | ** use the contact form at http://qt.digia.com/contact-us. 16 | ** 17 | ** GNU Lesser General Public License Usage 18 | ** Alternatively, this file may be used under the terms of the GNU Lesser 19 | ** General Public License version 2.1 as published by the Free Software 20 | ** Foundation and appearing in the file LICENSE.LGPL included in the 21 | ** packaging of this file. Please review the following information to 22 | ** ensure the GNU Lesser General Public License version 2.1 requirements 23 | ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. 24 | ** 25 | ** In addition, as a special exception, Digia gives you certain additional 26 | ** rights. These rights are described in the Digia Qt LGPL Exception 27 | ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. 28 | ** 29 | ** GNU General Public License Usage 30 | ** Alternatively, this file may be used under the terms of the GNU 31 | ** General Public License version 3.0 as published by the Free Software 32 | ** Foundation and appearing in the file LICENSE.GPL included in the 33 | ** packaging of this file. Please review the following information to 34 | ** ensure the GNU General Public License version 3.0 requirements will be 35 | ** met: http://www.gnu.org/copyleft/gpl.html. 36 | ** 37 | ** 38 | ** $QT_END_LICENSE$ 39 | ** 40 | ****************************************************************************/ 41 | 42 | #ifndef JSONDBSOCKETNAME_P_H 43 | #define JSONDBSOCKETNAME_P_H 44 | 45 | #define _stringify_socket_name(x) #x 46 | #define stringify_socket_name(x) _stringify_socket_name(x) 47 | #ifndef JSONDB_SOCKET_NAME 48 | #define JSONDB_SOCKET_NAME qt5jsondb 49 | #endif 50 | 51 | #define JSONDB_SOCKET_NAME_STRING stringify_socket_name(JSONDB_SOCKET_NAME) 52 | 53 | #endif // JSONDBSOCKETNAME_H 54 | -------------------------------------------------------------------------------- /doc/JsonDB-CommandLine-Client.txt: -------------------------------------------------------------------------------- 1 | jclient is a thin wrapper for testing the jsondb database. 2 | 3 | You must specify fairly accurately formated JSON objects to get the 4 | database to respond. 5 | 6 | Here's a sample session: 7 | 8 | jclient> create {"name":"Fred", "type":"CONTACT"} 9 | Received message: {"error" : null,"id" : 0,"result" : {"id" : "{b2c9c712-1ba3-41fd-a454-51c120ce1c8c}"}} 10 | 11 | jclient> notify {"query":"[?type='CONTACT']","actions":["create"]} 12 | Received message: {"error" : null,"id" : 1,"result" : {"active" : true}} 13 | 14 | jclient> create {"name":"Wilma","type":"CONTACT"} 15 | Received message: {"error" : null,"id" : 2,"result" : {"id" : "{35275206-e875-4c5d-a7b9-6cfd1cac67c2}"}} 16 | Received message: {"id" : 1,"notify" : {"action" : "create","object" : {"id" : "{35275206-e875-4c5d-a7b9-6cfd1cac67c2}","name" : "Wilma","type" : "CONTACT"}}} 17 | 18 | jclient> create {"name":"Quarry", "type":"LOCATION"} 19 | Received message: {"error" : null,"id" : 3,"result" : {"id" : "{0eba3c55-48ac-433a-833c-ca1a8c5c395d}"}} 20 | 21 | jclient> find {"query":".*"} 22 | Received message: {"error" : null,"id" : 4,"result" : {"data" : [{"id" : "{b2c9c712-1ba3-41fd-a454-51c120ce1c8c}","name" : "Fred","type" : "CONTACT"},{"id" : "{35275206-e875-4c5d-a7b9-6cfd1cac67c2}","name" : "Wilma","type" : "CONTACT"},{"id" : "{0eba3c55-48ac-433a-833c-ca1a8c5c395d}","name" : "Quarry","type" : "LOCATION"}],"length" : 3,"offset" : 0}} 23 | 24 | jclient> find {"query":"[?type~'location']"} 25 | Received message: {"error" : null,"id" : 5,"result" : {"data" : [{"id" : "{0eba3c55-48ac-433a-833c-ca1a8c5c395d}","name" : "Quarry","type" : "LOCATION"}],"length" : 1,"offset" : 0}} 26 | 27 | jclient> update {"name":"Fred Flintstone", "type":"CONTACT", "id":"{b2c9c712-1ba3-41fd-a454-51c120ce1c8c}"} 28 | Received message: {"error" : null,"id" : 9,"result" : null} 29 | 30 | jclient> find {"query":"[?type='CONTACT']"} 31 | Received message: {"error" : null,"id" : 10,"result" : {"data" : [{"id" : "{b2c9c712-1ba3-41fd-a454-51c120ce1c8c}","name" : "Fred Flintstone","type" : "CONTACT"},{"id" : "{35275206-e875-4c5d-a7b9-6cfd1cac67c2}","name" : "Wilma","type" : "CONTACT"}],"length" : 2,"offset" : 0}} 32 | 33 | jclient> delete {"id":"{35275206-e875-4c5d-a7b9-6cfd1cac67c2}"} 34 | Received message: {"error" : null,"id" : 11,"result" : null} 35 | 36 | jclient> find {"query":".*"} 37 | Received message: {"error" : null,"id" : 13,"result" : {"data" : [{"id" : "{b2c9c712-1ba3-41fd-a454-51c120ce1c8c}","name" : "Fred Flintstone","type" : "CONTACT"},{"id" : "{0eba3c55-48ac-433a-833c-ca1a8c5c395d}","name" : "Quarry","type" : "LOCATION"}],"length" : 2,"offset" : 0}} 38 | -------------------------------------------------------------------------------- /src/partition/jsondbscriptengine.h: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | ** 3 | ** Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies). 4 | ** Contact: http://www.qt-project.org/legal 5 | ** 6 | ** This file is part of the QtAddOn.JsonDb module of the Qt Toolkit. 7 | ** 8 | ** $QT_BEGIN_LICENSE:LGPL$ 9 | ** Commercial License Usage 10 | ** Licensees holding valid commercial Qt licenses may use this file in 11 | ** accordance with the commercial license agreement provided with the 12 | ** Software or, alternatively, in accordance with the terms contained in 13 | ** a written agreement between you and Digia. For licensing terms and 14 | ** conditions see http://qt.digia.com/licensing. For further information 15 | ** use the contact form at http://qt.digia.com/contact-us. 16 | ** 17 | ** GNU Lesser General Public License Usage 18 | ** Alternatively, this file may be used under the terms of the GNU Lesser 19 | ** General Public License version 2.1 as published by the Free Software 20 | ** Foundation and appearing in the file LICENSE.LGPL included in the 21 | ** packaging of this file. Please review the following information to 22 | ** ensure the GNU Lesser General Public License version 2.1 requirements 23 | ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. 24 | ** 25 | ** In addition, as a special exception, Digia gives you certain additional 26 | ** rights. These rights are described in the Digia Qt LGPL Exception 27 | ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. 28 | ** 29 | ** GNU General Public License Usage 30 | ** Alternatively, this file may be used under the terms of the GNU 31 | ** General Public License version 3.0 as published by the Free Software 32 | ** Foundation and appearing in the file LICENSE.GPL included in the 33 | ** packaging of this file. Please review the following information to 34 | ** ensure the GNU General Public License version 3.0 requirements will be 35 | ** met: http://www.gnu.org/copyleft/gpl.html. 36 | ** 37 | ** 38 | ** $QT_END_LICENSE$ 39 | ** 40 | ****************************************************************************/ 41 | 42 | #ifndef JSONDB_SCRIPT_ENGINE_H 43 | #define JSONDB_SCRIPT_ENGINE_H 44 | 45 | #include 46 | 47 | #include "jsondbpartitionglobal.h" 48 | 49 | QT_BEGIN_HEADER 50 | 51 | QT_BEGIN_NAMESPACE_JSONDB_PARTITION 52 | 53 | class Q_JSONDB_PARTITION_EXPORT JsonDbScriptEngine 54 | { 55 | public: 56 | static QJSEngine *scriptEngine(); 57 | static void releaseScriptEngine(); 58 | }; 59 | 60 | QT_END_NAMESPACE_JSONDB_PARTITION 61 | 62 | QT_END_HEADER 63 | 64 | #endif // JSONDB_SCRIPT_ENGINE_H 65 | -------------------------------------------------------------------------------- /src/imports/jsondb/plugin.h: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | ** 3 | ** Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies). 4 | ** Contact: http://www.qt-project.org/legal 5 | ** 6 | ** This file is part of the QtAddOn.JsonDb module of the Qt Toolkit. 7 | ** 8 | ** $QT_BEGIN_LICENSE:LGPL$ 9 | ** Commercial License Usage 10 | ** Licensees holding valid commercial Qt licenses may use this file in 11 | ** accordance with the commercial license agreement provided with the 12 | ** Software or, alternatively, in accordance with the terms contained in 13 | ** a written agreement between you and Digia. For licensing terms and 14 | ** conditions see http://qt.digia.com/licensing. For further information 15 | ** use the contact form at http://qt.digia.com/contact-us. 16 | ** 17 | ** GNU Lesser General Public License Usage 18 | ** Alternatively, this file may be used under the terms of the GNU Lesser 19 | ** General Public License version 2.1 as published by the Free Software 20 | ** Foundation and appearing in the file LICENSE.LGPL included in the 21 | ** packaging of this file. Please review the following information to 22 | ** ensure the GNU Lesser General Public License version 2.1 requirements 23 | ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. 24 | ** 25 | ** In addition, as a special exception, Digia gives you certain additional 26 | ** rights. These rights are described in the Digia Qt LGPL Exception 27 | ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. 28 | ** 29 | ** GNU General Public License Usage 30 | ** Alternatively, this file may be used under the terms of the GNU 31 | ** General Public License version 3.0 as published by the Free Software 32 | ** Foundation and appearing in the file LICENSE.GPL included in the 33 | ** packaging of this file. Please review the following information to 34 | ** ensure the GNU General Public License version 3.0 requirements will be 35 | ** met: http://www.gnu.org/copyleft/gpl.html. 36 | ** 37 | ** 38 | ** $QT_END_LICENSE$ 39 | ** 40 | ****************************************************************************/ 41 | 42 | #ifndef JSONDB_PLUGIN_H 43 | #define JSONDB_PLUGIN_H 44 | 45 | #include 46 | #include 47 | #include 48 | 49 | extern QQmlEngine *g_declEngine; 50 | 51 | class JsonDbPlugin : public QQmlExtensionPlugin 52 | { 53 | Q_OBJECT 54 | Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QQmlExtensionInterface" FILE "jsondb.json") 55 | public: 56 | void initializeEngine(QQmlEngine *engine, const char *uri); 57 | void registerTypes(const char *uri); 58 | }; 59 | 60 | #endif 61 | -------------------------------------------------------------------------------- /tests/auto/partition/json/map-reduce-schema.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "_type": "Contact", 4 | "displayName": "Joe Smith", 5 | "name": { 6 | "firstName": "joe", 7 | "lastName": "smith" 8 | }, 9 | "preferredNumber": "+15555551212", 10 | "phoneNumbers": [ 11 | { 12 | "type": "mobile", 13 | "number": "+15555551212" 14 | }, 15 | { 16 | "type": "work", 17 | "number": "+17812232323" 18 | }, 19 | { 20 | "type": "home", 21 | "number": "+16174532300" 22 | } 23 | ] 24 | }, 25 | { 26 | "_type": "Contact", 27 | "displayName": "Nancy Doe", 28 | "name": { 29 | "firstName": "nancy", 30 | "lastName": "doe" 31 | }, 32 | "preferredNumber": "+14567891234", 33 | "phoneNumbers": [ 34 | { 35 | "type": "mobile", 36 | "number": "+14567891234" 37 | }, 38 | { 39 | "type": "home", 40 | "number": "+16174532300" 41 | } 42 | ] 43 | }, 44 | { 45 | "_type": "_schemaType", 46 | "name": "Phone", 47 | "schema": { 48 | "type": "object", 49 | "extends": {"$ref": "View"}, 50 | "properties": { 51 | "key": { "type":"string", "required": true }, 52 | "displayName": { "type":"string", "required": true } 53 | } 54 | } 55 | }, 56 | { 57 | "_type": "_schemaType", 58 | "name": "PhoneCount", 59 | "schema": { 60 | "type": "object", 61 | "extends": {"$ref": "View"}, 62 | "properties": { 63 | "value": { 64 | "type": "object", 65 | "properties": { 66 | "count": { "type":"integer", "required": true } 67 | } 68 | } 69 | } 70 | } 71 | }, 72 | { 73 | "_type": "Map", 74 | "targetType": "Phone", 75 | "targetKeyName": "key", 76 | "brokenMap": {"Contact":"function map (c) { for (var i in c.phoneNumbers) { var phone = c.phoneNumbers[i]; jsondb.emit({key: phone.number, name: c.displayName }); }}"}, 77 | "map": {"Contact":"function map (c) { for (var i in c.phoneNumbers) { var phone = c.phoneNumbers[i]; jsondb.emit({key: phone.number, displayName: c.displayName}); }}"} 78 | }, 79 | { 80 | "_type": "Reduce", 81 | "targetType": "PhoneCount", 82 | "sourceType": "Phone", 83 | "sourceKeyName": "key", 84 | "brokenAdd": "function add (k, z, c) { if (!z) {z = { phoneCount: 0 }}; z.phoneCount += 1; return z;}", 85 | "add": "function add (k, z, c) { if (!z) {z = { count: 0 }}; z.count += 1; return z;}", 86 | "subtract": "function subtract (k, z, c) { if (!z) {z = { count: 0 }}; z.count -= 1; if (z.count > 0) return z;}" 87 | } 88 | ] 89 | -------------------------------------------------------------------------------- /src/partition/jsondbpartitionspec.h: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | ** 3 | ** Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies). 4 | ** Contact: http://www.qt-project.org/legal 5 | ** 6 | ** This file is part of the QtAddOn.JsonDb module of the Qt Toolkit. 7 | ** 8 | ** $QT_BEGIN_LICENSE:LGPL$ 9 | ** Commercial License Usage 10 | ** Licensees holding valid commercial Qt licenses may use this file in 11 | ** accordance with the commercial license agreement provided with the 12 | ** Software or, alternatively, in accordance with the terms contained in 13 | ** a written agreement between you and Digia. For licensing terms and 14 | ** conditions see http://qt.digia.com/licensing. For further information 15 | ** use the contact form at http://qt.digia.com/contact-us. 16 | ** 17 | ** GNU Lesser General Public License Usage 18 | ** Alternatively, this file may be used under the terms of the GNU Lesser 19 | ** General Public License version 2.1 as published by the Free Software 20 | ** Foundation and appearing in the file LICENSE.LGPL included in the 21 | ** packaging of this file. Please review the following information to 22 | ** ensure the GNU Lesser General Public License version 2.1 requirements 23 | ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. 24 | ** 25 | ** In addition, as a special exception, Digia gives you certain additional 26 | ** rights. These rights are described in the Digia Qt LGPL Exception 27 | ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. 28 | ** 29 | ** GNU General Public License Usage 30 | ** Alternatively, this file may be used under the terms of the GNU 31 | ** General Public License version 3.0 as published by the Free Software 32 | ** Foundation and appearing in the file LICENSE.GPL included in the 33 | ** packaging of this file. Please review the following information to 34 | ** ensure the GNU General Public License version 3.0 requirements will be 35 | ** met: http://www.gnu.org/copyleft/gpl.html. 36 | ** 37 | ** 38 | ** $QT_END_LICENSE$ 39 | ** 40 | ****************************************************************************/ 41 | 42 | #ifndef JSONDB_PARTITION_SPEC_H 43 | #define JSONDB_PARTITION_SPEC_H 44 | 45 | #include 46 | 47 | #include "jsondbpartitionglobal.h" 48 | 49 | QT_BEGIN_HEADER 50 | 51 | QT_BEGIN_NAMESPACE_JSONDB_PARTITION 52 | 53 | class Q_JSONDB_PARTITION_EXPORT JsonDbPartitionSpec 54 | { 55 | public: 56 | QString name; 57 | QString path; 58 | bool isRemovable; 59 | bool isDefault; 60 | 61 | inline JsonDbPartitionSpec() 62 | : isRemovable(false), isDefault(false) { } 63 | }; 64 | 65 | QT_END_NAMESPACE_JSONDB_PARTITION 66 | 67 | QT_END_HEADER 68 | 69 | #endif // JSONDB_PARTITION_SPEC_H 70 | -------------------------------------------------------------------------------- /doc/jsondb.qdocconf: -------------------------------------------------------------------------------- 1 | # Name of the project. 2 | project = QtJsonDb 3 | 4 | # Directories in which to search for files to document. 5 | # Paths are relative to the location of this file. 6 | exampledirs += ../examples 7 | headerdirs += ./src \ 8 | ../src/client \ 9 | ../src/imports/jsondb 10 | imagedirs += images 11 | sourcedirs += ./src \ 12 | ../src/client \ 13 | ../src/imports/jsondb 14 | 15 | Cpp.ignoretokens = \ 16 | QT_BEGIN_HEADER \ 17 | QT_END_HEADER \ 18 | QT_BEGIN_NAMESPACE_JSONDB \ 19 | QT_END_NAMESPACE_JSONDB \ 20 | Q_ADDON_JSONDB_EXPORT 21 | 22 | # The following parameters are for creating a qhp file, the qhelpgenerator 23 | # program can convert the qhp file into a qch file which can be opened in 24 | # Qt Assistant and/or Qt Creator. 25 | 26 | # Defines the name of the project. You cannot use operators (+, =, -) in 27 | # the name. Properties for this project are set using a qhp..property 28 | # format. 29 | qhp.projects = QtJsonDb 30 | 31 | # Sets the name of the output qhp file. 32 | qhp.QtJsonDb.file = QtJsonDb.qhp 33 | 34 | # Namespace for the output file. This namespace is used to distinguish between 35 | # different documentation files in Creator/Assistant. The namespace ends with 36 | # a version being a number containing a major, minor and revision element. 37 | # E.g. version 1.0 becomes 100. 38 | qhp.QtJsonDb.namespace = com.nokia.qtjsondb.100 39 | 40 | # Title for the package, will be the main title for the package in 41 | # Assistant/Creator. 42 | qhp.QtJsonDb.indexTitle = Qt JsonDb Reference Documentation 43 | 44 | # Extra files to add to the output which are not linked to from anywhere 45 | # using a qdoc \l command. 46 | qhp.QtJsonDb.extraFiles = style/style.css \ 47 | index.html 48 | 49 | # Only update the name of the project for the next variables. 50 | qhp.QtJsonDb.virtualFolder = qdoc 51 | qhp.QtJsonDb.subprojects = classes 52 | qhp.QtJsonDb.subprojects.classes.title = Classes 53 | qhp.QtJsonDb.subprojects.classes.selectors = class fake:headerfile 54 | qhp.QtJsonDb.subprojects.classes.sortPages = true 55 | 56 | 57 | 58 | 59 | # Do NOT change the variables after this line unless you know what you are doing. 60 | 61 | outputdir = html 62 | outputformats = HTML 63 | 64 | examples.fileextensions = "*.cpp *.h *.js *.svg *.xml *.ui *.qml" 65 | examples.imageextensions = "*.png *.jpeg *.jpg *.gif *.mng" 66 | headers.fileextensions = "*.h *.ch *.h++ *.hh *.hpp *.hxx" 67 | sources.fileextensions = "*.cpp *.qdoc *.mm *.qml" 68 | 69 | HTML.nobreadcrumbs = "true" 70 | 71 | HTML.templatedir = . 72 | HTML.stylesheets = style/style.css 73 | 74 | HTML.headerstyles = " \n" 75 | HTML.endheader = "\n" 76 | -------------------------------------------------------------------------------- /tests/auto/partition/json/array.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "_type": "ContactInArray", 4 | "displayName": "Joe Smith", 5 | "name": { 6 | "firstName": "joe", 7 | "lastName": "smith" 8 | }, 9 | "test": { 10 | "45": "joe" 11 | }, 12 | "test2": { 13 | "56": { 14 | "firstName": "joe" 15 | } 16 | }, 17 | "preferredNumber": "+15555551212", 18 | "foo": [ 19 | [ 20 | { "bar": "val00" }, 21 | { "bar": "val01" }, 22 | { "bar": "val02" } 23 | ], 24 | [ 25 | { "bar": "val10" }, 26 | { "bar": "val11" }, 27 | { "bar": "val12" } 28 | ] 29 | ], 30 | "phoneNumbers": [ 31 | { 32 | "type": "mobile", 33 | "number": "+15555551212", 34 | "validTime": [ 35 | { 36 | "timeFrom": "09:00", 37 | "timeTo": "13:00" 38 | }, 39 | { 40 | "timeFrom": "16:00", 41 | "timeTo": "20:00" 42 | } 43 | ] 44 | }, 45 | { 46 | "type": "work", 47 | "number": "+17812232323", 48 | "validTime": [ 49 | { 50 | "timeFrom": "21:00", 51 | "timeTo": "23:00" 52 | } 53 | ] 54 | }, 55 | { 56 | "type": "home", 57 | "number": "+16174532300" 58 | } 59 | ] 60 | }, 61 | { 62 | "_type": "ContactInArray", 63 | "displayName": "Nancy Doe", 64 | "name": { 65 | "firstName": "nancy", 66 | "lastName": "doe" 67 | }, 68 | "test": { 69 | "45": "nancy" 70 | }, 71 | "test2": { 72 | "56": { 73 | "firstName": "nancy" 74 | } 75 | }, 76 | "preferredNumber": "+14567891234", 77 | "foo": [ 78 | [ 79 | { "bar": "val00" }, 80 | { "bar": "val01" }, 81 | { "bar": "val02" } 82 | ], 83 | [ 84 | { "bar": "val10" }, 85 | { "bar": "val11" }, 86 | { "bar": "val12" } 87 | ] 88 | ], 89 | "phoneNumbers": [ 90 | { 91 | "type": "mobile", 92 | "number": "+14567891234", 93 | "validTime": [ 94 | { 95 | "timeFrom": "10:00", 96 | "timeTo": "13:00" 97 | }, 98 | { 99 | "timeFrom": "16:00", 100 | "timeTo": "20:00" 101 | } 102 | ] 103 | }, 104 | { 105 | "type": "home", 106 | "number": "+16174532300", 107 | "validTime": [ 108 | { 109 | "timeFrom": "21:00", 110 | "timeTo": "23:00" 111 | } 112 | ] 113 | } 114 | ] 115 | } 116 | ] 117 | -------------------------------------------------------------------------------- /src/partition/jsondbutils_p.h: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | ** 3 | ** Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies). 4 | ** Contact: http://www.qt-project.org/legal 5 | ** 6 | ** This file is part of the QtAddOn.JsonDb module of the Qt Toolkit. 7 | ** 8 | ** $QT_BEGIN_LICENSE:LGPL$ 9 | ** Commercial License Usage 10 | ** Licensees holding valid commercial Qt licenses may use this file in 11 | ** accordance with the commercial license agreement provided with the 12 | ** Software or, alternatively, in accordance with the terms contained in 13 | ** a written agreement between you and Digia. For licensing terms and 14 | ** conditions see http://qt.digia.com/licensing. For further information 15 | ** use the contact form at http://qt.digia.com/contact-us. 16 | ** 17 | ** GNU Lesser General Public License Usage 18 | ** Alternatively, this file may be used under the terms of the GNU Lesser 19 | ** General Public License version 2.1 as published by the Free Software 20 | ** Foundation and appearing in the file LICENSE.LGPL included in the 21 | ** packaging of this file. Please review the following information to 22 | ** ensure the GNU Lesser General Public License version 2.1 requirements 23 | ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. 24 | ** 25 | ** In addition, as a special exception, Digia gives you certain additional 26 | ** rights. These rights are described in the Digia Qt LGPL Exception 27 | ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. 28 | ** 29 | ** GNU General Public License Usage 30 | ** Alternatively, this file may be used under the terms of the GNU 31 | ** General Public License version 3.0 as published by the Free Software 32 | ** Foundation and appearing in the file LICENSE.GPL included in the 33 | ** packaging of this file. Please review the following information to 34 | ** ensure the GNU General Public License version 3.0 requirements will be 35 | ** met: http://www.gnu.org/copyleft/gpl.html. 36 | ** 37 | ** 38 | ** $QT_END_LICENSE$ 39 | ** 40 | ****************************************************************************/ 41 | 42 | #ifndef JSONDB_UTILS_P_H 43 | #define JSONDB_UTILS_P_H 44 | 45 | #include "jsondbpartitionglobal.h" 46 | 47 | #include 48 | #include 49 | 50 | #define JSONDB_INFO "[+" << __FUNCTION__ << "]" 51 | #define JSONDB_WARN "[-" << __FUNCTION__ << "]" 52 | #define JSONDB_ERROR "[!" << __FUNCTION__ << "]" 53 | 54 | QT_BEGIN_NAMESPACE_JSONDB_PARTITION 55 | 56 | inline bool operator==(const QString &str, QChar c) 57 | { 58 | return str.size() == 1 && str.at(0) == c; 59 | } 60 | 61 | inline bool operator!=(const QString &str, QChar c) 62 | { 63 | return !operator==(str, c); 64 | } 65 | 66 | QT_END_NAMESPACE_JSONDB_PARTITION 67 | 68 | #endif // JSONDB_UTILS_P_H 69 | -------------------------------------------------------------------------------- /examples/jsondb-client/example.qml: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | ** 3 | ** Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies). 4 | ** Contact: http://www.qt-project.org/legal 5 | ** 6 | ** This file is part of the examples of the Qt Toolkit. 7 | ** 8 | ** $QT_BEGIN_LICENSE:BSD$ 9 | ** You may use this file under the terms of the BSD license as follows: 10 | ** 11 | ** "Redistribution and use in source and binary forms, with or without 12 | ** modification, are permitted provided that the following conditions are 13 | ** met: 14 | ** * Redistributions of source code must retain the above copyright 15 | ** notice, this list of conditions and the following disclaimer. 16 | ** * Redistributions in binary form must reproduce the above copyright 17 | ** notice, this list of conditions and the following disclaimer in 18 | ** the documentation and/or other materials provided with the 19 | ** distribution. 20 | ** * Neither the name of Digia Plc and its Subsidiary(-ies) nor the names 21 | ** of its contributors may be used to endorse or promote products derived 22 | ** from this software without specific prior written permission. 23 | ** 24 | ** 25 | ** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 26 | ** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 27 | ** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 28 | ** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 29 | ** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 30 | ** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 31 | ** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 32 | ** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 33 | ** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 34 | ** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 35 | ** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." 36 | ** 37 | ** $QT_END_LICENSE$ 38 | ** 39 | ****************************************************************************/ 40 | 41 | import QtQuick 2.0 42 | import QtJsonDb 1.0 as JsonDb 43 | 44 | Item { 45 | 46 | JsonDb.Partition { 47 | id: partition 48 | } 49 | 50 | function createCallback(error, response) { 51 | if (error) 52 | console.debug("Error: " + JSON.stringify(error)); 53 | Qt.quit(); 54 | } 55 | 56 | Component.onCompleted: { 57 | var filename = "/home/user/Pictures/test000.jpeg"; 58 | var uuid = JsonDb.uuidFromString(filename); 59 | console.debug("Creating object with _uuid: " + uuid); 60 | 61 | partition.create({ 62 | "_uuid" : uuid, 63 | "_type" : "Image", 64 | "filename" : filename 65 | }, {}, createCallback); 66 | } 67 | } 68 | -------------------------------------------------------------------------------- /examples/declarative/desktop-inspector/content/Button.qml: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | ** 3 | ** Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies). 4 | ** Contact: http://www.qt-project.org/legal 5 | ** 6 | ** This file is part of the examples of the Qt Toolkit. 7 | ** 8 | ** $QT_BEGIN_LICENSE:BSD$ 9 | ** You may use this file under the terms of the BSD license as follows: 10 | ** 11 | ** "Redistribution and use in source and binary forms, with or without 12 | ** modification, are permitted provided that the following conditions are 13 | ** met: 14 | ** * Redistributions of source code must retain the above copyright 15 | ** notice, this list of conditions and the following disclaimer. 16 | ** * Redistributions in binary form must reproduce the above copyright 17 | ** notice, this list of conditions and the following disclaimer in 18 | ** the documentation and/or other materials provided with the 19 | ** distribution. 20 | ** * Neither the name of Digia Plc and its Subsidiary(-ies) nor the names 21 | ** of its contributors may be used to endorse or promote products derived 22 | ** from this software without specific prior written permission. 23 | ** 24 | ** 25 | ** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 26 | ** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 27 | ** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 28 | ** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 29 | ** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 30 | ** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 31 | ** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 32 | ** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 33 | ** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 34 | ** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 35 | ** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." 36 | ** 37 | ** $QT_END_LICENSE$ 38 | ** 39 | ****************************************************************************/ 40 | 41 | import QtQuick 2.0 42 | 43 | Rectangle { 44 | id: bt 45 | width: 120 46 | height: 40 47 | radius: 10 48 | color: ma.pressed?'silver': '#3ba5ff' 49 | property alias text:lb.text 50 | signal clicked() 51 | Text { 52 | id: lb 53 | anchors.fill:parent 54 | horizontalAlignment: Text.AlignHCenter 55 | verticalAlignment: Text.AlignVCenter 56 | elide:Text.ElideMiddle 57 | text:'button' 58 | color:'white' 59 | font.pixelSize: 12 60 | } 61 | MouseArea { 62 | id: ma 63 | anchors.fill:parent 64 | onClicked: { 65 | bt.clicked(); 66 | } 67 | } 68 | } 69 | -------------------------------------------------------------------------------- /examples/declarative/cachingmodel/Button.qml: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | ** 3 | ** Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies). 4 | ** Contact: http://www.qt-project.org/legal 5 | ** 6 | ** This file is part of the examples of the Qt Toolkit. 7 | ** 8 | ** $QT_BEGIN_LICENSE:BSD$ 9 | ** You may use this file under the terms of the BSD license as follows: 10 | ** 11 | ** "Redistribution and use in source and binary forms, with or without 12 | ** modification, are permitted provided that the following conditions are 13 | ** met: 14 | ** * Redistributions of source code must retain the above copyright 15 | ** notice, this list of conditions and the following disclaimer. 16 | ** * Redistributions in binary form must reproduce the above copyright 17 | ** notice, this list of conditions and the following disclaimer in 18 | ** the documentation and/or other materials provided with the 19 | ** distribution. 20 | ** * Neither the name of Digia Plc and its Subsidiary(-ies) nor the names 21 | ** of its contributors may be used to endorse or promote products derived 22 | ** from this software without specific prior written permission. 23 | ** 24 | ** 25 | ** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 26 | ** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 27 | ** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 28 | ** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 29 | ** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 30 | ** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 31 | ** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 32 | ** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 33 | ** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 34 | ** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 35 | ** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." 36 | ** 37 | ** $QT_END_LICENSE$ 38 | ** 39 | ****************************************************************************/ 40 | 41 | import QtQuick 2.0 42 | 43 | Rectangle { 44 | id: bt 45 | anchors.margins : 2 46 | width: 100 47 | height: 50 48 | color: ma.pressed?'#cccccc':'#dddddd' 49 | border.color: "black" 50 | border.width: 5 51 | radius: 10 52 | property alias text:lb.text 53 | signal clicked() 54 | Text { 55 | id: lb 56 | anchors.centerIn: parent 57 | horizontalAlignment: Text.AlignHCenter 58 | verticalAlignment: Text.AlignVCenter 59 | text: "Button" 60 | font.pointSize: 10 61 | } 62 | MouseArea { 63 | id: ma 64 | anchors.fill: parent 65 | onClicked: { 66 | bt.clicked(); 67 | } 68 | } 69 | } 70 | -------------------------------------------------------------------------------- /examples/declarative/contactsmodel/Button.qml: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | ** 3 | ** Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies). 4 | ** Contact: http://www.qt-project.org/legal 5 | ** 6 | ** This file is part of the examples of the Qt Toolkit. 7 | ** 8 | ** $QT_BEGIN_LICENSE:BSD$ 9 | ** You may use this file under the terms of the BSD license as follows: 10 | ** 11 | ** "Redistribution and use in source and binary forms, with or without 12 | ** modification, are permitted provided that the following conditions are 13 | ** met: 14 | ** * Redistributions of source code must retain the above copyright 15 | ** notice, this list of conditions and the following disclaimer. 16 | ** * Redistributions in binary form must reproduce the above copyright 17 | ** notice, this list of conditions and the following disclaimer in 18 | ** the documentation and/or other materials provided with the 19 | ** distribution. 20 | ** * Neither the name of Digia Plc and its Subsidiary(-ies) nor the names 21 | ** of its contributors may be used to endorse or promote products derived 22 | ** from this software without specific prior written permission. 23 | ** 24 | ** 25 | ** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 26 | ** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 27 | ** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 28 | ** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 29 | ** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 30 | ** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 31 | ** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 32 | ** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 33 | ** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 34 | ** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 35 | ** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." 36 | ** 37 | ** $QT_END_LICENSE$ 38 | ** 39 | ****************************************************************************/ 40 | 41 | import QtQuick 2.0 42 | 43 | Rectangle { 44 | id: bt 45 | anchors.margins : 2 46 | width: 100 47 | height: 50 48 | color: ma.pressed?'#cccccc':'#dddddd' 49 | border.color: "black" 50 | border.width: 5 51 | radius: 10 52 | property alias text:lb.text 53 | signal clicked() 54 | Text { 55 | id: lb 56 | anchors.centerIn: parent 57 | horizontalAlignment: Text.AlignHCenter 58 | verticalAlignment: Text.AlignVCenter 59 | text: "Button" 60 | font.pointSize: 10 61 | } 62 | MouseArea { 63 | id: ma 64 | anchors.fill: parent 65 | onClicked: { 66 | bt.clicked(); 67 | } 68 | } 69 | } 70 | -------------------------------------------------------------------------------- /examples/declarative/desktop-inspector/content/Header.qml: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | ** 3 | ** Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies). 4 | ** Contact: http://www.qt-project.org/legal 5 | ** 6 | ** This file is part of the examples of the Qt Toolkit. 7 | ** 8 | ** $QT_BEGIN_LICENSE:BSD$ 9 | ** You may use this file under the terms of the BSD license as follows: 10 | ** 11 | ** "Redistribution and use in source and binary forms, with or without 12 | ** modification, are permitted provided that the following conditions are 13 | ** met: 14 | ** * Redistributions of source code must retain the above copyright 15 | ** notice, this list of conditions and the following disclaimer. 16 | ** * Redistributions in binary form must reproduce the above copyright 17 | ** notice, this list of conditions and the following disclaimer in 18 | ** the documentation and/or other materials provided with the 19 | ** distribution. 20 | ** * Neither the name of Digia Plc and its Subsidiary(-ies) nor the names 21 | ** of its contributors may be used to endorse or promote products derived 22 | ** from this software without specific prior written permission. 23 | ** 24 | ** 25 | ** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 26 | ** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 27 | ** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 28 | ** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 29 | ** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 30 | ** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 31 | ** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 32 | ** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 33 | ** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 34 | ** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 35 | ** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." 36 | ** 37 | ** $QT_END_LICENSE$ 38 | ** 39 | ****************************************************************************/ 40 | 41 | // Generic item with no real data 42 | 43 | import QtQuick 2.0 44 | 45 | Rectangle { 46 | id: container 47 | width: parent.width 48 | height: myHeader.height 49 | border.color: "green" 50 | color: "#ccc" 51 | 52 | property string title : "Unknown" 53 | property int count: 0 54 | signal clicked(string title) 55 | 56 | Text { 57 | id: myHeader 58 | anchors { horizontalCenter: parent.horizontalCenter } 59 | text: title + " [" + count + "]"; 60 | font.pixelSize: 14 61 | } 62 | 63 | MouseArea { 64 | id: clickRegion 65 | anchors.fill: parent 66 | onClicked: { container.clicked(title); } 67 | } 68 | } 69 | -------------------------------------------------------------------------------- /examples/declarative/notifications/Button.qml: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | ** 3 | ** Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies). 4 | ** Contact: http://www.qt-project.org/legal 5 | ** 6 | ** This file is part of the examples of the Qt Toolkit. 7 | ** 8 | ** $QT_BEGIN_LICENSE:BSD$ 9 | ** You may use this file under the terms of the BSD license as follows: 10 | ** 11 | ** "Redistribution and use in source and binary forms, with or without 12 | ** modification, are permitted provided that the following conditions are 13 | ** met: 14 | ** * Redistributions of source code must retain the above copyright 15 | ** notice, this list of conditions and the following disclaimer. 16 | ** * Redistributions in binary form must reproduce the above copyright 17 | ** notice, this list of conditions and the following disclaimer in 18 | ** the documentation and/or other materials provided with the 19 | ** distribution. 20 | ** * Neither the name of Digia Plc and its Subsidiary(-ies) nor the names 21 | ** of its contributors may be used to endorse or promote products derived 22 | ** from this software without specific prior written permission. 23 | ** 24 | ** 25 | ** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 26 | ** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 27 | ** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 28 | ** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 29 | ** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 30 | ** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 31 | ** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 32 | ** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 33 | ** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 34 | ** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 35 | ** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." 36 | ** 37 | ** $QT_END_LICENSE$ 38 | ** 39 | ****************************************************************************/ 40 | 41 | import QtQuick 2.0 42 | 43 | Rectangle { 44 | id: bt 45 | anchors.margins : 2 46 | width: 100 47 | height: 40 48 | color: ma.pressed?'#cccccc':'#dddddd' 49 | border.color: "black" 50 | border.width: 5 51 | radius: 10 52 | property alias text:lb.text 53 | signal clicked() 54 | Text { 55 | id: lb 56 | anchors.centerIn: parent 57 | horizontalAlignment: Text.AlignHCenter 58 | verticalAlignment: Text.AlignVCenter 59 | text: "Button" 60 | font.pointSize: 10 61 | } 62 | MouseArea { 63 | id: ma 64 | anchors.fill: parent 65 | onClicked: { 66 | bt.clicked(); 67 | } 68 | } 69 | } 70 | -------------------------------------------------------------------------------- /examples/declarative/collationindex/content/Button.qml: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | ** 3 | ** Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies). 4 | ** Contact: http://www.qt-project.org/legal 5 | ** 6 | ** This file is part of the examples of the Qt Toolkit. 7 | ** 8 | ** $QT_BEGIN_LICENSE:BSD$ 9 | ** You may use this file under the terms of the BSD license as follows: 10 | ** 11 | ** "Redistribution and use in source and binary forms, with or without 12 | ** modification, are permitted provided that the following conditions are 13 | ** met: 14 | ** * Redistributions of source code must retain the above copyright 15 | ** notice, this list of conditions and the following disclaimer. 16 | ** * Redistributions in binary form must reproduce the above copyright 17 | ** notice, this list of conditions and the following disclaimer in 18 | ** the documentation and/or other materials provided with the 19 | ** distribution. 20 | ** * Neither the name of Digia Plc and its Subsidiary(-ies) nor the names 21 | ** of its contributors may be used to endorse or promote products derived 22 | ** from this software without specific prior written permission. 23 | ** 24 | ** 25 | ** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 26 | ** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 27 | ** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 28 | ** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 29 | ** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 30 | ** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 31 | ** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 32 | ** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 33 | ** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 34 | ** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 35 | ** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." 36 | ** 37 | ** $QT_END_LICENSE$ 38 | ** 39 | ****************************************************************************/ 40 | 41 | import QtQuick 2.0 42 | 43 | Rectangle { 44 | id: bt 45 | anchors.margins : 2 46 | width: 100 47 | height: 50 48 | color: ma.pressed?'#cccccc':'#dddddd' 49 | border.color: "black" 50 | border.width: 5 51 | radius: 10 52 | property alias text:lb.text 53 | signal clicked() 54 | Text { 55 | id: lb 56 | anchors.centerIn: parent 57 | horizontalAlignment: Text.AlignHCenter 58 | verticalAlignment: Text.AlignVCenter 59 | text: "Button" 60 | font.pointSize: 10 61 | } 62 | MouseArea { 63 | id: ma 64 | anchors.fill: parent 65 | onClicked: { 66 | bt.clicked(); 67 | } 68 | } 69 | } 70 | -------------------------------------------------------------------------------- /examples/declarative/simplelistmodel/content/Button.qml: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | ** 3 | ** Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies). 4 | ** Contact: http://www.qt-project.org/legal 5 | ** 6 | ** This file is part of the examples of the Qt Toolkit. 7 | ** 8 | ** $QT_BEGIN_LICENSE:BSD$ 9 | ** You may use this file under the terms of the BSD license as follows: 10 | ** 11 | ** "Redistribution and use in source and binary forms, with or without 12 | ** modification, are permitted provided that the following conditions are 13 | ** met: 14 | ** * Redistributions of source code must retain the above copyright 15 | ** notice, this list of conditions and the following disclaimer. 16 | ** * Redistributions in binary form must reproduce the above copyright 17 | ** notice, this list of conditions and the following disclaimer in 18 | ** the documentation and/or other materials provided with the 19 | ** distribution. 20 | ** * Neither the name of Digia Plc and its Subsidiary(-ies) nor the names 21 | ** of its contributors may be used to endorse or promote products derived 22 | ** from this software without specific prior written permission. 23 | ** 24 | ** 25 | ** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 26 | ** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 27 | ** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 28 | ** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 29 | ** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 30 | ** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 31 | ** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 32 | ** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 33 | ** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 34 | ** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 35 | ** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." 36 | ** 37 | ** $QT_END_LICENSE$ 38 | ** 39 | ****************************************************************************/ 40 | 41 | import QtQuick 2.0 42 | 43 | Rectangle { 44 | id: bt 45 | anchors.margins : 2 46 | width: 100 47 | height: 50 48 | color: ma.pressed?'#cccccc':'#dddddd' 49 | border.color: "black" 50 | border.width: 5 51 | radius: 10 52 | property alias text:lb.text 53 | signal clicked() 54 | Text { 55 | id: lb 56 | anchors.centerIn: parent 57 | horizontalAlignment: Text.AlignHCenter 58 | verticalAlignment: Text.AlignVCenter 59 | text: "Button" 60 | font.pointSize: 10 61 | } 62 | MouseArea { 63 | id: ma 64 | anchors.fill: parent 65 | onClicked: { 66 | bt.clicked(); 67 | } 68 | } 69 | } 70 | -------------------------------------------------------------------------------- /examples/declarative/streamingquery/content/Button.qml: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | ** 3 | ** Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies). 4 | ** Contact: http://www.qt-project.org/legal 5 | ** 6 | ** This file is part of the examples of the Qt Toolkit. 7 | ** 8 | ** $QT_BEGIN_LICENSE:BSD$ 9 | ** You may use this file under the terms of the BSD license as follows: 10 | ** 11 | ** "Redistribution and use in source and binary forms, with or without 12 | ** modification, are permitted provided that the following conditions are 13 | ** met: 14 | ** * Redistributions of source code must retain the above copyright 15 | ** notice, this list of conditions and the following disclaimer. 16 | ** * Redistributions in binary form must reproduce the above copyright 17 | ** notice, this list of conditions and the following disclaimer in 18 | ** the documentation and/or other materials provided with the 19 | ** distribution. 20 | ** * Neither the name of Digia Plc and its Subsidiary(-ies) nor the names 21 | ** of its contributors may be used to endorse or promote products derived 22 | ** from this software without specific prior written permission. 23 | ** 24 | ** 25 | ** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 26 | ** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 27 | ** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 28 | ** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 29 | ** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 30 | ** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 31 | ** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 32 | ** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 33 | ** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 34 | ** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 35 | ** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." 36 | ** 37 | ** $QT_END_LICENSE$ 38 | ** 39 | ****************************************************************************/ 40 | 41 | import QtQuick 2.0 42 | 43 | Rectangle { 44 | id: bt 45 | anchors.margins : 2 46 | width: 150 47 | height: 50 48 | color: ma.pressed?'#cccccc':'#dddddd' 49 | border.color: "black" 50 | border.width: 5 51 | radius: 10 52 | property alias text:lb.text 53 | signal clicked() 54 | Text { 55 | id: lb 56 | anchors.centerIn: parent 57 | horizontalAlignment: Text.AlignHCenter 58 | verticalAlignment: Text.AlignVCenter 59 | text: "Button" 60 | font.pointSize: 10 61 | } 62 | MouseArea { 63 | id: ma 64 | anchors.fill: parent 65 | onClicked: { 66 | bt.clicked(); 67 | } 68 | } 69 | } 70 | -------------------------------------------------------------------------------- /src/daemon/jsondbsignals.h: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | ** 3 | ** Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies). 4 | ** Contact: http://www.qt-project.org/legal 5 | ** 6 | ** This file is part of the QtAddOn.JsonDb module of the Qt Toolkit. 7 | ** 8 | ** $QT_BEGIN_LICENSE:LGPL$ 9 | ** Commercial License Usage 10 | ** Licensees holding valid commercial Qt licenses may use this file in 11 | ** accordance with the commercial license agreement provided with the 12 | ** Software or, alternatively, in accordance with the terms contained in 13 | ** a written agreement between you and Digia. For licensing terms and 14 | ** conditions see http://qt.digia.com/licensing. For further information 15 | ** use the contact form at http://qt.digia.com/contact-us. 16 | ** 17 | ** GNU Lesser General Public License Usage 18 | ** Alternatively, this file may be used under the terms of the GNU Lesser 19 | ** General Public License version 2.1 as published by the Free Software 20 | ** Foundation and appearing in the file LICENSE.LGPL included in the 21 | ** packaging of this file. Please review the following information to 22 | ** ensure the GNU Lesser General Public License version 2.1 requirements 23 | ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. 24 | ** 25 | ** In addition, as a special exception, Digia gives you certain additional 26 | ** rights. These rights are described in the Digia Qt LGPL Exception 27 | ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. 28 | ** 29 | ** GNU General Public License Usage 30 | ** Alternatively, this file may be used under the terms of the GNU 31 | ** General Public License version 3.0 as published by the Free Software 32 | ** Foundation and appearing in the file LICENSE.GPL included in the 33 | ** packaging of this file. Please review the following information to 34 | ** ensure the GNU General Public License version 3.0 requirements will be 35 | ** met: http://www.gnu.org/copyleft/gpl.html. 36 | ** 37 | ** 38 | ** $QT_END_LICENSE$ 39 | ** 40 | ****************************************************************************/ 41 | 42 | #ifndef JSONDB_SIGNALS_H 43 | #define JSONDB_SIGNALS_H 44 | 45 | #include 46 | 47 | QT_BEGIN_HEADER 48 | 49 | QT_BEGIN_NAMESPACE 50 | class QSocketNotifier; 51 | QT_END_NAMESPACE 52 | 53 | 54 | class JsonDbSignals : public QObject 55 | { 56 | Q_OBJECT 57 | public: 58 | JsonDbSignals( QObject *parent = 0); 59 | void start(); 60 | 61 | static void signalHandler(int unused); 62 | 63 | Q_SIGNALS: 64 | void sigTERM(); 65 | void sigHUP(); 66 | void sigINT(); 67 | void sigUSR1(); 68 | void sigUSR2(); 69 | 70 | private slots: 71 | void handleSig(); 72 | 73 | private: 74 | static int sSigFD[2]; 75 | QSocketNotifier *mNotifier; 76 | void listen(int sig); 77 | }; 78 | 79 | QT_END_HEADER 80 | 81 | #endif // JSONDB_SIGNALS_H 82 | --------------------------------------------------------------------------------