From 5f1cd97b9727fe10df79e1eb316ff493d9dfc2a9 Mon Sep 17 00:00:00 2001 From: Karen Arutyunov Date: Thu, 1 Feb 2024 20:50:43 +0300 Subject: Turn libodb-qt repository into package for muti-package repository --- .gitignore | 37 -- GPLv2 | 340 ----------- INSTALL | 107 ---- INSTALL-GIT | 78 --- LICENSE | 20 - Makefile.am | 12 - NEWS | 1 - README | 20 - README-GIT | 4 - bootstrap | 16 - build/.gitignore | 3 - build/bootstrap.build | 10 - build/bootstrap.make | 70 --- build/export.build | 9 - build/export/libodb-qt/stub.make | 8 - build/import/libodb-qt/configuration-rules.make | 13 - build/import/libodb-qt/configure | 53 -- build/import/libodb-qt/stub.make | 28 - build/import/libodb/configuration-rules.make | 13 - build/import/libodb/configure | 53 -- build/import/libodb/stub.make | 28 - build/import/libqt/configuration-rules.make | 13 - build/import/libqt/configure | 97 ---- build/import/libqt/core/rules.make | 26 - build/import/libqt/core/stub.make | 35 -- build/import/libqt/version | 1 - build/root.build | 17 - buildfile | 9 - configure.ac | 55 -- libodb-qt.pc.in | 14 - libodb-qt/.gitignore | 25 + libodb-qt/GPLv2 | 340 +++++++++++ libodb-qt/INSTALL | 6 + libodb-qt/LICENSE | 20 + libodb-qt/README | 20 + libodb-qt/build/.gitignore | 3 + libodb-qt/build/bootstrap.build | 10 + libodb-qt/build/export.build | 9 + libodb-qt/build/root.build | 17 + libodb-qt/buildfile | 9 + libodb-qt/manifest | 21 + libodb-qt/odb/qt.options | 7 + libodb-qt/odb/qt/basic.options | 4 + libodb-qt/odb/qt/basic/basic-common.options | 4 + libodb-qt/odb/qt/basic/basic-mssql.options | 13 + libodb-qt/odb/qt/basic/basic-mysql.options | 13 + libodb-qt/odb/qt/basic/basic-oracle.options | 13 + libodb-qt/odb/qt/basic/basic-pgsql.options | 13 + libodb-qt/odb/qt/basic/basic-sqlite.options | 13 + libodb-qt/odb/qt/basic/mssql/default-mapping.hxx | 29 + .../odb/qt/basic/mssql/qbyte-array-traits.hxx | 177 ++++++ libodb-qt/odb/qt/basic/mssql/qstring-traits.hxx | 372 ++++++++++++ libodb-qt/odb/qt/basic/mssql/quuid-traits.hxx | 58 ++ libodb-qt/odb/qt/basic/mysql/default-mapping.hxx | 28 + .../odb/qt/basic/mysql/qbyte-array-traits.hxx | 78 +++ libodb-qt/odb/qt/basic/mysql/qstring-traits.hxx | 93 +++ libodb-qt/odb/qt/basic/mysql/quuid-traits.hxx | 74 +++ libodb-qt/odb/qt/basic/oracle/default-mapping.hxx | 27 + .../odb/qt/basic/oracle/qbyte-array-traits.hxx | 167 ++++++ libodb-qt/odb/qt/basic/oracle/qstring-traits.hxx | 206 +++++++ libodb-qt/odb/qt/basic/oracle/quuid-traits.hxx | 70 +++ libodb-qt/odb/qt/basic/pgsql/default-mapping.hxx | 27 + .../odb/qt/basic/pgsql/qbyte-array-traits.hxx | 77 +++ libodb-qt/odb/qt/basic/pgsql/qstring-traits.hxx | 74 +++ libodb-qt/odb/qt/basic/pgsql/quuid-traits.hxx | 65 +++ libodb-qt/odb/qt/basic/sqlite/default-mapping.hxx | 27 + .../odb/qt/basic/sqlite/qbyte-array-traits.hxx | 77 +++ libodb-qt/odb/qt/basic/sqlite/qstring-traits.hxx | 83 +++ libodb-qt/odb/qt/basic/sqlite/quuid-traits.hxx | 74 +++ libodb-qt/odb/qt/buildfile | 93 +++ libodb-qt/odb/qt/containers.options | 18 + libodb-qt/odb/qt/containers/list-iterator.hxx | 30 + libodb-qt/odb/qt/containers/list-traits.hxx | 107 ++++ libodb-qt/odb/qt/containers/list-traits.txx | 101 ++++ libodb-qt/odb/qt/containers/list.hxx | 433 ++++++++++++++ libodb-qt/odb/qt/containers/list.ixx | 318 +++++++++++ .../odb/qt/containers/mutable-list-iterator.hxx | 110 ++++ libodb-qt/odb/qt/containers/qhash-traits.hxx | 129 +++++ .../odb/qt/containers/qlinked-list-traits.hxx | 82 +++ libodb-qt/odb/qt/containers/qlist-traits.hxx | 72 +++ libodb-qt/odb/qt/containers/qmap-traits.hxx | 130 +++++ libodb-qt/odb/qt/containers/qset-traits.hxx | 69 +++ libodb-qt/odb/qt/containers/qvector-traits.hxx | 82 +++ libodb-qt/odb/qt/date-time.options | 4 + .../odb/qt/date-time/date-time-common.options | 4 + libodb-qt/odb/qt/date-time/date-time-mssql.options | 13 + libodb-qt/odb/qt/date-time/date-time-mysql.options | 13 + .../odb/qt/date-time/date-time-oracle.options | 13 + libodb-qt/odb/qt/date-time/date-time-pgsql.options | 13 + .../odb/qt/date-time/date-time-sqlite.options | 13 + libodb-qt/odb/qt/date-time/exceptions.cxx | 25 + libodb-qt/odb/qt/date-time/exceptions.hxx | 34 ++ .../odb/qt/date-time/mssql/default-mapping.hxx | 31 + .../odb/qt/date-time/mssql/qdate-time-traits.hxx | 104 ++++ libodb-qt/odb/qt/date-time/mssql/qdate-traits.hxx | 63 +++ libodb-qt/odb/qt/date-time/mssql/qtime-traits.hxx | 80 +++ .../odb/qt/date-time/mysql/default-mapping.hxx | 26 + .../odb/qt/date-time/mysql/qdate-time-traits.hxx | 135 +++++ libodb-qt/odb/qt/date-time/mysql/qdate-traits.hxx | 73 +++ libodb-qt/odb/qt/date-time/mysql/qtime-traits.hxx | 74 +++ .../odb/qt/date-time/oracle/default-mapping.hxx | 29 + .../odb/qt/date-time/oracle/qdate-time-traits.hxx | 136 +++++ libodb-qt/odb/qt/date-time/oracle/qdate-traits.hxx | 76 +++ libodb-qt/odb/qt/date-time/oracle/qtime-traits.hxx | 66 +++ .../odb/qt/date-time/pgsql/default-mapping.hxx | 26 + .../odb/qt/date-time/pgsql/qdate-time-traits.hxx | 70 +++ libodb-qt/odb/qt/date-time/pgsql/qdate-traits.hxx | 70 +++ libodb-qt/odb/qt/date-time/pgsql/qtime-traits.hxx | 73 +++ .../odb/qt/date-time/sqlite/default-mapping.hxx | 26 + .../odb/qt/date-time/sqlite/qdate-time-traits.hxx | 138 +++++ libodb-qt/odb/qt/date-time/sqlite/qdate-traits.hxx | 141 +++++ libodb-qt/odb/qt/date-time/sqlite/qtime-traits.hxx | 120 ++++ libodb-qt/odb/qt/details/build2/config-stub.h | 5 + libodb-qt/odb/qt/details/build2/config-vc-stub.h | 5 + libodb-qt/odb/qt/details/build2/config-vc.h | 15 + libodb-qt/odb/qt/details/build2/config.h | 17 + libodb-qt/odb/qt/details/config-vc.h | 5 + libodb-qt/odb/qt/details/config.h.in | 12 + libodb-qt/odb/qt/details/config.hxx | 38 ++ libodb-qt/odb/qt/details/export.hxx | 78 +++ libodb-qt/odb/qt/exception.hxx | 28 + libodb-qt/odb/qt/lazy-ptr.hxx | 9 + libodb-qt/odb/qt/list-iterator.hxx | 9 + libodb-qt/odb/qt/list.hxx | 9 + libodb-qt/odb/qt/mutable-list-iterator.hxx | 9 + libodb-qt/odb/qt/smart-ptr.options | 19 + libodb-qt/odb/qt/smart-ptr/lazy-pointer-traits.hxx | 61 ++ libodb-qt/odb/qt/smart-ptr/lazy-ptr.hxx | 442 +++++++++++++++ libodb-qt/odb/qt/smart-ptr/lazy-ptr.ixx | 626 +++++++++++++++++++++ libodb-qt/odb/qt/smart-ptr/lazy-ptr.txx | 74 +++ libodb-qt/odb/qt/smart-ptr/pointer-traits.hxx | 110 ++++ libodb-qt/odb/qt/smart-ptr/wrapper-traits.hxx | 64 +++ libodb-qt/odb/qt/version-build2-stub.hxx | 4 + libodb-qt/odb/qt/version-build2.hxx | 0 libodb-qt/odb/qt/version-build2.hxx.in | 46 ++ libodb-qt/odb/qt/version.hxx | 55 ++ libodb-qt/odb/qt/version.options | 16 + libodb-qt/tests/.gitignore | 1 + libodb-qt/tests/basics/buildfile | 6 + libodb-qt/tests/basics/driver.cxx | 22 + libodb-qt/tests/build/.gitignore | 3 + libodb-qt/tests/build/bootstrap.build | 8 + libodb-qt/tests/build/root.build | 23 + libodb-qt/tests/buildfile | 4 + libodb-qt4-vc10.sln | 26 - libodb-qt4-vc11.sln | 26 - libodb-qt4-vc12.sln | 28 - libodb-qt4-vc8.sln | 26 - libodb-qt4-vc9.sln | 26 - libodb-qt5-vc10.sln | 26 - libodb-qt5-vc11.sln | 26 - libodb-qt5-vc12.sln | 28 - libodb-qt5-vc9.sln | 26 - m4/acx-pthread.m4 | 259 --------- m4/disable-rpath.m4 | 24 - m4/libodb.m4 | 81 --- m4/libqt.m4 | 121 ---- m4/libtool-link.m4 | 45 -- m4/pkgconfig.m4 | 11 - m4/static-lib.m4 | 17 - m4/threads.m4 | 68 --- makefile | 44 -- manifest | 21 - odb/qt.options | 7 - odb/qt/Makefile.am | 14 - odb/qt/basic.options | 4 - odb/qt/basic/basic-common.options | 4 - odb/qt/basic/basic-mssql.options | 13 - odb/qt/basic/basic-mysql.options | 13 - odb/qt/basic/basic-oracle.options | 13 - odb/qt/basic/basic-pgsql.options | 13 - odb/qt/basic/basic-sqlite.options | 13 - odb/qt/basic/mssql/default-mapping.hxx | 29 - odb/qt/basic/mssql/qbyte-array-traits.hxx | 177 ------ odb/qt/basic/mssql/qstring-traits.hxx | 372 ------------ odb/qt/basic/mssql/quuid-traits.hxx | 58 -- odb/qt/basic/mysql/default-mapping.hxx | 28 - odb/qt/basic/mysql/qbyte-array-traits.hxx | 78 --- odb/qt/basic/mysql/qstring-traits.hxx | 93 --- odb/qt/basic/mysql/quuid-traits.hxx | 74 --- odb/qt/basic/oracle/default-mapping.hxx | 27 - odb/qt/basic/oracle/qbyte-array-traits.hxx | 167 ------ odb/qt/basic/oracle/qstring-traits.hxx | 206 ------- odb/qt/basic/oracle/quuid-traits.hxx | 70 --- odb/qt/basic/pgsql/default-mapping.hxx | 27 - odb/qt/basic/pgsql/qbyte-array-traits.hxx | 77 --- odb/qt/basic/pgsql/qstring-traits.hxx | 74 --- odb/qt/basic/pgsql/quuid-traits.hxx | 65 --- odb/qt/basic/sqlite/default-mapping.hxx | 27 - odb/qt/basic/sqlite/qbyte-array-traits.hxx | 77 --- odb/qt/basic/sqlite/qstring-traits.hxx | 83 --- odb/qt/basic/sqlite/quuid-traits.hxx | 74 --- odb/qt/buildfile | 93 --- odb/qt/containers.options | 18 - odb/qt/containers/list-iterator.hxx | 30 - odb/qt/containers/list-traits.hxx | 107 ---- odb/qt/containers/list-traits.txx | 101 ---- odb/qt/containers/list.hxx | 433 -------------- odb/qt/containers/list.ixx | 318 ----------- odb/qt/containers/mutable-list-iterator.hxx | 110 ---- odb/qt/containers/qhash-traits.hxx | 129 ----- odb/qt/containers/qlinked-list-traits.hxx | 82 --- odb/qt/containers/qlist-traits.hxx | 72 --- odb/qt/containers/qmap-traits.hxx | 130 ----- odb/qt/containers/qset-traits.hxx | 69 --- odb/qt/containers/qvector-traits.hxx | 82 --- odb/qt/date-time.options | 4 - odb/qt/date-time/date-time-common.options | 4 - odb/qt/date-time/date-time-mssql.options | 13 - odb/qt/date-time/date-time-mysql.options | 13 - odb/qt/date-time/date-time-oracle.options | 13 - odb/qt/date-time/date-time-pgsql.options | 13 - odb/qt/date-time/date-time-sqlite.options | 13 - odb/qt/date-time/exceptions.cxx | 25 - odb/qt/date-time/exceptions.hxx | 34 -- odb/qt/date-time/mssql/default-mapping.hxx | 31 - odb/qt/date-time/mssql/qdate-time-traits.hxx | 104 ---- odb/qt/date-time/mssql/qdate-traits.hxx | 63 --- odb/qt/date-time/mssql/qtime-traits.hxx | 80 --- odb/qt/date-time/mysql/default-mapping.hxx | 26 - odb/qt/date-time/mysql/qdate-time-traits.hxx | 135 ----- odb/qt/date-time/mysql/qdate-traits.hxx | 73 --- odb/qt/date-time/mysql/qtime-traits.hxx | 74 --- odb/qt/date-time/oracle/default-mapping.hxx | 29 - odb/qt/date-time/oracle/qdate-time-traits.hxx | 136 ----- odb/qt/date-time/oracle/qdate-traits.hxx | 76 --- odb/qt/date-time/oracle/qtime-traits.hxx | 66 --- odb/qt/date-time/pgsql/default-mapping.hxx | 26 - odb/qt/date-time/pgsql/qdate-time-traits.hxx | 70 --- odb/qt/date-time/pgsql/qdate-traits.hxx | 70 --- odb/qt/date-time/pgsql/qtime-traits.hxx | 73 --- odb/qt/date-time/sqlite/default-mapping.hxx | 26 - odb/qt/date-time/sqlite/qdate-time-traits.hxx | 138 ----- odb/qt/date-time/sqlite/qdate-traits.hxx | 141 ----- odb/qt/date-time/sqlite/qtime-traits.hxx | 120 ---- odb/qt/details/build2/config-stub.h | 5 - odb/qt/details/build2/config-vc-stub.h | 5 - odb/qt/details/build2/config-vc.h | 15 - odb/qt/details/build2/config.h | 17 - odb/qt/details/config-vc.h | 5 - odb/qt/details/config.h.in | 12 - odb/qt/details/config.hxx | 38 -- odb/qt/details/export.hxx | 78 --- odb/qt/exception.hxx | 28 - odb/qt/lazy-ptr.hxx | 9 - odb/qt/libodb-qt4-vc10.vcxproj | 174 ------ odb/qt/libodb-qt4-vc10.vcxproj.filters | 19 - odb/qt/libodb-qt4-vc11.vcxproj | 178 ------ odb/qt/libodb-qt4-vc11.vcxproj.filters | 19 - odb/qt/libodb-qt4-vc12.vcxproj | 182 ------ odb/qt/libodb-qt4-vc12.vcxproj.filters | 19 - odb/qt/libodb-qt4-vc8.vcproj | 352 ------------ odb/qt/libodb-qt4-vc9.vcproj | 359 ------------ odb/qt/libodb-qt5-vc10.vcxproj | 174 ------ odb/qt/libodb-qt5-vc10.vcxproj.filters | 19 - odb/qt/libodb-qt5-vc11.vcxproj | 178 ------ odb/qt/libodb-qt5-vc11.vcxproj.filters | 19 - odb/qt/libodb-qt5-vc12.vcxproj | 182 ------ odb/qt/libodb-qt5-vc12.vcxproj.filters | 19 - odb/qt/libodb-qt5-vc9.vcproj | 359 ------------ odb/qt/list-iterator.hxx | 9 - odb/qt/list.hxx | 9 - odb/qt/makefile | 120 ---- odb/qt/mutable-list-iterator.hxx | 9 - odb/qt/smart-ptr.options | 19 - odb/qt/smart-ptr/lazy-pointer-traits.hxx | 61 -- odb/qt/smart-ptr/lazy-ptr.hxx | 442 --------------- odb/qt/smart-ptr/lazy-ptr.ixx | 626 --------------------- odb/qt/smart-ptr/lazy-ptr.txx | 74 --- odb/qt/smart-ptr/pointer-traits.hxx | 110 ---- odb/qt/smart-ptr/wrapper-traits.hxx | 64 --- odb/qt/version-build2-stub.hxx | 4 - odb/qt/version-build2.hxx | 0 odb/qt/version-build2.hxx.in | 46 -- odb/qt/version.hxx | 55 -- odb/qt/version.options | 16 - repositories.manifest | 6 - tests/.gitignore | 1 - tests/basics/buildfile | 6 - tests/basics/driver.cxx | 22 - tests/build/.gitignore | 3 - tests/build/bootstrap.build | 8 - tests/build/root.build | 23 - tests/buildfile | 4 - version | 1 - 285 files changed, 7729 insertions(+), 11761 deletions(-) delete mode 100644 .gitignore delete mode 100644 GPLv2 delete mode 100644 INSTALL delete mode 100644 INSTALL-GIT delete mode 100644 LICENSE delete mode 100644 Makefile.am delete mode 100644 NEWS delete mode 100644 README delete mode 100644 README-GIT delete mode 100755 bootstrap delete mode 100644 build/.gitignore delete mode 100644 build/bootstrap.build delete mode 100644 build/bootstrap.make delete mode 100644 build/export.build delete mode 100644 build/export/libodb-qt/stub.make delete mode 100644 build/import/libodb-qt/configuration-rules.make delete mode 100755 build/import/libodb-qt/configure delete mode 100644 build/import/libodb-qt/stub.make delete mode 100644 build/import/libodb/configuration-rules.make delete mode 100755 build/import/libodb/configure delete mode 100644 build/import/libodb/stub.make delete mode 100644 build/import/libqt/configuration-rules.make delete mode 100755 build/import/libqt/configure delete mode 100644 build/import/libqt/core/rules.make delete mode 100644 build/import/libqt/core/stub.make delete mode 100644 build/import/libqt/version delete mode 100644 build/root.build delete mode 100644 buildfile delete mode 100644 configure.ac delete mode 100644 libodb-qt.pc.in create mode 100644 libodb-qt/.gitignore create mode 100644 libodb-qt/GPLv2 create mode 100644 libodb-qt/INSTALL create mode 100644 libodb-qt/LICENSE create mode 100644 libodb-qt/README create mode 100644 libodb-qt/build/.gitignore create mode 100644 libodb-qt/build/bootstrap.build create mode 100644 libodb-qt/build/export.build create mode 100644 libodb-qt/build/root.build create mode 100644 libodb-qt/buildfile create mode 100644 libodb-qt/manifest create mode 100644 libodb-qt/odb/qt.options create mode 100644 libodb-qt/odb/qt/basic.options create mode 100644 libodb-qt/odb/qt/basic/basic-common.options create mode 100644 libodb-qt/odb/qt/basic/basic-mssql.options create mode 100644 libodb-qt/odb/qt/basic/basic-mysql.options create mode 100644 libodb-qt/odb/qt/basic/basic-oracle.options create mode 100644 libodb-qt/odb/qt/basic/basic-pgsql.options create mode 100644 libodb-qt/odb/qt/basic/basic-sqlite.options create mode 100644 libodb-qt/odb/qt/basic/mssql/default-mapping.hxx create mode 100644 libodb-qt/odb/qt/basic/mssql/qbyte-array-traits.hxx create mode 100644 libodb-qt/odb/qt/basic/mssql/qstring-traits.hxx create mode 100644 libodb-qt/odb/qt/basic/mssql/quuid-traits.hxx create mode 100644 libodb-qt/odb/qt/basic/mysql/default-mapping.hxx create mode 100644 libodb-qt/odb/qt/basic/mysql/qbyte-array-traits.hxx create mode 100644 libodb-qt/odb/qt/basic/mysql/qstring-traits.hxx create mode 100644 libodb-qt/odb/qt/basic/mysql/quuid-traits.hxx create mode 100644 libodb-qt/odb/qt/basic/oracle/default-mapping.hxx create mode 100644 libodb-qt/odb/qt/basic/oracle/qbyte-array-traits.hxx create mode 100644 libodb-qt/odb/qt/basic/oracle/qstring-traits.hxx create mode 100644 libodb-qt/odb/qt/basic/oracle/quuid-traits.hxx create mode 100644 libodb-qt/odb/qt/basic/pgsql/default-mapping.hxx create mode 100644 libodb-qt/odb/qt/basic/pgsql/qbyte-array-traits.hxx create mode 100644 libodb-qt/odb/qt/basic/pgsql/qstring-traits.hxx create mode 100644 libodb-qt/odb/qt/basic/pgsql/quuid-traits.hxx create mode 100644 libodb-qt/odb/qt/basic/sqlite/default-mapping.hxx create mode 100644 libodb-qt/odb/qt/basic/sqlite/qbyte-array-traits.hxx create mode 100644 libodb-qt/odb/qt/basic/sqlite/qstring-traits.hxx create mode 100644 libodb-qt/odb/qt/basic/sqlite/quuid-traits.hxx create mode 100644 libodb-qt/odb/qt/buildfile create mode 100644 libodb-qt/odb/qt/containers.options create mode 100644 libodb-qt/odb/qt/containers/list-iterator.hxx create mode 100644 libodb-qt/odb/qt/containers/list-traits.hxx create mode 100644 libodb-qt/odb/qt/containers/list-traits.txx create mode 100644 libodb-qt/odb/qt/containers/list.hxx create mode 100644 libodb-qt/odb/qt/containers/list.ixx create mode 100644 libodb-qt/odb/qt/containers/mutable-list-iterator.hxx create mode 100644 libodb-qt/odb/qt/containers/qhash-traits.hxx create mode 100644 libodb-qt/odb/qt/containers/qlinked-list-traits.hxx create mode 100644 libodb-qt/odb/qt/containers/qlist-traits.hxx create mode 100644 libodb-qt/odb/qt/containers/qmap-traits.hxx create mode 100644 libodb-qt/odb/qt/containers/qset-traits.hxx create mode 100644 libodb-qt/odb/qt/containers/qvector-traits.hxx create mode 100644 libodb-qt/odb/qt/date-time.options create mode 100644 libodb-qt/odb/qt/date-time/date-time-common.options create mode 100644 libodb-qt/odb/qt/date-time/date-time-mssql.options create mode 100644 libodb-qt/odb/qt/date-time/date-time-mysql.options create mode 100644 libodb-qt/odb/qt/date-time/date-time-oracle.options create mode 100644 libodb-qt/odb/qt/date-time/date-time-pgsql.options create mode 100644 libodb-qt/odb/qt/date-time/date-time-sqlite.options create mode 100644 libodb-qt/odb/qt/date-time/exceptions.cxx create mode 100644 libodb-qt/odb/qt/date-time/exceptions.hxx create mode 100644 libodb-qt/odb/qt/date-time/mssql/default-mapping.hxx create mode 100644 libodb-qt/odb/qt/date-time/mssql/qdate-time-traits.hxx create mode 100644 libodb-qt/odb/qt/date-time/mssql/qdate-traits.hxx create mode 100644 libodb-qt/odb/qt/date-time/mssql/qtime-traits.hxx create mode 100644 libodb-qt/odb/qt/date-time/mysql/default-mapping.hxx create mode 100644 libodb-qt/odb/qt/date-time/mysql/qdate-time-traits.hxx create mode 100644 libodb-qt/odb/qt/date-time/mysql/qdate-traits.hxx create mode 100644 libodb-qt/odb/qt/date-time/mysql/qtime-traits.hxx create mode 100644 libodb-qt/odb/qt/date-time/oracle/default-mapping.hxx create mode 100644 libodb-qt/odb/qt/date-time/oracle/qdate-time-traits.hxx create mode 100644 libodb-qt/odb/qt/date-time/oracle/qdate-traits.hxx create mode 100644 libodb-qt/odb/qt/date-time/oracle/qtime-traits.hxx create mode 100644 libodb-qt/odb/qt/date-time/pgsql/default-mapping.hxx create mode 100644 libodb-qt/odb/qt/date-time/pgsql/qdate-time-traits.hxx create mode 100644 libodb-qt/odb/qt/date-time/pgsql/qdate-traits.hxx create mode 100644 libodb-qt/odb/qt/date-time/pgsql/qtime-traits.hxx create mode 100644 libodb-qt/odb/qt/date-time/sqlite/default-mapping.hxx create mode 100644 libodb-qt/odb/qt/date-time/sqlite/qdate-time-traits.hxx create mode 100644 libodb-qt/odb/qt/date-time/sqlite/qdate-traits.hxx create mode 100644 libodb-qt/odb/qt/date-time/sqlite/qtime-traits.hxx create mode 100644 libodb-qt/odb/qt/details/build2/config-stub.h create mode 100644 libodb-qt/odb/qt/details/build2/config-vc-stub.h create mode 100644 libodb-qt/odb/qt/details/build2/config-vc.h create mode 100644 libodb-qt/odb/qt/details/build2/config.h create mode 100644 libodb-qt/odb/qt/details/config-vc.h create mode 100644 libodb-qt/odb/qt/details/config.h.in create mode 100644 libodb-qt/odb/qt/details/config.hxx create mode 100644 libodb-qt/odb/qt/details/export.hxx create mode 100644 libodb-qt/odb/qt/exception.hxx create mode 100644 libodb-qt/odb/qt/lazy-ptr.hxx create mode 100644 libodb-qt/odb/qt/list-iterator.hxx create mode 100644 libodb-qt/odb/qt/list.hxx create mode 100644 libodb-qt/odb/qt/mutable-list-iterator.hxx create mode 100644 libodb-qt/odb/qt/smart-ptr.options create mode 100644 libodb-qt/odb/qt/smart-ptr/lazy-pointer-traits.hxx create mode 100644 libodb-qt/odb/qt/smart-ptr/lazy-ptr.hxx create mode 100644 libodb-qt/odb/qt/smart-ptr/lazy-ptr.ixx create mode 100644 libodb-qt/odb/qt/smart-ptr/lazy-ptr.txx create mode 100644 libodb-qt/odb/qt/smart-ptr/pointer-traits.hxx create mode 100644 libodb-qt/odb/qt/smart-ptr/wrapper-traits.hxx create mode 100644 libodb-qt/odb/qt/version-build2-stub.hxx create mode 100644 libodb-qt/odb/qt/version-build2.hxx create mode 100644 libodb-qt/odb/qt/version-build2.hxx.in create mode 100644 libodb-qt/odb/qt/version.hxx create mode 100644 libodb-qt/odb/qt/version.options create mode 100644 libodb-qt/tests/.gitignore create mode 100644 libodb-qt/tests/basics/buildfile create mode 100644 libodb-qt/tests/basics/driver.cxx create mode 100644 libodb-qt/tests/build/.gitignore create mode 100644 libodb-qt/tests/build/bootstrap.build create mode 100644 libodb-qt/tests/build/root.build create mode 100644 libodb-qt/tests/buildfile delete mode 100644 libodb-qt4-vc10.sln delete mode 100644 libodb-qt4-vc11.sln delete mode 100644 libodb-qt4-vc12.sln delete mode 100644 libodb-qt4-vc8.sln delete mode 100644 libodb-qt4-vc9.sln delete mode 100644 libodb-qt5-vc10.sln delete mode 100644 libodb-qt5-vc11.sln delete mode 100644 libodb-qt5-vc12.sln delete mode 100644 libodb-qt5-vc9.sln delete mode 100644 m4/acx-pthread.m4 delete mode 100644 m4/disable-rpath.m4 delete mode 100644 m4/libodb.m4 delete mode 100644 m4/libqt.m4 delete mode 100644 m4/libtool-link.m4 delete mode 100644 m4/pkgconfig.m4 delete mode 100644 m4/static-lib.m4 delete mode 100644 m4/threads.m4 delete mode 100644 makefile delete mode 100644 manifest delete mode 100644 odb/qt.options delete mode 100644 odb/qt/Makefile.am delete mode 100644 odb/qt/basic.options delete mode 100644 odb/qt/basic/basic-common.options delete mode 100644 odb/qt/basic/basic-mssql.options delete mode 100644 odb/qt/basic/basic-mysql.options delete mode 100644 odb/qt/basic/basic-oracle.options delete mode 100644 odb/qt/basic/basic-pgsql.options delete mode 100644 odb/qt/basic/basic-sqlite.options delete mode 100644 odb/qt/basic/mssql/default-mapping.hxx delete mode 100644 odb/qt/basic/mssql/qbyte-array-traits.hxx delete mode 100644 odb/qt/basic/mssql/qstring-traits.hxx delete mode 100644 odb/qt/basic/mssql/quuid-traits.hxx delete mode 100644 odb/qt/basic/mysql/default-mapping.hxx delete mode 100644 odb/qt/basic/mysql/qbyte-array-traits.hxx delete mode 100644 odb/qt/basic/mysql/qstring-traits.hxx delete mode 100644 odb/qt/basic/mysql/quuid-traits.hxx delete mode 100644 odb/qt/basic/oracle/default-mapping.hxx delete mode 100644 odb/qt/basic/oracle/qbyte-array-traits.hxx delete mode 100644 odb/qt/basic/oracle/qstring-traits.hxx delete mode 100644 odb/qt/basic/oracle/quuid-traits.hxx delete mode 100644 odb/qt/basic/pgsql/default-mapping.hxx delete mode 100644 odb/qt/basic/pgsql/qbyte-array-traits.hxx delete mode 100644 odb/qt/basic/pgsql/qstring-traits.hxx delete mode 100644 odb/qt/basic/pgsql/quuid-traits.hxx delete mode 100644 odb/qt/basic/sqlite/default-mapping.hxx delete mode 100644 odb/qt/basic/sqlite/qbyte-array-traits.hxx delete mode 100644 odb/qt/basic/sqlite/qstring-traits.hxx delete mode 100644 odb/qt/basic/sqlite/quuid-traits.hxx delete mode 100644 odb/qt/buildfile delete mode 100644 odb/qt/containers.options delete mode 100644 odb/qt/containers/list-iterator.hxx delete mode 100644 odb/qt/containers/list-traits.hxx delete mode 100644 odb/qt/containers/list-traits.txx delete mode 100644 odb/qt/containers/list.hxx delete mode 100644 odb/qt/containers/list.ixx delete mode 100644 odb/qt/containers/mutable-list-iterator.hxx delete mode 100644 odb/qt/containers/qhash-traits.hxx delete mode 100644 odb/qt/containers/qlinked-list-traits.hxx delete mode 100644 odb/qt/containers/qlist-traits.hxx delete mode 100644 odb/qt/containers/qmap-traits.hxx delete mode 100644 odb/qt/containers/qset-traits.hxx delete mode 100644 odb/qt/containers/qvector-traits.hxx delete mode 100644 odb/qt/date-time.options delete mode 100644 odb/qt/date-time/date-time-common.options delete mode 100644 odb/qt/date-time/date-time-mssql.options delete mode 100644 odb/qt/date-time/date-time-mysql.options delete mode 100644 odb/qt/date-time/date-time-oracle.options delete mode 100644 odb/qt/date-time/date-time-pgsql.options delete mode 100644 odb/qt/date-time/date-time-sqlite.options delete mode 100644 odb/qt/date-time/exceptions.cxx delete mode 100644 odb/qt/date-time/exceptions.hxx delete mode 100644 odb/qt/date-time/mssql/default-mapping.hxx delete mode 100644 odb/qt/date-time/mssql/qdate-time-traits.hxx delete mode 100644 odb/qt/date-time/mssql/qdate-traits.hxx delete mode 100644 odb/qt/date-time/mssql/qtime-traits.hxx delete mode 100644 odb/qt/date-time/mysql/default-mapping.hxx delete mode 100644 odb/qt/date-time/mysql/qdate-time-traits.hxx delete mode 100644 odb/qt/date-time/mysql/qdate-traits.hxx delete mode 100644 odb/qt/date-time/mysql/qtime-traits.hxx delete mode 100644 odb/qt/date-time/oracle/default-mapping.hxx delete mode 100644 odb/qt/date-time/oracle/qdate-time-traits.hxx delete mode 100644 odb/qt/date-time/oracle/qdate-traits.hxx delete mode 100644 odb/qt/date-time/oracle/qtime-traits.hxx delete mode 100644 odb/qt/date-time/pgsql/default-mapping.hxx delete mode 100644 odb/qt/date-time/pgsql/qdate-time-traits.hxx delete mode 100644 odb/qt/date-time/pgsql/qdate-traits.hxx delete mode 100644 odb/qt/date-time/pgsql/qtime-traits.hxx delete mode 100644 odb/qt/date-time/sqlite/default-mapping.hxx delete mode 100644 odb/qt/date-time/sqlite/qdate-time-traits.hxx delete mode 100644 odb/qt/date-time/sqlite/qdate-traits.hxx delete mode 100644 odb/qt/date-time/sqlite/qtime-traits.hxx delete mode 100644 odb/qt/details/build2/config-stub.h delete mode 100644 odb/qt/details/build2/config-vc-stub.h delete mode 100644 odb/qt/details/build2/config-vc.h delete mode 100644 odb/qt/details/build2/config.h delete mode 100644 odb/qt/details/config-vc.h delete mode 100644 odb/qt/details/config.h.in delete mode 100644 odb/qt/details/config.hxx delete mode 100644 odb/qt/details/export.hxx delete mode 100644 odb/qt/exception.hxx delete mode 100644 odb/qt/lazy-ptr.hxx delete mode 100644 odb/qt/libodb-qt4-vc10.vcxproj delete mode 100644 odb/qt/libodb-qt4-vc10.vcxproj.filters delete mode 100644 odb/qt/libodb-qt4-vc11.vcxproj delete mode 100644 odb/qt/libodb-qt4-vc11.vcxproj.filters delete mode 100644 odb/qt/libodb-qt4-vc12.vcxproj delete mode 100644 odb/qt/libodb-qt4-vc12.vcxproj.filters delete mode 100644 odb/qt/libodb-qt4-vc8.vcproj delete mode 100644 odb/qt/libodb-qt4-vc9.vcproj delete mode 100644 odb/qt/libodb-qt5-vc10.vcxproj delete mode 100644 odb/qt/libodb-qt5-vc10.vcxproj.filters delete mode 100644 odb/qt/libodb-qt5-vc11.vcxproj delete mode 100644 odb/qt/libodb-qt5-vc11.vcxproj.filters delete mode 100644 odb/qt/libodb-qt5-vc12.vcxproj delete mode 100644 odb/qt/libodb-qt5-vc12.vcxproj.filters delete mode 100644 odb/qt/libodb-qt5-vc9.vcproj delete mode 100644 odb/qt/list-iterator.hxx delete mode 100644 odb/qt/list.hxx delete mode 100644 odb/qt/makefile delete mode 100644 odb/qt/mutable-list-iterator.hxx delete mode 100644 odb/qt/smart-ptr.options delete mode 100644 odb/qt/smart-ptr/lazy-pointer-traits.hxx delete mode 100644 odb/qt/smart-ptr/lazy-ptr.hxx delete mode 100644 odb/qt/smart-ptr/lazy-ptr.ixx delete mode 100644 odb/qt/smart-ptr/lazy-ptr.txx delete mode 100644 odb/qt/smart-ptr/pointer-traits.hxx delete mode 100644 odb/qt/smart-ptr/wrapper-traits.hxx delete mode 100644 odb/qt/version-build2-stub.hxx delete mode 100644 odb/qt/version-build2.hxx delete mode 100644 odb/qt/version-build2.hxx.in delete mode 100644 odb/qt/version.hxx delete mode 100644 odb/qt/version.options delete mode 100644 repositories.manifest delete mode 100644 tests/.gitignore delete mode 100644 tests/basics/buildfile delete mode 100644 tests/basics/driver.cxx delete mode 100644 tests/build/.gitignore delete mode 100644 tests/build/bootstrap.build delete mode 100644 tests/build/root.build delete mode 100644 tests/buildfile delete mode 100644 version diff --git a/.gitignore b/.gitignore deleted file mode 100644 index 3004ad1..0000000 --- a/.gitignore +++ /dev/null @@ -1,37 +0,0 @@ -.bdep/ - -# Compiler/linker output. -# -*.d -*.t -*.i -*.ii -*.o -*.obj -*.so -*.dll -*.a -*.lib -*.exp -*.pdb -*.ilk -*.exe -*.exe.dlls/ -*.exe.manifest -*.pc - -*.l -*.l.cpp-options - -# Generated documentation. -# -*.pdf -*.ps - -# Generated build system files. -# -*-dynamic.make - -# Generated .gitignore files. -# -.gitignore diff --git a/GPLv2 b/GPLv2 deleted file mode 100644 index 3912109..0000000 --- a/GPLv2 +++ /dev/null @@ -1,340 +0,0 @@ - GNU GENERAL PUBLIC LICENSE - Version 2, June 1991 - - Copyright (C) 1989, 1991 Free Software Foundation, Inc. - 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - Everyone is permitted to copy and distribute verbatim copies - of this license document, but changing it is not allowed. - - Preamble - - The licenses for most software are designed to take away your -freedom to share and change it. By contrast, the GNU General Public -License is intended to guarantee your freedom to share and change free -software--to make sure the software is free for all its users. This -General Public License applies to most of the Free Software -Foundation's software and to any other program whose authors commit to -using it. (Some other Free Software Foundation software is covered by -the GNU Library General Public License instead.) You can apply it to -your programs, too. - - When we speak of free software, we are referring to freedom, not -price. Our General Public Licenses are designed to make sure that you -have the freedom to distribute copies of free software (and charge for -this service if you wish), that you receive source code or can get it -if you want it, that you can change the software or use pieces of it -in new free programs; and that you know you can do these things. - - To protect your rights, we need to make restrictions that forbid -anyone to deny you these rights or to ask you to surrender the rights. -These restrictions translate to certain responsibilities for you if you -distribute copies of the software, or if you modify it. - - For example, if you distribute copies of such a program, whether -gratis or for a fee, you must give the recipients all the rights that -you have. You must make sure that they, too, receive or can get the -source code. And you must show them these terms so they know their -rights. - - We protect your rights with two steps: (1) copyright the software, and -(2) offer you this license which gives you legal permission to copy, -distribute and/or modify the software. - - Also, for each author's protection and ours, we want to make certain -that everyone understands that there is no warranty for this free -software. If the software is modified by someone else and passed on, we -want its recipients to know that what they have is not the original, so -that any problems introduced by others will not reflect on the original -authors' reputations. - - Finally, any free program is threatened constantly by software -patents. We wish to avoid the danger that redistributors of a free -program will individually obtain patent licenses, in effect making the -program proprietary. To prevent this, we have made it clear that any -patent must be licensed for everyone's free use or not licensed at all. - - The precise terms and conditions for copying, distribution and -modification follow. - - GNU GENERAL PUBLIC LICENSE - TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION - - 0. This License applies to any program or other work which contains -a notice placed by the copyright holder saying it may be distributed -under the terms of this General Public License. The "Program", below, -refers to any such program or work, and a "work based on the Program" -means either the Program or any derivative work under copyright law: -that is to say, a work containing the Program or a portion of it, -either verbatim or with modifications and/or translated into another -language. (Hereinafter, translation is included without limitation in -the term "modification".) Each licensee is addressed as "you". - -Activities other than copying, distribution and modification are not -covered by this License; they are outside its scope. The act of -running the Program is not restricted, and the output from the Program -is covered only if its contents constitute a work based on the -Program (independent of having been made by running the Program). -Whether that is true depends on what the Program does. - - 1. You may copy and distribute verbatim copies of the Program's -source code as you receive it, in any medium, provided that you -conspicuously and appropriately publish on each copy an appropriate -copyright notice and disclaimer of warranty; keep intact all the -notices that refer to this License and to the absence of any warranty; -and give any other recipients of the Program a copy of this License -along with the Program. - -You may charge a fee for the physical act of transferring a copy, and -you may at your option offer warranty protection in exchange for a fee. - - 2. You may modify your copy or copies of the Program or any portion -of it, thus forming a work based on the Program, and copy and -distribute such modifications or work under the terms of Section 1 -above, provided that you also meet all of these conditions: - - a) You must cause the modified files to carry prominent notices - stating that you changed the files and the date of any change. - - b) You must cause any work that you distribute or publish, that in - whole or in part contains or is derived from the Program or any - part thereof, to be licensed as a whole at no charge to all third - parties under the terms of this License. - - c) If the modified program normally reads commands interactively - when run, you must cause it, when started running for such - interactive use in the most ordinary way, to print or display an - announcement including an appropriate copyright notice and a - notice that there is no warranty (or else, saying that you provide - a warranty) and that users may redistribute the program under - these conditions, and telling the user how to view a copy of this - License. (Exception: if the Program itself is interactive but - does not normally print such an announcement, your work based on - the Program is not required to print an announcement.) - -These requirements apply to the modified work as a whole. If -identifiable sections of that work are not derived from the Program, -and can be reasonably considered independent and separate works in -themselves, then this License, and its terms, do not apply to those -sections when you distribute them as separate works. But when you -distribute the same sections as part of a whole which is a work based -on the Program, the distribution of the whole must be on the terms of -this License, whose permissions for other licensees extend to the -entire whole, and thus to each and every part regardless of who wrote it. - -Thus, it is not the intent of this section to claim rights or contest -your rights to work written entirely by you; rather, the intent is to -exercise the right to control the distribution of derivative or -collective works based on the Program. - -In addition, mere aggregation of another work not based on the Program -with the Program (or with a work based on the Program) on a volume of -a storage or distribution medium does not bring the other work under -the scope of this License. - - 3. You may copy and distribute the Program (or a work based on it, -under Section 2) in object code or executable form under the terms of -Sections 1 and 2 above provided that you also do one of the following: - - a) Accompany it with the complete corresponding machine-readable - source code, which must be distributed under the terms of Sections - 1 and 2 above on a medium customarily used for software interchange; or, - - b) Accompany it with a written offer, valid for at least three - years, to give any third party, for a charge no more than your - cost of physically performing source distribution, a complete - machine-readable copy of the corresponding source code, to be - distributed under the terms of Sections 1 and 2 above on a medium - customarily used for software interchange; or, - - c) Accompany it with the information you received as to the offer - to distribute corresponding source code. (This alternative is - allowed only for noncommercial distribution and only if you - received the program in object code or executable form with such - an offer, in accord with Subsection b above.) - -The source code for a work means the preferred form of the work for -making modifications to it. For an executable work, complete source -code means all the source code for all modules it contains, plus any -associated interface definition files, plus the scripts used to -control compilation and installation of the executable. However, as a -special exception, the source code distributed need not include -anything that is normally distributed (in either source or binary -form) with the major components (compiler, kernel, and so on) of the -operating system on which the executable runs, unless that component -itself accompanies the executable. - -If distribution of executable or object code is made by offering -access to copy from a designated place, then offering equivalent -access to copy the source code from the same place counts as -distribution of the source code, even though third parties are not -compelled to copy the source along with the object code. - - 4. You may not copy, modify, sublicense, or distribute the Program -except as expressly provided under this License. Any attempt -otherwise to copy, modify, sublicense or distribute the Program is -void, and will automatically terminate your rights under this License. -However, parties who have received copies, or rights, from you under -this License will not have their licenses terminated so long as such -parties remain in full compliance. - - 5. You are not required to accept this License, since you have not -signed it. However, nothing else grants you permission to modify or -distribute the Program or its derivative works. These actions are -prohibited by law if you do not accept this License. Therefore, by -modifying or distributing the Program (or any work based on the -Program), you indicate your acceptance of this License to do so, and -all its terms and conditions for copying, distributing or modifying -the Program or works based on it. - - 6. Each time you redistribute the Program (or any work based on the -Program), the recipient automatically receives a license from the -original licensor to copy, distribute or modify the Program subject to -these terms and conditions. You may not impose any further -restrictions on the recipients' exercise of the rights granted herein. -You are not responsible for enforcing compliance by third parties to -this License. - - 7. If, as a consequence of a court judgment or allegation of patent -infringement or for any other reason (not limited to patent issues), -conditions are imposed on you (whether by court order, agreement or -otherwise) that contradict the conditions of this License, they do not -excuse you from the conditions of this License. If you cannot -distribute so as to satisfy simultaneously your obligations under this -License and any other pertinent obligations, then as a consequence you -may not distribute the Program at all. For example, if a patent -license would not permit royalty-free redistribution of the Program by -all those who receive copies directly or indirectly through you, then -the only way you could satisfy both it and this License would be to -refrain entirely from distribution of the Program. - -If any portion of this section is held invalid or unenforceable under -any particular circumstance, the balance of the section is intended to -apply and the section as a whole is intended to apply in other -circumstances. - -It is not the purpose of this section to induce you to infringe any -patents or other property right claims or to contest validity of any -such claims; this section has the sole purpose of protecting the -integrity of the free software distribution system, which is -implemented by public license practices. Many people have made -generous contributions to the wide range of software distributed -through that system in reliance on consistent application of that -system; it is up to the author/donor to decide if he or she is willing -to distribute software through any other system and a licensee cannot -impose that choice. - -This section is intended to make thoroughly clear what is believed to -be a consequence of the rest of this License. - - 8. If the distribution and/or use of the Program is restricted in -certain countries either by patents or by copyrighted interfaces, the -original copyright holder who places the Program under this License -may add an explicit geographical distribution limitation excluding -those countries, so that distribution is permitted only in or among -countries not thus excluded. In such case, this License incorporates -the limitation as if written in the body of this License. - - 9. The Free Software Foundation may publish revised and/or new versions -of the General Public License from time to time. Such new versions will -be similar in spirit to the present version, but may differ in detail to -address new problems or concerns. - -Each version is given a distinguishing version number. If the Program -specifies a version number of this License which applies to it and "any -later version", you have the option of following the terms and conditions -either of that version or of any later version published by the Free -Software Foundation. If the Program does not specify a version number of -this License, you may choose any version ever published by the Free Software -Foundation. - - 10. If you wish to incorporate parts of the Program into other free -programs whose distribution conditions are different, write to the author -to ask for permission. For software which is copyrighted by the Free -Software Foundation, write to the Free Software Foundation; we sometimes -make exceptions for this. Our decision will be guided by the two goals -of preserving the free status of all derivatives of our free software and -of promoting the sharing and reuse of software generally. - - NO WARRANTY - - 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY -FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN -OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES -PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED -OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF -MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS -TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE -PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, -REPAIR OR CORRECTION. - - 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING -WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR -REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, -INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING -OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED -TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY -YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER -PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE -POSSIBILITY OF SUCH DAMAGES. - - END OF TERMS AND CONDITIONS - - How to Apply These Terms to Your New Programs - - If you develop a new program, and you want it to be of the greatest -possible use to the public, the best way to achieve this is to make it -free software which everyone can redistribute and change under these terms. - - To do so, attach the following notices to the program. It is safest -to attach them to the start of each source file to most effectively -convey the exclusion of warranty; and each file should have at least -the "copyright" line and a pointer to where the full notice is found. - - - Copyright (C) - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - - -Also add information on how to contact you by electronic and paper mail. - -If the program is interactive, make it output a short notice like this -when it starts in an interactive mode: - - Gnomovision version 69, Copyright (C) year name of author - Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. - This is free software, and you are welcome to redistribute it - under certain conditions; type `show c' for details. - -The hypothetical commands `show w' and `show c' should show the appropriate -parts of the General Public License. Of course, the commands you use may -be called something other than `show w' and `show c'; they could even be -mouse-clicks or menu items--whatever suits your program. - -You should also get your employer (if you work as a programmer) or your -school, if any, to sign a "copyright disclaimer" for the program, if -necessary. Here is a sample; alter the names: - - Yoyodyne, Inc., hereby disclaims all copyright interest in the program - `Gnomovision' (which makes passes at compilers) written by James Hacker. - - , 1 April 1989 - Ty Coon, President of Vice - -This General Public License does not permit incorporating your program into -proprietary programs. If your program is a subroutine library, you may -consider it more useful to permit linking proprietary applications with the -library. If this is what you want to do, use the GNU Library General -Public License instead of this License. diff --git a/INSTALL b/INSTALL deleted file mode 100644 index 9f6368d..0000000 --- a/INSTALL +++ /dev/null @@ -1,107 +0,0 @@ -Prerequisites -============= - - - libodb http://www.codesynthesis.com/products/odb/ - - Qt http://qt.nokia.com - - -Building on UNIX -================ - -The following build instructions are for the Linux/UNIX/Mac OS X -operating systems as well as for Cygwin and MinGW on Windows. - -The standard autotools-based build system is used on these platforms. -After unpacking the source code archive, change to the libodb-qt -package directory (referred to as libodb-qt/ from now on) and run -the configure script: - -./configure - -To see the available configuration options run configure with --help: - -./configure --help - -The configure script expects the libodb headers and libraries to be -installed in a directory where the C++ compiler and linker will search -for them by default (normally /usr and /usr/local). For Qt, the configure -script uses the pkg-config utility to discover the locations of the Qt -headers and libraries. - -If the above methods to locate libodb and Qt are not usable for your -setup, you can use the CPPFLAGS and LDFLAGS configure variables to -specify their locations, for example: - -./configure CPPFLAGS=-I/opt/libodb/include LDFLAGS=-L/opt/libodb/lib - -If libodb is not installed and you would like to use its build directory -instead, you can use the --with-libodb configure options to specify its -location, for example: - -./configure --with-libodb=/tmp/libodb - -As another example, the following configure command only builds shared -libraries, uses the specified C++ compiler, and compiles with optimization -and without debug information: - -./configure --disable-static CXX=g++-4.5 CXXFLAGS=-O3 - -Note that if you are using Qt5 and building a static library, then you -may have to manually add the -fPIC C++ compiler flag to satisfy the Qt5 -requirements, for example: - -./configure CXXFLAGS="-fPIC -O3" - -Once configuration is complete, run make to build libodb-qt: - -make - -Once the build is completed successfully, you can install the libodb-qt -headers and libraries using the install target (you may need to do this -step as root depending on the installation directory): - -make install - - -Building on Windows -=================== - -The following build instructions are for Windows using Microsoft Visual -Studio. If you would like to build libodb-qt with GCC either using -Cygwin or MinGW, refer to the "Building on UNIX" section above. - -The standard Visual Studio project and solution files are used on this -platform. The provided project files expect the libodb and Qt header -and import library directories to be in the VC++ Directories Include and -Library search lists. For libodb, see the INSTALL file in the package -directory for more information on how to setup the VC++ Directories. For -Qt, refer to the Qt documentation. - -To build libodb-qt, unpack the source code archive and open the -libodb-qt-vc.sln file located in the libodb-qt package directory -(referred to as libodb-qt\ from now on). Here is the version of -Visual Studio that you are using. Once the solution is open, select the -desired build configuration (Debug or Release) and platform (Win32 or -x64) and build the solution. - -The resulting 32-bit DLLs and import libraries are placed into the -libodb-qt\bin\ and libodb-qt\lib\ directories, respectively. Similarly, -the 64-bit DLLs and import libraries are placed into libodb-qt\bin64\ and -libodb-qt\lib64\. The Release versions of the import libraries are named -odb-qt.lib and the Debug versions are named odb-qt-d.lib. - -To configure Visual Studio to automatically locate the libodb-qt headers, -DLLs, and import libraries, add the following paths to your VC++ -Directories: - -Win32: - - Include: ...\libodb-qt - Library: ...\libodb-qt\lib - Executable: ...\libodb-qt\bin - -x64: - - Include: ...\libodb-qt - Library: ...\libodb-qt\lib64 - Executable: ...\libodb-qt\bin64 diff --git a/INSTALL-GIT b/INSTALL-GIT deleted file mode 100644 index f917af5..0000000 --- a/INSTALL-GIT +++ /dev/null @@ -1,78 +0,0 @@ -The following instructions describe how to work with the source code that was -checked out from the git repository. - -The major difference between using a released source code package and source -code from the repository is that the former does not contain autotools-based -makefiles or Visual Studio project files. Instead, it contains templates for -these files as well as its own, custom build system. This build system is -used for development as well as to automatically generate the autotools and -Visual Studio files. - -This file describes how to use this build system to build the package as well -as to create a release-ready source distribution which contains the autotools -build system and Visual Studio project files. - - -Prerequisites -============= - -Besides the prerequisites listed in the INSTALL file, you will need the -following additional packages: - - - GNU bash >= 2.0.0 http://www.gnu.org/software/bash/ - - GNU make >= 3.81 http://www.gnu.org/software/make/ - - build >= latest http://www.codesynthesis.com/projects/build/ - -If you are planning to create the source code distributions, then you will -also need the following packages: - - - GNU m4 >= 1.4.0 http://www.gnu.org/software/m4/ - - GNU sed >= 4.0.0 http://www.gnu.org/software/sed/ - - tofrodos >= 1.7.0 http://www.thefreecountry.com/tofrodos/ - -As we as the GNU autotools: - - - GNU libtool >= 2.2.6b http://www.gnu.org/software/libtool/ - - GNU autoconf >= 2.67 http://www.gnu.org/software/autoconf/ - - GNU automake >= 1.11.1 http://www.gnu.org/software/automake/ - -Any reasonably up to date GNU/Linux installation would normally have all of -the above packages already present, except for build and maybe tofrodos. - - -Configuring and Building -======================== - -To build the source code simply run make in the root directory of the package. -The first time you run make, the build process will also configure the -package by asking you several questions. On the subsequent runs, make will -only rebuild what has changed. - -To run the automated test suite (if any), run 'make test'. To clean the object -files, executables, etc., run 'make clean'. To de-configure the package (that -is, to remove configuration files in addition to objects, executables, etc.), -run 'make disfigure'. - - -Creating Distribution -===================== - -To create the source code distribution, use the dist make target as well as -the dist_prefix variable to specify the directory where the distribution files -should be placed. For example: - -make dist dist_prefix=/tmp/package-1.1.0 - -Once the distribution files are ready, change to the distribution directory -and run the bootstrap script to bootstrap the autotools build system, for -example: - -cd /tmp/package-1.1.0 -./bootsrap - -To create the source code archives, use the autotools build system. First -configuring the package (see the INSTALL file for more information on this -step) and then use the dist target to make the archives, for example: - -./configure -make dist diff --git a/LICENSE b/LICENSE deleted file mode 100644 index fad395c..0000000 --- a/LICENSE +++ /dev/null @@ -1,20 +0,0 @@ -Copyright (c) 2009-2023 Code Synthesis Tools CC. - -This program is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License version 2 as -published by the Free Software Foundation. - -For more information on ODB licensing as well as for answers to -some of the common licensing questions, visit the ODB License -page: - -http://www.codesynthesis.com/products/odb/license.xhtml - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for details. - -You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software -Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA diff --git a/Makefile.am b/Makefile.am deleted file mode 100644 index 9326a27..0000000 --- a/Makefile.am +++ /dev/null @@ -1,12 +0,0 @@ -# file : Makefile.am -# license : GNU GPL v2; see accompanying LICENSE file - -SUBDIRS = __path__(dirs) -dist_doc_DATA = __file__(docs) -EXTRA_DIST = __file__(extra_dist) -ACLOCAL_AMFLAGS = -I m4 - -nobase_include_HEADERS = __path__(options) - -pkgconfigdir = @pkgconfigdir@ -pkgconfig_DATA= libodb-qt.pc diff --git a/NEWS b/NEWS deleted file mode 100644 index 72d0f8b..0000000 --- a/NEWS +++ /dev/null @@ -1 +0,0 @@ -See the common NEWS file in the ODB compiler package. diff --git a/README b/README deleted file mode 100644 index cf85909..0000000 --- a/README +++ /dev/null @@ -1,20 +0,0 @@ -ODB is an object-relational mapping (ORM) system for C++. It provides -tools, APIs, and library support that allow you to persist C++ objects -to a relational database (RDBMS) without having to deal with tables, -columns, or SQL and without manually writing any of the mapping code. -For more information see: - -http://www.codesynthesis.com/products/odb/ - -This package contains the Qt profile library. The Qt profile provides -support for persisting Qt smart pointers, containers, and value types -with the ODB system. - -See the NEWS file for the user-visible changes from the previous release. - -See the LICENSE file for distribution conditions. - -See the INSTALL file for prerequisites and installation instructions. - -Send questions, bug reports, or any other feedback to the -odb-users@codesynthesis.com mailing list. diff --git a/README-GIT b/README-GIT deleted file mode 100644 index 859c710..0000000 --- a/README-GIT +++ /dev/null @@ -1,4 +0,0 @@ -The checked out odb/qt/version-build2.hxx will be overwritten during the build -process but these changes should be ignored. To do this automatically, run: - -git update-index --assume-unchanged odb/qt/version-build2.hxx diff --git a/bootstrap b/bootstrap deleted file mode 100755 index 85d1399..0000000 --- a/bootstrap +++ /dev/null @@ -1,16 +0,0 @@ -#! /bin/sh - -# file : bootstrap -# license : GNU GPL v2; see accompanying LICENSE file - -# -# Bootstrap the automake build system. -# - -rm -f config.cache - -if test ! -d m4; then - mkdir m4 -fi - -autoreconf --install diff --git a/build/.gitignore b/build/.gitignore deleted file mode 100644 index 4a730a3..0000000 --- a/build/.gitignore +++ /dev/null @@ -1,3 +0,0 @@ -config.build -root/ -bootstrap/ diff --git a/build/bootstrap.build b/build/bootstrap.build deleted file mode 100644 index dfb36a2..0000000 --- a/build/bootstrap.build +++ /dev/null @@ -1,10 +0,0 @@ -# file : build/bootstrap.build -# license : GNU GPL v2; see accompanying LICENSE file - -project = libodb-qt - -using version -using config -using dist -using test -using install diff --git a/build/bootstrap.make b/build/bootstrap.make deleted file mode 100644 index be09351..0000000 --- a/build/bootstrap.make +++ /dev/null @@ -1,70 +0,0 @@ -# file : build/bootstrap.make -# license : GNU GPL v2; see accompanying LICENSE file - -project_name := libodb-qt - -# First try to include the bundled bootstrap.make if it exist. If that -# fails, let make search for the external bootstrap.make. -# -build := build-0.3 - --include $(dir $(lastword $(MAKEFILE_LIST)))../../$(build)/bootstrap.make - -ifeq ($(patsubst %build/bootstrap.make,,$(lastword $(MAKEFILE_LIST))),) -include $(build)/bootstrap.make -endif - - -# Aliases -# -.PHONY: $(out_base)/ \ - $(out_base)/.test \ - $(out_base)/.dist \ - $(out_base)/.clean - -ifdef %interactive% - -.PHONY: test dist clean - -test: $(out_base)/.test -dist: $(out_base)/.dist -clean: $(out_base)/.clean - -ifneq ($(filter $(.DEFAULT_GOAL),test dist clean),) -.DEFAULT_GOAL := -endif - -endif - -# Make sure the distribution prefix is set if the goal is dist. -# -ifneq ($(filter $(MAKECMDGOALS),dist),) -ifeq ($(dist_prefix),) -$(error dist_prefix is not set) -endif -endif - -# If we don't have dependency auto-generation then we need to manually -# make sure that generated files are generated before C++ file are -# compiler. To do this we make the object files ($2) depend in order- -# only on generated files ($3). -# -ifeq ($(cxx_id),generic) - -define include-dep -$(if $2,$(eval $2: | $3)) -endef - -else - -define include-dep -$(call -include,$1) -endef - -endif - -# Don't include dependency info for certain targets. -# -ifneq ($(filter $(MAKECMDGOALS),clean disfigure dist),) -include-dep = -endif diff --git a/build/export.build b/build/export.build deleted file mode 100644 index bd72576..0000000 --- a/build/export.build +++ /dev/null @@ -1,9 +0,0 @@ -# file : build/export.build -# license : GNU GPL v2; see accompanying LICENSE file - -$out_root/ -{ - include odb/qt/ -} - -export $out_root/odb/qt/lib{odb-qt} diff --git a/build/export/libodb-qt/stub.make b/build/export/libodb-qt/stub.make deleted file mode 100644 index de06c20..0000000 --- a/build/export/libodb-qt/stub.make +++ /dev/null @@ -1,8 +0,0 @@ -# file : build/export/libodb-qt/stub.make -# license : GNU GPL v2; see accompanying LICENSE file - -$(call include-once,$(src_root)/odb/qt/makefile,$(out_root)) - -$(call export,\ - l: $(out_root)/odb/qt/odb-qt.l,\ - cpp-options: $(out_root)/odb/qt/odb-qt.l.cpp-options) diff --git a/build/import/libodb-qt/configuration-rules.make b/build/import/libodb-qt/configuration-rules.make deleted file mode 100644 index 9765a0c..0000000 --- a/build/import/libodb-qt/configuration-rules.make +++ /dev/null @@ -1,13 +0,0 @@ -# file : build/import/libodb-qt/configuration-rules.make -# license : GNU GPL v2; see accompanying LICENSE file - -$(dcf_root)/import/libodb-qt/configuration-dynamic.make: | $(dcf_root)/import/libodb-qt/. - $(call message,,$(scf_root)/import/libodb-qt/configure $@) - -ifndef %foreign% - -$(dcf_root)/.disfigure:: - $(call message,rm $(dcf_root)/import/libodb-qt/configuration-dynamic.make,\ -rm -f $(dcf_root)/import/libodb-qt/configuration-dynamic.make) - -endif diff --git a/build/import/libodb-qt/configure b/build/import/libodb-qt/configure deleted file mode 100755 index 6213974..0000000 --- a/build/import/libodb-qt/configure +++ /dev/null @@ -1,53 +0,0 @@ -#! /usr/bin/env bash - -# file : build/import/libodb-qt/configure -# license : GNU GPL v2; see accompanying LICENSE file - - -# $1 - out file -# -# bld_root - build root -# project_name - project name -# - -source $bld_root/dialog.bash - - -$echo -$echo "Configuring external dependency on 'libodb-qt' for '$project_name'." -$echo - -$echo -$echo "Would you like to configure dependency on the installed version" -$echo "of 'libodb-qt' as opposed to the development build?" -$echo - -installed=`read_y_n y` - -path= - -if [ "$installed" = "n" ]; then - -$echo -$echo "Please enter the src_root for 'libodb-qt'." -$echo - -src_root=`read_path --directory --exist` - -$echo -$echo "Please enter the out_root for 'libodb-qt'." -$echo - -out_root=`read_path --directory $src_root` - -fi - -echo libodb_qt_installed := $installed >$1 - -if [ "$installed" = "n" ]; then - -echo src_root := $src_root >>$1 -echo scf_root := \$\(src_root\)/build >>$1 -echo out_root := $out_root >>$1 - -fi diff --git a/build/import/libodb-qt/stub.make b/build/import/libodb-qt/stub.make deleted file mode 100644 index bd5e2ea..0000000 --- a/build/import/libodb-qt/stub.make +++ /dev/null @@ -1,28 +0,0 @@ -# file : build/import/libodb-qt/stub.make -# license : GNU GPL v2; see accompanying LICENSE file - -$(call include-once,$(scf_root)/import/libodb-qt/configuration-rules.make,$(dcf_root)) - -libodb_qt_installed := - -$(call -include,$(dcf_root)/import/libodb-qt/configuration-dynamic.make) - -ifdef libodb_qt_installed - -ifeq ($(libodb_qt_installed),y) - -$(call export,l: -lodb-qt -lodb,cpp-options: ) - -else - -# Include export stub. -# -$(call include,$(scf_root)/export/libodb-qt/stub.make) - -endif - -else - -.NOTPARALLEL: - -endif diff --git a/build/import/libodb/configuration-rules.make b/build/import/libodb/configuration-rules.make deleted file mode 100644 index 340c418..0000000 --- a/build/import/libodb/configuration-rules.make +++ /dev/null @@ -1,13 +0,0 @@ -# file : build/import/libodb/configuration-rules.make -# license : GNU GPL v2; see accompanying LICENSE file - -$(dcf_root)/import/libodb/configuration-dynamic.make: | $(dcf_root)/import/libodb/. - $(call message,,$(scf_root)/import/libodb/configure $@) - -ifndef %foreign% - -$(dcf_root)/.disfigure:: - $(call message,rm $(dcf_root)/import/libodb/configuration-dynamic.make,\ -rm -f $(dcf_root)/import/libodb/configuration-dynamic.make) - -endif diff --git a/build/import/libodb/configure b/build/import/libodb/configure deleted file mode 100755 index 261a202..0000000 --- a/build/import/libodb/configure +++ /dev/null @@ -1,53 +0,0 @@ -#! /usr/bin/env bash - -# file : build/import/libodb/configure -# license : GNU GPL v2; see accompanying LICENSE file - - -# $1 - out file -# -# bld_root - build root -# project_name - project name -# - -source $bld_root/dialog.bash - - -$echo -$echo "Configuring external dependency on 'libodb' for '$project_name'." -$echo - -$echo -$echo "Would you like to configure dependency on the installed " -$echo "version of 'libodb' as opposed to the development build?" -$echo - -installed=`read_y_n y` - -path= - -if [ "$installed" = "n" ]; then - -$echo -$echo "Please enter the src_root for 'libodb'." -$echo - -src_root=`read_path --directory --exist` - -$echo -$echo "Please enter the out_root for 'libodb'." -$echo - -out_root=`read_path --directory $src_root` - -fi - -echo libodb_installed := $installed >$1 - -if [ "$installed" = "n" ]; then - -echo src_root := $src_root >>$1 -echo scf_root := \$\(src_root\)/build >>$1 -echo out_root := $out_root >>$1 - -fi diff --git a/build/import/libodb/stub.make b/build/import/libodb/stub.make deleted file mode 100644 index 04dc786..0000000 --- a/build/import/libodb/stub.make +++ /dev/null @@ -1,28 +0,0 @@ -# file : build/import/libodb/stub.make -# license : GNU GPL v2; see accompanying LICENSE file - -$(call include-once,$(scf_root)/import/libodb/configuration-rules.make,$(dcf_root)) - -libodb_installed := - -$(call -include,$(dcf_root)/import/libodb/configuration-dynamic.make) - -ifdef libodb_installed - -ifeq ($(libodb_installed),y) - -$(call export,l: -lodb,cpp-options: ) - -else - -# Include export stub. -# -$(call include,$(scf_root)/export/libodb/stub.make) - -endif - -else - -.NOTPARALLEL: - -endif diff --git a/build/import/libqt/configuration-rules.make b/build/import/libqt/configuration-rules.make deleted file mode 100644 index badc561..0000000 --- a/build/import/libqt/configuration-rules.make +++ /dev/null @@ -1,13 +0,0 @@ -# file : build/import/libqt/configuration-rules.make -# license : GNU GPL v2; see accompanying LICENSE file - -$(dcf_root)/import/libqt/configuration-dynamic.make: | $(dcf_root)/import/libqt/. - $(call message,,$(scf_root)/import/libqt/configure $@) - -ifndef %foreign% - -disfigure:: - $(call message,rm $(dcf_root)/import/libqt/configuration-dynamic.make,\ -rm -f $(dcf_root)/import/libqt/configuration-dynamic.make) - -endif diff --git a/build/import/libqt/configure b/build/import/libqt/configure deleted file mode 100755 index 904d126..0000000 --- a/build/import/libqt/configure +++ /dev/null @@ -1,97 +0,0 @@ -#! /usr/bin/env bash - -# file : build/import/libqt/configure -# license : GNU GPL v2; see accompanying LICENSE file - - -# $1 - out config file -# -# bld_root - build root -# project_name - project name -# - -source $bld_root/dialog.bash - - -$echo -$echo "Configuring external dependency on 'Qt libraries' for '$project_name'." -$echo - -$echo -$echo "Which version of Qt would you like to use?" -$echo -$echo "(1) Qt5" -$echo "(2) Qt4" -$echo -version=`read_option "5 4" "5"` - -$echo -$echo "Would you like to configure dependency on the installed version" -$echo "of 'Qt libraries' as opposed to the development build?" -$echo - -installed=`read_y_n y` - -if [ "$installed" = "n" ]; then - - $echo - $echo "Please enter the 'Qt' root directory." - $echo - - root=`read_path --directory --exist` - - $echo - $echo "Please select the library type you would like to use:" - $echo - $echo "(1) archive" - $echo "(2) shared object" - $echo - - type=`read_option "archive shared" "shared"` - -else - core_libs= - if [ "$version" = "5" ]; then - - if pkg-config --exists Qt5Core; then - core_cppflags=`pkg-config --cflags Qt5Core` - core_libs=`pkg-config --libs Qt5Core` - fi - - else - - if pkg-config --exists QtCore; then - core_cppflags=`pkg-config --cflags QtCore` - core_libs=`pkg-config --libs QtCore` - fi - - fi - - if [ "$core_libs" = "" ]; then - - $echo - $echo "Unable to discover installed 'Qt libraries' using pkg-config." - $echo "Assuming the C++ compiler will find them automatically." - $echo - - core_cppflags= - - if [ "$version" = "5" ]; then - core_libs=-lQt5Core - else - core_libs=-lQtCore - fi - fi -fi - - -echo libqt_version := $version >$1 -echo libqt_installed := $installed >>$1 - -if [ "$installed" = "n" ]; then - echo libqt_root := $root >>$1 - echo libqt_type := $type >>$1 -else - echo libqt_core_cppflags := $core_cppflags >>$1 - echo libqt_core_libs := $core_libs >>$1 -fi diff --git a/build/import/libqt/core/rules.make b/build/import/libqt/core/rules.make deleted file mode 100644 index 1fd6f10..0000000 --- a/build/import/libqt/core/rules.make +++ /dev/null @@ -1,26 +0,0 @@ -# file : build/import/libqt/core/rules.make -# license : GNU GPL v2; see accompanying LICENSE file - -$(dcf_root)/import/libqt/%: root := $(libqt_root) -$(dcf_root)/import/libqt/core/core.l: | $(dcf_root)/import/libqt/core/. - -ifeq ($(libqt_type),archive) -$(dcf_root)/import/libqt/core/core.l: $(libqt_root)/lib/libQtCore.a - @echo $^ >$@ -else -$(dcf_root)/import/libqt/core/core.l: $(libqt_root)/lib/libQtCore.so - @echo $^ >$@ - @echo rpath:$(root)/lib >>$@ -endif - -$(dcf_root)/import/libqt/core/core.l.cpp-options: | $(dcf_root)/import/libqt/core/. - @echo include: -I$(root)/include -I$(root)/include/QtCore >$@ - -ifndef %foreign% - -disfigure:: - $(call message,rm $(dcf_root)/import/libqt/core/core.l,\ -rm -f $(dcf_root)/import/libqt/core/core.l) - $(call message,,rm -f $(dcf_root)/import/libqt/core/core.l.cpp-options) - -endif diff --git a/build/import/libqt/core/stub.make b/build/import/libqt/core/stub.make deleted file mode 100644 index 1a13bde..0000000 --- a/build/import/libqt/core/stub.make +++ /dev/null @@ -1,35 +0,0 @@ -# file : build/import/libqt/core/stub.make -# license : GNU GPL v2; see accompanying LICENSE file - -$(call include-once,$(scf_root)/import/libqt/configuration-rules.make,$(dcf_root)) - -libqt_version := -libqt_installed := - -$(call -include,$(dcf_root)/import/libqt/configuration-dynamic.make) - -ifdef libqt_installed - -ifeq ($(libqt_installed),y) - -$(call export,\ - l: $(libqt_core_libs),\ - cpp-options: ,\ - cpp-options-inline: $(libqt_core_cppflags)) - -else - -$(call include-once,$(scf_root)/import/libqt/core/rules.make,$(dcf_root)) - -$(call export,\ - l: $(dcf_root)/import/libqt/core/core.l,\ - cpp-options: $(dcf_root)/import/libqt/core/core.l.cpp-options,\ - cpp-options-inline: ) - -endif - -else - -.NOTPARALLEL: - -endif diff --git a/build/import/libqt/version b/build/import/libqt/version deleted file mode 100644 index 6e8bf73..0000000 --- a/build/import/libqt/version +++ /dev/null @@ -1 +0,0 @@ -0.1.0 diff --git a/build/root.build b/build/root.build deleted file mode 100644 index 882047d..0000000 --- a/build/root.build +++ /dev/null @@ -1,17 +0,0 @@ -# file : build/root.build -# license : GNU GPL v2; see accompanying LICENSE file - -cxx.std = latest - -using cxx - -hxx{*}: extension = hxx -ixx{*}: extension = ixx -txx{*}: extension = txx -cxx{*}: extension = cxx - -if ($cxx.target.system == 'win32-msvc') - cxx.poptions += -D_CRT_SECURE_NO_WARNINGS -D_SCL_SECURE_NO_WARNINGS - -if ($cxx.class == 'msvc') - cxx.coptions += /wd4251 /wd4275 /wd4800 diff --git a/buildfile b/buildfile deleted file mode 100644 index 1c342be..0000000 --- a/buildfile +++ /dev/null @@ -1,9 +0,0 @@ -# file : buildfile -# license : GNU GPL v2; see accompanying LICENSE file - -./: {*/ -build/ -m4/} doc{INSTALL NEWS README} legal{LICENSE} manifest - -# Don't install tests or the INSTALL file. -# -tests/: install = false -doc{INSTALL}@./: install = false diff --git a/configure.ac b/configure.ac deleted file mode 100644 index 483f4c8..0000000 --- a/configure.ac +++ /dev/null @@ -1,55 +0,0 @@ -# file : configure.ac -# license : GNU GPL v2; see accompanying LICENSE file - -AC_PREREQ(2.60) -AC_INIT([libodb-qt], [__value__(version)], [odb-users@codesynthesis.com]) -AC_CONFIG_AUX_DIR([config]) -AC_CONFIG_MACRO_DIR([m4]) -AC_CONFIG_SRCDIR([odb/qt/version.hxx]) - -AM_INIT_AUTOMAKE([-Wall -Werror foreign nostdinc subdir-objects dist-bzip2 dist-zip tar-ustar]) -m4_equote()[m4_ifdef]m4_dquote()([AM_PROG_AR], [AM_PROG_AR]) # Required by automake 1.12. - -LT_INIT([win32-dll]) - -AC_CANONICAL_HOST - -# Check for C++ compiler and use it to compile the tests. -# -AC_PROG_CXX -AC_LANG(C++) - -# Create the libtool executable so that we can use it in further tests. -# -LT_OUTPUT - -# Check for threads. -# -THREADS - -# Check for Qt. -# -LIBQTCORE([],[AC_MSG_ERROR([QtCore is not found; consider using CPPFLAGS/LDFLAGS to specify its location])]) - -# Check for libodb. -# -LIBODB([], [AC_MSG_ERROR([libodb is not found; consider using --with-libodb=DIR])]) - -# Define LIBODB_QT_STATIC_LIB if we are build static library on certain -# platforms. -# -STATIC_LIB([LIBODB_QT_STATIC_LIB], [Static library interface.]) - -# Allow the user to specify the pkgconfig directory. -# -PKGCONFIG - -# Check if we should disable rpath. -# -DISABLE_RPATH - -# Output. -# -AC_CONFIG_HEADERS([odb/qt/config.h odb/qt/details/config.h]) -AC_CONFIG_FILES([__path__(config_files)]) -AC_OUTPUT diff --git a/libodb-qt.pc.in b/libodb-qt.pc.in deleted file mode 100644 index c22a62f..0000000 --- a/libodb-qt.pc.in +++ /dev/null @@ -1,14 +0,0 @@ -# file : libodb-qt.pc.in -# license : GNU GPL v2; see accompanying LICENSE file - -prefix=@prefix@ -exec_prefix=@exec_prefix@ -libdir=@libdir@ -includedir=@includedir@ - -Name: libodb-qt -Description: Object-relational mapping (ORM) system for C++, Qt profile library -URL: http://www.codesynthesis.com/products/odb/ -Version: @VERSION@ -Libs: -L${libdir} -lodb-qt -Cflags: -I${includedir} diff --git a/libodb-qt/.gitignore b/libodb-qt/.gitignore new file mode 100644 index 0000000..1c363a0 --- /dev/null +++ b/libodb-qt/.gitignore @@ -0,0 +1,25 @@ +# Compiler/linker output. +# +*.d +*.t +*.i +*.i.* +*.ii +*.ii.* +*.o +*.obj +*.gcm +*.pcm +*.ifc +*.so +*.dylib +*.dll +*.a +*.lib +*.exp +*.pdb +*.ilk +*.exe +*.exe.dlls/ +*.exe.manifest +*.pc diff --git a/libodb-qt/GPLv2 b/libodb-qt/GPLv2 new file mode 100644 index 0000000..3912109 --- /dev/null +++ b/libodb-qt/GPLv2 @@ -0,0 +1,340 @@ + GNU GENERAL PUBLIC LICENSE + Version 2, June 1991 + + Copyright (C) 1989, 1991 Free Software Foundation, Inc. + 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The licenses for most software are designed to take away your +freedom to share and change it. By contrast, the GNU General Public +License is intended to guarantee your freedom to share and change free +software--to make sure the software is free for all its users. This +General Public License applies to most of the Free Software +Foundation's software and to any other program whose authors commit to +using it. (Some other Free Software Foundation software is covered by +the GNU Library General Public License instead.) You can apply it to +your programs, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +this service if you wish), that you receive source code or can get it +if you want it, that you can change the software or use pieces of it +in new free programs; and that you know you can do these things. + + To protect your rights, we need to make restrictions that forbid +anyone to deny you these rights or to ask you to surrender the rights. +These restrictions translate to certain responsibilities for you if you +distribute copies of the software, or if you modify it. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must give the recipients all the rights that +you have. You must make sure that they, too, receive or can get the +source code. And you must show them these terms so they know their +rights. + + We protect your rights with two steps: (1) copyright the software, and +(2) offer you this license which gives you legal permission to copy, +distribute and/or modify the software. + + Also, for each author's protection and ours, we want to make certain +that everyone understands that there is no warranty for this free +software. If the software is modified by someone else and passed on, we +want its recipients to know that what they have is not the original, so +that any problems introduced by others will not reflect on the original +authors' reputations. + + Finally, any free program is threatened constantly by software +patents. We wish to avoid the danger that redistributors of a free +program will individually obtain patent licenses, in effect making the +program proprietary. To prevent this, we have made it clear that any +patent must be licensed for everyone's free use or not licensed at all. + + The precise terms and conditions for copying, distribution and +modification follow. + + GNU GENERAL PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. This License applies to any program or other work which contains +a notice placed by the copyright holder saying it may be distributed +under the terms of this General Public License. The "Program", below, +refers to any such program or work, and a "work based on the Program" +means either the Program or any derivative work under copyright law: +that is to say, a work containing the Program or a portion of it, +either verbatim or with modifications and/or translated into another +language. (Hereinafter, translation is included without limitation in +the term "modification".) Each licensee is addressed as "you". + +Activities other than copying, distribution and modification are not +covered by this License; they are outside its scope. The act of +running the Program is not restricted, and the output from the Program +is covered only if its contents constitute a work based on the +Program (independent of having been made by running the Program). +Whether that is true depends on what the Program does. + + 1. You may copy and distribute verbatim copies of the Program's +source code as you receive it, in any medium, provided that you +conspicuously and appropriately publish on each copy an appropriate +copyright notice and disclaimer of warranty; keep intact all the +notices that refer to this License and to the absence of any warranty; +and give any other recipients of the Program a copy of this License +along with the Program. + +You may charge a fee for the physical act of transferring a copy, and +you may at your option offer warranty protection in exchange for a fee. + + 2. You may modify your copy or copies of the Program or any portion +of it, thus forming a work based on the Program, and copy and +distribute such modifications or work under the terms of Section 1 +above, provided that you also meet all of these conditions: + + a) You must cause the modified files to carry prominent notices + stating that you changed the files and the date of any change. + + b) You must cause any work that you distribute or publish, that in + whole or in part contains or is derived from the Program or any + part thereof, to be licensed as a whole at no charge to all third + parties under the terms of this License. + + c) If the modified program normally reads commands interactively + when run, you must cause it, when started running for such + interactive use in the most ordinary way, to print or display an + announcement including an appropriate copyright notice and a + notice that there is no warranty (or else, saying that you provide + a warranty) and that users may redistribute the program under + these conditions, and telling the user how to view a copy of this + License. (Exception: if the Program itself is interactive but + does not normally print such an announcement, your work based on + the Program is not required to print an announcement.) + +These requirements apply to the modified work as a whole. If +identifiable sections of that work are not derived from the Program, +and can be reasonably considered independent and separate works in +themselves, then this License, and its terms, do not apply to those +sections when you distribute them as separate works. But when you +distribute the same sections as part of a whole which is a work based +on the Program, the distribution of the whole must be on the terms of +this License, whose permissions for other licensees extend to the +entire whole, and thus to each and every part regardless of who wrote it. + +Thus, it is not the intent of this section to claim rights or contest +your rights to work written entirely by you; rather, the intent is to +exercise the right to control the distribution of derivative or +collective works based on the Program. + +In addition, mere aggregation of another work not based on the Program +with the Program (or with a work based on the Program) on a volume of +a storage or distribution medium does not bring the other work under +the scope of this License. + + 3. You may copy and distribute the Program (or a work based on it, +under Section 2) in object code or executable form under the terms of +Sections 1 and 2 above provided that you also do one of the following: + + a) Accompany it with the complete corresponding machine-readable + source code, which must be distributed under the terms of Sections + 1 and 2 above on a medium customarily used for software interchange; or, + + b) Accompany it with a written offer, valid for at least three + years, to give any third party, for a charge no more than your + cost of physically performing source distribution, a complete + machine-readable copy of the corresponding source code, to be + distributed under the terms of Sections 1 and 2 above on a medium + customarily used for software interchange; or, + + c) Accompany it with the information you received as to the offer + to distribute corresponding source code. (This alternative is + allowed only for noncommercial distribution and only if you + received the program in object code or executable form with such + an offer, in accord with Subsection b above.) + +The source code for a work means the preferred form of the work for +making modifications to it. For an executable work, complete source +code means all the source code for all modules it contains, plus any +associated interface definition files, plus the scripts used to +control compilation and installation of the executable. However, as a +special exception, the source code distributed need not include +anything that is normally distributed (in either source or binary +form) with the major components (compiler, kernel, and so on) of the +operating system on which the executable runs, unless that component +itself accompanies the executable. + +If distribution of executable or object code is made by offering +access to copy from a designated place, then offering equivalent +access to copy the source code from the same place counts as +distribution of the source code, even though third parties are not +compelled to copy the source along with the object code. + + 4. You may not copy, modify, sublicense, or distribute the Program +except as expressly provided under this License. Any attempt +otherwise to copy, modify, sublicense or distribute the Program is +void, and will automatically terminate your rights under this License. +However, parties who have received copies, or rights, from you under +this License will not have their licenses terminated so long as such +parties remain in full compliance. + + 5. You are not required to accept this License, since you have not +signed it. However, nothing else grants you permission to modify or +distribute the Program or its derivative works. These actions are +prohibited by law if you do not accept this License. Therefore, by +modifying or distributing the Program (or any work based on the +Program), you indicate your acceptance of this License to do so, and +all its terms and conditions for copying, distributing or modifying +the Program or works based on it. + + 6. Each time you redistribute the Program (or any work based on the +Program), the recipient automatically receives a license from the +original licensor to copy, distribute or modify the Program subject to +these terms and conditions. You may not impose any further +restrictions on the recipients' exercise of the rights granted herein. +You are not responsible for enforcing compliance by third parties to +this License. + + 7. If, as a consequence of a court judgment or allegation of patent +infringement or for any other reason (not limited to patent issues), +conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot +distribute so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you +may not distribute the Program at all. For example, if a patent +license would not permit royalty-free redistribution of the Program by +all those who receive copies directly or indirectly through you, then +the only way you could satisfy both it and this License would be to +refrain entirely from distribution of the Program. + +If any portion of this section is held invalid or unenforceable under +any particular circumstance, the balance of the section is intended to +apply and the section as a whole is intended to apply in other +circumstances. + +It is not the purpose of this section to induce you to infringe any +patents or other property right claims or to contest validity of any +such claims; this section has the sole purpose of protecting the +integrity of the free software distribution system, which is +implemented by public license practices. Many people have made +generous contributions to the wide range of software distributed +through that system in reliance on consistent application of that +system; it is up to the author/donor to decide if he or she is willing +to distribute software through any other system and a licensee cannot +impose that choice. + +This section is intended to make thoroughly clear what is believed to +be a consequence of the rest of this License. + + 8. If the distribution and/or use of the Program is restricted in +certain countries either by patents or by copyrighted interfaces, the +original copyright holder who places the Program under this License +may add an explicit geographical distribution limitation excluding +those countries, so that distribution is permitted only in or among +countries not thus excluded. In such case, this License incorporates +the limitation as if written in the body of this License. + + 9. The Free Software Foundation may publish revised and/or new versions +of the General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + +Each version is given a distinguishing version number. If the Program +specifies a version number of this License which applies to it and "any +later version", you have the option of following the terms and conditions +either of that version or of any later version published by the Free +Software Foundation. If the Program does not specify a version number of +this License, you may choose any version ever published by the Free Software +Foundation. + + 10. If you wish to incorporate parts of the Program into other free +programs whose distribution conditions are different, write to the author +to ask for permission. For software which is copyrighted by the Free +Software Foundation, write to the Free Software Foundation; we sometimes +make exceptions for this. Our decision will be guided by the two goals +of preserving the free status of all derivatives of our free software and +of promoting the sharing and reuse of software generally. + + NO WARRANTY + + 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY +FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN +OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES +PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED +OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS +TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE +PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, +REPAIR OR CORRECTION. + + 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR +REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, +INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING +OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED +TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY +YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER +PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE +POSSIBILITY OF SUCH DAMAGES. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Programs + + If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these terms. + + To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +convey the exclusion of warranty; and each file should have at least +the "copyright" line and a pointer to where the full notice is found. + + + Copyright (C) + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + + +Also add information on how to contact you by electronic and paper mail. + +If the program is interactive, make it output a short notice like this +when it starts in an interactive mode: + + Gnomovision version 69, Copyright (C) year name of author + Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. + This is free software, and you are welcome to redistribute it + under certain conditions; type `show c' for details. + +The hypothetical commands `show w' and `show c' should show the appropriate +parts of the General Public License. Of course, the commands you use may +be called something other than `show w' and `show c'; they could even be +mouse-clicks or menu items--whatever suits your program. + +You should also get your employer (if you work as a programmer) or your +school, if any, to sign a "copyright disclaimer" for the program, if +necessary. Here is a sample; alter the names: + + Yoyodyne, Inc., hereby disclaims all copyright interest in the program + `Gnomovision' (which makes passes at compilers) written by James Hacker. + + , 1 April 1989 + Ty Coon, President of Vice + +This General Public License does not permit incorporating your program into +proprietary programs. If your program is a subroutine library, you may +consider it more useful to permit linking proprietary applications with the +library. If this is what you want to do, use the GNU Library General +Public License instead of this License. diff --git a/libodb-qt/INSTALL b/libodb-qt/INSTALL new file mode 100644 index 0000000..5c67dce --- /dev/null +++ b/libodb-qt/INSTALL @@ -0,0 +1,6 @@ +The easiest way to build this package is with the bpkg package manager: + +$ bpkg build libodb-boost + +But if you don't want to use the package manager, then you can also build it +manually using the standard build2 build system. diff --git a/libodb-qt/LICENSE b/libodb-qt/LICENSE new file mode 100644 index 0000000..fad395c --- /dev/null +++ b/libodb-qt/LICENSE @@ -0,0 +1,20 @@ +Copyright (c) 2009-2023 Code Synthesis Tools CC. + +This program is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License version 2 as +published by the Free Software Foundation. + +For more information on ODB licensing as well as for answers to +some of the common licensing questions, visit the ODB License +page: + +http://www.codesynthesis.com/products/odb/license.xhtml + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for details. + +You should have received a copy of the GNU General Public License +along with this program; if not, write to the Free Software +Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA diff --git a/libodb-qt/README b/libodb-qt/README new file mode 100644 index 0000000..cf85909 --- /dev/null +++ b/libodb-qt/README @@ -0,0 +1,20 @@ +ODB is an object-relational mapping (ORM) system for C++. It provides +tools, APIs, and library support that allow you to persist C++ objects +to a relational database (RDBMS) without having to deal with tables, +columns, or SQL and without manually writing any of the mapping code. +For more information see: + +http://www.codesynthesis.com/products/odb/ + +This package contains the Qt profile library. The Qt profile provides +support for persisting Qt smart pointers, containers, and value types +with the ODB system. + +See the NEWS file for the user-visible changes from the previous release. + +See the LICENSE file for distribution conditions. + +See the INSTALL file for prerequisites and installation instructions. + +Send questions, bug reports, or any other feedback to the +odb-users@codesynthesis.com mailing list. diff --git a/libodb-qt/build/.gitignore b/libodb-qt/build/.gitignore new file mode 100644 index 0000000..4a730a3 --- /dev/null +++ b/libodb-qt/build/.gitignore @@ -0,0 +1,3 @@ +config.build +root/ +bootstrap/ diff --git a/libodb-qt/build/bootstrap.build b/libodb-qt/build/bootstrap.build new file mode 100644 index 0000000..dfb36a2 --- /dev/null +++ b/libodb-qt/build/bootstrap.build @@ -0,0 +1,10 @@ +# file : build/bootstrap.build +# license : GNU GPL v2; see accompanying LICENSE file + +project = libodb-qt + +using version +using config +using dist +using test +using install diff --git a/libodb-qt/build/export.build b/libodb-qt/build/export.build new file mode 100644 index 0000000..bd72576 --- /dev/null +++ b/libodb-qt/build/export.build @@ -0,0 +1,9 @@ +# file : build/export.build +# license : GNU GPL v2; see accompanying LICENSE file + +$out_root/ +{ + include odb/qt/ +} + +export $out_root/odb/qt/lib{odb-qt} diff --git a/libodb-qt/build/root.build b/libodb-qt/build/root.build new file mode 100644 index 0000000..882047d --- /dev/null +++ b/libodb-qt/build/root.build @@ -0,0 +1,17 @@ +# file : build/root.build +# license : GNU GPL v2; see accompanying LICENSE file + +cxx.std = latest + +using cxx + +hxx{*}: extension = hxx +ixx{*}: extension = ixx +txx{*}: extension = txx +cxx{*}: extension = cxx + +if ($cxx.target.system == 'win32-msvc') + cxx.poptions += -D_CRT_SECURE_NO_WARNINGS -D_SCL_SECURE_NO_WARNINGS + +if ($cxx.class == 'msvc') + cxx.coptions += /wd4251 /wd4275 /wd4800 diff --git a/libodb-qt/buildfile b/libodb-qt/buildfile new file mode 100644 index 0000000..8a0d6d9 --- /dev/null +++ b/libodb-qt/buildfile @@ -0,0 +1,9 @@ +# file : buildfile +# license : GNU GPL v2; see accompanying LICENSE file + +./: {*/ -build/} doc{INSTALL NEWS README} legal{LICENSE} manifest + +# Don't install tests or the INSTALL file. +# +tests/: install = false +doc{INSTALL}@./: install = false diff --git a/libodb-qt/manifest b/libodb-qt/manifest new file mode 100644 index 0000000..d806cae --- /dev/null +++ b/libodb-qt/manifest @@ -0,0 +1,21 @@ +: 1 +name: libodb-qt +version: 2.5.0-b.26.z +project: odb +summary: Qt ODB profile library +license: GPL-2.0-only +license: other: proprietary ; Not free/open source. +topics: C++, ORM, Qt, SQL +description-file: README +changes-file: NEWS +url: https://www.codesynthesis.com/products/odb/ +doc-url: https://www.codesynthesis.com/products/odb/doc/manual.xhtml +src-url: https://git.codesynthesis.com/cgit/odb/libodb-qt/ +email: odb-users@codesynthesis.com +build-warning-email: odb-builds@codesynthesis.com +builds: all +requires: c++11 +requires: libqt-core ; Requires not yet packaged libqt-core. +depends: * build2 >= 0.16.0- +depends: * bpkg >= 0.16.0- +depends: libodb [2.5.0-b.26.1 2.5.0-b.27) diff --git a/libodb-qt/odb/qt.options b/libodb-qt/odb/qt.options new file mode 100644 index 0000000..1e31135 --- /dev/null +++ b/libodb-qt/odb/qt.options @@ -0,0 +1,7 @@ +# file : odb/qt.options +# license : GNU GPL v2; see accompanying LICENSE file + +--profile qt/basic +--profile qt/containers +--profile qt/date-time +--profile qt/smart-ptr diff --git a/libodb-qt/odb/qt/basic.options b/libodb-qt/odb/qt/basic.options new file mode 100644 index 0000000..306d949 --- /dev/null +++ b/libodb-qt/odb/qt/basic.options @@ -0,0 +1,4 @@ +# file : odb/qt/basic.options +# license : GNU GPL v2; see accompanying LICENSE file + +--profile qt/basic/basic diff --git a/libodb-qt/odb/qt/basic/basic-common.options b/libodb-qt/odb/qt/basic/basic-common.options new file mode 100644 index 0000000..f704314 --- /dev/null +++ b/libodb-qt/odb/qt/basic/basic-common.options @@ -0,0 +1,4 @@ +# file : odb/qt/basic/basic-common.options +# license : GNU GPL v2; see accompanying LICENSE file + +--profile qt/version diff --git a/libodb-qt/odb/qt/basic/basic-mssql.options b/libodb-qt/odb/qt/basic/basic-mssql.options new file mode 100644 index 0000000..2234df5 --- /dev/null +++ b/libodb-qt/odb/qt/basic/basic-mssql.options @@ -0,0 +1,13 @@ +# file : odb/qt/basic/basic-mssql.options +# license : GNU GPL v2; see accompanying LICENSE file + +--profile qt/version + +# Include the default mapping in prologue instead of epilogue to +# allow the user to override the default mapping. +# +--odb-prologue '#include ' + +--hxx-prologue '#include ' +--hxx-prologue '#include ' +--hxx-prologue '#include ' diff --git a/libodb-qt/odb/qt/basic/basic-mysql.options b/libodb-qt/odb/qt/basic/basic-mysql.options new file mode 100644 index 0000000..d049f4e --- /dev/null +++ b/libodb-qt/odb/qt/basic/basic-mysql.options @@ -0,0 +1,13 @@ +# file : odb/qt/basic/basic-mysql.options +# license : GNU GPL v2; see accompanying LICENSE file + +--profile qt/version + +# Include the default mapping in prologue instead of epilogue to +# allow the user to override the default mapping. +# +--odb-prologue '#include ' + +--hxx-prologue '#include ' +--hxx-prologue '#include ' +--hxx-prologue '#include ' diff --git a/libodb-qt/odb/qt/basic/basic-oracle.options b/libodb-qt/odb/qt/basic/basic-oracle.options new file mode 100644 index 0000000..60ef9d0 --- /dev/null +++ b/libodb-qt/odb/qt/basic/basic-oracle.options @@ -0,0 +1,13 @@ +# file : odb/qt/basic/basic-oracle.options +# license : GNU GPL v2; see accompanying LICENSE file + +--profile qt/version + +# Include the default mapping in prologue instead of epilogue to +# allow the user to override the default mapping. +# +--odb-prologue '#include ' + +--hxx-prologue '#include ' +--hxx-prologue '#include ' +--hxx-prologue '#include ' diff --git a/libodb-qt/odb/qt/basic/basic-pgsql.options b/libodb-qt/odb/qt/basic/basic-pgsql.options new file mode 100644 index 0000000..6f0dc6e --- /dev/null +++ b/libodb-qt/odb/qt/basic/basic-pgsql.options @@ -0,0 +1,13 @@ +# file : odb/qt/basic/basic-pgsql.options +# license : GNU GPL v2; see accompanying LICENSE file + +--profile qt/version + +# Include the default mapping in prologue instead of epilogue to +# allow the user to override the default mapping. +# +--odb-prologue '#include ' + +--hxx-prologue '#include ' +--hxx-prologue '#include ' +--hxx-prologue '#include ' diff --git a/libodb-qt/odb/qt/basic/basic-sqlite.options b/libodb-qt/odb/qt/basic/basic-sqlite.options new file mode 100644 index 0000000..c64e37c --- /dev/null +++ b/libodb-qt/odb/qt/basic/basic-sqlite.options @@ -0,0 +1,13 @@ +# file : odb/qt/basic/basic-sqlite.options +# license : GNU GPL v2; see accompanying LICENSE file + +--profile qt/version + +# Include the default mapping in prologue instead of epilogue to +# allow the user to override the default mapping. +# +--odb-prologue '#include ' + +--hxx-prologue '#include ' +--hxx-prologue '#include ' +--hxx-prologue '#include ' diff --git a/libodb-qt/odb/qt/basic/mssql/default-mapping.hxx b/libodb-qt/odb/qt/basic/mssql/default-mapping.hxx new file mode 100644 index 0000000..19fd43b --- /dev/null +++ b/libodb-qt/odb/qt/basic/mssql/default-mapping.hxx @@ -0,0 +1,29 @@ +// file : odb/qt/basic/mssql/default-mapping.hxx +// license : GNU GPL v2; see accompanying LICENSE file + +#ifndef ODB_QT_BASIC_MSSQL_DEFAULT_MAPPING_HXX +#define ODB_QT_BASIC_MSSQL_DEFAULT_MAPPING_HXX + +#include +#include +#include + +// By default map QString to SQL Server VARCHAR(512) for non-id members +// and to VARCHAR(256) for id members (the same as the default mapping +// for std::string). Allow NULL values by default as QString provides +// a null representation. +// +#pragma db value(QString) type("VARCHAR(512)") id_type("VARCHAR(256)") null + +// By default map QByteArray to SQL Server VARBINARY(max). Allow NULL +// values by default as QByteArray provides a null representation. +// +#pragma db value(QByteArray) type("VARBINARY(max)") null + +// By default map QUuid to SQL Server UNIQUEIDENTIFIER and use NULL to +// represent null UUIDs. If NULL is disabled (e.g., at the member level), +// then we store the null UUID (i.e., all bytes are zero). +// +#pragma db value(QUuid) type("UNIQUEIDENTIFIER") null + +#endif // ODB_QT_BASIC_MSSQL_DEFAULT_MAPPING_HXX diff --git a/libodb-qt/odb/qt/basic/mssql/qbyte-array-traits.hxx b/libodb-qt/odb/qt/basic/mssql/qbyte-array-traits.hxx new file mode 100644 index 0000000..8047691 --- /dev/null +++ b/libodb-qt/odb/qt/basic/mssql/qbyte-array-traits.hxx @@ -0,0 +1,177 @@ +// file : odb/qt/basic/mssql/qbyte-array-traits.hxx +// license : GNU GPL v2; see accompanying LICENSE file + +#ifndef ODB_QT_BASIC_MSSQL_QBYTE_ARRAY_TRAITS_HXX +#define ODB_QT_BASIC_MSSQL_QBYTE_ARRAY_TRAITS_HXX + +#include + +#include // std::memcpy +#include // std::size_t +#include + +#include + +#include + +namespace odb +{ + namespace mssql + { + template <> + struct default_value_traits + { + typedef QByteArray value_type; + typedef QByteArray query_type; + typedef char* image_type; + + static void + set_value (QByteArray& v, const char* b, std::size_t n, bool is_null) + { + if (is_null) + v = QByteArray (); + else + { + // Note that we cannot use replace() here since a suitable + // overload was only added in Qt 4.7. + // + v.resize (static_cast (n)); + std::memcpy (v.data (), b, n); + } + } + + static void + set_image (char* b, + std::size_t c, + std::size_t& n, + bool& is_null, + const QByteArray& v) + { + if (v.isNull ()) + is_null = true; + else + { + is_null = false; + n = static_cast (v.size ()); + + if (n > c) + n = c; + + std::memcpy (b, v.constData (), n); + } + } + }; + + template <> + struct default_value_traits + { + typedef QByteArray value_type; + typedef QByteArray query_type; + typedef long_callback image_type; + + static void + set_value (QByteArray& v, + result_callback_type& cb, + void*& context) + { + cb = &result_callback; + context = &v; + } + + static void + set_image (param_callback_type& cb, + const void*& context, + bool& is_null, + const QByteArray& v) + { + if (v.isNull ()) + is_null = true; + else + { + is_null = false; + cb = ¶m_callback; + context = &v; + } + } + + static void + param_callback (const void* context, + std::size_t*, + const void** buffer, + std::size_t* size, + chunk_type* chunk, + void*, + std::size_t) + { + const QByteArray& v (*static_cast (context)); + + *buffer = v.constData (); + *size = static_cast (v.size ()); + *chunk = chunk_one; + } + + static void + result_callback (void* context, + std::size_t*, + void** buffer, + std::size_t* size, + chunk_type chunk, + std::size_t size_left, + void*, + std::size_t) + { + QByteArray& v (*static_cast (context)); + + switch (chunk) + { + case chunk_null: + { + v = QByteArray (); + break; + } + case chunk_one: + { + v.clear (); + break; + } + case chunk_first: + { + // The Native Client ODBC driver seems to always be able to + // return the total size. This makes things simple and + // efficient. + // + assert (size_left != 0); + + v.resize (static_cast (size_left)); + *buffer = v.data (); + *size = size_left; + break; + } + case chunk_next: + { + // We should never get here. + // + assert (false); + break; + } + case chunk_last: + { + // Nothing to do here. The array is already of the correct size + // and should contain the data. + break; + } + } + } + }; + + template <> + struct default_type_traits + { + static const database_type_id db_type_id = id_long_binary; + }; + } +} + +#include + +#endif // ODB_QT_BASIC_MSSQL_QBYTE_ARRAY_TRAITS_HXX diff --git a/libodb-qt/odb/qt/basic/mssql/qstring-traits.hxx b/libodb-qt/odb/qt/basic/mssql/qstring-traits.hxx new file mode 100644 index 0000000..779120e --- /dev/null +++ b/libodb-qt/odb/qt/basic/mssql/qstring-traits.hxx @@ -0,0 +1,372 @@ +// file : odb/qt/basic/mssql/qstring-traits.hxx +// license : GNU GPL v2; see accompanying LICENSE file + +#ifndef ODB_QT_BASIC_MSSQL_QSTRING_TRAITS_HXX +#define ODB_QT_BASIC_MSSQL_QSTRING_TRAITS_HXX + +#include + +#include // std::memcpy +#include // std::size_t +#include + +#include + +#include + +namespace odb +{ + namespace mssql + { + template <> + struct default_value_traits + { + typedef QString value_type; + typedef QString query_type; + typedef char* image_type; + + static void + set_value (QString& v, + const char* b, + std::size_t n, + bool is_null) + { + if (is_null) + v = QString (); + else + // On Windows the string data is in Windows code page. On Linux + // it is always UTF-8. + // +#ifdef _WIN32 + v = QString::fromLocal8Bit (b, static_cast (n)); +#else + v = QString::fromUtf8 (b, static_cast (n)); +#endif + } + + static void + set_image (char* b, + std::size_t c, + std::size_t& n, + bool& is_null, + const QString& v) + { + if (v.isNull ()) + is_null = true; + else + { + is_null = false; + +#ifdef _WIN32 + const QByteArray& a (v.toLocal8Bit ()); +#else + const QByteArray& a (v.toUtf8 ()); +#endif + n = static_cast (a.size ()); + + if (n > c) + n = c; + + std::memcpy (b, a.constData (), n); + } + } + }; + + template <> + struct default_value_traits + { + typedef QString value_type; + typedef QString query_type; + typedef ucs2_char* image_type; + + static void + set_value (QString& v, + const ucs2_char* b, + std::size_t n, + bool is_null) + { + if (is_null) + v = QString (); + else + { + // Note that we cannot use replace() here since a suitable + // overload was only added in Qt 4.7. + // + v.resize (static_cast (n)); + std::memcpy (v.data (), b, n * 2); + } + } + + static void + set_image (ucs2_char* b, + std::size_t c, + std::size_t& n, + bool& is_null, + const QString& v) + { + if (v.isNull ()) + is_null = true; + else + { + is_null = false; + n = static_cast (v.size ()); + + if (n > c) + n = c; + + std::memcpy (b, v.constData (), n * 2); + } + } + }; + + template <> + struct default_value_traits + { + typedef QString value_type; + typedef QString query_type; + typedef long_callback image_type; + + static void + set_value (QString& v, + result_callback_type& cb, + void*& context) + { + cb = &result_callback; + context = &v; + } + + static void + set_image (param_callback_type& cb, + const void*& context, + bool& is_null, + const QString& v) + { + if (v.isNull ()) + is_null = true; + else + { + is_null = false; + cb = ¶m_callback; + context = &v; + } + } + + static void + param_callback (const void* context, + std::size_t* position, + const void** buffer, + std::size_t* size, + chunk_type* chunk, + void* tmp_buf, + std::size_t tmp_capacity) + { + const QString& s (*static_cast (context)); + +#ifdef _WIN32 + const QByteArray& v (s.toLocal8Bit ()); +#else + const QByteArray& v (s.toUtf8 ()); +#endif + + *size = static_cast (v.size ()); + + if (*position == 0) + { + if (*size <= tmp_capacity) + *chunk = chunk_one; + else + { + *size = tmp_capacity; + *chunk = chunk_first; + } + } + else + { + *size -= *position; + + if (*size <= tmp_capacity) + *chunk = chunk_last; + else + { + *size = tmp_capacity; + *chunk = chunk_next; + } + } + + //@@ We might split a multi-byte sequence. Microsoft ODBC driver + // doesn't support this. + // + std::memcpy (tmp_buf, v.constData () + *position, *size); + *buffer = tmp_buf; + *position += *size; + } + + static void + result_callback (void* context, + std::size_t*, + void** buffer, + std::size_t* size, + chunk_type chunk, + std::size_t, + void* tmp_buf, + std::size_t tmp_capacity) + { + QString& v (*static_cast (context)); + + switch (chunk) + { + case chunk_null: + { + v = QString (); + break; + } + case chunk_one: + { + v.clear (); + break; + } + case chunk_first: + { + break; + } + case chunk_next: + case chunk_last: + { + // Append the data from the temporary buffer. + // +#ifdef _WIN32 + v += QString::fromLocal8Bit (static_cast (tmp_buf), + static_cast (*size)); +#else + v += QString::fromUtf8 (static_cast (tmp_buf), + static_cast (*size)); +#endif + break; + } + } + + if (chunk == chunk_first || chunk == chunk_next) + { + *buffer = tmp_buf; + *size = tmp_capacity; + } + } + }; + + template <> + struct default_value_traits + { + typedef QString value_type; + typedef QString query_type; + typedef long_callback image_type; + + static void + set_value (QString& v, + result_callback_type& cb, + void*& context) + { + cb = &result_callback; + context = &v; + } + + static void + set_image (param_callback_type& cb, + const void*& context, + bool& is_null, + const QString& v) + { + if (v.isNull ()) + is_null = true; + else + { + is_null = false; + cb = ¶m_callback; + context = &v; + } + } + + static void + param_callback (const void* context, + std::size_t*, + const void** buffer, + std::size_t* size, + chunk_type* chunk, + void*, + std::size_t) + { + const QString& v (*static_cast (context)); + + *buffer = v.constData (); + *size = static_cast (v.size ()) * 2; + *chunk = chunk_one; + } + + static void + result_callback (void* context, + std::size_t*, + void** buffer, + std::size_t* size, + chunk_type chunk, + std::size_t size_left, + void*, + std::size_t) + { + QString& v (*static_cast (context)); + + switch (chunk) + { + case chunk_null: + { + v = QString (); + break; + } + case chunk_one: + { + v.clear (); + break; + } + case chunk_first: + { + // The Native Client ODBC driver seems to always be able to + // return the total size. This makes things simple and + // efficient. + // + assert (size_left != 0); + + size_left /= 2; // Convert to characters. + size_left++; // One extra for the null terminator. + + v.resize (static_cast (size_left)); + *buffer = v.data (); + *size = size_left * 2; // In bytes. + break; + } + case chunk_next: + { + // We should never get here. + // + assert (false); + break; + } + case chunk_last: + { + // Get rid of the null terminator. + // + v.resize (static_cast (*size / 2)); + break; + } + } + } + }; + + template <> + struct default_type_traits + { + static const database_type_id db_type_id = id_long_string; + }; + } +} + +#include + +#endif // ODB_QT_BASIC_MSSQL_QSTRING_TRAITS_HXX diff --git a/libodb-qt/odb/qt/basic/mssql/quuid-traits.hxx b/libodb-qt/odb/qt/basic/mssql/quuid-traits.hxx new file mode 100644 index 0000000..d65b80f --- /dev/null +++ b/libodb-qt/odb/qt/basic/mssql/quuid-traits.hxx @@ -0,0 +1,58 @@ +// file : odb/qt/basic/mssql/uuid-traits.hxx +// license : GNU GPL v2; see accompanying LICENSE file + +#ifndef ODB_QT_BASIC_MSSQL_UUID_TRAITS_HXX +#define ODB_QT_BASIC_MSSQL_UUID_TRAITS_HXX + +#include + +#include // std::memcpy + +#include + +#include + +namespace odb +{ + namespace mssql + { + template <> + class default_value_traits + { + public: + typedef QUuid value_type; + typedef value_type query_type; + typedef uniqueidentifier image_type; + + static void + set_value (value_type& v, const uniqueidentifier& i, bool is_null) + { + if (!is_null) + std::memcpy (&v.data1, &i, 16); + else + v = QUuid (); + } + + static void + set_image (uniqueidentifier& i, bool& is_null, const value_type& v) + { + // If we can, store nil as NULL. Otherwise, store it as a value. + // + is_null = is_null && v.isNull (); + + if (!is_null) + std::memcpy (&i, &v.data1, 16); + } + }; + + template <> + struct default_type_traits + { + static const database_type_id db_type_id = id_uniqueidentifier; + }; + } +} + +#include + +#endif // ODB_QT_BASIC_MSSQL_UUID_TRAITS_HXX diff --git a/libodb-qt/odb/qt/basic/mysql/default-mapping.hxx b/libodb-qt/odb/qt/basic/mysql/default-mapping.hxx new file mode 100644 index 0000000..996895f --- /dev/null +++ b/libodb-qt/odb/qt/basic/mysql/default-mapping.hxx @@ -0,0 +1,28 @@ +// file : odb/qt/basic/mysql/default-mapping.hxx +// license : GNU GPL v2; see accompanying LICENSE file + +#ifndef ODB_QT_BASIC_MYSQL_DEFAULT_MAPPING_HXX +#define ODB_QT_BASIC_MYSQL_DEFAULT_MAPPING_HXX + +#include +#include +#include + +// Map QString to MySQL TEXT for non-id and to VARCHAR(128) for id members. +// MySQL cannot have primary key of the TEXT type. Allow NULL values by +// default as QString provides a null representation. +// +#pragma db value(QString) type("TEXT") id_type("VARCHAR(128)") null + +// Map QByteArray to MySQL BLOB by default. Allow NULL values by default as +// QByteArray provides a null representation. +// +#pragma db value(QByteArray) type("BLOB") null + +// By default map QUuid to MySQL BINARY(16) and use NULL to represent null +// UUIDs. If NULL is disabled (e.g., at the member level), then we store +// the null UUID (i.e., all bytes are zero). +// +#pragma db value(QUuid) type("BINARY(16)") null + +#endif // ODB_QT_BASIC_MYSQL_DEFAULT_MAPPING_HXX diff --git a/libodb-qt/odb/qt/basic/mysql/qbyte-array-traits.hxx b/libodb-qt/odb/qt/basic/mysql/qbyte-array-traits.hxx new file mode 100644 index 0000000..bfcfc69 --- /dev/null +++ b/libodb-qt/odb/qt/basic/mysql/qbyte-array-traits.hxx @@ -0,0 +1,78 @@ +// file : odb/qt/basic/mysql/qbyte-array-traits.hxx +// license : GNU GPL v2; see accompanying LICENSE file + +#ifndef ODB_QT_BASIC_MYSQL_QBYTE_ARRAY_TRAITS_HXX +#define ODB_QT_BASIC_MYSQL_QBYTE_ARRAY_TRAITS_HXX + +#include + +#include // std::memcpy +#include // std::size_t + +#include + +#include +#include + +namespace odb +{ + namespace mysql + { + template <> + struct default_value_traits + { + typedef QByteArray value_type; + typedef QByteArray query_type; + typedef details::buffer image_type; + + static void + set_value (QByteArray& v, + const details::buffer& b, + std::size_t n, + bool is_null) + { + if (is_null) + v = QByteArray (); + else + { + // Note that we cannot use replace() here since a suitable + // overload was only added in Qt 4.7. + // + v.resize (static_cast (n)); + std::memcpy (v.data (), b.data (), n); + } + } + + static void + set_image (details::buffer& b, + std::size_t& n, + bool& is_null, + const QByteArray& v) + { + if (v.isNull ()) + is_null = true; + else + { + is_null = false; + + n = static_cast (v.size ()); + + if (n > b.capacity ()) + b.capacity (n); + + std::memcpy (b.data (), v.data (), n); + } + } + }; + + template <> + struct default_type_traits + { + static const database_type_id db_type_id = id_blob; + }; + } +} + +#include + +#endif // ODB_QT_BASIC_MYSQL_QBYTE_ARRAY_TRAITS_HXX diff --git a/libodb-qt/odb/qt/basic/mysql/qstring-traits.hxx b/libodb-qt/odb/qt/basic/mysql/qstring-traits.hxx new file mode 100644 index 0000000..6a5f315 --- /dev/null +++ b/libodb-qt/odb/qt/basic/mysql/qstring-traits.hxx @@ -0,0 +1,93 @@ +// file : odb/qt/basic/mysql/qstring-traits.hxx +// license : GNU GPL v2; see accompanying LICENSE file + +#ifndef ODB_QT_BASIC_MYSQL_QSTRING_TRAITS_HXX +#define ODB_QT_BASIC_MYSQL_QSTRING_TRAITS_HXX + +#include + +#include // std::memcpy +#include // std::size_t + +#include + +#include +#include + +namespace odb +{ + namespace mysql + { + class qstring_value_traits + { + public: + typedef QString value_type; + typedef QString query_type; + typedef details::buffer image_type; + + static void + set_value (QString& v, + const details::buffer& b, + std::size_t n, + bool is_null) + { + if (is_null) + v = QString (); + else + v = QString::fromUtf8 (b.data (), static_cast (n)); + } + + static void + set_image (details::buffer& b, + std::size_t& n, + bool& is_null, + const QString& v) + { + if (v.isNull ()) + is_null = true; + else + { + is_null = false; + + const QByteArray& a (v.toUtf8 ()); + n = static_cast (a.size ()); + + if (n > b.capacity ()) + b.capacity (n); + + std::memcpy (b.data (), a.data (), n); + } + } + }; + + template <> + struct default_value_traits: qstring_value_traits + { + }; + + template <> + struct default_value_traits: qstring_value_traits + { + }; + + template <> + struct default_value_traits: qstring_value_traits + { + }; + + template <> + struct default_value_traits: qstring_value_traits + { + }; + + template <> + struct default_type_traits + { + static const database_type_id db_type_id = id_string; + }; + } +} + +#include + +#endif // ODB_QT_BASIC_MYSQL_QSTRING_TRAITS_HXX diff --git a/libodb-qt/odb/qt/basic/mysql/quuid-traits.hxx b/libodb-qt/odb/qt/basic/mysql/quuid-traits.hxx new file mode 100644 index 0000000..c672ee8 --- /dev/null +++ b/libodb-qt/odb/qt/basic/mysql/quuid-traits.hxx @@ -0,0 +1,74 @@ +// file : odb/qt/basic/mysql/uuid-traits.hxx +// license : GNU GPL v2; see accompanying LICENSE file + +#ifndef ODB_QT_BASIC_MYSQL_UUID_TRAITS_HXX +#define ODB_QT_BASIC_MYSQL_UUID_TRAITS_HXX + +#include + +#include // std::memcpy +#include + +#include + +#include + +namespace odb +{ + namespace mysql + { + template <> + struct default_value_traits + { + typedef QUuid value_type; + typedef value_type query_type; + typedef details::buffer image_type; + + static void + set_value (value_type& v, + const details::buffer& b, + std::size_t n, + bool is_null) + { + if (!is_null) + { + assert (n == 16); + std::memcpy (&v.data1, b.data (), 16); + } + else + v = QUuid (); + } + + static void + set_image (details::buffer& b, + std::size_t& n, + bool& is_null, + const value_type& v) + { + // If we can, store nil as NULL. Otherwise, store it as a value. + // + is_null = is_null && v.isNull (); + + if (!is_null) + { + n = 16; + + if (n > b.capacity ()) + b.capacity (n); + + std::memcpy (b.data (), &v.data1, n); + } + } + }; + + template <> + struct default_type_traits + { + static const database_type_id db_type_id = id_blob; + }; + } +} + +#include + +#endif // ODB_QT_BASIC_MYSQL_UUID_TRAITS_HXX diff --git a/libodb-qt/odb/qt/basic/oracle/default-mapping.hxx b/libodb-qt/odb/qt/basic/oracle/default-mapping.hxx new file mode 100644 index 0000000..8d72206 --- /dev/null +++ b/libodb-qt/odb/qt/basic/oracle/default-mapping.hxx @@ -0,0 +1,27 @@ +// file : odb/qt/basic/oracle/default-mapping.hxx +// license : GNU GPL v2; see accompanying LICENSE file + +#ifndef ODB_QT_BASIC_ORACLE_DEFAULT_MAPPING_HXX +#define ODB_QT_BASIC_ORACLE_DEFAULT_MAPPING_HXX + +#include +#include +#include + +// Map QString to Oracle VARCHAR2 by default. Allow NULL values by default as +// QString provides a null representation. +// +#pragma db value(QString) type("VARCHAR2(512)") null + +// Map QByteArray to Oracle BLOB by default. Allow NULL values by default as +// QByteArray provides a null representation. +// +#pragma db value(QByteArray) type("BLOB") null + +// By default map QUuid to Oracle RAW(16) and use NULL to represent null +// UUIDs. If NULL is disabled (e.g., at the member level), then we store +// the null UUID (i.e., all bytes are zero). +// +#pragma db value(QUuid) type("RAW(16)") null + +#endif // ODB_QT_BASIC_ORACLE_DEFAULT_MAPPING_HXX diff --git a/libodb-qt/odb/qt/basic/oracle/qbyte-array-traits.hxx b/libodb-qt/odb/qt/basic/oracle/qbyte-array-traits.hxx new file mode 100644 index 0000000..6979cc9 --- /dev/null +++ b/libodb-qt/odb/qt/basic/oracle/qbyte-array-traits.hxx @@ -0,0 +1,167 @@ +// file : odb/qt/basic/oracle/qbyte-array-traits.hxx +// license : GNU GPL v2; see accompanying LICENSE file + +#ifndef ODB_QT_BASIC_ORACLE_QBYTE_ARRAY_TRAITS_HXX +#define ODB_QT_BASIC_ORACLE_QBYTE_ARRAY_TRAITS_HXX + +#include + +#include // std::memcpy +#include // std::size_t + +#include + +#include + +namespace odb +{ + namespace oracle + { + template <> + struct default_value_traits + { + typedef QByteArray value_type; + typedef QByteArray query_type; + typedef char* image_type; + + static void + set_value (QByteArray& v, + const char* b, + std::size_t n, + bool is_null) + { + if (is_null) + v = QByteArray (); + else + { + // Note that we cannot use replace() here since a suitable + // overload was only added in Qt 4.7. + // + v.resize (static_cast (n)); + std::memcpy (v.data (), b, n); + } + } + + static void + set_image (char* b, + std::size_t c, + std::size_t& n, + bool& is_null, + const QByteArray& v) + { + if (v.isNull ()) + is_null = true; + else + { + is_null = false; + + n = static_cast (v.size ()); + + if (n > c) + n = c; + + std::memcpy (b, v.constData (), n); + } + } + }; + + template <> + struct default_value_traits + { + typedef QByteArray value_type; + typedef QByteArray query_type; + typedef lob_callback image_type; + + static void + set_value (QByteArray& v, + result_callback_type& cb, + void*& context, + bool is_null) + { + if (is_null) + v = QByteArray (); + else + { + cb = &result_callback; + context = &v; + } + } + + static void + set_image (param_callback_type& cb, + const void*& context, + bool& is_null, + const QByteArray& v) + { + if (v.isNull ()) + is_null = true; + else + { + is_null = false; + cb = ¶m_callback; + context = &v; + } + } + + static bool + result_callback (void* context, + ub4*, + void* b, + ub4 s, + chunk_position p) + { + QByteArray& v (*static_cast (context)); + + switch (p) + { + case chunk_one: + case chunk_first: + { + v.clear (); + + // Falling through. + } + case chunk_next: + case chunk_last: + { + v.append (static_cast (b), static_cast (s)); + break; + } + } + + return true; + } + + static bool + param_callback (const void* context, + ub4*, + const void** b, + ub4* s, + chunk_position* p, + void*, + ub4) + { + const QByteArray& v (*static_cast (context)); + + *p = chunk_one; + *s = static_cast (v.size ()); + *b = v.constData (); + + return true; + } + }; + + template <> + struct default_type_traits + { + // Allow use of QByteArray in query expressions by default by specifying + // the default type id as RAW. + // + static const database_type_id db_type_id = id_raw; + }; + } +} + +#include + +#endif // ODB_QT_BASIC_ORACLE_QBYTE_ARRAY_TRAITS_HXX diff --git a/libodb-qt/odb/qt/basic/oracle/qstring-traits.hxx b/libodb-qt/odb/qt/basic/oracle/qstring-traits.hxx new file mode 100644 index 0000000..418d30e --- /dev/null +++ b/libodb-qt/odb/qt/basic/oracle/qstring-traits.hxx @@ -0,0 +1,206 @@ +// file : odb/qt/basic/oracle/qstring-traits.hxx +// license : GNU GPL v2; see accompanying LICENSE file + +#ifndef ODB_QT_BASIC_ORACLE_QSTRING_TRAITS_HXX +#define ODB_QT_BASIC_ORACLE_QSTRING_TRAITS_HXX + +#include + +#include // std::memcpy +#include // std::size_t + +#include + +#include + +namespace odb +{ + namespace oracle + { + struct qstring_value_traits + { + public: + typedef QString value_type; + typedef QString query_type; + typedef char* image_type; + + static void + set_value (QString& v, + const char* b, + std::size_t n, + bool is_null) + { + if (is_null) + v = QString (); + else + v = QString::fromUtf8 (b, static_cast (n)); + } + + static void + set_image (char* b, + std::size_t c, + std::size_t& n, + bool& is_null, + const QString& v) + { + if (v.isNull ()) + is_null = true; + else + { + is_null = false; + + const QByteArray& a (v.toUtf8 ()); + + n = static_cast (a.size ()); + + if (n > c) + n = c; + + std::memcpy (b, a.constData (), n); + } + } + }; + + template <> + struct default_value_traits : qstring_value_traits + { + }; + + template <> + struct default_value_traits : qstring_value_traits + { + }; + + class qstring_lob_value_traits + { + public: + typedef QString value_type; + typedef QString query_type; + typedef lob_callback image_type; + + static void + set_value (QString& v, + result_callback_type& cb, + void*& context, + bool is_null) + { + if (is_null) + v = QString (); + else + { + cb = &result_callback; + context = &v; + } + } + + static void + set_image (param_callback_type& cb, + const void*& context, + bool& is_null, + const QString& v) + { + if (v.isNull ()) + is_null = true; + else + { + is_null = false; + cb = ¶m_callback; + context = &v; + } + } + + static bool + result_callback (void* context, + ub4*, + void* b, + ub4 s, + chunk_position p) + { + QString& v (*static_cast (context)); + + switch (p) + { + case chunk_one: + case chunk_first: + { + v.clear (); + + // Falling through. + } + case chunk_next: + case chunk_last: + { + v += QString::fromUtf8(static_cast (b), + static_cast (s)); + break; + } + } + + return true; + } + + static bool + param_callback (const void* context, + ub4* position_context, + const void** b, + ub4* s, + chunk_position* p, + void* temp_buffer, + ub4 capacity) + { + const QByteArray& v (static_cast (context)->toUtf8 ()); + + *s = static_cast (v.size ()); + + if (*position_context == 0) + { + if (*s <= capacity) + *p = chunk_one; + else + { + *s = capacity; + *p = chunk_first; + } + } + else + { + *s -= *position_context; + + if (*s <= capacity) + *p = chunk_last; + else + { + *s = capacity; + *p = chunk_next; + } + } + + std::memcpy (temp_buffer, v.constData () + *position_context, *s); + *b = temp_buffer; + *position_context += *s; + + return true; + } + }; + + template <> + struct default_value_traits: qstring_lob_value_traits + { + }; + + template <> + struct default_value_traits: qstring_lob_value_traits + { + }; + + template <> + struct default_type_traits + { + static const database_type_id db_type_id = id_string; + }; + } +} + +#include + +#endif // ODB_QT_BASIC_ORACLE_QSTRING_TRAITS_HXX diff --git a/libodb-qt/odb/qt/basic/oracle/quuid-traits.hxx b/libodb-qt/odb/qt/basic/oracle/quuid-traits.hxx new file mode 100644 index 0000000..5f8041e --- /dev/null +++ b/libodb-qt/odb/qt/basic/oracle/quuid-traits.hxx @@ -0,0 +1,70 @@ +// file : odb/qt/basic/oracle/uuid-traits.hxx +// license : GNU GPL v2; see accompanying LICENSE file + +#ifndef ODB_QT_BASIC_ORACLE_UUID_TRAITS_HXX +#define ODB_QT_BASIC_ORACLE_UUID_TRAITS_HXX + +#include + +#include // std::memcpy +#include + +#include + +#include + +namespace odb +{ + namespace oracle + { + template <> + struct default_value_traits + { + public: + typedef QUuid value_type; + typedef value_type query_type; + typedef char* image_type; + + static void + set_value (value_type& v, const char* b, std::size_t n, bool is_null) + { + if (!is_null) + { + assert (n == 16); + std::memcpy (&v.data1, b, 16); + } + else + v = QUuid (); + } + + static void + set_image (char* b, + std::size_t c, + std::size_t& n, + bool& is_null, + const value_type& v) + { + // If we can, store nil as NULL. Otherwise, store it as a value. + // + is_null = is_null && v.isNull (); + + if (!is_null) + { + n = 16; + assert (c >= n); + std::memcpy (b, &v.data1, n); + } + } + }; + + template <> + struct default_type_traits + { + static const database_type_id db_type_id = id_raw; + }; + } +} + +#include + +#endif // ODB_QT_BASIC_ORACLE_UUID_TRAITS_HXX diff --git a/libodb-qt/odb/qt/basic/pgsql/default-mapping.hxx b/libodb-qt/odb/qt/basic/pgsql/default-mapping.hxx new file mode 100644 index 0000000..13dbeb8 --- /dev/null +++ b/libodb-qt/odb/qt/basic/pgsql/default-mapping.hxx @@ -0,0 +1,27 @@ +// file : odb/qt/basic/pgsql/default-mapping.hxx +// license : GNU GPL v2; see accompanying LICENSE file + +#ifndef ODB_QT_BASIC_PGSQL_DEFAULT_MAPPING_HXX +#define ODB_QT_BASIC_PGSQL_DEFAULT_MAPPING_HXX + +#include +#include +#include + +// Map QString to PostgreSQL TEXT by default. Allow NULL values by default as +// QString provides a null representation. +// +#pragma db value(QString) type("TEXT") null + +// Map QByteArray to PostgreSQL BYTEA by default. Allow NULL values by default +// as QByteArray provides a null representation. +// +#pragma db value(QByteArray) type("BYTEA") null + +// By default map QUuid to PostgreSQL UUID and use NULL to represent null +// UUIDs. If NULL is disabled (e.g., at the member level), then we store +// the null UUID (i.e., all bytes are zero). +// +#pragma db value(QUuid) type("UUID") null + +#endif // ODB_QT_BASIC_PGSQL_DEFAULT_MAPPING_HXX diff --git a/libodb-qt/odb/qt/basic/pgsql/qbyte-array-traits.hxx b/libodb-qt/odb/qt/basic/pgsql/qbyte-array-traits.hxx new file mode 100644 index 0000000..3c3c496 --- /dev/null +++ b/libodb-qt/odb/qt/basic/pgsql/qbyte-array-traits.hxx @@ -0,0 +1,77 @@ +// file : odb/qt/basic/pgsql/qbyte-array-traits.hxx +// license : GNU GPL v2; see accompanying LICENSE file + +#ifndef ODB_QT_BASIC_PGSQL_QBYTE_ARRAY_TRAITS_HXX +#define ODB_QT_BASIC_PGSQL_QBYTE_ARRAY_TRAITS_HXX + +#include + +#include // std::memcpy +#include // std::size_t + +#include + +#include +#include + +namespace odb +{ + namespace pgsql + { + template <> + struct default_value_traits + { + typedef QByteArray value_type; + typedef QByteArray query_type; + typedef details::buffer image_type; + + static void + set_value (QByteArray& v, + const details::buffer& b, + std::size_t n, + bool is_null) + { + if (is_null) + v = QByteArray (); + else + { + // Note that we cannot use replace() here since a suitable + // overload was only added in Qt 4.7. + // + v.resize (static_cast (n)); + std::memcpy (v.data (), b.data (), n); + } + } + + static void + set_image (details::buffer& b, + std::size_t& n, + bool& is_null, + const QByteArray& v) + { + if (v.isNull ()) + is_null = true; + else + { + is_null = false; + + n = static_cast (v.size ()); + if (n > b.capacity ()) + b.capacity (n); + + std::memcpy (b.data (), v.data (), n); + } + } + }; + + template <> + struct default_type_traits + { + static const database_type_id db_type_id = id_bytea; + }; + } +} + +#include + +#endif // ODB_QT_BASIC_PGSQL_QBYTE_ARRAY_TRAITS_HXX diff --git a/libodb-qt/odb/qt/basic/pgsql/qstring-traits.hxx b/libodb-qt/odb/qt/basic/pgsql/qstring-traits.hxx new file mode 100644 index 0000000..f1ab53c --- /dev/null +++ b/libodb-qt/odb/qt/basic/pgsql/qstring-traits.hxx @@ -0,0 +1,74 @@ +// file : odb/qt/basic/pgsql/qstring-traits.hxx +// license : GNU GPL v2; see accompanying LICENSE file + +#ifndef ODB_QT_BASIC_PGSQL_QSTRING_TRAITS_HXX +#define ODB_QT_BASIC_PGSQL_QSTRING_TRAITS_HXX + +#include + +#include // std::memcpy +#include // std::size_t + +#include + +#include +#include + +namespace odb +{ + namespace pgsql + { + template <> + struct default_value_traits + { + public: + typedef QString value_type; + typedef QString query_type; + typedef details::buffer image_type; + + static void + set_value (QString& v, + const details::buffer& b, + std::size_t n, + bool is_null) + { + if (is_null) + v = QString (); + else + v = QString::fromUtf8 (b.data (), static_cast (n)); + } + + static void + set_image (details::buffer& b, + std::size_t& n, + bool& is_null, + const QString& v) + { + if (v.isNull ()) + is_null = true; + else + { + is_null = false; + + const QByteArray& a (v.toUtf8 ()); + n = static_cast (a.size ()); + + if (n > b.capacity ()) + b.capacity (n); + + std::memcpy (b.data (), a.data (), n); + } + } + }; + + template <> + struct default_type_traits + { + static const database_type_id db_type_id = id_string; + }; + } +} + +#include + +#endif // ODB_QT_BASIC_PGSQL_QSTRING_TRAITS_HXX diff --git a/libodb-qt/odb/qt/basic/pgsql/quuid-traits.hxx b/libodb-qt/odb/qt/basic/pgsql/quuid-traits.hxx new file mode 100644 index 0000000..5999b7e --- /dev/null +++ b/libodb-qt/odb/qt/basic/pgsql/quuid-traits.hxx @@ -0,0 +1,65 @@ +// file : odb/qt/basic/pgsql/uuid-traits.hxx +// license : GNU GPL v2; see accompanying LICENSE file + +#ifndef ODB_QT_BASIC_PGSQL_UUID_TRAITS_HXX +#define ODB_QT_BASIC_PGSQL_UUID_TRAITS_HXX + +#include + +#include // std::memcpy + +#include + +#include + +namespace odb +{ + namespace pgsql + { + template <> + class default_value_traits + { + public: + typedef QUuid value_type; + typedef value_type query_type; + typedef unsigned char* image_type; + + // PostgreSQL binary UUID representation is big-endian in the RFC 4122, + // section 4.1.2 order. While Qt provides (since 4.8) to/fromRfc4122(), + // they both incur a memory allocation (by QByteArray) which we could + // avoid, if we did it ourselves. + // + + static void + set_value (value_type& v, const unsigned char* i, bool is_null) + { + if (!is_null) + v = QUuid::fromRfc4122 ( + QByteArray (reinterpret_cast (i), 16)); + else + v = QUuid (); + } + + static void + set_image (unsigned char* i, bool& is_null, const value_type& v) + { + // If we can, store nil as NULL. Otherwise, store it as a value. + // + is_null = is_null && v.isNull (); + + if (!is_null) + std::memcpy (i, v.toRfc4122 ().constData (), 16); + } + }; + + template <> + struct default_type_traits + { + static const database_type_id db_type_id = id_uuid; + }; + } +} + +#include + +#endif // ODB_QT_BASIC_PGSQL_UUID_TRAITS_HXX diff --git a/libodb-qt/odb/qt/basic/sqlite/default-mapping.hxx b/libodb-qt/odb/qt/basic/sqlite/default-mapping.hxx new file mode 100644 index 0000000..7d14a6c --- /dev/null +++ b/libodb-qt/odb/qt/basic/sqlite/default-mapping.hxx @@ -0,0 +1,27 @@ +// file : odb/qt/basic/sqlite/default-mapping.hxx +// license : GNU GPL v2; see accompanying LICENSE file + +#ifndef ODB_QT_BASIC_SQLITE_DEFAULT_MAPPING_HXX +#define ODB_QT_BASIC_SQLITE_DEFAULT_MAPPING_HXX + +#include +#include +#include + +// Map QString to SQLite TEXT by default. Allow NULL values by default as +// QString provides a null representation. +// +#pragma db value(QString) type("TEXT") null + +// Map QByteArray to SQLite BLOB by default. Allow NULL values by default as +// QByteArray provides a null representation. +// +#pragma db value(QByteArray) type("BLOB") null + +// By default map QUuid to SQLite BLOB and use NULL to represent null UUIDs. +// If NULL is disabled (e.g., at the member level), then we store the null +// UUID (i.e., all bytes are zero). +// +#pragma db value(QUuid) type("BLOB") null + +#endif // ODB_QT_BASIC_SQLITE_DEFAULT_MAPPING_HXX diff --git a/libodb-qt/odb/qt/basic/sqlite/qbyte-array-traits.hxx b/libodb-qt/odb/qt/basic/sqlite/qbyte-array-traits.hxx new file mode 100644 index 0000000..8a26bb1 --- /dev/null +++ b/libodb-qt/odb/qt/basic/sqlite/qbyte-array-traits.hxx @@ -0,0 +1,77 @@ +// file : odb/qt/basic/sqlite/qbyte-array-traits.hxx +// license : GNU GPL v2; see accompanying LICENSE file + +#ifndef ODB_QT_BASIC_SQLITE_QBYTE_ARRAY_TRAITS_HXX +#define ODB_QT_BASIC_SQLITE_QBYTE_ARRAY_TRAITS_HXX + +#include + +#include // std::memcpy +#include // std::size_t + +#include + +#include +#include + +namespace odb +{ + namespace sqlite + { + template <> + struct default_value_traits + { + typedef QByteArray value_type; + typedef QByteArray query_type; + typedef details::buffer image_type; + + static void + set_value (QByteArray& v, + const details::buffer& b, + std::size_t n, + bool is_null) + { + if (is_null) + v = QByteArray (); + else + { + // Note that we cannot use replace() here since a suitable + // overload was only added in Qt 4.7. + // + v.resize (static_cast (n)); + std::memcpy (v.data (), b.data (), n); + } + } + + static void + set_image (details::buffer& b, + std::size_t& n, + bool& is_null, + const QByteArray& v) + { + if (v.isNull ()) + is_null = true; + else + { + is_null = false; + + n = static_cast (v.size ()); + if (n > b.capacity ()) + b.capacity (n); + + std::memcpy (b.data (), v.data (), n); + } + } + }; + + template <> + struct default_type_traits + { + static const database_type_id db_type_id = id_blob; + }; + } +} + +#include + +#endif // ODB_QT_BASIC_SQLITE_QBYTE_ARRAY_TRAITS_HXX diff --git a/libodb-qt/odb/qt/basic/sqlite/qstring-traits.hxx b/libodb-qt/odb/qt/basic/sqlite/qstring-traits.hxx new file mode 100644 index 0000000..30a2136 --- /dev/null +++ b/libodb-qt/odb/qt/basic/sqlite/qstring-traits.hxx @@ -0,0 +1,83 @@ +// file : odb/qt/basic/sqlite/qstring-traits.hxx +// license : GNU GPL v2; see accompanying LICENSE file + +#ifndef ODB_QT_BASIC_SQLITE_QSTRING_TRAITS_HXX +#define ODB_QT_BASIC_SQLITE_QSTRING_TRAITS_HXX + +#include + +#include // std::memcpy +#include // std::size_t + +#include + +#include +#include + +namespace odb +{ + namespace sqlite + { + template <> + struct image_traits + { + typedef details::buffer image_type; + + // Use UTF-16 binding for QString. + // + static const bind::buffer_type bind_value = bind::text16; + }; + + template <> + struct default_value_traits + { + public: + typedef QString value_type; + typedef QString query_type; + typedef details::buffer image_type; + + static void + set_value (QString& v, + const details::buffer& b, + std::size_t n, + bool is_null) + { + if (is_null) + v = QString (); + else + v.setUtf16 (reinterpret_cast (b.data ()), + static_cast (n / 2)); // In characters. + } + + static void + set_image (details::buffer& b, + std::size_t& n, + bool& is_null, + const QString& v) + { + if (v.isNull ()) + is_null = true; + else + { + is_null = false; + n = static_cast (v.size ()) * 2; // In bytes. + + if (n > b.capacity ()) + b.capacity (n); + + std::memcpy (b.data (), v.utf16 (), n); + } + } + }; + + template <> + struct default_type_traits + { + static const database_type_id db_type_id = id_text; + }; + } +} + +#include + +#endif // ODB_QT_BASIC_SQLITE_QSTRING_TRAITS_HXX diff --git a/libodb-qt/odb/qt/basic/sqlite/quuid-traits.hxx b/libodb-qt/odb/qt/basic/sqlite/quuid-traits.hxx new file mode 100644 index 0000000..20d4a94 --- /dev/null +++ b/libodb-qt/odb/qt/basic/sqlite/quuid-traits.hxx @@ -0,0 +1,74 @@ +// file : odb/qt/basic/sqlite/uuid-traits.hxx +// license : GNU GPL v2; see accompanying LICENSE file + +#ifndef ODB_QT_BASIC_SQLITE_UUID_TRAITS_HXX +#define ODB_QT_BASIC_SQLITE_UUID_TRAITS_HXX + +#include + +#include // std::memcpy +#include + +#include + +#include + +namespace odb +{ + namespace sqlite + { + template <> + struct default_value_traits + { + typedef QUuid value_type; + typedef value_type query_type; + typedef details::buffer image_type; + + static void + set_value (value_type& v, + const details::buffer& b, + std::size_t n, + bool is_null) + { + if (!is_null) + { + assert (n == 16); + std::memcpy (&v.data1, b.data (), 16); + } + else + v = QUuid (); + } + + static void + set_image (details::buffer& b, + std::size_t& n, + bool& is_null, + const value_type& v) + { + // If we can, store nil as NULL. Otherwise, store it as a value. + // + is_null = is_null && v.isNull (); + + if (!is_null) + { + n = 16; + + if (n > b.capacity ()) + b.capacity (n); + + std::memcpy (b.data (), &v.data1, n); + } + } + }; + + template <> + struct default_type_traits + { + static const database_type_id db_type_id = id_blob; + }; + } +} + +#include + +#endif // ODB_QT_BASIC_SQLITE_UUID_TRAITS_HXX diff --git a/libodb-qt/odb/qt/buildfile b/libodb-qt/odb/qt/buildfile new file mode 100644 index 0000000..63e6c95 --- /dev/null +++ b/libodb-qt/odb/qt/buildfile @@ -0,0 +1,93 @@ +# file : odb/qt/buildfile +# license : GNU GPL v2; see accompanying LICENSE file + +../ +{ + define options: file + options{*}: extension = options + + # Install into the odb/qt/ subdirectory of, say, /usr/include/ + # recreating subdirectories. + # + {hxx ixx txx options}{*}: + { + install = include/odb/ + install.subdirs = true + } + + qt/ + { + import int_libs = libodb%lib{odb} + imp_libs = + + lib{odb-qt}: {hxx ixx txx cxx}{** -version-build2} {hxx}{version-build2} \ + details/build2/{h}{*} \ + options{**} ../options{qt} \ + $imp_libs $int_libs + + # Include the generated version header into the distribution (so that we + # don't pick up an installed one) and don't remove it when cleaning in src + # (so that clean results in a state identical to distributed). + # + hxx{version-build2}: in{version-build2} $src_root/manifest + hxx{version-build2}: + { + dist = true + clean = ($src_root != $out_root) + } + + # Build options. + # + cxx.poptions =+ "-I$out_root" "-I$src_root" -DLIBODB_QT_BUILD2 + + obja{*}: cxx.poptions += -DLIBODB_QT_STATIC_BUILD + objs{*}: cxx.poptions += -DLIBODB_QT_SHARED_BUILD + + # Export options. + # + lib{odb-qt}: + { + cxx.export.poptions = "-I$out_root" "-I$src_root" -DLIBODB_QT_BUILD2 + cxx.export.libs = $int_libs + } + + liba{odb-qt}: cxx.export.poptions += -DLIBODB_QT_STATIC + libs{odb-qt}: cxx.export.poptions += -DLIBODB_QT_SHARED + + # For pre-releases use the complete version to make sure they cannot be + # used in place of another pre-release or the final version. See the + # version module for details on the version.* variable values. + # + if $version.pre_release + lib{odb-qt}: bin.lib.version = @"-$version.project_id" + else + lib{odb-qt}: bin.lib.version = @"-$version.major.$version.minor" + + # Installation tweaks. + # + install_include = [dir_path] include/odb/qt/ + + # We want these to be picked up whether LIBODB_QT_BUILD2 is defined or + # not. + # + hxx{version}@./: install = false + hxx{version-build2}: install = $install_include/version.hxx + hxx{version-build2-stub}@./: install = $install_include/version-build2.hxx + + details/build2/ + { + h{*}: install = false + + if ($cxx.target.system == 'win32-msvc') + { + h{config-vc}@./: install = $install_include/details/ + h{config-vc-stub}@./: install = $install_include/details/build2/config-vc.h + } + else + { + h{config}@./: install = $install_include/details/ + h{config-stub}@./: install = $install_include/details/build2/config.h + } + } + } +} diff --git a/libodb-qt/odb/qt/containers.options b/libodb-qt/odb/qt/containers.options new file mode 100644 index 0000000..337b064 --- /dev/null +++ b/libodb-qt/odb/qt/containers.options @@ -0,0 +1,18 @@ +# file : odb/qt/containers.options +# licences : GNU GPL v2; see accompanying LICENSE file + +--profile qt/version + +--odb-epilogue '#include ' +--odb-epilogue '#include ' +--odb-epilogue '#include ' +--odb-epilogue '#include ' +--odb-epilogue '#include ' +--odb-epilogue '#include ' + +--hxx-prologue '#include ' +--hxx-prologue '#include ' +--hxx-prologue '#include ' +--hxx-prologue '#include ' +--hxx-prologue '#include ' +--hxx-prologue '#include ' diff --git a/libodb-qt/odb/qt/containers/list-iterator.hxx b/libodb-qt/odb/qt/containers/list-iterator.hxx new file mode 100644 index 0000000..67f56fd --- /dev/null +++ b/libodb-qt/odb/qt/containers/list-iterator.hxx @@ -0,0 +1,30 @@ +// file : odb/qt/containers/list-iterator.hxx +// license : GNU GPL v2; see accompanying LICENSE file + +#ifndef ODB_QT_CONTAINERS_LIST_ITERATOR_HXX +#define ODB_QT_CONTAINERS_LIST_ITERATOR_HXX + +#include + +#include + +#include + +// Java-style QListIterator-like iterator. You can also use the +// QListIterator directly (but not QMutableListIterator). +// +template +class QOdbListIterator: public QListIterator +{ +public: + QOdbListIterator (const QOdbList& c): QListIterator (c) {} + QOdbListIterator& operator=(const QOdbList& c) + { + static_cast&> (*this) = c; + return *this; + } +}; + +#include + +#endif // ODB_QT_CONTAINERS_LIST_ITERATOR_HXX diff --git a/libodb-qt/odb/qt/containers/list-traits.hxx b/libodb-qt/odb/qt/containers/list-traits.hxx new file mode 100644 index 0000000..5a3ee38 --- /dev/null +++ b/libodb-qt/odb/qt/containers/list-traits.hxx @@ -0,0 +1,107 @@ +// file : odb/qt/containers/list-traits.hxx +// license : GNU GPL v2; see accompanying LICENSE file + +#ifndef ODB_QT_CONTAINERS_LIST_TRAITS_HXX +#define ODB_QT_CONTAINERS_LIST_TRAITS_HXX + +#include + +#include +#include +#include + +#include + +namespace odb +{ + template + class access::container_traits > + { + public: + static const container_kind kind = ck_ordered; + static const bool smart = true; + + typedef QOdbList container_type; + + typedef V value_type; + typedef typename container_type::size_type index_type; + + typedef smart_ordered_functions functions; + typedef ordered_functions dumb_functions; + + public: + static void + persist (const container_type& c, const functions& f) + { + for (index_type i (0), n (c.size ()); i < n; ++i) + f.insert (i, c[i]); + + // Now that this container is persistent, start tracking changes. + // + c._start (); + } + + static void + load (container_type& c, bool more, const functions& f) + { + // Stop tracking changes. + // + c._stop (); + + // Load. + // + c.clear (); + while (more) + { + index_type dummy; + c.append (value_type ()); + more = f.select (dummy, c.modify_back ()); + } + + // Start tracking changes. + // + c._start (); + } + + static bool + changed (const container_type&); + + static void + update (const container_type&, const functions&); + + static void + erase (const container_type* c, const functions& f) + { + f.delete_ (0); + + // Stop tracking changes. + // + if (c != 0) + c->_stop (); + } + + // Version of load() for dumb functions. Used to support + // inverse members of the container type. The implementation + // is identical to the smart one except we don't turn off/on + // change tracking. + // + static void + load (container_type& c, bool more, const dumb_functions& f) + { + c.clear (); + + while (more) + { + index_type dummy; + c.append (value_type ()); + more = f.select (dummy, c.modify_back ()); + } + } + }; +} + +#include + +#include + +#endif // ODB_QT_CONTAINERS_LIST_TRAITS_HXX diff --git a/libodb-qt/odb/qt/containers/list-traits.txx b/libodb-qt/odb/qt/containers/list-traits.txx new file mode 100644 index 0000000..105fc2a --- /dev/null +++ b/libodb-qt/odb/qt/containers/list-traits.txx @@ -0,0 +1,101 @@ +// file : odb/qt/containers/list-traits.txx +// license : GNU GPL v2; see accompanying LICENSE file + +namespace odb +{ + template + bool access::container_traits >:: + changed (const container_type& c) + { + // Because modifications can cancel each other (e.g., push and pop), + // it is tricky to keep track of whether there are any changes in + // the container. Instead, we are just going to examine each element + // just like update(). + // + + // We should either be tracking or summarily changed. + // + if (c._tracking ()) + { + const vector_impl& impl (c._impl ()); + + for (std::size_t i (0), n (impl.size ()); i < n; ++i) + { + if (impl.state (i) != vector_impl::state_unchanged) + return true; + } + } + else + return true; + + return false; + } + + template + void access::container_traits >:: + update (const container_type& c, const functions& f) + { + bool u (false); // Updated flag. + + if (c._tracking ()) + { + const vector_impl& impl (c._impl ()); + + for (std::size_t i (0), n (impl.size ()); i < n; ++i) + { + vector_impl::element_state_type s (impl.state (i)); + index_type ii (static_cast (i)); + + switch (s) + { + case vector_impl::state_unchanged: + { + break; + } + case vector_impl::state_inserted: + { + f.insert (ii, c[ii]); + u = u || true; + break; + } + case vector_impl::state_updated: + { + f.update (ii, c[ii]); + u = u || true; + break; + } + case vector_impl::state_erased: + { + f.delete_ (ii); // Delete from i onwards. + u = u || true; + break; + } + } + + // We delete all trailing elements in one go. + // + if (s == vector_impl::state_erased) + break; + } + } + else + { + // Fall back to delete all/insert all. + // + f.delete_ (0); + + for (index_type i (0), n (c.size ()); i < n; ++i) + f.insert (i, c[i]); + + u = true; + } + + // Arm the rollback callback and (re)start change tracking. + // + if (u) + { + c._arm (transaction::current ()); + c._start (); + } + } +} diff --git a/libodb-qt/odb/qt/containers/list.hxx b/libodb-qt/odb/qt/containers/list.hxx new file mode 100644 index 0000000..143deed --- /dev/null +++ b/libodb-qt/odb/qt/containers/list.hxx @@ -0,0 +1,433 @@ +// file : odb/qt/containers/list.hxx +// license : GNU GPL v2; see accompanying LICENSE file + +#ifndef ODB_QT_CONTAINERS_LIST_HXX +#define ODB_QT_CONTAINERS_LIST_HXX + +#include +#include // ODB_CXX11 + +#include // QT_VERSION +#include + +#ifdef ODB_CXX11 +# include // std::move +# if defined(ODB_CXX11_INITIALIZER_LIST) && \ + defined(Q_COMPILER_INITIALIZER_LISTS) +# include +# endif +#endif + +#include + +// A QList-like container that keeps track of changes. +// +// Note that the style and order of definitions is (mostly) as +// appears in the qlist.h Qt header (except for some cleanups, +// such as superfluous inline use). +// +template +class QOdbListIteratorImpl; + +template +class QOdbList: public odb::vector_base +{ +public: + typedef QList base_list_type; + typedef typename base_list_type::iterator base_iterator_type; + + QOdbList() {} + QOdbList(const QOdbList &x): vector_base (x), l_ (x.l_) {} + // ~QOdbList(); + QOdbList &operator=(const QOdbList &l); + +#if QT_VERSION >= 0x040800 + void swap(QOdbList &other); +#endif + +#ifdef ODB_CXX11 + QOdbList(QOdbList &&x) noexcept + : vector_base (std::move (x)), l_ (std::move (x.l_)) {} + + // Note: noexcept is not specified since it can throw while reallocating + // impl_. + // + QOdbList &operator=(QOdbList &&other); + +#if defined(ODB_CXX11_INITIALIZER_LIST) && \ + defined(Q_COMPILER_INITIALIZER_LISTS) + QOdbList(std::initializer_list il): l_ (il) {} +#endif +#endif + + // Implicit conversion. + // + bool operator==(const QList &x) const {return l_ == x;} + bool operator!=(const QList &x) const {return l_ != x;} + + int size() const {return l_.size ();} + void detach() {l_.detach ();} + void detachShared() {l_.detachShared ();} + bool isDetached() const {return l_.isDetached ();} + void setSharable(bool sharable) {l_.setSharable (sharable);} + // Implicit conversion. + bool isSharedWith(const QList &x) const {return l_.isSharedWith (x);} + bool isEmpty() const {return l_.isEmpty ();} + void clear(); + + const T &at(int i) const {return l_.at (i);} + const T &operator[](int i) const {return l_[i];} + //T &operator[](int i); + T &modify (int i); + + void reserve(int size); + void append(const T &t); + void append(const QList &t); // Implicit conversion. + void prepend(const T &t); + void insert(int i, const T &t); + void replace(int i, const T &t); + void removeAt(int i); + int removeAll(const T &t); + bool removeOne(const T &t); + T takeAt(int i); + T takeFirst(); + T takeLast(); + void move(int from, int to); + void swap(int i, int j); + + int indexOf(const T &t, int from = 0) const {return l_.indexOf (t, from);} + int lastIndexOf(const T &t, int from = -1) const + {return l_.lastIndexOf (t, from);} + bool contains(const T &t) const {return l_.contains (t);} + int count(const T &t) const {return l_.count (t);} + + typedef QOdbListIteratorImpl iterator; + typedef typename base_list_type::const_iterator const_iterator; + + // stl style + iterator begin() {return iterator (this, l_.begin ());} + const_iterator begin() const {return l_.begin ();} + const_iterator cbegin() const {return l_.cbegin ();} + const_iterator constBegin() const {return l_.constBegin ();} + iterator end() {return iterator (this, l_.end ());} + const_iterator end() const {return l_.end ();} + const_iterator cend() const {return l_.cend ();} + const_iterator constEnd() const {return l_.constEnd ();} + + // Return QList iterators. The begin() functions mark all + // the elements as modified. + // + base_iterator_type mbegin (); + base_iterator_type modifyBegin () {return mbegin ();} + base_iterator_type mend () {return l_.end ();} + base_iterator_type modifyEnd () {return mend ();} + + iterator insert(iterator before, const T &t); + iterator erase(iterator pos); + iterator erase(iterator first, iterator last); + + // more Qt + typedef iterator Iterator; + typedef const_iterator ConstIterator; + + int count() const {return l_.count ();} + int length() const {return l_.length ();} + //T& first(); + T& modifyFirst(); + const T& first() const {return l_.first ();} + //T& last(); + T& modifyLast(); + const T& last() const {return l_.last ();} + void removeFirst(); + void removeLast(); + bool startsWith(const T &t) const {return l_.startsWith (t);} + bool endsWith(const T &t) const {return l_.endsWith (t);} + QList mid(int pos, int length = -1) const {return l_.mid (pos, length);} + + T value(int i) const {return l_.value (i);} + T value(int i, const T &defValue) const {return l_.value (i, defValue);} + + // stl compatibility + void push_back(const T &t) {append(t);} + void push_front(const T &t) {prepend(t);} + //T& front(); + T& modify_front() {return modifyFirst ();} + const T& front() const {return l_.front ();} + //T& back(); + T& modify_back() {return modifyLast ();} + const T& back() const {return l_.back ();} + void pop_front() {removeFirst();} + void pop_back() {removeLast();} + bool empty() const {return l_.empty ();} + + typedef int size_type; + typedef T value_type; + typedef value_type *pointer; + typedef const value_type *const_pointer; + typedef value_type &reference; + typedef const value_type &const_reference; + typedef typename base_list_type::difference_type difference_type; + + // comfort + // Implicit conversion. + QOdbList &operator+=(const QList &l) {append (l); return *this;} + QOdbList operator+(const QList &l) const + {QOdbList r (*this); r.append (l); return r;} + QOdbList &operator+=(const T &t) {append (t); return *this;} + QOdbList &operator<< (const T &t) {append (t); return *this;} + QOdbList &operator<<(const QList &l) {append (l); return *this;} + + QVector toVector() const {return l_.toVector ();} + QSet toSet() const {return l_.toSet ();} + + static QOdbList fromVector(const QVector &v) + {return base_list_type::fromVector (v);} + static QOdbList fromSet(const QSet &s) + {return base_list_type::fromSet (s);} + + static QOdbList fromStdList(const std::list &l) + {return base_list_type::fromStdList (l);} + std::list toStdList() const {return l_.toStdList ();} + + // Interfacing with the base list. + // + QOdbList (const base_list_type& x): l_ (x) {} + QOdbList& operator= (const base_list_type&); + operator const base_list_type& () const {return l_;} + base_list_type& base () {return l_;} + const base_list_type& base () const {return l_;} + +#ifdef ODB_CXX11 + QOdbList (base_list_type&& x): l_ (std::move (x)) {} + QOdbList& operator= (base_list_type&&); +#endif + + // Change tracking (the rest comes from vector_base). + // +public: + void _start () const {impl_.start (l_.size ());} + +private: + base_list_type l_; +}; + +template +class QOdbListIteratorImpl +{ +public: + typedef L list_type; + typedef typename list_type::base_iterator_type base_iterator_type; + typedef typename list_type::const_iterator const_iterator_type; + + typedef typename base_iterator_type::iterator_category iterator_category; + typedef typename base_iterator_type::difference_type difference_type; + typedef typename base_iterator_type::value_type value_type; + typedef typename base_iterator_type::pointer pointer; + typedef typename base_iterator_type::reference reference; + + typedef typename list_type::size_type size_type; + typedef typename list_type::const_reference const_reference; + typedef typename list_type::const_pointer const_pointer; + + QOdbListIteratorImpl (): l_ (0), i_ () {} + QOdbListIteratorImpl (list_type* l, const base_iterator_type& i) + : l_ (l), i_ (i) {} + +#ifndef QT_STRICT_ITERATORS + operator const_iterator_type () const {return i_;} +#endif + base_iterator_type base () const {return i_;} + list_type* list () const {return l_;} + + // Note: const_{reference,pointer}. + // + const_reference operator* () const {return *i_;} + const_pointer operator-> () const {return i_.operator -> ();} + const_reference operator[] (difference_type n) const {return i_[n];} + + // Modifiers. + // + reference modify () const; + reference modify (difference_type n) const; + + QOdbListIteratorImpl& operator++ () {++i_; return *this;} + QOdbListIteratorImpl operator++ (int) + {return QOdbListIteratorImpl (l_, i_++);} + QOdbListIteratorImpl& operator-- () {--i_; return *this;} + QOdbListIteratorImpl operator-- (int) + {return QOdbListIteratorImpl (l_, i_--);} + + QOdbListIteratorImpl operator+ (int n) const + {return QOdbListIteratorImpl (l_, i_ + n);} + QOdbListIteratorImpl& operator+= (int n) {i_ += n; return *this;} + QOdbListIteratorImpl operator- (int n) const + {return QOdbListIteratorImpl (l_, i_ - n);} + QOdbListIteratorImpl& operator-= (int n) {i_ -= n; return *this;} + +private: + list_type* l_; + base_iterator_type i_; +}; + +// operator== +// +template +inline bool +operator== (const QOdbListIteratorImpl& x, const QOdbListIteratorImpl& y) +{return x.base () == y.base ();} + +#ifndef QT_STRICT_ITERATORS +template +inline bool +operator== (const QOdbListIteratorImpl& x, + const typename QOdbListIteratorImpl::const_iterator_type& y) +{return x.base () == y;} + +template +inline bool +operator== (const typename QOdbListIteratorImpl::const_iterator_type& x, + const QOdbListIteratorImpl& y) +{return x == y.base ();} +#endif + +// operator< +// +template +inline bool +operator< (const QOdbListIteratorImpl& x, const QOdbListIteratorImpl& y) +{return x.base () < y.base ();} + +#ifndef QT_STRICT_ITERATORS +template +inline bool +operator< (const QOdbListIteratorImpl& x, + const typename QOdbListIteratorImpl::const_iterator_type& y) +{return x.base () < y;} + +template +inline bool +operator< (const typename QOdbListIteratorImpl::const_iterator_type& x, + const QOdbListIteratorImpl& y) +{return x < y.base ();} +#endif + +// operator!= +// +template +inline bool +operator!= (const QOdbListIteratorImpl& x, const QOdbListIteratorImpl& y) +{return x.base () != y.base ();} + +#ifndef QT_STRICT_ITERATORS +template +inline bool +operator!= (const QOdbListIteratorImpl& x, + const typename QOdbListIteratorImpl::const_iterator_type& y) +{return x.base () != y;} + +template +inline bool +operator!= (const typename QOdbListIteratorImpl::const_iterator_type& x, + const QOdbListIteratorImpl& y) +{return x != y.base ();} +#endif + +// operator> +// +template +inline bool +operator> (const QOdbListIteratorImpl& x, const QOdbListIteratorImpl& y) +{return x.base () > y.base ();} + +#ifndef QT_STRICT_ITERATORS +template +inline bool +operator> (const QOdbListIteratorImpl& x, + const typename QOdbListIteratorImpl::const_iterator_type& y) +{return x.base () > y;} + +template +inline bool +operator> (const typename QOdbListIteratorImpl::const_iterator_type& x, + const QOdbListIteratorImpl& y) +{return x > y.base ();} +#endif + +// operator>= +// +template +inline bool +operator>= (const QOdbListIteratorImpl& x, const QOdbListIteratorImpl& y) +{return x.base () >= y.base ();} + +#ifndef QT_STRICT_ITERATORS +template +inline bool +operator>= (const QOdbListIteratorImpl& x, + const typename QOdbListIteratorImpl::const_iterator_type& y) +{return x.base () >= y;} + +template +inline bool +operator>= (const typename QOdbListIteratorImpl::const_iterator_type& x, + const QOdbListIteratorImpl& y) +{return x >= y.base ();} +#endif + +// operator<= +// +template +inline bool +operator<= (const QOdbListIteratorImpl& x, const QOdbListIteratorImpl& y) +{return x.base () <= y.base ();} + +#ifndef QT_STRICT_ITERATORS +template +inline bool +operator<= (const QOdbListIteratorImpl& x, + const typename QOdbListIteratorImpl::const_iterator_type& y) +{return x.base () <= y;} + +template +inline bool +operator<= (const typename QOdbListIteratorImpl::const_iterator_type& x, + const QOdbListIteratorImpl& y) +{return x <= y.base ();} +#endif + +// operator- +// +template +inline typename QOdbListIteratorImpl::difference_type +operator-(const QOdbListIteratorImpl& x, const QOdbListIteratorImpl& y) +{return x.base () - y.base ();} + +#ifndef QT_STRICT_ITERATORS +template +inline typename QOdbListIteratorImpl::difference_type +operator-(const QOdbListIteratorImpl& x, + const typename QOdbListIteratorImpl::const_iterator_type& y) +{return x.base () - y;} + +template +inline typename QOdbListIteratorImpl::difference_type +operator-(const typename QOdbListIteratorImpl::const_iterator_type& x, + const QOdbListIteratorImpl& y) +{return x - y.base ();} +#endif + +// operator+ +// +template +inline QOdbListIteratorImpl +operator+(typename QOdbListIteratorImpl::difference_type n, + const QOdbListIteratorImpl& x) +{return QOdbListIteratorImpl (x.list (), n + x.base ());} + +#include + +#include + +#include + +#endif // ODB_QT_CONTAINERS_LIST_HXX diff --git a/libodb-qt/odb/qt/containers/list.ixx b/libodb-qt/odb/qt/containers/list.ixx new file mode 100644 index 0000000..d9d37b6 --- /dev/null +++ b/libodb-qt/odb/qt/containers/list.ixx @@ -0,0 +1,318 @@ +// file : odb/qt/containers/list.ixx +// license : GNU GPL v2; see accompanying LICENSE file + +// +// QOdbList +// + +template +inline QOdbList& QOdbList:: +operator= (const QOdbList& x) +{ + l_ = x.l_; + if (_tracking ()) + impl_.assign (static_cast (l_.size ())); + return *this; +} + +template +inline QOdbList& QOdbList:: +operator= (const base_list_type& x) +{ + l_ = x; + if (_tracking ()) + impl_.assign (static_cast (l_.size ())); + return *this; +} + +#ifdef ODB_CXX11 +template +inline QOdbList& QOdbList:: +operator= (QOdbList&& x) +{ + l_ = std::move (x.l_); + if (_tracking ()) + impl_.assign (static_cast (l_.size ())); + return *this; +} + +template +inline QOdbList& QOdbList:: +operator= (base_list_type&& x) +{ + l_ = std::move (x); + if (_tracking ()) + impl_.assign (static_cast (l_.size ())); + return *this; +} +#endif + +#if QT_VERSION >= 0x040800 +template +inline void QOdbList:: +swap (QOdbList& x) +{ + l_.swap (x.l_); + vector_base::swap (x); +} +#endif + +template +inline void QOdbList:: +clear() +{ + l_.clear (); + if (_tracking ()) + impl_.clear (); +} + +template +inline T& QOdbList:: +modify (int i) +{ + T& r (l_[i]); + if (_tracking ()) + impl_.modify (static_cast (i)); + return r; +} + +template +inline void QOdbList:: +reserve (int n) +{ + l_.reserve (n); + if (_tracking ()) + impl_.reserve (static_cast (n)); +} + +template +inline void QOdbList:: +append (const T& x) +{ + l_.append (x); + if (_tracking ()) + impl_.push_back (); +} + +template +inline void QOdbList:: +append (const QList& x) +{ + l_.append (x); + if (_tracking ()) + impl_.push_back (static_cast (x.size ())); +} + +template +inline void QOdbList:: +prepend (const T& x) +{ + l_.prepend (x); + if (_tracking ()) + impl_.insert (0); +} + +template +inline void QOdbList:: +insert (int i, const T& x) +{ + l_.insert (i, x); + if (_tracking ()) + impl_.insert (static_cast (i)); +} + +template +inline void QOdbList:: +replace (int i, const T& x) +{ + l_.insert (i, x); + if (_tracking ()) + impl_.modify (static_cast (i)); +} + +template +inline void QOdbList:: +removeAt (int i) +{ + l_.removeAt (i); + if (_tracking ()) + impl_.erase (static_cast (i)); +} + +template +inline int QOdbList:: +removeAll (const T& x) +{ + // We have to re-implement this one ourselves since we need to + // know the indexes of the removed elements. + // + int r (0); + for (int i (l_.indexOf (x)); i != -1; i = l_.indexOf (x, i)) + { + removeAt (i); + r++; + } + return r; +} + +template +inline bool QOdbList:: +removeOne (const T& x) +{ + // We have to re-implement this one ourselves since we need to + // know the index of the removed element. + // + int i (l_.indexOf (x)); + if (i != -1) + removeAt (i); + return i != -1; +} + +template +inline T QOdbList:: +takeAt (int i) +{ + if (_tracking ()) + impl_.erase (static_cast (i)); + return l_.takeAt (i); +} + +template +inline T QOdbList:: +takeFirst () +{ + if (_tracking ()) + impl_.erase (0); + return l_.takeFirst (); +} + +template +inline T QOdbList:: +takeLast () +{ + if (_tracking ()) + impl_.pop_back (); + return l_.takeLast (); +} + +template +inline void QOdbList:: +move (int from, int to) +{ + l_.move (from, to); + if (_tracking ()) + { + impl_.erase (static_cast (from)); + impl_.insert (static_cast (to)); + } +} + +template +inline void QOdbList:: +swap (int i, int j) +{ + l_.swap (i, j); + if (_tracking ()) + { + impl_.modify (static_cast (i)); + impl_.modify (static_cast (j)); + } +} + +template +inline typename QOdbList::base_iterator_type QOdbList:: +mbegin () +{ + if (_tracking ()) + impl_.modify (0, static_cast (l_.size ())); + return l_.begin (); +} + +template +inline typename QOdbList::iterator QOdbList:: +insert (iterator p, const T& x) +{ + if (_tracking ()) + impl_.insert (static_cast (p.base () - l_.begin ())); + return iterator (this, l_.insert (p.base (), x)); +} + +template +inline typename QOdbList::iterator QOdbList:: +erase (iterator p) +{ + if (_tracking ()) + impl_.erase (static_cast (p.base () - l_.begin ())); + return iterator (this, l_.erase (p.base ())); +} + +template +inline typename QOdbList::iterator QOdbList:: +erase (iterator f, iterator l) +{ + if (_tracking ()) + impl_.erase (static_cast (f.base () - l_.begin ()), + static_cast (l - f)); + return iterator (this, l_.erase (f.base (), l.base ())); +} + +template +inline T& QOdbList:: +modifyFirst () +{ + T& r (l_.first ()); + if (_tracking ()) + impl_.modify (0); + return r; +} + +template +inline T& QOdbList:: +modifyLast () +{ + T& r (l_.last ()); + if (_tracking ()) + impl_.modify (static_cast (l_.size () - 1)); + return r; +} + +template +inline void QOdbList:: +removeFirst () +{ + l_.removeFirst (); + if (_tracking ()) + impl_.erase (0); +} + +template +inline void QOdbList:: +removeLast () +{ + l_.removeLast (); + if (_tracking ()) + impl_.pop_back (); +} + +// +// QOdbListIteratorImpl +// + +template +inline typename QOdbListIteratorImpl::reference QOdbListIteratorImpl:: +modify () const +{ + if (l_->_tracking ()) + l_->_impl ().modify (static_cast (i_ - l_->base ().begin ())); + return *i_; +} + +template +inline typename QOdbListIteratorImpl::reference QOdbListIteratorImpl:: +modify (difference_type n) const +{ + if (l_->_tracking ()) + l_->_impl ().modify ( + static_cast (i_ - l_->base ().begin () + n)); + return i_[n]; +} diff --git a/libodb-qt/odb/qt/containers/mutable-list-iterator.hxx b/libodb-qt/odb/qt/containers/mutable-list-iterator.hxx new file mode 100644 index 0000000..271633a --- /dev/null +++ b/libodb-qt/odb/qt/containers/mutable-list-iterator.hxx @@ -0,0 +1,110 @@ +// file : odb/qt/containers/mutable-list-iterator.hxx +// license : GNU GPL v2; see accompanying LICENSE file + +#ifndef ODB_QT_CONTAINERS_MUTABLE_LIST_ITERATOR_HXX +#define ODB_QT_CONTAINERS_MUTABLE_LIST_ITERATOR_HXX + +#include + +#include + +#include + +// Java-style QMutableListIterator-like iterator. The implementation +// is based on what's found in qiterator.h. +// +template +class QMutableOdbListIterator +{ +public: + QMutableOdbListIterator(QOdbList &x) + : c (&x) + { + c->setSharable(false); + i = c->begin(); + n = c->end(); + } + + ~QMutableOdbListIterator() {c->setSharable(true);} + + QMutableOdbListIterator &operator=(QOdbList &x) + { + c->setSharable(true); + c = &x; + c->setSharable(false); + i = c->begin(); + n = c->end(); + return *this; + } + + void toFront() {i = c->begin(); n = c->end();} + void toBack() {i = c->end(); n = i;} + bool hasNext() const {return c->constEnd() != const_iterator(i.base ());} + bool hasPrevious() const + { + return c->constBegin() != const_iterator(i.base ()); + } + + bool findNext(const T &t) + { + while (c->constEnd() != const_iterator((n = i).base ())) + if (*i++ == t) + return true; + return false; + } + + bool findPrevious(const T &t) + { + while (c->constBegin() != const_iterator(i.base ())) + if (*(n = --i) == t) + return true; + + n = c->end(); + return false; + } + + T &next() {n = i++; return n.modify ();} + T &peekNext() const {return i.modify ();} + T &previous() {n = --i; return n.modify ();} + T &peekPrevious() const {iterator p (i); return (--p).modify ();} + + void remove() + { + if (c->constEnd() != const_iterator(n.base ())) + { + i = c->erase (n); + n = c->end(); + } + } + + void setValue(const T &t) const + { + if (c->constEnd() != const_iterator(n.base ())) + n.modify () = t; + } + + T &value() + { + Q_ASSERT(c->constEnd() != const_iterator(n.base ())); + return n.modify (); + } + + const T &value() const + { + Q_ASSERT(c->constEnd() != const_iterator(n.base ())); + return *n; + } + + void insert(const T &t) {n = i = c->insert(i, t); ++i;} + +private: + typedef typename QOdbList::iterator iterator; + typedef typename QOdbList::const_iterator const_iterator; + + QOdbList* c; + iterator i, n; +}; + +#include + +#endif // ODB_QT_CONTAINERS_MUTABLE_LIST_ITERATOR_HXX diff --git a/libodb-qt/odb/qt/containers/qhash-traits.hxx b/libodb-qt/odb/qt/containers/qhash-traits.hxx new file mode 100644 index 0000000..9f42d37 --- /dev/null +++ b/libodb-qt/odb/qt/containers/qhash-traits.hxx @@ -0,0 +1,129 @@ +// file : odb/qt/containers/qhash-traits.hxx +// license : GNU GPL v2; see accompanying LICENSE file + +#ifndef ODB_QT_CONTAINER_QHASH_TRAITS_HXX +#define ODB_QT_CONTAINER_QHASH_TRAITS_HXX + +#include + +#include +#include + +#include + +namespace odb +{ + template + class access::container_traits > + { + public: + static const container_kind kind = ck_map; + static const bool smart = false; + + typedef QHash container_type; + typedef Key key_type; + typedef T value_type; + + typedef map_functions functions; + + public: + static void + persist (const container_type& c, const functions& f) + { + for (typename container_type::const_iterator i (c.begin ()), + e (c.end ()); i != e; ++i) + f.insert (i.key (), i.value ()); + } + + static void + load (container_type& c, bool more, const functions& f) + { + c.clear (); + + while (more) + { + key_type k; + value_type v; + more = f.select (k, v); + c.insert (k, v); // @@ Use std::move in C++11. + } + } + + static void + update (const container_type& c, const functions& f) + { + f.delete_ (); + + for (typename container_type::const_iterator i (c.begin ()), + e (c.end ()); i != e; ++i) + f.insert (i.key (), i.value ()); + } + + static void + erase (const functions& f) + { + f.delete_ (); + } + }; + + // @@ QMultiHash guarantees elements to be stored in reverse order of + // insertion. The current implementation of the generated code does + // not guarantee this. + // + template + class access::container_traits > + { + public: + static const container_kind kind = ck_multimap; + static const bool smart = false; + + typedef QMultiHash container_type; + typedef Key key_type; + typedef T value_type; + + typedef map_functions functions; + + public: + static void + persist (const container_type& c, const functions& f) + { + for (typename container_type::const_iterator i (c.begin ()), + e (c.end ()); i != e; ++i) + f.insert (i.key (), i.value ()); + } + + static void + load (container_type& c, bool more, const functions& f) + { + c.clear (); + + while (more) + { + key_type k; + value_type v; + more = f.select (k, v); + c.insert (k, v); //@@ Use std::move in C++11. + } + } + + static void + update (const container_type& c, const functions& f) + { + f.delete_ (); + + for (typename container_type::const_iterator i (c.begin ()), + e (c.end ()); i != e; ++i) + f.insert (i.key (), i.value ()); + } + + static void + erase (const functions& f) + { + f.delete_ (); + } + }; +} + +#include + +#endif // ODB_QT_CONTAINER_QHASH_TRAITS_HXX diff --git a/libodb-qt/odb/qt/containers/qlinked-list-traits.hxx b/libodb-qt/odb/qt/containers/qlinked-list-traits.hxx new file mode 100644 index 0000000..3bfc9e9 --- /dev/null +++ b/libodb-qt/odb/qt/containers/qlinked-list-traits.hxx @@ -0,0 +1,82 @@ +// file : odb/qt/containers/qlinked-list-traits.hxx +// license : GNU GPL v2; see accompanying LICENSE file + +#ifndef ODB_QT_CONTAINER_QLINKED_LIST_TRAITS_HXX +#define ODB_QT_CONTAINER_QLINKED_LIST_TRAITS_HXX + +#include + +#include // QT_VERSION + +// QLinkedList is deprecated since Qt5 5.15 and in Qt6 it has been moved to a +// separate library. +// +#if (QT_VERSION < 0x050F00) || ODB_QT_FORCE_QLINKEDLIST + +#include + +#include + +namespace odb +{ + template + class access::container_traits > + { + public: + static const container_kind kind = ck_ordered; + static const bool smart = false; + + typedef QLinkedList container_type; + + typedef T value_type; + typedef typename container_type::size_type index_type; + + typedef ordered_functions functions; + + public: + static void + persist (const container_type& c, const functions& f) + { + index_type i (0); + for (typename container_type::const_iterator j (c.begin ()), + e (c.end ()); j != e; ++j) + f.insert (i++, *j); + } + + static void + load (container_type& c, bool more, const functions& f) + { + c.clear (); + + while (more) + { + index_type dummy; + c.append (value_type ()); + more = f.select (dummy, c.back ()); + } + } + + static void + update (const container_type& c, const functions& f) + { + f.delete_ (); + + index_type i (0); + for (typename container_type::const_iterator j (c.begin ()), + e (c.end ()); j != e; ++j) + f.insert (i++, *j); + } + + static void + erase (const functions& f) + { + f.delete_ (); + } + }; +} + +#endif + +#include + +#endif // ODB_QT_CONTAINER_QLINKED_LIST_TRAITS_HXX diff --git a/libodb-qt/odb/qt/containers/qlist-traits.hxx b/libodb-qt/odb/qt/containers/qlist-traits.hxx new file mode 100644 index 0000000..572d02a --- /dev/null +++ b/libodb-qt/odb/qt/containers/qlist-traits.hxx @@ -0,0 +1,72 @@ +// file : odb/qt/containers/qlist-traits.hxx +// license : GNU GPL v2; see accompanying LICENSE file + +#ifndef ODB_QT_CONTAINER_QLIST_TRAITS_HXX +#define ODB_QT_CONTAINER_QLIST_TRAITS_HXX + +#include + +#include + +#include + +namespace odb +{ + template + class access::container_traits > + { + public: + static const container_kind kind = ck_ordered; + static const bool smart = false; + + typedef QList container_type; + + typedef T value_type; + typedef typename container_type::size_type index_type; + + typedef ordered_functions functions; + + public: + static void + persist (const container_type& c, const functions& f) + { + // Index based access is just as fast as iterator based access for + // QList. + // + for (index_type i (0), n (c.size ()); i < n; ++i) + f.insert (i, c[i]); + } + + static void + load (container_type& c, bool more, const functions& f) + { + c.clear (); + + while (more) + { + index_type dummy; + c.append (value_type ()); + more = f.select (dummy, c.back ()); + } + } + + static void + update (const container_type& c, const functions& f) + { + f.delete_ (); + + for (index_type i (0), n (c.size ()); i < n; ++i) + f.insert (i, c[i]); + } + + static void + erase (const functions& f) + { + f.delete_ (); + } + }; +} + +#include + +#endif // ODB_QT_CONTAINER_QLIST_TRAITS_HXX diff --git a/libodb-qt/odb/qt/containers/qmap-traits.hxx b/libodb-qt/odb/qt/containers/qmap-traits.hxx new file mode 100644 index 0000000..5f13b29 --- /dev/null +++ b/libodb-qt/odb/qt/containers/qmap-traits.hxx @@ -0,0 +1,130 @@ +// file : odb/qt/containers/qmap-traits.hxx +// license : GNU GPL v2; see accompanying LICENSE file + +#ifndef ODB_QT_CONTAINER_QMAP_TRAITS_HXX +#define ODB_QT_CONTAINER_QMAP_TRAITS_HXX + +#include + +#include +#include + +#include + +namespace odb +{ + template + class access::container_traits > + { + public: + static const container_kind kind = ck_map; + static const bool smart = false; + + typedef QMap container_type; + + typedef Key key_type; + typedef T value_type; + + typedef map_functions functions; + + public: + static void + persist (const container_type& c, const functions& f) + { + for (typename container_type::const_iterator i (c.begin ()), + e (c.end ()); i != e; ++i) + f.insert (i.key (), i.value ()); + } + + static void + load (container_type& c, bool more, const functions& f) + { + c.clear (); + + while (more) + { + key_type k; + value_type v; + more = f.select (k, v); + c.insert (k, v); //@@ Use std::move in C++11. + } + } + + static void + update (const container_type& c, const functions& f) + { + f.delete_ (); + + for (typename container_type::const_iterator i (c.begin ()), + e (c.end ()); i != e; ++i) + f.insert (i.key (), i.value ()); + } + + static void + erase (const functions& f) + { + f.delete_ (); + } + }; + // @@ QMultiMap guarantees elements to be stored in reverse order of + // insertion. The current implementation of the generated code does + // not guarantee this. + // + template + class access::container_traits > + { + public: + static const container_kind kind = ck_multimap; + static const bool smart = false; + + typedef QMultiMap container_type; + + typedef Key key_type; + typedef T value_type; + + typedef map_functions functions; + + public: + static void + persist (const container_type& c, const functions& f) + { + for (typename container_type::const_iterator i (c.begin ()), + e (c.end ()); i != e; ++i) + f.insert (i.key (), i.value ()); + } + + static void + load (container_type& c, bool more, const functions& f) + { + c.clear (); + + while (more) + { + key_type k; + value_type v; + more = f.select (k, v); + c.insert (k, v); //@@ Use std::move in C++11. + } + } + + static void + update (const container_type& c, const functions& f) + { + f.delete_ (); + + for (typename container_type::const_iterator i (c.begin ()), + e (c.end ()); i != e; ++i) + f.insert (i.key (), i.value ()); + } + + static void + erase (const functions& f) + { + f.delete_ (); + } + }; +} + +#include + +#endif // ODB_QT_CONTAINER_QMAP_TRAITS_HXX diff --git a/libodb-qt/odb/qt/containers/qset-traits.hxx b/libodb-qt/odb/qt/containers/qset-traits.hxx new file mode 100644 index 0000000..fbea8b7 --- /dev/null +++ b/libodb-qt/odb/qt/containers/qset-traits.hxx @@ -0,0 +1,69 @@ +// file : odb/qt/containers/qset-traits.hxx +// license : GNU GPL v2; see accompanying LICENSE file + +#ifndef ODB_QT_CONTAINER_QSET_TRAITS_HXX +#define ODB_QT_CONTAINER_QSET_TRAITS_HXX + +#include + +#include + +#include + +namespace odb +{ + template + class access::container_traits > + { + public: + static const container_kind kind = ck_set; + static const bool smart = false; + + typedef QSet container_type; + typedef T value_type; + + typedef set_functions functions; + + public: + static void + persist (const container_type& c, const functions& f) + { + for (typename container_type::const_iterator i (c.begin ()), + e (c.end ()); i != e; ++i) + f.insert (*i); + } + + static void + load (container_type& c, bool more, const functions& f) + { + c.clear (); + + while (more) + { + value_type v; + more = f.select (v); + c.insert (v); //@@ Use std::move in C++11. + } + } + + static void + update (const container_type& c, const functions& f) + { + f.delete_ (); + + for (typename container_type::const_iterator i (c.begin ()), + e (c.end ()); i != e; ++i) + f.insert (*i); + } + + static void + erase (const functions& f) + { + f.delete_ (); + } + }; +} + +#include + +#endif // ODB_QT_CONTAINER_QSET_TRAITS_HXX diff --git a/libodb-qt/odb/qt/containers/qvector-traits.hxx b/libodb-qt/odb/qt/containers/qvector-traits.hxx new file mode 100644 index 0000000..516475d --- /dev/null +++ b/libodb-qt/odb/qt/containers/qvector-traits.hxx @@ -0,0 +1,82 @@ +// file : odb/qt/containers/qvector-traits.hxx +// license : GNU GPL v2; see accompanying LICENSE file + +#ifndef ODB_QT_CONTAINER_QVECTOR_TRAITS_HXX +#define ODB_QT_CONTAINER_QVECTOR_TRAITS_HXX + +#include + +#include // QT_VERSION + +// In Qt 6 QVector is an alias for QList. +// +#if QT_VERSION >= 0x060000 +#include +#else + +#include + +#include + +namespace odb +{ + template + class access::container_traits > + { + public: + static const container_kind kind = ck_ordered; + static const bool smart = false; + + typedef QVector container_type; + + typedef T value_type; + typedef typename container_type::size_type index_type; + + typedef ordered_functions functions; + + public: + static void + persist (const container_type& c, const functions& f) + { + // Index based access is just as fast as iterator based access for + // QVector. + // + for (index_type i (0), n (c.size ()); i < n; ++i) + f.insert (i, c[i]); + } + + static void + load (container_type& c, bool more, const functions& f) + { + c.clear (); + + while (more) + { + index_type dummy; + c.append (value_type ()); + more = f.select (dummy, c.back ()); + } + } + + static void + update (const container_type& c, const functions& f) + { + f.delete_ (); + + for (index_type i (0), n (c.size ()); i < n; ++i) + f.insert (i, c[i]); + } + + static void + erase (const functions& f) + { + f.delete_ (); + } + }; +} + +#endif + +#include + +#endif // ODB_QT_CONTAINER_QVECTOR_TRAITS_HXX diff --git a/libodb-qt/odb/qt/date-time.options b/libodb-qt/odb/qt/date-time.options new file mode 100644 index 0000000..d199649 --- /dev/null +++ b/libodb-qt/odb/qt/date-time.options @@ -0,0 +1,4 @@ +# file : odb/qt/date-time.options +# license : GNU GPL v2; see accompanying LICENSE file + +--profile qt/date-time/date-time diff --git a/libodb-qt/odb/qt/date-time/date-time-common.options b/libodb-qt/odb/qt/date-time/date-time-common.options new file mode 100644 index 0000000..d813259 --- /dev/null +++ b/libodb-qt/odb/qt/date-time/date-time-common.options @@ -0,0 +1,4 @@ +# file : odb/qt/date-time/date-time-common.options +# license : GNU GPL v2; see accompanying LICENSE file + +--profile qt/version diff --git a/libodb-qt/odb/qt/date-time/date-time-mssql.options b/libodb-qt/odb/qt/date-time/date-time-mssql.options new file mode 100644 index 0000000..7e35b4d --- /dev/null +++ b/libodb-qt/odb/qt/date-time/date-time-mssql.options @@ -0,0 +1,13 @@ +# file : odb/qt/date-time/date-time-mssql.options +# license : GNU GPL v2; see accompanying LICENSE file + +--profile qt/version + +# Include the default mapping in prologue instead of epilogue to +# allow the user to override the default mapping. +# +--odb-prologue '#include ' + +--hxx-prologue '#include ' +--hxx-prologue '#include ' +--hxx-prologue '#include ' diff --git a/libodb-qt/odb/qt/date-time/date-time-mysql.options b/libodb-qt/odb/qt/date-time/date-time-mysql.options new file mode 100644 index 0000000..fdbb364 --- /dev/null +++ b/libodb-qt/odb/qt/date-time/date-time-mysql.options @@ -0,0 +1,13 @@ +# file : odb/qt/date-time/date-time-mysql.options +# license : GNU GPL v2; see accompanying LICENSE file + +--profile qt/version + +# Include the default mapping in prologue instead of epilogue to +# allow the user to override the default mapping. +# +--odb-prologue '#include ' + +--hxx-prologue '#include ' +--hxx-prologue '#include ' +--hxx-prologue '#include ' diff --git a/libodb-qt/odb/qt/date-time/date-time-oracle.options b/libodb-qt/odb/qt/date-time/date-time-oracle.options new file mode 100644 index 0000000..c339ce3 --- /dev/null +++ b/libodb-qt/odb/qt/date-time/date-time-oracle.options @@ -0,0 +1,13 @@ +# file : odb/qt/date-time/date-time-oracle.options +# license : GNU GPL v2; see accompanying LICENSE file + +--profile qt/version + +# Include the default mapping in prologue instead of epilogue to +# allow the user to override the default mapping. +# +--odb-prologue '#include ' + +--hxx-prologue '#include ' +--hxx-prologue '#include ' +--hxx-prologue '#include ' diff --git a/libodb-qt/odb/qt/date-time/date-time-pgsql.options b/libodb-qt/odb/qt/date-time/date-time-pgsql.options new file mode 100644 index 0000000..9d80d48 --- /dev/null +++ b/libodb-qt/odb/qt/date-time/date-time-pgsql.options @@ -0,0 +1,13 @@ +# file : odb/qt/date-time/date-time-pgsql.options +# license : GNU GPL v2; see accompanying LICENSE file + +--profile qt/version + +# Include the default mapping in prologue instead of epilogue to +# allow the user to override the default mapping. +# +--odb-prologue '#include ' + +--hxx-prologue '#include ' +--hxx-prologue '#include ' +--hxx-prologue '#include ' diff --git a/libodb-qt/odb/qt/date-time/date-time-sqlite.options b/libodb-qt/odb/qt/date-time/date-time-sqlite.options new file mode 100644 index 0000000..8eb1110 --- /dev/null +++ b/libodb-qt/odb/qt/date-time/date-time-sqlite.options @@ -0,0 +1,13 @@ +# file : odb/qt/date-time/date-time-sqlite.options +# license : GNU GPL v2; see accompanying LICENSE file + +--profile qt/version + +# Include the default mapping in prologue instead of epilogue to +# allow the user to override the default mapping. +# +--odb-prologue '#include ' + +--hxx-prologue '#include ' +--hxx-prologue '#include ' +--hxx-prologue '#include ' diff --git a/libodb-qt/odb/qt/date-time/exceptions.cxx b/libodb-qt/odb/qt/date-time/exceptions.cxx new file mode 100644 index 0000000..48f0540 --- /dev/null +++ b/libodb-qt/odb/qt/date-time/exceptions.cxx @@ -0,0 +1,25 @@ +// file : odb/qt/date-time/exceptions.cxx +// license : GNU GPL v2; see accompanying LICENSE file + +#include + +namespace odb +{ + namespace qt + { + namespace date_time + { + const char* value_out_of_range:: + what () const ODB_NOTHROW_NOEXCEPT + { + return "date/time value out of range"; + } + + value_out_of_range* value_out_of_range:: + clone () const + { + return new value_out_of_range (*this); + } + } + } +} diff --git a/libodb-qt/odb/qt/date-time/exceptions.hxx b/libodb-qt/odb/qt/date-time/exceptions.hxx new file mode 100644 index 0000000..7a73be2 --- /dev/null +++ b/libodb-qt/odb/qt/date-time/exceptions.hxx @@ -0,0 +1,34 @@ +// file : odb/qt/date-time/exceptions.hxx +// license : GNU GPL v2; see accompanying LICENSE file + +#ifndef ODB_QT_DATE_TIME_EXCEPTIONS_HXX +#define ODB_QT_DATE_TIME_EXCEPTIONS_HXX + +#include + +#include // ODB_NOTHROW_NOEXCEPT + +#include +#include + +namespace odb +{ + namespace qt + { + namespace date_time + { + struct LIBODB_QT_EXPORT value_out_of_range: exception + { + virtual const char* + what () const ODB_NOTHROW_NOEXCEPT; + + virtual value_out_of_range* + clone () const; + }; + } + } +} + +#include + +#endif // ODB_QT_DATE_TIME_EXCEPTIONS_HXX diff --git a/libodb-qt/odb/qt/date-time/mssql/default-mapping.hxx b/libodb-qt/odb/qt/date-time/mssql/default-mapping.hxx new file mode 100644 index 0000000..a8acb6b --- /dev/null +++ b/libodb-qt/odb/qt/date-time/mssql/default-mapping.hxx @@ -0,0 +1,31 @@ +// file : odb/qt/date-time/mssql/default-mapping.hxx +// license : GNU GPL v2; see accompanying LICENSE file + +#ifndef ODB_QT_DATE_TIME_MSSQL_DEFAULT_MAPPING_HXX +#define ODB_QT_DATE_TIME_MSSQL_DEFAULT_MAPPING_HXX + +#include +#include +#include + +// By default map QDate to SQL Server DATE (available only since SQL +// Server 2008). QDate provides a null representation so allow NULL +// values by default. +// +#pragma db value(QDate) type("DATE") null + +// By default map QTime to SQL Server TIME(3) (available only since SQL +// Server 2008). QTime can only represent clock times with a maximum +// precision of milliseconds. QTime provides a null representation so +// allow NULL values by default. +// +#pragma db value(QTime) type("TIME(3)") null + +// By default map QDateTime to SQL Server DATETIME2(3) (available only +// since SQL Server 2008). QDateTime can only represent clock times with +// a maximum precision of milliseconds. QDateTime provides a null +// representation so allow NULL values by default. +// +#pragma db value(QDateTime) type("DATETIME2(3)") null + +#endif // ODB_QT_DATE_TIME_MSSQL_DEFAULT_MAPPING_HXX diff --git a/libodb-qt/odb/qt/date-time/mssql/qdate-time-traits.hxx b/libodb-qt/odb/qt/date-time/mssql/qdate-time-traits.hxx new file mode 100644 index 0000000..5fd8a98 --- /dev/null +++ b/libodb-qt/odb/qt/date-time/mssql/qdate-time-traits.hxx @@ -0,0 +1,104 @@ +// file : odb/qt/date-time/mssql/qdate-time-traits.hxx +// license : GNU GPL v2; see accompanying LICENSE file + +#ifndef ODB_QT_DATE_TIME_MSSQL_QDATETIME_TRAITS_HXX +#define ODB_QT_DATE_TIME_MSSQL_QDATETIME_TRAITS_HXX + +#include + +#include + +#include + +namespace odb +{ + namespace mssql + { + template <> + struct default_value_traits + { + typedef QDateTime value_type; + typedef QDateTime query_type; + typedef datetime image_type; + + static void + set_value (QDateTime& v, const datetime& i, bool is_null) + { + if (is_null) + // Default constructor creates a null QDateTime. + // + v = QDateTime (); + else + v = QDateTime (QDate (i.year, + i.month, + i.day), + QTime (i.hour, + i.minute, + i.second, + static_cast (i.fraction / 1000000))); + } + + static void + set_image (datetime& i, + unsigned short s, + bool& is_null, + const QDateTime& v) + { + if (v.isNull ()) + is_null = true; + else + { + is_null = false; + + const QDate& d (v.date ()); + const QTime& t (v.time ()); + + is_null = false; + i.year = static_cast (d.year ()); + i.month = static_cast (d.month ()); + i.day = static_cast (d.day ()); + i.hour = static_cast (t.hour ()); + i.minute = static_cast (t.minute ()); + + // Scale value 8 indicates we are dealing with SMALLDATETIME + // which has the minutes precision. + // + if (s != 8) + { + i.second = static_cast (t.second ()); + + const unsigned int divider[8] = + { + 1000000000, + 100000000, + 10000000, + 1000000, + 100000, + 10000, + 1000, + 100 + }; + + unsigned int ns (static_cast (t.msec ()) * 1000000); + i.fraction = static_cast (ns - ns % divider[s]); + } + else + { + i.second = 0; + i.fraction = 0; + } + } + } + }; + + template <> + struct default_type_traits + { + static const database_type_id db_type_od = id_datetime; + }; + } +} + +#include + +#endif // ODB_QT_DATE_TIME_MSSQL_QDATETIME_TRAITS_HXX diff --git a/libodb-qt/odb/qt/date-time/mssql/qdate-traits.hxx b/libodb-qt/odb/qt/date-time/mssql/qdate-traits.hxx new file mode 100644 index 0000000..caa5d3c --- /dev/null +++ b/libodb-qt/odb/qt/date-time/mssql/qdate-traits.hxx @@ -0,0 +1,63 @@ +// file : odb/qt/date-time/mssql/qdate-traits.hxx +// license : GNU GPL v2; see accompanying LICENSE file + +#ifndef ODB_QT_DATE_TIME_MSSQL_QDATE_TRAITS_HXX +#define ODB_QT_DATE_TIME_MSSQL_QDATE_TRAITS_HXX + +#include + +#include + +#include + +#include + +namespace odb +{ + namespace mssql + { + template <> + struct default_value_traits + { + typedef QDate value_type; + typedef QDate query_type; + typedef date image_type; + + static void + set_value (QDate& v, const date& i, bool is_null) + { + if (is_null) + // A null QDate value is equivalent to an invalid QDate value. + // Set v to an invalid date to represent null. + // + v.setDate (0, 0, 0); + else + v.setDate (i.year, i.month, i.day); + } + + static void + set_image (date& i, bool& is_null, const QDate& v) + { + if (v.isNull ()) + is_null = true; + else + { + is_null = false; + i.year = static_cast (v.year ()); + i.month = static_cast (v.month ()); + i.day = static_cast (v.day ()); + } + } + }; + + template <> + struct default_type_traits + { + static const database_type_id db_type_id = id_date; + }; + } +} + +#include + +#endif // ODB_QT_DATE_TIME_MSSQL_QDATE_TRAITS_HXX diff --git a/libodb-qt/odb/qt/date-time/mssql/qtime-traits.hxx b/libodb-qt/odb/qt/date-time/mssql/qtime-traits.hxx new file mode 100644 index 0000000..88fbf41 --- /dev/null +++ b/libodb-qt/odb/qt/date-time/mssql/qtime-traits.hxx @@ -0,0 +1,80 @@ +// file : odb/qt/date-time/mssql/qtime-traits.hxx +// license : GNU GPL v2; see accompanying LICENSE file + +#ifndef ODB_QT_DATE_TIME_MSSQL_QTIME_TRAITS_HXX +#define ODB_QT_DATE_TIME_MSSQL_QTIME_TRAITS_HXX + +#include + +#include + +#include + +namespace odb +{ + namespace mssql + { + template <> + struct default_value_traits + { + typedef QTime value_type; + typedef QTime query_type; + typedef time image_type; + + static void + set_value (QTime& v, const time& i, bool is_null) + { + if (is_null) + // A null QTime value is equivalent to an invalid QTime value. + // Set v to an invalid time to represent null (hour value of + // a valid time must be in the range 0-23). + // + v.setHMS (24, 0, 0); + else + v.setHMS (i.hour, + i.minute, + i.second, + static_cast (i.fraction / 1000000)); + } + + static void + set_image (time& i, unsigned short s, bool& is_null, const QTime& v) + { + if (v.isNull ()) + is_null = true; + else + { + is_null = false; + i.hour = static_cast (v.hour ()); + i.minute = static_cast (v.minute ()); + i.second = static_cast (v.second ()); + + const unsigned int divider[8] = + { + 1000000000, + 100000000, + 10000000, + 1000000, + 100000, + 10000, + 1000, + 100 + }; + + unsigned int ns (static_cast (v.msec ()) * 1000000); + i.fraction = static_cast (ns - ns % divider[s]); + } + } + }; + + template <> + struct default_type_traits + { + static const database_type_id db_type_id = id_time; + }; + } +} + +#include + +#endif // ODB_QT_DATE_TIME_MSSQL_QTIME_TRAITS_HXX diff --git a/libodb-qt/odb/qt/date-time/mysql/default-mapping.hxx b/libodb-qt/odb/qt/date-time/mysql/default-mapping.hxx new file mode 100644 index 0000000..a88c507 --- /dev/null +++ b/libodb-qt/odb/qt/date-time/mysql/default-mapping.hxx @@ -0,0 +1,26 @@ +// file : odb/qt/date-time/mysql/default-mapping.hxx +// license : GNU GPL v2; see accompanying LICENSE file + +#ifndef ODB_QT_DATE_TIME_MYSQL_DEFAULT_MAPPING_HXX +#define ODB_QT_DATE_TIME_MYSQL_DEFAULT_MAPPING_HXX + +#include +#include +#include + +// Map QDate to MySQL DATE by default. QDate provides a null +// representation so allow NULL values by default. +// +#pragma db value(QDate) type("DATE") null + +// Map QTime to MySQL TIME by default. QTime provides a null +// representation so allow NULL values by default. +// +#pragma db value(QTime) type("TIME") null + +// Map QDateTime to MySQL DATETIME by default. QDateTime provides a null +// representation so allow NULL values by default. +// +#pragma db value(QDateTime) type("DATETIME") null + +#endif // ODB_QT_DATE_TIME_MYSQL_DEFAULT_MAPPING_HXX diff --git a/libodb-qt/odb/qt/date-time/mysql/qdate-time-traits.hxx b/libodb-qt/odb/qt/date-time/mysql/qdate-time-traits.hxx new file mode 100644 index 0000000..92279eb --- /dev/null +++ b/libodb-qt/odb/qt/date-time/mysql/qdate-time-traits.hxx @@ -0,0 +1,135 @@ +// file : odb/qt/date-time/mysql/qdate-time-traits.hxx +// license : GNU GPL v2; see accompanying LICENSE file + +#ifndef ODB_QT_DATE_TIME_MYSQL_QDATETIME_TRAITS_HXX +#define ODB_QT_DATE_TIME_MYSQL_QDATETIME_TRAITS_HXX + +#include + +#include + +#include + +namespace odb +{ + namespace mysql + { + template <> + struct default_value_traits + { + typedef QDateTime value_type; + typedef QDateTime query_type; + typedef MYSQL_TIME image_type; + + static void + set_value (QDateTime& v, const MYSQL_TIME& i, bool is_null) + { + if (is_null) + // Default constructor creates a null QDateTime. + // + v = QDateTime (); + else + // Since MySQL 5.6.4, the microseconds part is no longer ignored. + // + v = QDateTime (QDate (static_cast (i.year), + static_cast (i.month), + static_cast (i.day)), + QTime (static_cast (i.hour), + static_cast (i.minute), + static_cast (i.second), + static_cast (i.second_part / 1000))); + } + + static void + set_image (MYSQL_TIME& i, bool& is_null, const QDateTime& v) + { + if (v.isNull ()) + is_null = true; + else + { + if ((v < QDateTime (QDate (1000, 1, 1))) || + (v >= QDateTime (QDate (10000, 1, 1)))) + throw odb::qt::date_time::value_out_of_range (); + + is_null = false; + i.neg = false; + + const QDate& d (v.date ()); + i.year = static_cast (d.year ()); + i.month = static_cast (d.month ()); + i.day = static_cast (d.day ()); + + const QTime& t (v.time ()); + i.hour = static_cast (t.hour ()); + i.minute = static_cast (t.minute ()); + i.second = static_cast (t.second ()); + i.second_part = static_cast (t.msec ()) * 1000; + } + } + }; + + template <> + struct default_value_traits + { + typedef QDateTime value_type; + typedef QDateTime query_type; + typedef MYSQL_TIME image_type; + + static void + set_value (QDateTime& v, const MYSQL_TIME& i, bool is_null) + { + if (is_null) + // Default constructor creates a null QDateTime. + // + v = QDateTime (); + else + // Since MySQL 5.6.4, the microseconds part is no longer ignored. + // + v = QDateTime (QDate (static_cast (i.year), + static_cast (i.month), + static_cast (i.day)), + QTime (static_cast (i.hour), + static_cast (i.minute), + static_cast (i.second), + static_cast (i.second_part / 1000))); + } + + static void + set_image (MYSQL_TIME& i, bool& is_null, const QDateTime& v) + { + if (v.isNull ()) + is_null = true; + else + { + if ((v <= QDateTime (QDate (1970, 1, 1))) || + (v > QDateTime (QDate (2038, 1, 19), QTime (3, 14, 7)))) + throw odb::qt::date_time::value_out_of_range (); + + is_null = false; + i.neg = false; + + const QDate& d (v.date ()); + i.year = static_cast (d.year ()); + i.month = static_cast (d.month ()); + i.day = static_cast (d.day ()); + + const QTime& t (v.time ()); + i.hour = static_cast (t.hour ()); + i.minute = static_cast (t.minute ()); + i.second = static_cast (t.second ()); + i.second_part = static_cast (t.msec ()) * 1000; + } + } + }; + + template <> + struct default_type_traits + { + static const database_type_id db_type_od = id_datetime; + }; + } +} + +#include + +#endif // ODB_QT_DATE_TIME_MYSQL_QDATETIME_TRAITS_HXX diff --git a/libodb-qt/odb/qt/date-time/mysql/qdate-traits.hxx b/libodb-qt/odb/qt/date-time/mysql/qdate-traits.hxx new file mode 100644 index 0000000..12a00ec --- /dev/null +++ b/libodb-qt/odb/qt/date-time/mysql/qdate-traits.hxx @@ -0,0 +1,73 @@ +// file : odb/qt/date-time/mysql/qdate-traits.hxx +// license : GNU GPL v2; see accompanying LICENSE file + +#ifndef ODB_QT_DATE_TIME_MYSQL_QDATE_TRAITS_HXX +#define ODB_QT_DATE_TIME_MYSQL_QDATE_TRAITS_HXX + +#include + +#include + +#include +#include + +namespace odb +{ + namespace mysql + { + template <> + struct default_value_traits + { + typedef QDate value_type; + typedef QDate query_type; + typedef MYSQL_TIME image_type; + + static void + set_value (QDate& v, const MYSQL_TIME& i, bool is_null) + { + if (is_null) + // A null QDate value is equivalent to an invalid QDate value. + // Set v to an invalid date to represent null. + // + v.setDate (0, 0, 0); + else + v.setDate (static_cast (i.year), + static_cast (i.month), + static_cast (i.day)); + } + + static void + set_image (MYSQL_TIME& i, bool& is_null, const QDate& v) + { + if (v.isNull ()) + is_null = true; + else if ((v < QDate (1000, 1, 1)) || (v > QDate (9999, 12, 31))) + throw odb::qt::date_time::value_out_of_range (); + else + { + is_null = false; + i.neg = false; + + i.year = static_cast (v.year ()); + i.month = static_cast (v.month ()); + i.day = static_cast (v.day ()); + + i.hour = 0; + i.minute = 0; + i.second = 0; + i.second_part = 0; + } + } + }; + + template <> + struct default_type_traits + { + static const database_type_id db_type_id = id_date; + }; + } +} + +#include + +#endif // ODB_QT_DATE_TIME_MYSQL_QDATE_TRAITS_HXX diff --git a/libodb-qt/odb/qt/date-time/mysql/qtime-traits.hxx b/libodb-qt/odb/qt/date-time/mysql/qtime-traits.hxx new file mode 100644 index 0000000..c96e13f --- /dev/null +++ b/libodb-qt/odb/qt/date-time/mysql/qtime-traits.hxx @@ -0,0 +1,74 @@ +// file : odb/qt/date-time/mysql/qtime-traits.hxx +// license : GNU GPL v2; see accompanying LICENSE file + +#ifndef ODB_QT_DATE_TIME_MYSQL_QTIME_TRAITS_HXX +#define ODB_QT_DATE_TIME_MYSQL_QTIME_TRAITS_HXX + +#include + +#include + +#include + +namespace odb +{ + namespace mysql + { + template <> + struct default_value_traits + { + typedef QTime value_type; + typedef QTime query_type; + typedef MYSQL_TIME image_type; + + static void + set_value (QTime& v, const MYSQL_TIME& i, bool is_null) + { + if (is_null) + // A null QTime value is equivalent to an invalid QTime value. + // Set v to an invalid time to represent null (hour value of + // a valid time must be in the range 0-23). + // + v.setHMS (24, 0, 0); + else + // Since MySQL 5.6.4, the microseconds part is no longer ignored. + // + v.setHMS (static_cast (i.hour), + static_cast (i.minute), + static_cast (i.second), + static_cast (i.second_part / 1000)); + } + + static void + set_image (MYSQL_TIME& i, bool& is_null, const QTime& v) + { + if (v.isNull ()) + is_null = true; + else + { + is_null = false; + i.neg = false; + + i.year = 0; + i.month = 0; + i.day = 0; + + i.hour = static_cast (v.hour ()); + i.minute = static_cast (v.minute ()); + i.second = static_cast (v.second ()); + i.second_part = static_cast (v.msec ()) * 1000; + } + } + }; + + template <> + struct default_type_traits + { + static const database_type_id db_type_id = id_time; + }; + } +} + +#include + +#endif // ODB_QT_DATE_TIME_MYSQL_QTIME_TRAITS_HXX diff --git a/libodb-qt/odb/qt/date-time/oracle/default-mapping.hxx b/libodb-qt/odb/qt/date-time/oracle/default-mapping.hxx new file mode 100644 index 0000000..32a733a --- /dev/null +++ b/libodb-qt/odb/qt/date-time/oracle/default-mapping.hxx @@ -0,0 +1,29 @@ +// file : odb/qt/date-time/oracle/default-mapping.hxx +// license : GNU GPL v2; see accompanying LICENSE file + +#ifndef ODB_QT_DATE_TIME_ORACLE_DEFAULT_MAPPING_HXX +#define ODB_QT_DATE_TIME_ORACLE_DEFAULT_MAPPING_HXX + +#include +#include +#include + +// Map QDate to Oracle DATE by default. QDate provides a null representation +// so allow NULL values by default. +// +#pragma db value(QDate) type("DATE") null + +// Map QTime to Oracle INTERVAL DAY(0) TO SECOND(3) by default. QTime can +// only represent clock times with a maximum precision of milliseconds. +// QTime provides a null representation so allow NULL values by default. +// +#pragma db value(QTime) type("INTERVAL DAY(0) TO SECOND(3)") null + +// Map QDateTime to Oracle TIMESTAMP(3) by default. QDateTime can only +// represent clock times with a maximum precision of milliseconds. +// QDateTime provides a null representation so allow NULL values by +// default. +// +#pragma db value(QDateTime) type("TIMESTAMP(3)") null + +#endif // ODB_QT_DATE_TIME_ORACLE_DEFAULT_MAPPING_HXX diff --git a/libodb-qt/odb/qt/date-time/oracle/qdate-time-traits.hxx b/libodb-qt/odb/qt/date-time/oracle/qdate-time-traits.hxx new file mode 100644 index 0000000..ba90075 --- /dev/null +++ b/libodb-qt/odb/qt/date-time/oracle/qdate-time-traits.hxx @@ -0,0 +1,136 @@ +// file : odb/qt/date-time/oracle/qdate-time-traits.hxx +// license : GNU GPL v2; see accompanying LICENSE file + +#ifndef ODB_QT_DATE_TIME_ORACLE_QDATETIME_TRAITS_HXX +#define ODB_QT_DATE_TIME_ORACLE_QDATETIME_TRAITS_HXX + +#include + +#include + +#include +#include + +namespace odb +{ + namespace oracle + { + template <> + struct default_value_traits + { + typedef QDateTime value_type; + typedef QDateTime query_type; + typedef datetime image_type; + + static void + set_value (QDateTime& v, const datetime& i, bool is_null) + { + if (is_null) + // Default constructor creates a null QDateTime. + // + v = QDateTime (); + else + { + sb2 y (0); + ub1 m (0), d (0), h (0), minute (0), s (0); + ub4 ns (0); + i.get (y, m, d, h, minute, s, ns); + + v = QDateTime (QDate (static_cast (y), + static_cast (m), + static_cast (d)), + QTime (static_cast (h), + static_cast (minute), + static_cast (s), + static_cast (ns / 1000000))); + } + } + + static void + set_image (datetime& i, bool& is_null, const QDateTime& v) + { + if (v.isNull ()) + is_null = true; + else + { + is_null = false; + + const QDate& d (v.date ()); + const QTime& t (v.time ()); + + i.set (static_cast (d.year ()), + static_cast (d.month ()), + static_cast (d.day ()), + static_cast (t.hour ()), + static_cast (t.minute ()), + static_cast (t.second ()), + static_cast (t.msec () * 1000000)); + } + } + }; + + template <> + struct default_value_traits + { + typedef QDateTime value_type; + typedef QDateTime query_type; + typedef char* image_type; + + static void + set_value (QDateTime& v, const char* b, bool is_null) + { + if (is_null) + // Default constructor creates a null QDateTime. + // + v = QDateTime (); + else + { + short y; + unsigned char m, d, h, minute, s; + + details::get_date (b, y, m, d, h, minute, s); + + v = QDateTime (QDate (static_cast (y), + static_cast (m), + static_cast (d)), + QTime (static_cast (h), + static_cast (minute), + static_cast (s), + 0)); + } + } + + static void + set_image (char* b, bool& is_null, const QDateTime& v) + { + if (v.isNull ()) + is_null = true; + else + { + is_null = false; + + const QDate& d (v.date ()); + const QTime& t (v.time ()); + + details::set_date (b, + static_cast (d.year ()), + static_cast (d.month ()), + static_cast (d.day ()), + static_cast (t.hour ()), + static_cast (t.minute ()), + static_cast (t.second ())); + } + } + }; + + template <> + struct default_type_traits + { + static const database_type_id db_type_od = id_timestamp; + }; + } +} + +#include + +#endif // ODB_QT_DATE_TIME_ORACLE_QDATETIME_TRAITS_HXX diff --git a/libodb-qt/odb/qt/date-time/oracle/qdate-traits.hxx b/libodb-qt/odb/qt/date-time/oracle/qdate-traits.hxx new file mode 100644 index 0000000..f293e2d --- /dev/null +++ b/libodb-qt/odb/qt/date-time/oracle/qdate-traits.hxx @@ -0,0 +1,76 @@ +// file : odb/qt/date-time/oracle/qdate-traits.hxx +// license : GNU GPL v2; see accompanying LICENSE file + +#ifndef ODB_QT_DATE_TIME_ORACLE_QDATE_TRAITS_HXX +#define ODB_QT_DATE_TIME_ORACLE_QDATE_TRAITS_HXX + +#include + +#include + +#include + +#include + +#include + +namespace odb +{ + namespace oracle + { + template <> + struct default_value_traits + { + typedef QDate value_type; + typedef QDate query_type; + typedef char* image_type; + + static void + set_value (QDate& v, const char* b, bool is_null) + { + if (is_null) + // A null QDate value is equivalent to an invalid QDate value. + // Set v to an invalid date to represent null. + // + v.setDate (0, 0, 0); + else + { + short y (0); + unsigned char m (0), d (0), h (0), minute (0), s (0); + details::get_date (b, y, m, d, h, minute, s); + + v.setDate (y, m, d); + } + } + + static void + set_image (char* b, bool& is_null, const QDate& v) + { + if (v.isNull ()) + is_null = true; + else + { + is_null = false; + + details::set_date (b, + static_cast (v.year ()), + static_cast (v.month ()), + static_cast (v.day ()), + 0, + 0, + 0); + } + } + }; + + template <> + struct default_type_traits + { + static const database_type_id db_type_id = id_date; + }; + } +} + +#include + +#endif // ODB_QT_DATE_TIME_ORACLE_QDATE_TRAITS_HXX diff --git a/libodb-qt/odb/qt/date-time/oracle/qtime-traits.hxx b/libodb-qt/odb/qt/date-time/oracle/qtime-traits.hxx new file mode 100644 index 0000000..0d9aff4 --- /dev/null +++ b/libodb-qt/odb/qt/date-time/oracle/qtime-traits.hxx @@ -0,0 +1,66 @@ +// file : odb/qt/date-time/oracle/qtime-traits.hxx +// license : GNU GPL v2; see accompanying LICENSE file + +#ifndef ODB_QT_DATE_TIME_ORACLE_QTIME_TRAITS_HXX +#define ODB_QT_DATE_TIME_ORACLE_QTIME_TRAITS_HXX + +#include + +#include + +#include + +namespace odb +{ + namespace oracle + { + template <> + struct default_value_traits + { + typedef QTime value_type; + typedef QTime query_type; + typedef interval_ds image_type; + + static void + set_value (QTime& v, const interval_ds& i, bool is_null) + { + if (is_null) + // A null QTime value is equivalent to an invalid QTime value. + // Set v to an invalid time to represent null (hour value of + // a valid time must be in the range 0-23). + // + v.setHMS (24, 0, 0); + else + { + sb4 d (0), h (0), m (0), s (0), ns (0); + i.get (d, h, m, s, ns); + + v.setHMS (h, m, s, ns / 1000000); + } + } + + static void + set_image (interval_ds& i, bool& is_null, const QTime& v) + { + if (v.isNull ()) + is_null = true; + else + { + is_null = false; + + i.set (0, v.hour (), v.minute (), v.second (), v.msec () * 1000000); + } + } + }; + + template <> + struct default_type_traits + { + static const database_type_id db_type_id = id_interval_ds; + }; + } +} + +#include + +#endif // ODB_QT_DATE_TIME_ORACLE_QTIME_TRAITS_HXX diff --git a/libodb-qt/odb/qt/date-time/pgsql/default-mapping.hxx b/libodb-qt/odb/qt/date-time/pgsql/default-mapping.hxx new file mode 100644 index 0000000..cd3b1b5 --- /dev/null +++ b/libodb-qt/odb/qt/date-time/pgsql/default-mapping.hxx @@ -0,0 +1,26 @@ +// file : odb/qt/date-time/pgsql/default-mapping.hxx +// license : GNU GPL v2; see accompanying LICENSE file + +#ifndef ODB_QT_DATE_TIME_PGSQL_DEFAULT_MAPPING_HXX +#define ODB_QT_DATE_TIME_PGSQL_DEFAULT_MAPPING_HXX + +#include +#include +#include + +// Map QDate to PostgreSQL DATE by default. QDate provides a null +// representation so allow NULL values by default. +// +#pragma db value(QDate) type("DATE") null + +// Map QTime to PostgreSQL TIME by default. QTime provides a null +// representation so allow NULL values by default. +// +#pragma db value(QTime) type("TIME") null + +// Map QDateTime to PostgreSQL TIMESTAMP by default. QDateTime provides a null +// representation so allow NULL values by default. +// +#pragma db value(QDateTime) type("TIMESTAMP") null + +#endif // ODB_QT_DATE_TIME_PGSQL_DEFAULT_MAPPING_HXX diff --git a/libodb-qt/odb/qt/date-time/pgsql/qdate-time-traits.hxx b/libodb-qt/odb/qt/date-time/pgsql/qdate-time-traits.hxx new file mode 100644 index 0000000..a9fe757 --- /dev/null +++ b/libodb-qt/odb/qt/date-time/pgsql/qdate-time-traits.hxx @@ -0,0 +1,70 @@ +// file : odb/qt/date-time/pgsql/qdatetime-traits.hxx +// license : GNU GPL v2; see accompanying LICENSE file + +#ifndef ODB_QT_DATE_TIME_PGSQL_QDATETIME_TRAITS_HXX +#define ODB_QT_DATE_TIME_PGSQL_QDATETIME_TRAITS_HXX + +#include + +#include + +#include + +namespace odb +{ + namespace pgsql + { + // Implementation of mapping between QDateTime and PostgreSQL TIMESTAMP. + // TIMESTAMP values are stored as micro-seconds since the PostgreSQL + // epoch 2000-01-01. + // + template <> + struct default_value_traits + { + typedef details::endian_traits endian_traits; + + typedef QDateTime value_type; + typedef QDateTime query_type; + typedef long long image_type; + + static void + set_value (QDateTime& v, long long i, bool is_null) + { + if (is_null) + // Default constructor creates a null QDateTime. + // + v = QDateTime (); + else + { + const QDateTime pg_epoch (QDate (2000, 1, 1), QTime (0, 0, 0)); + v = pg_epoch.addMSecs ( + static_cast (endian_traits::ntoh (i) / 1000LL)); + } + } + + static void + set_image (long long& i, bool& is_null, const QDateTime& v) + { + if (v.isNull ()) + is_null = true; + else + { + is_null = false; + const QDateTime pg_epoch (QDate (2000, 1, 1), QTime (0, 0, 0)); + i = endian_traits::hton ( + static_cast (pg_epoch.msecsTo (v)) * 1000LL); + } + } + }; + + template <> + struct default_type_traits + { + static const database_type_id db_type_id = id_timestamp; + }; + } +} + +#include + +#endif // ODB_QT_DATE_TIME_PGSQL_QDATETIME_TRAITS_HXX diff --git a/libodb-qt/odb/qt/date-time/pgsql/qdate-traits.hxx b/libodb-qt/odb/qt/date-time/pgsql/qdate-traits.hxx new file mode 100644 index 0000000..b7cc7d4 --- /dev/null +++ b/libodb-qt/odb/qt/date-time/pgsql/qdate-traits.hxx @@ -0,0 +1,70 @@ +// file : odb/qt/date-time/pgsql/qdate-traits.hxx +// license : GNU GPL v2; see accompanying LICENSE file + +#ifndef ODB_QT_DATE_TIME_PGSQL_QDATE_TRAITS_HXX +#define ODB_QT_DATE_TIME_PGSQL_QDATE_TRAITS_HXX + +#include + +#include + +#include + +namespace odb +{ + namespace pgsql + { + // Implementation of the mapping between QDate and PostgreSQL DATE. The + // DATE values are stored as days since the PostgreSQL epoch 2000-01-01. + // + template <> + struct default_value_traits + { + typedef details::endian_traits endian_traits; + + typedef QDate value_type; + typedef QDate query_type; + typedef int image_type; + + static void + set_value (QDate& v, int i, bool is_null) + { + if (is_null) + // A null QDate value is equivalent to an invalid QDate value. + // Set v to an invalid date to represent null. + // + v.setDate (0, 0, 0); + else + { + const QDate pg_epoch (2000, 1, 1); + v = pg_epoch.addDays (endian_traits::ntoh (i)); + } + } + + static void + set_image (int& i, bool& is_null, const QDate& v) + { + if (v.isNull ()) + is_null = true; + else + { + is_null = false; + const QDate pg_epoch (2000, 1, 1); + // In Qt5 daysTo() returns qint64. + // + i = endian_traits::hton (static_cast (pg_epoch.daysTo (v))); + } + } + }; + + template <> + struct default_type_traits + { + static const database_type_id db_type_id = id_date; + }; + } +} + +#include + +#endif // ODB_QT_DATE_TIME_PGSQL_QDATE_TRAITS_HXX diff --git a/libodb-qt/odb/qt/date-time/pgsql/qtime-traits.hxx b/libodb-qt/odb/qt/date-time/pgsql/qtime-traits.hxx new file mode 100644 index 0000000..86a594b --- /dev/null +++ b/libodb-qt/odb/qt/date-time/pgsql/qtime-traits.hxx @@ -0,0 +1,73 @@ +// file : odb/qt/date-time/pgsql/qtime-traits.hxx +// license : GNU GPL v2; see accompanying LICENSE file + +#ifndef ODB_QT_DATE_TIME_PGSQL_QTIME_TRAITS_HXX +#define ODB_QT_DATE_TIME_PGSQL_QTIME_TRAITS_HXX + +#include + +#include + +#include + +namespace odb +{ + namespace pgsql + { + // Implementation of the mapping between QTime and PostgreSQL TIME. The + // TIME values are stored as micro-seconds since 00:00:00. + // + template <> + struct default_value_traits + { + typedef details::endian_traits endian_traits; + + typedef QTime value_type; + typedef QTime query_type; + typedef long long image_type; + + static void + set_value (QTime& v, long long i, bool is_null) + { + if (is_null) + // A null QTime value is equivalent to an invalid QTime value. + // Set v to an invalid time to represent null (hour value of + // a valid time must be in the range 0-23). + // + v.setHMS (24, 0, 0); + else + { + const QTime base (0, 0, 0); + + v = base.addMSecs ( + static_cast (endian_traits::ntoh (i) / 1000)); + } + } + + static void + set_image (long long& i, bool& is_null, const QTime& v) + { + if (v.isNull ()) + is_null = true; + else + { + is_null = false; + const QTime base (0, 0, 0); + + i = endian_traits::hton ( + static_cast (base.msecsTo (v)) * 1000); + } + } + }; + + template <> + struct default_type_traits + { + static const database_type_id db_type_id = id_time; + }; + } +} + +#include + +#endif // ODB_QT_DATE_TIME_PGSQL_QTIME_TRAITS_HXX diff --git a/libodb-qt/odb/qt/date-time/sqlite/default-mapping.hxx b/libodb-qt/odb/qt/date-time/sqlite/default-mapping.hxx new file mode 100644 index 0000000..a150ca9 --- /dev/null +++ b/libodb-qt/odb/qt/date-time/sqlite/default-mapping.hxx @@ -0,0 +1,26 @@ +// file : odb/qt/date-time/sqlite/default-mapping.hxx +// license : GNU GPL v2; see accompanying LICENSE file + +#ifndef ODB_QT_DATE_TIME_SQLITE_DEFAULT_MAPPING_HXX +#define ODB_QT_DATE_TIME_SQLITE_DEFAULT_MAPPING_HXX + +#include +#include +#include + +// Map QDate to SQLite TEXT by default. QDate provides a null representation +// so allow NULL values by default. +// +#pragma db value(QDate) type("TEXT") null + +// Map QTime to SQLite TEXT by default. QTime provides a null representation +// so allow NULL values by default. +// +#pragma db value(QTime) type("TEXT") null + +// Map QDateTime to SQLite TEXT by default. QDateTime provides a null +// representation so allow NULL values by default. +// +#pragma db value(QDateTime) type("TEXT") null + +#endif // ODB_QT_DATE_TIME_SQLITE_DEFAULT_MAPPING_HXX diff --git a/libodb-qt/odb/qt/date-time/sqlite/qdate-time-traits.hxx b/libodb-qt/odb/qt/date-time/sqlite/qdate-time-traits.hxx new file mode 100644 index 0000000..db561fc --- /dev/null +++ b/libodb-qt/odb/qt/date-time/sqlite/qdate-time-traits.hxx @@ -0,0 +1,138 @@ +// file : odb/qt/date-time/sqlite/qdatetime-traits.hxx +// license : GNU GPL v2; see accompanying LICENSE file + +#ifndef ODB_QT_DATE_TIME_SQLITE_QDATETIME_TRAITS_HXX +#define ODB_QT_DATE_TIME_SQLITE_QDATETIME_TRAITS_HXX + +#include + +#include +#include // std::size_t +#include // std::memcpy + +#include // QT_VERSION + +#include + +#include +#include +#include + +namespace odb +{ + namespace sqlite + { + template <> + struct default_value_traits + { + typedef QDateTime value_type; + typedef QDateTime query_type; + typedef details::buffer image_type; + + static void + set_value (QDateTime& v, + const details::buffer& i, + std::size_t n, + bool is_null) + { + if (is_null) + // Default constructor creates a null QDateTime. + // + v = QDateTime (); + else + v = QDateTime::fromString ( + QString::fromLatin1 (i.data (), static_cast (n)), + "yyyy-MM-ddTHH:mm:ss.zzz"); + } + + static void + set_image (details::buffer& i, + std::size_t& n, + bool& is_null, + const QDateTime& v) + { + if (v.isNull ()) + is_null = true; + else + { + is_null = false; + + // Cannot use toStdString() here since Qt could have been + // configured without the STL compatibility support. + // + std::string s ( + v.toString ("yyyy-MM-ddTHH:mm:ss.zzz").toLatin1 ().constData ()); + + n = s.size (); + if (n > i.capacity ()) + i.capacity (n); + + std::memcpy (i.data (), s.data (), n); + } + } + }; + + // Implementation of mapping between QDateTime and SQLite INTEGER. + // The integer value represents UNIX time. + // + template <> + struct default_value_traits + { + typedef QDateTime value_type; + typedef QDateTime query_type; + typedef long long image_type; + + static void + set_value (QDateTime& v, long long i, bool is_null) + { + if (is_null) + // Default constructor creates a null QDateTime. + // + v = QDateTime (); + else + { + v.setTimeSpec (Qt::UTC); + + // *Time_t() functions are deprecated in favor of *SecsSinceEpoch(). + // +#if QT_VERSION < 0x060000 + v.setTime_t (static_cast (i)); +#else + v.setSecsSinceEpoch (static_cast (i)); +#endif + } + } + + static void + set_image (long long& i, bool& is_null, const QDateTime& v) + { + if (v.isNull ()) + is_null = true; + else if (v < QDateTime (QDate (1970, 1, 1), + QTime (0, 0, 0), + Qt::UTC)) + throw odb::qt::date_time::value_out_of_range (); + else + { + is_null = false; + +#if QT_VERSION < 0x060000 + i = static_cast (v.toTime_t ()); +#else + i = static_cast (v.toSecsSinceEpoch ()); +#endif + } + } + }; + + template <> + struct default_type_traits + { + static const database_type_id db_type_id = id_text; + }; + } +} + +#include + +#endif // ODB_QT_DATE_TIME_SQLITE_QDATETIME_TRAITS_HXX diff --git a/libodb-qt/odb/qt/date-time/sqlite/qdate-traits.hxx b/libodb-qt/odb/qt/date-time/sqlite/qdate-traits.hxx new file mode 100644 index 0000000..52721b7 --- /dev/null +++ b/libodb-qt/odb/qt/date-time/sqlite/qdate-traits.hxx @@ -0,0 +1,141 @@ +// file : odb/qt/date-time/sqlite/qdate-traits.hxx +// license : GNU GPL v2; see accompanying LICENSE file + +#ifndef ODB_QT_DATE_TIME_SQLITE_QDATE_TRAITS_HXX +#define ODB_QT_DATE_TIME_SQLITE_QDATE_TRAITS_HXX + +#include + +#include +#include // std::size_t +#include // std::memcpy + +#include // QT_VERSION + +#include +#include + +#include +#include +#include + +namespace odb +{ + namespace sqlite + { + template <> + struct default_value_traits + { + typedef QDate value_type; + typedef QDate query_type; + typedef details::buffer image_type; + + static void + set_value (QDate& v, + const details::buffer& i, + std::size_t n, + bool is_null) + { + if (is_null) + // A null QDate value is equivalent to an invalid QDate value. + // Set v to an invalid date to represent null. + // + v.setDate (0, 0, 0); + else + v = QDate::fromString ( + QString::fromLatin1 (i.data (), static_cast (n)), + "yyyy-MM-dd"); + } + + static void + set_image (details::buffer& i, + std::size_t& n, + bool& is_null, + const QDate& v) + { + if (v.isNull ()) + is_null = true; + else + { + is_null = false; + + // Cannot use toStdString() here since Qt could have been + // configured without the STL compatibility support. + // + std::string s (v.toString ("yyyy-MM-dd").toLatin1 ().constData ()); + + n = s.size (); + if (n > i.capacity ()) + i.capacity (n); + + std::memcpy (i.data (), s.data (), n); + } + } + }; + + // Implementation of the mapping between QDate and SQLite INTEGER. The + // integer value represents UNIX time. + // + template <> + struct default_value_traits + { + typedef QDate value_type; + typedef QDate query_type; + typedef long long image_type; + + static void + set_value (QDate& v, long long i, bool is_null) + { + if (is_null) + // A null QDate value is equivalent to an invalid QDate value. + // Set v to an invalid date to represent null. + // + v.setDate (0, 0, 0); + else + { + QDateTime dt; + dt.setTimeSpec (Qt::UTC); + + // *Time_t() functions are deprecated in favor of *SecsSinceEpoch(). + // +#if QT_VERSION < 0x060000 + dt.setTime_t (static_cast (i)); +#else + dt.setSecsSinceEpoch (static_cast (i)); +#endif + v = dt.date (); + } + } + + static void + set_image (long long& i, bool& is_null, const QDate& v) + { + if (v.isNull ()) + is_null = true; + else if (v < QDate (1970, 1, 1)) + throw odb::qt::date_time::value_out_of_range (); + else + { + is_null = false; + const QDateTime dt (v, QTime (0, 0, 0), Qt::UTC); + +#if QT_VERSION < 0x060000 + i = static_cast (dt.toTime_t ()); +#else + i = static_cast (dt.toSecsSinceEpoch ()); +#endif + } + } + }; + + template <> + struct default_type_traits + { + static const database_type_id db_type_id = id_text; + }; + } +} + +#include + +#endif // ODB_QT_DATE_TIME_SQLITE_QDATE_TRAITS_HXX diff --git a/libodb-qt/odb/qt/date-time/sqlite/qtime-traits.hxx b/libodb-qt/odb/qt/date-time/sqlite/qtime-traits.hxx new file mode 100644 index 0000000..dd86399 --- /dev/null +++ b/libodb-qt/odb/qt/date-time/sqlite/qtime-traits.hxx @@ -0,0 +1,120 @@ +// file : odb/qt/date-time/sqlite/qtime-traits.hxx +// license : GNU GPL v2; see accompanying LICENSE file + +#ifndef ODB_QT_DATE_TIME_SQLITE_QTIME_TRAITS_HXX +#define ODB_QT_DATE_TIME_SQLITE_QTIME_TRAITS_HXX + +#include + +#include +#include // std::size_t +#include // std::memcpy + +#include + +#include +#include + +namespace odb +{ + namespace sqlite + { + template <> + struct default_value_traits + { + typedef QTime value_type; + typedef QTime query_type; + typedef details::buffer image_type; + + static void + set_value (QTime& v, + const details::buffer& i, + std::size_t n, + bool is_null) + { + if (is_null) + // A null QTime value is equivalent to an invalid QTime value. + // Set v to an invalid time to represent null (hour value of + // a valid time must be in the range 0-23). + // + v.setHMS (24, 0, 0); + else + v = QTime::fromString ( + QString::fromLatin1 (i.data (), static_cast (n)), + "HH:mm:ss.zzz"); + } + + static void + set_image (details::buffer& i, + std::size_t& n, + bool& is_null, + const QTime& v) + { + if (v.isNull ()) + is_null = true; + else + { + is_null = false; + + // Cannot use toStdString() here since Qt could have been + // configured without the STL compatibility support. + // + std::string s ( + v.toString ("HH:mm:ss.zzz").toLatin1 ().constData ()); + + n = s.size (); + if (n > i.capacity ()) + i.capacity (n); + + std::memcpy (i.data (), s.data (), n); + } + } + }; + + // Implementation of mapping between QTime and SQLite INTEGER. The + // integer value represents seconds since midnight. + // + template <> + struct default_value_traits + { + typedef QTime value_type; + typedef QTime query_type; + typedef long long image_type; + + static void + set_value (QTime& v, long long i, bool is_null) + { + if (is_null) + // A null QTime value is equivalent to an invalid QTime value. + // Set v to an invalid time to represent null (hour value of + // a valid time must be in the range 0-23). + // + v.setHMS (24, 0, 0); + else + v = QTime (0, 0, 0).addSecs (static_cast (i)); + } + + static void + set_image (long long& i, bool& is_null, const QTime& v) + { + if (v.isNull ()) + is_null = true; + else + { + is_null = false; + i = static_cast (QTime (0, 0, 0).secsTo (v)); + } + } + }; + + template <> + struct default_type_traits + { + static const database_type_id db_type_id = id_text; + }; + } +} + +#include + +#endif // ODB_QT_DATE_TIME_SQLITE_QTIME_TRAITS_HXX diff --git a/libodb-qt/odb/qt/details/build2/config-stub.h b/libodb-qt/odb/qt/details/build2/config-stub.h new file mode 100644 index 0000000..fbb2971 --- /dev/null +++ b/libodb-qt/odb/qt/details/build2/config-stub.h @@ -0,0 +1,5 @@ +/* file : odb/qt/details/build2/config-stub.h + * license : GNU GPL v2; see accompanying LICENSE file + */ + +#include diff --git a/libodb-qt/odb/qt/details/build2/config-vc-stub.h b/libodb-qt/odb/qt/details/build2/config-vc-stub.h new file mode 100644 index 0000000..e6a412d --- /dev/null +++ b/libodb-qt/odb/qt/details/build2/config-vc-stub.h @@ -0,0 +1,5 @@ +/* file : odb/qt/details/build2/config-vc-stub.h + * license : GNU GPL v2; see accompanying LICENSE file + */ + +#include diff --git a/libodb-qt/odb/qt/details/build2/config-vc.h b/libodb-qt/odb/qt/details/build2/config-vc.h new file mode 100644 index 0000000..36113ce --- /dev/null +++ b/libodb-qt/odb/qt/details/build2/config-vc.h @@ -0,0 +1,15 @@ +/* file : odb/qt/details/build2/config-vc.h + * license : GNU GPL v2; see accompanying LICENSE file + */ + +/* Configuration file for Windows/VC++ for the build2 build. */ + +#ifndef ODB_QT_DETAILS_CONFIG_VC_H +#define ODB_QT_DETAILS_CONFIG_VC_H + +/* Define LIBODB_QT_BUILD2 for the installed case. */ +#ifndef LIBODB_QT_BUILD2 +# define LIBODB_QT_BUILD2 +#endif + +#endif /* ODB_QT_DETAILS_CONFIG_VC_H */ diff --git a/libodb-qt/odb/qt/details/build2/config.h b/libodb-qt/odb/qt/details/build2/config.h new file mode 100644 index 0000000..12d168f --- /dev/null +++ b/libodb-qt/odb/qt/details/build2/config.h @@ -0,0 +1,17 @@ +/* file : odb/qt/details/build2/config.h + * license : GNU GPL v2; see accompanying LICENSE file + */ + +/* Static configuration file for the build2 build. The installed case + (when LIBODB_QT_BUILD2 is not necessarily defined) is the only + reason we have it. */ + +#ifndef ODB_QT_DETAILS_CONFIG_H +#define ODB_QT_DETAILS_CONFIG_H + +/* Define LIBODB_QT_BUILD2 for the installed case. */ +#ifndef LIBODB_QT_BUILD2 +# define LIBODB_QT_BUILD2 +#endif + +#endif /* ODB_QT_DETAILS_CONFIG_H */ diff --git a/libodb-qt/odb/qt/details/config-vc.h b/libodb-qt/odb/qt/details/config-vc.h new file mode 100644 index 0000000..6718a07 --- /dev/null +++ b/libodb-qt/odb/qt/details/config-vc.h @@ -0,0 +1,5 @@ +/* file : odb/qt/details/config-vc.h + * license : GNU GPL v2; see accompanying LICENSE file + */ + +/* Dummy configuration file for Windows/VC++. */ diff --git a/libodb-qt/odb/qt/details/config.h.in b/libodb-qt/odb/qt/details/config.h.in new file mode 100644 index 0000000..a0c3989 --- /dev/null +++ b/libodb-qt/odb/qt/details/config.h.in @@ -0,0 +1,12 @@ +/* file : odb/qt/details/config.h.in + * license : GNU GPL v2; see accompanying LICENSE file + */ + +/* This file is automatically processed by configure. */ + +#ifndef ODB_QT_DETAILS_CONFIG_H +#define ODB_QT_DETAILS_CONFIG_H + +#undef LIBODB_QT_STATIC_LIB + +#endif /* ODB_QT_DETAILS_CONFIG_H */ diff --git a/libodb-qt/odb/qt/details/config.hxx b/libodb-qt/odb/qt/details/config.hxx new file mode 100644 index 0000000..9077380 --- /dev/null +++ b/libodb-qt/odb/qt/details/config.hxx @@ -0,0 +1,38 @@ +// file : odb/qt/details/config.hxx +// license : GNU GPL v2; see accompanying LICENSE file + +#ifndef ODB_QT_DETAILS_CONFIG_HXX +#define ODB_QT_DETAILS_CONFIG_HXX + +// no pre + +// Qt5 may complain if we are building without -fPIC. Instead of asking the +// user to pass one of these options to the ODB compiler (which can, BTW, be +// done with -x -fPIC, for example, if one is not using the Qt profile), we +// are going to define __PIC__ ourselves just to silence Qt. We also want to +// try to minimize this to cases where it is actually necessary. To achieve +// this, we need to include the Qt config file without including , +// which is where the test for PIE is. While newer versions of Qt (from 4.7) +// have , to support older versions we will include qconfig.h +// directly. This file appears to be present in all the versions starting with +// Qt 4.0. +// +#ifdef ODB_COMPILER +# if defined(__ELF__) && !defined(__PIC__) +# include // QT_REDUCE_RELOCATIONS +# ifdef QT_REDUCE_RELOCATIONS +# define __PIC__ +# endif +# endif +# define LIBODB_QT_STATIC_LIB +#elif !defined(LIBODB_QT_BUILD2) +# ifdef _MSC_VER +# include +# else +# include +# endif +#endif + +// no post + +#endif // ODB_QT_DETAILS_CONFIG_HXX diff --git a/libodb-qt/odb/qt/details/export.hxx b/libodb-qt/odb/qt/details/export.hxx new file mode 100644 index 0000000..4c0097f --- /dev/null +++ b/libodb-qt/odb/qt/details/export.hxx @@ -0,0 +1,78 @@ +// file : odb/qt/details/export.hxx +// license : GNU GPL v2; see accompanying LICENSE file + +#ifndef ODB_QT_DETAILS_EXPORT_HXX +#define ODB_QT_DETAILS_EXPORT_HXX + +#include + +#include + +// Normally we don't export class templates (but do complete specializations), +// inline functions, and classes with only inline member functions. Exporting +// classes that inherit from non-exported/imported bases (e.g., std::string) +// will end up badly. The only known workarounds are to not inherit or to not +// export. Also, MinGW GCC doesn't like seeing non-exported function being +// used before their inline definition. The workaround is to reorder code. In +// the end it's all trial and error. + +#ifdef LIBODB_QT_BUILD2 + +#if defined(LIBODB_QT_STATIC) // Using static. +# define LIBODB_QT_EXPORT +#elif defined(LIBODB_QT_STATIC_BUILD) // Building static. +# define LIBODB_QT_EXPORT +#elif defined(LIBODB_QT_SHARED) // Using shared. +# ifdef _WIN32 +# define LIBODB_QT_EXPORT __declspec(dllimport) +# else +# define LIBODB_QT_EXPORT +# endif +#elif defined(LIBODB_QT_SHARED_BUILD) // Building shared. +# ifdef _WIN32 +# define LIBODB_QT_EXPORT __declspec(dllexport) +# else +# define LIBODB_QT_EXPORT +# endif +#else +// If none of the above macros are defined, then we assume we are being used +// by some third-party build system that cannot/doesn't signal the library +// type. Note that this fallback works for both static and shared but in case +// of shared will be sub-optimal compared to having dllimport. +// +# define LIBODB_QT_EXPORT // Using static or shared. +#endif + +#else // LIBODB_QT_BUILD2 + +#ifdef LIBODB_QT_STATIC_LIB +# define LIBODB_QT_EXPORT +#else +# ifdef _WIN32 +# ifdef _MSC_VER +# ifdef LIBODB_QT_DYNAMIC_LIB +# define LIBODB_QT_EXPORT __declspec(dllexport) +# else +# define LIBODB_QT_EXPORT __declspec(dllimport) +# endif +# else +# ifdef LIBODB_QT_DYNAMIC_LIB +# ifdef DLL_EXPORT +# define LIBODB_QT_EXPORT __declspec(dllexport) +# else +# define LIBODB_QT_EXPORT +# endif +# else +# define LIBODB_QT_EXPORT __declspec(dllimport) +# endif +# endif +# else +# define LIBODB_QT_EXPORT +# endif +#endif + +#endif // LIBODB_QT_BUILD2 + +#include + +#endif // ODB_QT_DETAILS_EXPORT_HXX diff --git a/libodb-qt/odb/qt/exception.hxx b/libodb-qt/odb/qt/exception.hxx new file mode 100644 index 0000000..44646d5 --- /dev/null +++ b/libodb-qt/odb/qt/exception.hxx @@ -0,0 +1,28 @@ +// file : odb/qt/exception.hxx +// license : GNU GPL v2; see accompanying LICENSE file + +#ifndef ODB_QT_EXCEPTION_HXX +#define ODB_QT_EXCEPTION_HXX + +#include + +#include + +#include // ODB_NOTHROW_NOEXCEPT +#include + +namespace odb +{ + namespace qt + { + struct LIBODB_QT_EXPORT exception: odb::exception + { + virtual const char* + what () const ODB_NOTHROW_NOEXCEPT = 0; + }; + } +} + +#include + +#endif // ODB_QT_EXCEPTION_HXX diff --git a/libodb-qt/odb/qt/lazy-ptr.hxx b/libodb-qt/odb/qt/lazy-ptr.hxx new file mode 100644 index 0000000..6e5a3e0 --- /dev/null +++ b/libodb-qt/odb/qt/lazy-ptr.hxx @@ -0,0 +1,9 @@ +// file : odb/qt/lazy-ptr.hxx +// license : GNU GPL v2; see accompanying LICENSE file + +#ifndef ODB_QT_LAZY_PTR_HXX +#define ODB_QT_LAZY_PTR_HXX + +#include + +#endif // ODB_QT_LAZY_PTR_HXX diff --git a/libodb-qt/odb/qt/list-iterator.hxx b/libodb-qt/odb/qt/list-iterator.hxx new file mode 100644 index 0000000..bb8b20c --- /dev/null +++ b/libodb-qt/odb/qt/list-iterator.hxx @@ -0,0 +1,9 @@ +// file : odb/qt/list-iterator.hxx +// license : GNU GPL v2; see accompanying LICENSE file + +#ifndef ODB_QT_LIST_ITERATOR_HXX +#define ODB_QT_LIST_ITERATOR_HXX + +#include + +#endif // ODB_QT_LIST_ITERATOR_HXX diff --git a/libodb-qt/odb/qt/list.hxx b/libodb-qt/odb/qt/list.hxx new file mode 100644 index 0000000..7918ef6 --- /dev/null +++ b/libodb-qt/odb/qt/list.hxx @@ -0,0 +1,9 @@ +// file : odb/qt/list.hxx +// license : GNU GPL v2; see accompanying LICENSE file + +#ifndef ODB_QT_LIST_HXX +#define ODB_QT_LIST_HXX + +#include + +#endif // ODB_QT_LIST_HXX diff --git a/libodb-qt/odb/qt/mutable-list-iterator.hxx b/libodb-qt/odb/qt/mutable-list-iterator.hxx new file mode 100644 index 0000000..045ae99 --- /dev/null +++ b/libodb-qt/odb/qt/mutable-list-iterator.hxx @@ -0,0 +1,9 @@ +// file : odb/qt/mutable-list-iterator.hxx +// license : GNU GPL v2; see accompanying LICENSE file + +#ifndef ODB_QT_MUTABLE_LIST_ITERATOR_HXX +#define ODB_QT_MUTABLE_LIST_ITERATOR_HXX + +#include + +#endif // ODB_QT_MUTABLE_LIST_ITERATOR_HXX diff --git a/libodb-qt/odb/qt/smart-ptr.options b/libodb-qt/odb/qt/smart-ptr.options new file mode 100644 index 0000000..b95b39b --- /dev/null +++ b/libodb-qt/odb/qt/smart-ptr.options @@ -0,0 +1,19 @@ +# file : odb/qt/smart-ptr.options +# license : GNU GPL v2; see accompanying LICENSE file + +--profile qt/version + +# Make QSharedPointer the default object pointer. +# +--hxx-prologue '#include ' +--default-pointer QSharedPointer + +# Include pointer traits. +# +--odb-epilogue '#include ' +--hxx-prologue '#include ' + +# Include wrapper traits. +# +--odb-epilogue '#include ' +--hxx-prologue '#include ' diff --git a/libodb-qt/odb/qt/smart-ptr/lazy-pointer-traits.hxx b/libodb-qt/odb/qt/smart-ptr/lazy-pointer-traits.hxx new file mode 100644 index 0000000..6c7aa38 --- /dev/null +++ b/libodb-qt/odb/qt/smart-ptr/lazy-pointer-traits.hxx @@ -0,0 +1,61 @@ +// file : odb/qt/smart-ptr/lazy-pointer-traits.hxx +// license : GNU GPL v2; see accompanying LICENSE file + +#ifndef ODB_QT_SMART_PTR_LAZY_POINTER_TRAITS_HXX +#define ODB_QT_SMART_PTR_LAZY_POINTER_TRAITS_HXX + +#include + +#include +#include + +namespace odb +{ + template + class pointer_traits > + { + public: + static const pointer_kind kind = pk_shared; + static const bool lazy = true; + + typedef T element_type; + typedef QLazySharedPointer pointer_type; + typedef QSharedPointer eager_pointer_type; + + static bool + null_ptr (const pointer_type& p) + { + return !p; + } + + template + static typename object_traits::id_type + object_id (const pointer_type& p) + { + return p.template objectId (); + } + }; + + template + class pointer_traits > + { + public: + static const pointer_kind kind = pk_weak; + static const bool lazy = true; + + typedef T element_type; + typedef QLazyWeakPointer pointer_type; + typedef QLazySharedPointer strong_pointer_type; + typedef QWeakPointer eager_pointer_type; + + static strong_pointer_type + lock (const pointer_type& p) + { + return p.toStrongRef (); + } + }; +} + +#include + +#endif // ODB_QT_SMART_PTR_LAZY_POINTER_TRAITS_HXX diff --git a/libodb-qt/odb/qt/smart-ptr/lazy-ptr.hxx b/libodb-qt/odb/qt/smart-ptr/lazy-ptr.hxx new file mode 100644 index 0000000..865e355 --- /dev/null +++ b/libodb-qt/odb/qt/smart-ptr/lazy-ptr.hxx @@ -0,0 +1,442 @@ +// file : odb/qt/smart-ptr/lazy-ptr.hxx +// license : GNU GPL v2; see accompanying LICENSE file + +#ifndef ODB_QT_SMART_PTR_LAZY_PTR_HXX +#define ODB_QT_SMART_PTR_LAZY_PTR_HXX + +#include + +#include +#include +#include + +#include // odb::database +#include +#include +#include // ODB_CXX11 + +template +class QLazyWeakPointer; + +// +// QLazySharedPointer declaration. +// + +template +class QLazySharedPointer +{ + // The standard QSharedPointer interface. + // +public: + // These typedefs are inherited by QSharedPointer indirectly from + // QtSharedPointer::Basic + // + typedef T Type; + typedef T element_type; + typedef T value_type; + typedef value_type* pointer; + typedef const value_type* const_pointer; + typedef value_type& reference; + typedef const value_type& const_reference; + typedef qptrdiff difference_type; + + QLazySharedPointer (); + + explicit + QLazySharedPointer (T*); + + template + QLazySharedPointer (T*, Deleter); + + QLazySharedPointer (const QLazySharedPointer&); + + template + QLazySharedPointer (const QLazySharedPointer&); + + template + QLazySharedPointer (const QLazyWeakPointer&); + + ~QLazySharedPointer (); + + QLazySharedPointer& + operator= (const QLazySharedPointer&); + + template + QLazySharedPointer& + operator= (const QLazySharedPointer&); + + template + QLazySharedPointer& + operator= (const QLazyWeakPointer&); + + typedef QSharedPointer QLazySharedPointer::*unspecified_bool_type; + operator unspecified_bool_type () const + { + return isNull () ? 0 : &QLazySharedPointer::p_; + } + + bool + operator! () const; + + T& + operator* () const; + + T* + operator-> () const; + + void + swap (QLazySharedPointer&); + + bool + isNull () const; + + T* + data () const; + + QLazyWeakPointer + toWeakRef () const; + + void + clear (); + + template + QLazySharedPointer + staticCast () const; + + template + QLazySharedPointer + dynamicCast () const; + + template + QLazySharedPointer + constCast () const; + + // Initialization and assignment from QSharedPointer and QWeakPointer. + // +public: + template + QLazySharedPointer (const QSharedPointer&); + + template + explicit + QLazySharedPointer (const QWeakPointer&); + + template + QLazySharedPointer& + operator= (const QSharedPointer&); + + template + QLazySharedPointer& + operator= (const QWeakPointer&); + + // Lazy loading interface. + // +public: + typedef odb::database database_type; + + // isNull() loaded() + // + // true true NULL pointer to transient object + // false true valid pointer to persistent object + // true false unloaded pointer to persistent object + // false false valid pointer to transient object + // + bool + loaded () const; + + QSharedPointer + load () const; + + // Unload the pointer. For transient objects this function is + // equivalent to clear(). + // + void unload () const; + + // Get the underlying eager pointer. If this is an unloaded pointer + // to a persistent object, then the returned pointer will be NULL. + // + QSharedPointer + getEager () const; + + template + QLazySharedPointer (DB&, const ID&); + + template + QLazySharedPointer (DB&, T*); + + template + QLazySharedPointer (DB&, T*, Deleter); + + template + QLazySharedPointer (DB&, const QSharedPointer&); + + template + QLazySharedPointer (DB&, const QWeakPointer&); + +#ifdef ODB_CXX11_FUNCTION_TEMPLATE_DEFAULT_ARGUMENT + template +#else + template +#endif + typename odb::object_traits::id_type + objectId () const; + + database_type& + database () const; + + // Helpers. + // +public: + template + bool + equal (const QLazySharedPointer&) const; + +private: + template friend class QLazySharedPointer; + template friend class QLazyWeakPointer; + + // For QLazyWeakPointer::toStrongRef(). + // + QLazySharedPointer (const QSharedPointer& p, + const odb::lazy_ptr_impl& i) + : p_ (p), i_ (i) {} + +private: + mutable QSharedPointer p_; + mutable odb::lazy_ptr_impl i_; +}; + +// +// QLazySharedPointer related non-members. +// + +template +QLazySharedPointer +qSharedPointerCast (const QLazySharedPointer&); + +template +QLazySharedPointer +qSharedPointerConstCast (const QLazySharedPointer&); + +template +QLazySharedPointer +qSharedPointerDynamicCast (const QLazySharedPointer&); + +template +bool +operator== (const QLazySharedPointer&, const QLazySharedPointer&); + +template +bool +operator!= (const QLazySharedPointer&, const QLazySharedPointer&); + +// +// QLazyWeakPointer declaration +// + +template +class QLazyWeakPointer +{ + // The standard QWeakPointer interface + // +public: + typedef T element_type; + typedef T value_type; + typedef value_type* pointer; + typedef const value_type* const_pointer; + typedef value_type& reference; + typedef const value_type& const_reference; + typedef qptrdiff difference_type; + + QLazyWeakPointer (); + + QLazyWeakPointer (const QLazyWeakPointer&); + + template + QLazyWeakPointer (const QLazyWeakPointer&); + + template + QLazyWeakPointer (const QLazySharedPointer&); + + ~QLazyWeakPointer (); + + QLazyWeakPointer& + operator= (const QLazyWeakPointer&); + + template + QLazyWeakPointer& + operator= (const QLazyWeakPointer&); + + template + QLazyWeakPointer& + operator= (const QLazySharedPointer&); + + typedef QWeakPointer QLazyWeakPointer::*unspecified_bool_type; + operator unspecified_bool_type () const + { + return isNull () ? 0 : &QLazyWeakPointer::p_; + } + + bool + operator! () const; + +#ifdef QWEAKPOINTER_ENABLE_ARROW + T* + operator-> () const; +#endif + + void + clear (); + + T* + data () const; + + bool + isNull () const; + + QLazySharedPointer + toStrongRef () const; + + // Initialization/assignment from QSharedPointer and QWeakPointer. + // +public: + template + QLazyWeakPointer (const QWeakPointer&); + + template + QLazyWeakPointer (const QSharedPointer&); + + template + QLazyWeakPointer& + operator= (const QWeakPointer&); + + template + QLazyWeakPointer& + operator= (const QSharedPointer&); + + // Lazy loading interface. + // +public: + typedef odb::database database_type; + + // toStrongRef().isNull() loaded() + // + // true true expired pointer to transient object + // false true valid pointer to persistent object + // true false expired pointer to persistent object + // false false valid pointer to transient object + // + bool + loaded () const; + + // Create a strong reference using toStrongRef() and load. + // + QSharedPointer + load () const; + + // Unload the pointer. For transient objects this function is equivalent + // to clear(). + // + void + unload () const; + + // Get the underlying eager pointer. If this is an unloaded pointer + // to a persistent object, then the returned pointer will be NULL. + // + QWeakPointer + getEager () const; + + template + QLazyWeakPointer (DB&, const ID&); + + template + QLazyWeakPointer (DB&, const QSharedPointer&); + + template + QLazyWeakPointer (DB&, const QWeakPointer&); + + // The objectId() function can only be called when the object is persistent, + // or: toStrongRef().isNull() XOR loaded() (can use != for XOR). + // +#ifdef ODB_CXX11_FUNCTION_TEMPLATE_DEFAULT_ARGUMENT + template +#else + template +#endif + typename odb::object_traits::id_type + objectId () const; + + database_type& + database () const; + + // Helpers. + // +public: + template + bool + equal (const QLazyWeakPointer&) const; + + template + bool + equal (const QLazySharedPointer&) const; + +private: + template friend class QLazySharedPointer; + template friend class QLazyWeakPointer; + + mutable QWeakPointer p_; + mutable odb::lazy_ptr_impl i_; +}; + +// +// QLazyWeakPointer related non-members. +// + +template +QLazySharedPointer +qSharedPointerCast (const QLazyWeakPointer&); + +template +QLazySharedPointer +qSharedPointerConstCast (const QLazyWeakPointer&); + +template +QLazySharedPointer +qSharedPointerDynamicCast (const QLazyWeakPointer&); + +template +QLazyWeakPointer +qWeakPointerCast (const QLazyWeakPointer&); + +template +bool +operator== (const QLazyWeakPointer&, const QLazyWeakPointer&); + +template +bool +operator== (const QLazyWeakPointer&, const QLazySharedPointer&); + +template +bool +operator== (const QLazySharedPointer&, const QLazyWeakPointer&); + +template +bool +operator!= (const QLazyWeakPointer&, const QLazyWeakPointer&); + +template +bool +operator!= (const QLazyWeakPointer&, const QLazySharedPointer&); + +template +bool +operator!= (const QLazySharedPointer&, const QLazyWeakPointer&); + +#include +#include + +#include + +#include + +#endif // ODB_QT_SMART_PTR_LAZY_PTR_HXX diff --git a/libodb-qt/odb/qt/smart-ptr/lazy-ptr.ixx b/libodb-qt/odb/qt/smart-ptr/lazy-ptr.ixx new file mode 100644 index 0000000..b9e6de8 --- /dev/null +++ b/libodb-qt/odb/qt/smart-ptr/lazy-ptr.ixx @@ -0,0 +1,626 @@ +// file : odb/qt/smart-ptr/lazy-ptr.ixx +// license : GNU GPL v2; see accompanying LICENSE file + +// +// QLazySharedPointer definition. +// + +template +inline QLazySharedPointer:: +QLazySharedPointer () {} + +template +inline QLazySharedPointer:: +QLazySharedPointer (T* p): p_ (p) {} + +template +template +inline QLazySharedPointer:: +QLazySharedPointer (T* p, Deleter d): p_ (p, d) {} + +template +inline QLazySharedPointer:: +QLazySharedPointer (const QLazySharedPointer& r): p_ (r.p_), i_ (r.i_) {} + +template +template +inline QLazySharedPointer:: +QLazySharedPointer (const QLazySharedPointer& r): p_ (r.p_), i_ (r.i_) {} + +template +template +inline QLazySharedPointer:: +QLazySharedPointer (const QLazyWeakPointer& r): p_ (r.p_), i_ (r.i_) {} + +template +inline QLazySharedPointer:: +~QLazySharedPointer () {} + +template +inline QLazySharedPointer& QLazySharedPointer:: +operator= (const QLazySharedPointer& r) +{ + p_ = r.p_; + i_ = r.i_; + return *this; +} + +template +template +inline QLazySharedPointer& QLazySharedPointer:: +operator= (const QLazySharedPointer& r) +{ + p_ = r.p_; + i_ = r.i_; + return *this; +} + +template +template +inline QLazySharedPointer& QLazySharedPointer:: +operator= (const QLazyWeakPointer& r) +{ + p_ = r.p_; + i_ = r.i_; + return *this; +} + +template +inline bool QLazySharedPointer:: +operator! () const +{ + return isNull (); +} + +template +inline T& QLazySharedPointer:: +operator* () const +{ + return *p_; +} + +template +inline T* QLazySharedPointer:: +operator-> () const +{ + return p_.operator-> (); +} + +template +inline void QLazySharedPointer:: +swap (QLazySharedPointer& x) +{ + p_.swap (x.p_); + i_.swap (x.i_); +} + +template +inline bool QLazySharedPointer:: +isNull () const +{ + return !(p_ || i_); +} + +template +inline T* QLazySharedPointer:: +data () const +{ + return p_.data (); +} + +template +inline QLazyWeakPointer QLazySharedPointer:: +toWeakRef () const +{ + return QLazyWeakPointer (*this); +} + +template +inline void QLazySharedPointer:: +clear () +{ + p_.clear (); + i_.reset (); +} + +template +template +inline QLazySharedPointer QLazySharedPointer:: +staticCast () const +{ + QLazySharedPointer c (p_.template staticCast ()); + c.i_ = i_; + return c; +} + +template +template +inline QLazySharedPointer QLazySharedPointer:: +dynamicCast () const +{ + QLazySharedPointer c (p_.template dynamicCast ()); + + if (c) + c.i_ = i_; + + return c; +} + +template +template +inline QLazySharedPointer QLazySharedPointer:: +constCast () const +{ + QLazySharedPointer c (p_.template constCast ()); + c.i_ = i_; + return c; +} + +template +template +inline QLazySharedPointer:: +QLazySharedPointer (const QSharedPointer& r): p_ (r) {} + +template +template +inline QLazySharedPointer:: +QLazySharedPointer (const QWeakPointer& r): p_ (r) {} + +template +template +inline QLazySharedPointer& QLazySharedPointer:: +operator= (const QSharedPointer& r) +{ + p_ = r; + i_.reset (); + return *this; +} + +template +template +inline QLazySharedPointer& QLazySharedPointer:: +operator= (const QWeakPointer& r) +{ + p_ = r; + i_.reset (); + return *this; +} + +template +inline bool QLazySharedPointer:: +loaded () const +{ + bool i (i_); + return !p_ != i; // !p_ XOR i_ +} + +template +inline QLazySharedPointer QLazyWeakPointer:: +toStrongRef () const +{ + return QLazySharedPointer (p_.toStrongRef (), i_); +} + +template +inline QSharedPointer QLazySharedPointer:: +load () const +{ + if (!p_ && i_) + p_ = i_.template load (true); // Reset id. + + return p_; +} + +template +inline void QLazySharedPointer:: +unload () const +{ + typedef typename odb::object_traits::object_type object_type; + + if (p_) + { + if (i_.database () != 0) + i_.reset_id (odb::object_traits::id (*p_)); + + p_.clear (); + } +} + +template +inline QSharedPointer QLazySharedPointer:: +getEager () const +{ + return p_; +} + +template +template +inline QLazySharedPointer:: +QLazySharedPointer (DB& db, const ID& id): i_ (db, id) {} + +template +template +inline QLazySharedPointer:: +QLazySharedPointer (DB& db, T* p) + : p_ (p) +{ + if (p_) + i_.reset_db (db); +} + +template +template +inline QLazySharedPointer:: +QLazySharedPointer (DB& db, T* p, Deleter d) + : p_ (p, d) +{ + if (p_) + i_.reset_db (db); +} + +template +template +inline QLazySharedPointer:: +QLazySharedPointer (DB& db, const QSharedPointer& r) + : p_ (r) +{ + if (p_) + i_.reset_db (db); +} + +template +template +inline QLazySharedPointer:: +QLazySharedPointer (DB& db, const QWeakPointer& r) + : p_ (r) +{ + if (p_) + i_.reset_db (db); +} + +template +inline typename QLazySharedPointer::database_type& QLazySharedPointer:: +database () const +{ + return *i_.database (); +} + +template +template +inline typename odb::object_traits::id_type QLazySharedPointer:: +objectId () const +{ + typedef typename odb::object_traits::object_type object_type; + + return p_ + ? odb::object_traits::id (*p_) + : i_.template object_id (); +} + +// +// QLazySharedPointer related non-member function definitions. +// + +template +inline QLazySharedPointer +qSharedPointerCast (const QLazySharedPointer& r) +{ + return r.template staticCast (); +} + +template +inline QLazySharedPointer +qSharedPointerConstCast (const QLazySharedPointer& r) +{ + return r.template constCast (); +} + +template +inline QLazySharedPointer +qSharedPointerDynamicCast (const QLazySharedPointer& r) +{ + return r.template dynamicCast (); +} + +template +inline bool +operator== (const QLazySharedPointer& a, const QLazySharedPointer& b) +{ + return a.equal (b); +} + +template +inline bool +operator!= (const QLazySharedPointer& a, const QLazySharedPointer& b) +{ + return !a.equal (b); +} + +// +// QLazyWeakPointer definition. +// + +template +inline QLazyWeakPointer:: +QLazyWeakPointer () {} + + +template +inline QLazyWeakPointer:: +QLazyWeakPointer (const QLazyWeakPointer& r): p_ (r.p_), i_ (r.i_) {} + +template +template +inline QLazyWeakPointer:: +QLazyWeakPointer (const QLazyWeakPointer& r): p_ (r.p_), i_ (r.i_) {} + +template +template +inline QLazyWeakPointer:: +QLazyWeakPointer (const QLazySharedPointer& r): p_ (r.p_), i_ (r.i_) {} + +template +inline QLazyWeakPointer:: +~QLazyWeakPointer () {} + +template +inline QLazyWeakPointer& QLazyWeakPointer:: +operator= (const QLazyWeakPointer& r) +{ + p_ = r.p_; + i_ = r.i_; + return *this; +} + +template +template +inline QLazyWeakPointer& QLazyWeakPointer:: +operator= (const QLazyWeakPointer& r) +{ + p_ = r.p_; + i_ = r.i_; + return *this; +} + +template +template +inline QLazyWeakPointer& QLazyWeakPointer:: +operator= (const QLazySharedPointer& r) +{ + p_ = r.p_; + i_ = r.i_; + return *this; +} + +template +inline bool QLazyWeakPointer:: +operator! () const +{ + return isNull (); +} + +#ifdef QWEAKPOINTER_ENABLE_ARROW +template +inline T* QLazyWeakPointer:: +operator-> () const +{ + return p_.operator-> (); +} +#endif + +template +inline void QLazyWeakPointer:: +clear () +{ + p_.clear (); + i_.reset (); +} + +template +inline T* QLazyWeakPointer:: +data () const +{ + return p_.data (); +} + +template +inline bool QLazyWeakPointer:: +isNull () const +{ + return !(p_ || i_); +} + +template +template +inline QLazyWeakPointer:: +QLazyWeakPointer (const QWeakPointer& r): p_ (r) {} + +template +template +inline QLazyWeakPointer:: +QLazyWeakPointer (const QSharedPointer& r): p_ (r) {} + +template +template +inline QLazyWeakPointer& QLazyWeakPointer:: +operator= (const QWeakPointer& r) +{ + p_ = r; + i_.reset (); + return *this; +} + +template +template +inline QLazyWeakPointer& QLazyWeakPointer:: +operator= (const QSharedPointer& r) +{ + p_ = r; + i_.reset (); + return *this; +} + +template +inline bool QLazyWeakPointer:: +loaded () const +{ + bool i (i_); + return p_.toStrongRef ().isNull () != i; // expired () XOR i_ +} + +template +inline QSharedPointer QLazyWeakPointer:: +load () const +{ + QSharedPointer r (p_.toStrongRef ()); + + if (!r && i_) + { + r = i_.template load (false); // Keep id. + p_ = r; + } + + return r; +} + +template +inline void QLazyWeakPointer:: +unload () const +{ + // With weak pointer we always keep i_ up to date. + // + p_.clear (); +} + +template +inline QWeakPointer QLazyWeakPointer:: +getEager () const +{ + return p_; +} + +template +template +inline QLazyWeakPointer:: +QLazyWeakPointer (DB& db, const ID& id): i_ (db, id) {} + +template +template +inline QLazyWeakPointer:: +QLazyWeakPointer (DB& db, const QSharedPointer& r) + : p_ (r) +{ + typedef typename odb::object_traits::object_type object_type; + + if (r) + i_.reset (db, odb::object_traits::id (*r)); +} + +template +template +inline QLazyWeakPointer:: +QLazyWeakPointer (DB& db, const QWeakPointer& r) + : p_ (r) +{ + typedef typename odb::object_traits::object_type object_type; + + QSharedPointer sp (p_.toStrongRef ()); + + if (sp) + i_.reset (db, odb::object_traits::id (*sp)); +} + +template +template +inline typename odb::object_traits::id_type QLazyWeakPointer:: +objectId () const +{ + typedef typename odb::object_traits::object_type object_type; + + QSharedPointer sp (p_.toStrongRef ()); + + return sp + ? odb::object_traits::id (*sp) + : i_.template object_id (); +} + +template +inline typename QLazyWeakPointer::database_type& QLazyWeakPointer:: +database () const +{ + return *i_.database (); +} + +// +// QLazyWeakPointer related non-member functions. +// + +template +inline QLazySharedPointer +qSharedPointerCast (const QLazyWeakPointer& r) +{ + return QLazySharedPointer (r).template staticCast (); +} + +template +inline QLazySharedPointer +qSharedPointerConstCast (const QLazyWeakPointer& r) +{ + return QLazySharedPointer (r).template constCast (); +} + +template +inline QLazySharedPointer +qSharedPointerDynamicCast (const QLazyWeakPointer& r) +{ + return QLazySharedPointer (r).template dynamicCast (); +} + +template +inline QLazyWeakPointer +qWeakPointerCast (const QLazyWeakPointer& r) +{ + return QLazySharedPointer (r).template staticCast ().toWeakRef (); +} + +template +inline bool +operator== (const QLazyWeakPointer& t, const QLazyWeakPointer& x) +{ + return t.equal (x); +} + +template +inline bool +operator== (const QLazyWeakPointer& t, const QLazySharedPointer& x) +{ + return t.equal (x); +} + +template +inline bool +operator== (const QLazySharedPointer& t, const QLazyWeakPointer& x) +{ + return x.equal (t); +} + +template +inline bool +operator!= (const QLazyWeakPointer& t, const QLazyWeakPointer& x) +{ + return !t.equal (x); +} + +template +inline bool +operator!= (const QLazyWeakPointer& t, const QLazySharedPointer& x) +{ + return !t.equal (x); +} + +template +inline bool +operator!= (const QLazySharedPointer& t, const QLazyWeakPointer& x) +{ + return !x.equal (t); +} diff --git a/libodb-qt/odb/qt/smart-ptr/lazy-ptr.txx b/libodb-qt/odb/qt/smart-ptr/lazy-ptr.txx new file mode 100644 index 0000000..0ae038a --- /dev/null +++ b/libodb-qt/odb/qt/smart-ptr/lazy-ptr.txx @@ -0,0 +1,74 @@ +// file : odb/qt/smart-ptr/lazy-ptr.txx +// license : GNU GPL v2; see accompanying LICENSE file + +template +template +bool QLazySharedPointer:: +equal (const QLazySharedPointer& r) const +{ + bool t1 (!p_ == loaded ()); + bool t2 (!r.p_ == r.loaded ()); + + // If both are transient, then compare the underlying pointers. + // + if (t1 && t2) + return p_ == r.p_; + + // If one is transient and the other is persistent, then compare + // the underlying pointers but only if they are non NULL. Note + // that an unloaded persistent object is always unequal to a + // transient object. + // + if (t1 || t2) + return p_ == r.p_ && p_; + + // If both objects are persistent, then we compare databases and + // object ids. + // + typedef typename odb::object_traits::object_type object_type1; + typedef typename odb::object_traits::object_type object_type2; + + return i_.database () == r.i_.database () && + objectId () == r.template objectId (); +} + +// +// QLazyWeakPointer +// + +template +template +bool QLazyWeakPointer:: +equal (const QLazyWeakPointer& r) const +{ + if (isNull () && r.isNull ()) + return true; + + QLazySharedPointer sp1 (toStrongRef ()); + QLazySharedPointer sp2 (r.toStrongRef ()); + + // If either one has expired, they are not equal. + // + if (!sp1 || !sp2) + return false; + + return sp1.equal (sp2); +} + +template +template +bool QLazyWeakPointer:: +equal (const QLazySharedPointer& r) const +{ + if (isNull () && r.isNull ()) + return true; + + QLazySharedPointer sp (toStrongRef ()); + + // If the weak pointer has expired, they are not equal. + // + if (!sp) + return false; + + return r.equal (sp); +} diff --git a/libodb-qt/odb/qt/smart-ptr/pointer-traits.hxx b/libodb-qt/odb/qt/smart-ptr/pointer-traits.hxx new file mode 100644 index 0000000..f5cbc39 --- /dev/null +++ b/libodb-qt/odb/qt/smart-ptr/pointer-traits.hxx @@ -0,0 +1,110 @@ +// file : odb/qt/smart-ptr/pointer-traits.hxx +// license : GNU GPL v2; see accompanying LICENSE file + +#ifndef ODB_QT_SMART_PTR_POINTER_TRAITS_HXX +#define ODB_QT_SMART_PTR_POINTER_TRAITS_HXX + +#include + +#include +#include + +#include +#include + +namespace odb +{ + // Specialization for QSharedPointer. + // + template + class pointer_traits > + { + public: + static const pointer_kind kind = pk_shared; + static const bool lazy = false; + + typedef T element_type; + typedef QSharedPointer pointer_type; + typedef QSharedPointer const_pointer_type; + typedef typename odb::details::meta::remove_const::result + unrestricted_element_type; + typedef QSharedPointer + unrestricted_pointer_type; + typedef smart_ptr_guard guard; + + static element_type* + get_ptr (const pointer_type& p) + { + return p.data (); + } + + static element_type& + get_ref (const pointer_type& p) + { + return *p; + } + + static bool + null_ptr (const pointer_type& p) + { + return !p; + } + + static unrestricted_pointer_type + const_pointer_cast (const pointer_type& p) + { + return qSharedPointerConstCast (p); + } + + template + static QSharedPointer + static_pointer_cast (const pointer_type& p) + { + return qSharedPointerCast (p); + } + + template + static QSharedPointer + dynamic_pointer_cast (const pointer_type& p) + { + return qSharedPointerDynamicCast (p); + } + + public: + static void* + allocate (std::size_t n) + { + return operator new (n); + } + + static void + free (void* p) + { + operator delete (p); + } + }; + + // Specialization for QWeakPointer. + // + template + class pointer_traits > + { + public: + static const pointer_kind kind = pk_weak; + static const bool lazy = false; + + typedef T element_type; + typedef QWeakPointer pointer_type; + typedef QSharedPointer strong_pointer_type; + + static strong_pointer_type + lock (const pointer_type& p) + { + return p.toStrongRef (); + } + }; +} + +#include + +#endif // ODB_QT_SMART_PTR_POINTER_TRAITS_HXX diff --git a/libodb-qt/odb/qt/smart-ptr/wrapper-traits.hxx b/libodb-qt/odb/qt/smart-ptr/wrapper-traits.hxx new file mode 100644 index 0000000..dc6cb02 --- /dev/null +++ b/libodb-qt/odb/qt/smart-ptr/wrapper-traits.hxx @@ -0,0 +1,64 @@ +// file : odb/qt/smart-ptr/wrapper-traits.hxx +// license : GNU GPL v2; see accompanying LICENSE file + +#ifndef ODB_QT_SMART_PTR_WRAPPER_TRAITS_HXX +#define ODB_QT_SMART_PTR_WRAPPER_TRAITS_HXX + +#include + +#include + +#include + +namespace odb +{ + // Specialization for QSharedPointer. + // + template + class wrapper_traits< QSharedPointer > + { + public: + typedef T wrapped_type; + typedef QSharedPointer wrapper_type; + + // T can be const. + // + typedef + typename odb::details::meta::remove_const::result + unrestricted_wrapped_type; + + static const bool null_handler = true; + static const bool null_default = false; + + static bool + get_null (const wrapper_type& p) + { + return p.isNull (); + } + + static void + set_null (wrapper_type& p) + { + p.clear (); + } + + static const wrapped_type& + get_ref (const wrapper_type& p) + { + return *p; + } + + static wrapped_type& + set_ref (wrapper_type& p) + { + if (p.isNull ()) + p = wrapper_type (new unrestricted_wrapped_type); + + return const_cast (*p); + } + }; +} + +#include + +#endif // ODB_QT_SMART_PTR_WRAPPER_TRAITS_HXX diff --git a/libodb-qt/odb/qt/version-build2-stub.hxx b/libodb-qt/odb/qt/version-build2-stub.hxx new file mode 100644 index 0000000..b00d1de --- /dev/null +++ b/libodb-qt/odb/qt/version-build2-stub.hxx @@ -0,0 +1,4 @@ +// file : odb/qt/version-build2-stub.hxx +// license : GNU GPL v2; see accompanying LICENSE file + +#include diff --git a/libodb-qt/odb/qt/version-build2.hxx b/libodb-qt/odb/qt/version-build2.hxx new file mode 100644 index 0000000..e69de29 diff --git a/libodb-qt/odb/qt/version-build2.hxx.in b/libodb-qt/odb/qt/version-build2.hxx.in new file mode 100644 index 0000000..51f1191 --- /dev/null +++ b/libodb-qt/odb/qt/version-build2.hxx.in @@ -0,0 +1,46 @@ +// file : odb/qt/version-build2.hxx.in +// license : GNU GPL v2; see accompanying LICENSE file + +#ifndef LIBODB_QT_VERSION // Note: using the version macro itself. + +// @@ TODO: need to derive automatically (it is also hardcoded in *.options). +// +#define ODB_QT_VERSION 2047600 + +// The numeric version format is AAAAABBBBBCCCCCDDDE where: +// +// AAAAA - major version number +// BBBBB - minor version number +// CCCCC - bugfix version number +// DDD - alpha / beta (DDD + 500) version number +// E - final (0) / snapshot (1) +// +// When DDDE is not 0, 1 is subtracted from AAAAABBBBBCCCCC. For example: +// +// Version AAAAABBBBBCCCCCDDDE +// +// 0.1.0 0000000001000000000 +// 0.1.2 0000000001000020000 +// 1.2.3 0000100002000030000 +// 2.2.0-a.1 0000200001999990010 +// 3.0.0-b.2 0000299999999995020 +// 2.2.0-a.1.z 0000200001999990011 +// +#define LIBODB_QT_VERSION $libodb_qt.version.project_number$ULL +#define LIBODB_QT_VERSION_STR "$libodb_qt.version.project$" +#define LIBODB_QT_VERSION_ID "$libodb_qt.version.project_id$" + +#define LIBODB_QT_VERSION_MAJOR $libodb_qt.version.major$ +#define LIBODB_QT_VERSION_MINOR $libodb_qt.version.minor$ +#define LIBODB_QT_VERSION_PATCH $libodb_qt.version.patch$ + +#define LIBODB_QT_PRE_RELEASE $libodb_qt.version.pre_release$ + +#define LIBODB_QT_SNAPSHOT $libodb_qt.version.snapshot_sn$ULL +#define LIBODB_QT_SNAPSHOT_ID "$libodb_qt.version.snapshot_id$" + +#include + +$libodb.check(LIBODB_VERSION, LIBODB_SNAPSHOT)$ + +#endif // LIBODB_QT_VERSION diff --git a/libodb-qt/odb/qt/version.hxx b/libodb-qt/odb/qt/version.hxx new file mode 100644 index 0000000..4f9510a --- /dev/null +++ b/libodb-qt/odb/qt/version.hxx @@ -0,0 +1,55 @@ +// file : odb/qt/version.hxx +// license : GNU GPL v2; see accompanying LICENSE file + +#ifdef LIBODB_QT_BUILD2 +# include +#else + +#ifndef ODB_QT_VERSION_HXX +#define ODB_QT_VERSION_HXX + +#include + +#include + +// Version format is AABBCCDD where +// +// AA - major version number +// BB - minor version number +// CC - bugfix version number +// DD - alpha / beta (DD + 50) version number +// +// When DD is not 00, 1 is subtracted from AABBCC. For example: +// +// Version AABBCCDD +// 2.0.0 02000000 +// 2.1.0 02010000 +// 2.1.1 02010100 +// 2.2.0.a1 02019901 +// 3.0.0.b2 02999952 +// + +// Check that we have compatible ODB version. +// +#if ODB_VERSION != 20476 +# error incompatible odb interface version detected +#endif + +// ODB Qt interface version: odb interface version plus the Qt interface +// version. +// +#define ODB_QT_VERSION 2047600 +#define ODB_QT_VERSION_STR "2.5.0-b.26" + +// libodb-qt version: odb interface version plus the bugfix version. Note +// that LIBODB_QT_VERSION is always greater or equal to ODB_QT_VERSION +// since if the Qt interface virsion is incremented then the bugfix version +// must be incremented as well. +// +#define LIBODB_QT_VERSION 2049976 +#define LIBODB_QT_VERSION_STR "2.5.0-b.26" + +#include + +#endif // ODB_QT_VERSION_HXX +#endif // LIBODB_QT_BUILD2 diff --git a/libodb-qt/odb/qt/version.options b/libodb-qt/odb/qt/version.options new file mode 100644 index 0000000..0fef537 --- /dev/null +++ b/libodb-qt/odb/qt/version.options @@ -0,0 +1,16 @@ +# file : odb/qt/version.options +# license : GNU GPL v2; see accompanying LICENSE file + +# Include the config file first so that it can do its thing before we +# include any Qt headers. +# +--odb-prologue '#include ' + +# Make sure the options files as seen by the ODB compiler and header +# files as seen by the C++ compiler have the same Qt interface version. +# +--hxx-prologue '#include ' + +--hxx-prologue '#if ODB_QT_VERSION != 2047600 // 2.5.0-b.26' +--hxx-prologue '# error ODB and C++ compilers see different libodb-qt interface versions' +--hxx-prologue '#endif' diff --git a/libodb-qt/tests/.gitignore b/libodb-qt/tests/.gitignore new file mode 100644 index 0000000..e54525b --- /dev/null +++ b/libodb-qt/tests/.gitignore @@ -0,0 +1 @@ +driver diff --git a/libodb-qt/tests/basics/buildfile b/libodb-qt/tests/basics/buildfile new file mode 100644 index 0000000..900e57a --- /dev/null +++ b/libodb-qt/tests/basics/buildfile @@ -0,0 +1,6 @@ +# file : tests/basics/buildfile +# license : GNU GPL v2; see accompanying LICENSE file + +import libs = libodb-qt%lib{odb-qt} + +exe{driver}: {hxx cxx}{*} $libs diff --git a/libodb-qt/tests/basics/driver.cxx b/libodb-qt/tests/basics/driver.cxx new file mode 100644 index 0000000..01e0d55 --- /dev/null +++ b/libodb-qt/tests/basics/driver.cxx @@ -0,0 +1,22 @@ +// file : tests/basics/driver.cxx +// license : GNU GPL v2; see accompanying LICENSE file + +// Basic test to make sure the library is usable. Functionality testing +// is done in the odb-tests package. + +#include +#include + +using namespace odb; + +int +main () +{ + try + { + throw qt::date_time::value_out_of_range (); + } + catch (const qt::exception&) + { + } +} diff --git a/libodb-qt/tests/build/.gitignore b/libodb-qt/tests/build/.gitignore new file mode 100644 index 0000000..4a730a3 --- /dev/null +++ b/libodb-qt/tests/build/.gitignore @@ -0,0 +1,3 @@ +config.build +root/ +bootstrap/ diff --git a/libodb-qt/tests/build/bootstrap.build b/libodb-qt/tests/build/bootstrap.build new file mode 100644 index 0000000..6ee38db --- /dev/null +++ b/libodb-qt/tests/build/bootstrap.build @@ -0,0 +1,8 @@ +# file : tests/build/bootstrap.build +# license : GNU GPL v2; see accompanying LICENSE file + +project = # Unnamed subproject. + +using config +using dist +using test diff --git a/libodb-qt/tests/build/root.build b/libodb-qt/tests/build/root.build new file mode 100644 index 0000000..6c5a90b --- /dev/null +++ b/libodb-qt/tests/build/root.build @@ -0,0 +1,23 @@ +# file : tests/build/root.build +# license : GNU GPL v2; see accompanying LICENSE file + +cxx.std = latest + +using cxx + +hxx{*}: extension = hxx +cxx{*}: extension = cxx + +if ($cxx.target.system == 'win32-msvc') + cxx.poptions += -D_CRT_SECURE_NO_WARNINGS -D_SCL_SECURE_NO_WARNINGS + +if ($cxx.class == 'msvc') + cxx.coptions += /wd4251 /wd4275 /wd4800 + +# Every exe{} in this subproject is by default a test. +# +exe{*}: test = true + +# Specify the test target for cross-testing. +# +test.target = $cxx.target diff --git a/libodb-qt/tests/buildfile b/libodb-qt/tests/buildfile new file mode 100644 index 0000000..57588a4 --- /dev/null +++ b/libodb-qt/tests/buildfile @@ -0,0 +1,4 @@ +# file : tests/buildfile +# license : GNU GPL v2; see accompanying LICENSE file + +./: {*/ -build/} diff --git a/libodb-qt4-vc10.sln b/libodb-qt4-vc10.sln deleted file mode 100644 index e5c0645..0000000 --- a/libodb-qt4-vc10.sln +++ /dev/null @@ -1,26 +0,0 @@ - -Microsoft Visual Studio Solution File, Format Version 11.00 -# Visual Studio 2010 -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libodb-qt", "odb\qt\libodb-qt4-vc10.vcxproj", "{4392B1DA-5467-11E0-93E8-00E0812AE2E8}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Win32 = Debug|Win32 - Debug|x64 = Debug|x64 - Release|Win32 = Release|Win32 - Release|x64 = Release|x64 - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {4392B1DA-5467-11E0-93E8-00E0812AE2E8}.Debug|Win32.ActiveCfg = Debug|Win32 - {4392B1DA-5467-11E0-93E8-00E0812AE2E8}.Debug|Win32.Build.0 = Debug|Win32 - {4392B1DA-5467-11E0-93E8-00E0812AE2E8}.Debug|x64.ActiveCfg = Debug|x64 - {4392B1DA-5467-11E0-93E8-00E0812AE2E8}.Debug|x64.Build.0 = Debug|x64 - {4392B1DA-5467-11E0-93E8-00E0812AE2E8}.Release|Win32.ActiveCfg = Release|Win32 - {4392B1DA-5467-11E0-93E8-00E0812AE2E8}.Release|Win32.Build.0 = Release|Win32 - {4392B1DA-5467-11E0-93E8-00E0812AE2E8}.Release|x64.ActiveCfg = Release|x64 - {4392B1DA-5467-11E0-93E8-00E0812AE2E8}.Release|x64.Build.0 = Release|x64 - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection -EndGlobal diff --git a/libodb-qt4-vc11.sln b/libodb-qt4-vc11.sln deleted file mode 100644 index cf44717..0000000 --- a/libodb-qt4-vc11.sln +++ /dev/null @@ -1,26 +0,0 @@ - -Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio 2012 -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libodb-qt", "odb\qt\libodb-qt4-vc11.vcxproj", "{4392B1DA-5467-11E0-93E8-00E0812AE2E8}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Win32 = Debug|Win32 - Debug|x64 = Debug|x64 - Release|Win32 = Release|Win32 - Release|x64 = Release|x64 - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {4392B1DA-5467-11E0-93E8-00E0812AE2E8}.Debug|Win32.ActiveCfg = Debug|Win32 - {4392B1DA-5467-11E0-93E8-00E0812AE2E8}.Debug|Win32.Build.0 = Debug|Win32 - {4392B1DA-5467-11E0-93E8-00E0812AE2E8}.Debug|x64.ActiveCfg = Debug|x64 - {4392B1DA-5467-11E0-93E8-00E0812AE2E8}.Debug|x64.Build.0 = Debug|x64 - {4392B1DA-5467-11E0-93E8-00E0812AE2E8}.Release|Win32.ActiveCfg = Release|Win32 - {4392B1DA-5467-11E0-93E8-00E0812AE2E8}.Release|Win32.Build.0 = Release|Win32 - {4392B1DA-5467-11E0-93E8-00E0812AE2E8}.Release|x64.ActiveCfg = Release|x64 - {4392B1DA-5467-11E0-93E8-00E0812AE2E8}.Release|x64.Build.0 = Release|x64 - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection -EndGlobal diff --git a/libodb-qt4-vc12.sln b/libodb-qt4-vc12.sln deleted file mode 100644 index 3b44965..0000000 --- a/libodb-qt4-vc12.sln +++ /dev/null @@ -1,28 +0,0 @@ - -Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio 2013 -VisualStudioVersion = 12.0.21005.1 -MinimumVisualStudioVersion = 10.0.40219.1 -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libodb-qt", "odb\qt\libodb-qt4-vc12.vcxproj", "{4392B1DA-5467-11E0-93E8-00E0812AE2E8}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Win32 = Debug|Win32 - Debug|x64 = Debug|x64 - Release|Win32 = Release|Win32 - Release|x64 = Release|x64 - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {4392B1DA-5467-11E0-93E8-00E0812AE2E8}.Debug|Win32.ActiveCfg = Debug|Win32 - {4392B1DA-5467-11E0-93E8-00E0812AE2E8}.Debug|Win32.Build.0 = Debug|Win32 - {4392B1DA-5467-11E0-93E8-00E0812AE2E8}.Debug|x64.ActiveCfg = Debug|x64 - {4392B1DA-5467-11E0-93E8-00E0812AE2E8}.Debug|x64.Build.0 = Debug|x64 - {4392B1DA-5467-11E0-93E8-00E0812AE2E8}.Release|Win32.ActiveCfg = Release|Win32 - {4392B1DA-5467-11E0-93E8-00E0812AE2E8}.Release|Win32.Build.0 = Release|Win32 - {4392B1DA-5467-11E0-93E8-00E0812AE2E8}.Release|x64.ActiveCfg = Release|x64 - {4392B1DA-5467-11E0-93E8-00E0812AE2E8}.Release|x64.Build.0 = Release|x64 - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection -EndGlobal diff --git a/libodb-qt4-vc8.sln b/libodb-qt4-vc8.sln deleted file mode 100644 index 023c674..0000000 --- a/libodb-qt4-vc8.sln +++ /dev/null @@ -1,26 +0,0 @@ - -Microsoft Visual Studio Solution File, Format Version 9.00 -# Visual Studio 2005 -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libodb-qt", "odb\qt\libodb-qt4-vc8.vcproj", "{E8E3DC4A-5467-11E0-BA7B-00E0812AE2E8}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Win32 = Debug|Win32 - Debug|x64 = Debug|x64 - Release|Win32 = Release|Win32 - Release|x64 = Release|x64 - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {E8E3DC4A-5467-11E0-BA7B-00E0812AE2E8}.Debug|Win32.ActiveCfg = Debug|Win32 - {E8E3DC4A-5467-11E0-BA7B-00E0812AE2E8}.Debug|Win32.Build.0 = Debug|Win32 - {E8E3DC4A-5467-11E0-BA7B-00E0812AE2E8}.Debug|x64.ActiveCfg = Debug|x64 - {E8E3DC4A-5467-11E0-BA7B-00E0812AE2E8}.Debug|x64.Build.0 = Debug|x64 - {E8E3DC4A-5467-11E0-BA7B-00E0812AE2E8}.Release|Win32.ActiveCfg = Release|Win32 - {E8E3DC4A-5467-11E0-BA7B-00E0812AE2E8}.Release|Win32.Build.0 = Release|Win32 - {E8E3DC4A-5467-11E0-BA7B-00E0812AE2E8}.Release|x64.ActiveCfg = Release|x64 - {E8E3DC4A-5467-11E0-BA7B-00E0812AE2E8}.Release|x64.Build.0 = Release|x64 - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection -EndGlobal diff --git a/libodb-qt4-vc9.sln b/libodb-qt4-vc9.sln deleted file mode 100644 index 74abe11..0000000 --- a/libodb-qt4-vc9.sln +++ /dev/null @@ -1,26 +0,0 @@ - -Microsoft Visual Studio Solution File, Format Version 10.00 -# Visual Studio 2008 -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libodb-qt", "odb\qt\libodb-qt4-vc9.vcproj", "{E8E3DC4A-5467-11E0-BA7B-00E0812AE2E8}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Win32 = Debug|Win32 - Debug|x64 = Debug|x64 - Release|Win32 = Release|Win32 - Release|x64 = Release|x64 - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {E8E3DC4A-5467-11E0-BA7B-00E0812AE2E8}.Debug|Win32.ActiveCfg = Debug|Win32 - {E8E3DC4A-5467-11E0-BA7B-00E0812AE2E8}.Debug|Win32.Build.0 = Debug|Win32 - {E8E3DC4A-5467-11E0-BA7B-00E0812AE2E8}.Debug|x64.ActiveCfg = Debug|x64 - {E8E3DC4A-5467-11E0-BA7B-00E0812AE2E8}.Debug|x64.Build.0 = Debug|x64 - {E8E3DC4A-5467-11E0-BA7B-00E0812AE2E8}.Release|Win32.ActiveCfg = Release|Win32 - {E8E3DC4A-5467-11E0-BA7B-00E0812AE2E8}.Release|Win32.Build.0 = Release|Win32 - {E8E3DC4A-5467-11E0-BA7B-00E0812AE2E8}.Release|x64.ActiveCfg = Release|x64 - {E8E3DC4A-5467-11E0-BA7B-00E0812AE2E8}.Release|x64.Build.0 = Release|x64 - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection -EndGlobal diff --git a/libodb-qt5-vc10.sln b/libodb-qt5-vc10.sln deleted file mode 100644 index 7852e94..0000000 --- a/libodb-qt5-vc10.sln +++ /dev/null @@ -1,26 +0,0 @@ - -Microsoft Visual Studio Solution File, Format Version 11.00 -# Visual Studio 2010 -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libodb-qt", "odb\qt\libodb-qt5-vc10.vcxproj", "{4392B1DA-5467-11E0-93E8-00E0812AE2E8}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Win32 = Debug|Win32 - Debug|x64 = Debug|x64 - Release|Win32 = Release|Win32 - Release|x64 = Release|x64 - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {4392B1DA-5467-11E0-93E8-00E0812AE2E8}.Debug|Win32.ActiveCfg = Debug|Win32 - {4392B1DA-5467-11E0-93E8-00E0812AE2E8}.Debug|Win32.Build.0 = Debug|Win32 - {4392B1DA-5467-11E0-93E8-00E0812AE2E8}.Debug|x64.ActiveCfg = Debug|x64 - {4392B1DA-5467-11E0-93E8-00E0812AE2E8}.Debug|x64.Build.0 = Debug|x64 - {4392B1DA-5467-11E0-93E8-00E0812AE2E8}.Release|Win32.ActiveCfg = Release|Win32 - {4392B1DA-5467-11E0-93E8-00E0812AE2E8}.Release|Win32.Build.0 = Release|Win32 - {4392B1DA-5467-11E0-93E8-00E0812AE2E8}.Release|x64.ActiveCfg = Release|x64 - {4392B1DA-5467-11E0-93E8-00E0812AE2E8}.Release|x64.Build.0 = Release|x64 - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection -EndGlobal diff --git a/libodb-qt5-vc11.sln b/libodb-qt5-vc11.sln deleted file mode 100644 index 3cf08de..0000000 --- a/libodb-qt5-vc11.sln +++ /dev/null @@ -1,26 +0,0 @@ - -Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio 2012 -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libodb-qt", "odb\qt\libodb-qt5-vc11.vcxproj", "{4392B1DA-5467-11E0-93E8-00E0812AE2E8}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Win32 = Debug|Win32 - Debug|x64 = Debug|x64 - Release|Win32 = Release|Win32 - Release|x64 = Release|x64 - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {4392B1DA-5467-11E0-93E8-00E0812AE2E8}.Debug|Win32.ActiveCfg = Debug|Win32 - {4392B1DA-5467-11E0-93E8-00E0812AE2E8}.Debug|Win32.Build.0 = Debug|Win32 - {4392B1DA-5467-11E0-93E8-00E0812AE2E8}.Debug|x64.ActiveCfg = Debug|x64 - {4392B1DA-5467-11E0-93E8-00E0812AE2E8}.Debug|x64.Build.0 = Debug|x64 - {4392B1DA-5467-11E0-93E8-00E0812AE2E8}.Release|Win32.ActiveCfg = Release|Win32 - {4392B1DA-5467-11E0-93E8-00E0812AE2E8}.Release|Win32.Build.0 = Release|Win32 - {4392B1DA-5467-11E0-93E8-00E0812AE2E8}.Release|x64.ActiveCfg = Release|x64 - {4392B1DA-5467-11E0-93E8-00E0812AE2E8}.Release|x64.Build.0 = Release|x64 - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection -EndGlobal diff --git a/libodb-qt5-vc12.sln b/libodb-qt5-vc12.sln deleted file mode 100644 index eeaa377..0000000 --- a/libodb-qt5-vc12.sln +++ /dev/null @@ -1,28 +0,0 @@ - -Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio 2013 -VisualStudioVersion = 12.0.21005.1 -MinimumVisualStudioVersion = 10.0.40219.1 -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libodb-qt", "odb\qt\libodb-qt5-vc12.vcxproj", "{4392B1DA-5467-11E0-93E8-00E0812AE2E8}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Win32 = Debug|Win32 - Debug|x64 = Debug|x64 - Release|Win32 = Release|Win32 - Release|x64 = Release|x64 - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {4392B1DA-5467-11E0-93E8-00E0812AE2E8}.Debug|Win32.ActiveCfg = Debug|Win32 - {4392B1DA-5467-11E0-93E8-00E0812AE2E8}.Debug|Win32.Build.0 = Debug|Win32 - {4392B1DA-5467-11E0-93E8-00E0812AE2E8}.Debug|x64.ActiveCfg = Debug|x64 - {4392B1DA-5467-11E0-93E8-00E0812AE2E8}.Debug|x64.Build.0 = Debug|x64 - {4392B1DA-5467-11E0-93E8-00E0812AE2E8}.Release|Win32.ActiveCfg = Release|Win32 - {4392B1DA-5467-11E0-93E8-00E0812AE2E8}.Release|Win32.Build.0 = Release|Win32 - {4392B1DA-5467-11E0-93E8-00E0812AE2E8}.Release|x64.ActiveCfg = Release|x64 - {4392B1DA-5467-11E0-93E8-00E0812AE2E8}.Release|x64.Build.0 = Release|x64 - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection -EndGlobal diff --git a/libodb-qt5-vc9.sln b/libodb-qt5-vc9.sln deleted file mode 100644 index ac89bd9..0000000 --- a/libodb-qt5-vc9.sln +++ /dev/null @@ -1,26 +0,0 @@ - -Microsoft Visual Studio Solution File, Format Version 10.00 -# Visual Studio 2008 -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libodb-qt", "odb\qt\libodb-qt5-vc9.vcproj", "{E8E3DC4A-5467-11E0-BA7B-00E0812AE2E8}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Win32 = Debug|Win32 - Debug|x64 = Debug|x64 - Release|Win32 = Release|Win32 - Release|x64 = Release|x64 - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {E8E3DC4A-5467-11E0-BA7B-00E0812AE2E8}.Debug|Win32.ActiveCfg = Debug|Win32 - {E8E3DC4A-5467-11E0-BA7B-00E0812AE2E8}.Debug|Win32.Build.0 = Debug|Win32 - {E8E3DC4A-5467-11E0-BA7B-00E0812AE2E8}.Debug|x64.ActiveCfg = Debug|x64 - {E8E3DC4A-5467-11E0-BA7B-00E0812AE2E8}.Debug|x64.Build.0 = Debug|x64 - {E8E3DC4A-5467-11E0-BA7B-00E0812AE2E8}.Release|Win32.ActiveCfg = Release|Win32 - {E8E3DC4A-5467-11E0-BA7B-00E0812AE2E8}.Release|Win32.Build.0 = Release|Win32 - {E8E3DC4A-5467-11E0-BA7B-00E0812AE2E8}.Release|x64.ActiveCfg = Release|x64 - {E8E3DC4A-5467-11E0-BA7B-00E0812AE2E8}.Release|x64.Build.0 = Release|x64 - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection -EndGlobal diff --git a/m4/acx-pthread.m4 b/m4/acx-pthread.m4 deleted file mode 100644 index 204b32d..0000000 --- a/m4/acx-pthread.m4 +++ /dev/null @@ -1,259 +0,0 @@ -dnl -dnl NOTE: This file was modified. See the comments starting with 'CS:' -dnl for more information. In particular, it was changed to use C++ -dnl instead of C. -dnl -dnl @synopsis ACX_PTHREAD([ACTION-IF-FOUND[, ACTION-IF-NOT-FOUND]]) -dnl -dnl @summary figure out how to build C++ programs using POSIX threads -dnl -dnl This macro figures out how to build C++ programs using POSIX threads. -dnl It sets the PTHREAD_LIBS output variable to the threads library and -dnl linker flags, and the PTHREAD_CXXFLAGS output variable to any special -dnl C++ compiler flags that are needed. (The user can also force certain -dnl compiler flags/libs to be tested by setting these environment -dnl variables.) -dnl -dnl Also sets PTHREAD_CXX to any special C++ compiler that is needed for -dnl multi-threaded programs (defaults to the value of CXX otherwise). -dnl (This is necessary on AIX to use the special xlC_r compiler alias.) -dnl -dnl NOTE: You are assumed to not only compile your program with these -dnl flags, but also link it with them as well. e.g. you should link -dnl with $PTHREAD_CXX $CXXFLAGS $PTHREAD_CXXFLAGS $LDFLAGS ... $PTHREAD_LIBS -dnl $LIBS -dnl -dnl If you are only building threads programs, you may wish to use -dnl these variables in your default LIBS, CXXFLAGS, and CXX: -dnl -dnl LIBS="$PTHREAD_LIBS $LIBS" -dnl CXXFLAGS="$CXXFLAGS $PTHREAD_CXXFLAGS" -dnl CXX="$PTHREAD_CXX" -dnl -dnl In addition, if the PTHREAD_CREATE_JOINABLE thread-attribute -dnl constant has a nonstandard name, defines PTHREAD_CREATE_JOINABLE to -dnl that name (e.g. PTHREAD_CREATE_UNDETACHED on AIX). -dnl -dnl ACTION-IF-FOUND is a list of shell commands to run if a threads -dnl library is found, and ACTION-IF-NOT-FOUND is a list of commands to -dnl run it if it is not found. If ACTION-IF-FOUND is not specified, the -dnl default action will define HAVE_PTHREAD. -dnl -dnl Please let the authors know if this macro fails on any platform, or -dnl if you have any other suggestions or comments. This macro was based -dnl on work by SGJ on autoconf scripts for FFTW (www.fftw.org) (with -dnl help from M. Frigo), as well as ac_pthread and hb_pthread macros -dnl posted by Alejandro Forero Cuervo to the autoconf macro repository. -dnl We are also grateful for the helpful feedback of numerous users. -dnl -dnl @category InstalledPackages -dnl @author Steven G. Johnson -dnl @version 2006-05-29 -dnl @license GPLWithACException - -AC_DEFUN([ACX_PTHREAD], [ -AC_REQUIRE([AC_CANONICAL_HOST]) -AC_LANG_SAVE -AC_LANG(C++) -acx_pthread_ok=no - -# We used to check for pthread.h first, but this fails if pthread.h -# requires special compiler flags (e.g. on True64 or Sequent). -# It gets checked for in the link test anyway. - -# First of all, check if the user has set any of the PTHREAD_LIBS, -# etcetera environment variables, and if threads linking works using -# them: -if test x"$PTHREAD_LIBS$PTHREAD_CXXFLAGS" != x; then - save_CXXFLAGS="$CXXFLAGS" - CXXFLAGS="$CXXFLAGS $PTHREAD_CXXFLAGS" - save_LIBS="$LIBS" - LIBS="$PTHREAD_LIBS $LIBS" - AC_MSG_CHECKING([for pthread_join in LIBS=$PTHREAD_LIBS with CXXFLAGS=$PTHREAD_CXXFLAGS]) - AC_TRY_LINK_FUNC(pthread_join, acx_pthread_ok=yes) - AC_MSG_RESULT($acx_pthread_ok) - if test x"$acx_pthread_ok" = xno; then - PTHREAD_LIBS="" - PTHREAD_CXXFLAGS="" - fi - LIBS="$save_LIBS" - CXXFLAGS="$save_CXXFLAGS" -fi - -# We must check for the threads library under a number of different -# names; the ordering is very important because some systems -# (e.g. DEC) have both -lpthread and -lpthreads, where one of the -# libraries is broken (non-POSIX). - -# Create a list of thread flags to try. Items starting with a "-" are -# C compiler flags, and other items are library names, except for "none" -# which indicates that we try without any flags at all, and "pthread-config" -# which is a program returning the flags for the Pth emulation library. - -# CS: On GNU/Linux with gcc both -pthread and -lpthread are valid. -# However, libtool links libraries with -nostdlib which results in -# -pthread being stripped from the linker command line. To resolve -# this we move pthread from after -mthreads to after pthreads. -# -acx_pthread_flags="pthreads pthread none -Kthread -kthread lthread -pthread -pthreads -mthreads --thread-safe -mt pthread-config" - -# The ordering *is* (sometimes) important. Some notes on the -# individual items follow: - -# pthreads: AIX (must check this before -lpthread) -# none: in case threads are in libc; should be tried before -Kthread and -# other compiler flags to prevent continual compiler warnings -# -Kthread: Sequent (threads in libc, but -Kthread needed for pthread.h) -# -kthread: FreeBSD kernel threads (preferred to -pthread since SMP-able) -# lthread: LinuxThreads port on FreeBSD (also preferred to -pthread) -# -pthread: Linux/gcc (kernel threads), BSD/gcc (userland threads) -# -pthreads: Solaris/gcc -# -mthreads: Mingw32/gcc, Lynx/gcc -# -mt: Sun Workshop C (may only link SunOS threads [-lthread], but it -# doesn't hurt to check since this sometimes defines pthreads too; -# also defines -D_REENTRANT) -# ... -mt is also the pthreads flag for HP/aCC -# pthread: Linux, etcetera -# --thread-safe: KAI C++ -# pthread-config: use pthread-config program (for GNU Pth library) - -case "${host_cpu}-${host_os}" in - *solaris*) - - # On Solaris (at least, for some versions), libc contains stubbed - # (non-functional) versions of the pthreads routines, so link-based - # tests will erroneously succeed. (We need to link with -pthreads/-mt/ - # -lpthread.) (The stubs are missing pthread_cleanup_push, or rather - # a function called by this macro, so we could check for that, but - # who knows whether they'll stub that too in a future libc.) So, - # we'll just look for -pthreads and -lpthread first: - - # CS: Move -mt to the front of the list; Sun CC will use -mt, - # gcc will use -pthreads. - # - acx_pthread_flags="-mt -pthreads pthread -pthread $acx_pthread_flags" - ;; -esac - -if test x"$acx_pthread_ok" = xno; then -for flag in $acx_pthread_flags; do - - case $flag in - none) - AC_MSG_CHECKING([whether pthreads work without any flags]) - ;; - - -*) - AC_MSG_CHECKING([whether pthreads work with $flag]) - PTHREAD_CXXFLAGS="$flag" - ;; - - pthread-config) - AC_CHECK_PROG(acx_pthread_config, pthread-config, yes, no) - if test x"$acx_pthread_config" = xno; then continue; fi - PTHREAD_CXXFLAGS="`pthread-config --cflags`" - PTHREAD_LIBS="`pthread-config --ldflags` `pthread-config --libs`" - ;; - - *) - AC_MSG_CHECKING([for the pthreads library -l$flag]) - PTHREAD_LIBS="-l$flag" - ;; - esac - - save_LIBS="$LIBS" - save_CXXFLAGS="$CXXFLAGS" - LIBS="$PTHREAD_LIBS $LIBS" - CXXFLAGS="$CXXFLAGS $PTHREAD_CXXFLAGS" - - # Check for various functions. We must include pthread.h, - # since some functions may be macros. (On the Sequent, we - # need a special flag -Kthread to make this header compile.) - # We check for pthread_join because it is in -lpthread on IRIX - # while pthread_create is in libc. We check for pthread_attr_init - # due to DEC craziness with -lpthreads. We check for - # pthread_cleanup_push because it is one of the few pthread - # functions on Solaris that doesn't have a non-functional libc stub. - # We try pthread_create on general principles. - # - AC_TRY_LINK([#include ], - [pthread_t th; pthread_join(th, 0); - pthread_attr_init(0); pthread_cleanup_push(0, 0); - pthread_create(0,0,0,0); pthread_cleanup_pop(0);], - [acx_pthread_ok=yes]) - - LIBS="$save_LIBS" - CXXFLAGS="$save_CXXFLAGS" - - AC_MSG_RESULT($acx_pthread_ok) - if test "x$acx_pthread_ok" = xyes; then - break; - fi - - PTHREAD_LIBS="" - PTHREAD_CXXFLAGS="" -done -fi - -# Various other checks: -if test "x$acx_pthread_ok" = xyes; then - save_LIBS="$LIBS" - LIBS="$PTHREAD_LIBS $LIBS" - save_CXXFLAGS="$CXXFLAGS" - CXXFLAGS="$CXXFLAGS $PTHREAD_CXXFLAGS" - -dnl # Detect AIX lossage: JOINABLE attribute is called UNDETACHED. -dnl AC_MSG_CHECKING([for joinable pthread attribute]) -dnl attr_name=unknown -dnl for attr in PTHREAD_CREATE_JOINABLE PTHREAD_CREATE_UNDETACHED; do -dnl AC_TRY_LINK([#include ], [int attr=$attr; return attr;], -dnl [attr_name=$attr; break]) -dnl done -dnl AC_MSG_RESULT($attr_name) -dnl if test "$attr_name" != PTHREAD_CREATE_JOINABLE; then -dnl AC_DEFINE_UNQUOTED(PTHREAD_CREATE_JOINABLE, $attr_name, -dnl [Define to necessary symbol if this constant -dnl uses a non-standard name on your system.]) -dnl fi - - AC_MSG_CHECKING([if more special flags are required for pthreads]) - flag=no - case "${host_cpu}-${host_os}" in - *-aix* | *-freebsd* | *-darwin*) flag="-D_THREAD_SAFE";; - # CS: Add _REENTRANT in Linux to emulate -pthread. - # - *-linux* | *solaris* | *-osf* | *-hpux*) flag="-D_REENTRANT";; - esac - AC_MSG_RESULT(${flag}) - if test "x$flag" != xno; then - PTHREAD_CXXFLAGS="$flag $PTHREAD_CXXFLAGS" - fi - - LIBS="$save_LIBS" - CXXFLAGS="$save_CXXFLAGS" - -dnl # More AIX lossage: must compile with xlC_r -dnl if test x"$GXX" != xyes; then -dnl AC_CHECK_PROGS(PTHREAD_CXX, xlC_r, ${CXX}) -dnl else -dnl PTHREAD_CXX=$CXX -dnl fi - -else - PTHREAD_CXX="$CXX" -fi - -AC_SUBST(PTHREAD_LIBS) -AC_SUBST(PTHREAD_CXXFLAGS) -AC_SUBST(PTHREAD_CXX) - -# Finally, execute ACTION-IF-FOUND/ACTION-IF-NOT-FOUND: -if test x"$acx_pthread_ok" = xyes; then - ifelse([$1],,AC_DEFINE(HAVE_PTHREAD,1,[Define if you have POSIX threads libraries and header files.]),[$1]) - : -else - acx_pthread_ok=no - $2 -fi -AC_LANG_RESTORE -])dnl ACX_PTHREAD diff --git a/m4/disable-rpath.m4 b/m4/disable-rpath.m4 deleted file mode 100644 index 0864209..0000000 --- a/m4/disable-rpath.m4 +++ /dev/null @@ -1,24 +0,0 @@ -dnl file : m4/disable-rpath.m4 -dnl license : GNU GPL v2; see accompanying LICENSE file -dnl -AC_DEFUN([DISABLE_RPATH],[ - -AC_MSG_CHECKING([whether to use rpath]) -AC_ARG_ENABLE( - [rpath], - [AC_HELP_STRING([--disable-rpath], [patch libtool to not use rpath])], - [libtool_rpath="$enable_rpath"], - [libtool_rpath="yes"]) -AC_MSG_RESULT($libtool_rpath) - -# Patch libtool to not use rpath if requested. -# -AC_CONFIG_COMMANDS( - [libtool-rpath-patch], - [if test "$libtool_use_rpath" = "no"; then - sed < libtool > libtool-2 's/^hardcode_libdir_flag_spec.*$'/'hardcode_libdir_flag_spec=" -D__LIBTOOL_NO_RPATH__ "/' - mv libtool-2 libtool - chmod 755 libtool - fi], - [libtool_use_rpath=$libtool_rpath]) -])dnl diff --git a/m4/libodb.m4 b/m4/libodb.m4 deleted file mode 100644 index 0dba7c4..0000000 --- a/m4/libodb.m4 +++ /dev/null @@ -1,81 +0,0 @@ -dnl file : m4/libodb.m4 -dnl license : GNU GPL v2; see accompanying LICENSE file -dnl -dnl LIBODB([ACTION-IF-FOUND[, ACTION-IF-NOT-FOUND]]) -dnl -dnl -AC_DEFUN([LIBODB], [ -libodb_found=no - -AC_ARG_WITH( - [libodb], - [AC_HELP_STRING([--with-libodb=DIR],[location of libodb build directory])], - [libodb_dir=${withval}], - [libodb_dir=]) - -AC_MSG_CHECKING([for libodb]) - -# If libodb_dir was given, add the necessary preprocessor and linker flags. -# -if test x"$libodb_dir" != x; then - save_CPPFLAGS="$CPPFLAGS" - save_LDFLAGS="$LDFLAGS" - - AS_SET_CATFILE([abs_libodb_dir], [$ac_pwd], [$libodb_dir]) - - CPPFLAGS="$CPPFLAGS -I$abs_libodb_dir" - LDFLAGS="$LDFLAGS -L$abs_libodb_dir/odb" -fi - -save_LIBS="$LIBS" -LIBS="-lodb $LIBS" - -CXX_LIBTOOL_LINK_IFELSE([ -AC_LANG_SOURCE([ -#include - -void -f () -{ -} - -const char* -g () -{ - try - { - f (); - } - catch (const odb::exception& e) - { - return e.what (); - } - return 0; -} - -int -main () -{ - const char* m (g ()); - return m != 0; -} -])], -[libodb_found=yes]) - -if test x"$libodb_found" = xno; then - LIBS="$save_LIBS" - - if test x"$libodb_dir" != x; then - CPPFLAGS="$save_CPPFLAGS" - LDFLAGS="$save_LDFLAGS" - fi -fi - -if test x"$libodb_found" = xyes; then - AC_MSG_RESULT([yes]) - $1 -else - AC_MSG_RESULT([no]) - $2 -fi -])dnl diff --git a/m4/libqt.m4 b/m4/libqt.m4 deleted file mode 100644 index f053d79..0000000 --- a/m4/libqt.m4 +++ /dev/null @@ -1,121 +0,0 @@ -dnl file : m4/libqt.m4 -dnl license : GNU GPL v2; see accompanying LICENSE file -dnl -dnl -dnl LIBQTCORE_COMPILE() -dnl -AC_DEFUN([LIBQTCORE_COMPILE], [ -CXX_LIBTOOL_LINK_IFELSE([ -AC_LANG_SOURCE([ -// See libodb-qt/odb/qt/details/config.hxx for more information on -// what's going on here. -// -# if defined(__ELF__) && !defined(__PIC__) -# include // QT_REDUCE_RELOCATIONS -# ifdef QT_REDUCE_RELOCATIONS -# define __PIC__ -# endif -# endif -#include -#include - -int -main () -{ - QString qs ("test"); - std::string ss (qs.toStdString ()); - return ss.size () != 0; -} -])], -[libqt_found=yes]) -])dnl -dnl -dnl LIBQTCORE([ACTION-IF-FOUND[,ACTION-IF-NOT-FOUND]]) -dnl -dnl -AC_DEFUN([LIBQTCORE], [ -libqt_found=no - -# QtCore libraries and pkg-config names in the order we should try -# them. -# -libqt_lib_names="Qt5Core QtCore5 QtCore Qt4Core QtCore4" -libqt_pkg_names="Qt5Core QtCore" - -AC_PATH_PROG([pkg_config],[pkg-config]) - -AC_MSG_CHECKING([for QtCore]) - -# First check for QtCore using default CPPFLAGS/LDFLAGS/LIBS. This -# test allows the user to override the QtCore library name (e.g., -# QtCored4, Qt5Core) via the LIBS variable. -# -LIBQTCORE_COMPILE - -# Then check for QtCore using default CPPFLAGS/LDFLAGS. -# -if test x"$libqt_found" = xno; then - for lib in $libqt_lib_names; do - save_LIBS="$LIBS" - LIBS="-l$lib $LIBS" - - LIBQTCORE_COMPILE - - if test x"$libqt_found" = xno; then - LIBS="$save_LIBS" - else - break - fi - done -fi - -# Try framework in case we are on Mac OS X. -# -if test x"$libqt_found" = xno; then - save_LIBS="$LIBS" - LIBS="-framework QtCore $LIBS" - - LIBQTCORE_COMPILE - - if test x"$libqt_found" = xno; then - LIBS="$save_LIBS" - fi -fi - -# If default CPPFLAGS/LDFLAGS didn't work, try to discover -# them using pkg-config. -# -if test x"$libqt_found" = xno; then - if test x"$pkg_config" != x; then - for pkg in $libqt_pkg_names; do - if $pkg_config --exists $pkg; then - save_CPPFLAGS="$CPPFLAGS" - save_LIBS="$LIBS" - - CPPFLAGS=`$pkg_config --cflags $pkg` - LIBS=`$pkg_config --libs $pkg` - - CPPFLAGS="$CPPFLAGS $save_CPPFLAGS" - LIBS="$LIBS $save_LIBS" - - LIBQTCORE_COMPILE - - if test x"$libqt_found" = xno; then - CPPFLAGS="$save_CPPFLAGS" - LIBS="$save_LIBS" - else - break - fi - fi - done - fi -fi - -if test x"$libqt_found" = xyes; then - AC_MSG_RESULT([yes]) - $1 -else - AC_MSG_RESULT([no]) - $2 -fi -])dnl diff --git a/m4/libtool-link.m4 b/m4/libtool-link.m4 deleted file mode 100644 index 302639f..0000000 --- a/m4/libtool-link.m4 +++ /dev/null @@ -1,45 +0,0 @@ -dnl file : m4/libtool-link.m4 -dnl license : GNU GPL v2; see accompanying LICENSE file -dnl -dnl -dnl CXX_LIBTOOL_LINK_IFELSE (input, [action-if-true], [action-if-false]) -dnl -dnl Similar to AC_LINK_IFELSE except it uses libtool to perform the -dnl linking and it does this using the C++ compiler. -dnl -AC_DEFUN([CXX_LIBTOOL_LINK_IFELSE],[ -AC_LANG_SAVE -AC_LANG(C++) - -if test -d .libs; then - delete_libs_dir=no -else - delete_libs_dir=yes -fi - -AC_COMPILE_IFELSE([$1], -[ - ac_try='./libtool --tag=CXX --mode=link $CXX -no-install $CXXFLAGS $LDFLAGS -o conftest conftest.$OBJEXT $LIBS >&AS_MESSAGE_LOG_FD' - if _AC_DO_VAR(ac_try); then - libtool_link_ok=yes - else - libtool_link_ok=no - fi -], -[ - libtool_link_ok=no -]) - -if test x"$delete_libs_dir" = xyes; then - rm -rf .libs -fi - -if test x"$libtool_link_ok" = xyes; then -[$2] -: -else -[$3] -: -fi - -AC_LANG_RESTORE])dnl diff --git a/m4/pkgconfig.m4 b/m4/pkgconfig.m4 deleted file mode 100644 index c48ea56..0000000 --- a/m4/pkgconfig.m4 +++ /dev/null @@ -1,11 +0,0 @@ -dnl file : m4/pkgconfig.m4 -dnl license : GNU GPL v2; see accompanying LICENSE file -dnl -AC_DEFUN([PKGCONFIG],[ -AC_ARG_WITH( - [pkgconfigdir], - [AC_HELP_STRING([--with-pkgconfigdir=DIR],[location of pkgconfig dir (default is libdir/pkgconfig)])], - [pkgconfigdir=${withval}], - [pkgconfigdir='${libdir}/pkgconfig']) -AC_SUBST([pkgconfigdir]) -])dnl diff --git a/m4/static-lib.m4 b/m4/static-lib.m4 deleted file mode 100644 index 5fb1c11..0000000 --- a/m4/static-lib.m4 +++ /dev/null @@ -1,17 +0,0 @@ -dnl file : m4/static-lib.m4 -dnl license : GNU GPL v2; see accompanying LICENSE file -dnl -dnl STATIC_LIB(MACRO, DESCRIPTION) -dnl -dnl Define MACRO if we are on MinGW and are only building static library. -dnl -AC_DEFUN([STATIC_LIB], -[ -if test x$enable_shared = xno; then - case $host_os in - mingw*) - AC_DEFINE([$1], [1], [$2]) - ;; - esac -fi -])dnl diff --git a/m4/threads.m4 b/m4/threads.m4 deleted file mode 100644 index 6f2e25f..0000000 --- a/m4/threads.m4 +++ /dev/null @@ -1,68 +0,0 @@ -dnl file : m4/threads.m4 -dnl license : GNU GPL v2; see accompanying LICENSE file -dnl -AC_DEFUN([THREADS],[ - -threads_thread_keyword=no - -AC_ARG_ENABLE( - [threads], - AS_HELP_STRING([--disable-threads], [disable threads (enabled by default)]), - [AS_IF([test x"$enableval" = xno], [threads=none], [threads=check])], - [threads=check]) - -# If thread support is not disabled by the user, figure out what we can use. -# -if test x$threads = xcheck; then - case $host_os in - windows* | mingw*) - case $host_os in - mingw*) - CXXFLAGS="$CXXFLAGS -mthreads" - ;; - esac - - # Newer versions of GCC can be configured to use either Win32 or POSIX - # threads. It appears that -mthreads should be used in both cases but - # if the model is POSIX then GCC will also link -lpthread by default. - # Use that fact to test which model we have. - # - AC_TRY_LINK([#include ], - [pthread_create(0,0,0,0);], - [threads=posix], - [threads=win32]) - ;; - *) - ACX_PTHREAD - - if test x$acx_pthread_ok = xyes; then - threads=posix - LIBS="$LIBS $PTHREAD_LIBS" - CXXFLAGS="$CXXFLAGS $PTHREAD_CXXFLAGS" - - # Check if we can use the __thread keyword. - # - AC_MSG_CHECKING([for __thread keyword]) - - CXX_LIBTOOL_LINK_IFELSE([ - AC_LANG_SOURCE([ - __thread int tls_var; - - int - main () - { - tls_var = 0; - } - ])], - [threads_thread_keyword=yes]) - - AC_MSG_RESULT([$threads_thread_keyword]) - fi - ;; - esac -fi - -if test x$threads = xcheck; then - AC_MSG_ERROR([thread support not available; use --disable-threads to force single-threaded mode]) -fi -])dnl diff --git a/makefile b/makefile deleted file mode 100644 index 994a37a..0000000 --- a/makefile +++ /dev/null @@ -1,44 +0,0 @@ -# file : makefile -# license : GNU GPL v2; see accompanying LICENSE file - -include $(dir $(lastword $(MAKEFILE_LIST)))build/bootstrap.make - -dirs := odb/qt - -default := $(out_base)/ -dist := $(out_base)/.dist -clean := $(out_base)/.clean - -$(default): $(addprefix $(out_base)/,$(addsuffix /,$(dirs))) - -$(dist): export dirs := $(dirs) -$(dist): export docs := GPLv2 LICENSE README NEWS version -$(dist): export options := odb/qt.options -$(dist): data_dist := INSTALL \ -libodb-qt4-vc8.sln \ -libodb-qt4-vc9.sln \ -libodb-qt4-vc10.sln \ -libodb-qt4-vc11.sln \ -libodb-qt4-vc12.sln \ -libodb-qt5-vc9.sln \ -libodb-qt5-vc10.sln \ -libodb-qt5-vc11.sln \ -libodb-qt5-vc12.sln -$(dist): exec_dist := bootstrap -$(dist): export extra_dist := $(data_dist) $(exec_dist) -$(dist): export version = $(shell cat $(src_root)/version) - -$(dist): $(addprefix $(out_base)/,$(addsuffix /.dist,$(dirs))) - $(call dist-data,$(docs) $(options) $(data_dist) libodb-qt.pc.in) - $(call dist-exec,$(exec_dist)) - $(call dist-dir,m4) - $(call meta-automake) - $(call meta-autoconf) - -$(clean): $(addprefix $(out_base)/,$(addsuffix /.clean,$(dirs))) - -$(call include,$(bld_root)/dist.make) -$(call include,$(bld_root)/meta/automake.make) -$(call include,$(bld_root)/meta/autoconf.make) - -$(foreach d,$(dirs),$(call import,$(src_base)/$d/makefile)) diff --git a/manifest b/manifest deleted file mode 100644 index d806cae..0000000 --- a/manifest +++ /dev/null @@ -1,21 +0,0 @@ -: 1 -name: libodb-qt -version: 2.5.0-b.26.z -project: odb -summary: Qt ODB profile library -license: GPL-2.0-only -license: other: proprietary ; Not free/open source. -topics: C++, ORM, Qt, SQL -description-file: README -changes-file: NEWS -url: https://www.codesynthesis.com/products/odb/ -doc-url: https://www.codesynthesis.com/products/odb/doc/manual.xhtml -src-url: https://git.codesynthesis.com/cgit/odb/libodb-qt/ -email: odb-users@codesynthesis.com -build-warning-email: odb-builds@codesynthesis.com -builds: all -requires: c++11 -requires: libqt-core ; Requires not yet packaged libqt-core. -depends: * build2 >= 0.16.0- -depends: * bpkg >= 0.16.0- -depends: libodb [2.5.0-b.26.1 2.5.0-b.27) diff --git a/odb/qt.options b/odb/qt.options deleted file mode 100644 index 1e31135..0000000 --- a/odb/qt.options +++ /dev/null @@ -1,7 +0,0 @@ -# file : odb/qt.options -# license : GNU GPL v2; see accompanying LICENSE file - ---profile qt/basic ---profile qt/containers ---profile qt/date-time ---profile qt/smart-ptr diff --git a/odb/qt/Makefile.am b/odb/qt/Makefile.am deleted file mode 100644 index 7edbe1d..0000000 --- a/odb/qt/Makefile.am +++ /dev/null @@ -1,14 +0,0 @@ -# file : odb/qt/Makefile.am -# license : GNU GPL v2; see accompanying LICENSE file - -lib_LTLIBRARIES = libodb-qt.la -libodb_qt_la_SOURCES = __path__(sources) - -odbqtincludedir = $(includedir)/odb/qt/ -nobase_odbqtinclude_HEADERS = __path__(headers) __path__(options) -nobase_nodist_odbqtinclude_HEADERS = details/config.h - -EXTRA_DIST = __file__(extra_dist) - -AM_CPPFLAGS= -I'$(top_builddir)' -I'$(top_srcdir)' -DLIBODB_QT_DYNAMIC_LIB -AM_LDFLAGS = -release __value__(interface_version) -no-undefined diff --git a/odb/qt/basic.options b/odb/qt/basic.options deleted file mode 100644 index 306d949..0000000 --- a/odb/qt/basic.options +++ /dev/null @@ -1,4 +0,0 @@ -# file : odb/qt/basic.options -# license : GNU GPL v2; see accompanying LICENSE file - ---profile qt/basic/basic diff --git a/odb/qt/basic/basic-common.options b/odb/qt/basic/basic-common.options deleted file mode 100644 index f704314..0000000 --- a/odb/qt/basic/basic-common.options +++ /dev/null @@ -1,4 +0,0 @@ -# file : odb/qt/basic/basic-common.options -# license : GNU GPL v2; see accompanying LICENSE file - ---profile qt/version diff --git a/odb/qt/basic/basic-mssql.options b/odb/qt/basic/basic-mssql.options deleted file mode 100644 index 2234df5..0000000 --- a/odb/qt/basic/basic-mssql.options +++ /dev/null @@ -1,13 +0,0 @@ -# file : odb/qt/basic/basic-mssql.options -# license : GNU GPL v2; see accompanying LICENSE file - ---profile qt/version - -# Include the default mapping in prologue instead of epilogue to -# allow the user to override the default mapping. -# ---odb-prologue '#include ' - ---hxx-prologue '#include ' ---hxx-prologue '#include ' ---hxx-prologue '#include ' diff --git a/odb/qt/basic/basic-mysql.options b/odb/qt/basic/basic-mysql.options deleted file mode 100644 index d049f4e..0000000 --- a/odb/qt/basic/basic-mysql.options +++ /dev/null @@ -1,13 +0,0 @@ -# file : odb/qt/basic/basic-mysql.options -# license : GNU GPL v2; see accompanying LICENSE file - ---profile qt/version - -# Include the default mapping in prologue instead of epilogue to -# allow the user to override the default mapping. -# ---odb-prologue '#include ' - ---hxx-prologue '#include ' ---hxx-prologue '#include ' ---hxx-prologue '#include ' diff --git a/odb/qt/basic/basic-oracle.options b/odb/qt/basic/basic-oracle.options deleted file mode 100644 index 60ef9d0..0000000 --- a/odb/qt/basic/basic-oracle.options +++ /dev/null @@ -1,13 +0,0 @@ -# file : odb/qt/basic/basic-oracle.options -# license : GNU GPL v2; see accompanying LICENSE file - ---profile qt/version - -# Include the default mapping in prologue instead of epilogue to -# allow the user to override the default mapping. -# ---odb-prologue '#include ' - ---hxx-prologue '#include ' ---hxx-prologue '#include ' ---hxx-prologue '#include ' diff --git a/odb/qt/basic/basic-pgsql.options b/odb/qt/basic/basic-pgsql.options deleted file mode 100644 index 6f0dc6e..0000000 --- a/odb/qt/basic/basic-pgsql.options +++ /dev/null @@ -1,13 +0,0 @@ -# file : odb/qt/basic/basic-pgsql.options -# license : GNU GPL v2; see accompanying LICENSE file - ---profile qt/version - -# Include the default mapping in prologue instead of epilogue to -# allow the user to override the default mapping. -# ---odb-prologue '#include ' - ---hxx-prologue '#include ' ---hxx-prologue '#include ' ---hxx-prologue '#include ' diff --git a/odb/qt/basic/basic-sqlite.options b/odb/qt/basic/basic-sqlite.options deleted file mode 100644 index c64e37c..0000000 --- a/odb/qt/basic/basic-sqlite.options +++ /dev/null @@ -1,13 +0,0 @@ -# file : odb/qt/basic/basic-sqlite.options -# license : GNU GPL v2; see accompanying LICENSE file - ---profile qt/version - -# Include the default mapping in prologue instead of epilogue to -# allow the user to override the default mapping. -# ---odb-prologue '#include ' - ---hxx-prologue '#include ' ---hxx-prologue '#include ' ---hxx-prologue '#include ' diff --git a/odb/qt/basic/mssql/default-mapping.hxx b/odb/qt/basic/mssql/default-mapping.hxx deleted file mode 100644 index 19fd43b..0000000 --- a/odb/qt/basic/mssql/default-mapping.hxx +++ /dev/null @@ -1,29 +0,0 @@ -// file : odb/qt/basic/mssql/default-mapping.hxx -// license : GNU GPL v2; see accompanying LICENSE file - -#ifndef ODB_QT_BASIC_MSSQL_DEFAULT_MAPPING_HXX -#define ODB_QT_BASIC_MSSQL_DEFAULT_MAPPING_HXX - -#include -#include -#include - -// By default map QString to SQL Server VARCHAR(512) for non-id members -// and to VARCHAR(256) for id members (the same as the default mapping -// for std::string). Allow NULL values by default as QString provides -// a null representation. -// -#pragma db value(QString) type("VARCHAR(512)") id_type("VARCHAR(256)") null - -// By default map QByteArray to SQL Server VARBINARY(max). Allow NULL -// values by default as QByteArray provides a null representation. -// -#pragma db value(QByteArray) type("VARBINARY(max)") null - -// By default map QUuid to SQL Server UNIQUEIDENTIFIER and use NULL to -// represent null UUIDs. If NULL is disabled (e.g., at the member level), -// then we store the null UUID (i.e., all bytes are zero). -// -#pragma db value(QUuid) type("UNIQUEIDENTIFIER") null - -#endif // ODB_QT_BASIC_MSSQL_DEFAULT_MAPPING_HXX diff --git a/odb/qt/basic/mssql/qbyte-array-traits.hxx b/odb/qt/basic/mssql/qbyte-array-traits.hxx deleted file mode 100644 index 8047691..0000000 --- a/odb/qt/basic/mssql/qbyte-array-traits.hxx +++ /dev/null @@ -1,177 +0,0 @@ -// file : odb/qt/basic/mssql/qbyte-array-traits.hxx -// license : GNU GPL v2; see accompanying LICENSE file - -#ifndef ODB_QT_BASIC_MSSQL_QBYTE_ARRAY_TRAITS_HXX -#define ODB_QT_BASIC_MSSQL_QBYTE_ARRAY_TRAITS_HXX - -#include - -#include // std::memcpy -#include // std::size_t -#include - -#include - -#include - -namespace odb -{ - namespace mssql - { - template <> - struct default_value_traits - { - typedef QByteArray value_type; - typedef QByteArray query_type; - typedef char* image_type; - - static void - set_value (QByteArray& v, const char* b, std::size_t n, bool is_null) - { - if (is_null) - v = QByteArray (); - else - { - // Note that we cannot use replace() here since a suitable - // overload was only added in Qt 4.7. - // - v.resize (static_cast (n)); - std::memcpy (v.data (), b, n); - } - } - - static void - set_image (char* b, - std::size_t c, - std::size_t& n, - bool& is_null, - const QByteArray& v) - { - if (v.isNull ()) - is_null = true; - else - { - is_null = false; - n = static_cast (v.size ()); - - if (n > c) - n = c; - - std::memcpy (b, v.constData (), n); - } - } - }; - - template <> - struct default_value_traits - { - typedef QByteArray value_type; - typedef QByteArray query_type; - typedef long_callback image_type; - - static void - set_value (QByteArray& v, - result_callback_type& cb, - void*& context) - { - cb = &result_callback; - context = &v; - } - - static void - set_image (param_callback_type& cb, - const void*& context, - bool& is_null, - const QByteArray& v) - { - if (v.isNull ()) - is_null = true; - else - { - is_null = false; - cb = ¶m_callback; - context = &v; - } - } - - static void - param_callback (const void* context, - std::size_t*, - const void** buffer, - std::size_t* size, - chunk_type* chunk, - void*, - std::size_t) - { - const QByteArray& v (*static_cast (context)); - - *buffer = v.constData (); - *size = static_cast (v.size ()); - *chunk = chunk_one; - } - - static void - result_callback (void* context, - std::size_t*, - void** buffer, - std::size_t* size, - chunk_type chunk, - std::size_t size_left, - void*, - std::size_t) - { - QByteArray& v (*static_cast (context)); - - switch (chunk) - { - case chunk_null: - { - v = QByteArray (); - break; - } - case chunk_one: - { - v.clear (); - break; - } - case chunk_first: - { - // The Native Client ODBC driver seems to always be able to - // return the total size. This makes things simple and - // efficient. - // - assert (size_left != 0); - - v.resize (static_cast (size_left)); - *buffer = v.data (); - *size = size_left; - break; - } - case chunk_next: - { - // We should never get here. - // - assert (false); - break; - } - case chunk_last: - { - // Nothing to do here. The array is already of the correct size - // and should contain the data. - break; - } - } - } - }; - - template <> - struct default_type_traits - { - static const database_type_id db_type_id = id_long_binary; - }; - } -} - -#include - -#endif // ODB_QT_BASIC_MSSQL_QBYTE_ARRAY_TRAITS_HXX diff --git a/odb/qt/basic/mssql/qstring-traits.hxx b/odb/qt/basic/mssql/qstring-traits.hxx deleted file mode 100644 index 779120e..0000000 --- a/odb/qt/basic/mssql/qstring-traits.hxx +++ /dev/null @@ -1,372 +0,0 @@ -// file : odb/qt/basic/mssql/qstring-traits.hxx -// license : GNU GPL v2; see accompanying LICENSE file - -#ifndef ODB_QT_BASIC_MSSQL_QSTRING_TRAITS_HXX -#define ODB_QT_BASIC_MSSQL_QSTRING_TRAITS_HXX - -#include - -#include // std::memcpy -#include // std::size_t -#include - -#include - -#include - -namespace odb -{ - namespace mssql - { - template <> - struct default_value_traits - { - typedef QString value_type; - typedef QString query_type; - typedef char* image_type; - - static void - set_value (QString& v, - const char* b, - std::size_t n, - bool is_null) - { - if (is_null) - v = QString (); - else - // On Windows the string data is in Windows code page. On Linux - // it is always UTF-8. - // -#ifdef _WIN32 - v = QString::fromLocal8Bit (b, static_cast (n)); -#else - v = QString::fromUtf8 (b, static_cast (n)); -#endif - } - - static void - set_image (char* b, - std::size_t c, - std::size_t& n, - bool& is_null, - const QString& v) - { - if (v.isNull ()) - is_null = true; - else - { - is_null = false; - -#ifdef _WIN32 - const QByteArray& a (v.toLocal8Bit ()); -#else - const QByteArray& a (v.toUtf8 ()); -#endif - n = static_cast (a.size ()); - - if (n > c) - n = c; - - std::memcpy (b, a.constData (), n); - } - } - }; - - template <> - struct default_value_traits - { - typedef QString value_type; - typedef QString query_type; - typedef ucs2_char* image_type; - - static void - set_value (QString& v, - const ucs2_char* b, - std::size_t n, - bool is_null) - { - if (is_null) - v = QString (); - else - { - // Note that we cannot use replace() here since a suitable - // overload was only added in Qt 4.7. - // - v.resize (static_cast (n)); - std::memcpy (v.data (), b, n * 2); - } - } - - static void - set_image (ucs2_char* b, - std::size_t c, - std::size_t& n, - bool& is_null, - const QString& v) - { - if (v.isNull ()) - is_null = true; - else - { - is_null = false; - n = static_cast (v.size ()); - - if (n > c) - n = c; - - std::memcpy (b, v.constData (), n * 2); - } - } - }; - - template <> - struct default_value_traits - { - typedef QString value_type; - typedef QString query_type; - typedef long_callback image_type; - - static void - set_value (QString& v, - result_callback_type& cb, - void*& context) - { - cb = &result_callback; - context = &v; - } - - static void - set_image (param_callback_type& cb, - const void*& context, - bool& is_null, - const QString& v) - { - if (v.isNull ()) - is_null = true; - else - { - is_null = false; - cb = ¶m_callback; - context = &v; - } - } - - static void - param_callback (const void* context, - std::size_t* position, - const void** buffer, - std::size_t* size, - chunk_type* chunk, - void* tmp_buf, - std::size_t tmp_capacity) - { - const QString& s (*static_cast (context)); - -#ifdef _WIN32 - const QByteArray& v (s.toLocal8Bit ()); -#else - const QByteArray& v (s.toUtf8 ()); -#endif - - *size = static_cast (v.size ()); - - if (*position == 0) - { - if (*size <= tmp_capacity) - *chunk = chunk_one; - else - { - *size = tmp_capacity; - *chunk = chunk_first; - } - } - else - { - *size -= *position; - - if (*size <= tmp_capacity) - *chunk = chunk_last; - else - { - *size = tmp_capacity; - *chunk = chunk_next; - } - } - - //@@ We might split a multi-byte sequence. Microsoft ODBC driver - // doesn't support this. - // - std::memcpy (tmp_buf, v.constData () + *position, *size); - *buffer = tmp_buf; - *position += *size; - } - - static void - result_callback (void* context, - std::size_t*, - void** buffer, - std::size_t* size, - chunk_type chunk, - std::size_t, - void* tmp_buf, - std::size_t tmp_capacity) - { - QString& v (*static_cast (context)); - - switch (chunk) - { - case chunk_null: - { - v = QString (); - break; - } - case chunk_one: - { - v.clear (); - break; - } - case chunk_first: - { - break; - } - case chunk_next: - case chunk_last: - { - // Append the data from the temporary buffer. - // -#ifdef _WIN32 - v += QString::fromLocal8Bit (static_cast (tmp_buf), - static_cast (*size)); -#else - v += QString::fromUtf8 (static_cast (tmp_buf), - static_cast (*size)); -#endif - break; - } - } - - if (chunk == chunk_first || chunk == chunk_next) - { - *buffer = tmp_buf; - *size = tmp_capacity; - } - } - }; - - template <> - struct default_value_traits - { - typedef QString value_type; - typedef QString query_type; - typedef long_callback image_type; - - static void - set_value (QString& v, - result_callback_type& cb, - void*& context) - { - cb = &result_callback; - context = &v; - } - - static void - set_image (param_callback_type& cb, - const void*& context, - bool& is_null, - const QString& v) - { - if (v.isNull ()) - is_null = true; - else - { - is_null = false; - cb = ¶m_callback; - context = &v; - } - } - - static void - param_callback (const void* context, - std::size_t*, - const void** buffer, - std::size_t* size, - chunk_type* chunk, - void*, - std::size_t) - { - const QString& v (*static_cast (context)); - - *buffer = v.constData (); - *size = static_cast (v.size ()) * 2; - *chunk = chunk_one; - } - - static void - result_callback (void* context, - std::size_t*, - void** buffer, - std::size_t* size, - chunk_type chunk, - std::size_t size_left, - void*, - std::size_t) - { - QString& v (*static_cast (context)); - - switch (chunk) - { - case chunk_null: - { - v = QString (); - break; - } - case chunk_one: - { - v.clear (); - break; - } - case chunk_first: - { - // The Native Client ODBC driver seems to always be able to - // return the total size. This makes things simple and - // efficient. - // - assert (size_left != 0); - - size_left /= 2; // Convert to characters. - size_left++; // One extra for the null terminator. - - v.resize (static_cast (size_left)); - *buffer = v.data (); - *size = size_left * 2; // In bytes. - break; - } - case chunk_next: - { - // We should never get here. - // - assert (false); - break; - } - case chunk_last: - { - // Get rid of the null terminator. - // - v.resize (static_cast (*size / 2)); - break; - } - } - } - }; - - template <> - struct default_type_traits - { - static const database_type_id db_type_id = id_long_string; - }; - } -} - -#include - -#endif // ODB_QT_BASIC_MSSQL_QSTRING_TRAITS_HXX diff --git a/odb/qt/basic/mssql/quuid-traits.hxx b/odb/qt/basic/mssql/quuid-traits.hxx deleted file mode 100644 index d65b80f..0000000 --- a/odb/qt/basic/mssql/quuid-traits.hxx +++ /dev/null @@ -1,58 +0,0 @@ -// file : odb/qt/basic/mssql/uuid-traits.hxx -// license : GNU GPL v2; see accompanying LICENSE file - -#ifndef ODB_QT_BASIC_MSSQL_UUID_TRAITS_HXX -#define ODB_QT_BASIC_MSSQL_UUID_TRAITS_HXX - -#include - -#include // std::memcpy - -#include - -#include - -namespace odb -{ - namespace mssql - { - template <> - class default_value_traits - { - public: - typedef QUuid value_type; - typedef value_type query_type; - typedef uniqueidentifier image_type; - - static void - set_value (value_type& v, const uniqueidentifier& i, bool is_null) - { - if (!is_null) - std::memcpy (&v.data1, &i, 16); - else - v = QUuid (); - } - - static void - set_image (uniqueidentifier& i, bool& is_null, const value_type& v) - { - // If we can, store nil as NULL. Otherwise, store it as a value. - // - is_null = is_null && v.isNull (); - - if (!is_null) - std::memcpy (&i, &v.data1, 16); - } - }; - - template <> - struct default_type_traits - { - static const database_type_id db_type_id = id_uniqueidentifier; - }; - } -} - -#include - -#endif // ODB_QT_BASIC_MSSQL_UUID_TRAITS_HXX diff --git a/odb/qt/basic/mysql/default-mapping.hxx b/odb/qt/basic/mysql/default-mapping.hxx deleted file mode 100644 index 996895f..0000000 --- a/odb/qt/basic/mysql/default-mapping.hxx +++ /dev/null @@ -1,28 +0,0 @@ -// file : odb/qt/basic/mysql/default-mapping.hxx -// license : GNU GPL v2; see accompanying LICENSE file - -#ifndef ODB_QT_BASIC_MYSQL_DEFAULT_MAPPING_HXX -#define ODB_QT_BASIC_MYSQL_DEFAULT_MAPPING_HXX - -#include -#include -#include - -// Map QString to MySQL TEXT for non-id and to VARCHAR(128) for id members. -// MySQL cannot have primary key of the TEXT type. Allow NULL values by -// default as QString provides a null representation. -// -#pragma db value(QString) type("TEXT") id_type("VARCHAR(128)") null - -// Map QByteArray to MySQL BLOB by default. Allow NULL values by default as -// QByteArray provides a null representation. -// -#pragma db value(QByteArray) type("BLOB") null - -// By default map QUuid to MySQL BINARY(16) and use NULL to represent null -// UUIDs. If NULL is disabled (e.g., at the member level), then we store -// the null UUID (i.e., all bytes are zero). -// -#pragma db value(QUuid) type("BINARY(16)") null - -#endif // ODB_QT_BASIC_MYSQL_DEFAULT_MAPPING_HXX diff --git a/odb/qt/basic/mysql/qbyte-array-traits.hxx b/odb/qt/basic/mysql/qbyte-array-traits.hxx deleted file mode 100644 index bfcfc69..0000000 --- a/odb/qt/basic/mysql/qbyte-array-traits.hxx +++ /dev/null @@ -1,78 +0,0 @@ -// file : odb/qt/basic/mysql/qbyte-array-traits.hxx -// license : GNU GPL v2; see accompanying LICENSE file - -#ifndef ODB_QT_BASIC_MYSQL_QBYTE_ARRAY_TRAITS_HXX -#define ODB_QT_BASIC_MYSQL_QBYTE_ARRAY_TRAITS_HXX - -#include - -#include // std::memcpy -#include // std::size_t - -#include - -#include -#include - -namespace odb -{ - namespace mysql - { - template <> - struct default_value_traits - { - typedef QByteArray value_type; - typedef QByteArray query_type; - typedef details::buffer image_type; - - static void - set_value (QByteArray& v, - const details::buffer& b, - std::size_t n, - bool is_null) - { - if (is_null) - v = QByteArray (); - else - { - // Note that we cannot use replace() here since a suitable - // overload was only added in Qt 4.7. - // - v.resize (static_cast (n)); - std::memcpy (v.data (), b.data (), n); - } - } - - static void - set_image (details::buffer& b, - std::size_t& n, - bool& is_null, - const QByteArray& v) - { - if (v.isNull ()) - is_null = true; - else - { - is_null = false; - - n = static_cast (v.size ()); - - if (n > b.capacity ()) - b.capacity (n); - - std::memcpy (b.data (), v.data (), n); - } - } - }; - - template <> - struct default_type_traits - { - static const database_type_id db_type_id = id_blob; - }; - } -} - -#include - -#endif // ODB_QT_BASIC_MYSQL_QBYTE_ARRAY_TRAITS_HXX diff --git a/odb/qt/basic/mysql/qstring-traits.hxx b/odb/qt/basic/mysql/qstring-traits.hxx deleted file mode 100644 index 6a5f315..0000000 --- a/odb/qt/basic/mysql/qstring-traits.hxx +++ /dev/null @@ -1,93 +0,0 @@ -// file : odb/qt/basic/mysql/qstring-traits.hxx -// license : GNU GPL v2; see accompanying LICENSE file - -#ifndef ODB_QT_BASIC_MYSQL_QSTRING_TRAITS_HXX -#define ODB_QT_BASIC_MYSQL_QSTRING_TRAITS_HXX - -#include - -#include // std::memcpy -#include // std::size_t - -#include - -#include -#include - -namespace odb -{ - namespace mysql - { - class qstring_value_traits - { - public: - typedef QString value_type; - typedef QString query_type; - typedef details::buffer image_type; - - static void - set_value (QString& v, - const details::buffer& b, - std::size_t n, - bool is_null) - { - if (is_null) - v = QString (); - else - v = QString::fromUtf8 (b.data (), static_cast (n)); - } - - static void - set_image (details::buffer& b, - std::size_t& n, - bool& is_null, - const QString& v) - { - if (v.isNull ()) - is_null = true; - else - { - is_null = false; - - const QByteArray& a (v.toUtf8 ()); - n = static_cast (a.size ()); - - if (n > b.capacity ()) - b.capacity (n); - - std::memcpy (b.data (), a.data (), n); - } - } - }; - - template <> - struct default_value_traits: qstring_value_traits - { - }; - - template <> - struct default_value_traits: qstring_value_traits - { - }; - - template <> - struct default_value_traits: qstring_value_traits - { - }; - - template <> - struct default_value_traits: qstring_value_traits - { - }; - - template <> - struct default_type_traits - { - static const database_type_id db_type_id = id_string; - }; - } -} - -#include - -#endif // ODB_QT_BASIC_MYSQL_QSTRING_TRAITS_HXX diff --git a/odb/qt/basic/mysql/quuid-traits.hxx b/odb/qt/basic/mysql/quuid-traits.hxx deleted file mode 100644 index c672ee8..0000000 --- a/odb/qt/basic/mysql/quuid-traits.hxx +++ /dev/null @@ -1,74 +0,0 @@ -// file : odb/qt/basic/mysql/uuid-traits.hxx -// license : GNU GPL v2; see accompanying LICENSE file - -#ifndef ODB_QT_BASIC_MYSQL_UUID_TRAITS_HXX -#define ODB_QT_BASIC_MYSQL_UUID_TRAITS_HXX - -#include - -#include // std::memcpy -#include - -#include - -#include - -namespace odb -{ - namespace mysql - { - template <> - struct default_value_traits - { - typedef QUuid value_type; - typedef value_type query_type; - typedef details::buffer image_type; - - static void - set_value (value_type& v, - const details::buffer& b, - std::size_t n, - bool is_null) - { - if (!is_null) - { - assert (n == 16); - std::memcpy (&v.data1, b.data (), 16); - } - else - v = QUuid (); - } - - static void - set_image (details::buffer& b, - std::size_t& n, - bool& is_null, - const value_type& v) - { - // If we can, store nil as NULL. Otherwise, store it as a value. - // - is_null = is_null && v.isNull (); - - if (!is_null) - { - n = 16; - - if (n > b.capacity ()) - b.capacity (n); - - std::memcpy (b.data (), &v.data1, n); - } - } - }; - - template <> - struct default_type_traits - { - static const database_type_id db_type_id = id_blob; - }; - } -} - -#include - -#endif // ODB_QT_BASIC_MYSQL_UUID_TRAITS_HXX diff --git a/odb/qt/basic/oracle/default-mapping.hxx b/odb/qt/basic/oracle/default-mapping.hxx deleted file mode 100644 index 8d72206..0000000 --- a/odb/qt/basic/oracle/default-mapping.hxx +++ /dev/null @@ -1,27 +0,0 @@ -// file : odb/qt/basic/oracle/default-mapping.hxx -// license : GNU GPL v2; see accompanying LICENSE file - -#ifndef ODB_QT_BASIC_ORACLE_DEFAULT_MAPPING_HXX -#define ODB_QT_BASIC_ORACLE_DEFAULT_MAPPING_HXX - -#include -#include -#include - -// Map QString to Oracle VARCHAR2 by default. Allow NULL values by default as -// QString provides a null representation. -// -#pragma db value(QString) type("VARCHAR2(512)") null - -// Map QByteArray to Oracle BLOB by default. Allow NULL values by default as -// QByteArray provides a null representation. -// -#pragma db value(QByteArray) type("BLOB") null - -// By default map QUuid to Oracle RAW(16) and use NULL to represent null -// UUIDs. If NULL is disabled (e.g., at the member level), then we store -// the null UUID (i.e., all bytes are zero). -// -#pragma db value(QUuid) type("RAW(16)") null - -#endif // ODB_QT_BASIC_ORACLE_DEFAULT_MAPPING_HXX diff --git a/odb/qt/basic/oracle/qbyte-array-traits.hxx b/odb/qt/basic/oracle/qbyte-array-traits.hxx deleted file mode 100644 index 6979cc9..0000000 --- a/odb/qt/basic/oracle/qbyte-array-traits.hxx +++ /dev/null @@ -1,167 +0,0 @@ -// file : odb/qt/basic/oracle/qbyte-array-traits.hxx -// license : GNU GPL v2; see accompanying LICENSE file - -#ifndef ODB_QT_BASIC_ORACLE_QBYTE_ARRAY_TRAITS_HXX -#define ODB_QT_BASIC_ORACLE_QBYTE_ARRAY_TRAITS_HXX - -#include - -#include // std::memcpy -#include // std::size_t - -#include - -#include - -namespace odb -{ - namespace oracle - { - template <> - struct default_value_traits - { - typedef QByteArray value_type; - typedef QByteArray query_type; - typedef char* image_type; - - static void - set_value (QByteArray& v, - const char* b, - std::size_t n, - bool is_null) - { - if (is_null) - v = QByteArray (); - else - { - // Note that we cannot use replace() here since a suitable - // overload was only added in Qt 4.7. - // - v.resize (static_cast (n)); - std::memcpy (v.data (), b, n); - } - } - - static void - set_image (char* b, - std::size_t c, - std::size_t& n, - bool& is_null, - const QByteArray& v) - { - if (v.isNull ()) - is_null = true; - else - { - is_null = false; - - n = static_cast (v.size ()); - - if (n > c) - n = c; - - std::memcpy (b, v.constData (), n); - } - } - }; - - template <> - struct default_value_traits - { - typedef QByteArray value_type; - typedef QByteArray query_type; - typedef lob_callback image_type; - - static void - set_value (QByteArray& v, - result_callback_type& cb, - void*& context, - bool is_null) - { - if (is_null) - v = QByteArray (); - else - { - cb = &result_callback; - context = &v; - } - } - - static void - set_image (param_callback_type& cb, - const void*& context, - bool& is_null, - const QByteArray& v) - { - if (v.isNull ()) - is_null = true; - else - { - is_null = false; - cb = ¶m_callback; - context = &v; - } - } - - static bool - result_callback (void* context, - ub4*, - void* b, - ub4 s, - chunk_position p) - { - QByteArray& v (*static_cast (context)); - - switch (p) - { - case chunk_one: - case chunk_first: - { - v.clear (); - - // Falling through. - } - case chunk_next: - case chunk_last: - { - v.append (static_cast (b), static_cast (s)); - break; - } - } - - return true; - } - - static bool - param_callback (const void* context, - ub4*, - const void** b, - ub4* s, - chunk_position* p, - void*, - ub4) - { - const QByteArray& v (*static_cast (context)); - - *p = chunk_one; - *s = static_cast (v.size ()); - *b = v.constData (); - - return true; - } - }; - - template <> - struct default_type_traits - { - // Allow use of QByteArray in query expressions by default by specifying - // the default type id as RAW. - // - static const database_type_id db_type_id = id_raw; - }; - } -} - -#include - -#endif // ODB_QT_BASIC_ORACLE_QBYTE_ARRAY_TRAITS_HXX diff --git a/odb/qt/basic/oracle/qstring-traits.hxx b/odb/qt/basic/oracle/qstring-traits.hxx deleted file mode 100644 index 418d30e..0000000 --- a/odb/qt/basic/oracle/qstring-traits.hxx +++ /dev/null @@ -1,206 +0,0 @@ -// file : odb/qt/basic/oracle/qstring-traits.hxx -// license : GNU GPL v2; see accompanying LICENSE file - -#ifndef ODB_QT_BASIC_ORACLE_QSTRING_TRAITS_HXX -#define ODB_QT_BASIC_ORACLE_QSTRING_TRAITS_HXX - -#include - -#include // std::memcpy -#include // std::size_t - -#include - -#include - -namespace odb -{ - namespace oracle - { - struct qstring_value_traits - { - public: - typedef QString value_type; - typedef QString query_type; - typedef char* image_type; - - static void - set_value (QString& v, - const char* b, - std::size_t n, - bool is_null) - { - if (is_null) - v = QString (); - else - v = QString::fromUtf8 (b, static_cast (n)); - } - - static void - set_image (char* b, - std::size_t c, - std::size_t& n, - bool& is_null, - const QString& v) - { - if (v.isNull ()) - is_null = true; - else - { - is_null = false; - - const QByteArray& a (v.toUtf8 ()); - - n = static_cast (a.size ()); - - if (n > c) - n = c; - - std::memcpy (b, a.constData (), n); - } - } - }; - - template <> - struct default_value_traits : qstring_value_traits - { - }; - - template <> - struct default_value_traits : qstring_value_traits - { - }; - - class qstring_lob_value_traits - { - public: - typedef QString value_type; - typedef QString query_type; - typedef lob_callback image_type; - - static void - set_value (QString& v, - result_callback_type& cb, - void*& context, - bool is_null) - { - if (is_null) - v = QString (); - else - { - cb = &result_callback; - context = &v; - } - } - - static void - set_image (param_callback_type& cb, - const void*& context, - bool& is_null, - const QString& v) - { - if (v.isNull ()) - is_null = true; - else - { - is_null = false; - cb = ¶m_callback; - context = &v; - } - } - - static bool - result_callback (void* context, - ub4*, - void* b, - ub4 s, - chunk_position p) - { - QString& v (*static_cast (context)); - - switch (p) - { - case chunk_one: - case chunk_first: - { - v.clear (); - - // Falling through. - } - case chunk_next: - case chunk_last: - { - v += QString::fromUtf8(static_cast (b), - static_cast (s)); - break; - } - } - - return true; - } - - static bool - param_callback (const void* context, - ub4* position_context, - const void** b, - ub4* s, - chunk_position* p, - void* temp_buffer, - ub4 capacity) - { - const QByteArray& v (static_cast (context)->toUtf8 ()); - - *s = static_cast (v.size ()); - - if (*position_context == 0) - { - if (*s <= capacity) - *p = chunk_one; - else - { - *s = capacity; - *p = chunk_first; - } - } - else - { - *s -= *position_context; - - if (*s <= capacity) - *p = chunk_last; - else - { - *s = capacity; - *p = chunk_next; - } - } - - std::memcpy (temp_buffer, v.constData () + *position_context, *s); - *b = temp_buffer; - *position_context += *s; - - return true; - } - }; - - template <> - struct default_value_traits: qstring_lob_value_traits - { - }; - - template <> - struct default_value_traits: qstring_lob_value_traits - { - }; - - template <> - struct default_type_traits - { - static const database_type_id db_type_id = id_string; - }; - } -} - -#include - -#endif // ODB_QT_BASIC_ORACLE_QSTRING_TRAITS_HXX diff --git a/odb/qt/basic/oracle/quuid-traits.hxx b/odb/qt/basic/oracle/quuid-traits.hxx deleted file mode 100644 index 5f8041e..0000000 --- a/odb/qt/basic/oracle/quuid-traits.hxx +++ /dev/null @@ -1,70 +0,0 @@ -// file : odb/qt/basic/oracle/uuid-traits.hxx -// license : GNU GPL v2; see accompanying LICENSE file - -#ifndef ODB_QT_BASIC_ORACLE_UUID_TRAITS_HXX -#define ODB_QT_BASIC_ORACLE_UUID_TRAITS_HXX - -#include - -#include // std::memcpy -#include - -#include - -#include - -namespace odb -{ - namespace oracle - { - template <> - struct default_value_traits - { - public: - typedef QUuid value_type; - typedef value_type query_type; - typedef char* image_type; - - static void - set_value (value_type& v, const char* b, std::size_t n, bool is_null) - { - if (!is_null) - { - assert (n == 16); - std::memcpy (&v.data1, b, 16); - } - else - v = QUuid (); - } - - static void - set_image (char* b, - std::size_t c, - std::size_t& n, - bool& is_null, - const value_type& v) - { - // If we can, store nil as NULL. Otherwise, store it as a value. - // - is_null = is_null && v.isNull (); - - if (!is_null) - { - n = 16; - assert (c >= n); - std::memcpy (b, &v.data1, n); - } - } - }; - - template <> - struct default_type_traits - { - static const database_type_id db_type_id = id_raw; - }; - } -} - -#include - -#endif // ODB_QT_BASIC_ORACLE_UUID_TRAITS_HXX diff --git a/odb/qt/basic/pgsql/default-mapping.hxx b/odb/qt/basic/pgsql/default-mapping.hxx deleted file mode 100644 index 13dbeb8..0000000 --- a/odb/qt/basic/pgsql/default-mapping.hxx +++ /dev/null @@ -1,27 +0,0 @@ -// file : odb/qt/basic/pgsql/default-mapping.hxx -// license : GNU GPL v2; see accompanying LICENSE file - -#ifndef ODB_QT_BASIC_PGSQL_DEFAULT_MAPPING_HXX -#define ODB_QT_BASIC_PGSQL_DEFAULT_MAPPING_HXX - -#include -#include -#include - -// Map QString to PostgreSQL TEXT by default. Allow NULL values by default as -// QString provides a null representation. -// -#pragma db value(QString) type("TEXT") null - -// Map QByteArray to PostgreSQL BYTEA by default. Allow NULL values by default -// as QByteArray provides a null representation. -// -#pragma db value(QByteArray) type("BYTEA") null - -// By default map QUuid to PostgreSQL UUID and use NULL to represent null -// UUIDs. If NULL is disabled (e.g., at the member level), then we store -// the null UUID (i.e., all bytes are zero). -// -#pragma db value(QUuid) type("UUID") null - -#endif // ODB_QT_BASIC_PGSQL_DEFAULT_MAPPING_HXX diff --git a/odb/qt/basic/pgsql/qbyte-array-traits.hxx b/odb/qt/basic/pgsql/qbyte-array-traits.hxx deleted file mode 100644 index 3c3c496..0000000 --- a/odb/qt/basic/pgsql/qbyte-array-traits.hxx +++ /dev/null @@ -1,77 +0,0 @@ -// file : odb/qt/basic/pgsql/qbyte-array-traits.hxx -// license : GNU GPL v2; see accompanying LICENSE file - -#ifndef ODB_QT_BASIC_PGSQL_QBYTE_ARRAY_TRAITS_HXX -#define ODB_QT_BASIC_PGSQL_QBYTE_ARRAY_TRAITS_HXX - -#include - -#include // std::memcpy -#include // std::size_t - -#include - -#include -#include - -namespace odb -{ - namespace pgsql - { - template <> - struct default_value_traits - { - typedef QByteArray value_type; - typedef QByteArray query_type; - typedef details::buffer image_type; - - static void - set_value (QByteArray& v, - const details::buffer& b, - std::size_t n, - bool is_null) - { - if (is_null) - v = QByteArray (); - else - { - // Note that we cannot use replace() here since a suitable - // overload was only added in Qt 4.7. - // - v.resize (static_cast (n)); - std::memcpy (v.data (), b.data (), n); - } - } - - static void - set_image (details::buffer& b, - std::size_t& n, - bool& is_null, - const QByteArray& v) - { - if (v.isNull ()) - is_null = true; - else - { - is_null = false; - - n = static_cast (v.size ()); - if (n > b.capacity ()) - b.capacity (n); - - std::memcpy (b.data (), v.data (), n); - } - } - }; - - template <> - struct default_type_traits - { - static const database_type_id db_type_id = id_bytea; - }; - } -} - -#include - -#endif // ODB_QT_BASIC_PGSQL_QBYTE_ARRAY_TRAITS_HXX diff --git a/odb/qt/basic/pgsql/qstring-traits.hxx b/odb/qt/basic/pgsql/qstring-traits.hxx deleted file mode 100644 index f1ab53c..0000000 --- a/odb/qt/basic/pgsql/qstring-traits.hxx +++ /dev/null @@ -1,74 +0,0 @@ -// file : odb/qt/basic/pgsql/qstring-traits.hxx -// license : GNU GPL v2; see accompanying LICENSE file - -#ifndef ODB_QT_BASIC_PGSQL_QSTRING_TRAITS_HXX -#define ODB_QT_BASIC_PGSQL_QSTRING_TRAITS_HXX - -#include - -#include // std::memcpy -#include // std::size_t - -#include - -#include -#include - -namespace odb -{ - namespace pgsql - { - template <> - struct default_value_traits - { - public: - typedef QString value_type; - typedef QString query_type; - typedef details::buffer image_type; - - static void - set_value (QString& v, - const details::buffer& b, - std::size_t n, - bool is_null) - { - if (is_null) - v = QString (); - else - v = QString::fromUtf8 (b.data (), static_cast (n)); - } - - static void - set_image (details::buffer& b, - std::size_t& n, - bool& is_null, - const QString& v) - { - if (v.isNull ()) - is_null = true; - else - { - is_null = false; - - const QByteArray& a (v.toUtf8 ()); - n = static_cast (a.size ()); - - if (n > b.capacity ()) - b.capacity (n); - - std::memcpy (b.data (), a.data (), n); - } - } - }; - - template <> - struct default_type_traits - { - static const database_type_id db_type_id = id_string; - }; - } -} - -#include - -#endif // ODB_QT_BASIC_PGSQL_QSTRING_TRAITS_HXX diff --git a/odb/qt/basic/pgsql/quuid-traits.hxx b/odb/qt/basic/pgsql/quuid-traits.hxx deleted file mode 100644 index 5999b7e..0000000 --- a/odb/qt/basic/pgsql/quuid-traits.hxx +++ /dev/null @@ -1,65 +0,0 @@ -// file : odb/qt/basic/pgsql/uuid-traits.hxx -// license : GNU GPL v2; see accompanying LICENSE file - -#ifndef ODB_QT_BASIC_PGSQL_UUID_TRAITS_HXX -#define ODB_QT_BASIC_PGSQL_UUID_TRAITS_HXX - -#include - -#include // std::memcpy - -#include - -#include - -namespace odb -{ - namespace pgsql - { - template <> - class default_value_traits - { - public: - typedef QUuid value_type; - typedef value_type query_type; - typedef unsigned char* image_type; - - // PostgreSQL binary UUID representation is big-endian in the RFC 4122, - // section 4.1.2 order. While Qt provides (since 4.8) to/fromRfc4122(), - // they both incur a memory allocation (by QByteArray) which we could - // avoid, if we did it ourselves. - // - - static void - set_value (value_type& v, const unsigned char* i, bool is_null) - { - if (!is_null) - v = QUuid::fromRfc4122 ( - QByteArray (reinterpret_cast (i), 16)); - else - v = QUuid (); - } - - static void - set_image (unsigned char* i, bool& is_null, const value_type& v) - { - // If we can, store nil as NULL. Otherwise, store it as a value. - // - is_null = is_null && v.isNull (); - - if (!is_null) - std::memcpy (i, v.toRfc4122 ().constData (), 16); - } - }; - - template <> - struct default_type_traits - { - static const database_type_id db_type_id = id_uuid; - }; - } -} - -#include - -#endif // ODB_QT_BASIC_PGSQL_UUID_TRAITS_HXX diff --git a/odb/qt/basic/sqlite/default-mapping.hxx b/odb/qt/basic/sqlite/default-mapping.hxx deleted file mode 100644 index 7d14a6c..0000000 --- a/odb/qt/basic/sqlite/default-mapping.hxx +++ /dev/null @@ -1,27 +0,0 @@ -// file : odb/qt/basic/sqlite/default-mapping.hxx -// license : GNU GPL v2; see accompanying LICENSE file - -#ifndef ODB_QT_BASIC_SQLITE_DEFAULT_MAPPING_HXX -#define ODB_QT_BASIC_SQLITE_DEFAULT_MAPPING_HXX - -#include -#include -#include - -// Map QString to SQLite TEXT by default. Allow NULL values by default as -// QString provides a null representation. -// -#pragma db value(QString) type("TEXT") null - -// Map QByteArray to SQLite BLOB by default. Allow NULL values by default as -// QByteArray provides a null representation. -// -#pragma db value(QByteArray) type("BLOB") null - -// By default map QUuid to SQLite BLOB and use NULL to represent null UUIDs. -// If NULL is disabled (e.g., at the member level), then we store the null -// UUID (i.e., all bytes are zero). -// -#pragma db value(QUuid) type("BLOB") null - -#endif // ODB_QT_BASIC_SQLITE_DEFAULT_MAPPING_HXX diff --git a/odb/qt/basic/sqlite/qbyte-array-traits.hxx b/odb/qt/basic/sqlite/qbyte-array-traits.hxx deleted file mode 100644 index 8a26bb1..0000000 --- a/odb/qt/basic/sqlite/qbyte-array-traits.hxx +++ /dev/null @@ -1,77 +0,0 @@ -// file : odb/qt/basic/sqlite/qbyte-array-traits.hxx -// license : GNU GPL v2; see accompanying LICENSE file - -#ifndef ODB_QT_BASIC_SQLITE_QBYTE_ARRAY_TRAITS_HXX -#define ODB_QT_BASIC_SQLITE_QBYTE_ARRAY_TRAITS_HXX - -#include - -#include // std::memcpy -#include // std::size_t - -#include - -#include -#include - -namespace odb -{ - namespace sqlite - { - template <> - struct default_value_traits - { - typedef QByteArray value_type; - typedef QByteArray query_type; - typedef details::buffer image_type; - - static void - set_value (QByteArray& v, - const details::buffer& b, - std::size_t n, - bool is_null) - { - if (is_null) - v = QByteArray (); - else - { - // Note that we cannot use replace() here since a suitable - // overload was only added in Qt 4.7. - // - v.resize (static_cast (n)); - std::memcpy (v.data (), b.data (), n); - } - } - - static void - set_image (details::buffer& b, - std::size_t& n, - bool& is_null, - const QByteArray& v) - { - if (v.isNull ()) - is_null = true; - else - { - is_null = false; - - n = static_cast (v.size ()); - if (n > b.capacity ()) - b.capacity (n); - - std::memcpy (b.data (), v.data (), n); - } - } - }; - - template <> - struct default_type_traits - { - static const database_type_id db_type_id = id_blob; - }; - } -} - -#include - -#endif // ODB_QT_BASIC_SQLITE_QBYTE_ARRAY_TRAITS_HXX diff --git a/odb/qt/basic/sqlite/qstring-traits.hxx b/odb/qt/basic/sqlite/qstring-traits.hxx deleted file mode 100644 index 30a2136..0000000 --- a/odb/qt/basic/sqlite/qstring-traits.hxx +++ /dev/null @@ -1,83 +0,0 @@ -// file : odb/qt/basic/sqlite/qstring-traits.hxx -// license : GNU GPL v2; see accompanying LICENSE file - -#ifndef ODB_QT_BASIC_SQLITE_QSTRING_TRAITS_HXX -#define ODB_QT_BASIC_SQLITE_QSTRING_TRAITS_HXX - -#include - -#include // std::memcpy -#include // std::size_t - -#include - -#include -#include - -namespace odb -{ - namespace sqlite - { - template <> - struct image_traits - { - typedef details::buffer image_type; - - // Use UTF-16 binding for QString. - // - static const bind::buffer_type bind_value = bind::text16; - }; - - template <> - struct default_value_traits - { - public: - typedef QString value_type; - typedef QString query_type; - typedef details::buffer image_type; - - static void - set_value (QString& v, - const details::buffer& b, - std::size_t n, - bool is_null) - { - if (is_null) - v = QString (); - else - v.setUtf16 (reinterpret_cast (b.data ()), - static_cast (n / 2)); // In characters. - } - - static void - set_image (details::buffer& b, - std::size_t& n, - bool& is_null, - const QString& v) - { - if (v.isNull ()) - is_null = true; - else - { - is_null = false; - n = static_cast (v.size ()) * 2; // In bytes. - - if (n > b.capacity ()) - b.capacity (n); - - std::memcpy (b.data (), v.utf16 (), n); - } - } - }; - - template <> - struct default_type_traits - { - static const database_type_id db_type_id = id_text; - }; - } -} - -#include - -#endif // ODB_QT_BASIC_SQLITE_QSTRING_TRAITS_HXX diff --git a/odb/qt/basic/sqlite/quuid-traits.hxx b/odb/qt/basic/sqlite/quuid-traits.hxx deleted file mode 100644 index 20d4a94..0000000 --- a/odb/qt/basic/sqlite/quuid-traits.hxx +++ /dev/null @@ -1,74 +0,0 @@ -// file : odb/qt/basic/sqlite/uuid-traits.hxx -// license : GNU GPL v2; see accompanying LICENSE file - -#ifndef ODB_QT_BASIC_SQLITE_UUID_TRAITS_HXX -#define ODB_QT_BASIC_SQLITE_UUID_TRAITS_HXX - -#include - -#include // std::memcpy -#include - -#include - -#include - -namespace odb -{ - namespace sqlite - { - template <> - struct default_value_traits - { - typedef QUuid value_type; - typedef value_type query_type; - typedef details::buffer image_type; - - static void - set_value (value_type& v, - const details::buffer& b, - std::size_t n, - bool is_null) - { - if (!is_null) - { - assert (n == 16); - std::memcpy (&v.data1, b.data (), 16); - } - else - v = QUuid (); - } - - static void - set_image (details::buffer& b, - std::size_t& n, - bool& is_null, - const value_type& v) - { - // If we can, store nil as NULL. Otherwise, store it as a value. - // - is_null = is_null && v.isNull (); - - if (!is_null) - { - n = 16; - - if (n > b.capacity ()) - b.capacity (n); - - std::memcpy (b.data (), &v.data1, n); - } - } - }; - - template <> - struct default_type_traits - { - static const database_type_id db_type_id = id_blob; - }; - } -} - -#include - -#endif // ODB_QT_BASIC_SQLITE_UUID_TRAITS_HXX diff --git a/odb/qt/buildfile b/odb/qt/buildfile deleted file mode 100644 index 63e6c95..0000000 --- a/odb/qt/buildfile +++ /dev/null @@ -1,93 +0,0 @@ -# file : odb/qt/buildfile -# license : GNU GPL v2; see accompanying LICENSE file - -../ -{ - define options: file - options{*}: extension = options - - # Install into the odb/qt/ subdirectory of, say, /usr/include/ - # recreating subdirectories. - # - {hxx ixx txx options}{*}: - { - install = include/odb/ - install.subdirs = true - } - - qt/ - { - import int_libs = libodb%lib{odb} - imp_libs = - - lib{odb-qt}: {hxx ixx txx cxx}{** -version-build2} {hxx}{version-build2} \ - details/build2/{h}{*} \ - options{**} ../options{qt} \ - $imp_libs $int_libs - - # Include the generated version header into the distribution (so that we - # don't pick up an installed one) and don't remove it when cleaning in src - # (so that clean results in a state identical to distributed). - # - hxx{version-build2}: in{version-build2} $src_root/manifest - hxx{version-build2}: - { - dist = true - clean = ($src_root != $out_root) - } - - # Build options. - # - cxx.poptions =+ "-I$out_root" "-I$src_root" -DLIBODB_QT_BUILD2 - - obja{*}: cxx.poptions += -DLIBODB_QT_STATIC_BUILD - objs{*}: cxx.poptions += -DLIBODB_QT_SHARED_BUILD - - # Export options. - # - lib{odb-qt}: - { - cxx.export.poptions = "-I$out_root" "-I$src_root" -DLIBODB_QT_BUILD2 - cxx.export.libs = $int_libs - } - - liba{odb-qt}: cxx.export.poptions += -DLIBODB_QT_STATIC - libs{odb-qt}: cxx.export.poptions += -DLIBODB_QT_SHARED - - # For pre-releases use the complete version to make sure they cannot be - # used in place of another pre-release or the final version. See the - # version module for details on the version.* variable values. - # - if $version.pre_release - lib{odb-qt}: bin.lib.version = @"-$version.project_id" - else - lib{odb-qt}: bin.lib.version = @"-$version.major.$version.minor" - - # Installation tweaks. - # - install_include = [dir_path] include/odb/qt/ - - # We want these to be picked up whether LIBODB_QT_BUILD2 is defined or - # not. - # - hxx{version}@./: install = false - hxx{version-build2}: install = $install_include/version.hxx - hxx{version-build2-stub}@./: install = $install_include/version-build2.hxx - - details/build2/ - { - h{*}: install = false - - if ($cxx.target.system == 'win32-msvc') - { - h{config-vc}@./: install = $install_include/details/ - h{config-vc-stub}@./: install = $install_include/details/build2/config-vc.h - } - else - { - h{config}@./: install = $install_include/details/ - h{config-stub}@./: install = $install_include/details/build2/config.h - } - } - } -} diff --git a/odb/qt/containers.options b/odb/qt/containers.options deleted file mode 100644 index 337b064..0000000 --- a/odb/qt/containers.options +++ /dev/null @@ -1,18 +0,0 @@ -# file : odb/qt/containers.options -# licences : GNU GPL v2; see accompanying LICENSE file - ---profile qt/version - ---odb-epilogue '#include ' ---odb-epilogue '#include ' ---odb-epilogue '#include ' ---odb-epilogue '#include ' ---odb-epilogue '#include ' ---odb-epilogue '#include ' - ---hxx-prologue '#include ' ---hxx-prologue '#include ' ---hxx-prologue '#include ' ---hxx-prologue '#include ' ---hxx-prologue '#include ' ---hxx-prologue '#include ' diff --git a/odb/qt/containers/list-iterator.hxx b/odb/qt/containers/list-iterator.hxx deleted file mode 100644 index 67f56fd..0000000 --- a/odb/qt/containers/list-iterator.hxx +++ /dev/null @@ -1,30 +0,0 @@ -// file : odb/qt/containers/list-iterator.hxx -// license : GNU GPL v2; see accompanying LICENSE file - -#ifndef ODB_QT_CONTAINERS_LIST_ITERATOR_HXX -#define ODB_QT_CONTAINERS_LIST_ITERATOR_HXX - -#include - -#include - -#include - -// Java-style QListIterator-like iterator. You can also use the -// QListIterator directly (but not QMutableListIterator). -// -template -class QOdbListIterator: public QListIterator -{ -public: - QOdbListIterator (const QOdbList& c): QListIterator (c) {} - QOdbListIterator& operator=(const QOdbList& c) - { - static_cast&> (*this) = c; - return *this; - } -}; - -#include - -#endif // ODB_QT_CONTAINERS_LIST_ITERATOR_HXX diff --git a/odb/qt/containers/list-traits.hxx b/odb/qt/containers/list-traits.hxx deleted file mode 100644 index 5a3ee38..0000000 --- a/odb/qt/containers/list-traits.hxx +++ /dev/null @@ -1,107 +0,0 @@ -// file : odb/qt/containers/list-traits.hxx -// license : GNU GPL v2; see accompanying LICENSE file - -#ifndef ODB_QT_CONTAINERS_LIST_TRAITS_HXX -#define ODB_QT_CONTAINERS_LIST_TRAITS_HXX - -#include - -#include -#include -#include - -#include - -namespace odb -{ - template - class access::container_traits > - { - public: - static const container_kind kind = ck_ordered; - static const bool smart = true; - - typedef QOdbList container_type; - - typedef V value_type; - typedef typename container_type::size_type index_type; - - typedef smart_ordered_functions functions; - typedef ordered_functions dumb_functions; - - public: - static void - persist (const container_type& c, const functions& f) - { - for (index_type i (0), n (c.size ()); i < n; ++i) - f.insert (i, c[i]); - - // Now that this container is persistent, start tracking changes. - // - c._start (); - } - - static void - load (container_type& c, bool more, const functions& f) - { - // Stop tracking changes. - // - c._stop (); - - // Load. - // - c.clear (); - while (more) - { - index_type dummy; - c.append (value_type ()); - more = f.select (dummy, c.modify_back ()); - } - - // Start tracking changes. - // - c._start (); - } - - static bool - changed (const container_type&); - - static void - update (const container_type&, const functions&); - - static void - erase (const container_type* c, const functions& f) - { - f.delete_ (0); - - // Stop tracking changes. - // - if (c != 0) - c->_stop (); - } - - // Version of load() for dumb functions. Used to support - // inverse members of the container type. The implementation - // is identical to the smart one except we don't turn off/on - // change tracking. - // - static void - load (container_type& c, bool more, const dumb_functions& f) - { - c.clear (); - - while (more) - { - index_type dummy; - c.append (value_type ()); - more = f.select (dummy, c.modify_back ()); - } - } - }; -} - -#include - -#include - -#endif // ODB_QT_CONTAINERS_LIST_TRAITS_HXX diff --git a/odb/qt/containers/list-traits.txx b/odb/qt/containers/list-traits.txx deleted file mode 100644 index 105fc2a..0000000 --- a/odb/qt/containers/list-traits.txx +++ /dev/null @@ -1,101 +0,0 @@ -// file : odb/qt/containers/list-traits.txx -// license : GNU GPL v2; see accompanying LICENSE file - -namespace odb -{ - template - bool access::container_traits >:: - changed (const container_type& c) - { - // Because modifications can cancel each other (e.g., push and pop), - // it is tricky to keep track of whether there are any changes in - // the container. Instead, we are just going to examine each element - // just like update(). - // - - // We should either be tracking or summarily changed. - // - if (c._tracking ()) - { - const vector_impl& impl (c._impl ()); - - for (std::size_t i (0), n (impl.size ()); i < n; ++i) - { - if (impl.state (i) != vector_impl::state_unchanged) - return true; - } - } - else - return true; - - return false; - } - - template - void access::container_traits >:: - update (const container_type& c, const functions& f) - { - bool u (false); // Updated flag. - - if (c._tracking ()) - { - const vector_impl& impl (c._impl ()); - - for (std::size_t i (0), n (impl.size ()); i < n; ++i) - { - vector_impl::element_state_type s (impl.state (i)); - index_type ii (static_cast (i)); - - switch (s) - { - case vector_impl::state_unchanged: - { - break; - } - case vector_impl::state_inserted: - { - f.insert (ii, c[ii]); - u = u || true; - break; - } - case vector_impl::state_updated: - { - f.update (ii, c[ii]); - u = u || true; - break; - } - case vector_impl::state_erased: - { - f.delete_ (ii); // Delete from i onwards. - u = u || true; - break; - } - } - - // We delete all trailing elements in one go. - // - if (s == vector_impl::state_erased) - break; - } - } - else - { - // Fall back to delete all/insert all. - // - f.delete_ (0); - - for (index_type i (0), n (c.size ()); i < n; ++i) - f.insert (i, c[i]); - - u = true; - } - - // Arm the rollback callback and (re)start change tracking. - // - if (u) - { - c._arm (transaction::current ()); - c._start (); - } - } -} diff --git a/odb/qt/containers/list.hxx b/odb/qt/containers/list.hxx deleted file mode 100644 index 143deed..0000000 --- a/odb/qt/containers/list.hxx +++ /dev/null @@ -1,433 +0,0 @@ -// file : odb/qt/containers/list.hxx -// license : GNU GPL v2; see accompanying LICENSE file - -#ifndef ODB_QT_CONTAINERS_LIST_HXX -#define ODB_QT_CONTAINERS_LIST_HXX - -#include -#include // ODB_CXX11 - -#include // QT_VERSION -#include - -#ifdef ODB_CXX11 -# include // std::move -# if defined(ODB_CXX11_INITIALIZER_LIST) && \ - defined(Q_COMPILER_INITIALIZER_LISTS) -# include -# endif -#endif - -#include - -// A QList-like container that keeps track of changes. -// -// Note that the style and order of definitions is (mostly) as -// appears in the qlist.h Qt header (except for some cleanups, -// such as superfluous inline use). -// -template -class QOdbListIteratorImpl; - -template -class QOdbList: public odb::vector_base -{ -public: - typedef QList base_list_type; - typedef typename base_list_type::iterator base_iterator_type; - - QOdbList() {} - QOdbList(const QOdbList &x): vector_base (x), l_ (x.l_) {} - // ~QOdbList(); - QOdbList &operator=(const QOdbList &l); - -#if QT_VERSION >= 0x040800 - void swap(QOdbList &other); -#endif - -#ifdef ODB_CXX11 - QOdbList(QOdbList &&x) noexcept - : vector_base (std::move (x)), l_ (std::move (x.l_)) {} - - // Note: noexcept is not specified since it can throw while reallocating - // impl_. - // - QOdbList &operator=(QOdbList &&other); - -#if defined(ODB_CXX11_INITIALIZER_LIST) && \ - defined(Q_COMPILER_INITIALIZER_LISTS) - QOdbList(std::initializer_list il): l_ (il) {} -#endif -#endif - - // Implicit conversion. - // - bool operator==(const QList &x) const {return l_ == x;} - bool operator!=(const QList &x) const {return l_ != x;} - - int size() const {return l_.size ();} - void detach() {l_.detach ();} - void detachShared() {l_.detachShared ();} - bool isDetached() const {return l_.isDetached ();} - void setSharable(bool sharable) {l_.setSharable (sharable);} - // Implicit conversion. - bool isSharedWith(const QList &x) const {return l_.isSharedWith (x);} - bool isEmpty() const {return l_.isEmpty ();} - void clear(); - - const T &at(int i) const {return l_.at (i);} - const T &operator[](int i) const {return l_[i];} - //T &operator[](int i); - T &modify (int i); - - void reserve(int size); - void append(const T &t); - void append(const QList &t); // Implicit conversion. - void prepend(const T &t); - void insert(int i, const T &t); - void replace(int i, const T &t); - void removeAt(int i); - int removeAll(const T &t); - bool removeOne(const T &t); - T takeAt(int i); - T takeFirst(); - T takeLast(); - void move(int from, int to); - void swap(int i, int j); - - int indexOf(const T &t, int from = 0) const {return l_.indexOf (t, from);} - int lastIndexOf(const T &t, int from = -1) const - {return l_.lastIndexOf (t, from);} - bool contains(const T &t) const {return l_.contains (t);} - int count(const T &t) const {return l_.count (t);} - - typedef QOdbListIteratorImpl iterator; - typedef typename base_list_type::const_iterator const_iterator; - - // stl style - iterator begin() {return iterator (this, l_.begin ());} - const_iterator begin() const {return l_.begin ();} - const_iterator cbegin() const {return l_.cbegin ();} - const_iterator constBegin() const {return l_.constBegin ();} - iterator end() {return iterator (this, l_.end ());} - const_iterator end() const {return l_.end ();} - const_iterator cend() const {return l_.cend ();} - const_iterator constEnd() const {return l_.constEnd ();} - - // Return QList iterators. The begin() functions mark all - // the elements as modified. - // - base_iterator_type mbegin (); - base_iterator_type modifyBegin () {return mbegin ();} - base_iterator_type mend () {return l_.end ();} - base_iterator_type modifyEnd () {return mend ();} - - iterator insert(iterator before, const T &t); - iterator erase(iterator pos); - iterator erase(iterator first, iterator last); - - // more Qt - typedef iterator Iterator; - typedef const_iterator ConstIterator; - - int count() const {return l_.count ();} - int length() const {return l_.length ();} - //T& first(); - T& modifyFirst(); - const T& first() const {return l_.first ();} - //T& last(); - T& modifyLast(); - const T& last() const {return l_.last ();} - void removeFirst(); - void removeLast(); - bool startsWith(const T &t) const {return l_.startsWith (t);} - bool endsWith(const T &t) const {return l_.endsWith (t);} - QList mid(int pos, int length = -1) const {return l_.mid (pos, length);} - - T value(int i) const {return l_.value (i);} - T value(int i, const T &defValue) const {return l_.value (i, defValue);} - - // stl compatibility - void push_back(const T &t) {append(t);} - void push_front(const T &t) {prepend(t);} - //T& front(); - T& modify_front() {return modifyFirst ();} - const T& front() const {return l_.front ();} - //T& back(); - T& modify_back() {return modifyLast ();} - const T& back() const {return l_.back ();} - void pop_front() {removeFirst();} - void pop_back() {removeLast();} - bool empty() const {return l_.empty ();} - - typedef int size_type; - typedef T value_type; - typedef value_type *pointer; - typedef const value_type *const_pointer; - typedef value_type &reference; - typedef const value_type &const_reference; - typedef typename base_list_type::difference_type difference_type; - - // comfort - // Implicit conversion. - QOdbList &operator+=(const QList &l) {append (l); return *this;} - QOdbList operator+(const QList &l) const - {QOdbList r (*this); r.append (l); return r;} - QOdbList &operator+=(const T &t) {append (t); return *this;} - QOdbList &operator<< (const T &t) {append (t); return *this;} - QOdbList &operator<<(const QList &l) {append (l); return *this;} - - QVector toVector() const {return l_.toVector ();} - QSet toSet() const {return l_.toSet ();} - - static QOdbList fromVector(const QVector &v) - {return base_list_type::fromVector (v);} - static QOdbList fromSet(const QSet &s) - {return base_list_type::fromSet (s);} - - static QOdbList fromStdList(const std::list &l) - {return base_list_type::fromStdList (l);} - std::list toStdList() const {return l_.toStdList ();} - - // Interfacing with the base list. - // - QOdbList (const base_list_type& x): l_ (x) {} - QOdbList& operator= (const base_list_type&); - operator const base_list_type& () const {return l_;} - base_list_type& base () {return l_;} - const base_list_type& base () const {return l_;} - -#ifdef ODB_CXX11 - QOdbList (base_list_type&& x): l_ (std::move (x)) {} - QOdbList& operator= (base_list_type&&); -#endif - - // Change tracking (the rest comes from vector_base). - // -public: - void _start () const {impl_.start (l_.size ());} - -private: - base_list_type l_; -}; - -template -class QOdbListIteratorImpl -{ -public: - typedef L list_type; - typedef typename list_type::base_iterator_type base_iterator_type; - typedef typename list_type::const_iterator const_iterator_type; - - typedef typename base_iterator_type::iterator_category iterator_category; - typedef typename base_iterator_type::difference_type difference_type; - typedef typename base_iterator_type::value_type value_type; - typedef typename base_iterator_type::pointer pointer; - typedef typename base_iterator_type::reference reference; - - typedef typename list_type::size_type size_type; - typedef typename list_type::const_reference const_reference; - typedef typename list_type::const_pointer const_pointer; - - QOdbListIteratorImpl (): l_ (0), i_ () {} - QOdbListIteratorImpl (list_type* l, const base_iterator_type& i) - : l_ (l), i_ (i) {} - -#ifndef QT_STRICT_ITERATORS - operator const_iterator_type () const {return i_;} -#endif - base_iterator_type base () const {return i_;} - list_type* list () const {return l_;} - - // Note: const_{reference,pointer}. - // - const_reference operator* () const {return *i_;} - const_pointer operator-> () const {return i_.operator -> ();} - const_reference operator[] (difference_type n) const {return i_[n];} - - // Modifiers. - // - reference modify () const; - reference modify (difference_type n) const; - - QOdbListIteratorImpl& operator++ () {++i_; return *this;} - QOdbListIteratorImpl operator++ (int) - {return QOdbListIteratorImpl (l_, i_++);} - QOdbListIteratorImpl& operator-- () {--i_; return *this;} - QOdbListIteratorImpl operator-- (int) - {return QOdbListIteratorImpl (l_, i_--);} - - QOdbListIteratorImpl operator+ (int n) const - {return QOdbListIteratorImpl (l_, i_ + n);} - QOdbListIteratorImpl& operator+= (int n) {i_ += n; return *this;} - QOdbListIteratorImpl operator- (int n) const - {return QOdbListIteratorImpl (l_, i_ - n);} - QOdbListIteratorImpl& operator-= (int n) {i_ -= n; return *this;} - -private: - list_type* l_; - base_iterator_type i_; -}; - -// operator== -// -template -inline bool -operator== (const QOdbListIteratorImpl& x, const QOdbListIteratorImpl& y) -{return x.base () == y.base ();} - -#ifndef QT_STRICT_ITERATORS -template -inline bool -operator== (const QOdbListIteratorImpl& x, - const typename QOdbListIteratorImpl::const_iterator_type& y) -{return x.base () == y;} - -template -inline bool -operator== (const typename QOdbListIteratorImpl::const_iterator_type& x, - const QOdbListIteratorImpl& y) -{return x == y.base ();} -#endif - -// operator< -// -template -inline bool -operator< (const QOdbListIteratorImpl& x, const QOdbListIteratorImpl& y) -{return x.base () < y.base ();} - -#ifndef QT_STRICT_ITERATORS -template -inline bool -operator< (const QOdbListIteratorImpl& x, - const typename QOdbListIteratorImpl::const_iterator_type& y) -{return x.base () < y;} - -template -inline bool -operator< (const typename QOdbListIteratorImpl::const_iterator_type& x, - const QOdbListIteratorImpl& y) -{return x < y.base ();} -#endif - -// operator!= -// -template -inline bool -operator!= (const QOdbListIteratorImpl& x, const QOdbListIteratorImpl& y) -{return x.base () != y.base ();} - -#ifndef QT_STRICT_ITERATORS -template -inline bool -operator!= (const QOdbListIteratorImpl& x, - const typename QOdbListIteratorImpl::const_iterator_type& y) -{return x.base () != y;} - -template -inline bool -operator!= (const typename QOdbListIteratorImpl::const_iterator_type& x, - const QOdbListIteratorImpl& y) -{return x != y.base ();} -#endif - -// operator> -// -template -inline bool -operator> (const QOdbListIteratorImpl& x, const QOdbListIteratorImpl& y) -{return x.base () > y.base ();} - -#ifndef QT_STRICT_ITERATORS -template -inline bool -operator> (const QOdbListIteratorImpl& x, - const typename QOdbListIteratorImpl::const_iterator_type& y) -{return x.base () > y;} - -template -inline bool -operator> (const typename QOdbListIteratorImpl::const_iterator_type& x, - const QOdbListIteratorImpl& y) -{return x > y.base ();} -#endif - -// operator>= -// -template -inline bool -operator>= (const QOdbListIteratorImpl& x, const QOdbListIteratorImpl& y) -{return x.base () >= y.base ();} - -#ifndef QT_STRICT_ITERATORS -template -inline bool -operator>= (const QOdbListIteratorImpl& x, - const typename QOdbListIteratorImpl::const_iterator_type& y) -{return x.base () >= y;} - -template -inline bool -operator>= (const typename QOdbListIteratorImpl::const_iterator_type& x, - const QOdbListIteratorImpl& y) -{return x >= y.base ();} -#endif - -// operator<= -// -template -inline bool -operator<= (const QOdbListIteratorImpl& x, const QOdbListIteratorImpl& y) -{return x.base () <= y.base ();} - -#ifndef QT_STRICT_ITERATORS -template -inline bool -operator<= (const QOdbListIteratorImpl& x, - const typename QOdbListIteratorImpl::const_iterator_type& y) -{return x.base () <= y;} - -template -inline bool -operator<= (const typename QOdbListIteratorImpl::const_iterator_type& x, - const QOdbListIteratorImpl& y) -{return x <= y.base ();} -#endif - -// operator- -// -template -inline typename QOdbListIteratorImpl::difference_type -operator-(const QOdbListIteratorImpl& x, const QOdbListIteratorImpl& y) -{return x.base () - y.base ();} - -#ifndef QT_STRICT_ITERATORS -template -inline typename QOdbListIteratorImpl::difference_type -operator-(const QOdbListIteratorImpl& x, - const typename QOdbListIteratorImpl::const_iterator_type& y) -{return x.base () - y;} - -template -inline typename QOdbListIteratorImpl::difference_type -operator-(const typename QOdbListIteratorImpl::const_iterator_type& x, - const QOdbListIteratorImpl& y) -{return x - y.base ();} -#endif - -// operator+ -// -template -inline QOdbListIteratorImpl -operator+(typename QOdbListIteratorImpl::difference_type n, - const QOdbListIteratorImpl& x) -{return QOdbListIteratorImpl (x.list (), n + x.base ());} - -#include - -#include - -#include - -#endif // ODB_QT_CONTAINERS_LIST_HXX diff --git a/odb/qt/containers/list.ixx b/odb/qt/containers/list.ixx deleted file mode 100644 index d9d37b6..0000000 --- a/odb/qt/containers/list.ixx +++ /dev/null @@ -1,318 +0,0 @@ -// file : odb/qt/containers/list.ixx -// license : GNU GPL v2; see accompanying LICENSE file - -// -// QOdbList -// - -template -inline QOdbList& QOdbList:: -operator= (const QOdbList& x) -{ - l_ = x.l_; - if (_tracking ()) - impl_.assign (static_cast (l_.size ())); - return *this; -} - -template -inline QOdbList& QOdbList:: -operator= (const base_list_type& x) -{ - l_ = x; - if (_tracking ()) - impl_.assign (static_cast (l_.size ())); - return *this; -} - -#ifdef ODB_CXX11 -template -inline QOdbList& QOdbList:: -operator= (QOdbList&& x) -{ - l_ = std::move (x.l_); - if (_tracking ()) - impl_.assign (static_cast (l_.size ())); - return *this; -} - -template -inline QOdbList& QOdbList:: -operator= (base_list_type&& x) -{ - l_ = std::move (x); - if (_tracking ()) - impl_.assign (static_cast (l_.size ())); - return *this; -} -#endif - -#if QT_VERSION >= 0x040800 -template -inline void QOdbList:: -swap (QOdbList& x) -{ - l_.swap (x.l_); - vector_base::swap (x); -} -#endif - -template -inline void QOdbList:: -clear() -{ - l_.clear (); - if (_tracking ()) - impl_.clear (); -} - -template -inline T& QOdbList:: -modify (int i) -{ - T& r (l_[i]); - if (_tracking ()) - impl_.modify (static_cast (i)); - return r; -} - -template -inline void QOdbList:: -reserve (int n) -{ - l_.reserve (n); - if (_tracking ()) - impl_.reserve (static_cast (n)); -} - -template -inline void QOdbList:: -append (const T& x) -{ - l_.append (x); - if (_tracking ()) - impl_.push_back (); -} - -template -inline void QOdbList:: -append (const QList& x) -{ - l_.append (x); - if (_tracking ()) - impl_.push_back (static_cast (x.size ())); -} - -template -inline void QOdbList:: -prepend (const T& x) -{ - l_.prepend (x); - if (_tracking ()) - impl_.insert (0); -} - -template -inline void QOdbList:: -insert (int i, const T& x) -{ - l_.insert (i, x); - if (_tracking ()) - impl_.insert (static_cast (i)); -} - -template -inline void QOdbList:: -replace (int i, const T& x) -{ - l_.insert (i, x); - if (_tracking ()) - impl_.modify (static_cast (i)); -} - -template -inline void QOdbList:: -removeAt (int i) -{ - l_.removeAt (i); - if (_tracking ()) - impl_.erase (static_cast (i)); -} - -template -inline int QOdbList:: -removeAll (const T& x) -{ - // We have to re-implement this one ourselves since we need to - // know the indexes of the removed elements. - // - int r (0); - for (int i (l_.indexOf (x)); i != -1; i = l_.indexOf (x, i)) - { - removeAt (i); - r++; - } - return r; -} - -template -inline bool QOdbList:: -removeOne (const T& x) -{ - // We have to re-implement this one ourselves since we need to - // know the index of the removed element. - // - int i (l_.indexOf (x)); - if (i != -1) - removeAt (i); - return i != -1; -} - -template -inline T QOdbList:: -takeAt (int i) -{ - if (_tracking ()) - impl_.erase (static_cast (i)); - return l_.takeAt (i); -} - -template -inline T QOdbList:: -takeFirst () -{ - if (_tracking ()) - impl_.erase (0); - return l_.takeFirst (); -} - -template -inline T QOdbList:: -takeLast () -{ - if (_tracking ()) - impl_.pop_back (); - return l_.takeLast (); -} - -template -inline void QOdbList:: -move (int from, int to) -{ - l_.move (from, to); - if (_tracking ()) - { - impl_.erase (static_cast (from)); - impl_.insert (static_cast (to)); - } -} - -template -inline void QOdbList:: -swap (int i, int j) -{ - l_.swap (i, j); - if (_tracking ()) - { - impl_.modify (static_cast (i)); - impl_.modify (static_cast (j)); - } -} - -template -inline typename QOdbList::base_iterator_type QOdbList:: -mbegin () -{ - if (_tracking ()) - impl_.modify (0, static_cast (l_.size ())); - return l_.begin (); -} - -template -inline typename QOdbList::iterator QOdbList:: -insert (iterator p, const T& x) -{ - if (_tracking ()) - impl_.insert (static_cast (p.base () - l_.begin ())); - return iterator (this, l_.insert (p.base (), x)); -} - -template -inline typename QOdbList::iterator QOdbList:: -erase (iterator p) -{ - if (_tracking ()) - impl_.erase (static_cast (p.base () - l_.begin ())); - return iterator (this, l_.erase (p.base ())); -} - -template -inline typename QOdbList::iterator QOdbList:: -erase (iterator f, iterator l) -{ - if (_tracking ()) - impl_.erase (static_cast (f.base () - l_.begin ()), - static_cast (l - f)); - return iterator (this, l_.erase (f.base (), l.base ())); -} - -template -inline T& QOdbList:: -modifyFirst () -{ - T& r (l_.first ()); - if (_tracking ()) - impl_.modify (0); - return r; -} - -template -inline T& QOdbList:: -modifyLast () -{ - T& r (l_.last ()); - if (_tracking ()) - impl_.modify (static_cast (l_.size () - 1)); - return r; -} - -template -inline void QOdbList:: -removeFirst () -{ - l_.removeFirst (); - if (_tracking ()) - impl_.erase (0); -} - -template -inline void QOdbList:: -removeLast () -{ - l_.removeLast (); - if (_tracking ()) - impl_.pop_back (); -} - -// -// QOdbListIteratorImpl -// - -template -inline typename QOdbListIteratorImpl::reference QOdbListIteratorImpl:: -modify () const -{ - if (l_->_tracking ()) - l_->_impl ().modify (static_cast (i_ - l_->base ().begin ())); - return *i_; -} - -template -inline typename QOdbListIteratorImpl::reference QOdbListIteratorImpl:: -modify (difference_type n) const -{ - if (l_->_tracking ()) - l_->_impl ().modify ( - static_cast (i_ - l_->base ().begin () + n)); - return i_[n]; -} diff --git a/odb/qt/containers/mutable-list-iterator.hxx b/odb/qt/containers/mutable-list-iterator.hxx deleted file mode 100644 index 271633a..0000000 --- a/odb/qt/containers/mutable-list-iterator.hxx +++ /dev/null @@ -1,110 +0,0 @@ -// file : odb/qt/containers/mutable-list-iterator.hxx -// license : GNU GPL v2; see accompanying LICENSE file - -#ifndef ODB_QT_CONTAINERS_MUTABLE_LIST_ITERATOR_HXX -#define ODB_QT_CONTAINERS_MUTABLE_LIST_ITERATOR_HXX - -#include - -#include - -#include - -// Java-style QMutableListIterator-like iterator. The implementation -// is based on what's found in qiterator.h. -// -template -class QMutableOdbListIterator -{ -public: - QMutableOdbListIterator(QOdbList &x) - : c (&x) - { - c->setSharable(false); - i = c->begin(); - n = c->end(); - } - - ~QMutableOdbListIterator() {c->setSharable(true);} - - QMutableOdbListIterator &operator=(QOdbList &x) - { - c->setSharable(true); - c = &x; - c->setSharable(false); - i = c->begin(); - n = c->end(); - return *this; - } - - void toFront() {i = c->begin(); n = c->end();} - void toBack() {i = c->end(); n = i;} - bool hasNext() const {return c->constEnd() != const_iterator(i.base ());} - bool hasPrevious() const - { - return c->constBegin() != const_iterator(i.base ()); - } - - bool findNext(const T &t) - { - while (c->constEnd() != const_iterator((n = i).base ())) - if (*i++ == t) - return true; - return false; - } - - bool findPrevious(const T &t) - { - while (c->constBegin() != const_iterator(i.base ())) - if (*(n = --i) == t) - return true; - - n = c->end(); - return false; - } - - T &next() {n = i++; return n.modify ();} - T &peekNext() const {return i.modify ();} - T &previous() {n = --i; return n.modify ();} - T &peekPrevious() const {iterator p (i); return (--p).modify ();} - - void remove() - { - if (c->constEnd() != const_iterator(n.base ())) - { - i = c->erase (n); - n = c->end(); - } - } - - void setValue(const T &t) const - { - if (c->constEnd() != const_iterator(n.base ())) - n.modify () = t; - } - - T &value() - { - Q_ASSERT(c->constEnd() != const_iterator(n.base ())); - return n.modify (); - } - - const T &value() const - { - Q_ASSERT(c->constEnd() != const_iterator(n.base ())); - return *n; - } - - void insert(const T &t) {n = i = c->insert(i, t); ++i;} - -private: - typedef typename QOdbList::iterator iterator; - typedef typename QOdbList::const_iterator const_iterator; - - QOdbList* c; - iterator i, n; -}; - -#include - -#endif // ODB_QT_CONTAINERS_MUTABLE_LIST_ITERATOR_HXX diff --git a/odb/qt/containers/qhash-traits.hxx b/odb/qt/containers/qhash-traits.hxx deleted file mode 100644 index 9f42d37..0000000 --- a/odb/qt/containers/qhash-traits.hxx +++ /dev/null @@ -1,129 +0,0 @@ -// file : odb/qt/containers/qhash-traits.hxx -// license : GNU GPL v2; see accompanying LICENSE file - -#ifndef ODB_QT_CONTAINER_QHASH_TRAITS_HXX -#define ODB_QT_CONTAINER_QHASH_TRAITS_HXX - -#include - -#include -#include - -#include - -namespace odb -{ - template - class access::container_traits > - { - public: - static const container_kind kind = ck_map; - static const bool smart = false; - - typedef QHash container_type; - typedef Key key_type; - typedef T value_type; - - typedef map_functions functions; - - public: - static void - persist (const container_type& c, const functions& f) - { - for (typename container_type::const_iterator i (c.begin ()), - e (c.end ()); i != e; ++i) - f.insert (i.key (), i.value ()); - } - - static void - load (container_type& c, bool more, const functions& f) - { - c.clear (); - - while (more) - { - key_type k; - value_type v; - more = f.select (k, v); - c.insert (k, v); // @@ Use std::move in C++11. - } - } - - static void - update (const container_type& c, const functions& f) - { - f.delete_ (); - - for (typename container_type::const_iterator i (c.begin ()), - e (c.end ()); i != e; ++i) - f.insert (i.key (), i.value ()); - } - - static void - erase (const functions& f) - { - f.delete_ (); - } - }; - - // @@ QMultiHash guarantees elements to be stored in reverse order of - // insertion. The current implementation of the generated code does - // not guarantee this. - // - template - class access::container_traits > - { - public: - static const container_kind kind = ck_multimap; - static const bool smart = false; - - typedef QMultiHash container_type; - typedef Key key_type; - typedef T value_type; - - typedef map_functions functions; - - public: - static void - persist (const container_type& c, const functions& f) - { - for (typename container_type::const_iterator i (c.begin ()), - e (c.end ()); i != e; ++i) - f.insert (i.key (), i.value ()); - } - - static void - load (container_type& c, bool more, const functions& f) - { - c.clear (); - - while (more) - { - key_type k; - value_type v; - more = f.select (k, v); - c.insert (k, v); //@@ Use std::move in C++11. - } - } - - static void - update (const container_type& c, const functions& f) - { - f.delete_ (); - - for (typename container_type::const_iterator i (c.begin ()), - e (c.end ()); i != e; ++i) - f.insert (i.key (), i.value ()); - } - - static void - erase (const functions& f) - { - f.delete_ (); - } - }; -} - -#include - -#endif // ODB_QT_CONTAINER_QHASH_TRAITS_HXX diff --git a/odb/qt/containers/qlinked-list-traits.hxx b/odb/qt/containers/qlinked-list-traits.hxx deleted file mode 100644 index 3bfc9e9..0000000 --- a/odb/qt/containers/qlinked-list-traits.hxx +++ /dev/null @@ -1,82 +0,0 @@ -// file : odb/qt/containers/qlinked-list-traits.hxx -// license : GNU GPL v2; see accompanying LICENSE file - -#ifndef ODB_QT_CONTAINER_QLINKED_LIST_TRAITS_HXX -#define ODB_QT_CONTAINER_QLINKED_LIST_TRAITS_HXX - -#include - -#include // QT_VERSION - -// QLinkedList is deprecated since Qt5 5.15 and in Qt6 it has been moved to a -// separate library. -// -#if (QT_VERSION < 0x050F00) || ODB_QT_FORCE_QLINKEDLIST - -#include - -#include - -namespace odb -{ - template - class access::container_traits > - { - public: - static const container_kind kind = ck_ordered; - static const bool smart = false; - - typedef QLinkedList container_type; - - typedef T value_type; - typedef typename container_type::size_type index_type; - - typedef ordered_functions functions; - - public: - static void - persist (const container_type& c, const functions& f) - { - index_type i (0); - for (typename container_type::const_iterator j (c.begin ()), - e (c.end ()); j != e; ++j) - f.insert (i++, *j); - } - - static void - load (container_type& c, bool more, const functions& f) - { - c.clear (); - - while (more) - { - index_type dummy; - c.append (value_type ()); - more = f.select (dummy, c.back ()); - } - } - - static void - update (const container_type& c, const functions& f) - { - f.delete_ (); - - index_type i (0); - for (typename container_type::const_iterator j (c.begin ()), - e (c.end ()); j != e; ++j) - f.insert (i++, *j); - } - - static void - erase (const functions& f) - { - f.delete_ (); - } - }; -} - -#endif - -#include - -#endif // ODB_QT_CONTAINER_QLINKED_LIST_TRAITS_HXX diff --git a/odb/qt/containers/qlist-traits.hxx b/odb/qt/containers/qlist-traits.hxx deleted file mode 100644 index 572d02a..0000000 --- a/odb/qt/containers/qlist-traits.hxx +++ /dev/null @@ -1,72 +0,0 @@ -// file : odb/qt/containers/qlist-traits.hxx -// license : GNU GPL v2; see accompanying LICENSE file - -#ifndef ODB_QT_CONTAINER_QLIST_TRAITS_HXX -#define ODB_QT_CONTAINER_QLIST_TRAITS_HXX - -#include - -#include - -#include - -namespace odb -{ - template - class access::container_traits > - { - public: - static const container_kind kind = ck_ordered; - static const bool smart = false; - - typedef QList container_type; - - typedef T value_type; - typedef typename container_type::size_type index_type; - - typedef ordered_functions functions; - - public: - static void - persist (const container_type& c, const functions& f) - { - // Index based access is just as fast as iterator based access for - // QList. - // - for (index_type i (0), n (c.size ()); i < n; ++i) - f.insert (i, c[i]); - } - - static void - load (container_type& c, bool more, const functions& f) - { - c.clear (); - - while (more) - { - index_type dummy; - c.append (value_type ()); - more = f.select (dummy, c.back ()); - } - } - - static void - update (const container_type& c, const functions& f) - { - f.delete_ (); - - for (index_type i (0), n (c.size ()); i < n; ++i) - f.insert (i, c[i]); - } - - static void - erase (const functions& f) - { - f.delete_ (); - } - }; -} - -#include - -#endif // ODB_QT_CONTAINER_QLIST_TRAITS_HXX diff --git a/odb/qt/containers/qmap-traits.hxx b/odb/qt/containers/qmap-traits.hxx deleted file mode 100644 index 5f13b29..0000000 --- a/odb/qt/containers/qmap-traits.hxx +++ /dev/null @@ -1,130 +0,0 @@ -// file : odb/qt/containers/qmap-traits.hxx -// license : GNU GPL v2; see accompanying LICENSE file - -#ifndef ODB_QT_CONTAINER_QMAP_TRAITS_HXX -#define ODB_QT_CONTAINER_QMAP_TRAITS_HXX - -#include - -#include -#include - -#include - -namespace odb -{ - template - class access::container_traits > - { - public: - static const container_kind kind = ck_map; - static const bool smart = false; - - typedef QMap container_type; - - typedef Key key_type; - typedef T value_type; - - typedef map_functions functions; - - public: - static void - persist (const container_type& c, const functions& f) - { - for (typename container_type::const_iterator i (c.begin ()), - e (c.end ()); i != e; ++i) - f.insert (i.key (), i.value ()); - } - - static void - load (container_type& c, bool more, const functions& f) - { - c.clear (); - - while (more) - { - key_type k; - value_type v; - more = f.select (k, v); - c.insert (k, v); //@@ Use std::move in C++11. - } - } - - static void - update (const container_type& c, const functions& f) - { - f.delete_ (); - - for (typename container_type::const_iterator i (c.begin ()), - e (c.end ()); i != e; ++i) - f.insert (i.key (), i.value ()); - } - - static void - erase (const functions& f) - { - f.delete_ (); - } - }; - // @@ QMultiMap guarantees elements to be stored in reverse order of - // insertion. The current implementation of the generated code does - // not guarantee this. - // - template - class access::container_traits > - { - public: - static const container_kind kind = ck_multimap; - static const bool smart = false; - - typedef QMultiMap container_type; - - typedef Key key_type; - typedef T value_type; - - typedef map_functions functions; - - public: - static void - persist (const container_type& c, const functions& f) - { - for (typename container_type::const_iterator i (c.begin ()), - e (c.end ()); i != e; ++i) - f.insert (i.key (), i.value ()); - } - - static void - load (container_type& c, bool more, const functions& f) - { - c.clear (); - - while (more) - { - key_type k; - value_type v; - more = f.select (k, v); - c.insert (k, v); //@@ Use std::move in C++11. - } - } - - static void - update (const container_type& c, const functions& f) - { - f.delete_ (); - - for (typename container_type::const_iterator i (c.begin ()), - e (c.end ()); i != e; ++i) - f.insert (i.key (), i.value ()); - } - - static void - erase (const functions& f) - { - f.delete_ (); - } - }; -} - -#include - -#endif // ODB_QT_CONTAINER_QMAP_TRAITS_HXX diff --git a/odb/qt/containers/qset-traits.hxx b/odb/qt/containers/qset-traits.hxx deleted file mode 100644 index fbea8b7..0000000 --- a/odb/qt/containers/qset-traits.hxx +++ /dev/null @@ -1,69 +0,0 @@ -// file : odb/qt/containers/qset-traits.hxx -// license : GNU GPL v2; see accompanying LICENSE file - -#ifndef ODB_QT_CONTAINER_QSET_TRAITS_HXX -#define ODB_QT_CONTAINER_QSET_TRAITS_HXX - -#include - -#include - -#include - -namespace odb -{ - template - class access::container_traits > - { - public: - static const container_kind kind = ck_set; - static const bool smart = false; - - typedef QSet container_type; - typedef T value_type; - - typedef set_functions functions; - - public: - static void - persist (const container_type& c, const functions& f) - { - for (typename container_type::const_iterator i (c.begin ()), - e (c.end ()); i != e; ++i) - f.insert (*i); - } - - static void - load (container_type& c, bool more, const functions& f) - { - c.clear (); - - while (more) - { - value_type v; - more = f.select (v); - c.insert (v); //@@ Use std::move in C++11. - } - } - - static void - update (const container_type& c, const functions& f) - { - f.delete_ (); - - for (typename container_type::const_iterator i (c.begin ()), - e (c.end ()); i != e; ++i) - f.insert (*i); - } - - static void - erase (const functions& f) - { - f.delete_ (); - } - }; -} - -#include - -#endif // ODB_QT_CONTAINER_QSET_TRAITS_HXX diff --git a/odb/qt/containers/qvector-traits.hxx b/odb/qt/containers/qvector-traits.hxx deleted file mode 100644 index 516475d..0000000 --- a/odb/qt/containers/qvector-traits.hxx +++ /dev/null @@ -1,82 +0,0 @@ -// file : odb/qt/containers/qvector-traits.hxx -// license : GNU GPL v2; see accompanying LICENSE file - -#ifndef ODB_QT_CONTAINER_QVECTOR_TRAITS_HXX -#define ODB_QT_CONTAINER_QVECTOR_TRAITS_HXX - -#include - -#include // QT_VERSION - -// In Qt 6 QVector is an alias for QList. -// -#if QT_VERSION >= 0x060000 -#include -#else - -#include - -#include - -namespace odb -{ - template - class access::container_traits > - { - public: - static const container_kind kind = ck_ordered; - static const bool smart = false; - - typedef QVector container_type; - - typedef T value_type; - typedef typename container_type::size_type index_type; - - typedef ordered_functions functions; - - public: - static void - persist (const container_type& c, const functions& f) - { - // Index based access is just as fast as iterator based access for - // QVector. - // - for (index_type i (0), n (c.size ()); i < n; ++i) - f.insert (i, c[i]); - } - - static void - load (container_type& c, bool more, const functions& f) - { - c.clear (); - - while (more) - { - index_type dummy; - c.append (value_type ()); - more = f.select (dummy, c.back ()); - } - } - - static void - update (const container_type& c, const functions& f) - { - f.delete_ (); - - for (index_type i (0), n (c.size ()); i < n; ++i) - f.insert (i, c[i]); - } - - static void - erase (const functions& f) - { - f.delete_ (); - } - }; -} - -#endif - -#include - -#endif // ODB_QT_CONTAINER_QVECTOR_TRAITS_HXX diff --git a/odb/qt/date-time.options b/odb/qt/date-time.options deleted file mode 100644 index d199649..0000000 --- a/odb/qt/date-time.options +++ /dev/null @@ -1,4 +0,0 @@ -# file : odb/qt/date-time.options -# license : GNU GPL v2; see accompanying LICENSE file - ---profile qt/date-time/date-time diff --git a/odb/qt/date-time/date-time-common.options b/odb/qt/date-time/date-time-common.options deleted file mode 100644 index d813259..0000000 --- a/odb/qt/date-time/date-time-common.options +++ /dev/null @@ -1,4 +0,0 @@ -# file : odb/qt/date-time/date-time-common.options -# license : GNU GPL v2; see accompanying LICENSE file - ---profile qt/version diff --git a/odb/qt/date-time/date-time-mssql.options b/odb/qt/date-time/date-time-mssql.options deleted file mode 100644 index 7e35b4d..0000000 --- a/odb/qt/date-time/date-time-mssql.options +++ /dev/null @@ -1,13 +0,0 @@ -# file : odb/qt/date-time/date-time-mssql.options -# license : GNU GPL v2; see accompanying LICENSE file - ---profile qt/version - -# Include the default mapping in prologue instead of epilogue to -# allow the user to override the default mapping. -# ---odb-prologue '#include ' - ---hxx-prologue '#include ' ---hxx-prologue '#include ' ---hxx-prologue '#include ' diff --git a/odb/qt/date-time/date-time-mysql.options b/odb/qt/date-time/date-time-mysql.options deleted file mode 100644 index fdbb364..0000000 --- a/odb/qt/date-time/date-time-mysql.options +++ /dev/null @@ -1,13 +0,0 @@ -# file : odb/qt/date-time/date-time-mysql.options -# license : GNU GPL v2; see accompanying LICENSE file - ---profile qt/version - -# Include the default mapping in prologue instead of epilogue to -# allow the user to override the default mapping. -# ---odb-prologue '#include ' - ---hxx-prologue '#include ' ---hxx-prologue '#include ' ---hxx-prologue '#include ' diff --git a/odb/qt/date-time/date-time-oracle.options b/odb/qt/date-time/date-time-oracle.options deleted file mode 100644 index c339ce3..0000000 --- a/odb/qt/date-time/date-time-oracle.options +++ /dev/null @@ -1,13 +0,0 @@ -# file : odb/qt/date-time/date-time-oracle.options -# license : GNU GPL v2; see accompanying LICENSE file - ---profile qt/version - -# Include the default mapping in prologue instead of epilogue to -# allow the user to override the default mapping. -# ---odb-prologue '#include ' - ---hxx-prologue '#include ' ---hxx-prologue '#include ' ---hxx-prologue '#include ' diff --git a/odb/qt/date-time/date-time-pgsql.options b/odb/qt/date-time/date-time-pgsql.options deleted file mode 100644 index 9d80d48..0000000 --- a/odb/qt/date-time/date-time-pgsql.options +++ /dev/null @@ -1,13 +0,0 @@ -# file : odb/qt/date-time/date-time-pgsql.options -# license : GNU GPL v2; see accompanying LICENSE file - ---profile qt/version - -# Include the default mapping in prologue instead of epilogue to -# allow the user to override the default mapping. -# ---odb-prologue '#include ' - ---hxx-prologue '#include ' ---hxx-prologue '#include ' ---hxx-prologue '#include ' diff --git a/odb/qt/date-time/date-time-sqlite.options b/odb/qt/date-time/date-time-sqlite.options deleted file mode 100644 index 8eb1110..0000000 --- a/odb/qt/date-time/date-time-sqlite.options +++ /dev/null @@ -1,13 +0,0 @@ -# file : odb/qt/date-time/date-time-sqlite.options -# license : GNU GPL v2; see accompanying LICENSE file - ---profile qt/version - -# Include the default mapping in prologue instead of epilogue to -# allow the user to override the default mapping. -# ---odb-prologue '#include ' - ---hxx-prologue '#include ' ---hxx-prologue '#include ' ---hxx-prologue '#include ' diff --git a/odb/qt/date-time/exceptions.cxx b/odb/qt/date-time/exceptions.cxx deleted file mode 100644 index 48f0540..0000000 --- a/odb/qt/date-time/exceptions.cxx +++ /dev/null @@ -1,25 +0,0 @@ -// file : odb/qt/date-time/exceptions.cxx -// license : GNU GPL v2; see accompanying LICENSE file - -#include - -namespace odb -{ - namespace qt - { - namespace date_time - { - const char* value_out_of_range:: - what () const ODB_NOTHROW_NOEXCEPT - { - return "date/time value out of range"; - } - - value_out_of_range* value_out_of_range:: - clone () const - { - return new value_out_of_range (*this); - } - } - } -} diff --git a/odb/qt/date-time/exceptions.hxx b/odb/qt/date-time/exceptions.hxx deleted file mode 100644 index 7a73be2..0000000 --- a/odb/qt/date-time/exceptions.hxx +++ /dev/null @@ -1,34 +0,0 @@ -// file : odb/qt/date-time/exceptions.hxx -// license : GNU GPL v2; see accompanying LICENSE file - -#ifndef ODB_QT_DATE_TIME_EXCEPTIONS_HXX -#define ODB_QT_DATE_TIME_EXCEPTIONS_HXX - -#include - -#include // ODB_NOTHROW_NOEXCEPT - -#include -#include - -namespace odb -{ - namespace qt - { - namespace date_time - { - struct LIBODB_QT_EXPORT value_out_of_range: exception - { - virtual const char* - what () const ODB_NOTHROW_NOEXCEPT; - - virtual value_out_of_range* - clone () const; - }; - } - } -} - -#include - -#endif // ODB_QT_DATE_TIME_EXCEPTIONS_HXX diff --git a/odb/qt/date-time/mssql/default-mapping.hxx b/odb/qt/date-time/mssql/default-mapping.hxx deleted file mode 100644 index a8acb6b..0000000 --- a/odb/qt/date-time/mssql/default-mapping.hxx +++ /dev/null @@ -1,31 +0,0 @@ -// file : odb/qt/date-time/mssql/default-mapping.hxx -// license : GNU GPL v2; see accompanying LICENSE file - -#ifndef ODB_QT_DATE_TIME_MSSQL_DEFAULT_MAPPING_HXX -#define ODB_QT_DATE_TIME_MSSQL_DEFAULT_MAPPING_HXX - -#include -#include -#include - -// By default map QDate to SQL Server DATE (available only since SQL -// Server 2008). QDate provides a null representation so allow NULL -// values by default. -// -#pragma db value(QDate) type("DATE") null - -// By default map QTime to SQL Server TIME(3) (available only since SQL -// Server 2008). QTime can only represent clock times with a maximum -// precision of milliseconds. QTime provides a null representation so -// allow NULL values by default. -// -#pragma db value(QTime) type("TIME(3)") null - -// By default map QDateTime to SQL Server DATETIME2(3) (available only -// since SQL Server 2008). QDateTime can only represent clock times with -// a maximum precision of milliseconds. QDateTime provides a null -// representation so allow NULL values by default. -// -#pragma db value(QDateTime) type("DATETIME2(3)") null - -#endif // ODB_QT_DATE_TIME_MSSQL_DEFAULT_MAPPING_HXX diff --git a/odb/qt/date-time/mssql/qdate-time-traits.hxx b/odb/qt/date-time/mssql/qdate-time-traits.hxx deleted file mode 100644 index 5fd8a98..0000000 --- a/odb/qt/date-time/mssql/qdate-time-traits.hxx +++ /dev/null @@ -1,104 +0,0 @@ -// file : odb/qt/date-time/mssql/qdate-time-traits.hxx -// license : GNU GPL v2; see accompanying LICENSE file - -#ifndef ODB_QT_DATE_TIME_MSSQL_QDATETIME_TRAITS_HXX -#define ODB_QT_DATE_TIME_MSSQL_QDATETIME_TRAITS_HXX - -#include - -#include - -#include - -namespace odb -{ - namespace mssql - { - template <> - struct default_value_traits - { - typedef QDateTime value_type; - typedef QDateTime query_type; - typedef datetime image_type; - - static void - set_value (QDateTime& v, const datetime& i, bool is_null) - { - if (is_null) - // Default constructor creates a null QDateTime. - // - v = QDateTime (); - else - v = QDateTime (QDate (i.year, - i.month, - i.day), - QTime (i.hour, - i.minute, - i.second, - static_cast (i.fraction / 1000000))); - } - - static void - set_image (datetime& i, - unsigned short s, - bool& is_null, - const QDateTime& v) - { - if (v.isNull ()) - is_null = true; - else - { - is_null = false; - - const QDate& d (v.date ()); - const QTime& t (v.time ()); - - is_null = false; - i.year = static_cast (d.year ()); - i.month = static_cast (d.month ()); - i.day = static_cast (d.day ()); - i.hour = static_cast (t.hour ()); - i.minute = static_cast (t.minute ()); - - // Scale value 8 indicates we are dealing with SMALLDATETIME - // which has the minutes precision. - // - if (s != 8) - { - i.second = static_cast (t.second ()); - - const unsigned int divider[8] = - { - 1000000000, - 100000000, - 10000000, - 1000000, - 100000, - 10000, - 1000, - 100 - }; - - unsigned int ns (static_cast (t.msec ()) * 1000000); - i.fraction = static_cast (ns - ns % divider[s]); - } - else - { - i.second = 0; - i.fraction = 0; - } - } - } - }; - - template <> - struct default_type_traits - { - static const database_type_id db_type_od = id_datetime; - }; - } -} - -#include - -#endif // ODB_QT_DATE_TIME_MSSQL_QDATETIME_TRAITS_HXX diff --git a/odb/qt/date-time/mssql/qdate-traits.hxx b/odb/qt/date-time/mssql/qdate-traits.hxx deleted file mode 100644 index caa5d3c..0000000 --- a/odb/qt/date-time/mssql/qdate-traits.hxx +++ /dev/null @@ -1,63 +0,0 @@ -// file : odb/qt/date-time/mssql/qdate-traits.hxx -// license : GNU GPL v2; see accompanying LICENSE file - -#ifndef ODB_QT_DATE_TIME_MSSQL_QDATE_TRAITS_HXX -#define ODB_QT_DATE_TIME_MSSQL_QDATE_TRAITS_HXX - -#include - -#include - -#include - -#include - -namespace odb -{ - namespace mssql - { - template <> - struct default_value_traits - { - typedef QDate value_type; - typedef QDate query_type; - typedef date image_type; - - static void - set_value (QDate& v, const date& i, bool is_null) - { - if (is_null) - // A null QDate value is equivalent to an invalid QDate value. - // Set v to an invalid date to represent null. - // - v.setDate (0, 0, 0); - else - v.setDate (i.year, i.month, i.day); - } - - static void - set_image (date& i, bool& is_null, const QDate& v) - { - if (v.isNull ()) - is_null = true; - else - { - is_null = false; - i.year = static_cast (v.year ()); - i.month = static_cast (v.month ()); - i.day = static_cast (v.day ()); - } - } - }; - - template <> - struct default_type_traits - { - static const database_type_id db_type_id = id_date; - }; - } -} - -#include - -#endif // ODB_QT_DATE_TIME_MSSQL_QDATE_TRAITS_HXX diff --git a/odb/qt/date-time/mssql/qtime-traits.hxx b/odb/qt/date-time/mssql/qtime-traits.hxx deleted file mode 100644 index 88fbf41..0000000 --- a/odb/qt/date-time/mssql/qtime-traits.hxx +++ /dev/null @@ -1,80 +0,0 @@ -// file : odb/qt/date-time/mssql/qtime-traits.hxx -// license : GNU GPL v2; see accompanying LICENSE file - -#ifndef ODB_QT_DATE_TIME_MSSQL_QTIME_TRAITS_HXX -#define ODB_QT_DATE_TIME_MSSQL_QTIME_TRAITS_HXX - -#include - -#include - -#include - -namespace odb -{ - namespace mssql - { - template <> - struct default_value_traits - { - typedef QTime value_type; - typedef QTime query_type; - typedef time image_type; - - static void - set_value (QTime& v, const time& i, bool is_null) - { - if (is_null) - // A null QTime value is equivalent to an invalid QTime value. - // Set v to an invalid time to represent null (hour value of - // a valid time must be in the range 0-23). - // - v.setHMS (24, 0, 0); - else - v.setHMS (i.hour, - i.minute, - i.second, - static_cast (i.fraction / 1000000)); - } - - static void - set_image (time& i, unsigned short s, bool& is_null, const QTime& v) - { - if (v.isNull ()) - is_null = true; - else - { - is_null = false; - i.hour = static_cast (v.hour ()); - i.minute = static_cast (v.minute ()); - i.second = static_cast (v.second ()); - - const unsigned int divider[8] = - { - 1000000000, - 100000000, - 10000000, - 1000000, - 100000, - 10000, - 1000, - 100 - }; - - unsigned int ns (static_cast (v.msec ()) * 1000000); - i.fraction = static_cast (ns - ns % divider[s]); - } - } - }; - - template <> - struct default_type_traits - { - static const database_type_id db_type_id = id_time; - }; - } -} - -#include - -#endif // ODB_QT_DATE_TIME_MSSQL_QTIME_TRAITS_HXX diff --git a/odb/qt/date-time/mysql/default-mapping.hxx b/odb/qt/date-time/mysql/default-mapping.hxx deleted file mode 100644 index a88c507..0000000 --- a/odb/qt/date-time/mysql/default-mapping.hxx +++ /dev/null @@ -1,26 +0,0 @@ -// file : odb/qt/date-time/mysql/default-mapping.hxx -// license : GNU GPL v2; see accompanying LICENSE file - -#ifndef ODB_QT_DATE_TIME_MYSQL_DEFAULT_MAPPING_HXX -#define ODB_QT_DATE_TIME_MYSQL_DEFAULT_MAPPING_HXX - -#include -#include -#include - -// Map QDate to MySQL DATE by default. QDate provides a null -// representation so allow NULL values by default. -// -#pragma db value(QDate) type("DATE") null - -// Map QTime to MySQL TIME by default. QTime provides a null -// representation so allow NULL values by default. -// -#pragma db value(QTime) type("TIME") null - -// Map QDateTime to MySQL DATETIME by default. QDateTime provides a null -// representation so allow NULL values by default. -// -#pragma db value(QDateTime) type("DATETIME") null - -#endif // ODB_QT_DATE_TIME_MYSQL_DEFAULT_MAPPING_HXX diff --git a/odb/qt/date-time/mysql/qdate-time-traits.hxx b/odb/qt/date-time/mysql/qdate-time-traits.hxx deleted file mode 100644 index 92279eb..0000000 --- a/odb/qt/date-time/mysql/qdate-time-traits.hxx +++ /dev/null @@ -1,135 +0,0 @@ -// file : odb/qt/date-time/mysql/qdate-time-traits.hxx -// license : GNU GPL v2; see accompanying LICENSE file - -#ifndef ODB_QT_DATE_TIME_MYSQL_QDATETIME_TRAITS_HXX -#define ODB_QT_DATE_TIME_MYSQL_QDATETIME_TRAITS_HXX - -#include - -#include - -#include - -namespace odb -{ - namespace mysql - { - template <> - struct default_value_traits - { - typedef QDateTime value_type; - typedef QDateTime query_type; - typedef MYSQL_TIME image_type; - - static void - set_value (QDateTime& v, const MYSQL_TIME& i, bool is_null) - { - if (is_null) - // Default constructor creates a null QDateTime. - // - v = QDateTime (); - else - // Since MySQL 5.6.4, the microseconds part is no longer ignored. - // - v = QDateTime (QDate (static_cast (i.year), - static_cast (i.month), - static_cast (i.day)), - QTime (static_cast (i.hour), - static_cast (i.minute), - static_cast (i.second), - static_cast (i.second_part / 1000))); - } - - static void - set_image (MYSQL_TIME& i, bool& is_null, const QDateTime& v) - { - if (v.isNull ()) - is_null = true; - else - { - if ((v < QDateTime (QDate (1000, 1, 1))) || - (v >= QDateTime (QDate (10000, 1, 1)))) - throw odb::qt::date_time::value_out_of_range (); - - is_null = false; - i.neg = false; - - const QDate& d (v.date ()); - i.year = static_cast (d.year ()); - i.month = static_cast (d.month ()); - i.day = static_cast (d.day ()); - - const QTime& t (v.time ()); - i.hour = static_cast (t.hour ()); - i.minute = static_cast (t.minute ()); - i.second = static_cast (t.second ()); - i.second_part = static_cast (t.msec ()) * 1000; - } - } - }; - - template <> - struct default_value_traits - { - typedef QDateTime value_type; - typedef QDateTime query_type; - typedef MYSQL_TIME image_type; - - static void - set_value (QDateTime& v, const MYSQL_TIME& i, bool is_null) - { - if (is_null) - // Default constructor creates a null QDateTime. - // - v = QDateTime (); - else - // Since MySQL 5.6.4, the microseconds part is no longer ignored. - // - v = QDateTime (QDate (static_cast (i.year), - static_cast (i.month), - static_cast (i.day)), - QTime (static_cast (i.hour), - static_cast (i.minute), - static_cast (i.second), - static_cast (i.second_part / 1000))); - } - - static void - set_image (MYSQL_TIME& i, bool& is_null, const QDateTime& v) - { - if (v.isNull ()) - is_null = true; - else - { - if ((v <= QDateTime (QDate (1970, 1, 1))) || - (v > QDateTime (QDate (2038, 1, 19), QTime (3, 14, 7)))) - throw odb::qt::date_time::value_out_of_range (); - - is_null = false; - i.neg = false; - - const QDate& d (v.date ()); - i.year = static_cast (d.year ()); - i.month = static_cast (d.month ()); - i.day = static_cast (d.day ()); - - const QTime& t (v.time ()); - i.hour = static_cast (t.hour ()); - i.minute = static_cast (t.minute ()); - i.second = static_cast (t.second ()); - i.second_part = static_cast (t.msec ()) * 1000; - } - } - }; - - template <> - struct default_type_traits - { - static const database_type_id db_type_od = id_datetime; - }; - } -} - -#include - -#endif // ODB_QT_DATE_TIME_MYSQL_QDATETIME_TRAITS_HXX diff --git a/odb/qt/date-time/mysql/qdate-traits.hxx b/odb/qt/date-time/mysql/qdate-traits.hxx deleted file mode 100644 index 12a00ec..0000000 --- a/odb/qt/date-time/mysql/qdate-traits.hxx +++ /dev/null @@ -1,73 +0,0 @@ -// file : odb/qt/date-time/mysql/qdate-traits.hxx -// license : GNU GPL v2; see accompanying LICENSE file - -#ifndef ODB_QT_DATE_TIME_MYSQL_QDATE_TRAITS_HXX -#define ODB_QT_DATE_TIME_MYSQL_QDATE_TRAITS_HXX - -#include - -#include - -#include -#include - -namespace odb -{ - namespace mysql - { - template <> - struct default_value_traits - { - typedef QDate value_type; - typedef QDate query_type; - typedef MYSQL_TIME image_type; - - static void - set_value (QDate& v, const MYSQL_TIME& i, bool is_null) - { - if (is_null) - // A null QDate value is equivalent to an invalid QDate value. - // Set v to an invalid date to represent null. - // - v.setDate (0, 0, 0); - else - v.setDate (static_cast (i.year), - static_cast (i.month), - static_cast (i.day)); - } - - static void - set_image (MYSQL_TIME& i, bool& is_null, const QDate& v) - { - if (v.isNull ()) - is_null = true; - else if ((v < QDate (1000, 1, 1)) || (v > QDate (9999, 12, 31))) - throw odb::qt::date_time::value_out_of_range (); - else - { - is_null = false; - i.neg = false; - - i.year = static_cast (v.year ()); - i.month = static_cast (v.month ()); - i.day = static_cast (v.day ()); - - i.hour = 0; - i.minute = 0; - i.second = 0; - i.second_part = 0; - } - } - }; - - template <> - struct default_type_traits - { - static const database_type_id db_type_id = id_date; - }; - } -} - -#include - -#endif // ODB_QT_DATE_TIME_MYSQL_QDATE_TRAITS_HXX diff --git a/odb/qt/date-time/mysql/qtime-traits.hxx b/odb/qt/date-time/mysql/qtime-traits.hxx deleted file mode 100644 index c96e13f..0000000 --- a/odb/qt/date-time/mysql/qtime-traits.hxx +++ /dev/null @@ -1,74 +0,0 @@ -// file : odb/qt/date-time/mysql/qtime-traits.hxx -// license : GNU GPL v2; see accompanying LICENSE file - -#ifndef ODB_QT_DATE_TIME_MYSQL_QTIME_TRAITS_HXX -#define ODB_QT_DATE_TIME_MYSQL_QTIME_TRAITS_HXX - -#include - -#include - -#include - -namespace odb -{ - namespace mysql - { - template <> - struct default_value_traits - { - typedef QTime value_type; - typedef QTime query_type; - typedef MYSQL_TIME image_type; - - static void - set_value (QTime& v, const MYSQL_TIME& i, bool is_null) - { - if (is_null) - // A null QTime value is equivalent to an invalid QTime value. - // Set v to an invalid time to represent null (hour value of - // a valid time must be in the range 0-23). - // - v.setHMS (24, 0, 0); - else - // Since MySQL 5.6.4, the microseconds part is no longer ignored. - // - v.setHMS (static_cast (i.hour), - static_cast (i.minute), - static_cast (i.second), - static_cast (i.second_part / 1000)); - } - - static void - set_image (MYSQL_TIME& i, bool& is_null, const QTime& v) - { - if (v.isNull ()) - is_null = true; - else - { - is_null = false; - i.neg = false; - - i.year = 0; - i.month = 0; - i.day = 0; - - i.hour = static_cast (v.hour ()); - i.minute = static_cast (v.minute ()); - i.second = static_cast (v.second ()); - i.second_part = static_cast (v.msec ()) * 1000; - } - } - }; - - template <> - struct default_type_traits - { - static const database_type_id db_type_id = id_time; - }; - } -} - -#include - -#endif // ODB_QT_DATE_TIME_MYSQL_QTIME_TRAITS_HXX diff --git a/odb/qt/date-time/oracle/default-mapping.hxx b/odb/qt/date-time/oracle/default-mapping.hxx deleted file mode 100644 index 32a733a..0000000 --- a/odb/qt/date-time/oracle/default-mapping.hxx +++ /dev/null @@ -1,29 +0,0 @@ -// file : odb/qt/date-time/oracle/default-mapping.hxx -// license : GNU GPL v2; see accompanying LICENSE file - -#ifndef ODB_QT_DATE_TIME_ORACLE_DEFAULT_MAPPING_HXX -#define ODB_QT_DATE_TIME_ORACLE_DEFAULT_MAPPING_HXX - -#include -#include -#include - -// Map QDate to Oracle DATE by default. QDate provides a null representation -// so allow NULL values by default. -// -#pragma db value(QDate) type("DATE") null - -// Map QTime to Oracle INTERVAL DAY(0) TO SECOND(3) by default. QTime can -// only represent clock times with a maximum precision of milliseconds. -// QTime provides a null representation so allow NULL values by default. -// -#pragma db value(QTime) type("INTERVAL DAY(0) TO SECOND(3)") null - -// Map QDateTime to Oracle TIMESTAMP(3) by default. QDateTime can only -// represent clock times with a maximum precision of milliseconds. -// QDateTime provides a null representation so allow NULL values by -// default. -// -#pragma db value(QDateTime) type("TIMESTAMP(3)") null - -#endif // ODB_QT_DATE_TIME_ORACLE_DEFAULT_MAPPING_HXX diff --git a/odb/qt/date-time/oracle/qdate-time-traits.hxx b/odb/qt/date-time/oracle/qdate-time-traits.hxx deleted file mode 100644 index ba90075..0000000 --- a/odb/qt/date-time/oracle/qdate-time-traits.hxx +++ /dev/null @@ -1,136 +0,0 @@ -// file : odb/qt/date-time/oracle/qdate-time-traits.hxx -// license : GNU GPL v2; see accompanying LICENSE file - -#ifndef ODB_QT_DATE_TIME_ORACLE_QDATETIME_TRAITS_HXX -#define ODB_QT_DATE_TIME_ORACLE_QDATETIME_TRAITS_HXX - -#include - -#include - -#include -#include - -namespace odb -{ - namespace oracle - { - template <> - struct default_value_traits - { - typedef QDateTime value_type; - typedef QDateTime query_type; - typedef datetime image_type; - - static void - set_value (QDateTime& v, const datetime& i, bool is_null) - { - if (is_null) - // Default constructor creates a null QDateTime. - // - v = QDateTime (); - else - { - sb2 y (0); - ub1 m (0), d (0), h (0), minute (0), s (0); - ub4 ns (0); - i.get (y, m, d, h, minute, s, ns); - - v = QDateTime (QDate (static_cast (y), - static_cast (m), - static_cast (d)), - QTime (static_cast (h), - static_cast (minute), - static_cast (s), - static_cast (ns / 1000000))); - } - } - - static void - set_image (datetime& i, bool& is_null, const QDateTime& v) - { - if (v.isNull ()) - is_null = true; - else - { - is_null = false; - - const QDate& d (v.date ()); - const QTime& t (v.time ()); - - i.set (static_cast (d.year ()), - static_cast (d.month ()), - static_cast (d.day ()), - static_cast (t.hour ()), - static_cast (t.minute ()), - static_cast (t.second ()), - static_cast (t.msec () * 1000000)); - } - } - }; - - template <> - struct default_value_traits - { - typedef QDateTime value_type; - typedef QDateTime query_type; - typedef char* image_type; - - static void - set_value (QDateTime& v, const char* b, bool is_null) - { - if (is_null) - // Default constructor creates a null QDateTime. - // - v = QDateTime (); - else - { - short y; - unsigned char m, d, h, minute, s; - - details::get_date (b, y, m, d, h, minute, s); - - v = QDateTime (QDate (static_cast (y), - static_cast (m), - static_cast (d)), - QTime (static_cast (h), - static_cast (minute), - static_cast (s), - 0)); - } - } - - static void - set_image (char* b, bool& is_null, const QDateTime& v) - { - if (v.isNull ()) - is_null = true; - else - { - is_null = false; - - const QDate& d (v.date ()); - const QTime& t (v.time ()); - - details::set_date (b, - static_cast (d.year ()), - static_cast (d.month ()), - static_cast (d.day ()), - static_cast (t.hour ()), - static_cast (t.minute ()), - static_cast (t.second ())); - } - } - }; - - template <> - struct default_type_traits - { - static const database_type_id db_type_od = id_timestamp; - }; - } -} - -#include - -#endif // ODB_QT_DATE_TIME_ORACLE_QDATETIME_TRAITS_HXX diff --git a/odb/qt/date-time/oracle/qdate-traits.hxx b/odb/qt/date-time/oracle/qdate-traits.hxx deleted file mode 100644 index f293e2d..0000000 --- a/odb/qt/date-time/oracle/qdate-traits.hxx +++ /dev/null @@ -1,76 +0,0 @@ -// file : odb/qt/date-time/oracle/qdate-traits.hxx -// license : GNU GPL v2; see accompanying LICENSE file - -#ifndef ODB_QT_DATE_TIME_ORACLE_QDATE_TRAITS_HXX -#define ODB_QT_DATE_TIME_ORACLE_QDATE_TRAITS_HXX - -#include - -#include - -#include - -#include - -#include - -namespace odb -{ - namespace oracle - { - template <> - struct default_value_traits - { - typedef QDate value_type; - typedef QDate query_type; - typedef char* image_type; - - static void - set_value (QDate& v, const char* b, bool is_null) - { - if (is_null) - // A null QDate value is equivalent to an invalid QDate value. - // Set v to an invalid date to represent null. - // - v.setDate (0, 0, 0); - else - { - short y (0); - unsigned char m (0), d (0), h (0), minute (0), s (0); - details::get_date (b, y, m, d, h, minute, s); - - v.setDate (y, m, d); - } - } - - static void - set_image (char* b, bool& is_null, const QDate& v) - { - if (v.isNull ()) - is_null = true; - else - { - is_null = false; - - details::set_date (b, - static_cast (v.year ()), - static_cast (v.month ()), - static_cast (v.day ()), - 0, - 0, - 0); - } - } - }; - - template <> - struct default_type_traits - { - static const database_type_id db_type_id = id_date; - }; - } -} - -#include - -#endif // ODB_QT_DATE_TIME_ORACLE_QDATE_TRAITS_HXX diff --git a/odb/qt/date-time/oracle/qtime-traits.hxx b/odb/qt/date-time/oracle/qtime-traits.hxx deleted file mode 100644 index 0d9aff4..0000000 --- a/odb/qt/date-time/oracle/qtime-traits.hxx +++ /dev/null @@ -1,66 +0,0 @@ -// file : odb/qt/date-time/oracle/qtime-traits.hxx -// license : GNU GPL v2; see accompanying LICENSE file - -#ifndef ODB_QT_DATE_TIME_ORACLE_QTIME_TRAITS_HXX -#define ODB_QT_DATE_TIME_ORACLE_QTIME_TRAITS_HXX - -#include - -#include - -#include - -namespace odb -{ - namespace oracle - { - template <> - struct default_value_traits - { - typedef QTime value_type; - typedef QTime query_type; - typedef interval_ds image_type; - - static void - set_value (QTime& v, const interval_ds& i, bool is_null) - { - if (is_null) - // A null QTime value is equivalent to an invalid QTime value. - // Set v to an invalid time to represent null (hour value of - // a valid time must be in the range 0-23). - // - v.setHMS (24, 0, 0); - else - { - sb4 d (0), h (0), m (0), s (0), ns (0); - i.get (d, h, m, s, ns); - - v.setHMS (h, m, s, ns / 1000000); - } - } - - static void - set_image (interval_ds& i, bool& is_null, const QTime& v) - { - if (v.isNull ()) - is_null = true; - else - { - is_null = false; - - i.set (0, v.hour (), v.minute (), v.second (), v.msec () * 1000000); - } - } - }; - - template <> - struct default_type_traits - { - static const database_type_id db_type_id = id_interval_ds; - }; - } -} - -#include - -#endif // ODB_QT_DATE_TIME_ORACLE_QTIME_TRAITS_HXX diff --git a/odb/qt/date-time/pgsql/default-mapping.hxx b/odb/qt/date-time/pgsql/default-mapping.hxx deleted file mode 100644 index cd3b1b5..0000000 --- a/odb/qt/date-time/pgsql/default-mapping.hxx +++ /dev/null @@ -1,26 +0,0 @@ -// file : odb/qt/date-time/pgsql/default-mapping.hxx -// license : GNU GPL v2; see accompanying LICENSE file - -#ifndef ODB_QT_DATE_TIME_PGSQL_DEFAULT_MAPPING_HXX -#define ODB_QT_DATE_TIME_PGSQL_DEFAULT_MAPPING_HXX - -#include -#include -#include - -// Map QDate to PostgreSQL DATE by default. QDate provides a null -// representation so allow NULL values by default. -// -#pragma db value(QDate) type("DATE") null - -// Map QTime to PostgreSQL TIME by default. QTime provides a null -// representation so allow NULL values by default. -// -#pragma db value(QTime) type("TIME") null - -// Map QDateTime to PostgreSQL TIMESTAMP by default. QDateTime provides a null -// representation so allow NULL values by default. -// -#pragma db value(QDateTime) type("TIMESTAMP") null - -#endif // ODB_QT_DATE_TIME_PGSQL_DEFAULT_MAPPING_HXX diff --git a/odb/qt/date-time/pgsql/qdate-time-traits.hxx b/odb/qt/date-time/pgsql/qdate-time-traits.hxx deleted file mode 100644 index a9fe757..0000000 --- a/odb/qt/date-time/pgsql/qdate-time-traits.hxx +++ /dev/null @@ -1,70 +0,0 @@ -// file : odb/qt/date-time/pgsql/qdatetime-traits.hxx -// license : GNU GPL v2; see accompanying LICENSE file - -#ifndef ODB_QT_DATE_TIME_PGSQL_QDATETIME_TRAITS_HXX -#define ODB_QT_DATE_TIME_PGSQL_QDATETIME_TRAITS_HXX - -#include - -#include - -#include - -namespace odb -{ - namespace pgsql - { - // Implementation of mapping between QDateTime and PostgreSQL TIMESTAMP. - // TIMESTAMP values are stored as micro-seconds since the PostgreSQL - // epoch 2000-01-01. - // - template <> - struct default_value_traits - { - typedef details::endian_traits endian_traits; - - typedef QDateTime value_type; - typedef QDateTime query_type; - typedef long long image_type; - - static void - set_value (QDateTime& v, long long i, bool is_null) - { - if (is_null) - // Default constructor creates a null QDateTime. - // - v = QDateTime (); - else - { - const QDateTime pg_epoch (QDate (2000, 1, 1), QTime (0, 0, 0)); - v = pg_epoch.addMSecs ( - static_cast (endian_traits::ntoh (i) / 1000LL)); - } - } - - static void - set_image (long long& i, bool& is_null, const QDateTime& v) - { - if (v.isNull ()) - is_null = true; - else - { - is_null = false; - const QDateTime pg_epoch (QDate (2000, 1, 1), QTime (0, 0, 0)); - i = endian_traits::hton ( - static_cast (pg_epoch.msecsTo (v)) * 1000LL); - } - } - }; - - template <> - struct default_type_traits - { - static const database_type_id db_type_id = id_timestamp; - }; - } -} - -#include - -#endif // ODB_QT_DATE_TIME_PGSQL_QDATETIME_TRAITS_HXX diff --git a/odb/qt/date-time/pgsql/qdate-traits.hxx b/odb/qt/date-time/pgsql/qdate-traits.hxx deleted file mode 100644 index b7cc7d4..0000000 --- a/odb/qt/date-time/pgsql/qdate-traits.hxx +++ /dev/null @@ -1,70 +0,0 @@ -// file : odb/qt/date-time/pgsql/qdate-traits.hxx -// license : GNU GPL v2; see accompanying LICENSE file - -#ifndef ODB_QT_DATE_TIME_PGSQL_QDATE_TRAITS_HXX -#define ODB_QT_DATE_TIME_PGSQL_QDATE_TRAITS_HXX - -#include - -#include - -#include - -namespace odb -{ - namespace pgsql - { - // Implementation of the mapping between QDate and PostgreSQL DATE. The - // DATE values are stored as days since the PostgreSQL epoch 2000-01-01. - // - template <> - struct default_value_traits - { - typedef details::endian_traits endian_traits; - - typedef QDate value_type; - typedef QDate query_type; - typedef int image_type; - - static void - set_value (QDate& v, int i, bool is_null) - { - if (is_null) - // A null QDate value is equivalent to an invalid QDate value. - // Set v to an invalid date to represent null. - // - v.setDate (0, 0, 0); - else - { - const QDate pg_epoch (2000, 1, 1); - v = pg_epoch.addDays (endian_traits::ntoh (i)); - } - } - - static void - set_image (int& i, bool& is_null, const QDate& v) - { - if (v.isNull ()) - is_null = true; - else - { - is_null = false; - const QDate pg_epoch (2000, 1, 1); - // In Qt5 daysTo() returns qint64. - // - i = endian_traits::hton (static_cast (pg_epoch.daysTo (v))); - } - } - }; - - template <> - struct default_type_traits - { - static const database_type_id db_type_id = id_date; - }; - } -} - -#include - -#endif // ODB_QT_DATE_TIME_PGSQL_QDATE_TRAITS_HXX diff --git a/odb/qt/date-time/pgsql/qtime-traits.hxx b/odb/qt/date-time/pgsql/qtime-traits.hxx deleted file mode 100644 index 86a594b..0000000 --- a/odb/qt/date-time/pgsql/qtime-traits.hxx +++ /dev/null @@ -1,73 +0,0 @@ -// file : odb/qt/date-time/pgsql/qtime-traits.hxx -// license : GNU GPL v2; see accompanying LICENSE file - -#ifndef ODB_QT_DATE_TIME_PGSQL_QTIME_TRAITS_HXX -#define ODB_QT_DATE_TIME_PGSQL_QTIME_TRAITS_HXX - -#include - -#include - -#include - -namespace odb -{ - namespace pgsql - { - // Implementation of the mapping between QTime and PostgreSQL TIME. The - // TIME values are stored as micro-seconds since 00:00:00. - // - template <> - struct default_value_traits - { - typedef details::endian_traits endian_traits; - - typedef QTime value_type; - typedef QTime query_type; - typedef long long image_type; - - static void - set_value (QTime& v, long long i, bool is_null) - { - if (is_null) - // A null QTime value is equivalent to an invalid QTime value. - // Set v to an invalid time to represent null (hour value of - // a valid time must be in the range 0-23). - // - v.setHMS (24, 0, 0); - else - { - const QTime base (0, 0, 0); - - v = base.addMSecs ( - static_cast (endian_traits::ntoh (i) / 1000)); - } - } - - static void - set_image (long long& i, bool& is_null, const QTime& v) - { - if (v.isNull ()) - is_null = true; - else - { - is_null = false; - const QTime base (0, 0, 0); - - i = endian_traits::hton ( - static_cast (base.msecsTo (v)) * 1000); - } - } - }; - - template <> - struct default_type_traits - { - static const database_type_id db_type_id = id_time; - }; - } -} - -#include - -#endif // ODB_QT_DATE_TIME_PGSQL_QTIME_TRAITS_HXX diff --git a/odb/qt/date-time/sqlite/default-mapping.hxx b/odb/qt/date-time/sqlite/default-mapping.hxx deleted file mode 100644 index a150ca9..0000000 --- a/odb/qt/date-time/sqlite/default-mapping.hxx +++ /dev/null @@ -1,26 +0,0 @@ -// file : odb/qt/date-time/sqlite/default-mapping.hxx -// license : GNU GPL v2; see accompanying LICENSE file - -#ifndef ODB_QT_DATE_TIME_SQLITE_DEFAULT_MAPPING_HXX -#define ODB_QT_DATE_TIME_SQLITE_DEFAULT_MAPPING_HXX - -#include -#include -#include - -// Map QDate to SQLite TEXT by default. QDate provides a null representation -// so allow NULL values by default. -// -#pragma db value(QDate) type("TEXT") null - -// Map QTime to SQLite TEXT by default. QTime provides a null representation -// so allow NULL values by default. -// -#pragma db value(QTime) type("TEXT") null - -// Map QDateTime to SQLite TEXT by default. QDateTime provides a null -// representation so allow NULL values by default. -// -#pragma db value(QDateTime) type("TEXT") null - -#endif // ODB_QT_DATE_TIME_SQLITE_DEFAULT_MAPPING_HXX diff --git a/odb/qt/date-time/sqlite/qdate-time-traits.hxx b/odb/qt/date-time/sqlite/qdate-time-traits.hxx deleted file mode 100644 index db561fc..0000000 --- a/odb/qt/date-time/sqlite/qdate-time-traits.hxx +++ /dev/null @@ -1,138 +0,0 @@ -// file : odb/qt/date-time/sqlite/qdatetime-traits.hxx -// license : GNU GPL v2; see accompanying LICENSE file - -#ifndef ODB_QT_DATE_TIME_SQLITE_QDATETIME_TRAITS_HXX -#define ODB_QT_DATE_TIME_SQLITE_QDATETIME_TRAITS_HXX - -#include - -#include -#include // std::size_t -#include // std::memcpy - -#include // QT_VERSION - -#include - -#include -#include -#include - -namespace odb -{ - namespace sqlite - { - template <> - struct default_value_traits - { - typedef QDateTime value_type; - typedef QDateTime query_type; - typedef details::buffer image_type; - - static void - set_value (QDateTime& v, - const details::buffer& i, - std::size_t n, - bool is_null) - { - if (is_null) - // Default constructor creates a null QDateTime. - // - v = QDateTime (); - else - v = QDateTime::fromString ( - QString::fromLatin1 (i.data (), static_cast (n)), - "yyyy-MM-ddTHH:mm:ss.zzz"); - } - - static void - set_image (details::buffer& i, - std::size_t& n, - bool& is_null, - const QDateTime& v) - { - if (v.isNull ()) - is_null = true; - else - { - is_null = false; - - // Cannot use toStdString() here since Qt could have been - // configured without the STL compatibility support. - // - std::string s ( - v.toString ("yyyy-MM-ddTHH:mm:ss.zzz").toLatin1 ().constData ()); - - n = s.size (); - if (n > i.capacity ()) - i.capacity (n); - - std::memcpy (i.data (), s.data (), n); - } - } - }; - - // Implementation of mapping between QDateTime and SQLite INTEGER. - // The integer value represents UNIX time. - // - template <> - struct default_value_traits - { - typedef QDateTime value_type; - typedef QDateTime query_type; - typedef long long image_type; - - static void - set_value (QDateTime& v, long long i, bool is_null) - { - if (is_null) - // Default constructor creates a null QDateTime. - // - v = QDateTime (); - else - { - v.setTimeSpec (Qt::UTC); - - // *Time_t() functions are deprecated in favor of *SecsSinceEpoch(). - // -#if QT_VERSION < 0x060000 - v.setTime_t (static_cast (i)); -#else - v.setSecsSinceEpoch (static_cast (i)); -#endif - } - } - - static void - set_image (long long& i, bool& is_null, const QDateTime& v) - { - if (v.isNull ()) - is_null = true; - else if (v < QDateTime (QDate (1970, 1, 1), - QTime (0, 0, 0), - Qt::UTC)) - throw odb::qt::date_time::value_out_of_range (); - else - { - is_null = false; - -#if QT_VERSION < 0x060000 - i = static_cast (v.toTime_t ()); -#else - i = static_cast (v.toSecsSinceEpoch ()); -#endif - } - } - }; - - template <> - struct default_type_traits - { - static const database_type_id db_type_id = id_text; - }; - } -} - -#include - -#endif // ODB_QT_DATE_TIME_SQLITE_QDATETIME_TRAITS_HXX diff --git a/odb/qt/date-time/sqlite/qdate-traits.hxx b/odb/qt/date-time/sqlite/qdate-traits.hxx deleted file mode 100644 index 52721b7..0000000 --- a/odb/qt/date-time/sqlite/qdate-traits.hxx +++ /dev/null @@ -1,141 +0,0 @@ -// file : odb/qt/date-time/sqlite/qdate-traits.hxx -// license : GNU GPL v2; see accompanying LICENSE file - -#ifndef ODB_QT_DATE_TIME_SQLITE_QDATE_TRAITS_HXX -#define ODB_QT_DATE_TIME_SQLITE_QDATE_TRAITS_HXX - -#include - -#include -#include // std::size_t -#include // std::memcpy - -#include // QT_VERSION - -#include -#include - -#include -#include -#include - -namespace odb -{ - namespace sqlite - { - template <> - struct default_value_traits - { - typedef QDate value_type; - typedef QDate query_type; - typedef details::buffer image_type; - - static void - set_value (QDate& v, - const details::buffer& i, - std::size_t n, - bool is_null) - { - if (is_null) - // A null QDate value is equivalent to an invalid QDate value. - // Set v to an invalid date to represent null. - // - v.setDate (0, 0, 0); - else - v = QDate::fromString ( - QString::fromLatin1 (i.data (), static_cast (n)), - "yyyy-MM-dd"); - } - - static void - set_image (details::buffer& i, - std::size_t& n, - bool& is_null, - const QDate& v) - { - if (v.isNull ()) - is_null = true; - else - { - is_null = false; - - // Cannot use toStdString() here since Qt could have been - // configured without the STL compatibility support. - // - std::string s (v.toString ("yyyy-MM-dd").toLatin1 ().constData ()); - - n = s.size (); - if (n > i.capacity ()) - i.capacity (n); - - std::memcpy (i.data (), s.data (), n); - } - } - }; - - // Implementation of the mapping between QDate and SQLite INTEGER. The - // integer value represents UNIX time. - // - template <> - struct default_value_traits - { - typedef QDate value_type; - typedef QDate query_type; - typedef long long image_type; - - static void - set_value (QDate& v, long long i, bool is_null) - { - if (is_null) - // A null QDate value is equivalent to an invalid QDate value. - // Set v to an invalid date to represent null. - // - v.setDate (0, 0, 0); - else - { - QDateTime dt; - dt.setTimeSpec (Qt::UTC); - - // *Time_t() functions are deprecated in favor of *SecsSinceEpoch(). - // -#if QT_VERSION < 0x060000 - dt.setTime_t (static_cast (i)); -#else - dt.setSecsSinceEpoch (static_cast (i)); -#endif - v = dt.date (); - } - } - - static void - set_image (long long& i, bool& is_null, const QDate& v) - { - if (v.isNull ()) - is_null = true; - else if (v < QDate (1970, 1, 1)) - throw odb::qt::date_time::value_out_of_range (); - else - { - is_null = false; - const QDateTime dt (v, QTime (0, 0, 0), Qt::UTC); - -#if QT_VERSION < 0x060000 - i = static_cast (dt.toTime_t ()); -#else - i = static_cast (dt.toSecsSinceEpoch ()); -#endif - } - } - }; - - template <> - struct default_type_traits - { - static const database_type_id db_type_id = id_text; - }; - } -} - -#include - -#endif // ODB_QT_DATE_TIME_SQLITE_QDATE_TRAITS_HXX diff --git a/odb/qt/date-time/sqlite/qtime-traits.hxx b/odb/qt/date-time/sqlite/qtime-traits.hxx deleted file mode 100644 index dd86399..0000000 --- a/odb/qt/date-time/sqlite/qtime-traits.hxx +++ /dev/null @@ -1,120 +0,0 @@ -// file : odb/qt/date-time/sqlite/qtime-traits.hxx -// license : GNU GPL v2; see accompanying LICENSE file - -#ifndef ODB_QT_DATE_TIME_SQLITE_QTIME_TRAITS_HXX -#define ODB_QT_DATE_TIME_SQLITE_QTIME_TRAITS_HXX - -#include - -#include -#include // std::size_t -#include // std::memcpy - -#include - -#include -#include - -namespace odb -{ - namespace sqlite - { - template <> - struct default_value_traits - { - typedef QTime value_type; - typedef QTime query_type; - typedef details::buffer image_type; - - static void - set_value (QTime& v, - const details::buffer& i, - std::size_t n, - bool is_null) - { - if (is_null) - // A null QTime value is equivalent to an invalid QTime value. - // Set v to an invalid time to represent null (hour value of - // a valid time must be in the range 0-23). - // - v.setHMS (24, 0, 0); - else - v = QTime::fromString ( - QString::fromLatin1 (i.data (), static_cast (n)), - "HH:mm:ss.zzz"); - } - - static void - set_image (details::buffer& i, - std::size_t& n, - bool& is_null, - const QTime& v) - { - if (v.isNull ()) - is_null = true; - else - { - is_null = false; - - // Cannot use toStdString() here since Qt could have been - // configured without the STL compatibility support. - // - std::string s ( - v.toString ("HH:mm:ss.zzz").toLatin1 ().constData ()); - - n = s.size (); - if (n > i.capacity ()) - i.capacity (n); - - std::memcpy (i.data (), s.data (), n); - } - } - }; - - // Implementation of mapping between QTime and SQLite INTEGER. The - // integer value represents seconds since midnight. - // - template <> - struct default_value_traits - { - typedef QTime value_type; - typedef QTime query_type; - typedef long long image_type; - - static void - set_value (QTime& v, long long i, bool is_null) - { - if (is_null) - // A null QTime value is equivalent to an invalid QTime value. - // Set v to an invalid time to represent null (hour value of - // a valid time must be in the range 0-23). - // - v.setHMS (24, 0, 0); - else - v = QTime (0, 0, 0).addSecs (static_cast (i)); - } - - static void - set_image (long long& i, bool& is_null, const QTime& v) - { - if (v.isNull ()) - is_null = true; - else - { - is_null = false; - i = static_cast (QTime (0, 0, 0).secsTo (v)); - } - } - }; - - template <> - struct default_type_traits - { - static const database_type_id db_type_id = id_text; - }; - } -} - -#include - -#endif // ODB_QT_DATE_TIME_SQLITE_QTIME_TRAITS_HXX diff --git a/odb/qt/details/build2/config-stub.h b/odb/qt/details/build2/config-stub.h deleted file mode 100644 index fbb2971..0000000 --- a/odb/qt/details/build2/config-stub.h +++ /dev/null @@ -1,5 +0,0 @@ -/* file : odb/qt/details/build2/config-stub.h - * license : GNU GPL v2; see accompanying LICENSE file - */ - -#include diff --git a/odb/qt/details/build2/config-vc-stub.h b/odb/qt/details/build2/config-vc-stub.h deleted file mode 100644 index e6a412d..0000000 --- a/odb/qt/details/build2/config-vc-stub.h +++ /dev/null @@ -1,5 +0,0 @@ -/* file : odb/qt/details/build2/config-vc-stub.h - * license : GNU GPL v2; see accompanying LICENSE file - */ - -#include diff --git a/odb/qt/details/build2/config-vc.h b/odb/qt/details/build2/config-vc.h deleted file mode 100644 index 36113ce..0000000 --- a/odb/qt/details/build2/config-vc.h +++ /dev/null @@ -1,15 +0,0 @@ -/* file : odb/qt/details/build2/config-vc.h - * license : GNU GPL v2; see accompanying LICENSE file - */ - -/* Configuration file for Windows/VC++ for the build2 build. */ - -#ifndef ODB_QT_DETAILS_CONFIG_VC_H -#define ODB_QT_DETAILS_CONFIG_VC_H - -/* Define LIBODB_QT_BUILD2 for the installed case. */ -#ifndef LIBODB_QT_BUILD2 -# define LIBODB_QT_BUILD2 -#endif - -#endif /* ODB_QT_DETAILS_CONFIG_VC_H */ diff --git a/odb/qt/details/build2/config.h b/odb/qt/details/build2/config.h deleted file mode 100644 index 12d168f..0000000 --- a/odb/qt/details/build2/config.h +++ /dev/null @@ -1,17 +0,0 @@ -/* file : odb/qt/details/build2/config.h - * license : GNU GPL v2; see accompanying LICENSE file - */ - -/* Static configuration file for the build2 build. The installed case - (when LIBODB_QT_BUILD2 is not necessarily defined) is the only - reason we have it. */ - -#ifndef ODB_QT_DETAILS_CONFIG_H -#define ODB_QT_DETAILS_CONFIG_H - -/* Define LIBODB_QT_BUILD2 for the installed case. */ -#ifndef LIBODB_QT_BUILD2 -# define LIBODB_QT_BUILD2 -#endif - -#endif /* ODB_QT_DETAILS_CONFIG_H */ diff --git a/odb/qt/details/config-vc.h b/odb/qt/details/config-vc.h deleted file mode 100644 index 6718a07..0000000 --- a/odb/qt/details/config-vc.h +++ /dev/null @@ -1,5 +0,0 @@ -/* file : odb/qt/details/config-vc.h - * license : GNU GPL v2; see accompanying LICENSE file - */ - -/* Dummy configuration file for Windows/VC++. */ diff --git a/odb/qt/details/config.h.in b/odb/qt/details/config.h.in deleted file mode 100644 index a0c3989..0000000 --- a/odb/qt/details/config.h.in +++ /dev/null @@ -1,12 +0,0 @@ -/* file : odb/qt/details/config.h.in - * license : GNU GPL v2; see accompanying LICENSE file - */ - -/* This file is automatically processed by configure. */ - -#ifndef ODB_QT_DETAILS_CONFIG_H -#define ODB_QT_DETAILS_CONFIG_H - -#undef LIBODB_QT_STATIC_LIB - -#endif /* ODB_QT_DETAILS_CONFIG_H */ diff --git a/odb/qt/details/config.hxx b/odb/qt/details/config.hxx deleted file mode 100644 index 9077380..0000000 --- a/odb/qt/details/config.hxx +++ /dev/null @@ -1,38 +0,0 @@ -// file : odb/qt/details/config.hxx -// license : GNU GPL v2; see accompanying LICENSE file - -#ifndef ODB_QT_DETAILS_CONFIG_HXX -#define ODB_QT_DETAILS_CONFIG_HXX - -// no pre - -// Qt5 may complain if we are building without -fPIC. Instead of asking the -// user to pass one of these options to the ODB compiler (which can, BTW, be -// done with -x -fPIC, for example, if one is not using the Qt profile), we -// are going to define __PIC__ ourselves just to silence Qt. We also want to -// try to minimize this to cases where it is actually necessary. To achieve -// this, we need to include the Qt config file without including , -// which is where the test for PIE is. While newer versions of Qt (from 4.7) -// have , to support older versions we will include qconfig.h -// directly. This file appears to be present in all the versions starting with -// Qt 4.0. -// -#ifdef ODB_COMPILER -# if defined(__ELF__) && !defined(__PIC__) -# include // QT_REDUCE_RELOCATIONS -# ifdef QT_REDUCE_RELOCATIONS -# define __PIC__ -# endif -# endif -# define LIBODB_QT_STATIC_LIB -#elif !defined(LIBODB_QT_BUILD2) -# ifdef _MSC_VER -# include -# else -# include -# endif -#endif - -// no post - -#endif // ODB_QT_DETAILS_CONFIG_HXX diff --git a/odb/qt/details/export.hxx b/odb/qt/details/export.hxx deleted file mode 100644 index 4c0097f..0000000 --- a/odb/qt/details/export.hxx +++ /dev/null @@ -1,78 +0,0 @@ -// file : odb/qt/details/export.hxx -// license : GNU GPL v2; see accompanying LICENSE file - -#ifndef ODB_QT_DETAILS_EXPORT_HXX -#define ODB_QT_DETAILS_EXPORT_HXX - -#include - -#include - -// Normally we don't export class templates (but do complete specializations), -// inline functions, and classes with only inline member functions. Exporting -// classes that inherit from non-exported/imported bases (e.g., std::string) -// will end up badly. The only known workarounds are to not inherit or to not -// export. Also, MinGW GCC doesn't like seeing non-exported function being -// used before their inline definition. The workaround is to reorder code. In -// the end it's all trial and error. - -#ifdef LIBODB_QT_BUILD2 - -#if defined(LIBODB_QT_STATIC) // Using static. -# define LIBODB_QT_EXPORT -#elif defined(LIBODB_QT_STATIC_BUILD) // Building static. -# define LIBODB_QT_EXPORT -#elif defined(LIBODB_QT_SHARED) // Using shared. -# ifdef _WIN32 -# define LIBODB_QT_EXPORT __declspec(dllimport) -# else -# define LIBODB_QT_EXPORT -# endif -#elif defined(LIBODB_QT_SHARED_BUILD) // Building shared. -# ifdef _WIN32 -# define LIBODB_QT_EXPORT __declspec(dllexport) -# else -# define LIBODB_QT_EXPORT -# endif -#else -// If none of the above macros are defined, then we assume we are being used -// by some third-party build system that cannot/doesn't signal the library -// type. Note that this fallback works for both static and shared but in case -// of shared will be sub-optimal compared to having dllimport. -// -# define LIBODB_QT_EXPORT // Using static or shared. -#endif - -#else // LIBODB_QT_BUILD2 - -#ifdef LIBODB_QT_STATIC_LIB -# define LIBODB_QT_EXPORT -#else -# ifdef _WIN32 -# ifdef _MSC_VER -# ifdef LIBODB_QT_DYNAMIC_LIB -# define LIBODB_QT_EXPORT __declspec(dllexport) -# else -# define LIBODB_QT_EXPORT __declspec(dllimport) -# endif -# else -# ifdef LIBODB_QT_DYNAMIC_LIB -# ifdef DLL_EXPORT -# define LIBODB_QT_EXPORT __declspec(dllexport) -# else -# define LIBODB_QT_EXPORT -# endif -# else -# define LIBODB_QT_EXPORT __declspec(dllimport) -# endif -# endif -# else -# define LIBODB_QT_EXPORT -# endif -#endif - -#endif // LIBODB_QT_BUILD2 - -#include - -#endif // ODB_QT_DETAILS_EXPORT_HXX diff --git a/odb/qt/exception.hxx b/odb/qt/exception.hxx deleted file mode 100644 index 44646d5..0000000 --- a/odb/qt/exception.hxx +++ /dev/null @@ -1,28 +0,0 @@ -// file : odb/qt/exception.hxx -// license : GNU GPL v2; see accompanying LICENSE file - -#ifndef ODB_QT_EXCEPTION_HXX -#define ODB_QT_EXCEPTION_HXX - -#include - -#include - -#include // ODB_NOTHROW_NOEXCEPT -#include - -namespace odb -{ - namespace qt - { - struct LIBODB_QT_EXPORT exception: odb::exception - { - virtual const char* - what () const ODB_NOTHROW_NOEXCEPT = 0; - }; - } -} - -#include - -#endif // ODB_QT_EXCEPTION_HXX diff --git a/odb/qt/lazy-ptr.hxx b/odb/qt/lazy-ptr.hxx deleted file mode 100644 index 6e5a3e0..0000000 --- a/odb/qt/lazy-ptr.hxx +++ /dev/null @@ -1,9 +0,0 @@ -// file : odb/qt/lazy-ptr.hxx -// license : GNU GPL v2; see accompanying LICENSE file - -#ifndef ODB_QT_LAZY_PTR_HXX -#define ODB_QT_LAZY_PTR_HXX - -#include - -#endif // ODB_QT_LAZY_PTR_HXX diff --git a/odb/qt/libodb-qt4-vc10.vcxproj b/odb/qt/libodb-qt4-vc10.vcxproj deleted file mode 100644 index 7fca2e7..0000000 --- a/odb/qt/libodb-qt4-vc10.vcxproj +++ /dev/null @@ -1,174 +0,0 @@ - - - - - Debug - Win32 - - - Debug - x64 - - - Release - Win32 - - - Release - x64 - - - - {4392B1DA-5467-11E0-93E8-00E0812AE2E8} - Win32Proj - libodb-qt - - - - DynamicLibrary - true - Unicode - - - DynamicLibrary - true - Unicode - - - DynamicLibrary - false - true - Unicode - - - DynamicLibrary - false - true - Unicode - - - - - - - - - - - - - - - - - - - true - ..\..\bin\ - odb-qt4-d-__value__(interface_version)-vc10 - - - true - ..\..\bin64\ - odb-qt4-d-__value__(interface_version)-vc10 - - - false - ..\..\bin\ - odb-qt4-__value__(interface_version)-vc10 - - - false - ..\..\bin64\ - odb-qt4-__value__(interface_version)-vc10 - - - - - - Level3 - Disabled - WIN32;_DEBUG;_WINDOWS;_USRDLL;LIBODB_QT_DYNAMIC_LIB;%(PreprocessorDefinitions) - ..\.. - 4355;4800;4290;4251;%(DisableSpecificWarnings) - - - odb-d.lib;QtCored4.lib;%(AdditionalDependencies) - Windows - true - $(TargetPath) - ..\..\lib\odb-qt-d.lib - - - - - - - Level3 - Disabled - WIN32;_DEBUG;_WINDOWS;_USRDLL;LIBODB_QT_DYNAMIC_LIB;%(PreprocessorDefinitions) - ..\.. - 4355;4800;4290;4251;%(DisableSpecificWarnings) - - - odb-d.lib;QtCored4.lib;%(AdditionalDependencies) - Windows - true - $(TargetPath) - ..\..\lib64\odb-qt-d.lib - - - - - Level3 - - - MaxSpeed - true - true - WIN32;NDEBUG;_WINDOWS;_USRDLL;LIBODB_QT_DYNAMIC_LIB;%(PreprocessorDefinitions) - ..\.. - 4355;4800;4290;4251;%(DisableSpecificWarnings) - - - odb.lib;QtCore4.lib;%(AdditionalDependencies) - Windows - true - true - true - $(TargetPath) - ..\..\lib\odb-qt.lib - - - - - Level3 - - - MaxSpeed - true - true - WIN32;NDEBUG;_WINDOWS;_USRDLL;LIBODB_QT_DYNAMIC_LIB;%(PreprocessorDefinitions) - ..\.. - 4355;4800;4290;4251;%(DisableSpecificWarnings) - - - odb.lib;QtCore4.lib;%(AdditionalDependencies) - Windows - true - true - true - $(TargetPath) - ..\..\lib64\odb-qt.lib - - - -__header_entries__(headers) - - -__source_entries__(sources) - - - - - diff --git a/odb/qt/libodb-qt4-vc10.vcxproj.filters b/odb/qt/libodb-qt4-vc10.vcxproj.filters deleted file mode 100644 index 083a1e7..0000000 --- a/odb/qt/libodb-qt4-vc10.vcxproj.filters +++ /dev/null @@ -1,19 +0,0 @@ - - - - - {6D8C47F8-5566-11E0-8D23-00E0812AE2E8} - cxx - - - {8808F89C-5566-11E0-853E-00E0812AE2E8} - h;hxx;ixx;txx - - - -__header_filter_entries__(headers) - - -__source_filter_entries__(sources) - - diff --git a/odb/qt/libodb-qt4-vc11.vcxproj b/odb/qt/libodb-qt4-vc11.vcxproj deleted file mode 100644 index 8c64942..0000000 --- a/odb/qt/libodb-qt4-vc11.vcxproj +++ /dev/null @@ -1,178 +0,0 @@ - - - - - Debug - Win32 - - - Debug - x64 - - - Release - Win32 - - - Release - x64 - - - - {4392B1DA-5467-11E0-93E8-00E0812AE2E8} - Win32Proj - libodb-qt - - - - DynamicLibrary - true - v110 - Unicode - - - DynamicLibrary - true - v110 - Unicode - - - DynamicLibrary - false - v110 - true - Unicode - - - DynamicLibrary - false - v110 - true - Unicode - - - - - - - - - - - - - - - - - - - true - ..\..\bin\ - odb-qt4-d-__value__(interface_version)-vc11 - - - true - ..\..\bin64\ - odb-qt4-d-__value__(interface_version)-vc11 - - - false - ..\..\bin\ - odb-qt4-__value__(interface_version)-vc11 - - - false - ..\..\bin64\ - odb-qt4-__value__(interface_version)-vc11 - - - - - - Level3 - Disabled - WIN32;_DEBUG;_WINDOWS;_USRDLL;LIBODB_QT_DYNAMIC_LIB;%(PreprocessorDefinitions) - ..\.. - 4355;4800;4290;4251;%(DisableSpecificWarnings) - - - odb-d.lib;QtCored4.lib;%(AdditionalDependencies) - Windows - true - $(TargetPath) - ..\..\lib\odb-qt-d.lib - - - - - - - Level3 - Disabled - WIN32;_DEBUG;_WINDOWS;_USRDLL;LIBODB_QT_DYNAMIC_LIB;%(PreprocessorDefinitions) - ..\.. - 4355;4800;4290;4251;%(DisableSpecificWarnings) - - - odb-d.lib;QtCored4.lib;%(AdditionalDependencies) - Windows - true - $(TargetPath) - ..\..\lib64\odb-qt-d.lib - - - - - Level3 - - - MaxSpeed - true - true - WIN32;NDEBUG;_WINDOWS;_USRDLL;LIBODB_QT_DYNAMIC_LIB;%(PreprocessorDefinitions) - ..\.. - 4355;4800;4290;4251;%(DisableSpecificWarnings) - - - odb.lib;QtCore4.lib;%(AdditionalDependencies) - Windows - true - true - true - $(TargetPath) - ..\..\lib\odb-qt.lib - - - - - Level3 - - - MaxSpeed - true - true - WIN32;NDEBUG;_WINDOWS;_USRDLL;LIBODB_QT_DYNAMIC_LIB;%(PreprocessorDefinitions) - ..\.. - 4355;4800;4290;4251;%(DisableSpecificWarnings) - - - odb.lib;QtCore4.lib;%(AdditionalDependencies) - Windows - true - true - true - $(TargetPath) - ..\..\lib64\odb-qt.lib - - - -__header_entries__(headers) - - -__source_entries__(sources) - - - - - diff --git a/odb/qt/libodb-qt4-vc11.vcxproj.filters b/odb/qt/libodb-qt4-vc11.vcxproj.filters deleted file mode 100644 index 083a1e7..0000000 --- a/odb/qt/libodb-qt4-vc11.vcxproj.filters +++ /dev/null @@ -1,19 +0,0 @@ - - - - - {6D8C47F8-5566-11E0-8D23-00E0812AE2E8} - cxx - - - {8808F89C-5566-11E0-853E-00E0812AE2E8} - h;hxx;ixx;txx - - - -__header_filter_entries__(headers) - - -__source_filter_entries__(sources) - - diff --git a/odb/qt/libodb-qt4-vc12.vcxproj b/odb/qt/libodb-qt4-vc12.vcxproj deleted file mode 100644 index 5055b52..0000000 --- a/odb/qt/libodb-qt4-vc12.vcxproj +++ /dev/null @@ -1,182 +0,0 @@ - - - - - Debug - Win32 - - - Debug - x64 - - - Release - Win32 - - - Release - x64 - - - - {4392B1DA-5467-11E0-93E8-00E0812AE2E8} - Win32Proj - libodb-qt - - - - DynamicLibrary - true - v120 - Unicode - - - DynamicLibrary - true - v120 - Unicode - - - DynamicLibrary - false - v120 - true - Unicode - - - DynamicLibrary - false - v120 - true - Unicode - - - - - - - - - - - - - - - - - - - true - ..\..\bin\ - odb-qt4-d-__value__(interface_version)-vc12 - - - true - ..\..\bin64\ - odb-qt4-d-__value__(interface_version)-vc12 - - - false - ..\..\bin\ - odb-qt4-__value__(interface_version)-vc12 - - - false - ..\..\bin64\ - odb-qt4-__value__(interface_version)-vc12 - - - - - - Level3 - Disabled - WIN32;_DEBUG;_WINDOWS;_USRDLL;LIBODB_QT_DYNAMIC_LIB;%(PreprocessorDefinitions) - ..\.. - 4355;4800;4290;4251;%(DisableSpecificWarnings) - true - - - odb-d.lib;QtCored4.lib;%(AdditionalDependencies) - Windows - true - $(TargetPath) - ..\..\lib\odb-qt-d.lib - - - - - - - Level3 - Disabled - WIN32;_DEBUG;_WINDOWS;_USRDLL;LIBODB_QT_DYNAMIC_LIB;%(PreprocessorDefinitions) - ..\.. - 4355;4800;4290;4251;%(DisableSpecificWarnings) - true - - - odb-d.lib;QtCored4.lib;%(AdditionalDependencies) - Windows - true - $(TargetPath) - ..\..\lib64\odb-qt-d.lib - - - - - Level3 - - - MaxSpeed - true - true - WIN32;NDEBUG;_WINDOWS;_USRDLL;LIBODB_QT_DYNAMIC_LIB;%(PreprocessorDefinitions) - ..\.. - 4355;4800;4290;4251;%(DisableSpecificWarnings) - true - - - odb.lib;QtCore4.lib;%(AdditionalDependencies) - Windows - true - true - true - $(TargetPath) - ..\..\lib\odb-qt.lib - - - - - Level3 - - - MaxSpeed - true - true - WIN32;NDEBUG;_WINDOWS;_USRDLL;LIBODB_QT_DYNAMIC_LIB;%(PreprocessorDefinitions) - ..\.. - 4355;4800;4290;4251;%(DisableSpecificWarnings) - true - - - odb.lib;QtCore4.lib;%(AdditionalDependencies) - Windows - true - true - true - $(TargetPath) - ..\..\lib64\odb-qt.lib - - - -__header_entries__(headers) - - -__source_entries__(sources) - - - - - diff --git a/odb/qt/libodb-qt4-vc12.vcxproj.filters b/odb/qt/libodb-qt4-vc12.vcxproj.filters deleted file mode 100644 index 083a1e7..0000000 --- a/odb/qt/libodb-qt4-vc12.vcxproj.filters +++ /dev/null @@ -1,19 +0,0 @@ - - - - - {6D8C47F8-5566-11E0-8D23-00E0812AE2E8} - cxx - - - {8808F89C-5566-11E0-853E-00E0812AE2E8} - h;hxx;ixx;txx - - - -__header_filter_entries__(headers) - - -__source_filter_entries__(sources) - - diff --git a/odb/qt/libodb-qt4-vc8.vcproj b/odb/qt/libodb-qt4-vc8.vcproj deleted file mode 100644 index a46dcc6..0000000 --- a/odb/qt/libodb-qt4-vc8.vcproj +++ /dev/null @@ -1,352 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -__source_entries__(sources) - - -__file_entries__(headers) - - - - - diff --git a/odb/qt/libodb-qt4-vc9.vcproj b/odb/qt/libodb-qt4-vc9.vcproj deleted file mode 100644 index bf0d728..0000000 --- a/odb/qt/libodb-qt4-vc9.vcproj +++ /dev/null @@ -1,359 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -__source_entries__(sources) - - -__file_entries__(headers) - - - - - diff --git a/odb/qt/libodb-qt5-vc10.vcxproj b/odb/qt/libodb-qt5-vc10.vcxproj deleted file mode 100644 index f6d6b92..0000000 --- a/odb/qt/libodb-qt5-vc10.vcxproj +++ /dev/null @@ -1,174 +0,0 @@ - - - - - Debug - Win32 - - - Debug - x64 - - - Release - Win32 - - - Release - x64 - - - - {4392B1DA-5467-11E0-93E8-00E0812AE2E8} - Win32Proj - libodb-qt - - - - DynamicLibrary - true - Unicode - - - DynamicLibrary - true - Unicode - - - DynamicLibrary - false - true - Unicode - - - DynamicLibrary - false - true - Unicode - - - - - - - - - - - - - - - - - - - true - ..\..\bin\ - odb-qt5-d-__value__(interface_version)-vc10 - - - true - ..\..\bin64\ - odb-qt5-d-__value__(interface_version)-vc10 - - - false - ..\..\bin\ - odb-qt5-__value__(interface_version)-vc10 - - - false - ..\..\bin64\ - odb-qt5-__value__(interface_version)-vc10 - - - - - - Level3 - Disabled - WIN32;_DEBUG;_WINDOWS;_USRDLL;LIBODB_QT_DYNAMIC_LIB;%(PreprocessorDefinitions) - ..\.. - 4355;4800;4290;4251;%(DisableSpecificWarnings) - - - odb-d.lib;Qt5Cored.lib;%(AdditionalDependencies) - Windows - true - $(TargetPath) - ..\..\lib\odb-qt-d.lib - - - - - - - Level3 - Disabled - WIN32;_DEBUG;_WINDOWS;_USRDLL;LIBODB_QT_DYNAMIC_LIB;%(PreprocessorDefinitions) - ..\.. - 4355;4800;4290;4251;%(DisableSpecificWarnings) - - - odb-d.lib;Qt5Cored.lib;%(AdditionalDependencies) - Windows - true - $(TargetPath) - ..\..\lib64\odb-qt-d.lib - - - - - Level3 - - - MaxSpeed - true - true - WIN32;NDEBUG;_WINDOWS;_USRDLL;LIBODB_QT_DYNAMIC_LIB;%(PreprocessorDefinitions) - ..\.. - 4355;4800;4290;4251;%(DisableSpecificWarnings) - - - odb.lib;Qt5Core.lib;%(AdditionalDependencies) - Windows - true - true - true - $(TargetPath) - ..\..\lib\odb-qt.lib - - - - - Level3 - - - MaxSpeed - true - true - WIN32;NDEBUG;_WINDOWS;_USRDLL;LIBODB_QT_DYNAMIC_LIB;%(PreprocessorDefinitions) - ..\.. - 4355;4800;4290;4251;%(DisableSpecificWarnings) - - - odb.lib;Qt5Core.lib;%(AdditionalDependencies) - Windows - true - true - true - $(TargetPath) - ..\..\lib64\odb-qt.lib - - - -__header_entries__(headers) - - -__source_entries__(sources) - - - - - diff --git a/odb/qt/libodb-qt5-vc10.vcxproj.filters b/odb/qt/libodb-qt5-vc10.vcxproj.filters deleted file mode 100644 index 083a1e7..0000000 --- a/odb/qt/libodb-qt5-vc10.vcxproj.filters +++ /dev/null @@ -1,19 +0,0 @@ - - - - - {6D8C47F8-5566-11E0-8D23-00E0812AE2E8} - cxx - - - {8808F89C-5566-11E0-853E-00E0812AE2E8} - h;hxx;ixx;txx - - - -__header_filter_entries__(headers) - - -__source_filter_entries__(sources) - - diff --git a/odb/qt/libodb-qt5-vc11.vcxproj b/odb/qt/libodb-qt5-vc11.vcxproj deleted file mode 100644 index 49167cf..0000000 --- a/odb/qt/libodb-qt5-vc11.vcxproj +++ /dev/null @@ -1,178 +0,0 @@ - - - - - Debug - Win32 - - - Debug - x64 - - - Release - Win32 - - - Release - x64 - - - - {4392B1DA-5467-11E0-93E8-00E0812AE2E8} - Win32Proj - libodb-qt - - - - DynamicLibrary - true - v110 - Unicode - - - DynamicLibrary - true - v110 - Unicode - - - DynamicLibrary - false - v110 - true - Unicode - - - DynamicLibrary - false - v110 - true - Unicode - - - - - - - - - - - - - - - - - - - true - ..\..\bin\ - odb-qt5-d-__value__(interface_version)-vc11 - - - true - ..\..\bin64\ - odb-qt5-d-__value__(interface_version)-vc11 - - - false - ..\..\bin\ - odb-qt5-__value__(interface_version)-vc11 - - - false - ..\..\bin64\ - odb-qt5-__value__(interface_version)-vc11 - - - - - - Level3 - Disabled - WIN32;_DEBUG;_WINDOWS;_USRDLL;LIBODB_QT_DYNAMIC_LIB;%(PreprocessorDefinitions) - ..\.. - 4355;4800;4290;4251;%(DisableSpecificWarnings) - - - odb-d.lib;Qt5Cored.lib;%(AdditionalDependencies) - Windows - true - $(TargetPath) - ..\..\lib\odb-qt-d.lib - - - - - - - Level3 - Disabled - WIN32;_DEBUG;_WINDOWS;_USRDLL;LIBODB_QT_DYNAMIC_LIB;%(PreprocessorDefinitions) - ..\.. - 4355;4800;4290;4251;%(DisableSpecificWarnings) - - - odb-d.lib;Qt5Cored.lib;%(AdditionalDependencies) - Windows - true - $(TargetPath) - ..\..\lib64\odb-qt-d.lib - - - - - Level3 - - - MaxSpeed - true - true - WIN32;NDEBUG;_WINDOWS;_USRDLL;LIBODB_QT_DYNAMIC_LIB;%(PreprocessorDefinitions) - ..\.. - 4355;4800;4290;4251;%(DisableSpecificWarnings) - - - odb.lib;Qt5Core.lib;%(AdditionalDependencies) - Windows - true - true - true - $(TargetPath) - ..\..\lib\odb-qt.lib - - - - - Level3 - - - MaxSpeed - true - true - WIN32;NDEBUG;_WINDOWS;_USRDLL;LIBODB_QT_DYNAMIC_LIB;%(PreprocessorDefinitions) - ..\.. - 4355;4800;4290;4251;%(DisableSpecificWarnings) - - - odb.lib;Qt5Core.lib;%(AdditionalDependencies) - Windows - true - true - true - $(TargetPath) - ..\..\lib64\odb-qt.lib - - - -__header_entries__(headers) - - -__source_entries__(sources) - - - - - diff --git a/odb/qt/libodb-qt5-vc11.vcxproj.filters b/odb/qt/libodb-qt5-vc11.vcxproj.filters deleted file mode 100644 index 083a1e7..0000000 --- a/odb/qt/libodb-qt5-vc11.vcxproj.filters +++ /dev/null @@ -1,19 +0,0 @@ - - - - - {6D8C47F8-5566-11E0-8D23-00E0812AE2E8} - cxx - - - {8808F89C-5566-11E0-853E-00E0812AE2E8} - h;hxx;ixx;txx - - - -__header_filter_entries__(headers) - - -__source_filter_entries__(sources) - - diff --git a/odb/qt/libodb-qt5-vc12.vcxproj b/odb/qt/libodb-qt5-vc12.vcxproj deleted file mode 100644 index ecee751..0000000 --- a/odb/qt/libodb-qt5-vc12.vcxproj +++ /dev/null @@ -1,182 +0,0 @@ - - - - - Debug - Win32 - - - Debug - x64 - - - Release - Win32 - - - Release - x64 - - - - {4392B1DA-5467-11E0-93E8-00E0812AE2E8} - Win32Proj - libodb-qt - - - - DynamicLibrary - true - v120 - Unicode - - - DynamicLibrary - true - v120 - Unicode - - - DynamicLibrary - false - v120 - true - Unicode - - - DynamicLibrary - false - v120 - true - Unicode - - - - - - - - - - - - - - - - - - - true - ..\..\bin\ - odb-qt5-d-__value__(interface_version)-vc12 - - - true - ..\..\bin64\ - odb-qt5-d-__value__(interface_version)-vc12 - - - false - ..\..\bin\ - odb-qt5-__value__(interface_version)-vc12 - - - false - ..\..\bin64\ - odb-qt5-__value__(interface_version)-vc12 - - - - - - Level3 - Disabled - WIN32;_DEBUG;_WINDOWS;_USRDLL;LIBODB_QT_DYNAMIC_LIB;%(PreprocessorDefinitions) - ..\.. - 4355;4800;4290;4251;%(DisableSpecificWarnings) - true - - - odb-d.lib;Qt5Cored.lib;%(AdditionalDependencies) - Windows - true - $(TargetPath) - ..\..\lib\odb-qt-d.lib - - - - - - - Level3 - Disabled - WIN32;_DEBUG;_WINDOWS;_USRDLL;LIBODB_QT_DYNAMIC_LIB;%(PreprocessorDefinitions) - ..\.. - 4355;4800;4290;4251;%(DisableSpecificWarnings) - true - - - odb-d.lib;Qt5Cored.lib;%(AdditionalDependencies) - Windows - true - $(TargetPath) - ..\..\lib64\odb-qt-d.lib - - - - - Level3 - - - MaxSpeed - true - true - WIN32;NDEBUG;_WINDOWS;_USRDLL;LIBODB_QT_DYNAMIC_LIB;%(PreprocessorDefinitions) - ..\.. - 4355;4800;4290;4251;%(DisableSpecificWarnings) - true - - - odb.lib;Qt5Core.lib;%(AdditionalDependencies) - Windows - true - true - true - $(TargetPath) - ..\..\lib\odb-qt.lib - - - - - Level3 - - - MaxSpeed - true - true - WIN32;NDEBUG;_WINDOWS;_USRDLL;LIBODB_QT_DYNAMIC_LIB;%(PreprocessorDefinitions) - ..\.. - 4355;4800;4290;4251;%(DisableSpecificWarnings) - true - - - odb.lib;Qt5Core.lib;%(AdditionalDependencies) - Windows - true - true - true - $(TargetPath) - ..\..\lib64\odb-qt.lib - - - -__header_entries__(headers) - - -__source_entries__(sources) - - - - - diff --git a/odb/qt/libodb-qt5-vc12.vcxproj.filters b/odb/qt/libodb-qt5-vc12.vcxproj.filters deleted file mode 100644 index 083a1e7..0000000 --- a/odb/qt/libodb-qt5-vc12.vcxproj.filters +++ /dev/null @@ -1,19 +0,0 @@ - - - - - {6D8C47F8-5566-11E0-8D23-00E0812AE2E8} - cxx - - - {8808F89C-5566-11E0-853E-00E0812AE2E8} - h;hxx;ixx;txx - - - -__header_filter_entries__(headers) - - -__source_filter_entries__(sources) - - diff --git a/odb/qt/libodb-qt5-vc9.vcproj b/odb/qt/libodb-qt5-vc9.vcproj deleted file mode 100644 index 4e62ff9..0000000 --- a/odb/qt/libodb-qt5-vc9.vcproj +++ /dev/null @@ -1,359 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -__source_entries__(sources) - - -__file_entries__(headers) - - - - - diff --git a/odb/qt/list-iterator.hxx b/odb/qt/list-iterator.hxx deleted file mode 100644 index bb8b20c..0000000 --- a/odb/qt/list-iterator.hxx +++ /dev/null @@ -1,9 +0,0 @@ -// file : odb/qt/list-iterator.hxx -// license : GNU GPL v2; see accompanying LICENSE file - -#ifndef ODB_QT_LIST_ITERATOR_HXX -#define ODB_QT_LIST_ITERATOR_HXX - -#include - -#endif // ODB_QT_LIST_ITERATOR_HXX diff --git a/odb/qt/list.hxx b/odb/qt/list.hxx deleted file mode 100644 index 7918ef6..0000000 --- a/odb/qt/list.hxx +++ /dev/null @@ -1,9 +0,0 @@ -// file : odb/qt/list.hxx -// license : GNU GPL v2; see accompanying LICENSE file - -#ifndef ODB_QT_LIST_HXX -#define ODB_QT_LIST_HXX - -#include - -#endif // ODB_QT_LIST_HXX diff --git a/odb/qt/makefile b/odb/qt/makefile deleted file mode 100644 index 0c46805..0000000 --- a/odb/qt/makefile +++ /dev/null @@ -1,120 +0,0 @@ -# file : odb/qt/makefile -# license : GNU GPL v2; see accompanying LICENSE file - -include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make - -cxx := date-time/exceptions.cxx - -cxx_tun := $(cxx) -cxx_obj := $(addprefix $(out_base)/,$(cxx_tun:.cxx=.o)) -cxx_od := $(cxx_obj:.o=.o.d) - -odb_qt.l := $(out_base)/odb-qt.l -odb_qt.l.cpp-options := $(out_base)/odb-qt.l.cpp-options - -default := $(out_base)/ -dist := $(out_base)/.dist -clean := $(out_base)/.clean - -# Import. -# -$(call import,\ - $(scf_root)/import/libodb/stub.make,\ - l: odb.l,cpp-options: odb.l.cpp-options) - -$(call import,\ - $(scf_root)/import/libqt/core/stub.make,\ - l: qt_core.l,\ - cpp-options: qt_core.l.cpp-options,\ - cpp-options-inline: qt_core_cpp_options) - -# Build. -# -$(odb_qt.l): $(cxx_obj) $(odb.l) $(qt_core.l) -$(odb_qt.l.cpp-options): value := -I$(out_root) -I$(src_root) $(qt_core_cpp_options) -$(odb_qt.l.cpp-options): $(odb.l.cpp-options) $(qt_core.l.cpp-options) - -$(cxx_obj) $(cxx_od): $(odb_qt.l.cpp-options) $(out_base)/details/config.h - -$(out_base)/details/config.h: | $(out_base)/details/. - @echo '/* file : odb/qt/details/config.h' >$@ - @echo ' * note : automatically generated' >>$@ - @echo ' */' >>$@ - @echo '' >>$@ - @echo '#ifndef ODB_QT_DETAILS_CONFIG_H' >>$@ - @echo '#define ODB_QT_DETAILS_CONFIG_H' >>$@ - @echo '' >>$@ - @echo '' >>$@ - @echo '#endif /* ODB_QT_DETAILS_CONFIG_H */' >>$@ - -$(call include-dep,$(cxx_od),$(cxx_obj),$(out_base)/details/config.h) - -# Convenience alias for default target. -# -$(out_base)/: $(odb_qt.l) - -# Dist. -# -$(dist): export sources := $(cxx) -$(dist): export headers = $(subst $(src_base)/,,$(shell find $(src_base) \ --name '*.hxx' -o -name '*.ixx' -o -name '*.txx')) -$(dist): export options = $(subst $(src_base)/,,$(shell find $(src_base) \ --name '*.options')) -$(dist): export extra_dist := \ -libodb-qt4-vc8.vcproj \ -libodb-qt4-vc9.vcproj \ -libodb-qt5-vc9.vcproj \ -libodb-qt4-vc10.vcxproj libodb-qt4-vc10.vcxproj.filters \ -libodb-qt5-vc10.vcxproj libodb-qt5-vc10.vcxproj.filters \ -libodb-qt4-vc11.vcxproj libodb-qt4-vc11.vcxproj.filters \ -libodb-qt5-vc11.vcxproj libodb-qt5-vc11.vcxproj.filters \ -libodb-qt4-vc12.vcxproj libodb-qt4-vc12.vcxproj.filters \ -libodb-qt5-vc12.vcxproj libodb-qt5-vc12.vcxproj.filters -$(dist): export interface_version = $(shell sed -e \ -'s/^\([0-9]*\.[0-9]*\).*/\1/' $(src_root)/version) - -$(dist): - $(call dist-data,$(sources) $(headers) $(options) details/config.h.in details/config-vc.h) - $(call meta-vc8proj,$(src_base)/libodb-qt4-vc8.vcproj) - $(call meta-vc9proj,$(src_base)/libodb-qt4-vc9.vcproj) - $(call meta-vc9proj,$(src_base)/libodb-qt5-vc9.vcproj) - $(call meta-vc10proj,$(src_base)/libodb-qt4-vc10.vcxproj) - $(call meta-vc10proj,$(src_base)/libodb-qt5-vc10.vcxproj) - $(call meta-vc11proj,$(src_base)/libodb-qt4-vc11.vcxproj) - $(call meta-vc11proj,$(src_base)/libodb-qt5-vc11.vcxproj) - $(call meta-vc12proj,$(src_base)/libodb-qt4-vc12.vcxproj) - $(call meta-vc12proj,$(src_base)/libodb-qt5-vc12.vcxproj) - $(call meta-automake) - -# Clean. -# -$(clean): $(odb_qt.l).o.clean \ - $(odb_qt.l.cpp-options).clean \ - $(addsuffix .cxx.clean,$(cxx_obj)) \ - $(addsuffix .cxx.clean,$(cxx_od)) - $(call message,rm $$1,rm -f $$1,$(out_base)/details/config.h) - -# Generated .gitignore. -# -ifeq ($(out_base),$(src_base)) -$(odb_qt.l): | $(out_base)/.gitignore - -$(out_base)/.gitignore: files := details/config.h -$(clean): $(out_base)/.gitignore.clean - -$(call include,$(bld_root)/git/gitignore.make) -endif - -# How to. -# -$(call include,$(bld_root)/dist.make) -$(call include,$(bld_root)/meta/vc8proj.make) -$(call include,$(bld_root)/meta/vc9proj.make) -$(call include,$(bld_root)/meta/vc10proj.make) -$(call include,$(bld_root)/meta/vc11proj.make) -$(call include,$(bld_root)/meta/vc12proj.make) -$(call include,$(bld_root)/meta/automake.make) - -$(call include,$(bld_root)/cxx/o-l.make) -$(call include,$(bld_root)/cxx/cxx-o.make) -$(call include,$(bld_root)/cxx/cxx-d.make) diff --git a/odb/qt/mutable-list-iterator.hxx b/odb/qt/mutable-list-iterator.hxx deleted file mode 100644 index 045ae99..0000000 --- a/odb/qt/mutable-list-iterator.hxx +++ /dev/null @@ -1,9 +0,0 @@ -// file : odb/qt/mutable-list-iterator.hxx -// license : GNU GPL v2; see accompanying LICENSE file - -#ifndef ODB_QT_MUTABLE_LIST_ITERATOR_HXX -#define ODB_QT_MUTABLE_LIST_ITERATOR_HXX - -#include - -#endif // ODB_QT_MUTABLE_LIST_ITERATOR_HXX diff --git a/odb/qt/smart-ptr.options b/odb/qt/smart-ptr.options deleted file mode 100644 index b95b39b..0000000 --- a/odb/qt/smart-ptr.options +++ /dev/null @@ -1,19 +0,0 @@ -# file : odb/qt/smart-ptr.options -# license : GNU GPL v2; see accompanying LICENSE file - ---profile qt/version - -# Make QSharedPointer the default object pointer. -# ---hxx-prologue '#include ' ---default-pointer QSharedPointer - -# Include pointer traits. -# ---odb-epilogue '#include ' ---hxx-prologue '#include ' - -# Include wrapper traits. -# ---odb-epilogue '#include ' ---hxx-prologue '#include ' diff --git a/odb/qt/smart-ptr/lazy-pointer-traits.hxx b/odb/qt/smart-ptr/lazy-pointer-traits.hxx deleted file mode 100644 index 6c7aa38..0000000 --- a/odb/qt/smart-ptr/lazy-pointer-traits.hxx +++ /dev/null @@ -1,61 +0,0 @@ -// file : odb/qt/smart-ptr/lazy-pointer-traits.hxx -// license : GNU GPL v2; see accompanying LICENSE file - -#ifndef ODB_QT_SMART_PTR_LAZY_POINTER_TRAITS_HXX -#define ODB_QT_SMART_PTR_LAZY_POINTER_TRAITS_HXX - -#include - -#include -#include - -namespace odb -{ - template - class pointer_traits > - { - public: - static const pointer_kind kind = pk_shared; - static const bool lazy = true; - - typedef T element_type; - typedef QLazySharedPointer pointer_type; - typedef QSharedPointer eager_pointer_type; - - static bool - null_ptr (const pointer_type& p) - { - return !p; - } - - template - static typename object_traits::id_type - object_id (const pointer_type& p) - { - return p.template objectId (); - } - }; - - template - class pointer_traits > - { - public: - static const pointer_kind kind = pk_weak; - static const bool lazy = true; - - typedef T element_type; - typedef QLazyWeakPointer pointer_type; - typedef QLazySharedPointer strong_pointer_type; - typedef QWeakPointer eager_pointer_type; - - static strong_pointer_type - lock (const pointer_type& p) - { - return p.toStrongRef (); - } - }; -} - -#include - -#endif // ODB_QT_SMART_PTR_LAZY_POINTER_TRAITS_HXX diff --git a/odb/qt/smart-ptr/lazy-ptr.hxx b/odb/qt/smart-ptr/lazy-ptr.hxx deleted file mode 100644 index 865e355..0000000 --- a/odb/qt/smart-ptr/lazy-ptr.hxx +++ /dev/null @@ -1,442 +0,0 @@ -// file : odb/qt/smart-ptr/lazy-ptr.hxx -// license : GNU GPL v2; see accompanying LICENSE file - -#ifndef ODB_QT_SMART_PTR_LAZY_PTR_HXX -#define ODB_QT_SMART_PTR_LAZY_PTR_HXX - -#include - -#include -#include -#include - -#include // odb::database -#include -#include -#include // ODB_CXX11 - -template -class QLazyWeakPointer; - -// -// QLazySharedPointer declaration. -// - -template -class QLazySharedPointer -{ - // The standard QSharedPointer interface. - // -public: - // These typedefs are inherited by QSharedPointer indirectly from - // QtSharedPointer::Basic - // - typedef T Type; - typedef T element_type; - typedef T value_type; - typedef value_type* pointer; - typedef const value_type* const_pointer; - typedef value_type& reference; - typedef const value_type& const_reference; - typedef qptrdiff difference_type; - - QLazySharedPointer (); - - explicit - QLazySharedPointer (T*); - - template - QLazySharedPointer (T*, Deleter); - - QLazySharedPointer (const QLazySharedPointer&); - - template - QLazySharedPointer (const QLazySharedPointer&); - - template - QLazySharedPointer (const QLazyWeakPointer&); - - ~QLazySharedPointer (); - - QLazySharedPointer& - operator= (const QLazySharedPointer&); - - template - QLazySharedPointer& - operator= (const QLazySharedPointer&); - - template - QLazySharedPointer& - operator= (const QLazyWeakPointer&); - - typedef QSharedPointer QLazySharedPointer::*unspecified_bool_type; - operator unspecified_bool_type () const - { - return isNull () ? 0 : &QLazySharedPointer::p_; - } - - bool - operator! () const; - - T& - operator* () const; - - T* - operator-> () const; - - void - swap (QLazySharedPointer&); - - bool - isNull () const; - - T* - data () const; - - QLazyWeakPointer - toWeakRef () const; - - void - clear (); - - template - QLazySharedPointer - staticCast () const; - - template - QLazySharedPointer - dynamicCast () const; - - template - QLazySharedPointer - constCast () const; - - // Initialization and assignment from QSharedPointer and QWeakPointer. - // -public: - template - QLazySharedPointer (const QSharedPointer&); - - template - explicit - QLazySharedPointer (const QWeakPointer&); - - template - QLazySharedPointer& - operator= (const QSharedPointer&); - - template - QLazySharedPointer& - operator= (const QWeakPointer&); - - // Lazy loading interface. - // -public: - typedef odb::database database_type; - - // isNull() loaded() - // - // true true NULL pointer to transient object - // false true valid pointer to persistent object - // true false unloaded pointer to persistent object - // false false valid pointer to transient object - // - bool - loaded () const; - - QSharedPointer - load () const; - - // Unload the pointer. For transient objects this function is - // equivalent to clear(). - // - void unload () const; - - // Get the underlying eager pointer. If this is an unloaded pointer - // to a persistent object, then the returned pointer will be NULL. - // - QSharedPointer - getEager () const; - - template - QLazySharedPointer (DB&, const ID&); - - template - QLazySharedPointer (DB&, T*); - - template - QLazySharedPointer (DB&, T*, Deleter); - - template - QLazySharedPointer (DB&, const QSharedPointer&); - - template - QLazySharedPointer (DB&, const QWeakPointer&); - -#ifdef ODB_CXX11_FUNCTION_TEMPLATE_DEFAULT_ARGUMENT - template -#else - template -#endif - typename odb::object_traits::id_type - objectId () const; - - database_type& - database () const; - - // Helpers. - // -public: - template - bool - equal (const QLazySharedPointer&) const; - -private: - template friend class QLazySharedPointer; - template friend class QLazyWeakPointer; - - // For QLazyWeakPointer::toStrongRef(). - // - QLazySharedPointer (const QSharedPointer& p, - const odb::lazy_ptr_impl& i) - : p_ (p), i_ (i) {} - -private: - mutable QSharedPointer p_; - mutable odb::lazy_ptr_impl i_; -}; - -// -// QLazySharedPointer related non-members. -// - -template -QLazySharedPointer -qSharedPointerCast (const QLazySharedPointer&); - -template -QLazySharedPointer -qSharedPointerConstCast (const QLazySharedPointer&); - -template -QLazySharedPointer -qSharedPointerDynamicCast (const QLazySharedPointer&); - -template -bool -operator== (const QLazySharedPointer&, const QLazySharedPointer&); - -template -bool -operator!= (const QLazySharedPointer&, const QLazySharedPointer&); - -// -// QLazyWeakPointer declaration -// - -template -class QLazyWeakPointer -{ - // The standard QWeakPointer interface - // -public: - typedef T element_type; - typedef T value_type; - typedef value_type* pointer; - typedef const value_type* const_pointer; - typedef value_type& reference; - typedef const value_type& const_reference; - typedef qptrdiff difference_type; - - QLazyWeakPointer (); - - QLazyWeakPointer (const QLazyWeakPointer&); - - template - QLazyWeakPointer (const QLazyWeakPointer&); - - template - QLazyWeakPointer (const QLazySharedPointer&); - - ~QLazyWeakPointer (); - - QLazyWeakPointer& - operator= (const QLazyWeakPointer&); - - template - QLazyWeakPointer& - operator= (const QLazyWeakPointer&); - - template - QLazyWeakPointer& - operator= (const QLazySharedPointer&); - - typedef QWeakPointer QLazyWeakPointer::*unspecified_bool_type; - operator unspecified_bool_type () const - { - return isNull () ? 0 : &QLazyWeakPointer::p_; - } - - bool - operator! () const; - -#ifdef QWEAKPOINTER_ENABLE_ARROW - T* - operator-> () const; -#endif - - void - clear (); - - T* - data () const; - - bool - isNull () const; - - QLazySharedPointer - toStrongRef () const; - - // Initialization/assignment from QSharedPointer and QWeakPointer. - // -public: - template - QLazyWeakPointer (const QWeakPointer&); - - template - QLazyWeakPointer (const QSharedPointer&); - - template - QLazyWeakPointer& - operator= (const QWeakPointer&); - - template - QLazyWeakPointer& - operator= (const QSharedPointer&); - - // Lazy loading interface. - // -public: - typedef odb::database database_type; - - // toStrongRef().isNull() loaded() - // - // true true expired pointer to transient object - // false true valid pointer to persistent object - // true false expired pointer to persistent object - // false false valid pointer to transient object - // - bool - loaded () const; - - // Create a strong reference using toStrongRef() and load. - // - QSharedPointer - load () const; - - // Unload the pointer. For transient objects this function is equivalent - // to clear(). - // - void - unload () const; - - // Get the underlying eager pointer. If this is an unloaded pointer - // to a persistent object, then the returned pointer will be NULL. - // - QWeakPointer - getEager () const; - - template - QLazyWeakPointer (DB&, const ID&); - - template - QLazyWeakPointer (DB&, const QSharedPointer&); - - template - QLazyWeakPointer (DB&, const QWeakPointer&); - - // The objectId() function can only be called when the object is persistent, - // or: toStrongRef().isNull() XOR loaded() (can use != for XOR). - // -#ifdef ODB_CXX11_FUNCTION_TEMPLATE_DEFAULT_ARGUMENT - template -#else - template -#endif - typename odb::object_traits::id_type - objectId () const; - - database_type& - database () const; - - // Helpers. - // -public: - template - bool - equal (const QLazyWeakPointer&) const; - - template - bool - equal (const QLazySharedPointer&) const; - -private: - template friend class QLazySharedPointer; - template friend class QLazyWeakPointer; - - mutable QWeakPointer p_; - mutable odb::lazy_ptr_impl i_; -}; - -// -// QLazyWeakPointer related non-members. -// - -template -QLazySharedPointer -qSharedPointerCast (const QLazyWeakPointer&); - -template -QLazySharedPointer -qSharedPointerConstCast (const QLazyWeakPointer&); - -template -QLazySharedPointer -qSharedPointerDynamicCast (const QLazyWeakPointer&); - -template -QLazyWeakPointer -qWeakPointerCast (const QLazyWeakPointer&); - -template -bool -operator== (const QLazyWeakPointer&, const QLazyWeakPointer&); - -template -bool -operator== (const QLazyWeakPointer&, const QLazySharedPointer&); - -template -bool -operator== (const QLazySharedPointer&, const QLazyWeakPointer&); - -template -bool -operator!= (const QLazyWeakPointer&, const QLazyWeakPointer&); - -template -bool -operator!= (const QLazyWeakPointer&, const QLazySharedPointer&); - -template -bool -operator!= (const QLazySharedPointer&, const QLazyWeakPointer&); - -#include -#include - -#include - -#include - -#endif // ODB_QT_SMART_PTR_LAZY_PTR_HXX diff --git a/odb/qt/smart-ptr/lazy-ptr.ixx b/odb/qt/smart-ptr/lazy-ptr.ixx deleted file mode 100644 index b9e6de8..0000000 --- a/odb/qt/smart-ptr/lazy-ptr.ixx +++ /dev/null @@ -1,626 +0,0 @@ -// file : odb/qt/smart-ptr/lazy-ptr.ixx -// license : GNU GPL v2; see accompanying LICENSE file - -// -// QLazySharedPointer definition. -// - -template -inline QLazySharedPointer:: -QLazySharedPointer () {} - -template -inline QLazySharedPointer:: -QLazySharedPointer (T* p): p_ (p) {} - -template -template -inline QLazySharedPointer:: -QLazySharedPointer (T* p, Deleter d): p_ (p, d) {} - -template -inline QLazySharedPointer:: -QLazySharedPointer (const QLazySharedPointer& r): p_ (r.p_), i_ (r.i_) {} - -template -template -inline QLazySharedPointer:: -QLazySharedPointer (const QLazySharedPointer& r): p_ (r.p_), i_ (r.i_) {} - -template -template -inline QLazySharedPointer:: -QLazySharedPointer (const QLazyWeakPointer& r): p_ (r.p_), i_ (r.i_) {} - -template -inline QLazySharedPointer:: -~QLazySharedPointer () {} - -template -inline QLazySharedPointer& QLazySharedPointer:: -operator= (const QLazySharedPointer& r) -{ - p_ = r.p_; - i_ = r.i_; - return *this; -} - -template -template -inline QLazySharedPointer& QLazySharedPointer:: -operator= (const QLazySharedPointer& r) -{ - p_ = r.p_; - i_ = r.i_; - return *this; -} - -template -template -inline QLazySharedPointer& QLazySharedPointer:: -operator= (const QLazyWeakPointer& r) -{ - p_ = r.p_; - i_ = r.i_; - return *this; -} - -template -inline bool QLazySharedPointer:: -operator! () const -{ - return isNull (); -} - -template -inline T& QLazySharedPointer:: -operator* () const -{ - return *p_; -} - -template -inline T* QLazySharedPointer:: -operator-> () const -{ - return p_.operator-> (); -} - -template -inline void QLazySharedPointer:: -swap (QLazySharedPointer& x) -{ - p_.swap (x.p_); - i_.swap (x.i_); -} - -template -inline bool QLazySharedPointer:: -isNull () const -{ - return !(p_ || i_); -} - -template -inline T* QLazySharedPointer:: -data () const -{ - return p_.data (); -} - -template -inline QLazyWeakPointer QLazySharedPointer:: -toWeakRef () const -{ - return QLazyWeakPointer (*this); -} - -template -inline void QLazySharedPointer:: -clear () -{ - p_.clear (); - i_.reset (); -} - -template -template -inline QLazySharedPointer QLazySharedPointer:: -staticCast () const -{ - QLazySharedPointer c (p_.template staticCast ()); - c.i_ = i_; - return c; -} - -template -template -inline QLazySharedPointer QLazySharedPointer:: -dynamicCast () const -{ - QLazySharedPointer c (p_.template dynamicCast ()); - - if (c) - c.i_ = i_; - - return c; -} - -template -template -inline QLazySharedPointer QLazySharedPointer:: -constCast () const -{ - QLazySharedPointer c (p_.template constCast ()); - c.i_ = i_; - return c; -} - -template -template -inline QLazySharedPointer:: -QLazySharedPointer (const QSharedPointer& r): p_ (r) {} - -template -template -inline QLazySharedPointer:: -QLazySharedPointer (const QWeakPointer& r): p_ (r) {} - -template -template -inline QLazySharedPointer& QLazySharedPointer:: -operator= (const QSharedPointer& r) -{ - p_ = r; - i_.reset (); - return *this; -} - -template -template -inline QLazySharedPointer& QLazySharedPointer:: -operator= (const QWeakPointer& r) -{ - p_ = r; - i_.reset (); - return *this; -} - -template -inline bool QLazySharedPointer:: -loaded () const -{ - bool i (i_); - return !p_ != i; // !p_ XOR i_ -} - -template -inline QLazySharedPointer QLazyWeakPointer:: -toStrongRef () const -{ - return QLazySharedPointer (p_.toStrongRef (), i_); -} - -template -inline QSharedPointer QLazySharedPointer:: -load () const -{ - if (!p_ && i_) - p_ = i_.template load (true); // Reset id. - - return p_; -} - -template -inline void QLazySharedPointer:: -unload () const -{ - typedef typename odb::object_traits::object_type object_type; - - if (p_) - { - if (i_.database () != 0) - i_.reset_id (odb::object_traits::id (*p_)); - - p_.clear (); - } -} - -template -inline QSharedPointer QLazySharedPointer:: -getEager () const -{ - return p_; -} - -template -template -inline QLazySharedPointer:: -QLazySharedPointer (DB& db, const ID& id): i_ (db, id) {} - -template -template -inline QLazySharedPointer:: -QLazySharedPointer (DB& db, T* p) - : p_ (p) -{ - if (p_) - i_.reset_db (db); -} - -template -template -inline QLazySharedPointer:: -QLazySharedPointer (DB& db, T* p, Deleter d) - : p_ (p, d) -{ - if (p_) - i_.reset_db (db); -} - -template -template -inline QLazySharedPointer:: -QLazySharedPointer (DB& db, const QSharedPointer& r) - : p_ (r) -{ - if (p_) - i_.reset_db (db); -} - -template -template -inline QLazySharedPointer:: -QLazySharedPointer (DB& db, const QWeakPointer& r) - : p_ (r) -{ - if (p_) - i_.reset_db (db); -} - -template -inline typename QLazySharedPointer::database_type& QLazySharedPointer:: -database () const -{ - return *i_.database (); -} - -template -template -inline typename odb::object_traits::id_type QLazySharedPointer:: -objectId () const -{ - typedef typename odb::object_traits::object_type object_type; - - return p_ - ? odb::object_traits::id (*p_) - : i_.template object_id (); -} - -// -// QLazySharedPointer related non-member function definitions. -// - -template -inline QLazySharedPointer -qSharedPointerCast (const QLazySharedPointer& r) -{ - return r.template staticCast (); -} - -template -inline QLazySharedPointer -qSharedPointerConstCast (const QLazySharedPointer& r) -{ - return r.template constCast (); -} - -template -inline QLazySharedPointer -qSharedPointerDynamicCast (const QLazySharedPointer& r) -{ - return r.template dynamicCast (); -} - -template -inline bool -operator== (const QLazySharedPointer& a, const QLazySharedPointer& b) -{ - return a.equal (b); -} - -template -inline bool -operator!= (const QLazySharedPointer& a, const QLazySharedPointer& b) -{ - return !a.equal (b); -} - -// -// QLazyWeakPointer definition. -// - -template -inline QLazyWeakPointer:: -QLazyWeakPointer () {} - - -template -inline QLazyWeakPointer:: -QLazyWeakPointer (const QLazyWeakPointer& r): p_ (r.p_), i_ (r.i_) {} - -template -template -inline QLazyWeakPointer:: -QLazyWeakPointer (const QLazyWeakPointer& r): p_ (r.p_), i_ (r.i_) {} - -template -template -inline QLazyWeakPointer:: -QLazyWeakPointer (const QLazySharedPointer& r): p_ (r.p_), i_ (r.i_) {} - -template -inline QLazyWeakPointer:: -~QLazyWeakPointer () {} - -template -inline QLazyWeakPointer& QLazyWeakPointer:: -operator= (const QLazyWeakPointer& r) -{ - p_ = r.p_; - i_ = r.i_; - return *this; -} - -template -template -inline QLazyWeakPointer& QLazyWeakPointer:: -operator= (const QLazyWeakPointer& r) -{ - p_ = r.p_; - i_ = r.i_; - return *this; -} - -template -template -inline QLazyWeakPointer& QLazyWeakPointer:: -operator= (const QLazySharedPointer& r) -{ - p_ = r.p_; - i_ = r.i_; - return *this; -} - -template -inline bool QLazyWeakPointer:: -operator! () const -{ - return isNull (); -} - -#ifdef QWEAKPOINTER_ENABLE_ARROW -template -inline T* QLazyWeakPointer:: -operator-> () const -{ - return p_.operator-> (); -} -#endif - -template -inline void QLazyWeakPointer:: -clear () -{ - p_.clear (); - i_.reset (); -} - -template -inline T* QLazyWeakPointer:: -data () const -{ - return p_.data (); -} - -template -inline bool QLazyWeakPointer:: -isNull () const -{ - return !(p_ || i_); -} - -template -template -inline QLazyWeakPointer:: -QLazyWeakPointer (const QWeakPointer& r): p_ (r) {} - -template -template -inline QLazyWeakPointer:: -QLazyWeakPointer (const QSharedPointer& r): p_ (r) {} - -template -template -inline QLazyWeakPointer& QLazyWeakPointer:: -operator= (const QWeakPointer& r) -{ - p_ = r; - i_.reset (); - return *this; -} - -template -template -inline QLazyWeakPointer& QLazyWeakPointer:: -operator= (const QSharedPointer& r) -{ - p_ = r; - i_.reset (); - return *this; -} - -template -inline bool QLazyWeakPointer:: -loaded () const -{ - bool i (i_); - return p_.toStrongRef ().isNull () != i; // expired () XOR i_ -} - -template -inline QSharedPointer QLazyWeakPointer:: -load () const -{ - QSharedPointer r (p_.toStrongRef ()); - - if (!r && i_) - { - r = i_.template load (false); // Keep id. - p_ = r; - } - - return r; -} - -template -inline void QLazyWeakPointer:: -unload () const -{ - // With weak pointer we always keep i_ up to date. - // - p_.clear (); -} - -template -inline QWeakPointer QLazyWeakPointer:: -getEager () const -{ - return p_; -} - -template -template -inline QLazyWeakPointer:: -QLazyWeakPointer (DB& db, const ID& id): i_ (db, id) {} - -template -template -inline QLazyWeakPointer:: -QLazyWeakPointer (DB& db, const QSharedPointer& r) - : p_ (r) -{ - typedef typename odb::object_traits::object_type object_type; - - if (r) - i_.reset (db, odb::object_traits::id (*r)); -} - -template -template -inline QLazyWeakPointer:: -QLazyWeakPointer (DB& db, const QWeakPointer& r) - : p_ (r) -{ - typedef typename odb::object_traits::object_type object_type; - - QSharedPointer sp (p_.toStrongRef ()); - - if (sp) - i_.reset (db, odb::object_traits::id (*sp)); -} - -template -template -inline typename odb::object_traits::id_type QLazyWeakPointer:: -objectId () const -{ - typedef typename odb::object_traits::object_type object_type; - - QSharedPointer sp (p_.toStrongRef ()); - - return sp - ? odb::object_traits::id (*sp) - : i_.template object_id (); -} - -template -inline typename QLazyWeakPointer::database_type& QLazyWeakPointer:: -database () const -{ - return *i_.database (); -} - -// -// QLazyWeakPointer related non-member functions. -// - -template -inline QLazySharedPointer -qSharedPointerCast (const QLazyWeakPointer& r) -{ - return QLazySharedPointer (r).template staticCast (); -} - -template -inline QLazySharedPointer -qSharedPointerConstCast (const QLazyWeakPointer& r) -{ - return QLazySharedPointer (r).template constCast (); -} - -template -inline QLazySharedPointer -qSharedPointerDynamicCast (const QLazyWeakPointer& r) -{ - return QLazySharedPointer (r).template dynamicCast (); -} - -template -inline QLazyWeakPointer -qWeakPointerCast (const QLazyWeakPointer& r) -{ - return QLazySharedPointer (r).template staticCast ().toWeakRef (); -} - -template -inline bool -operator== (const QLazyWeakPointer& t, const QLazyWeakPointer& x) -{ - return t.equal (x); -} - -template -inline bool -operator== (const QLazyWeakPointer& t, const QLazySharedPointer& x) -{ - return t.equal (x); -} - -template -inline bool -operator== (const QLazySharedPointer& t, const QLazyWeakPointer& x) -{ - return x.equal (t); -} - -template -inline bool -operator!= (const QLazyWeakPointer& t, const QLazyWeakPointer& x) -{ - return !t.equal (x); -} - -template -inline bool -operator!= (const QLazyWeakPointer& t, const QLazySharedPointer& x) -{ - return !t.equal (x); -} - -template -inline bool -operator!= (const QLazySharedPointer& t, const QLazyWeakPointer& x) -{ - return !x.equal (t); -} diff --git a/odb/qt/smart-ptr/lazy-ptr.txx b/odb/qt/smart-ptr/lazy-ptr.txx deleted file mode 100644 index 0ae038a..0000000 --- a/odb/qt/smart-ptr/lazy-ptr.txx +++ /dev/null @@ -1,74 +0,0 @@ -// file : odb/qt/smart-ptr/lazy-ptr.txx -// license : GNU GPL v2; see accompanying LICENSE file - -template -template -bool QLazySharedPointer:: -equal (const QLazySharedPointer& r) const -{ - bool t1 (!p_ == loaded ()); - bool t2 (!r.p_ == r.loaded ()); - - // If both are transient, then compare the underlying pointers. - // - if (t1 && t2) - return p_ == r.p_; - - // If one is transient and the other is persistent, then compare - // the underlying pointers but only if they are non NULL. Note - // that an unloaded persistent object is always unequal to a - // transient object. - // - if (t1 || t2) - return p_ == r.p_ && p_; - - // If both objects are persistent, then we compare databases and - // object ids. - // - typedef typename odb::object_traits::object_type object_type1; - typedef typename odb::object_traits::object_type object_type2; - - return i_.database () == r.i_.database () && - objectId () == r.template objectId (); -} - -// -// QLazyWeakPointer -// - -template -template -bool QLazyWeakPointer:: -equal (const QLazyWeakPointer& r) const -{ - if (isNull () && r.isNull ()) - return true; - - QLazySharedPointer sp1 (toStrongRef ()); - QLazySharedPointer sp2 (r.toStrongRef ()); - - // If either one has expired, they are not equal. - // - if (!sp1 || !sp2) - return false; - - return sp1.equal (sp2); -} - -template -template -bool QLazyWeakPointer:: -equal (const QLazySharedPointer& r) const -{ - if (isNull () && r.isNull ()) - return true; - - QLazySharedPointer sp (toStrongRef ()); - - // If the weak pointer has expired, they are not equal. - // - if (!sp) - return false; - - return r.equal (sp); -} diff --git a/odb/qt/smart-ptr/pointer-traits.hxx b/odb/qt/smart-ptr/pointer-traits.hxx deleted file mode 100644 index f5cbc39..0000000 --- a/odb/qt/smart-ptr/pointer-traits.hxx +++ /dev/null @@ -1,110 +0,0 @@ -// file : odb/qt/smart-ptr/pointer-traits.hxx -// license : GNU GPL v2; see accompanying LICENSE file - -#ifndef ODB_QT_SMART_PTR_POINTER_TRAITS_HXX -#define ODB_QT_SMART_PTR_POINTER_TRAITS_HXX - -#include - -#include -#include - -#include -#include - -namespace odb -{ - // Specialization for QSharedPointer. - // - template - class pointer_traits > - { - public: - static const pointer_kind kind = pk_shared; - static const bool lazy = false; - - typedef T element_type; - typedef QSharedPointer pointer_type; - typedef QSharedPointer const_pointer_type; - typedef typename odb::details::meta::remove_const::result - unrestricted_element_type; - typedef QSharedPointer - unrestricted_pointer_type; - typedef smart_ptr_guard guard; - - static element_type* - get_ptr (const pointer_type& p) - { - return p.data (); - } - - static element_type& - get_ref (const pointer_type& p) - { - return *p; - } - - static bool - null_ptr (const pointer_type& p) - { - return !p; - } - - static unrestricted_pointer_type - const_pointer_cast (const pointer_type& p) - { - return qSharedPointerConstCast (p); - } - - template - static QSharedPointer - static_pointer_cast (const pointer_type& p) - { - return qSharedPointerCast (p); - } - - template - static QSharedPointer - dynamic_pointer_cast (const pointer_type& p) - { - return qSharedPointerDynamicCast (p); - } - - public: - static void* - allocate (std::size_t n) - { - return operator new (n); - } - - static void - free (void* p) - { - operator delete (p); - } - }; - - // Specialization for QWeakPointer. - // - template - class pointer_traits > - { - public: - static const pointer_kind kind = pk_weak; - static const bool lazy = false; - - typedef T element_type; - typedef QWeakPointer pointer_type; - typedef QSharedPointer strong_pointer_type; - - static strong_pointer_type - lock (const pointer_type& p) - { - return p.toStrongRef (); - } - }; -} - -#include - -#endif // ODB_QT_SMART_PTR_POINTER_TRAITS_HXX diff --git a/odb/qt/smart-ptr/wrapper-traits.hxx b/odb/qt/smart-ptr/wrapper-traits.hxx deleted file mode 100644 index dc6cb02..0000000 --- a/odb/qt/smart-ptr/wrapper-traits.hxx +++ /dev/null @@ -1,64 +0,0 @@ -// file : odb/qt/smart-ptr/wrapper-traits.hxx -// license : GNU GPL v2; see accompanying LICENSE file - -#ifndef ODB_QT_SMART_PTR_WRAPPER_TRAITS_HXX -#define ODB_QT_SMART_PTR_WRAPPER_TRAITS_HXX - -#include - -#include - -#include - -namespace odb -{ - // Specialization for QSharedPointer. - // - template - class wrapper_traits< QSharedPointer > - { - public: - typedef T wrapped_type; - typedef QSharedPointer wrapper_type; - - // T can be const. - // - typedef - typename odb::details::meta::remove_const::result - unrestricted_wrapped_type; - - static const bool null_handler = true; - static const bool null_default = false; - - static bool - get_null (const wrapper_type& p) - { - return p.isNull (); - } - - static void - set_null (wrapper_type& p) - { - p.clear (); - } - - static const wrapped_type& - get_ref (const wrapper_type& p) - { - return *p; - } - - static wrapped_type& - set_ref (wrapper_type& p) - { - if (p.isNull ()) - p = wrapper_type (new unrestricted_wrapped_type); - - return const_cast (*p); - } - }; -} - -#include - -#endif // ODB_QT_SMART_PTR_WRAPPER_TRAITS_HXX diff --git a/odb/qt/version-build2-stub.hxx b/odb/qt/version-build2-stub.hxx deleted file mode 100644 index b00d1de..0000000 --- a/odb/qt/version-build2-stub.hxx +++ /dev/null @@ -1,4 +0,0 @@ -// file : odb/qt/version-build2-stub.hxx -// license : GNU GPL v2; see accompanying LICENSE file - -#include diff --git a/odb/qt/version-build2.hxx b/odb/qt/version-build2.hxx deleted file mode 100644 index e69de29..0000000 diff --git a/odb/qt/version-build2.hxx.in b/odb/qt/version-build2.hxx.in deleted file mode 100644 index 51f1191..0000000 --- a/odb/qt/version-build2.hxx.in +++ /dev/null @@ -1,46 +0,0 @@ -// file : odb/qt/version-build2.hxx.in -// license : GNU GPL v2; see accompanying LICENSE file - -#ifndef LIBODB_QT_VERSION // Note: using the version macro itself. - -// @@ TODO: need to derive automatically (it is also hardcoded in *.options). -// -#define ODB_QT_VERSION 2047600 - -// The numeric version format is AAAAABBBBBCCCCCDDDE where: -// -// AAAAA - major version number -// BBBBB - minor version number -// CCCCC - bugfix version number -// DDD - alpha / beta (DDD + 500) version number -// E - final (0) / snapshot (1) -// -// When DDDE is not 0, 1 is subtracted from AAAAABBBBBCCCCC. For example: -// -// Version AAAAABBBBBCCCCCDDDE -// -// 0.1.0 0000000001000000000 -// 0.1.2 0000000001000020000 -// 1.2.3 0000100002000030000 -// 2.2.0-a.1 0000200001999990010 -// 3.0.0-b.2 0000299999999995020 -// 2.2.0-a.1.z 0000200001999990011 -// -#define LIBODB_QT_VERSION $libodb_qt.version.project_number$ULL -#define LIBODB_QT_VERSION_STR "$libodb_qt.version.project$" -#define LIBODB_QT_VERSION_ID "$libodb_qt.version.project_id$" - -#define LIBODB_QT_VERSION_MAJOR $libodb_qt.version.major$ -#define LIBODB_QT_VERSION_MINOR $libodb_qt.version.minor$ -#define LIBODB_QT_VERSION_PATCH $libodb_qt.version.patch$ - -#define LIBODB_QT_PRE_RELEASE $libodb_qt.version.pre_release$ - -#define LIBODB_QT_SNAPSHOT $libodb_qt.version.snapshot_sn$ULL -#define LIBODB_QT_SNAPSHOT_ID "$libodb_qt.version.snapshot_id$" - -#include - -$libodb.check(LIBODB_VERSION, LIBODB_SNAPSHOT)$ - -#endif // LIBODB_QT_VERSION diff --git a/odb/qt/version.hxx b/odb/qt/version.hxx deleted file mode 100644 index 4f9510a..0000000 --- a/odb/qt/version.hxx +++ /dev/null @@ -1,55 +0,0 @@ -// file : odb/qt/version.hxx -// license : GNU GPL v2; see accompanying LICENSE file - -#ifdef LIBODB_QT_BUILD2 -# include -#else - -#ifndef ODB_QT_VERSION_HXX -#define ODB_QT_VERSION_HXX - -#include - -#include - -// Version format is AABBCCDD where -// -// AA - major version number -// BB - minor version number -// CC - bugfix version number -// DD - alpha / beta (DD + 50) version number -// -// When DD is not 00, 1 is subtracted from AABBCC. For example: -// -// Version AABBCCDD -// 2.0.0 02000000 -// 2.1.0 02010000 -// 2.1.1 02010100 -// 2.2.0.a1 02019901 -// 3.0.0.b2 02999952 -// - -// Check that we have compatible ODB version. -// -#if ODB_VERSION != 20476 -# error incompatible odb interface version detected -#endif - -// ODB Qt interface version: odb interface version plus the Qt interface -// version. -// -#define ODB_QT_VERSION 2047600 -#define ODB_QT_VERSION_STR "2.5.0-b.26" - -// libodb-qt version: odb interface version plus the bugfix version. Note -// that LIBODB_QT_VERSION is always greater or equal to ODB_QT_VERSION -// since if the Qt interface virsion is incremented then the bugfix version -// must be incremented as well. -// -#define LIBODB_QT_VERSION 2049976 -#define LIBODB_QT_VERSION_STR "2.5.0-b.26" - -#include - -#endif // ODB_QT_VERSION_HXX -#endif // LIBODB_QT_BUILD2 diff --git a/odb/qt/version.options b/odb/qt/version.options deleted file mode 100644 index 0fef537..0000000 --- a/odb/qt/version.options +++ /dev/null @@ -1,16 +0,0 @@ -# file : odb/qt/version.options -# license : GNU GPL v2; see accompanying LICENSE file - -# Include the config file first so that it can do its thing before we -# include any Qt headers. -# ---odb-prologue '#include ' - -# Make sure the options files as seen by the ODB compiler and header -# files as seen by the C++ compiler have the same Qt interface version. -# ---hxx-prologue '#include ' - ---hxx-prologue '#if ODB_QT_VERSION != 2047600 // 2.5.0-b.26' ---hxx-prologue '# error ODB and C++ compilers see different libodb-qt interface versions' ---hxx-prologue '#endif' diff --git a/repositories.manifest b/repositories.manifest deleted file mode 100644 index 595268d..0000000 --- a/repositories.manifest +++ /dev/null @@ -1,6 +0,0 @@ -: 1 -summary: Qt ODB profile library repository - -: -role: prerequisite -location: ../libodb.git##HEAD diff --git a/tests/.gitignore b/tests/.gitignore deleted file mode 100644 index e54525b..0000000 --- a/tests/.gitignore +++ /dev/null @@ -1 +0,0 @@ -driver diff --git a/tests/basics/buildfile b/tests/basics/buildfile deleted file mode 100644 index 900e57a..0000000 --- a/tests/basics/buildfile +++ /dev/null @@ -1,6 +0,0 @@ -# file : tests/basics/buildfile -# license : GNU GPL v2; see accompanying LICENSE file - -import libs = libodb-qt%lib{odb-qt} - -exe{driver}: {hxx cxx}{*} $libs diff --git a/tests/basics/driver.cxx b/tests/basics/driver.cxx deleted file mode 100644 index 01e0d55..0000000 --- a/tests/basics/driver.cxx +++ /dev/null @@ -1,22 +0,0 @@ -// file : tests/basics/driver.cxx -// license : GNU GPL v2; see accompanying LICENSE file - -// Basic test to make sure the library is usable. Functionality testing -// is done in the odb-tests package. - -#include -#include - -using namespace odb; - -int -main () -{ - try - { - throw qt::date_time::value_out_of_range (); - } - catch (const qt::exception&) - { - } -} diff --git a/tests/build/.gitignore b/tests/build/.gitignore deleted file mode 100644 index 4a730a3..0000000 --- a/tests/build/.gitignore +++ /dev/null @@ -1,3 +0,0 @@ -config.build -root/ -bootstrap/ diff --git a/tests/build/bootstrap.build b/tests/build/bootstrap.build deleted file mode 100644 index 6ee38db..0000000 --- a/tests/build/bootstrap.build +++ /dev/null @@ -1,8 +0,0 @@ -# file : tests/build/bootstrap.build -# license : GNU GPL v2; see accompanying LICENSE file - -project = # Unnamed subproject. - -using config -using dist -using test diff --git a/tests/build/root.build b/tests/build/root.build deleted file mode 100644 index 6c5a90b..0000000 --- a/tests/build/root.build +++ /dev/null @@ -1,23 +0,0 @@ -# file : tests/build/root.build -# license : GNU GPL v2; see accompanying LICENSE file - -cxx.std = latest - -using cxx - -hxx{*}: extension = hxx -cxx{*}: extension = cxx - -if ($cxx.target.system == 'win32-msvc') - cxx.poptions += -D_CRT_SECURE_NO_WARNINGS -D_SCL_SECURE_NO_WARNINGS - -if ($cxx.class == 'msvc') - cxx.coptions += /wd4251 /wd4275 /wd4800 - -# Every exe{} in this subproject is by default a test. -# -exe{*}: test = true - -# Specify the test target for cross-testing. -# -test.target = $cxx.target diff --git a/tests/buildfile b/tests/buildfile deleted file mode 100644 index 57588a4..0000000 --- a/tests/buildfile +++ /dev/null @@ -1,4 +0,0 @@ -# file : tests/buildfile -# license : GNU GPL v2; see accompanying LICENSE file - -./: {*/ -build/} diff --git a/version b/version deleted file mode 100644 index 6bc2f39..0000000 --- a/version +++ /dev/null @@ -1 +0,0 @@ -2.5.0-b.26 -- cgit v1.1