diff options
265 files changed, 3859 insertions, 1156 deletions
@@ -1,3 +1,5 @@ +Copyright (c) 2009-2024 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 3 as published by the Free Software Foundation. diff --git a/Makefile.am b/Makefile.am index f13f4b4..11b661c 100644 --- a/Makefile.am +++ b/Makefile.am @@ -1,5 +1,4 @@ # file : Makefile.am -# copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC # license : GNU GPL v3; see accompanying LICENSE file SUBDIRS = __path__(dirs) @@ -7,6 +7,10 @@ Version 2.5.0 @@ Ref to the manual. + * Support for custom table definition options in addition to column + definition options. For details, refer to Section 14.1.16, "options" in + the ODB manual. + * Support for nested object ids. Now the 'id' pragma specifier can optionally include the data member path to the id inside a composite value. For example: @@ -33,11 +37,50 @@ Version 2.5.0 * The 'inverse' pragma now supports nested data members. * Helper header (<odb/nested-container.hxx>) for nested container emulation. - It is still fairly experimental and only supports vector<vector<T>>. + It is still fairly experimental and only supports vector<vector<T>>. For + example: + + #include <odb/nested-container.hxx> + + #pragma db object + class package + { + using licenses_type = std::vector<std::string> + using license_alternatives_type = std::vector<licenses_type> + + license_alternatives_type license_alternatives; + + // Database mapping. + // + using _license_key = odb::nested_key<licenses_type>; + using _licenses_type = std::map<_license_key, std::string>; + + #pragma db value(_license_key) + #pragma db member(_license_key::outer) column("alternative_index") + #pragma db member(_license_key::inner) column("index") + + #pragma db member(license_alternatives) id_column("") value_column("") + #pragma db member(licenses) \ + virtual(_licenses_type) \ + after(license_alternatives) \ + get(odb::nested_get (this.license_alternatives)) \ + set(odb::nested_set (this.license_alternatives, std::move (?))) \ + id_column("") key_column("") value_column("license") + }; * Database classes are now move-constructible. This means they can be returned by value from a function in C++11. + * Support for bulk operations in PostgreSQL 14 using the new pipeline mode. + For details on bulk operations see Section 15.3, "Bulk Database Operations" + in the ODB manual. Note that while this functionality requires libpq + version 14 or later, it should be usable with PostgreSQL servers version + 7.4 or later. The development of this support was sponsored by Qube + Research & Technologies Limited. + + * Support for SQLite ATTACH DATABASE. Attached databases are represented as + special odb::sqlite::database instances. @@ TODO: doc ref. + * Support for SQLite incremental BLOB/TEXT I/O (the sqlite3_blob_open() functionality). For details, refer to Section 18.1.3, "Incremental BLOB/TEXT I/O" in the ODB manual. @@ -1,7 +1,6 @@ #! /bin/sh # file : bootstrap -# copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC # license : GNU GPL v3; see accompanying LICENSE file # diff --git a/build/bootstrap.build b/build/bootstrap.build index d82a776..9e30b56 100644 --- a/build/bootstrap.build +++ b/build/bootstrap.build @@ -1,5 +1,4 @@ # file : build/bootstrap.build -# copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC # license : GNU GPL v3; see accompanying LICENSE file project = odb diff --git a/build/bootstrap.make b/build/bootstrap.make index 054a073..f0c56e8 100644 --- a/build/bootstrap.make +++ b/build/bootstrap.make @@ -1,5 +1,4 @@ # file : build/bootstrap.make -# copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC # license : GNU GPL v3; see accompanying LICENSE file project_name := odb diff --git a/build/export.build b/build/export.build index 0f9170b..6293a45 100644 --- a/build/export.build +++ b/build/export.build @@ -1,5 +1,4 @@ # file : build/export.build -# copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC # license : GNU GPL v3; see accompanying LICENSE file $out_root/ diff --git a/build/export/odb/stub.make b/build/export/odb/stub.make index 0233132..890ae22 100644 --- a/build/export/odb/stub.make +++ b/build/export/odb/stub.make @@ -1,5 +1,4 @@ # file : build/export/odb/stub.make -# copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC # license : GNU GPL v3; see accompanying LICENSE file $(call include-once,$(src_root)/odb/makefile,$(out_root)) diff --git a/build/hxx/hxx-cxx.make b/build/hxx/hxx-cxx.make index fc72963..cdd0f01 100644 --- a/build/hxx/hxx-cxx.make +++ b/build/hxx/hxx-cxx.make @@ -1,5 +1,4 @@ # file : build/hxx/hxx-cxx.make -# copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC # license : GNU GPL v3; see accompanying LICENSE file # Get the C++ configuration (file extensions, and extra CPP options). diff --git a/build/import/cli/LICENSE b/build/import/cli/LICENSE deleted file mode 100644 index f6b2d2b..0000000 --- a/build/import/cli/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -Copyright (c) 2009-2019 Code Synthesis Tools CC. - -Permission is hereby granted, free of charge, to any person obtaining -a copy of this software and associated documentation files (the -"Software"), to deal in the Software without restriction, including -without limitation the rights to use, copy, modify, merge, publish, -distribute, sublicense, and/or sell copies of the Software, and to -permit persons to whom the Software is furnished to do so, subject to -the following conditions: - -The above copyright notice and this permission notice shall be included -in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY -CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, -TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE -SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - diff --git a/build/import/cli/cli-cxx.make b/build/import/cli/cli-cxx.make index 3d01453..9bdf238 100644 --- a/build/import/cli/cli-cxx.make +++ b/build/import/cli/cli-cxx.make @@ -1,5 +1,4 @@ # file : build/import/cli/cli-cxx.make -# copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC # license : MIT; see accompanying LICENSE file # Here we are operating in the importing project's space, not in diff --git a/build/import/cli/configuration-rules.make b/build/import/cli/configuration-rules.make index f13d01b..6355000 100644 --- a/build/import/cli/configuration-rules.make +++ b/build/import/cli/configuration-rules.make @@ -1,5 +1,4 @@ # file : build/import/cli/configuration-rules.make -# copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC # license : MIT; see accompanying LICENSE file $(dcf_root)/import/cli/configuration-dynamic.make: | $(dcf_root)/import/cli/. diff --git a/build/import/cli/configure b/build/import/cli/configure index 944f48c..2a1fde4 100755 --- a/build/import/cli/configure +++ b/build/import/cli/configure @@ -1,7 +1,6 @@ #! /usr/bin/env bash # file : build/import/cli/configure -# copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC # license : MIT; see accompanying LICENSE file diff --git a/build/import/cli/stub.make b/build/import/cli/stub.make index 047ba40..741b371 100644 --- a/build/import/cli/stub.make +++ b/build/import/cli/stub.make @@ -1,5 +1,4 @@ # file : build/import/cli/stub.make -# copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC # license : MIT; see accompanying LICENSE file $(call include-once,$(scf_root)/import/cli/configuration-rules.make,$(dcf_root)) diff --git a/build/import/libcutl/LICENSE b/build/import/libcutl/LICENSE deleted file mode 100644 index 6b90d44..0000000 --- a/build/import/libcutl/LICENSE +++ /dev/null @@ -1,24 +0,0 @@ -Code found in the cutl/details/boost/ directory is distributed under -the Boost Software License (see the accompanying LICENSE file). - -The rest is Copyright (c) 2009-2011 Code Synthesis Tools CC and is -distributed under the following license (MIT License): - -Permission is hereby granted, free of charge, to any person obtaining -a copy of this software and associated documentation files (the -"Software"), to deal in the Software without restriction, including -without limitation the rights to use, copy, modify, merge, publish, -distribute, sublicense, and/or sell copies of the Software, and to -permit persons to whom the Software is furnished to do so, subject to -the following conditions: - -The above copyright notice and this permission notice shall be included -in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY -CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, -TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE -SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/build/import/libcutl/configuration-rules.make b/build/import/libcutl/configuration-rules.make index ac6ae63..4559510 100644 --- a/build/import/libcutl/configuration-rules.make +++ b/build/import/libcutl/configuration-rules.make @@ -1,5 +1,4 @@ # file : build/import/libcutl/configuration-rules.make -# copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC # license : MIT; see accompanying LICENSE file $(dcf_root)/import/libcutl/configuration-dynamic.make: | $(dcf_root)/import/libcutl/. diff --git a/build/import/libcutl/configure b/build/import/libcutl/configure index d2bdd68..5c182e2 100755 --- a/build/import/libcutl/configure +++ b/build/import/libcutl/configure @@ -1,7 +1,6 @@ #! /usr/bin/env bash # file : build/import/libcutl/configure -# copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC # license : MIT; see accompanying LICENSE file diff --git a/build/import/libcutl/stub.make b/build/import/libcutl/stub.make index d831a43..11876f2 100644 --- a/build/import/libcutl/stub.make +++ b/build/import/libcutl/stub.make @@ -1,5 +1,4 @@ # file : build/import/libcutl/stub.make -# copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC # license : MIT; see accompanying LICENSE file $(call include-once,$(scf_root)/import/libcutl/configuration-rules.make,$(dcf_root)) diff --git a/build/import/odb/LICENSE b/build/import/odb/LICENSE deleted file mode 120000 index 5853aae..0000000 --- a/build/import/odb/LICENSE +++ /dev/null @@ -1 +0,0 @@ -../../../LICENSE
\ No newline at end of file diff --git a/build/import/odb/configuration-rules.make b/build/import/odb/configuration-rules.make index ea66763..81d21e1 100644 --- a/build/import/odb/configuration-rules.make +++ b/build/import/odb/configuration-rules.make @@ -1,5 +1,4 @@ # file : build/import/odb/configuration-rules.make -# copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC # license : GNU GPL v3; see accompanying LICENSE file $(dcf_root)/import/odb/configuration-dynamic.make: | $(dcf_root)/import/odb/. diff --git a/build/import/odb/configure b/build/import/odb/configure index a1fcb71..6cb5f9b 100755 --- a/build/import/odb/configure +++ b/build/import/odb/configure @@ -1,7 +1,6 @@ #! /usr/bin/env bash # file : build/import/odb/configure -# copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC # license : GNU GPL v3; see accompanying LICENSE file diff --git a/build/import/odb/hxx-cxx.make b/build/import/odb/hxx-cxx.make index 7cb6f51..987acc0 100644 --- a/build/import/odb/hxx-cxx.make +++ b/build/import/odb/hxx-cxx.make @@ -1,5 +1,4 @@ # file : build/import/odb/hxx-cxx.make -# copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC # license : GNU GPL v3; see accompanying LICENSE file # Here we are operating in the importing project's space, not in odb's. diff --git a/build/import/odb/stub.make b/build/import/odb/stub.make index cc523cf..b2fcebe 100644 --- a/build/import/odb/stub.make +++ b/build/import/odb/stub.make @@ -1,5 +1,4 @@ # file : build/import/odb/stub.make -# copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC # license : GNU GPL v3; see accompanying LICENSE file $(call include-once,$(scf_root)/import/odb/configuration-rules.make,$(dcf_root)) diff --git a/build/root.build b/build/root.build index ec7a4ca..86a02a0 100644 --- a/build/root.build +++ b/build/root.build @@ -1,50 +1,110 @@ # file : build/root.build -# copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC # license : GNU GPL v3; see accompanying LICENSE file -cxx.std = 11 +# This configuration variable can be used to specify the GCC plugin directory +# instead of auto-discovering it with -print-file-name=plugin. Primarily +# useful when dealing with cross-compilation. +# +config [dir_path, config.report.variable=plugin_dir] \ + config.odb.plugin_dir ?= [null] -using cxx +# This configuration variable can be used to specify the GCC g++ executable +# name that will be called by the ODB compiler instead of auto-deriving it +# from config.cxx. Primarily useful when dealing with cross-compilation. +# +config [string, config.report.variable=gxx_name] \ + config.odb.gxx_name ?= [null] -if ($cxx.id != 'gcc') - fail 'ODB compiler can only be built with GCC' +config [bool] config.odb.develop ?= false -# Determine the GCC plugin directory. -# -# If plugin support is disabled, then -print-file-name will print the name we -# have passed (the real plugin directory will always be absolute). -# -# It can also include '..' components (e.g., on Windows) so normalize it for -# good measure. -# -plugin_dir = [dir_path] $process.run($cxx.path -print-file-name=plugin) +develop = $config.odb.develop -if ("$plugin_dir" == plugin) - fail "$recall($cxx.path) does not support plugins" +define cli: file +cli{*}: extension = cli -plugin_dir = $normalize($plugin_dir) +cxx.std = latest + +using cxx hxx{*}: extension = hxx ixx{*}: extension = ixx txx{*}: extension = txx cxx{*}: extension = cxx -if ($cxx.class == 'msvc') -{ +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 -} cxx.poptions =+ "-I$out_root" "-I$src_root" -# Load the cli module but only if it's available. This way a distribution -# that includes pre-generated files can be built without installing cli. -# This is also the reason why we need to explicitly spell out individual -# source file prerequisites instead of using the cli.cxx{} group (it won't -# be there unless the module is configured). -# -using? cli - # Specify the test target for cross-testing. # test.target = $cxx.target + +# Omit the rest during the skeleton load. +# +if ($build.mode != 'skeleton') +{ + if ($cxx.id != 'gcc') + fail 'ODB compiler can only be built with GCC' + + # Determine the GCC plugin directory unless specified explicitly. + # + if ($config.odb.plugin_dir != [null]) + plugin_dir = $config.odb.plugin_dir + else + { + # If plugin support is disabled, then -print-file-name will print the name + # we have passed (the real plugin directory will always be absolute). + # + plugin_dir = [dir_path] $process.run($cxx.path -print-file-name=plugin) + + if ("$plugin_dir" == plugin) + fail "$recall($cxx.path) does not support plugins" + } + + # It can also include '..' components (e.g., on Windows) so normalize it for + # good measure. + # + plugin_dir = $normalize($plugin_dir) + + # Determine the g++ executable name unless specified explicitly. + # + if ($config.odb.gxx_name != [null]) + gxx_name = $config.odb.gxx_name + else + { + # Unless cross-compiling, pass the C++ compiler's recall path as the g++ + # name. + # + # Note that we used to compare complete target triplets but that prooved + # too strict. For example, we may be running on x86_64-apple-darwin17.7.0 + # while the compiler is targeting x86_64-apple-darwin17.3.0. + # + if ($cxx.target.cpu == $build.host.cpu && \ + $cxx.target.system == $build.host.system) + { + gxx_name = $recall($cxx.path) + } + else + fail "g++ executable name must be specified explicitly with \ +config.odb.gxx_name when cross-compiling" + } + + # Extract the copyright notice from the LICENSE file. + # + # Note that cat is a builtin which means this is both portable and fast. + # + copyright = $process.run_regex(cat $src_root/LICENSE, \ + 'Copyright \(c\) (.+)\.', \ + '\1') +} +else +{ + # Set for report. + # + plugin_dir = [null] + gxx_name = [null] +} @@ -1,8 +1,7 @@ # file : buildfile -# copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC # license : GNU GPL v3; see accompanying LICENSE file -./: {*/ -build/ -m4/} doc{GPLv3 INSTALL LICENSE NEWS README} manifest +./: {*/ -build/ -m4/} doc{INSTALL NEWS README} legal{GPLv3 LICENSE} manifest # Don't install tests or the INSTALL file. # diff --git a/configure.ac b/configure.ac index 5a2a70f..1d92980 100644 --- a/configure.ac +++ b/configure.ac @@ -1,5 +1,4 @@ # file : configure.ac -# copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC # license : GNU GPL v3; see accompanying LICENSE file AC_PREREQ(2.60) diff --git a/doc/.gitignore b/doc/.gitignore index 5accfef..9ee2af2 100644 --- a/doc/.gitignore +++ b/doc/.gitignore @@ -1,4 +1,5 @@ -odb.xhtml -odb.1 +/odb.1 +/odb.xhtml + *.ps *.pdf diff --git a/doc/Makefile.am b/doc/Makefile.am index 8d2cbbe..f09e34b 100644 --- a/doc/Makefile.am +++ b/doc/Makefile.am @@ -1,5 +1,4 @@ # file : doc/Makefile.am -# copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC # license : GNU GPL v3; see accompanying LICENSE file dist_ps_DATA = __file__(ps_docs) diff --git a/doc/buildfile b/doc/buildfile index 552fcb0..88f30fc 100644 --- a/doc/buildfile +++ b/doc/buildfile @@ -1,5 +1,4 @@ # file : doc/buildfile -# copyright : Copyright (c) 2009-2019 Code Synthesis Ltd # license : GNU GPL v3; see accompanying LICENSE file define css: doc @@ -8,14 +7,185 @@ css{*}: extension = css define xhtml: doc xhtml{*}: extension = xhtml -./: css{default} +define ps: doc +ps{*}: extension = ps -# @@ BUILD2 TMP: auto-generated and not in git (also odb-manual.* below) +define pdf: doc +pdf{*}: extension = pdf + +define html2ps: file +html2ps{*}: extension = html2ps + +./: css{default} xhtml{manual} doc{*.png} file{*.svg} + +# Man pages. +# + +## Consumption build ($develop == false). +# + +# Use pregenerated versions in the consumption build. +# +./: pregenerated/{man1 xhtml}{*}: include = (!$develop) + +# Distribute pregenerated versions only in the consumption build. +# +pregenerated/{man1 xhtml}{*}: dist = (!$develop) + +# +## + +## Development build ($develop == true). +# + +./: {man1 xhtml}{odb}: include = $develop + +if $develop +{ + doc_version = [string] "$version.major.$version.minor.$version.patch" + if $version.pre_release + doc_version += "-$version.pre_release_string" + + # Let's take the last four-digit number to cover 2000-2021,2022. + # + doc_year = $regex.replace($copyright, '.+[-, ]([0-9][0-9][0-9][0-9]) .+', '\1') + + man_options = -v project="ODB" -v version="$doc_version" \ + -v copyright="$copyright" --suppress-undocumented + + import! [metadata] cli = cli%exe{cli} +} + +# In the development build distribute regenerated versions, remapping their +# locations to the paths of the pregenerated versions (which are only +# distributed in the consumption build; see above). This way we make sure that +# the distributed files are always up-to-date. +# +{man1 xhtml}{odb}: dist = ($develop ? pregenerated/ : false) + +# @@ TMP Note that the project, version, and date variables we are passing to +# cli are currently unused since the respective values are hard-coded +# in the odb-prologue.* files. +# +man1{odb}: ../odb/cli{options} file{odb-prologue.1 odb-epilogue.1} $cli +% +if $develop +{{ + # Use the copyright year to approximate the last authoring date. + # + $cli --generate-man $man_options \ + -v date="January $doc_year" \ + --man-prologue-file $path($<[1]) \ + --man-epilogue-file $path($<[2]) \ + --stdout $path($<[0]) >$path($>) + + # If the result differs from the pregenerated version, copy it over. + # + if! diff $src_base/pregenerated/odb.1 $path($>) >- + cp $path($>) $src_base/pregenerated/odb.1 + end +}} + +xhtml{odb}: ../odb/cli{options} file{odb-prologue.xhtml odb-epilogue.xhtml} $cli +% +if $develop +{{ + $cli --generate-html $man_options \ + --html-prologue-file $path($<[1]) \ + --html-epilogue-file $path($<[2]) \ + --stdout $path($<[0]) >$path($>) + + if! diff $src_base/pregenerated/odb.xhtml $path($>) >- + cp $path($>) $src_base/pregenerated/odb.xhtml + end +}} + +# +## + +# Manual. +# +# This case is slightly more involved because we make the generation of the +# manual's ps/pdf optional and also don't keep the result in the repository. +# Specifically: +# +# 1. In the consumption build we will install/redistribute ps/pdf if present. +# +# 2. In the development build we will generate ps/pdf if we are able to import +# the needed tools, issuing a warning otherwise. + +## Consumption build ($develop == false). +# + +# Use pregenerated versions, if exist, in the consumption build. +# +./: pregenerated/{ps pdf}{*}: include = (!$develop) + +# Distribute pregenerated versions only in the consumption build. +# +pregenerated/{ps pdf}{*}: dist = (!$develop) + +# +## + +## Development build ($develop == true). +# + +html2pdf = false + +if $develop +{ + # Import the html2ps and ps2pdf programs from the system, if available. + # + import? html2ps = html2ps%exe{html2ps} + import? ps2pdf = ps2pdf14%exe{ps2pdf14} + + html2pdf = ($html2ps != [null] && $ps2pdf != [null]) + + if! $html2pdf + warn "html2ps and/or ps2pdf14 are not available, not generating .ps and .pdf documentation" +} + +./: {ps pdf}{odb-manual}: include = $html2pdf + +# In the development build distribute regenerated versions, remapping their +# locations to the paths of the pregenerated versions (which are only +# distributed in the consumption build; see above). This way we make sure that +# the distributed files are always up-to-date. +# +{ps pdf}{odb-manual}: dist = ($html2pdf ? pregenerated/ : false) + +# Note: the pregenerated file may not exist, thus --no-cleanup option is +# required for the cp builtin call. Strictly speaking we don't really need to +# copy them since they are not stored in the repository, but let's do that for +# consistency with the distributed source tree. +# +# @@ TMP Note that manual.{xhtml,html2ps} still have copyright years, ODB +# version, document revision/date, etc hard-coded. # -./: file{odb-*.1} file{odb-*.xhtml} - # {man1 xhtml}{odb} +ps{odb-manual}: {xhtml html2ps}{manual} $html2ps +% +if $html2pdf +{{ + options = + + diag html2ps ($<[0]) + $html2ps $options -f $path($<[1]) -o $path($>) $path($<[0]) + + cp --no-cleanup $path($>) $src_base/pregenerated/odb-manual.ps +}} -./: doc{manual.xhtml} doc{*.png} file{*.svg +*.html2ps} - #doc{odb-manual.ps odb-manual.pdf} +pdf{odb-manual}: ps{odb-manual} $ps2pdf +% +if $html2pdf +{{ + options = -dOptimize=true -dEmbedAllFonts=true -./: file{doc.sh} + diag ps2pdf ($<[0]) + $ps2pdf $options $path($<[0]) $path($>) + + cp --no-cleanup $path($>) $src_base/pregenerated/odb-manual.pdf +}} + +# +## diff --git a/doc/doc.sh b/doc/doc.sh deleted file mode 100755 index a5517af..0000000 --- a/doc/doc.sh +++ /dev/null @@ -1,68 +0,0 @@ -#! /usr/bin/env bash - -version=2.5.0-b.6 -date="$(date +"%B %Y")" - -trap 'exit 1' ERR -set -o errtrace # Trap in functions. - -function info () { echo "$*" 1>&2; } -function error () { info "$*"; exit 1; } - -while [ $# -gt 0 ]; do - case $1 in - --clean) - rm -f odb.xhtml odb.1 - rm -f odb-manual.ps odb-manual.pdf - exit 0 - ;; - *) - error "unexpected $1" - ;; - esac -done - -function compile () # <input-name> <output-name> -{ - local i=$1; shift - local o=$1; shift - - # Use a bash array to handle empty arguments. - # - local ops=() - while [ $# -gt 0 ]; do - ops=("${ops[@]}" "$1") - shift - done - - # --html-suffix .xhtml - cli -I .. -v project="odb" -v version="$version" -v date="$date" \ -"${ops[@]}" --generate-html --stdout \ ---html-prologue-file odb-prologue.xhtml \ ---html-epilogue-file odb-epilogue.xhtml \ -"../odb/$i.cli" >"$o.xhtml" - - # --man-suffix .1 - cli -I .. -v project="odb" -v version="$version" -v date="$date" \ -"${ops[@]}" --generate-man --stdout \ ---man-prologue-file odb-prologue.1 \ ---man-epilogue-file odb-epilogue.1 \ -"../odb/$i.cli" >"$o.1" -} - -compile options odb --suppress-undocumented - -# Manual. -# - -#function compile_doc () -#{ -# html2ps -f doc.html2ps:a4.html2ps -o "$n-a4.ps" "$n.xhtml" -# ps2pdf14 -sPAPERSIZE=a4 -dOptimize=true -dEmbedAllFonts=true "$n-a4.ps" "$n-a4.pdf" -# -# html2ps -f doc.html2ps:letter.html2ps -o "$n-letter.ps" "$n.xhtml" -# ps2pdf14 -sPAPERSIZE=letter -dOptimize=true -dEmbedAllFonts=true "$n-letter.ps" "$n-letter.pdf" -#} - -html2ps -f manual.html2ps -o odb-manual.ps manual.xhtml -ps2pdf14 -dOptimize=true -dEmbedAllFonts=true odb-manual.ps odb-manual.pdf diff --git a/doc/makefile b/doc/makefile index cdccd00..481f22d 100644 --- a/doc/makefile +++ b/doc/makefile @@ -1,5 +1,4 @@ # file : doc/makefile -# copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC # license : GNU GPL v3; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../build/bootstrap.make diff --git a/doc/manual.html2ps b/doc/manual.html2ps index c9ecd02..6acd29d 100644 --- a/doc/manual.html2ps +++ b/doc/manual.html2ps @@ -21,7 +21,7 @@ <h1> </h1> <h1> </h1> </div> - <p>Copyright © 2009-2019 Code Synthesis Tools CC</p> + <p>Copyright © 2009-2020 Code Synthesis Tools CC.</p> <p>Permission is granted to copy, distribute and/or modify this document under the terms of the diff --git a/doc/manual.xhtml b/doc/manual.xhtml index c556283..a308758 100644 --- a/doc/manual.xhtml +++ b/doc/manual.xhtml @@ -5,7 +5,7 @@ <head> <title>C++ Object Persistence with ODB</title> - <meta name="copyright" content="© 2009-2019 Code Synthesis Tools CC"/> + <meta name="copyright" content="© 2009-2020 Code Synthesis Tools CC"/> <meta name="keywords" content="odb,c++,object,persistence,ORM,relational,database,RDBMS,ODBMS,OODBMS"/> <meta name="description" content="C++ Object Persistence with ODB"/> <meta name="revision" content="2.4"/> @@ -281,7 +281,7 @@ for consistency. <div id="titlepage"> <div class="title">C++ Object Persistence with ODB</div> - <p>Copyright © 2009-2019 Code Synthesis Tools CC</p> + <p>Copyright © 2009-2020 Code Synthesis Tools CC.</p> <p>Permission is granted to copy, distribute and/or modify this document under the terms of the @@ -538,6 +538,7 @@ for consistency. <tr><th>14.1.13</th><td><a href="#14.1.13"><code>sectionable</code></a></td></tr> <tr><th>14.1.14</th><td><a href="#14.1.14"><code>deleted</code></a></td></tr> <tr><th>14.1.15</th><td><a href="#14.1.15"><code>bulk</code></a></td></tr> + <tr><th>14.1.16</th><td><a href="#14.1.16"><code>options</code></a></td></tr> </table> </td> </tr> @@ -774,6 +775,7 @@ for consistency. <tr><th>19.5.4</th><td><a href="#19.5.4">Date-Time Format</a></td></tr> <tr><th>19.5.5</th><td><a href="#19.5.5">Timezones</a></td></tr> <tr><th>19.5.6</th><td><a href="#19.5.6"><code>NUMERIC</code> Type Support</a></td></tr> + <tr><th>19.5.7</th><td><a href="#19.5.7">Bulk Operations Support</a></td></tr> </table> </td> </tr> @@ -4577,9 +4579,9 @@ namespace odb <p>The <code>unknown_schema</code> exception is thrown by the <code>odb::schema_catalog</code> class if a schema with the specified name is not found. Refer to <a href="#3.4">Section 3.4, "Database"</a> - for details. The <code>unknown_schema_version</code> exception is - thrown by the <code>schema_catalog</code> functions that deal with - database schema evolution if the passed version is unknow. Refer + for details. The <code>unknown_schema_version</code> exception is thrown + by the <code>schema_catalog</code> functions that deal with database + schema evolution if the passed or current version is unknow. Refer to <a href="#13">Chapter 13, "Database Schema Evolution"</a> for details.</p> @@ -5591,11 +5593,11 @@ for (age = 90; age > 40; age -= 10) template <typename T> prepared_query<T> - lookup_query (const char* name) const; + lookup_query (const char* name); template <typename T, typename P> prepared_query<T> - lookup_query (const char* name, P*& params) const; + lookup_query (const char* name, P*& params); </pre> <p>The <code>cache_query()</code> function caches the passed prepared @@ -5775,6 +5777,11 @@ db.query_factory ( }); </pre> + Note that the <code>database::query_factory()</code> function is not + thread-safe and should be called before starting any threads that may + require this functionality. Normally, all the prepared query factories + are registered as part of the database instance creation. + <!-- CHAPTER --> <hr class="page-break"/> @@ -10890,7 +10897,7 @@ unsigned short v_min = ... unsigned short l_min = ... result r (db.query<employee_leave> ( - "vacation_days > " + query::_val(v_min) + "AND" + "vacation_days > " + query::_val(v_min) + "AND" + "sick_leave_days > " + query::_val(l_min))); t.commit (); @@ -12840,7 +12847,7 @@ namespace odb <ol> <li>The database administrator determines the current database version. If migration is required, then for each migration step (that - is, from one version to the next), he performs the following:</li> + is, from one version to the next), they perform the following:</li> <li>Execute the pre-migration file.</li> @@ -13002,12 +13009,12 @@ t.commit (); process is directed by an external entity, such as a database administrator or a script.</p> - <p>Most <code>schema_catalog</code> functions presented above also - accept the optional schema name argument. If the passed schema - name is not found, then the <code>odb::unknown_schema</code> exception - is thrown. Similarly, functions that accept the schema version - argument will throw the <code>odb::unknown_schema_version</code> exception - if the passed version is invalid. Refer to <a href="#3.14">Section + <p>Most <code>schema_catalog</code> functions presented above also accept + the optional schema name argument. If the passed schema name is not + found, then the <code>odb::unknown_schema</code> exception is + thrown. Similarly, functions that accept the schema version argument will + throw the <code>odb::unknown_schema_version</code> exception if the + passed or current version is invalid. Refer to <a href="#3.14">Section 3.14, "ODB Exceptions"</a> for more information on these exceptions.</p> <p>To illustrate how all these parts fit together, consider the @@ -14359,6 +14366,12 @@ class person <td><a href="#14.1.15">14.1.15</a></td> </tr> + <tr> + <td><code>options</code></td> + <td>database options for a persistent class</td> + <td><a href="#14.1.16">14.1.16</a></td> + </tr> + </table> <h3><a name="14.1.1">14.1.1 <code>table</code></a></h3> @@ -15001,6 +15014,39 @@ class employer is the batch size. For more information on this functionality, refer to <a href="#15.3">Section 15.3, "Bulk Database Operations"</a>.</p> + <h3><a name="14.1.16">14.1.16 <code>options</code></a></h3> + + <p>The <code>options</code> specifier specifies additional table + definition options that should be used for the persistent class. For + example:</p> + + <pre class="cxx"> +#pragma db object options("PARTITION BY RANGE (age)") +class person +{ + ... + + unsigned short age_; +}; + </pre> + + <p>Table definition options for a container table can be specified with + the <code>options</code> data member specifier + (<a href="#14.4.8">Section 14.4.8, "<code>options</code>"</a>). For + example:</p> + + <pre class="cxx"> +#pragma db object +class person +{ + ... + + #pragma db options("PARTITION BY RANGE (index)") + std::vector<std::string> aliases_; +}; + </pre> + + <h2><a name="14.2">14.2 View Type Pragmas</a></h2> <p>A pragma with the <code>view</code> qualifier declares a C++ class @@ -16577,6 +16623,11 @@ class person }; </pre> + <p>Note that if specified for the container member, then instead of the + column definition options it specifies the table definition options for + the container table (<a href="#14.1.16">Section 14.1.16, + "<code>options</code>"</a>).</p> + <p>Options can also be specified on the per-type basis (<a href="#14.3.5">Section 14.3.5, "<code>options</code>"</a>). By default, options are accumulating. That is, the ODB compiler @@ -18705,23 +18756,24 @@ class derived: public string_base <h2><a name="15.3">15.3 Bulk Database Operations</a></h2> - <p>Some database systems supported by ODB provide a mechanism, often - called bulk or batch statement execution, that allows us to execute - the same SQL statement on multiple sets of data at once and with a - single database API call. This often results in significantly - better performance if we need to execute the same statement for a - large number of data sets (thousands to millions).</p> - - <p>ODB translates this mechanism to bulk operations which allow - us to persist, update, or erase a range of objects in the database. - Currently, from all the database systems supported by ODB, only - Oracle and Microsoft SQL Server are capable of bulk operations. - There is also currently no emulation of the bulk API for other - databases nor dynamic multi-database support. As a result, if - you are using dynamic multi-database support, you will need to - "drop down" to static support in order to access the bulk API. - Refer to <a href="#16">Chapter 16, "Multi-Database Support"</a> - for details.</p> + <p>Some database systems supported by ODB provide a mechanism, often called + bulk or batch statement execution, that allows us to execute the same SQL + statement on multiple sets of data at once and with a single database API + call (or equivalent). This often results in significantly better + performance if we need to execute the same statement for a large number + of data sets (thousands to millions).</p> + + <p>ODB translates this mechanism to bulk operations which allow us to + persist, update, or erase a range of objects in the database. Currently, + from all the database systems supported by ODB, only Oracle, Microsoft + SQL Server, and PostgreSQL are capable of bulk operations (but + see <a href="#19.5.7">Section 19.5.7, "Bulk Operations Support"</a> for + PostgreSQL limitations). There is also currently no emulation of the bulk + API for other databases nor dynamic multi-database support. As a result, + if you are using dynamic multi-database support, you will need to "drop + down" to static support in order to access the bulk API. Refer + to <a href="#16">Chapter 16, "Multi-Database Support"</a> for + details.</p> <p>As we will discuss later in this section, bulk operations have complex failure semantics that is dictated by the underlying @@ -18755,15 +18807,15 @@ class person </pre> <p>The single argument to the <code>bulk</code> pragma is the batch - size. The batch size specifies the maximum number of data sets - that should be handled with a single underlying statement execution. - If the range that we want to perform the bulk operation on contains - more objects than the batch size, then ODB will split this operation - into multiple underlying statement executions (batches). To illustrate - this point with an example, suppose we want to persist 53,000 objects - and the batch size is 5,000. ODB will then execute the statement - 11 times, the first 10 times with 5,000 data sets each, and the - last time with the remaining 3,000 data sets.</p> + size. The batch size specifies the maximum number of data sets that + should be handled with a single underlying statement execution (or + equivalent). If the range that we want to perform the bulk operation on + contains more objects than the batch size, then ODB will split this + operation into multiple underlying statement executions (batches). To + illustrate this point with an example, suppose we want to persist 53,000 + objects and the batch size is 5,000. ODB will then execute the statement + 11 times, the first 10 times with 5,000 data sets each, and the last time + with the remaining 3,000 data sets.</p> <p>The commonly used batch sizes are in the 2,000-5,000 range, though smaller or larger batches could provide better performance, @@ -18780,7 +18832,7 @@ class person by using the database prefix, for example:</p> <pre class="cxx"> -#pragma db object mssql:bulk(3000) oracle:bulk(4000) +#pragma db object mssql:bulk(3000) oracle:bulk(4000) pgsql:bulk(2000) class person { ... @@ -18911,11 +18963,11 @@ db.erase<person> (ids.begin (), ids.end ()); <p>Conceptually, a bulk operation is equivalent to performing the corresponding non-bulk version in a loop, except when it comes to the - failure semantics. Both databases that currently are capable of - bulk operations (Oracle and SQL Server) do not stop when a data + failure semantics. Some databases that currently are capable of bulk + operations (specifically, Oracle and SQL Server) do not stop when a data set in a batch fails (for example, because of a unique constraint - violation). Instead, they continue executing subsequent data - sets until every element in the batch has been attempted. The + violation). Instead, they continue executing subsequent data sets until + every element in the batch has been attempted. The <code>continue_failed</code> argument in the bulk functions listed above specifies whether ODB should extend this behavior and continue with subsequent batches if the one it has tried to execute has failed @@ -19042,20 +19094,19 @@ multiple exceptions, 4 elements attempted, 2 failed: [3] 1: ORA-00001: unique constraint (ODB_TEST.person_last_i) violated </pre> - <p>Both databases that currently are capable of bulk operations return - a total count of affected rows rather than individual counts for - each data set. This limitation prevents ODB from being able to - always determine which elements in the batch haven't affected - any rows and, for the update and erase operations, translate - this to the <code>object_not_persistent</code> exceptions. As - a result, if some elements in the batch haven't affected any - rows and ODB is unable to determine exactly which ones, it will mark - all the elements in this batch as "maybe not persistent". That - is, it will insert the <code>object_not_persistent</code> exception - and set the <code>maybe</code> flag for every position in the - batch. The diagnostics string returned by <code>what()</code> - will also reflect this situation, for example (assuming batch - size of 3):</p> + <p>Some databases that currently are capable of bulk operations + (specifically, Oracle and SQL Server) return a total count of affected + rows rather than individual counts for each data set. This limitation + prevents ODB from being able to always determine which elements in the + batch haven't affected any rows and, for the update and erase operations, + translate this to the <code>object_not_persistent</code> exceptions. As a + result, if some elements in the batch haven't affected any rows and ODB + is unable to determine exactly which ones, it will mark all the elements + in this batch as "maybe not persistent". That is, it will insert + the <code>object_not_persistent</code> exception and set + the <code>maybe</code> flag for every position in the batch. The + diagnostics string returned by <code>what()</code> will also reflect this + situation, for example (assuming batch size of 3):</p> <pre class="terminal"> multiple exceptions, 4 elements attempted, 4 failed: @@ -22848,6 +22899,13 @@ SHOW integer_datetimes ones, as discussed in <a href="#14.8">Section 14.8, "Database Type Mapping Pragmas"</a>.</p> + <h3><a name="19.5.7">19.5.7 Bulk Operations Support</a></h3> + + <p>Support for bulk operations (<a href="#15.3">Section 15.3, "Bulk + Database Operations"</a>) requires PostgreSQL client library + (<code>libpq</code>) version 14 or later and PostgreSQL server + version 7.4 or later.</p> + <h2><a name="19.6">19.6 PostgreSQL Index Definitions</a></h2> diff --git a/doc/odb-epilogue.1 b/doc/odb-epilogue.1 index aa80feb..e331b23 100644 --- a/doc/odb-epilogue.1 +++ b/doc/odb-epilogue.1 @@ -144,7 +144,7 @@ Send bug reports to the odb-users@codesynthesis.com mailing list. .\" COPYRIGHT .\" .SH COPYRIGHT -Copyright (c) 2009-2019 Code Synthesis Tools CC. +Copyright (c) $copyright$. Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, diff --git a/doc/odb-epilogue.xhtml b/doc/odb-epilogue.xhtml index fda5ec6..9eba558 100644 --- a/doc/odb-epilogue.xhtml +++ b/doc/odb-epilogue.xhtml @@ -111,7 +111,7 @@ </div> <div id="footer"> - © 2009-2019 <a href="http://www.codesynthesis.com">Code Synthesis Tools CC</a> + Copyright © $copyright$. <div id="terms"> Permission is granted to copy, distribute and/or modify this diff --git a/doc/odb-prologue.xhtml b/doc/odb-prologue.xhtml index 95aa706..b8cc694 100644 --- a/doc/odb-prologue.xhtml +++ b/doc/odb-prologue.xhtml @@ -4,7 +4,7 @@ <head> <title>ODB 2.4.0 Compiler Command Line Manual</title> - <meta name="copyright" content="© 2009-2019 Code Synthesis Tools CC"/> + <meta name="copyright" content="© $copyright$"/> <meta name="keywords" content="odb,object,relational,mapping,compiler,c++"/> <meta name="description" content="ODB Compiler Command Line Manual"/> diff --git a/doc/pregenerated/odb.1 b/doc/pregenerated/odb.1 new file mode 100644 index 0000000..42d81d0 --- /dev/null +++ b/doc/pregenerated/odb.1 @@ -0,0 +1,799 @@ +.\" Process this file with +.\" groff -man -Tascii odb.1 +.\" +.TH ODB 1 "February 2015" "ODB 2.4.0" +.SH NAME +odb \- object-relational mapping (ORM) compiler for C++ +.\" +.\" +.\" +.\"-------------------------------------------------------------------- +.SH SYNOPSIS +.\"-------------------------------------------------------------------- +.B odb +.B [ +.I options +.B ] +.I file +.B [ +.IR file... +.B ] +.\" +.\" +.\" +.\"-------------------------------------------------------------------- +.SH DESCRIPTION +.\"-------------------------------------------------------------------- +Given a set of C++ classes in a header file, +.B odb +generates C++ code that allows you to persist, query, and update objects +of these classes in a relational database (RDBMS). The relational +database that the generated code should target is specified with the +required +.B --database +option (see below). + + +For an input file in the form +.B name.hxx +(other file extensions can be used instead of +.BR .hxx ), +in the single-database mode (the default), the generated C++ files by +default have the following names: +.B name-odb.hxx +(header file), +.B name-odb.ixx +(inline file), and +.B name-odb.cxx +(source file). Additionally, if the +.B --generate-schema +option is specified and the +.B sql +schema format is requested (see +.BR --schema-format ), +the +.B name.sql +database schema file is generated. If the +.B separate +schema format is requested, the database creation code is generated into +the separate +.B name-schema.cxx +file. + + +In the multi-database mode (see the +.B --multi-database +option below), the generated files corresponding to the +.B common +database have the same names as in the single-database mode. For other +databases, the file names include the database name: +.BR name-odb-\fIdb\fB.hxx , +.BR name-odb-\fIdb\fB.ixx , +.BR name-odb-\fIdb\fB.cxx , +.BR name-\fIdb\fB.sql , +and +.B name-schema-\fIdb\fB.cxx +(where +.I db +is the database name). +.\" +.\" +.\" +.\"-------------------------------------------------------------------- +.SH OPTIONS +.\"-------------------------------------------------------------------- +.IP "\fB--help\fR" +Print usage information and exit\. +.IP "\fB--version\fR" +Print version and exit\. +.IP "\fB-I\fR \fIdir\fR" +Add \fIdir\fR to the beginning of the list of directories to be searched for +included header files\. +.IP "\fB-D\fR \fIname\fR[=\fIdef\fR]" +Define macro \fIname\fR with definition \fIdef\fR\. If definition is omitted, +define \fIname\fR to be 1\. +.IP "\fB-U\fR \fIname\fR" +Cancel any previous definitions of macro \fIname\fR, either built-in or +provided with the \fB-D\fR option\. +.IP "\fB--database\fR|\fB-d\fR \fIdb\fR" +Generate code for the \fIdb\fR database\. Valid values are \fBmssql\fR, +\fBmysql\fR, \fBoracle\fR, \fBpgsql\fR, \fBsqlite\fR, and \fBcommon\fR +(multi-database mode only)\. +.IP "\fB--multi-database\fR|\fB-m\fR \fItype\fR" +Enable multi-database support and specify its type\. Valid values for this +option are \fBstatic\fR and \fBdynamic\fR\. + +In the multi-database mode, options that determine the kind (for example, +\fB--schema-format\fR), names (for example, \fB--odb-file-suffix\fR), or +content (for example, prologue and epilogue options) of the output files can +be prefixed with the database name followed by a colon, for example, +\fBmysql:value\fR\. This restricts the value of such an option to only apply +to generated files corresponding to this database\. +.IP "\fB--default-database\fR \fIdb\fR" +When static multi-database support is used, specify the database that should +be made the default\. When dynamic multi-database support is used, +\fBcommon\fR is always made the default database\. +.IP "\fB--generate-query\fR|\fB-q\fR" +Generate query support code\. Without this support you cannot use views and +can only load objects via their ids\. +.IP "\fB--generate-prepared\fR" +Generate prepared query execution support code\. +.IP "\fB--omit-unprepared\fR" +Omit un-prepared (once-off) query execution support code\. +.IP "\fB--generate-session\fR|\fB-e\fR" +Generate session support code\. With this option session support will be +enabled by default for all the persistent classes except those for which it +was explicitly disabled using the \fBdb session\fR pragma\. +.IP "\fB--generate-schema\fR|\fB-s\fR" +Generate the database schema\. The database schema contains SQL statements +that create database tables necessary to store persistent classes defined in +the file being compiled\. Note that by applying this schema, all the existing +information stored in such tables will be lost\. + +Depending on the database being used (\fB--database\fR option), the schema is +generated either as a standalone SQL file or embedded into the generated C++ +code\. By default the SQL file is generated for the MySQL, PostgreSQL, Oracle, +and Microsoft SQL Server databases and the schema is embedded into the C++ +code for the SQLite database\. Use the \fB--schema-format\fR option to alter +the default schema format\. + +If database schema evolution support is enabled (that is, the object model +version is specified), then this option also triggers the generation of +database schema migration statements, again either as standalong SQL files or +embedded into the generated C++ code\. You can suppress the generation of +schema migration statements by specifying the \fB--suppress-migration\fR +option\. +.IP "\fB--generate-schema-only\fR" +Generate only the database schema\. Note that this option is only valid when +generating schema as a standalone SQL file (see \fB--schema-format\fR for +details)\. +.IP "\fB--suppress-migration\fR" +Suppress the generation of database schema migration statements\. +.IP "\fB--suppress-schema-version\fR" +Suppress the generation of schema version table\. If you specify this option +then you are also expected to manually specify the database schema version and +migration state at runtime using the \fBodb::database::schema_version()\fR +function\. +.IP "\fB--schema-version-table\fR \fIname\fR" +Specify the alternative schema version table name instead of the default +\fBschema_version\fR\. If you specify this option then you are also expected +to manually specify the schema version table name at runtime using the +\fBodb::database::schema_version_table()\fR function\. The table name can be +qualified\. +.IP "\fB--schema-format\fR \fIformat\fR" +Generate the database schema in the specified format\. Pass \fBsql\fR as +\fIformat\fR to generate the database schema as a standalone SQL file or pass +\fBembedded\fR to embed the schema into the generated C++ code\. The +\fBseparate\fR value is similar to \fBembedded\fR except the schema creation +code is generated into a separate C++ file (\fBname-schema\.cxx\fR by +default)\. This value is primarily useful if you want to place the schema +creation functionality into a separate program or library\. Repeat this option +to generate the same database schema in multiple formats\. +.IP "\fB--omit-drop\fR" +Omit \fBDROP\fR statements from the generated database schema\. +.IP "\fB--omit-create\fR" +Omit \fBCREATE\fR statements from the generated database schema\. +.IP "\fB--schema-name\fR \fIname\fR" +Use \fIname\fR as the database schema name\. Schema names are primarily used +to distinguish between multiple embedded schemas in the schema catalog\. They +are not to be confused with database schemas (database namespaces) which are +specified with the \fB--schema\fR option\. If this option is not specified, +the empty name, which is the default schema name, is used\. +.IP "\fB--fkeys-deferrable-mode\fR \fIm\fR" +Use constraint checking mode \fIm\fR in foreign keys generated for object +relationships\. Valid values for this option are \fBnot_deferrable\fR, +\fBimmediate\fR, and \fBdeferred\fR (default)\. MySQL and SQL Server do not +support deferrable foreign keys and for these databases such keys are +generated commented out\. Other foreign keys generated by the ODB compiler +(such as the ones used to support containers and polymorphic hierarchies) are +always generated as not deferrable\. + +Note also that if you use either \fBnot_deferrable\fR or \fBimmediate\fR mode, +then the order in which you persist, update, and erase objects within a +transaction becomes important\. +.IP "\fB--default-pointer\fR \fIptr\fR" +Use \fIptr\fR as the default pointer for persistent objects and views\. +Objects and views that do not have a pointer assigned with the \fBdb +pointer\fR pragma will use this pointer by default\. The value of this option +can be '\fB*\fR' which denotes the raw pointer and is the default, or +qualified name of a smart pointer class template, for example, +\fBstd::shared_ptr\fR\. In the latter case, the ODB compiler constructs the +object or view pointer by adding a single template argument of the object or +view type to the qualified name, for example \fBstd::shared_ptr<object>\fR\. +The ODB runtime uses object and view pointers to return, and, in case of +objects, pass and cache dynamically allocated instances of object and view +types\. + +Except for the raw pointer and the standard smart pointers defined in the +\fB<memory>\fR header file, you are expected to include the definition of the +default pointer at the beginning of the generated header file\. There are two +common ways to achieve this: you can either include the necessary header in +the file being compiled or you can use the \fB--hxx-prologue\fR option to add +the necessary \fB#include\fR directive to the generated code\. +.IP "\fB--session-type\fR \fItype\fR" +Use \fItype\fR as the alternative session type instead of the default +\fBodb::session\fR\. This option can be used to specify a custom session +implementation to be use by the persistent classes\. Note that you will also +need to include the definition of the custom session type into the generated +header file\. This is normally achieved with the \fB--hxx-prologue*\fR +options\. +.IP "\fB--profile\fR|\fB-p\fR \fIname\fR" +Specify a profile that should be used during compilation\. A profile is an +options file\. The ODB compiler first looks for a database-specific version +with the name constructed by appending the +\fB-\fR\fIdatabase\fR\fB\.options\fR suffix to \fIname\fR, where +\fIdatabase\fR is the database name as specified with the \fB--database\fR +option\. If this file is not found, then the ODB compiler looks for a +database-independant version with the name constructed by appending just the +\fB\.options\fR suffix\. + +The profile options files are searched for in the same set of directories as +C++ headers included with the \fB#include <\.\.\.>\fR directive (built-in +paths plus those specified with the \fB-I\fR options)\. The options file is +first searched for in the directory itself and then in its \fBodb/\fR +subdirectory\. + +For the format of the options file refer to the \fB--options-file\fR option +below\. You can repeat this option to specify more than one profile\. +.IP "\fB--at-once\fR" +Generate code for all the input files as well as for all the files that they +include at once\. The result is a single set of source/schema files that +contain all the generated code\. If more than one input file is specified +together with this option, then the \fB--input-name\fR option must also be +specified in order to provide the base name for the output files\. In this +case, the directory part of such a base name is used as the location of the +combined file\. This can be important for the \fB#include\fR directive +resolution\. +.IP "\fB--schema\fR \fIschema\fR" +Specify a database schema (database namespace) that should be assigned to the +persistent classes in the file being compiled\. Database schemas are not to be +confused with database schema names (schema catalog names) which are specified +with the \fB--schema-name\fR option\. +.IP "\fB--export-symbol\fR \fIsymbol\fR" +Insert \fIsymbol\fR in places where DLL export/import control statements +(\fB__declspec(dllexport/dllimport)\fR) are necessary\. See also the +\fB--extern-symbol\fR option below\. +.IP "\fB--extern-symbol\fR \fIsymbol\fR" +If \fIsymbol\fR is defined, insert it in places where a template instantiation +must be declared \fBextern\fR\. This option is normally used together with +\fB--export-symbol\fR when both multi-database support and queries are +enabled\. +.IP "\fB--std\fR \fIversion\fR" +Specify the C++ standard that should be used during compilation\. Valid values +are \fBc++98\fR (default), \fBc++11\fR, \fBc++14\fR, \fBc++17\fR, and +\fBc++20\fR\. +.IP "\fB--warn-hard-add\fR" +Warn about hard-added data members\. +.IP "\fB--warn-hard-delete\fR" +Warn about hard-deleted data members and persistent classes\. +.IP "\fB--warn-hard\fR" +Warn about both hard-added and hard-deleted data members and persistent +classes\. +.IP "\fB--output-dir\fR|\fB-o\fR \fIdir\fR" +Write the generated files to \fIdir\fR instead of the current directory\. +.IP "\fB--input-name\fR \fIname\fR" +Use \fIname\fR instead of the input file to derive the names of the generated +files\. If the \fB--at-once\fR option is specified, then the directory part of +\fIname\fR is used as the location of the combined file\. Refer to the +\fB--at-once\fR option for details\. +.IP "\fB--changelog\fR \fIfile\fR" +Read/write changelog from/to \fIfile\fR instead of the default changelog +file\. The default changelog file name is derived from the input file name and +it is placed into the same directory as the input file\. Note that the +\fB--output-dir\fR option does not affect the changelog file location\. In +other words, by default, the changelog file is treated as another input rather +than output even though the ODB compiler may modify it\. Use the +\fB--changelog-in\fR and \fB--changelog-out\fR options to specify different +input and output chaneglog files\. +.IP "\fB--changelog-in\fR \fIfile\fR" +Read changelog from \fIfile\fR instead of the default changelog file\. If this +option is specified, then you must also specify the output chanegelog file +with \fB--changelog-out\fR\. +.IP "\fB--changelog-out\fR \fIfile\fR" +Write changelog to \fIfile\fR instead of the default changelog file\. If this +option is specified, then you must also specify the input chanegelog file with +\fB--changelog-in\fR\. +.IP "\fB--changelog-dir\fR \fIdir\fR" +Use \fIdir\fR instead of the input file directory as the changelog file +directory\. This directory is also added to changelog files specified with the +\fB--changelog\fR, \fB--changelog-in\fR, and \fB--changelog-in\fR options +unless they are absolute paths\. +.IP "\fB--init-changelog\fR" +Force re-initialization of the changelog even if one exists (all the existing +change history will be lost)\. This option is primarily useful for automated +testing\. +.IP "\fB--odb-file-suffix\fR \fIsuffix\fR" +Use \fIsuffix\fR to construct the names of the generated C++ files\. In the +single-database mode the default value for this option is \fB-odb\fR\. In the +multi-database mode it is \fB-odb\fR for the files corresponding to the +\fBcommon\fR database and \fB-odb-\fR\fIdb\fR\fR (where \fIdb\fR is the +database name) for other databases\. +.IP "\fB--sql-file-suffix\fR \fIsuffix\fR" +Use \fIsuffix\fR to construct the name of the generated schema SQL file\. In +the single-database mode by default no suffix is used\. In the multi-database +mode the default value for this option is \fB-\fR\fIdb\fR\fR (where \fIdb\fR +is the database name)\. +.IP "\fB--schema-file-suffix\fR \fIsuffix\fR" +Use \fIsuffix\fR to construct the name of the generated schema C++ source +file\. In the single-database mode the default value for this option is +\fB-schema\fR\. In the multi-database mode it is \fB-schema-\fR\fIdb\fR\fR +(where \fIdb\fR is the database name)\. See the \fB--schema-format\fR option +for details\. +.IP "\fB--changelog-file-suffix\fR \fIsfx\fR" +Use \fIsfx\fR to construct the name of the changelog file\. In the +single-database mode by default no suffix is used\. In the multi-database mode +the default value for this option is \fB-\fR\fIdb\fR\fR (where \fIdb\fR is the +database name)\. +.IP "\fB--hxx-suffix\fR \fIsuffix\fR" +Use \fIsuffix\fR instead of the default \fB\.hxx\fR to construct the name of +the generated C++ header file\. +.IP "\fB--ixx-suffix\fR \fIsuffix\fR" +Use \fIsuffix\fR instead of the default \fB\.ixx\fR to construct the name of +the generated C++ inline file\. +.IP "\fB--cxx-suffix\fR \fIsuffix\fR" +Use \fIsuffix\fR instead of the default \fB\.cxx\fR to construct the name of +the generated C++ source file\. +.IP "\fB--sql-suffix\fR \fIsuffix\fR" +Use \fIsuffix\fR instead of the default \fB\.sql\fR to construct the name of +the generated database schema file\. +.IP "\fB--changelog-suffix\fR \fIsuffix\fR" +Use \fIsuffix\fR instead of the default \fB\.xml\fR to construct the name of +the changelog file\. +.IP "\fB--hxx-prologue\fR \fItext\fR" +Insert \fItext\fR at the beginning of the generated C++ header file\. +.IP "\fB--ixx-prologue\fR \fItext\fR" +Insert \fItext\fR at the beginning of the generated C++ inline file\. +.IP "\fB--cxx-prologue\fR \fItext\fR" +Insert \fItext\fR at the beginning of the generated C++ source file\. +.IP "\fB--schema-prologue\fR \fItext\fR" +Insert \fItext\fR at the beginning of the generated schema C++ source file\. +.IP "\fB--sql-prologue\fR \fItext\fR" +Insert \fItext\fR at the beginning of the generated database schema file\. +.IP "\fB--migration-prologue\fR \fItext\fR" +Insert \fItext\fR at the beginning of the generated database migration file\. +.IP "\fB--sql-interlude\fR \fItext\fR" +Insert \fItext\fR after all the \fBDROP\fR and before any \fBCREATE\fR +statements in the generated database schema file\. +.IP "\fB--hxx-epilogue\fR \fItext\fR" +Insert \fItext\fR at the end of the generated C++ header file\. +.IP "\fB--ixx-epilogue\fR \fItext\fR" +Insert \fItext\fR at the end of the generated C++ inline file\. +.IP "\fB--cxx-epilogue\fR \fItext\fR" +Insert \fItext\fR at the end of the generated C++ source file\. +.IP "\fB--schema-epilogue\fR \fItext\fR" +Insert \fItext\fR at the end of the generated schema C++ source file\. +.IP "\fB--sql-epilogue\fR \fItext\fR" +Insert \fItext\fR at the end of the generated database schema file\. +.IP "\fB--migration-epilogue\fR \fItext\fR" +Insert \fItext\fR at the end of the generated database migration file\. +.IP "\fB--hxx-prologue-file\fR \fIfile\fR" +Insert the content of \fIfile\fR at the beginning of the generated C++ header +file\. +.IP "\fB--ixx-prologue-file\fR \fIfile\fR" +Insert the content of \fIfile\fR at the beginning of the generated C++ inline +file\. +.IP "\fB--cxx-prologue-file\fR \fIfile\fR" +Insert the content of \fIfile\fR at the beginning of the generated C++ source +file\. +.IP "\fB--schema-prologue-file\fR \fIfile\fR" +Insert the content of \fIfile\fR at the beginning of the generated schema C++ +source file\. +.IP "\fB--sql-prologue-file\fR \fIfile\fR" +Insert the content of \fIfile\fR at the beginning of the generated database +schema file\. +.IP "\fB--migration-prologue-file\fR \fIf\fR" +Insert the content of file \fIf\fR at the beginning of the generated database +migration file\. +.IP "\fB--sql-interlude-file\fR \fIfile\fR" +Insert the content of \fIfile\fR after all the \fBDROP\fR and before any +\fBCREATE\fR statements in the generated database schema file\. +.IP "\fB--hxx-epilogue-file\fR \fIfile\fR" +Insert the content of \fIfile\fR at the end of the generated C++ header file\. +.IP "\fB--ixx-epilogue-file\fR \fIfile\fR" +Insert the content of \fIfile\fR at the end of the generated C++ inline file\. +.IP "\fB--cxx-epilogue-file\fR \fIfile\fR" +Insert the content of \fIfile\fR at the end of the generated C++ source file\. +.IP "\fB--schema-epilogue-file\fR \fIfile\fR" +Insert the content of \fIfile\fR at the end of the generated schema C++ source +file\. +.IP "\fB--sql-epilogue-file\fR \fIfile\fR" +Insert the content of \fIfile\fR at the end of the generated database schema +file\. +.IP "\fB--migration-epilogue-file\fR \fIf\fR" +Insert the content of file \fIf\fR at the end of the generated database +migration file\. +.IP "\fB--odb-prologue\fR \fItext\fR" +Compile \fItext\fR before the input header file\. This option allows you to +add additional declarations, such as custom traits specializations, to the ODB +compilation process\. +.IP "\fB--odb-prologue-file\fR \fIfile\fR" +Compile \fIfile\fR contents before the input header file\. Prologue files are +compiled after all the prologue text fragments (\fB--odb-prologue\fR option)\. +.IP "\fB--odb-epilogue\fR \fItext\fR" +Compile \fItext\fR after the input header file\. This option allows you to add +additional declarations, such as custom traits specializations, to the ODB +compilation process\. +.IP "\fB--odb-epilogue-file\fR \fIfile\fR" +Compile \fIfile\fR contents after the input header file\. Epilogue files are +compiled after all the epilogue text fragments (\fB--odb-epilogue\fR option)\. +.IP "\fB--table-prefix\fR \fIprefix\fR" +Add \fIprefix\fR to table names and, for databases that have global index +and/or foreign key names, to those names as well\. The prefix is added to both +names that were specified with the \fBdb table\fR and \fBdb index\fR pragmas +and those that were automatically derived from class and data member names\. +If you require a separator, such as an underscore, between the prefix and the +name, then you should include it into the prefix value\. +.IP "\fB--index-suffix\fR \fIsuffix\fR" +Use \fIsuffix\fR instead of the default \fB_i\fR to construct index names\. +The suffix is only added to names that were automatically derived from data +member names\. If you require a separator, such as an underscore, between the +name and the suffix, then you should include it into the suffix value\. +.IP "\fB--fkey-suffix\fR \fIsuffix\fR" +Use \fIsuffix\fR instead of the default \fB_fk\fR to construct foreign key +names\. If you require a separator, such as an underscore, between the name +and the suffix, then you should include it into the suffix value\. +.IP "\fB--sequence-suffix\fR \fIsuffix\fR" +Use \fIsuffix\fR instead of the default \fB_seq\fR to construct sequence +names\. If you require a separator, such as an underscore, between the name +and the suffix, then you should include it into the suffix value\. +.IP "\fB--sql-name-case\fR \fIcase\fR" +Convert all automatically-derived SQL names to upper or lower case\. Valid +values for this option are \fBupper\fR and \fBlower\fR\. +.IP "\fB--table-regex\fR \fIregex\fR" +Add \fIregex\fR to the list of regular expressions that is used to transform +automatically-derived table names\. See the SQL NAME TRANSFORMATIONS section +below for details\. +.IP "\fB--column-regex\fR \fIregex\fR" +Add \fIregex\fR to the list of regular expressions that is used to transform +automatically-derived column names\. See the SQL NAME TRANSFORMATIONS section +below for details\. +.IP "\fB--index-regex\fR \fIregex\fR" +Add \fIregex\fR to the list of regular expressions that is used to transform +automatically-derived index names\. See the SQL NAME TRANSFORMATIONS section +below for details\. +.IP "\fB--fkey-regex\fR \fIregex\fR" +Add \fIregex\fR to the list of regular expressions that is used to transform +automatically-derived foreign key names\. See the SQL NAME TRANSFORMATIONS +section below for details\. +.IP "\fB--sequence-regex\fR \fIregex\fR" +Add \fIregex\fR to the list of regular expressions that is used to transform +automatically-derived sequence names\. See the SQL NAME TRANSFORMATIONS +section below for details\. +.IP "\fB--statement-regex\fR \fIregex\fR" +Add \fIregex\fR to the list of regular expressions that is used to transform +automatically-derived prepared statement names\. See the SQL NAME +TRANSFORMATIONS section below for details\. +.IP "\fB--sql-name-regex\fR \fIregex\fR" +Add \fIregex\fR to the list of regular expressions that is used to transform +all automatically-derived SQL names\. See the SQL NAME TRANSFORMATIONS section +below for details\. +.IP "\fB--sql-name-regex-trace\fR" +Trace the process of applying regular expressions specified with the SQL name +\fB--*-regex\fR options\. Use this option to find out why your regular +expressions don't do what you expected them to do\. +.IP "\fB--accessor-regex\fR \fIregex\fR" +Add \fIregex\fR to the list of regular expressions used to transform data +member names to function names when searching for a suitable accessor +function\. The argument to this option is a Perl-like regular expression in +the form \fB/\fR\fIpattern\fR\fB/\fR\fIreplacement\fR\fB/\fR\fR\. Any +character can be used as a delimiter instead of '\fB/\fR' and the delimiter +can be escaped inside \fIpattern\fR and \fIreplacement\fR with a backslash +(\fB\e\fR)\. You can specify multiple regular expressions by repeating this +option\. + +All the regular expressions are tried in the order specified and the first +expression that produces a suitable accessor function is used\. Each +expression is tried twice: first with the actual member name and then with the +member's \fIpublic name\fR which is obtained by removing the common member +name decorations, such as leading and trailing underscores, the \fBm_\fR +prefix, etc\. The ODB compiler also includes a number of built-in expressions +for commonly used accessor names, such as \fBget_foo\fR, \fBgetFoo\fR, +\fBgetfoo\fR, and just \fBfoo\fR\. The built-in expressions are tried last\. + +As an example, the following expression transforms data members with public +names in the form \fBfoo\fR to accessor names in the form \fBGetFoo\fR: + +\fB/(\.+)/Get\eu$1/\fR + +See also the REGEX AND SHELL QUOTING section below\. +.IP "\fB--accessor-regex-trace\fR" +Trace the process of applying regular expressions specified with the +\fB--accessor-regex\fR option\. Use this option to find out why your regular +expressions don't do what you expected them to do\. +.IP "\fB--modifier-regex\fR \fIregex\fR" +Add \fIregex\fR to the list of regular expressions used to transform data +member names to function names when searching for a suitable modifier +function\. The argument to this option is a Perl-like regular expression in +the form \fB/\fR\fIpattern\fR\fB/\fR\fIreplacement\fR\fB/\fR\fR\. Any +character can be used as a delimiter instead of '\fB/\fR' and the delimiter +can be escaped inside \fIpattern\fR and \fIreplacement\fR with a backslash +(\fB\e\fR)\. You can specify multiple regular expressions by repeating this +option\. + +All the regular expressions are tried in the order specified and the first +expression that produces a suitable modifier function is used\. Each +expression is tried twice: first with the actual member name and then with the +member's \fIpublic name\fR which is obtained by removing the common member +name decorations, such as leading and trailing underscores, the \fBm_\fR +prefix, etc\. The ODB compiler also includes a number of built-in expressions +for commonly used modifier names, such as \fBset_foo\fR, \fBsetFoo\fR, +\fBsetfoo\fR, and just \fBfoo\fR\. The built-in expressions are tried last\. + +As an example, the following expression transforms data members with public +names in the form \fBfoo\fR to modifier names in the form \fBSetFoo\fR: + +\fB/(\.+)/Set\eu$1/\fR + +See also the REGEX AND SHELL QUOTING section below\. +.IP "\fB--modifier-regex-trace\fR" +Trace the process of applying regular expressions specified with the +\fB--modifier-regex\fR option\. Use this option to find out why your regular +expressions don't do what you expected them to do\. +.IP "\fB--include-with-brackets\fR" +Use angle brackets (<>) instead of quotes ("") in the generated \fB#include\fR +directives\. +.IP "\fB--include-prefix\fR \fIprefix\fR" +Add \fIprefix\fR to the generated \fB#include\fR directive paths\. +.IP "\fB--include-regex\fR \fIregex\fR" +Add \fIregex\fR to the list of regular expressions used to transform generated +\fB#include\fR directive paths\. The argument to this option is a Perl-like +regular expression in the form +\fB/\fR\fIpattern\fR\fB/\fR\fIreplacement\fR\fB/\fR\fR\. Any character can be +used as a delimiter instead of '\fB/\fR' and the delimiter can be escaped +inside \fIpattern\fR and \fIreplacement\fR with a backslash (\fB\e\fR)\. You +can specify multiple regular expressions by repeating this option\. All the +regular expressions are tried in the order specified and the first expression +that matches is used\. + +As an example, the following expression transforms include paths in the form +\fBfoo/bar-odb\.h\fR to paths in the form \fBfoo/generated/bar-odb\.h\fR: + +\fB%foo/(\.+)-odb\.h%foo/generated/$1-odb\.h%\fR + +See also the REGEX AND SHELL QUOTING section below\. +.IP "\fB--include-regex-trace\fR" +Trace the process of applying regular expressions specified with the +\fB--include-regex\fR option\. Use this option to find out why your regular +expressions don't do what you expected them to do\. +.IP "\fB--guard-prefix\fR \fIprefix\fR" +Add \fIprefix\fR to the generated header inclusion guards\. The prefix is +transformed to upper case and characters that are illegal in a preprocessor +macro name are replaced with underscores\. +.IP "\fB--show-sloc\fR" +Print the number of generated physical source lines of code (SLOC)\. +.IP "\fB--sloc-limit\fR \fInum\fR" +Check that the number of generated physical source lines of code (SLOC) does +not exceed \fInum\fR\. +.IP "\fB--options-file\fR \fIfile\fR" +Read additional options from \fIfile\fR\. Each option should appear on a +separate line optionally followed by space or equal sign (\fB=\fR) and an +option value\. Empty lines and lines starting with \fB#\fR are ignored\. +Option values can be enclosed in double (\fB"\fR) or single (\fB'\fR) quotes +to preserve leading and trailing whitespaces as well as to specify empty +values\. If the value itself contains trailing or leading quotes, enclose it +with an extra pair of quotes, for example \fB'"x"'\fR\. Non-leading and +non-trailing quotes are interpreted as being part of the option value\. + +The semantics of providing options in a file is equivalent to providing the +same set of options in the same order on the command line at the point where +the \fB--options-file\fR option is specified except that the shell escaping +and quoting is not required\. Repeat this option to specify more than one +options file\. +.IP "\fB-x\fR \fIoption\fR" +Pass \fIoption\fR to the underlying C++ compiler (\fBg++\fR)\. The +\fIoption\fR value that doesn't start with '\fB-\fR' is considered the +\fBg++\fR executable name\. +.IP "\fB-v\fR" +Print the commands executed to run the stages of compilation\. +.IP "\fB--trace\fR" +Trace the compilation process\. +.IP "\fB--mysql-engine\fR \fIengine\fR" +Use \fIengine\fR instead of the default \fBInnoDB\fR in the generated database +schema file\. For more information on the storage engine options see the MySQL +documentation\. If you would like to use the database-default engine, pass +\fBdefault\fR as the value for this option\. +.IP "\fB--sqlite-override-null\fR" +Make all columns in the generated database schema allow \fBNULL\fR values\. +This is primarily useful in schema migration since SQLite does not support +dropping of columns\. By making all columns \fBNULL\fR we can later "delete" +them by setting their values to \fBNULL\fR\. Note that this option overrides +even the \fBnot_null\fR pragma\. +.IP "\fB--sqlite-lax-auto-id\fR" +Do not force monotonically increasing automatically-assigned object ids\. In +this mode the generated database schema omits the \fBAUTOINCREMENT\fR keyword +which results in faster object persistence but may lead to +automatically-assigned ids not being in a strictly ascending order\. Refer to +the SQLite documentation for details\. +.IP "\fB--pgsql-server-version\fR \fIver\fR" +Specify the minimum PostgreSQL server version with which the generated C++ +code and schema will be used\. This information is used to enable +version-specific optimizations and workarounds in the generated C++ code and +schema\. The version must be in the \fImajor\fR\fB\.\fR\fIminor\fR\fR form, +for example, \fB9\.1\fR\. If this option is not specified, then \fB7\.4\fR or +later is assumed\. +.IP "\fB--oracle-client-version\fR \fIver\fR" +Specify the minimum Oracle client library (OCI) version with which the +generated C++ code will be linked\. This information is used to enable +version-specific optimizations and workarounds in the generated C++ code\. The +version must be in the \fImajor\fR\fB\.\fR\fIminor\fR\fR form, for example, +\fB11\.2\fR\. If this option is not specified, then \fB10\.1\fR or later is +assumed\. +.IP "\fB--oracle-warn-truncation\fR" +Warn about SQL names that are longer than 30 characters and are therefore +truncated\. Note that during database schema generation +(\fB--generate-schema\fR) ODB detects when such truncations lead to name +conflicts and issues diagnostics even without this option specified\. +.IP "\fB--mssql-server-version\fR \fIver\fR" +Specify the minimum SQL Server server version with which the generated C++ +code and schema will be used\. This information is used to enable +version-specific optimizations and workarounds in the generated C++ code and +schema\. The version must be in the \fImajor\fR\fB\.\fR\fIminor\fR\fR form, +for example, \fB9\.0\fR (SQL Server 2005), \fB10\.5\fR (2008R2), or +\fB11\.0\fR (2012)\. If this option is not specified, then \fB10\.0\fR (SQL +Server 2008) or later is assumed\. +.IP "\fB--mssql-short-limit\fR \fIsize\fR" +Specify the short data size limit\. If a character, national character, or +binary data type has a maximum length (in bytes) less than or equal to this +limit, then it is treated as \fIshort data\fR, otherwise it is \fIlong +data\fR\. For short data ODB pre-allocates an intermediate buffer of the +maximum size and binds it directly to a parameter or result column\. This way +the underlying API (ODBC) can read/write directly from/to this buffer\. In the +case of long data, the data is read/written in chunks using the +\fBSQLGetData()\fR/\fBSQLPutData()\fR ODBC functions\. While the long data +approach reduces the amount of memory used by the application, it may require +greater CPU resources\. The default short data limit is 1024 bytes\. When +setting a custom short data limit, make sure that it is sufficiently large so +that no object id in the application is treated as long data\. +.\" +.\" SQL NAME TRANSFORMATIONS +.\" +.SH SQL NAME TRANSFORMATIONS +The ODB compiler provides a number of mechanisms for transforming +automatically-derived SQL names, such as tables, columns, etc., +to match a specific naming convention. At the higher level, we can +add a prefix to global names (tables and, for some databases, +indexes and/or foreign keys) with the +.B --table-prefix +option. Similarly, we can specify custom suffixes for automatically-derived +index +.RB ( --index-suffix ; +default is +.BR _i ), +foreign key +.RB ( --fkey-suffix ; +default is +.BR _fk ), +and sequence +.RB ( --sequence-suffix ; +default is +.BR _seq ) +names. Finally, we can also convert all the names to upper or lower +case with the +.B --sql-name-case +option (valid values are +.B upper +and +.BR lower ). + +At the lower level we can specify a set of regular expressions to +implement arbitrary transformations of the automatically-derived SQL +names. If we want a particular regular expression only to apply to +a specific name, for example, table or column, then we use one of the +.B --\fIkind\fB-regex +options, where +.I kind +can be +.BR table , +.BR column , +.BR index , +.BR fkey , +.BR sequence , +or +.BR statement . +On the other hand, if we want our regular expressions to apply to all SQL +names, then we use the +.B --sql-name-regex +option. + +The interaction between the higher and lower level transformations +is as follows. Prefixes and suffixes are added first. Then the +regular expression transformations are applied. Finally, if requested, +the name is converted to upper or lower case. Note also that all of +these transformations except for +.B --table-prefix +only apply to automatically-derived names. In other words, if a table, +column, etc., name was explicitly specified with a pragma, then it +is used as is, without applying any (except for the table prefix) +transformations. + +The value for the +.B --*-regex +options is a Perl-like regular expression in the form +.BI / pattern / replacement /\fR. +Any character can be used as a delimiter instead of +.B / +and the delimiter can be escaped inside +.I pattern +and +.I replacement +with a backslash +.RB ( \e ). +You can also specify multiple regular expressions by repeating these +options. + +All the regular expressions are tried in the order specified with the +name-specific expressions (for example, +.BR --table-regex) +tried first followed by the generic expressions +.RB ( --sql-name-regex ). +The first expression that matches is used. + +As an example, consider a regular expression that transforms a class +name in the form +.B CFoo +to a table name in the form +.BR FOO: + +.B --table-regex '/C(.+)/\eU$1/' + +As a more interesting example, consider the transformation of class +names that follow the upper camel case convention (for example, +.BR FooBar ) +to table names that follow the underscore-separated, all upper case +convention (for example, +.BR FOO_BAR ). +For this case we have to use separate expressions to handle one-word, +two-word, etc., names: + +.B --table-regex '/([A-z][a-z]+)/\eU$1/' + +.B --table-regex '/([A-z][a-z]+)([A-z][a-z]+)/\eU$1_$2/' + +See also the REGEX AND SHELL QUOTING section below. +.\" +.\" REGEX AND SHELL QUOTING +.\" +.SH REGEX AND SHELL QUOTING +When entering a regular expression argument in the shell command line +it is often necessary to use quoting (enclosing the argument in " " +or ' ') in order to prevent the shell from interpreting certain +characters, for example, spaces as argument separators and $ as +variable expansions. + +Unfortunately it is hard to achieve this in a manner that is portable +across POSIX shells, such as those found on GNU/Linux and UNIX, and +Windows shell. For example, if you use " " for quoting you will get +a wrong result with POSIX shells if your expression contains $. The +standard way of dealing with this on POSIX systems is to use ' ' +instead. Unfortunately, Windows shell does not remove ' ' from +arguments when they are passed to applications. As a result you may +have to use ' ' for POSIX and " " for Windows ($ is not treated as +a special character on Windows). + +Alternatively, you can save regular expression options into a file, +one option per line, and use this file with the +.B --options-file +option. With this approach you don't need to worry about shell quoting. +.\" +.\" DIAGNOSTICS +.\" +.SH DIAGNOSTICS +If the input file is not valid C++, +.B odb +will issue diagnostic messages to STDERR and exit with non-zero exit code. +.\" +.\" BUGS +.\" +.SH BUGS +Send bug reports to the odb-users@codesynthesis.com mailing list. +.\" +.\" COPYRIGHT +.\" +.SH COPYRIGHT +Copyright (c) 2009-2023 Code Synthesis Tools CC. + +Permission is granted to copy, distribute and/or modify this +document under the terms of the GNU Free Documentation License, +version 1.2; with no Invariant Sections, no Front-Cover Texts and +no Back-Cover Texts. Copy of the license can be obtained from +http://www.codesynthesis.com/licenses/fdl-1.3.txt diff --git a/doc/pregenerated/odb.xhtml b/doc/pregenerated/odb.xhtml new file mode 100644 index 0000000..0a9785c --- /dev/null +++ b/doc/pregenerated/odb.xhtml @@ -0,0 +1,978 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en"> + +<head> + <title>ODB 2.4.0 Compiler Command Line Manual</title> + + <meta name="copyright" content="© 2009-2023 Code Synthesis Tools CC"/> + <meta name="keywords" content="odb,object,relational,mapping,compiler,c++"/> + <meta name="description" content="ODB Compiler Command Line Manual"/> + + <link rel="stylesheet" type="text/css" href="default.css" /> + +<style type="text/css"> + + #synopsis { + list-style-type: none; + } + + #synopsis li { + padding-top : 0.0em; + padding-bottom : 0.0em; + } + + .options { + margin: 1em 0 1em 0; + } + + .options dt { + margin: 1em 0 0 0; + } + + .options dd { + margin: .1em 0 0 4.5em; + } + +</style> +</head> + +<body> +<div id="container"> + <div id="content"> + + <h1>NAME</h1> + + <p>odb - object-relational mapping (ORM) compiler for C++</p> + + <h1>SYNOPSIS</h1> + + <dl id="synopsis"> + <dt><code><b>odb</b> [<i>options</i>] <i>file</i> [<i>file</i>...]</code></dt> + </dl> + + <h1>DESCRIPTION</h1> + + <p>Given a set of C++ classes in a header file, <code><b>odb</b></code> + generates C++ code that allows you to persist, query, and update objects + of these classes in a relational database (RDBMS). The relational + database that the generated code should target is specified with the + required <code><b>--database</b></code> option (see below).</p> + + <p>For an input file in the form <code><b>name.hxx</b></code> (other + file extensions can be used instead of <code><b>.hxx</b></code>), + in the single-database mode (the default), the generated C++ files + by default have the following names: + <code><b>name-odb.hxx</b></code> (header file), + <code><b>name-odb.ixx</b></code> (inline file), and + <code><b>name-odb.cxx</b></code> (source file). + + Additionally, if the <code><b>--generate-schema</b></code> option is + specified and the <code><b>sql</b></code> schema format is requested (see + <code><b>--schema-format</b></code>), the <code><b>name.sql</b></code> + database schema file is generated. If the <code><b>separate</b></code> + schema format is requested, the database creation code is generated + into the separate <code><b>name-schema.cxx</b></code> file.</p> + + <p>In the multi-database mode (see the <code><b>--multi-database</b></code> + option below), the generated files corresponding to the + <code><b>common</b></code> database have the same names as in the + single-database mode. For other databases, the file names include + the database name: + <code><b>name-odb-</b><i>db</i><b>.hxx</b></code>, + <code><b>name-odb-</b><i>db</i><b>.ixx</b></code>, + <code><b>name-odb-</b><i>db</i><b>.cxx</b></code>, + <code><b>name-</b><i>db</i><b>.sql</b></code>, and + <code><b>name-schema-</b><i>db</i><b>.cxx</b></code> + (where <code><i>db</i></code> is the database name).</p> + + <h1>OPTIONS</h1> + <dl class="options"> + <dt><code><b>--help</b></code></dt> + <dd>Print usage information and exit.</dd> + + <dt><code><b>--version</b></code></dt> + <dd>Print version and exit.</dd> + + <dt><code><b>-I</b></code> <code><i>dir</i></code></dt> + <dd>Add <code><i>dir</i></code> to the beginning of the list of + directories to be searched for included header files.</dd> + + <dt><code><b>-D</b></code> <code><i>name</i></code>[=<code><i>def</i></code>]</dt> + <dd>Define macro <code><i>name</i></code> with definition + <code><i>def</i></code>. If definition is omitted, define + <code><i>name</i></code> to be 1.</dd> + + <dt><code><b>-U</b></code> <code><i>name</i></code></dt> + <dd>Cancel any previous definitions of macro <code><i>name</i></code>, + either built-in or provided with the <code><b>-D</b></code> option.</dd> + + <dt><code><b>--database</b></code>|<code><b>-d</b></code> <code><i>db</i></code></dt> + <dd>Generate code for the <code><i>db</i></code> database. Valid values + are <code><b>mssql</b></code>, <code><b>mysql</b></code>, + <code><b>oracle</b></code>, <code><b>pgsql</b></code>, + <code><b>sqlite</b></code>, and <code><b>common</b></code> (multi-database + mode only).</dd> + + <dt><code><b>--multi-database</b></code>|<code><b>-m</b></code> <code><i>type</i></code></dt> + <dd>Enable multi-database support and specify its type. Valid values for + this option are <code><b>static</b></code> and + <code><b>dynamic</b></code>. + + <p>In the multi-database mode, options that determine the kind (for + example, <code><b>--schema-format</b></code>), names (for example, + <code><b>--odb-file-suffix</b></code>), or content (for example, prologue + and epilogue options) of the output files can be prefixed with the + database name followed by a colon, for example, + <code><b>mysql:value</b></code>. This restricts the value of such an + option to only apply to generated files corresponding to this + database.</p></dd> + + <dt><code><b>--default-database</b></code> <code><i>db</i></code></dt> + <dd>When static multi-database support is used, specify the database that + should be made the default. When dynamic multi-database support is used, + <code><b>common</b></code> is always made the default database.</dd> + + <dt><code><b>--generate-query</b></code>|<code><b>-q</b></code></dt> + <dd>Generate query support code. Without this support you cannot use views + and can only load objects via their ids.</dd> + + <dt><code><b>--generate-prepared</b></code></dt> + <dd>Generate prepared query execution support code.</dd> + + <dt><code><b>--omit-unprepared</b></code></dt> + <dd>Omit un-prepared (once-off) query execution support code.</dd> + + <dt><code><b>--generate-session</b></code>|<code><b>-e</b></code></dt> + <dd>Generate session support code. With this option session support will + be enabled by default for all the persistent classes except those for + which it was explicitly disabled using the <code><b>db session</b></code> + pragma.</dd> + + <dt><code><b>--generate-schema</b></code>|<code><b>-s</b></code></dt> + <dd>Generate the database schema. The database schema contains SQL + statements that create database tables necessary to store persistent + classes defined in the file being compiled. Note that by applying this + schema, all the existing information stored in such tables will be lost. + + <p>Depending on the database being used (<code><b>--database</b></code> + option), the schema is generated either as a standalone SQL file or + embedded into the generated C++ code. By default the SQL file is generated + for the MySQL, PostgreSQL, Oracle, and Microsoft SQL Server databases and + the schema is embedded into the C++ code for the SQLite database. Use the + <code><b>--schema-format</b></code> option to alter the default schema + format.</p> + + <p>If database schema evolution support is enabled (that is, the object + model version is specified), then this option also triggers the generation + of database schema migration statements, again either as standalong SQL + files or embedded into the generated C++ code. You can suppress the + generation of schema migration statements by specifying the + <code><b>--suppress-migration</b></code> option.</p></dd> + + <dt><code><b>--generate-schema-only</b></code></dt> + <dd>Generate only the database schema. Note that this option is only valid + when generating schema as a standalone SQL file (see + <code><b>--schema-format</b></code> for details).</dd> + + <dt><code><b>--suppress-migration</b></code></dt> + <dd>Suppress the generation of database schema migration statements.</dd> + + <dt><code><b>--suppress-schema-version</b></code></dt> + <dd>Suppress the generation of schema version table. If you specify this + option then you are also expected to manually specify the database schema + version and migration state at runtime using the + <code><b>odb::database::schema_version()</b></code> function.</dd> + + <dt><code><b>--schema-version-table</b></code> <code><i>name</i></code></dt> + <dd>Specify the alternative schema version table name instead of the + default <code><b>schema_version</b></code>. If you specify this option + then you are also expected to manually specify the schema version table + name at runtime using the + <code><b>odb::database::schema_version_table()</b></code> function. The + table name can be qualified.</dd> + + <dt><code><b>--schema-format</b></code> <code><i>format</i></code></dt> + <dd>Generate the database schema in the specified format. Pass + <code><b>sql</b></code> as <code><i>format</i></code> to generate the + database schema as a standalone SQL file or pass + <code><b>embedded</b></code> to embed the schema into the generated C++ + code. The <code><b>separate</b></code> value is similar to + <code><b>embedded</b></code> except the schema creation code is generated + into a separate C++ file (<code><b>name-schema.cxx</b></code> by default). + This value is primarily useful if you want to place the schema creation + functionality into a separate program or library. Repeat this option to + generate the same database schema in multiple formats.</dd> + + <dt><code><b>--omit-drop</b></code></dt> + <dd>Omit <code><b>DROP</b></code> statements from the generated database + schema.</dd> + + <dt><code><b>--omit-create</b></code></dt> + <dd>Omit <code><b>CREATE</b></code> statements from the generated database + schema.</dd> + + <dt><code><b>--schema-name</b></code> <code><i>name</i></code></dt> + <dd>Use <code><i>name</i></code> as the database schema name. Schema names + are primarily used to distinguish between multiple embedded schemas in the + schema catalog. They are not to be confused with database schemas + (database namespaces) which are specified with the + <code><b>--schema</b></code> option. If this option is not specified, the + empty name, which is the default schema name, is used.</dd> + + <dt><code><b>--fkeys-deferrable-mode</b></code> <code><i>m</i></code></dt> + <dd>Use constraint checking mode <code><i>m</i></code> in foreign keys + generated for object relationships. Valid values for this option are + <code><b>not_deferrable</b></code>, <code><b>immediate</b></code>, and + <code><b>deferred</b></code> (default). MySQL and SQL Server do not + support deferrable foreign keys and for these databases such keys are + generated commented out. Other foreign keys generated by the ODB compiler + (such as the ones used to support containers and polymorphic hierarchies) + are always generated as not deferrable. + + <p>Note also that if you use either <code><b>not_deferrable</b></code> or + <code><b>immediate</b></code> mode, then the order in which you persist, + update, and erase objects within a transaction becomes important.</p></dd> + + <dt><code><b>--default-pointer</b></code> <code><i>ptr</i></code></dt> + <dd>Use <code><i>ptr</i></code> as the default pointer for persistent + objects and views. Objects and views that do not have a pointer assigned + with the <code><b>db pointer</b></code> pragma will use this pointer by + default. The value of this option can be '<code><b>*</b></code>' which + denotes the raw pointer and is the default, or qualified name of a smart + pointer class template, for example, <code><b>std::shared_ptr</b></code>. + In the latter case, the ODB compiler constructs the object or view pointer + by adding a single template argument of the object or view type to the + qualified name, for example + <code><b>std::shared_ptr<object></b></code>. The ODB runtime uses + object and view pointers to return, and, in case of objects, pass and + cache dynamically allocated instances of object and view types. + + <p>Except for the raw pointer and the standard smart pointers defined in + the <code><b><memory></b></code> header file, you are expected to + include the definition of the default pointer at the beginning of the + generated header file. There are two common ways to achieve this: you can + either include the necessary header in the file being compiled or you can + use the <code><b>--hxx-prologue</b></code> option to add the necessary + <code><b>#include</b></code> directive to the generated code.</p></dd> + + <dt><code><b>--session-type</b></code> <code><i>type</i></code></dt> + <dd>Use <code><i>type</i></code> as the alternative session type instead + of the default <code><b>odb::session</b></code>. This option can be used + to specify a custom session implementation to be use by the persistent + classes. Note that you will also need to include the definition of the + custom session type into the generated header file. This is normally + achieved with the <code><b>--hxx-prologue*</b></code> options.</dd> + + <dt><code><b>--profile</b></code>|<code><b>-p</b></code> <code><i>name</i></code></dt> + <dd>Specify a profile that should be used during compilation. A profile is + an options file. The ODB compiler first looks for a database-specific + version with the name constructed by appending the + <code><b>-</b></code><code><i>database</i></code><code><b>.options</b></code> + suffix to <code><i>name</i></code>, where <code><i>database</i></code> is + the database name as specified with the <code><b>--database</b></code> + option. If this file is not found, then the ODB compiler looks for a + database-independant version with the name constructed by appending just + the <code><b>.options</b></code> suffix. + + <p>The profile options files are searched for in the same set of + directories as C++ headers included with the <code><b>#include + <...></b></code> directive (built-in paths plus those specified with + the <code><b>-I</b></code> options). The options file is first searched + for in the directory itself and then in its <code><b>odb/</b></code> + subdirectory.</p> + + <p>For the format of the options file refer to the + <code><b>--options-file</b></code> option below. You can repeat this + option to specify more than one profile.</p></dd> + + <dt><code><b>--at-once</b></code></dt> + <dd>Generate code for all the input files as well as for all the files + that they include at once. The result is a single set of source/schema + files that contain all the generated code. If more than one input file is + specified together with this option, then the + <code><b>--input-name</b></code> option must also be specified in order to + provide the base name for the output files. In this case, the directory + part of such a base name is used as the location of the combined file. + This can be important for the <code><b>#include</b></code> directive + resolution.</dd> + + <dt><code><b>--schema</b></code> <code><i>schema</i></code></dt> + <dd>Specify a database schema (database namespace) that should be assigned + to the persistent classes in the file being compiled. Database schemas are + not to be confused with database schema names (schema catalog names) which + are specified with the <code><b>--schema-name</b></code> option.</dd> + + <dt><code><b>--export-symbol</b></code> <code><i>symbol</i></code></dt> + <dd>Insert <code><i>symbol</i></code> in places where DLL export/import + control statements (<code><b>__declspec(dllexport/dllimport)</b></code>) + are necessary. See also the <code><b>--extern-symbol</b></code> option + below.</dd> + + <dt><code><b>--extern-symbol</b></code> <code><i>symbol</i></code></dt> + <dd>If <code><i>symbol</i></code> is defined, insert it in places where a + template instantiation must be declared <code><b>extern</b></code>. This + option is normally used together with <code><b>--export-symbol</b></code> + when both multi-database support and queries are enabled.</dd> + + <dt><code><b>--std</b></code> <code><i>version</i></code></dt> + <dd>Specify the C++ standard that should be used during compilation. Valid + values are <code><b>c++98</b></code> (default), <code><b>c++11</b></code>, + <code><b>c++14</b></code>, <code><b>c++17</b></code>, and + <code><b>c++20</b></code>.</dd> + + <dt><code><b>--warn-hard-add</b></code></dt> + <dd>Warn about hard-added data members.</dd> + + <dt><code><b>--warn-hard-delete</b></code></dt> + <dd>Warn about hard-deleted data members and persistent classes.</dd> + + <dt><code><b>--warn-hard</b></code></dt> + <dd>Warn about both hard-added and hard-deleted data members and + persistent classes.</dd> + + <dt><code><b>--output-dir</b></code>|<code><b>-o</b></code> <code><i>dir</i></code></dt> + <dd>Write the generated files to <code><i>dir</i></code> instead of the + current directory.</dd> + + <dt><code><b>--input-name</b></code> <code><i>name</i></code></dt> + <dd>Use <code><i>name</i></code> instead of the input file to derive the + names of the generated files. If the <code><b>--at-once</b></code> option + is specified, then the directory part of <code><i>name</i></code> is used + as the location of the combined file. Refer to the + <code><b>--at-once</b></code> option for details.</dd> + + <dt><code><b>--changelog</b></code> <code><i>file</i></code></dt> + <dd>Read/write changelog from/to <code><i>file</i></code> instead of the + default changelog file. The default changelog file name is derived from + the input file name and it is placed into the same directory as the input + file. Note that the <code><b>--output-dir</b></code> option does not + affect the changelog file location. In other words, by default, the + changelog file is treated as another input rather than output even though + the ODB compiler may modify it. Use the <code><b>--changelog-in</b></code> + and <code><b>--changelog-out</b></code> options to specify different input + and output chaneglog files.</dd> + + <dt><code><b>--changelog-in</b></code> <code><i>file</i></code></dt> + <dd>Read changelog from <code><i>file</i></code> instead of the default + changelog file. If this option is specified, then you must also specify + the output chanegelog file with <code><b>--changelog-out</b></code>.</dd> + + <dt><code><b>--changelog-out</b></code> <code><i>file</i></code></dt> + <dd>Write changelog to <code><i>file</i></code> instead of the default + changelog file. If this option is specified, then you must also specify + the input chanegelog file with <code><b>--changelog-in</b></code>.</dd> + + <dt><code><b>--changelog-dir</b></code> <code><i>dir</i></code></dt> + <dd>Use <code><i>dir</i></code> instead of the input file directory as the + changelog file directory. This directory is also added to changelog files + specified with the <code><b>--changelog</b></code>, + <code><b>--changelog-in</b></code>, and <code><b>--changelog-in</b></code> + options unless they are absolute paths.</dd> + + <dt><code><b>--init-changelog</b></code></dt> + <dd>Force re-initialization of the changelog even if one exists (all the + existing change history will be lost). This option is primarily useful for + automated testing.</dd> + + <dt><code><b>--odb-file-suffix</b></code> <code><i>suffix</i></code></dt> + <dd>Use <code><i>suffix</i></code> to construct the names of the generated + C++ files. In the single-database mode the default value for this option + is <code><b>-odb</b></code>. In the multi-database mode it is + <code><b>-odb</b></code> for the files corresponding to the + <code><b>common</b></code> database and <code><b>-odb-</b><i>db</i></code> + (where <code><i>db</i></code> is the database name) for other + databases.</dd> + + <dt><code><b>--sql-file-suffix</b></code> <code><i>suffix</i></code></dt> + <dd>Use <code><i>suffix</i></code> to construct the name of the generated + schema SQL file. In the single-database mode by default no suffix is used. + In the multi-database mode the default value for this option is + <code><b>-</b><i>db</i></code> (where <code><i>db</i></code> is the + database name).</dd> + + <dt><code><b>--schema-file-suffix</b></code> <code><i>suffix</i></code></dt> + <dd>Use <code><i>suffix</i></code> to construct the name of the generated + schema C++ source file. In the single-database mode the default value for + this option is <code><b>-schema</b></code>. In the multi-database mode it + is <code><b>-schema-</b><i>db</i></code> (where <code><i>db</i></code> is + the database name). See the <code><b>--schema-format</b></code> option for + details.</dd> + + <dt><code><b>--changelog-file-suffix</b></code> <code><i>sfx</i></code></dt> + <dd>Use <code><i>sfx</i></code> to construct the name of the changelog + file. In the single-database mode by default no suffix is used. In the + multi-database mode the default value for this option is + <code><b>-</b><i>db</i></code> (where <code><i>db</i></code> is the + database name).</dd> + + <dt><code><b>--hxx-suffix</b></code> <code><i>suffix</i></code></dt> + <dd>Use <code><i>suffix</i></code> instead of the default + <code><b>.hxx</b></code> to construct the name of the generated C++ header + file.</dd> + + <dt><code><b>--ixx-suffix</b></code> <code><i>suffix</i></code></dt> + <dd>Use <code><i>suffix</i></code> instead of the default + <code><b>.ixx</b></code> to construct the name of the generated C++ inline + file.</dd> + + <dt><code><b>--cxx-suffix</b></code> <code><i>suffix</i></code></dt> + <dd>Use <code><i>suffix</i></code> instead of the default + <code><b>.cxx</b></code> to construct the name of the generated C++ source + file.</dd> + + <dt><code><b>--sql-suffix</b></code> <code><i>suffix</i></code></dt> + <dd>Use <code><i>suffix</i></code> instead of the default + <code><b>.sql</b></code> to construct the name of the generated database + schema file.</dd> + + <dt><code><b>--changelog-suffix</b></code> <code><i>suffix</i></code></dt> + <dd>Use <code><i>suffix</i></code> instead of the default + <code><b>.xml</b></code> to construct the name of the changelog file.</dd> + + <dt><code><b>--hxx-prologue</b></code> <code><i>text</i></code></dt> + <dd>Insert <code><i>text</i></code> at the beginning of the generated C++ + header file.</dd> + + <dt><code><b>--ixx-prologue</b></code> <code><i>text</i></code></dt> + <dd>Insert <code><i>text</i></code> at the beginning of the generated C++ + inline file.</dd> + + <dt><code><b>--cxx-prologue</b></code> <code><i>text</i></code></dt> + <dd>Insert <code><i>text</i></code> at the beginning of the generated C++ + source file.</dd> + + <dt><code><b>--schema-prologue</b></code> <code><i>text</i></code></dt> + <dd>Insert <code><i>text</i></code> at the beginning of the generated + schema C++ source file.</dd> + + <dt><code><b>--sql-prologue</b></code> <code><i>text</i></code></dt> + <dd>Insert <code><i>text</i></code> at the beginning of the generated + database schema file.</dd> + + <dt><code><b>--migration-prologue</b></code> <code><i>text</i></code></dt> + <dd>Insert <code><i>text</i></code> at the beginning of the generated + database migration file.</dd> + + <dt><code><b>--sql-interlude</b></code> <code><i>text</i></code></dt> + <dd>Insert <code><i>text</i></code> after all the <code><b>DROP</b></code> + and before any <code><b>CREATE</b></code> statements in the generated + database schema file.</dd> + + <dt><code><b>--hxx-epilogue</b></code> <code><i>text</i></code></dt> + <dd>Insert <code><i>text</i></code> at the end of the generated C++ header + file.</dd> + + <dt><code><b>--ixx-epilogue</b></code> <code><i>text</i></code></dt> + <dd>Insert <code><i>text</i></code> at the end of the generated C++ inline + file.</dd> + + <dt><code><b>--cxx-epilogue</b></code> <code><i>text</i></code></dt> + <dd>Insert <code><i>text</i></code> at the end of the generated C++ source + file.</dd> + + <dt><code><b>--schema-epilogue</b></code> <code><i>text</i></code></dt> + <dd>Insert <code><i>text</i></code> at the end of the generated schema C++ + source file.</dd> + + <dt><code><b>--sql-epilogue</b></code> <code><i>text</i></code></dt> + <dd>Insert <code><i>text</i></code> at the end of the generated database + schema file.</dd> + + <dt><code><b>--migration-epilogue</b></code> <code><i>text</i></code></dt> + <dd>Insert <code><i>text</i></code> at the end of the generated database + migration file.</dd> + + <dt><code><b>--hxx-prologue-file</b></code> <code><i>file</i></code></dt> + <dd>Insert the content of <code><i>file</i></code> at the beginning of the + generated C++ header file.</dd> + + <dt><code><b>--ixx-prologue-file</b></code> <code><i>file</i></code></dt> + <dd>Insert the content of <code><i>file</i></code> at the beginning of the + generated C++ inline file.</dd> + + <dt><code><b>--cxx-prologue-file</b></code> <code><i>file</i></code></dt> + <dd>Insert the content of <code><i>file</i></code> at the beginning of the + generated C++ source file.</dd> + + <dt><code><b>--schema-prologue-file</b></code> <code><i>file</i></code></dt> + <dd>Insert the content of <code><i>file</i></code> at the beginning of the + generated schema C++ source file.</dd> + + <dt><code><b>--sql-prologue-file</b></code> <code><i>file</i></code></dt> + <dd>Insert the content of <code><i>file</i></code> at the beginning of the + generated database schema file.</dd> + + <dt><code><b>--migration-prologue-file</b></code> <code><i>f</i></code></dt> + <dd>Insert the content of file <code><i>f</i></code> at the beginning of + the generated database migration file.</dd> + + <dt><code><b>--sql-interlude-file</b></code> <code><i>file</i></code></dt> + <dd>Insert the content of <code><i>file</i></code> after all the + <code><b>DROP</b></code> and before any <code><b>CREATE</b></code> + statements in the generated database schema file.</dd> + + <dt><code><b>--hxx-epilogue-file</b></code> <code><i>file</i></code></dt> + <dd>Insert the content of <code><i>file</i></code> at the end of the + generated C++ header file.</dd> + + <dt><code><b>--ixx-epilogue-file</b></code> <code><i>file</i></code></dt> + <dd>Insert the content of <code><i>file</i></code> at the end of the + generated C++ inline file.</dd> + + <dt><code><b>--cxx-epilogue-file</b></code> <code><i>file</i></code></dt> + <dd>Insert the content of <code><i>file</i></code> at the end of the + generated C++ source file.</dd> + + <dt><code><b>--schema-epilogue-file</b></code> <code><i>file</i></code></dt> + <dd>Insert the content of <code><i>file</i></code> at the end of the + generated schema C++ source file.</dd> + + <dt><code><b>--sql-epilogue-file</b></code> <code><i>file</i></code></dt> + <dd>Insert the content of <code><i>file</i></code> at the end of the + generated database schema file.</dd> + + <dt><code><b>--migration-epilogue-file</b></code> <code><i>f</i></code></dt> + <dd>Insert the content of file <code><i>f</i></code> at the end of the + generated database migration file.</dd> + + <dt><code><b>--odb-prologue</b></code> <code><i>text</i></code></dt> + <dd>Compile <code><i>text</i></code> before the input header file. This + option allows you to add additional declarations, such as custom traits + specializations, to the ODB compilation process.</dd> + + <dt><code><b>--odb-prologue-file</b></code> <code><i>file</i></code></dt> + <dd>Compile <code><i>file</i></code> contents before the input header + file. Prologue files are compiled after all the prologue text fragments + (<code><b>--odb-prologue</b></code> option).</dd> + + <dt><code><b>--odb-epilogue</b></code> <code><i>text</i></code></dt> + <dd>Compile <code><i>text</i></code> after the input header file. This + option allows you to add additional declarations, such as custom traits + specializations, to the ODB compilation process.</dd> + + <dt><code><b>--odb-epilogue-file</b></code> <code><i>file</i></code></dt> + <dd>Compile <code><i>file</i></code> contents after the input header file. + Epilogue files are compiled after all the epilogue text fragments + (<code><b>--odb-epilogue</b></code> option).</dd> + + <dt><code><b>--table-prefix</b></code> <code><i>prefix</i></code></dt> + <dd>Add <code><i>prefix</i></code> to table names and, for databases that + have global index and/or foreign key names, to those names as well. The + prefix is added to both names that were specified with the <code><b>db + table</b></code> and <code><b>db index</b></code> pragmas and those that + were automatically derived from class and data member names. If you + require a separator, such as an underscore, between the prefix and the + name, then you should include it into the prefix value.</dd> + + <dt><code><b>--index-suffix</b></code> <code><i>suffix</i></code></dt> + <dd>Use <code><i>suffix</i></code> instead of the default + <code><b>_i</b></code> to construct index names. The suffix is only added + to names that were automatically derived from data member names. If you + require a separator, such as an underscore, between the name and the + suffix, then you should include it into the suffix value.</dd> + + <dt><code><b>--fkey-suffix</b></code> <code><i>suffix</i></code></dt> + <dd>Use <code><i>suffix</i></code> instead of the default + <code><b>_fk</b></code> to construct foreign key names. If you require a + separator, such as an underscore, between the name and the suffix, then + you should include it into the suffix value.</dd> + + <dt><code><b>--sequence-suffix</b></code> <code><i>suffix</i></code></dt> + <dd>Use <code><i>suffix</i></code> instead of the default + <code><b>_seq</b></code> to construct sequence names. If you require a + separator, such as an underscore, between the name and the suffix, then + you should include it into the suffix value.</dd> + + <dt><code><b>--sql-name-case</b></code> <code><i>case</i></code></dt> + <dd>Convert all automatically-derived SQL names to upper or lower case. + Valid values for this option are <code><b>upper</b></code> and + <code><b>lower</b></code>.</dd> + + <dt><code><b>--table-regex</b></code> <code><i>regex</i></code></dt> + <dd>Add <code><i>regex</i></code> to the list of regular expressions that + is used to transform automatically-derived table names. See the SQL NAME + TRANSFORMATIONS section below for details.</dd> + + <dt><code><b>--column-regex</b></code> <code><i>regex</i></code></dt> + <dd>Add <code><i>regex</i></code> to the list of regular expressions that + is used to transform automatically-derived column names. See the SQL NAME + TRANSFORMATIONS section below for details.</dd> + + <dt><code><b>--index-regex</b></code> <code><i>regex</i></code></dt> + <dd>Add <code><i>regex</i></code> to the list of regular expressions that + is used to transform automatically-derived index names. See the SQL NAME + TRANSFORMATIONS section below for details.</dd> + + <dt><code><b>--fkey-regex</b></code> <code><i>regex</i></code></dt> + <dd>Add <code><i>regex</i></code> to the list of regular expressions that + is used to transform automatically-derived foreign key names. See the SQL + NAME TRANSFORMATIONS section below for details.</dd> + + <dt><code><b>--sequence-regex</b></code> <code><i>regex</i></code></dt> + <dd>Add <code><i>regex</i></code> to the list of regular expressions that + is used to transform automatically-derived sequence names. See the SQL + NAME TRANSFORMATIONS section below for details.</dd> + + <dt><code><b>--statement-regex</b></code> <code><i>regex</i></code></dt> + <dd>Add <code><i>regex</i></code> to the list of regular expressions that + is used to transform automatically-derived prepared statement names. See + the SQL NAME TRANSFORMATIONS section below for details.</dd> + + <dt><code><b>--sql-name-regex</b></code> <code><i>regex</i></code></dt> + <dd>Add <code><i>regex</i></code> to the list of regular expressions that + is used to transform all automatically-derived SQL names. See the SQL NAME + TRANSFORMATIONS section below for details.</dd> + + <dt><code><b>--sql-name-regex-trace</b></code></dt> + <dd>Trace the process of applying regular expressions specified with the + SQL name <code><b>--*-regex</b></code> options. Use this option to find + out why your regular expressions don't do what you expected them to + do.</dd> + + <dt><code><b>--accessor-regex</b></code> <code><i>regex</i></code></dt> + <dd>Add <code><i>regex</i></code> to the list of regular expressions used + to transform data member names to function names when searching for a + suitable accessor function. The argument to this option is a Perl-like + regular expression in the form + <code><b>/</b><i>pattern</i><b>/</b><i>replacement</i><b>/</b></code>. Any + character can be used as a delimiter instead of '<code><b>/</b></code>' + and the delimiter can be escaped inside <code><i>pattern</i></code> and + <code><i>replacement</i></code> with a backslash (<code><b>\</b></code>). + You can specify multiple regular expressions by repeating this option. + + <p>All the regular expressions are tried in the order specified and the + first expression that produces a suitable accessor function is used. Each + expression is tried twice: first with the actual member name and then with + the member's <i>public name</i> which is obtained by removing the common + member name decorations, such as leading and trailing underscores, the + <code><b>m_</b></code> prefix, etc. The ODB compiler also includes a + number of built-in expressions for commonly used accessor names, such as + <code><b>get_foo</b></code>, <code><b>getFoo</b></code>, + <code><b>getfoo</b></code>, and just <code><b>foo</b></code>. The built-in + expressions are tried last.</p> + + <p>As an example, the following expression transforms data members with + public names in the form <code><b>foo</b></code> to accessor names in the + form <code><b>GetFoo</b></code>:</p> + + <p class="code"><code><b>/(.+)/Get\u$1/</b></code></p> + + <p>See also the REGEX AND SHELL QUOTING section below.</p></dd> + + <dt><code><b>--accessor-regex-trace</b></code></dt> + <dd>Trace the process of applying regular expressions specified with the + <code><b>--accessor-regex</b></code> option. Use this option to find out + why your regular expressions don't do what you expected them to do.</dd> + + <dt><code><b>--modifier-regex</b></code> <code><i>regex</i></code></dt> + <dd>Add <code><i>regex</i></code> to the list of regular expressions used + to transform data member names to function names when searching for a + suitable modifier function. The argument to this option is a Perl-like + regular expression in the form + <code><b>/</b><i>pattern</i><b>/</b><i>replacement</i><b>/</b></code>. Any + character can be used as a delimiter instead of '<code><b>/</b></code>' + and the delimiter can be escaped inside <code><i>pattern</i></code> and + <code><i>replacement</i></code> with a backslash (<code><b>\</b></code>). + You can specify multiple regular expressions by repeating this option. + + <p>All the regular expressions are tried in the order specified and the + first expression that produces a suitable modifier function is used. Each + expression is tried twice: first with the actual member name and then with + the member's <i>public name</i> which is obtained by removing the common + member name decorations, such as leading and trailing underscores, the + <code><b>m_</b></code> prefix, etc. The ODB compiler also includes a + number of built-in expressions for commonly used modifier names, such as + <code><b>set_foo</b></code>, <code><b>setFoo</b></code>, + <code><b>setfoo</b></code>, and just <code><b>foo</b></code>. The built-in + expressions are tried last.</p> + + <p>As an example, the following expression transforms data members with + public names in the form <code><b>foo</b></code> to modifier names in the + form <code><b>SetFoo</b></code>:</p> + + <p class="code"><code><b>/(.+)/Set\u$1/</b></code></p> + + <p>See also the REGEX AND SHELL QUOTING section below.</p></dd> + + <dt><code><b>--modifier-regex-trace</b></code></dt> + <dd>Trace the process of applying regular expressions specified with the + <code><b>--modifier-regex</b></code> option. Use this option to find out + why your regular expressions don't do what you expected them to do.</dd> + + <dt><code><b>--include-with-brackets</b></code></dt> + <dd>Use angle brackets (<>) instead of quotes ("") in the generated + <code><b>#include</b></code> directives.</dd> + + <dt><code><b>--include-prefix</b></code> <code><i>prefix</i></code></dt> + <dd>Add <code><i>prefix</i></code> to the generated + <code><b>#include</b></code> directive paths.</dd> + + <dt><code><b>--include-regex</b></code> <code><i>regex</i></code></dt> + <dd>Add <code><i>regex</i></code> to the list of regular expressions used + to transform generated <code><b>#include</b></code> directive paths. The + argument to this option is a Perl-like regular expression in the form + <code><b>/</b><i>pattern</i><b>/</b><i>replacement</i><b>/</b></code>. Any + character can be used as a delimiter instead of '<code><b>/</b></code>' + and the delimiter can be escaped inside <code><i>pattern</i></code> and + <code><i>replacement</i></code> with a backslash (<code><b>\</b></code>). + You can specify multiple regular expressions by repeating this option. All + the regular expressions are tried in the order specified and the first + expression that matches is used. + + <p>As an example, the following expression transforms include paths in the + form <code><b>foo/bar-odb.h</b></code> to paths in the form + <code><b>foo/generated/bar-odb.h</b></code>:</p> + + <p + class="code"><code><b>%foo/(.+)-odb.h%foo/generated/$1-odb.h%</b></code></p> + + <p>See also the REGEX AND SHELL QUOTING section below.</p></dd> + + <dt><code><b>--include-regex-trace</b></code></dt> + <dd>Trace the process of applying regular expressions specified with the + <code><b>--include-regex</b></code> option. Use this option to find out + why your regular expressions don't do what you expected them to do.</dd> + + <dt><code><b>--guard-prefix</b></code> <code><i>prefix</i></code></dt> + <dd>Add <code><i>prefix</i></code> to the generated header inclusion + guards. The prefix is transformed to upper case and characters that are + illegal in a preprocessor macro name are replaced with underscores.</dd> + + <dt><code><b>--show-sloc</b></code></dt> + <dd>Print the number of generated physical source lines of code + (SLOC).</dd> + + <dt><code><b>--sloc-limit</b></code> <code><i>num</i></code></dt> + <dd>Check that the number of generated physical source lines of code + (SLOC) does not exceed <code><i>num</i></code>.</dd> + + <dt><code><b>--options-file</b></code> <code><i>file</i></code></dt> + <dd>Read additional options from <code><i>file</i></code>. Each option + should appear on a separate line optionally followed by space or equal + sign (<code><b>=</b></code>) and an option value. Empty lines and lines + starting with <code><b>#</b></code> are ignored. Option values can be + enclosed in double (<code><b>"</b></code>) or single + (<code><b>'</b></code>) quotes to preserve leading and trailing + whitespaces as well as to specify empty values. If the value itself + contains trailing or leading quotes, enclose it with an extra pair of + quotes, for example <code><b>'"x"'</b></code>. Non-leading and + non-trailing quotes are interpreted as being part of the option value. + + <p>The semantics of providing options in a file is equivalent to providing + the same set of options in the same order on the command line at the point + where the <code><b>--options-file</b></code> option is specified except + that the shell escaping and quoting is not required. Repeat this option to + specify more than one options file.</p></dd> + + <dt><code><b>-x</b></code> <code><i>option</i></code></dt> + <dd>Pass <code><i>option</i></code> to the underlying C++ compiler + (<code><b>g++</b></code>). The <code><i>option</i></code> value that + doesn't start with '<code><b>-</b></code>' is considered the + <code><b>g++</b></code> executable name.</dd> + + <dt><code><b>-v</b></code></dt> + <dd>Print the commands executed to run the stages of compilation.</dd> + + <dt><code><b>--trace</b></code></dt> + <dd>Trace the compilation process.</dd> + + <dt><code><b>--mysql-engine</b></code> <code><i>engine</i></code></dt> + <dd>Use <code><i>engine</i></code> instead of the default + <code><b>InnoDB</b></code> in the generated database schema file. For more + information on the storage engine options see the MySQL documentation. If + you would like to use the database-default engine, pass + <code><b>default</b></code> as the value for this option.</dd> + + <dt><code><b>--sqlite-override-null</b></code></dt> + <dd>Make all columns in the generated database schema allow + <code><b>NULL</b></code> values. This is primarily useful in schema + migration since SQLite does not support dropping of columns. By making all + columns <code><b>NULL</b></code> we can later "delete" them by setting + their values to <code><b>NULL</b></code>. Note that this option overrides + even the <code><b>not_null</b></code> pragma.</dd> + + <dt><code><b>--sqlite-lax-auto-id</b></code></dt> + <dd>Do not force monotonically increasing automatically-assigned object + ids. In this mode the generated database schema omits the + <code><b>AUTOINCREMENT</b></code> keyword which results in faster object + persistence but may lead to automatically-assigned ids not being in a + strictly ascending order. Refer to the SQLite documentation for + details.</dd> + + <dt><code><b>--pgsql-server-version</b></code> <code><i>ver</i></code></dt> + <dd>Specify the minimum PostgreSQL server version with which the generated + C++ code and schema will be used. This information is used to enable + version-specific optimizations and workarounds in the generated C++ code + and schema. The version must be in the + <code><i>major</i><b>.</b><i>minor</i></code> form, for example, + <code><b>9.1</b></code>. If this option is not specified, then + <code><b>7.4</b></code> or later is assumed.</dd> + + <dt><code><b>--oracle-client-version</b></code> <code><i>ver</i></code></dt> + <dd>Specify the minimum Oracle client library (OCI) version with which the + generated C++ code will be linked. This information is used to enable + version-specific optimizations and workarounds in the generated C++ code. + The version must be in the <code><i>major</i><b>.</b><i>minor</i></code> + form, for example, <code><b>11.2</b></code>. If this option is not + specified, then <code><b>10.1</b></code> or later is assumed.</dd> + + <dt><code><b>--oracle-warn-truncation</b></code></dt> + <dd>Warn about SQL names that are longer than 30 characters and are + therefore truncated. Note that during database schema generation + (<code><b>--generate-schema</b></code>) ODB detects when such truncations + lead to name conflicts and issues diagnostics even without this option + specified.</dd> + + <dt><code><b>--mssql-server-version</b></code> <code><i>ver</i></code></dt> + <dd>Specify the minimum SQL Server server version with which the generated + C++ code and schema will be used. This information is used to enable + version-specific optimizations and workarounds in the generated C++ code + and schema. The version must be in the + <code><i>major</i><b>.</b><i>minor</i></code> form, for example, + <code><b>9.0</b></code> (SQL Server 2005), <code><b>10.5</b></code> + (2008R2), or <code><b>11.0</b></code> (2012). If this option is not + specified, then <code><b>10.0</b></code> (SQL Server 2008) or later is + assumed.</dd> + + <dt><code><b>--mssql-short-limit</b></code> <code><i>size</i></code></dt> + <dd>Specify the short data size limit. If a character, national character, + or binary data type has a maximum length (in bytes) less than or equal to + this limit, then it is treated as <i>short data</i>, otherwise it is + <i>long data</i>. For short data ODB pre-allocates an intermediate buffer + of the maximum size and binds it directly to a parameter or result column. + This way the underlying API (ODBC) can read/write directly from/to this + buffer. In the case of long data, the data is read/written in chunks using + the <code><b>SQLGetData()</b></code>/<code><b>SQLPutData()</b></code> ODBC + functions. While the long data approach reduces the amount of memory used + by the application, it may require greater CPU resources. The default + short data limit is 1024 bytes. When setting a custom short data limit, + make sure that it is sufficiently large so that no object id in the + application is treated as long data.</dd> + </dl> + + <h1>SQL NAME TRANSFORMATIONS</h1> + + <p>The ODB compiler provides a number of mechanisms for transforming + automatically-derived SQL names, such as tables, columns, etc., + to match a specific naming convention. At the higher level, we can + add a prefix to global names (tables and, for some databases, + indexes and/or foreign keys) with the <code><b>--table-prefix</b></code> + option. Similarly, we can specify custom suffixes for + automatically-derived + index (<code><b>--index-suffix</b></code>; default is <code><b>_i</b></code>), + foreign key (<code><b>--fkey-suffix</b></code>; default is <code><b>_fk</b></code>), and + sequence (<code><b>--sequence-suffix</b></code>; default is <code><b>_seq</b></code>) + names. Finally, we can also convert all the names to upper or lower + case with the <code><b>--sql-name-case</b></code> option (valid values + are <code><b>upper</b></code> and <code><b>lower</b></code>).</p> + + <p>At the lower level we can specify a set of regular expressions to + implement arbitrary transformations of the automatically-derived SQL + names. If we want a particular regular expression only to apply to + a specific name, for example, table or column, then we use one of the + <code><b>--</b><i>kind</i><b>-regex</b></code> options, where + <code><i>kind</i></code> can be <code><b>table</b></code>, + <code><b>column</b></code>, <code><b>index</b></code>, + <code><b>fkey</b></code>, <code><b>sequence</b></code>, or + <code><b>statement</b></code>. On the other hand, if we want our + regular expressions to apply to all SQL names, then we use the + <code><b>--sql-name-regex</b></code> option.</p> + + <p>The interaction between the higher and lower level transformations + is as follows. Prefixes and suffixes are added first. Then the + regular expression transformations are applied. Finally, if requested, + the name is converted to upper or lower case. Note also that all of + these transformations except for <code><b>--table-prefix</b></code> + only apply to automatically-derived names. In other words, if a table, + column, etc., name was explicitly specified with a pragma, then it + is used as is, without applying any (except for the table prefix) + transformations.</p> + + <p>The value for the <code><b>--*-regex</b></code> options is a Perl-like + regular expression in the form + <code><b>/</b><i>pattern</i><b>/</b><i>replacement</i><b>/</b></code>. + Any character can be used as a delimiter instead of <code><b>/</b></code> + and the delimiter can be escaped inside <code><i>pattern</i></code> and + <code><i>replacement</i></code> with a backslash (<code><b>\</b></code>). + You can also specify multiple regular expressions by repeating these + options.</p> + + <p>All the regular expressions are tried in the order specified with the + name-specific expressions (for example, <code><b>--table-regex</b></code>) + tried first followed by the generic expressions + (<code><b>--sql-name-regex</b></code>). The first expression that + matches is used.</p> + + <p>As an example, consider a regular expression that transforms a class + name in the form <code><b>CFoo</b></code> to a table name in the + form <code><b>FOO</b></code>:</p> + + <p><code><b>--table-regex '/C(.+)/\U$1/'</b></code></p> + + <p>As a more interesting example, consider the transformation of class + names that follow the upper camel case convention (for example, + <code><b>FooBar</b></code>) to table names that follow the + underscore-separated, all upper case convention (for example, + <code><b>FOO_BAR</b></code>). For this case we have to use + separate expressions to handle one-word, two-word, etc., + names:</p> + + <p><code><b>--table-regex '/([A-z][a-z]+)/\U$1/'</b></code></p> + <p><code><b>--table-regex '/([A-z][a-z]+)([A-z][a-z]+)/\U$1_$2/'</b></code></p> + + <p>See also the REGEX AND SHELL QUOTING section below.</p> + + <h1>REGEX AND SHELL QUOTING</h1> + + <p>When entering a regular expression argument in the shell + command line it is often necessary to use quoting (enclosing + the argument in <code><b>" "</b></code> or + <code><b>' '</b></code>) in order to prevent the shell + from interpreting certain characters, for example, spaces as + argument separators and <code><b>$</b></code> as variable + expansions.</p> + + <p>Unfortunately it is hard to achieve this in a manner that is + portable across POSIX shells, such as those found on + GNU/Linux and UNIX, and Windows shell. For example, if you + use <code><b>" "</b></code> for quoting you will get a + wrong result with POSIX shells if your expression contains + <code><b>$</b></code>. The standard way of dealing with this + on POSIX systems is to use <code><b>' '</b></code> instead. + Unfortunately, Windows shell does not remove <code><b>' '</b></code> + from arguments when they are passed to applications. As a result you + may have to use <code><b>' '</b></code> for POSIX and + <code><b>" "</b></code> for Windows (<code><b>$</b></code> is + not treated as a special character on Windows).</p> + + <p>Alternatively, you can save regular expression options into + a file, one option per line, and use this file with the + <code><b>--options-file</b></code> option. With this approach + you don't need to worry about shell quoting.</p> + + <h1>DIAGNOSTICS</h1> + + <p>If the input file is not valid C++, <code><b>odb</b></code> + will issue diagnostic messages to STDERR and exit with non-zero exit + code.</p> + + <h1>BUGS</h1> + + <p>Send bug reports to the + <a href="mailto:odb-users@codesynthesis.com">odb-users@codesynthesis.com</a> mailing list.</p> + + </div> + <div id="footer"> + Copyright © 2009-2023 Code Synthesis Tools CC. + + <div id="terms"> + Permission is granted to copy, distribute and/or modify this + document under the terms of the + <a href="http://codesynthesis.com/licenses/fdl-1.3.txt">GNU Free + Documentation License, version 1.3</a>; with no Invariant Sections, + no Front-Cover Texts and no Back-Cover Texts. + </div> + </div> +</div> +</body> +</html> diff --git a/m4/disable-rpath.m4 b/m4/disable-rpath.m4 index 89c03dc..388f685 100644 --- a/m4/disable-rpath.m4 +++ b/m4/disable-rpath.m4 @@ -1,5 +1,4 @@ dnl file : m4/disable-rpath.m4 -dnl copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC dnl license : GNU GPL v3; see accompanying LICENSE file dnl AC_DEFUN([DISABLE_RPATH],[ diff --git a/m4/gcc-plugin.m4 b/m4/gcc-plugin.m4 index 9379493..20a9c75 100644 --- a/m4/gcc-plugin.m4 +++ b/m4/gcc-plugin.m4 @@ -1,5 +1,4 @@ dnl file : m4/gcc-plugin.m4 -dnl copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC dnl license : GNU GPL v3; see accompanying LICENSE file dnl dnl GCC_PLUGIN diff --git a/m4/libcutl.m4 b/m4/libcutl.m4 index 1d60dd3..7275ba2 100644 --- a/m4/libcutl.m4 +++ b/m4/libcutl.m4 @@ -1,5 +1,4 @@ dnl file : m4/libcutl.m4 -dnl copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC dnl license : MIT; see accompanying LICENSE file dnl dnl LIBCUTL([ACTION-IF-FOUND[, ACTION-IF-NOT-FOUND]]) diff --git a/m4/libtool-link.m4 b/m4/libtool-link.m4 index 635793f..302639f 100644 --- a/m4/libtool-link.m4 +++ b/m4/libtool-link.m4 @@ -1,5 +1,4 @@ dnl file : m4/libtool-link.m4 -dnl copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC dnl license : GNU GPL v2; see accompanying LICENSE file dnl dnl @@ -1,5 +1,4 @@ # file : makefile -# copyright : Copyright (c) 2005-2019 Code Synthesis Tools CC # license : GNU GPL v3; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))build/bootstrap.make @@ -1,8 +1,8 @@ : 1 name: odb -version: 2.5.0-b.16.z +version: 2.5.0-b.26.z summary: ODB compiler -license: GPLv3 +license: GPL-3.0-only topics: C++, ORM, source code generation, object persistence, \ relational database description-file: README @@ -11,13 +11,21 @@ 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/odb/ email: odb-users@codesynthesis.com -build-email: odb-builds@codesynthesis.com -builds: all +build-warning-email: odb-builds@codesynthesis.com +builds: default builds: -( +windows -gcc ) ; Requires MinGW GCC. builds: &gcc ; Requires GCC with plugin support enabled. builds: &gcc-5+ ; Requires GCC 5 or later. +builds: -static ; Implementation uses plugins and requires -fPIC. +requires: host requires: c++11 -depends: * build2 >= 0.11.0 -depends: * bpkg >= 0.11.0 +depends: * build2 >= 0.16.0- +depends: * bpkg >= 0.16.0- + depends: libstudxml ^1.1.0- depends: libcutl ^1.11.0- + +#depends: libstudxml == 1.1.0-b.10 +#depends: libcutl == 1.11.0-b.9 + +depends: * cli ^1.2.0- ? ($config.odb.develop) diff --git a/odb/.gitignore b/odb/.gitignore index 7e97b78..4fd410e 100644 --- a/odb/.gitignore +++ b/odb/.gitignore @@ -1,3 +1,2 @@ -odb -odb.so -#options.?xx +/odb +/options.?xx diff --git a/odb/Makefile.am b/odb/Makefile.am index 8a36dd0..04d8ccf 100644 --- a/odb/Makefile.am +++ b/odb/Makefile.am @@ -1,5 +1,4 @@ # file : odb/Makefile.am -# copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC # license : GNU GPL v3; see accompanying LICENSE file plugindir = @plugindir@ diff --git a/odb/buildfile b/odb/buildfile index 46c5ab6..34a6329 100644 --- a/odb/buildfile +++ b/odb/buildfile @@ -1,5 +1,4 @@ # file : odb/buildfile -# copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC # license : GNU GPL v3; see accompanying LICENSE file define plugin: libs @@ -33,22 +32,6 @@ if ($cxx.target.class != 'windows') # plugin{*}: install = bin/ -# Unless cross-compiling, pass the C++ compiler's recall path as the g++ -# name. At some point we should also make it configurable. -# -# Note that we used to compare complete target triplets but that prooved too -# strict. For example, we may be running on x86_64-apple-darwin17.7.0 while -# the compiler is targeting x86_64-apple-darwin17.3.0. -# -if ($cxx.target.cpu == $build.host.cpu && \ - $cxx.target.system == $build.host.system) -{ - gxx_name = $recall($cxx.path) - gxx_name = $regex.replace($gxx_name, '\\', '\\\\') # Escape back slashes. -} -else - gxx_name = g++ - import libs = libcutl%lib{cutl} import libs += libstudxml%lib{studxml} @@ -66,53 +49,112 @@ exe{odb}: cxx{odb} exe{odb}: libus{odb}: bin.whole = false exe{odb}: plugin{odb}: include = adhoc +# Target metadata, see also --build2-metadata in odb.cxx. +# +# While ODB itself doesn't use any environment variables, it uses GCC +# underneath which does (see "Environment Variables Affecting GCC"). +# +exe{odb}: +{ + export.metadata = 1 odb + odb.name = [string] odb + odb.version = [string] $version + odb.checksum = [string] $version + odb.environment = [strings] CPATH CPLUS_INCLUDE_PATH GCC_EXEC_PREFIX COMPILER_PATH +} + plugin{odb}: libus{odb} -# On Windows we have to link the import stub. +switch $cxx.target.system +{ + # On Windows we have to link the import stub. + # + case 'mingw32' + plugin{odb}: cxx.libs += $plugin_dir/cc1plus.exe.a + + # On Mac OS we have to allow undefined symbols. + # + case 'darwin' + plugin{odb}: cxx.loptions += -undefined dynamic_lookup +} + +libus{odb}: {hxx ixx txx cxx}{** -odb -options -pregenerated/**} $libs + +# Build options. # -if ($cxx.target.system == 'mingw32') - plugin{odb}: cxx.libs += $plugin_dir/cc1plus.exe.a +# Note: escape backslashes in gxx_name. +# +cxx.poptions += "-I$plugin_dir/include" +cxx.poptions += "-DODB_GXX_NAME=\"$regex.replace($gxx_name, '\\', '\\\\')\"" +cxx.poptions += -DODB_BUILD2 # @@ TMP while supporting other build systems. + +## Consumption build ($develop == false). # -# On Mac OS we have to allow undefined symbols. + +# Use pregenerated versions in the consumption build. # -elif ($cxx.target.system == 'darwin') - plugin{odb}: cxx.loptions += -undefined dynamic_lookup +libus{odb}: pregenerated/{hxx ixx cxx}{**}: include = (!$develop) -libus{odb}: {hxx ixx txx cxx}{** -odb -options} {hxx ixx cxx}{options} $libs +if! $develop + cxx.poptions =+ "-I($src_base/pregenerated)" # Note: must come first. -# Build options. +# Distribute pregenerated versions only in the consumption build. # -cxx.poptions += "-I$plugin_dir/include" "-DODB_GXX_NAME=\"$gxx_name\"" -cxx.poptions += -DODB_BUILD2 # @@ TMP while supporting other build systems. +pregenerated/{hxx ixx cxx}{*}: dist = (!$develop) -# Generated options parser. # -# @@ TMP: currently generated code is committed to allow building from git. +## + +## Development build ($develop == true). +# + +libus{odb}: {hxx ixx cxx}{options}: include = $develop + +if $develop + import! [metadata] cli = cli%exe{cli} + +# In the development build distribute regenerated {hxx ixx cxx}{options}, +# remapping their locations to the paths of the pregenerated versions (which +# are only distributed in the consumption build; see above). This way we make +# sure that the distributed files are always up-to-date. # -if $cli.configured +<{hxx ixx cxx}{options}>: cli{options} $cli { - cli.cxx{options}: cli{options} - - cli.options += --include-with-brackets --include-prefix odb \ ---guard-prefix ODB --generate-file-scanner --generate-specifier \ ---generate-modifier --generate-description --suppress-undocumented \ ---cxx-prologue '#include <odb/option-parsers.hxx>' - - cli.cxx{*}: - { - # Include the generated cli files into the distribution and don't remove - # them when cleaning in src (so that clean results in a state identical to - # distributed). - # - dist = true - clean = ($src_root != $out_root) - - # We keep the generated code in the repository so copy it back to src in - # case of a forwarded configuration. - # - backlink = overwrite - } + dist = ($develop ? pregenerated/odb/ : false) + + # Symlink the generated code in src for convenience of development. + # + backlink = true } +% +if $develop +{{ + options = --include-with-brackets --include-prefix odb --guard-prefix ODB \ + --generate-file-scanner --generate-specifier --generate-modifier \ + --generate-description --suppress-undocumented \ + --cxx-prologue '#include <odb/option-parsers.hxx>' + + $cli $options -o $out_base $path($<[0]) + + # If the result differs from the pregenerated version, copy it over. + # + if diff $src_base/pregenerated/odb/options.hxx $path($>[0]) >- && \ + diff $src_base/pregenerated/odb/options.ixx $path($>[1]) >- && \ + diff $src_base/pregenerated/odb/options.cxx $path($>[2]) >- + exit + end + + cp $path($>[0]) $src_base/pregenerated/odb/options.hxx + cp $path($>[1]) $src_base/pregenerated/odb/options.ixx + cp $path($>[2]) $src_base/pregenerated/odb/options.cxx +}} + +# +## + +# Pass the copyright notice extracted from the LICENSE file. +# +obj{odb}: cxx.poptions += -DODB_COPYRIGHT=\"$copyright\" # Don't install any of the plugin's headers. # diff --git a/odb/common-query.cxx b/odb/common-query.cxx index ea45ec3..517c92c 100644 --- a/odb/common-query.cxx +++ b/odb/common-query.cxx @@ -1,5 +1,4 @@ // file : odb/common-query.cxx -// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v3; see accompanying LICENSE file #include <sstream> diff --git a/odb/common-query.hxx b/odb/common-query.hxx index b0cfbbf..e90dd69 100644 --- a/odb/common-query.hxx +++ b/odb/common-query.hxx @@ -1,5 +1,4 @@ // file : odb/common-query.hxx -// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v3; see accompanying LICENSE file #ifndef ODB_COMMON_QUERY_HXX diff --git a/odb/common.cxx b/odb/common.cxx index 24d0b70..63e49ad 100644 --- a/odb/common.cxx +++ b/odb/common.cxx @@ -1,5 +1,4 @@ // file : odb/common.cxx -// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v3; see accompanying LICENSE file #include <odb/common.hxx> diff --git a/odb/common.hxx b/odb/common.hxx index 083eb4e..149def7 100644 --- a/odb/common.hxx +++ b/odb/common.hxx @@ -1,5 +1,4 @@ // file : odb/common.hxx -// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v3; see accompanying LICENSE file #ifndef ODB_COMMON_HXX diff --git a/odb/context.cxx b/odb/context.cxx index 4daa896..13fc1b3 100644 --- a/odb/context.cxx +++ b/odb/context.cxx @@ -1,5 +1,4 @@ // file : odb/context.cxx -// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v3; see accompanying LICENSE file #include <odb/gcc.hxx> @@ -1473,7 +1472,7 @@ utype (semantics::data_member& m, } } - if (s->global_scope ()) + if (!s->named_p () || s->global_scope ()) break; } @@ -1493,15 +1492,17 @@ string context:: type_ref_type (semantics::type& t, semantics::names* hint, bool mc, - string const& var) + string const& var, + bool decay) { using semantics::array; string r; // Note that trailing const syntax is used for a reason (consider - // t == const foo*). We also have to decay top-level arrays. + // t == const foo*). We may also have to decay then top-level array. // - if (array* a = dynamic_cast<array*> (&utype (t))) + array* a; + if (decay && (a = dynamic_cast<array*> (&utype (t))) != 0) { semantics::type& bt (a->base_type ()); hint = a->contains ().hint (); @@ -1881,8 +1882,13 @@ schema (semantics::scope& s) const namespace_* ns (dynamic_cast<namespace_*> (ps)); - if (ns == 0) - continue; // Some other scope. + if (ns == 0) // Some other scope. + { + if (!ps->named_p ()) + break; + + continue; + } if (ns->extension ()) ns = &ns->original (); @@ -1919,7 +1925,8 @@ schema (semantics::scope& s) const n.swap (r); } - if (r.fully_qualified () || ns->global_scope ()) + if (r.fully_qualified () || + ns->global_scope ()) // Note: namespaces always named. break; } @@ -1951,8 +1958,13 @@ table_name_prefix (semantics::scope& s) const namespace_* ns (dynamic_cast<namespace_*> (ps)); - if (ns == 0) - continue; // Some other scope. + if (ns == 0) // Some other scope. + { + if (!ps->named_p ()) + break; + + continue; + } if (ns->extension ()) ns = &ns->original (); @@ -1963,7 +1975,7 @@ table_name_prefix (semantics::scope& s) const r = n.uname () + r; } - if (ns->global_scope ()) + if (ns->global_scope ()) // Note: namespaces always named. break; } @@ -2129,6 +2141,90 @@ table_name (semantics::data_member& m, table_prefix const& p) const return r; } +string context:: +table_options (semantics::class_& c) +{ + string r; + + // Accumulate options from class. + // + // @@ Should we also get them from bases? + // + // @@ Note for some databases (like SQLite), options are seperated with + // comma, not space. Likely the same issue in the column_options(). + // + if (c.count ("options")) + { + strings const& o (c.get<strings> ("options")); + + for (strings::const_iterator i (o.begin ()); i != o.end (); ++i) + { + if (i->empty ()) + r.clear (); + else + { + if (!r.empty ()) + r += ' '; + + r += *i; + } + } + } + + return r; +} + +string context:: +table_options (semantics::data_member& m, semantics::type& c) +{ + string r; + + // Accumulate options from container and member. + // + // @@ Currently there is no way to assign options to the container type. If + // we use the value specifier, then it ends up being treated as a value + // type. To support this we will probably need to invent the container + // specifier. + // + if (c.count ("options")) + { + strings const& o (c.get<strings> ("options")); + + for (strings::const_iterator i (o.begin ()); i != o.end (); ++i) + { + if (i->empty ()) + r.clear (); + else + { + if (!r.empty ()) + r += ' '; + + r += *i; + } + } + } + + if (m.count ("options")) + { + strings const& o (m.get<strings> ("options")); + + for (strings::const_iterator i (o.begin ()); i != o.end (); ++i) + { + if (i->empty ()) + r.clear (); + else + { + if (!r.empty ()) + r += ' '; + + r += *i; + } + } + } + + return r; +} + // context::column_prefix // context::column_prefix:: diff --git a/odb/context.hxx b/odb/context.hxx index f9203ae..ec4505b 100644 --- a/odb/context.hxx +++ b/odb/context.hxx @@ -1,5 +1,4 @@ // file : odb/context.hxx -// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v3; see accompanying LICENSE file #ifndef ODB_CONTEXT_HXX @@ -18,8 +17,8 @@ #include <cstddef> // std::size_t #include <iostream> -#include <cutl/re.hxx> -#include <cutl/shared-ptr.hxx> +#include <libcutl/re.hxx> +#include <libcutl/shared-ptr.hxx> #include <odb/options.hxx> #include <odb/features.hxx> @@ -714,21 +713,25 @@ public: // make_const is true, then add top-level const qualifier, unless // it is already there. If it is false, then strip it if it is // already there. If var is not empty, then embed the variable - // name into the type (e.g., char (*v)[3]). + // name into the type (e.g., char (*v)[3]). If decay_array is + // false then don't decay the (top-level) array to a pointer. // static string member_ref_type (semantics::data_member& m, bool make_const, - string const& var = "") + string const& var = "", + bool decay_array = true) { - return type_ref_type (m.type (), m.belongs ().hint (), make_const, var); + return type_ref_type ( + m.type (), m.belongs ().hint (), make_const, var, decay_array); } static string type_ref_type (semantics::type&, semantics::names* hint, bool make_const, - string const& var = ""); + string const& var = "", + bool decay_array = true); // Form a value type for a not mapped, actual member type. If make_const // is true, then add top-level const qualifier, unless it is already @@ -1339,6 +1342,14 @@ public: qname table_name (semantics::data_member&, table_prefix const&) const; + string + table_options (semantics::class_&); + + // Table options for the container member. + // + string + table_options (semantics::data_member&, semantics::type& ct); + // // struct column_prefix @@ -1892,9 +1903,14 @@ public: private: static context* current_; +#if __cplusplus >= 201103L || defined(__GXX_EXPERIMENTAL_CXX0X__) + context& + operator= (context const&) = delete; +#else private: context& operator= (context const&); +#endif }; // Create concrete database context. diff --git a/odb/context.ixx b/odb/context.ixx index 20107e7..5018743 100644 --- a/odb/context.ixx +++ b/odb/context.ixx @@ -1,5 +1,4 @@ // file : odb/context.ixx -// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v3; see accompanying LICENSE file inline bool user_section:: diff --git a/odb/cxx-lexer.cxx b/odb/cxx-lexer.cxx index e252332..67493b7 100644 --- a/odb/cxx-lexer.cxx +++ b/odb/cxx-lexer.cxx @@ -1,5 +1,4 @@ // file : odb/cxx-lexer.cxx -// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v3; see accompanying LICENSE file #include <odb/gcc.hxx> diff --git a/odb/cxx-lexer.hxx b/odb/cxx-lexer.hxx index a768680..ea16132 100644 --- a/odb/cxx-lexer.hxx +++ b/odb/cxx-lexer.hxx @@ -1,5 +1,4 @@ // file : odb/cxx-lexer.hxx -// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v3; see accompanying LICENSE file #ifndef ODB_CXX_LEXER_HXX diff --git a/odb/cxx-token.hxx b/odb/cxx-token.hxx index 784564d..34b28d4 100644 --- a/odb/cxx-token.hxx +++ b/odb/cxx-token.hxx @@ -1,5 +1,4 @@ // file : odb/cxx-token.hxx -// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v3; see accompanying LICENSE file #ifndef ODB_CXX_TOKEN_HXX diff --git a/odb/diagnostics.cxx b/odb/diagnostics.cxx index bd8db29..57166bb 100644 --- a/odb/diagnostics.cxx +++ b/odb/diagnostics.cxx @@ -1,5 +1,4 @@ // file : odb/diagnostics.cxx -// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v3; see accompanying LICENSE file #include <odb/gcc.hxx> diff --git a/odb/diagnostics.hxx b/odb/diagnostics.hxx index 8f89bbb..46f2272 100644 --- a/odb/diagnostics.hxx +++ b/odb/diagnostics.hxx @@ -1,5 +1,4 @@ // file : odb/diagnostics.hxx -// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v3; see accompanying LICENSE file #ifndef ODB_DIAGNOSTICS_HXX @@ -11,7 +10,7 @@ #include <cstddef> #include <iostream> -#include <cutl/fs/path.hxx> +#include <libcutl/fs/path.hxx> #include <odb/location.hxx> diff --git a/odb/emitter.cxx b/odb/emitter.cxx index 91a2569..d6d8eac 100644 --- a/odb/emitter.cxx +++ b/odb/emitter.cxx @@ -1,5 +1,4 @@ // file : odb/emitter.cxx -// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v3; see accompanying LICENSE file #include <odb/context.hxx> diff --git a/odb/emitter.hxx b/odb/emitter.hxx index 63c6771..1071dab 100644 --- a/odb/emitter.hxx +++ b/odb/emitter.hxx @@ -1,5 +1,4 @@ // file : odb/emitter.hxx -// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v3; see accompanying LICENSE file #ifndef ODB_EMITTER_HXX diff --git a/odb/features.hxx b/odb/features.hxx index b300276..1093684 100644 --- a/odb/features.hxx +++ b/odb/features.hxx @@ -1,5 +1,4 @@ // file : odb/features.hxx -// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v3; see accompanying LICENSE file #ifndef ODB_FEATURES_HXX diff --git a/odb/gcc-fwd.hxx b/odb/gcc-fwd.hxx index 1c6c756..83d3746 100644 --- a/odb/gcc-fwd.hxx +++ b/odb/gcc-fwd.hxx @@ -1,5 +1,4 @@ // file : odb/gcc-fwd.hxx -// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v3; see accompanying LICENSE file #ifndef ODB_GCC_FWD_HXX diff --git a/odb/gcc.hxx b/odb/gcc.hxx index f4780ba..e5fecef 100644 --- a/odb/gcc.hxx +++ b/odb/gcc.hxx @@ -1,5 +1,4 @@ // file : odb/gcc.hxx -// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v3; see accompanying LICENSE file #ifndef ODB_GCC_HXX @@ -152,15 +151,19 @@ gcc_tree_code_name (gcc_tree_code_type tc) {return tree_code_name[tc];} #define DECL_CHAIN(x) TREE_CHAIN(x) #endif -// In GCC 6, ANON_AGGRNAME_P became anon_aggrname_p(). +// In GCC 6 ANON_AGGRNAME_P became anon_aggrname_p(). +// In GCC 10 anon_aggrname_p() became IDENTIFIER_ANON_P. // #if BUILDING_GCC_MAJOR < 6 -# define anon_aggrname_p(X) ANON_AGGRNAME_P(X) +# define IDENTIFIER_ANON_P(X) ANON_AGGRNAME_P(X) +#elif BUILDING_GCC_MAJOR < 10 +# define IDENTIFIER_ANON_P(X) anon_aggrname_p(X) #endif // In GCC 9: // // INCLUDED_FROM Became linemap_included_from_linemap(). +// // LAST_SOURCE_LINE Was removed apparently as no longer used. Studying // the line-map.h diff from 8.3 suggests that the old // implementation should still work. @@ -190,4 +193,23 @@ LAST_SOURCE_LINE (const line_map_ordinary* map) #endif +// In GCC 11: +// +// lookup_qualified_name() has a new interface. +// +// DECL_IS_BUILTIN became DECL_IS_UNDECLARED_BUILTIN. +// +#if BUILDING_GCC_MAJOR >= 11 + +inline tree +lookup_qualified_name (tree scope, tree name, bool type, bool complain) +{ + return lookup_qualified_name ( + scope, name, (type ? LOOK_want::TYPE : LOOK_want::NORMAL), complain); +} + +#define DECL_IS_BUILTIN(decl) DECL_IS_UNDECLARED_BUILTIN(decl) + +#endif + #endif // ODB_GCC_HXX diff --git a/odb/generate.hxx b/odb/generate.hxx index 828f031..b3b9c43 100644 --- a/odb/generate.hxx +++ b/odb/generate.hxx @@ -1,5 +1,4 @@ // file : odb/generate.hxx -// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v3; see accompanying LICENSE file #ifndef ODB_GENERATE_HXX diff --git a/odb/generator.cxx b/odb/generator.cxx index cb65ceb..ec0fefe 100644 --- a/odb/generator.cxx +++ b/odb/generator.cxx @@ -1,5 +1,4 @@ // file : odb/generator.cxx -// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v3; see accompanying LICENSE file #include <cctype> // std::toupper, std::is{alpha,upper,lower} @@ -10,18 +9,18 @@ #include <sstream> #include <iostream> -#include <cutl/fs/auto-remove.hxx> +#include <libcutl/fs/auto-remove.hxx> -#include <cutl/compiler/code-stream.hxx> -#include <cutl/compiler/cxx-indenter.hxx> -#include <cutl/compiler/sloc-counter.hxx> +#include <libcutl/compiler/code-stream.hxx> +#include <libcutl/compiler/cxx-indenter.hxx> +#include <libcutl/compiler/sloc-counter.hxx> #ifdef ODB_BUILD2 #include <libstudxml/parser.hxx> #include <libstudxml/serializer.hxx> #else -#include <cutl/xml/parser.hxx> -#include <cutl/xml/serializer.hxx> +#include <libcutl/xml/parser.hxx> +#include <libcutl/xml/serializer.hxx> #endif #include <odb/version.hxx> diff --git a/odb/generator.hxx b/odb/generator.hxx index 1043e8f..205043b 100644 --- a/odb/generator.hxx +++ b/odb/generator.hxx @@ -1,5 +1,4 @@ // file : odb/generator.hxx -// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v3; see accompanying LICENSE file #ifndef ODB_GENERATOR_HXX diff --git a/odb/header.cxx b/odb/header.cxx index 88ac83f..fad28b3 100644 --- a/odb/header.cxx +++ b/odb/header.cxx @@ -1,5 +1,4 @@ // file : odb/header.cxx -// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v3; see accompanying LICENSE file #include <odb/common.hxx> diff --git a/odb/include.cxx b/odb/include.cxx index 8ac6dda..5fda7c0 100644 --- a/odb/include.cxx +++ b/odb/include.cxx @@ -1,5 +1,4 @@ // file : odb/include.cxx -// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v3; see accompanying LICENSE file #include <odb/gcc.hxx> diff --git a/odb/inline.cxx b/odb/inline.cxx index 66d7337..15482aa 100644 --- a/odb/inline.cxx +++ b/odb/inline.cxx @@ -1,5 +1,4 @@ // file : odb/inline.cxx -// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v3; see accompanying LICENSE file #include <odb/common.hxx> diff --git a/odb/instance.cxx b/odb/instance.cxx index d86f6c0..2d10239 100644 --- a/odb/instance.cxx +++ b/odb/instance.cxx @@ -1,5 +1,4 @@ // file : odb/instance.cxx -// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v3; see accompanying LICENSE file #include <sstream> diff --git a/odb/instance.hxx b/odb/instance.hxx index 3706a07..2b47939 100644 --- a/odb/instance.hxx +++ b/odb/instance.hxx @@ -1,5 +1,4 @@ // file : odb/instance.hxx -// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v3; see accompanying LICENSE file #ifndef ODB_INSTANCE_HXX diff --git a/odb/location.cxx b/odb/location.cxx index 1588110..23bd7ef 100644 --- a/odb/location.cxx +++ b/odb/location.cxx @@ -1,5 +1,4 @@ // file : odb/location.cxx -// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v3; see accompanying LICENSE file #include <odb/location.hxx> diff --git a/odb/location.hxx b/odb/location.hxx index c57848b..cc59196 100644 --- a/odb/location.hxx +++ b/odb/location.hxx @@ -1,5 +1,4 @@ // file : odb/location.hxx -// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v3; see accompanying LICENSE file #ifndef ODB_LOCATION_HXX @@ -8,7 +7,7 @@ #include <odb/gcc-fwd.hxx> #include <cstddef> -#include <cutl/fs/path.hxx> +#include <libcutl/fs/path.hxx> struct location { diff --git a/odb/lookup.cxx b/odb/lookup.cxx index a0bd89c..a54ef15 100644 --- a/odb/lookup.cxx +++ b/odb/lookup.cxx @@ -1,5 +1,4 @@ // file : odb/lookup.cxx -// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v3; see accompanying LICENSE file #include <odb/lookup.hxx> diff --git a/odb/lookup.hxx b/odb/lookup.hxx index cd125bd..86c65b2 100644 --- a/odb/lookup.hxx +++ b/odb/lookup.hxx @@ -1,5 +1,4 @@ // file : odb/lookup.hxx -// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v3; see accompanying LICENSE file #ifndef ODB_LOOKUP_HXX diff --git a/odb/makefile b/odb/makefile index 04098c2..16a3185 100644 --- a/odb/makefile +++ b/odb/makefile @@ -1,5 +1,4 @@ # file : odb/makefile -# copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC # license : GNU GPL v3; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../build/bootstrap.make diff --git a/odb/odb.cxx b/odb/odb.cxx index 191c9bb..701f6e1 100644 --- a/odb/odb.cxx +++ b/odb/odb.cxx @@ -1,5 +1,4 @@ // file : odb/odb.cxx -// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v3; see accompanying LICENSE file #include <errno.h> @@ -19,7 +18,7 @@ # ifndef WIN32_LEAN_AND_MEAN # define WIN32_LEAN_AND_MEAN # endif -# include <windows.h> // CreatePipe, CreateProcess +# include <windows.h> // CreatePipe, CreateProcess, GetTemp*, MAX_PATH # include <io.h> // _open_osfhandle # include <fcntl.h> // _O_TEXT #endif @@ -32,7 +31,8 @@ #include <iostream> #include <ext/stdio_filebuf.h> -#include <cutl/fs/path.hxx> +#include <libcutl/fs/path.hxx> +#include <libcutl/fs/auto-remove.hxx> #include <odb/version.hxx> #include <odb/options.hxx> @@ -45,6 +45,7 @@ using namespace std; using cutl::fs::path; using cutl::fs::invalid_path; +using cutl::fs::auto_remove; typedef vector<string> strings; typedef vector<path> paths; @@ -91,6 +92,16 @@ struct process_info struct process_failure {}; +#ifdef _WIN32 +// Deal with Windows command line length limit. +// +static auto_remove +fixup_cmd_line (vector<const char*>& args, + size_t start, + const char* name, + string& arg); +#endif + // Start another process using the specified command line. Connect the // newly created process' stdin to out_fd. Also if connect_* are true, // connect the created process' stdout and stderr to in_*fd. Issue @@ -260,9 +271,7 @@ main (int argc, char* argv[]) file = dd / file; // For diagnostics. } - int ac (3); - const char* av[4] = {argv[0], "--file", file.string ().c_str (), 0}; - cli::argv_file_scanner s (ac, const_cast<char**> (av), "--file"); + cli::argv_file_scanner s (file.string ()); bool first_x (true); @@ -382,11 +391,15 @@ main (int argc, char* argv[]) // Parse driver options. // + // We scan expanding --options-file in order to allow specifying ad hoc + // options (-I, etc) in options files. + // bool first_x (true); - for (int i = 1; i < argc; ++i) + for (cli::argv_file_scanner scan (argc, argv, "--options-file"); + scan.more (); ) { - string a (argv[i]); + string a (scan.next ()); size_t n (a.size ()); // -v @@ -400,14 +413,14 @@ main (int argc, char* argv[]) // else if (a == "-x") { - if (++i == argc || argv[i][0] == '\0') + const char* v; + if (!scan.more () || (v = scan.next ())[0] == '\0') { - e << argv[0] << ": error: expected argument for the -x option" << endl; + e << argv[0] << ": error: expected argument for the -x option" + << endl; return 1; } - a = argv[i]; - if (first_x) { first_x = false; @@ -415,13 +428,13 @@ main (int argc, char* argv[]) // If it doesn't start with '-', then it must be the g++ // executable name. Update the first argument with it. // - if (a[0] != '-') - args[0] = a; + if (v[0] != '-') + args[0] = v; else - args.push_back (a); + args.push_back (v); } else - args.push_back (a); + args.push_back (v); } // -I // @@ -431,14 +444,15 @@ main (int argc, char* argv[]) if (n == 2) // -I /path { - if (++i == argc || argv[i][0] == '\0') + const char* v; + if (!scan.more () || (v = scan.next ())[0] == '\0') { e << argv[0] << ": error: expected argument for the -I option" << endl; return 1; } - args.push_back (argv[i]); + args.push_back (v); } } // -isystem, -iquote, -idirafter, and -framework (Mac OS X) @@ -450,14 +464,15 @@ main (int argc, char* argv[]) { args.push_back (a); - if (++i == argc || argv[i][0] == '\0') + const char* v; + if (!scan.more () || (v = scan.next ())[0] == '\0') { e << argv[0] << ": error: expected argument for the " << a << " option" << endl; return 1; } - args.push_back (argv[i]); + args.push_back (v); } // -D // @@ -467,14 +482,15 @@ main (int argc, char* argv[]) if (n == 2) // -D macro { - if (++i == argc || argv[i][0] == '\0') + const char* v; + if (!scan.more () || (v = scan.next ())[0] == '\0') { e << argv[0] << ": error: expected argument for the -D option" << endl; return 1; } - args.push_back (argv[i]); + args.push_back (v); } } // -U @@ -485,14 +501,15 @@ main (int argc, char* argv[]) if (n == 2) // -U macro { - if (++i == argc || argv[i][0] == '\0') + const char* v; + if (!scan.more () || (v = scan.next ())[0] == '\0') { e << argv[0] << ": error: expected argument for the -U option" << endl; return 1; } - args.push_back (argv[i]); + args.push_back (v); } } // Store everything else in a list so that we can parse it with the @@ -578,7 +595,7 @@ main (int argc, char* argv[]) int ac (static_cast<int> (av.size ())); cli::argv_file_scanner::option_info oi[3]; - oi[0].option = "--options-file"; + oi[0].option = "--options-file"; // Keep in case profile uses it. oi[0].search_func = 0; oi[1].option = "-p"; oi[2].option = "--profile"; @@ -593,17 +610,41 @@ main (int argc, char* argv[]) cli::argv_file_scanner scan (ac, &av[0], oi, 3); options ops (scan); + // Handle --build2-metadata (see also buildfile). + // + if (ops.build2_metadata_specified ()) + { + ostream& o (cout); + + // Note that the export.metadata variable should be the first non- + // blank/comment line. + // + o << "# build2 buildfile odb" << endl + << "export.metadata = 1 odb" << endl + << "odb.name = [string] odb" << endl + << "odb.version = [string] '" << ODB_COMPILER_VERSION_STR << '\'' << endl + << "odb.checksum = [string] '" << ODB_COMPILER_VERSION_STR << '\'' << endl + << "odb.environment = [strings] CPATH CPLUS_INCLUDE_PATH GCC_EXEC_PREFIX COMPILER_PATH" << endl; + + return 0; + } + // Handle --version. // if (ops.version ()) { - cout << "ODB object-relational mapping (ORM) compiler for C++ " - ODB_COMPILER_VERSION_STR << endl - << "Copyright (c) 2009-2019 Code Synthesis Tools CC" << endl; + ostream& o (cout); + + o << "ODB object-relational mapping (ORM) compiler for C++ " + ODB_COMPILER_VERSION_STR << endl; + +#ifdef ODB_BUILD2 + o << "Copyright (c) " << ODB_COPYRIGHT << "." << endl; +#endif - cout << "This is free software; see the source for copying " - << "conditions. There is NO\nwarranty; not even for " - << "MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." << endl; + o << "This is free software; see the source for copying conditions. " + << "There is NO\nwarranty; not even for MERCHANTABILITY or FITNESS " + << "FOR A PARTICULAR PURPOSE." << endl; return 0; } @@ -612,8 +653,10 @@ main (int argc, char* argv[]) // if (ops.help ()) { - cout << "Usage: " << argv[0] << " [options] file [file ...]" << endl - << "Options:" << endl; + ostream& o (cout); + + o << "Usage: " << argv[0] << " [options] file [file ...]" << endl + << "Options:" << endl; options::print_usage (cout); return 0; @@ -664,6 +707,11 @@ main (int argc, char* argv[]) args[3] = "-std=c++1z"; break; } + case cxx_version::cxx20: + { + args[3] = "-std=c++2a"; + break; + } } } @@ -864,6 +912,14 @@ main (int argc, char* argv[]) } } + // Deal with Windows command line length limit. + // +#ifdef _WIN32 + string ops_file_arg; + auto_remove opt_file_rm ( + fixup_cmd_line (exec_args, 1, argv[0], ops_file_arg)); +#endif + process_info pi (start_process (&exec_args[0], argv[0], false, true)); { @@ -1297,6 +1353,11 @@ profile_paths (strings const& sargs, char const* name) exec_args.push_back ("-"); // Compile stdin. exec_args.push_back (0); +#ifdef _WIN32 + string ops_file_arg; + auto_remove opt_file_rm (fixup_cmd_line (exec_args, 1, name, ops_file_arg)); +#endif + process_info pi (start_process (&exec_args[0], name, true)); close (pi.out_fd); // Preprocess empty file. @@ -1811,6 +1872,134 @@ print_error (char const* name) LocalFree (msg); } +// On Windows we need to protect command line arguments with spaces using +// quotes. Since there could be actual quotes in the value, we need to escape +// them. +// +static void +append_quoted (string& cmd_line, const char* ca) +{ + string a (ca); + bool quote (a.find (' ') != string::npos); + + if (quote) + cmd_line += '"'; + + for (size_t i (0); i < a.size (); ++i) + { + if (a[i] == '"') + cmd_line += "\\\""; + else + cmd_line += a[i]; + } + + if (quote) + cmd_line += '"'; +} + +// Deal with Windows command line length limit. +// +// The best approach seems to be passing the command line in an "options file" +// ("response file" in Microsoft's terminology). +// +static auto_remove +fixup_cmd_line (vector<const char*>& args, + size_t start, + const char* name, + string& arg) +{ + // Calculate the would-be command line length similar to how start_process() + // implementation does it. + // + size_t n (0); + string s; + for (const char* a: args) + { + if (a != nullptr) + { + if (n != 0) + n++; // For the space separator. + + s.clear (); + append_quoted (s, a); + n += s.size (); + } + } + + if (n <= 32766) // 32768 - "Unicode terminating null character". + return auto_remove (); + + // Create the temporary file. + // + char d[MAX_PATH + 1], p[MAX_PATH + 1]; + if (GetTempPathA (sizeof (d), d) == 0 || + GetTempFileNameA (d, "odb-options-", 0, p) == 0) + { + print_error (name); + throw process_failure (); + } + + auto_remove rm = auto_remove (path (p)); + try + { + ofstream ofs (p); + if (!ofs.is_open ()) + { + cerr << name << ": error: unable to open '" << p << "' in write mode" + << endl; + throw process_failure (); + } + + ofs.exceptions (ios_base::badbit | ios_base::failbit); + + // Write the arguments to file. + // + // The format is a space-separated list of potentially-quoted arguments + // with support for backslash-escaping. + // + string b; + for (size_t i (start), n (args.size () - 1); i != n; ++i) + { + const char* a (args[i]); + + // We will most likely have backslashes so just do it. + // + { + for (b.clear (); *a != '\0'; ++a) + { + if (*a != '\\') + b += *a; + else + b += "\\\\"; + } + + a = b.c_str (); + } + + s.clear (); + append_quoted (s, a); + ofs << (i != start ? " " : "") << s; + } + + ofs << '\n'; + ofs.close (); + } + catch (const ios_base::failure&) + { + cerr << name << ": error: unable to write to '" << p << "'" << endl; + throw process_failure (); + } + + // Rewrite the command line. + // + arg = string ("@") + p; + args.resize (start); + args.push_back (arg.c_str()); + args.push_back (nullptr); + + return rm; +} + static process_info start_process (char const* args[], char const* name, bool err, bool out) { @@ -1876,26 +2065,7 @@ start_process (char const* args[], char const* name, bool err, bool out) if (p != args) cmd_line += ' '; - // On Windows we need to protect values with spaces using quotes. - // Since there could be actual quotes in the value, we need to - // escape them. - // - string a (*p); - bool quote (a.find (' ') != string::npos); - - if (quote) - cmd_line += '"'; - - for (size_t i (0); i < a.size (); ++i) - { - if (a[i] == '"') - cmd_line += "\\\""; - else - cmd_line += a[i]; - } - - if (quote) - cmd_line += '"'; + append_quoted (cmd_line, *p); } // Prepare other info. diff --git a/odb/option-functions.cxx b/odb/option-functions.cxx index 40f5083..7eda934 100644 --- a/odb/option-functions.cxx +++ b/odb/option-functions.cxx @@ -1,5 +1,4 @@ // file : odb/option-functions.cxx -// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v3; see accompanying LICENSE file #include <set> @@ -102,7 +101,7 @@ process_options (options& o) o.odb_file_suffix ().insert (make_pair (db, "-odb-" + db.string ())); o.sql_file_suffix ().insert (make_pair (db, "-" + db.string ())); o.schema_file_suffix ().insert (make_pair (db, "-schema-" + db.string ())); - o.changelog_file_suffix ().insert (make_pair (db, "-" + db.string ())); + o.changelog_file_suffix ().insert (make_pair (db, '-' + db.string ())); } // Set default --default-database value. diff --git a/odb/option-functions.hxx b/odb/option-functions.hxx index 8a7f431..a4b072c 100644 --- a/odb/option-functions.hxx +++ b/odb/option-functions.hxx @@ -1,5 +1,4 @@ // file : odb/option-functions.hxx -// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v3; see accompanying LICENSE file #ifndef ODB_OPTION_FUNCTIONS_HXX diff --git a/odb/option-parsers.hxx b/odb/option-parsers.hxx index f282a14..2daa6eb 100644 --- a/odb/option-parsers.hxx +++ b/odb/option-parsers.hxx @@ -1,5 +1,4 @@ // file : odb/option-parsers.hxx -// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v3; see accompanying LICENSE file #ifndef ODB_OPTION_PARSERS_HXX diff --git a/odb/option-types.cxx b/odb/option-types.cxx index 1415b25..c4a030b 100644 --- a/odb/option-types.cxx +++ b/odb/option-types.cxx @@ -1,5 +1,4 @@ // file : odb/option-types.cxx -// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v3; see accompanying LICENSE file #include <istream> @@ -19,7 +18,8 @@ static const char* cxx_version_[] = "c++98", "c++11", "c++14", - "c++17" + "c++17", + "c++20" }; string cxx_version:: @@ -44,6 +44,8 @@ operator>> (istream& is, cxx_version& v) v = cxx_version::cxx14; else if (s == "c++17") v = cxx_version::cxx17; + else if (s == "c++20") + v = cxx_version::cxx20; else is.setstate (istream::failbit); } diff --git a/odb/option-types.hxx b/odb/option-types.hxx index 290485c..869fc83 100644 --- a/odb/option-types.hxx +++ b/odb/option-types.hxx @@ -1,5 +1,4 @@ // file : odb/option-types.hxx -// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v3; see accompanying LICENSE file #ifndef ODB_OPTION_TYPES_HXX @@ -23,7 +22,8 @@ struct cxx_version cxx98, cxx11, cxx14, - cxx17 + cxx17, + cxx20 }; cxx_version (value v = value (0)) : v_ (v) {} diff --git a/odb/options.cli b/odb/options.cli index a052201..17ee438 100644 --- a/odb/options.cli +++ b/odb/options.cli @@ -1,11 +1,11 @@ // file : odb/options.cli -// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v3; see accompanying LICENSE file include <set>; include <vector>; include <string>; include <cstddef>; +include <cstdint>; include <odb/option-types.hxx>; @@ -15,6 +15,8 @@ class options // Wrapper options. These are not passed to the plugin. // + std::uint64_t --build2-metadata; // Leave undocumented/hidden. + bool --help {"Print usage information and exit."}; bool --version {"Print version and exit."}; @@ -307,11 +309,15 @@ class options // Language. // + // @@ TODO: perhaps we should switch to latest to match how we build + // runtime by default? + // cxx_version --std = cxx_version::cxx98 { "<version>", "Specify the C++ standard that should be used during compilation. - Valid values are \cb{c++98} (default), \cb{c++11}, and \cb{c++14}." + Valid values are \cb{c++98} (default), \cb{c++11}, \cb{c++14}, + \cb{c++17}, and \cb{c++20}." }; // Diagnostics. diff --git a/odb/parser.cxx b/odb/parser.cxx index 9d9931e..c026808 100644 --- a/odb/parser.cxx +++ b/odb/parser.cxx @@ -1,5 +1,4 @@ // file : odb/parser.cxx -// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v3; see accompanying LICENSE file #include <odb/gcc.hxx> // Keep it first. @@ -177,6 +176,7 @@ private: unit* unit_; scope* scope_; + vector<scope*> class_scopes_; // Current hierarchy of class-like scopes. size_t error_; decl_set decls_; @@ -264,6 +264,11 @@ emit_class (tree c, path const& file, size_t line, size_t clmn, bool stub) if (stub || !COMPLETE_TYPE_P (c)) return *c_node; + // Note: "include" the base classes into the class scope (see comment for + // self-typedefs in emit_type_decl()). + // + class_scopes_.push_back (c_node); + // Traverse base information. // tree bis (TYPE_BINFO (c)); @@ -558,6 +563,8 @@ emit_class (tree c, path const& file, size_t line, size_t clmn, bool stub) diagnose_unassoc_pragmas (decls); scope_ = prev_scope; + class_scopes_.pop_back (); + return *c_node; } @@ -584,6 +591,8 @@ emit_union (tree u, path const& file, size_t line, size_t clmn, bool stub) if (stub || !COMPLETE_TYPE_P (u)) return *u_node; + class_scopes_.push_back (u_node); + // Collect member declarations so that we can traverse them in // the source code order. // @@ -729,6 +738,7 @@ emit_union (tree u, path const& file, size_t line, size_t clmn, bool stub) diagnose_unassoc_pragmas (decls); scope_ = prev_scope; + class_scopes_.pop_back (); return *u_node; } @@ -891,15 +901,23 @@ collect (tree ns) { case TYPE_DECL: { - if (DECL_NAME (decl) != NULL_TREE) - decls_.insert (decl); + // Skip special type declarations. + // + if (DECL_NAME (decl) == NULL_TREE) + continue; + + tree type (TREE_TYPE (decl)); + if (LAMBDA_TYPE_P (type)) + continue; + decls_.insert (decl); break; } case TEMPLATE_DECL: { if (DECL_CLASS_TEMPLATE_P (decl)) decls_.insert (decl); + break; } default: @@ -935,9 +953,10 @@ collect (tree ns) if (!DECL_IS_BUILTIN (decl) || DECL_NAMESPACE_STD_P (decl)) { + tree dn (DECL_NAME (decl)); + if (trace) { - tree dn (DECL_NAME (decl)); char const* name (dn ? IDENTIFIER_POINTER (dn) : "<anonymous>"); ts << "namespace " << name << " at " @@ -945,7 +964,12 @@ collect (tree ns) << DECL_SOURCE_LINE (decl) << endl; } - collect (decl); + // Skip anonymous namespaces (there could be nothing of interest to us + // inside but they wreck havoc with our attempts to sort declarations + // into namespaces). + // + if (dn != 0) + collect (decl); } } } @@ -1072,6 +1096,8 @@ emit () break; } } + + assert (class_scopes_.empty ()); } // Diagnose any position pragmas that haven't been associated. @@ -1096,14 +1122,14 @@ emit_type_decl (tree decl) // says that in typedef struct {} S; S becomes struct's // name. // - if (anon_aggrname_p (decl_name)) + if (IDENTIFIER_ANON_P (decl_name)) { tree d (TYPE_NAME (t)); if (d != NULL_TREE && !DECL_ARTIFICIAL (d) && DECL_NAME (d) != NULL_TREE && - !anon_aggrname_p (DECL_NAME (d))) + !IDENTIFIER_ANON_P (DECL_NAME (d))) { decl = d; decl_name = DECL_NAME (decl); @@ -1194,6 +1220,58 @@ emit_type_decl (tree decl) size_t c (DECL_SOURCE_COLUMN (decl)); type& node (emit_type (t, decl_access (decl), f, l, c)); + + // Omit inner self-typedefs (e.g., a class typedefs itself in its own + // scope). Such aliases don't buy us anything (in particular, they cannot + // be used to form an fq-name) but they do cause scoping cycles if this + // name happens to be used to find outer scope (see scope::scope_()). + // Note that this means we can now have class template instantiations that + // are not named and therefore don't belong to any scope. + // + // Note that emit_type() might still enter this decl as a hint. It's fuzzy + // whether this is harmless or not. + // + // Note also that using the normal scope hierarchy does not work in more + // complex cases where templates cross-self-typedef. So instead we now use + // a special-purpose mechanism (class_scopes_). Note for this to work + // correctly (hopefully), the class should be "in scope" for its bases. + // Here is a representative examples (inspired by code in Eigen): + // + // template <typename M> + // struct PlainObjectBase + // { + // typedef M Self; + // }; + // + // template <typename T, int X, int Y> + // struct Matrix: PlainObjectBase<Matrix<T, X, Y>> + // { + // typedef PlainObjectBase<Matrix> Base; + // typedef Matrix Self; + // }; + // + // typedef Matrix<double, 3, 1> Vector3d; + // + // Here we want both Self's (but not Base) to be skipped. + // + if (scope* s = dynamic_cast<scope*> (&node)) + { + for (auto i (class_scopes_.rbegin ()); i != class_scopes_.rend (); ++i) + { + if (s == *i) + { + if (trace) + { + string s (emit_type_name (t, false)); + + ts << "omitting inner self-typedef " << s << " (" << &node + << ") -> " << name << " at " << f << ":" << l << endl; + } + return 0; + } + } + } + typedefs& edge (unit_->new_edge<typedefs> (*scope_, node, name)); // Find our hint. @@ -1320,6 +1398,8 @@ emit_class_template (tree t, bool stub) if (stub || !COMPLETE_TYPE_P (c)) return *ct_node; + class_scopes_.push_back (ct_node); + // Collect member declarations so that we can traverse them in // the source code order. For now we are only interested in // nested class template declarations. @@ -1375,6 +1455,7 @@ emit_class_template (tree t, bool stub) diagnose_unassoc_pragmas (decls); scope_ = prev_scope; + class_scopes_.pop_back (); return *ct_node; } @@ -1403,6 +1484,8 @@ emit_union_template (tree t, bool stub) if (stub || !COMPLETE_TYPE_P (u)) return *ut_node; + class_scopes_.push_back (ut_node); + // Collect member declarations so that we can traverse them in // the source code order. For now we are only interested in // nested class template declarations. @@ -1458,6 +1541,7 @@ emit_union_template (tree t, bool stub) diagnose_unassoc_pragmas (decls); scope_ = prev_scope; + class_scopes_.pop_back (); return *ut_node; } @@ -1720,7 +1804,7 @@ create_type (tree t, ts << "start anon/stub " << gcc_tree_code_name(tc) << " at " << file << ":" << line << endl; - if (d == NULL_TREE || anon_aggrname_p (DECL_NAME (d))) + if (d == NULL_TREE || IDENTIFIER_ANON_P (DECL_NAME (d))) { if (tc == RECORD_TYPE) r = &emit_class<class_> (t, file, line, clmn); @@ -1817,7 +1901,7 @@ create_type (tree t, ts << "start anon/stub " << gcc_tree_code_name(tc) << " at " << file << ":" << line << endl; - if (d == NULL_TREE || anon_aggrname_p (DECL_NAME (d))) + if (d == NULL_TREE || IDENTIFIER_ANON_P (DECL_NAME (d))) { r = &emit_enum (t, access, file, line, clmn); } @@ -2046,9 +2130,12 @@ emit_type_name (tree type, bool direct) if (i != 0) id += ", "; - // Assume type-only arguments. + // Assume integer and type-only arguments. // - id += emit_type_name (a); + if (TREE_CODE (a) == INTEGER_CST) + id += to_string (integer_value (a)); + else + id += emit_type_name (a); } id += '>'; diff --git a/odb/parser.hxx b/odb/parser.hxx index 29eaf7e..b26c8f1 100644 --- a/odb/parser.hxx +++ b/odb/parser.hxx @@ -1,5 +1,4 @@ // file : odb/parser.hxx -// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v3; see accompanying LICENSE file #ifndef ODB_PARSER_HXX diff --git a/odb/plugin.cxx b/odb/plugin.cxx index 10b0b01..c065a8a 100644 --- a/odb/plugin.cxx +++ b/odb/plugin.cxx @@ -1,5 +1,4 @@ // file : odb/plugin.cxx -// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v3; see accompanying LICENSE file #include <odb/gcc.hxx> // Keep it first. @@ -15,8 +14,8 @@ #include <cassert> #include <iostream> -#include <cutl/re.hxx> -#include <cutl/fs/path.hxx> +#include <libcutl/re.hxx> +#include <libcutl/fs/path.hxx> #include <odb/pragma.hxx> #include <odb/parser.hxx> diff --git a/odb/pragma.cxx b/odb/pragma.cxx index a20b1fb..6668733 100644 --- a/odb/pragma.cxx +++ b/odb/pragma.cxx @@ -1,5 +1,4 @@ // file : odb/pragma.cxx -// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v3; see accompanying LICENSE file #include <odb/gcc.hxx> @@ -1644,8 +1643,6 @@ handle_pragma (cxx_lexer& l, return; } - // base - // if (l.next (tl, &tn) != CPP_NUMBER || TREE_CODE (tn) != INTEGER_CST) { error (l) << "unsigned integer expected as batch size" << endl; diff --git a/odb/pragma.hxx b/odb/pragma.hxx index 078b3b8..0d4d3f1 100644 --- a/odb/pragma.hxx +++ b/odb/pragma.hxx @@ -1,5 +1,4 @@ // file : odb/pragma.hxx -// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v3; see accompanying LICENSE file #ifndef ODB_PRAGMA_HXX @@ -14,9 +13,9 @@ #include <odb/option-types.hxx> // database -#include <cutl/container/any.hxx> -#include <cutl/container/multi-index.hxx> -#include <cutl/compiler/context.hxx> +#include <libcutl/container/any.hxx> +#include <libcutl/container/multi-index.hxx> +#include <libcutl/compiler/context.hxx> struct virt_declaration { diff --git a/odb/options.cxx b/odb/pregenerated/odb/options.cxx index 98af4e9..da22570 100644 --- a/odb/options.cxx +++ b/odb/pregenerated/odb/options.cxx @@ -16,6 +16,7 @@ #include <set> #include <string> #include <vector> +#include <utility> #include <ostream> #include <sstream> #include <cstring> @@ -197,6 +198,7 @@ namespace cli else ++i_; + ++start_position_; return r; } else @@ -207,13 +209,25 @@ namespace cli skip () { if (i_ < argc_) + { ++i_; + ++start_position_; + } else throw eos_reached (); } + std::size_t argv_scanner:: + position () + { + return start_position_; + } + // argv_file_scanner // + int argv_file_scanner::zero_argc_ = 0; + std::string argv_file_scanner::empty_string_; + bool argv_file_scanner:: more () { @@ -286,7 +300,25 @@ namespace cli if (!more ()) throw eos_reached (); - return args_.empty () ? base::peek () : args_.front ().c_str (); + return args_.empty () ? base::peek () : args_.front ().value.c_str (); + } + + const std::string& argv_file_scanner:: + peek_file () + { + if (!more ()) + throw eos_reached (); + + return args_.empty () ? empty_string_ : *args_.front ().file; + } + + std::size_t argv_file_scanner:: + peek_line () + { + if (!more ()) + throw eos_reached (); + + return args_.empty () ? 0 : args_.front ().line; } const char* argv_file_scanner:: @@ -299,8 +331,9 @@ namespace cli return base::next (); else { - hold_[i_ == 0 ? ++i_ : --i_].swap (args_.front ()); + hold_[i_ == 0 ? ++i_ : --i_].swap (args_.front ().value); args_.pop_front (); + ++start_position_; return hold_[i_].c_str (); } } @@ -314,7 +347,10 @@ namespace cli if (args_.empty ()) return base::skip (); else + { args_.pop_front (); + ++start_position_; + } } const argv_file_scanner::option_info* argv_file_scanner:: @@ -327,6 +363,12 @@ namespace cli return 0; } + std::size_t argv_file_scanner:: + position () + { + return start_position_; + } + void argv_file_scanner:: load (const std::string& file) { @@ -337,7 +379,12 @@ namespace cli if (!is.is_open ()) throw file_io_failure (file); - while (!is.eof ()) + files_.push_back (file); + + arg a; + a.file = &*files_.rbegin (); + + for (a.line = 1; !is.eof (); ++a.line) { string line; getline (is, line); @@ -434,20 +481,38 @@ namespace cli if (oi->search_func != 0) { - std::string f (oi->search_func (s2.c_str (), oi->arg)); + string f (oi->search_func (s2.c_str (), oi->arg)); if (!f.empty ()) load (f); } else + { + // If the path of the file being parsed is not simple and the + // path of the file that needs to be loaded is relative, then + // complete the latter using the former as a base. + // +#ifndef _WIN32 + string::size_type p (file.find_last_of ('/')); + bool c (p != string::npos && s2[0] != '/'); +#else + string::size_type p (file.find_last_of ("/\\")); + bool c (p != string::npos && s2[1] != ':'); +#endif + if (c) + s2.insert (0, file, 0, p + 1); + load (s2); + } continue; } - args_.push_back (s1); + a.value = s1; + args_.push_back (a); } - args_.push_back (s2); + a.value = s2; + args_.push_back (a); } } @@ -472,7 +537,6 @@ namespace cli using namespace std; const char* o (s.next ()); - if (s.more ()) { string v (s.next ()); @@ -491,10 +555,31 @@ namespace cli struct parser<bool> { static void - parse (bool& x, scanner& s) + parse (bool& x, bool& xs, scanner& s) { - s.next (); - x = true; + const char* o (s.next ()); + + if (s.more ()) + { + const char* v (s.next ()); + + if (std::strcmp (v, "1") == 0 || + std::strcmp (v, "true") == 0 || + std::strcmp (v, "TRUE") == 0 || + std::strcmp (v, "True") == 0) + x = true; + else if (std::strcmp (v, "0") == 0 || + std::strcmp (v, "false") == 0 || + std::strcmp (v, "FALSE") == 0 || + std::strcmp (v, "False") == 0) + x = false; + else + throw invalid_value (o, v); + } + else + throw missing_value (o); + + xs = true; } }; @@ -516,6 +601,17 @@ namespace cli }; template <typename X> + struct parser<std::pair<X, std::size_t> > + { + static void + parse (std::pair<X, std::size_t>& x, bool& xs, scanner& s) + { + x.second = s.position (); + parser<X>::parse (x.first, xs, s); + } + }; + + template <typename X> struct parser<std::vector<X> > { static void @@ -529,11 +625,11 @@ namespace cli } }; - template <typename X> - struct parser<std::set<X> > + template <typename X, typename C> + struct parser<std::set<X, C> > { static void - parse (std::set<X>& c, bool& xs, scanner& s) + parse (std::set<X, C>& c, bool& xs, scanner& s) { X x; bool dummy; @@ -543,16 +639,17 @@ namespace cli } }; - template <typename K, typename V> - struct parser<std::map<K, V> > + template <typename K, typename V, typename C> + struct parser<std::map<K, V, C> > { static void - parse (std::map<K, V>& m, bool& xs, scanner& s) + parse (std::map<K, V, C>& m, bool& xs, scanner& s) { const char* o (s.next ()); if (s.more ()) { + std::size_t pos (s.position ()); std::string ov (s.next ()); std::string::size_type p = ov.find ('='); @@ -562,23 +659,24 @@ namespace cli std::string vstr (ov, (p != std::string::npos ? p + 1 : ov.size ())); int ac (2); - char* av[] = + char* av[] = { - const_cast<char*> (o), 0 + const_cast<char*> (o), + 0 }; bool dummy; if (!kstr.empty ()) { av[1] = const_cast<char*> (kstr.c_str ()); - argv_scanner s (0, ac, av); + argv_scanner s (0, ac, av, false, pos); parser<K>::parse (k, dummy, s); } if (!vstr.empty ()) { av[1] = const_cast<char*> (vstr.c_str ()); - argv_scanner s (0, ac, av); + argv_scanner s (0, ac, av, false, pos); parser<V>::parse (v, dummy, s); } @@ -591,6 +689,56 @@ namespace cli } }; + template <typename K, typename V, typename C> + struct parser<std::multimap<K, V, C> > + { + static void + parse (std::multimap<K, V, C>& m, bool& xs, scanner& s) + { + const char* o (s.next ()); + + if (s.more ()) + { + std::size_t pos (s.position ()); + std::string ov (s.next ()); + std::string::size_type p = ov.find ('='); + + K k = K (); + V v = V (); + std::string kstr (ov, 0, p); + std::string vstr (ov, (p != std::string::npos ? p + 1 : ov.size ())); + + int ac (2); + char* av[] = + { + const_cast<char*> (o), + 0 + }; + + bool dummy; + if (!kstr.empty ()) + { + av[1] = const_cast<char*> (kstr.c_str ()); + argv_scanner s (0, ac, av, false, pos); + parser<K>::parse (k, dummy, s); + } + + if (!vstr.empty ()) + { + av[1] = const_cast<char*> (vstr.c_str ()); + argv_scanner s (0, ac, av, false, pos); + parser<V>::parse (v, dummy, s); + } + + m.insert (typename std::multimap<K, V, C>::value_type (k, v)); + } + else + throw missing_value (o); + + xs = true; + } + }; + template <typename X, typename T, T X::*M> void thunk (X& x, scanner& s) @@ -598,6 +746,14 @@ namespace cli parser<T>::parse (x.*M, s); } + template <typename X, bool X::*M> + void + thunk (X& x, scanner& s) + { + s.next (); + x.*M = true; + } + template <typename X, typename T, T X::*M, bool X::*S> void thunk (X& x, scanner& s) @@ -607,14 +763,15 @@ namespace cli } #include <map> -#include <cstring> // options // options:: options () -: help_ (), +: build2_metadata_ (), + build2_metadata_specified_ (false), + help_ (), version_ (), I_ (), I_specified_ (false), @@ -825,7 +982,9 @@ options (int& argc, bool erase, ::cli::unknown_mode opt, ::cli::unknown_mode arg) -: help_ (), +: build2_metadata_ (), + build2_metadata_specified_ (false), + help_ (), version_ (), I_ (), I_specified_ (false), @@ -1039,7 +1198,9 @@ options (int start, bool erase, ::cli::unknown_mode opt, ::cli::unknown_mode arg) -: help_ (), +: build2_metadata_ (), + build2_metadata_specified_ (false), + help_ (), version_ (), I_ (), I_specified_ (false), @@ -1253,7 +1414,9 @@ options (int& argc, bool erase, ::cli::unknown_mode opt, ::cli::unknown_mode arg) -: help_ (), +: build2_metadata_ (), + build2_metadata_specified_ (false), + help_ (), version_ (), I_ (), I_specified_ (false), @@ -1469,7 +1632,9 @@ options (int start, bool erase, ::cli::unknown_mode opt, ::cli::unknown_mode arg) -: help_ (), +: build2_metadata_ (), + build2_metadata_specified_ (false), + help_ (), version_ (), I_ (), I_specified_ (false), @@ -1681,7 +1846,9 @@ options:: options (::cli::scanner& s, ::cli::unknown_mode opt, ::cli::unknown_mode arg) -: help_ (), +: build2_metadata_ (), + build2_metadata_specified_ (false), + help_ (), version_ (), I_ (), I_specified_ (false), @@ -2269,6 +2436,15 @@ static _cli_options_desc_type _cli_options_desc_; void options:: fill (::cli::options& os) { + // --build2-metadata + // + { + ::cli::option_names a; + std::string dv; + ::cli::option o ("--build2-metadata", a, false, dv); + os.push_back (o); + } + // --help // { @@ -3328,339 +3504,342 @@ struct _cli_options_map_init { _cli_options_map_init () { - _cli_options_map_["--help"] = - &::cli::thunk< options, bool, &options::help_ >; - _cli_options_map_["--version"] = - &::cli::thunk< options, bool, &options::version_ >; - _cli_options_map_["-I"] = + _cli_options_map_["--build2-metadata"] = + &::cli::thunk< options, std::uint64_t, &options::build2_metadata_, + &options::build2_metadata_specified_ >; + _cli_options_map_["--help"] = + &::cli::thunk< options, &options::help_ >; + _cli_options_map_["--version"] = + &::cli::thunk< options, &options::version_ >; + _cli_options_map_["-I"] = &::cli::thunk< options, std::vector<std::string>, &options::I_, &options::I_specified_ >; - _cli_options_map_["-D"] = + _cli_options_map_["-D"] = &::cli::thunk< options, std::vector<std::string>, &options::D_, &options::D_specified_ >; - _cli_options_map_["-U"] = + _cli_options_map_["-U"] = &::cli::thunk< options, std::vector<std::string>, &options::U_, &options::U_specified_ >; - _cli_options_map_["--database"] = + _cli_options_map_["--database"] = &::cli::thunk< options, std::vector< ::database>, &options::database_, &options::database_specified_ >; - _cli_options_map_["-d"] = + _cli_options_map_["-d"] = &::cli::thunk< options, std::vector< ::database>, &options::database_, &options::database_specified_ >; - _cli_options_map_["--multi-database"] = + _cli_options_map_["--multi-database"] = &::cli::thunk< options, ::multi_database, &options::multi_database_, &options::multi_database_specified_ >; - _cli_options_map_["-m"] = + _cli_options_map_["-m"] = &::cli::thunk< options, ::multi_database, &options::multi_database_, &options::multi_database_specified_ >; - _cli_options_map_["--default-database"] = + _cli_options_map_["--default-database"] = &::cli::thunk< options, ::database, &options::default_database_, &options::default_database_specified_ >; - _cli_options_map_["--generate-query"] = - &::cli::thunk< options, bool, &options::generate_query_ >; - _cli_options_map_["-q"] = - &::cli::thunk< options, bool, &options::generate_query_ >; - _cli_options_map_["--generate-prepared"] = - &::cli::thunk< options, bool, &options::generate_prepared_ >; - _cli_options_map_["--omit-unprepared"] = - &::cli::thunk< options, bool, &options::omit_unprepared_ >; - _cli_options_map_["--generate-session"] = - &::cli::thunk< options, bool, &options::generate_session_ >; - _cli_options_map_["-e"] = - &::cli::thunk< options, bool, &options::generate_session_ >; - _cli_options_map_["--generate-schema"] = - &::cli::thunk< options, bool, &options::generate_schema_ >; - _cli_options_map_["-s"] = - &::cli::thunk< options, bool, &options::generate_schema_ >; - _cli_options_map_["--generate-schema-only"] = - &::cli::thunk< options, bool, &options::generate_schema_only_ >; - _cli_options_map_["--suppress-migration"] = - &::cli::thunk< options, bool, &options::suppress_migration_ >; - _cli_options_map_["--suppress-schema-version"] = - &::cli::thunk< options, bool, &options::suppress_schema_version_ >; - _cli_options_map_["--schema-version-table"] = + _cli_options_map_["--generate-query"] = + &::cli::thunk< options, &options::generate_query_ >; + _cli_options_map_["-q"] = + &::cli::thunk< options, &options::generate_query_ >; + _cli_options_map_["--generate-prepared"] = + &::cli::thunk< options, &options::generate_prepared_ >; + _cli_options_map_["--omit-unprepared"] = + &::cli::thunk< options, &options::omit_unprepared_ >; + _cli_options_map_["--generate-session"] = + &::cli::thunk< options, &options::generate_session_ >; + _cli_options_map_["-e"] = + &::cli::thunk< options, &options::generate_session_ >; + _cli_options_map_["--generate-schema"] = + &::cli::thunk< options, &options::generate_schema_ >; + _cli_options_map_["-s"] = + &::cli::thunk< options, &options::generate_schema_ >; + _cli_options_map_["--generate-schema-only"] = + &::cli::thunk< options, &options::generate_schema_only_ >; + _cli_options_map_["--suppress-migration"] = + &::cli::thunk< options, &options::suppress_migration_ >; + _cli_options_map_["--suppress-schema-version"] = + &::cli::thunk< options, &options::suppress_schema_version_ >; + _cli_options_map_["--schema-version-table"] = &::cli::thunk< options, database_map<qname>, &options::schema_version_table_, &options::schema_version_table_specified_ >; - _cli_options_map_["--schema-format"] = + _cli_options_map_["--schema-format"] = &::cli::thunk< options, database_map<std::set< ::schema_format> >, &options::schema_format_, &options::schema_format_specified_ >; - _cli_options_map_["--omit-drop"] = - &::cli::thunk< options, bool, &options::omit_drop_ >; - _cli_options_map_["--omit-create"] = - &::cli::thunk< options, bool, &options::omit_create_ >; - _cli_options_map_["--schema-name"] = + _cli_options_map_["--omit-drop"] = + &::cli::thunk< options, &options::omit_drop_ >; + _cli_options_map_["--omit-create"] = + &::cli::thunk< options, &options::omit_create_ >; + _cli_options_map_["--schema-name"] = &::cli::thunk< options, database_map<std::string>, &options::schema_name_, &options::schema_name_specified_ >; - _cli_options_map_["--fkeys-deferrable-mode"] = + _cli_options_map_["--fkeys-deferrable-mode"] = &::cli::thunk< options, database_map<deferrable>, &options::fkeys_deferrable_mode_, &options::fkeys_deferrable_mode_specified_ >; - _cli_options_map_["--default-pointer"] = + _cli_options_map_["--default-pointer"] = &::cli::thunk< options, std::string, &options::default_pointer_, &options::default_pointer_specified_ >; - _cli_options_map_["--session-type"] = + _cli_options_map_["--session-type"] = &::cli::thunk< options, std::string, &options::session_type_, &options::session_type_specified_ >; - _cli_options_map_["--profile"] = + _cli_options_map_["--profile"] = &::cli::thunk< options, std::string, &options::profile_, &options::profile_specified_ >; - _cli_options_map_["-p"] = + _cli_options_map_["-p"] = &::cli::thunk< options, std::string, &options::profile_, &options::profile_specified_ >; - _cli_options_map_["--at-once"] = - &::cli::thunk< options, bool, &options::at_once_ >; - _cli_options_map_["--schema"] = + _cli_options_map_["--at-once"] = + &::cli::thunk< options, &options::at_once_ >; + _cli_options_map_["--schema"] = &::cli::thunk< options, database_map<qname>, &options::schema_, &options::schema_specified_ >; - _cli_options_map_["--export-symbol"] = + _cli_options_map_["--export-symbol"] = &::cli::thunk< options, database_map<std::string>, &options::export_symbol_, &options::export_symbol_specified_ >; - _cli_options_map_["--extern-symbol"] = + _cli_options_map_["--extern-symbol"] = &::cli::thunk< options, database_map<std::string>, &options::extern_symbol_, &options::extern_symbol_specified_ >; - _cli_options_map_["--std"] = + _cli_options_map_["--std"] = &::cli::thunk< options, cxx_version, &options::std_, &options::std_specified_ >; - _cli_options_map_["--warn-hard-add"] = - &::cli::thunk< options, bool, &options::warn_hard_add_ >; - _cli_options_map_["--warn-hard-delete"] = - &::cli::thunk< options, bool, &options::warn_hard_delete_ >; - _cli_options_map_["--warn-hard"] = - &::cli::thunk< options, bool, &options::warn_hard_ >; - _cli_options_map_["--output-dir"] = + _cli_options_map_["--warn-hard-add"] = + &::cli::thunk< options, &options::warn_hard_add_ >; + _cli_options_map_["--warn-hard-delete"] = + &::cli::thunk< options, &options::warn_hard_delete_ >; + _cli_options_map_["--warn-hard"] = + &::cli::thunk< options, &options::warn_hard_ >; + _cli_options_map_["--output-dir"] = &::cli::thunk< options, std::string, &options::output_dir_, &options::output_dir_specified_ >; - _cli_options_map_["-o"] = + _cli_options_map_["-o"] = &::cli::thunk< options, std::string, &options::output_dir_, &options::output_dir_specified_ >; - _cli_options_map_["--input-name"] = + _cli_options_map_["--input-name"] = &::cli::thunk< options, std::string, &options::input_name_, &options::input_name_specified_ >; - _cli_options_map_["--changelog"] = + _cli_options_map_["--changelog"] = &::cli::thunk< options, database_map<std::string>, &options::changelog_, &options::changelog_specified_ >; - _cli_options_map_["--changelog-in"] = + _cli_options_map_["--changelog-in"] = &::cli::thunk< options, database_map<std::string>, &options::changelog_in_, &options::changelog_in_specified_ >; - _cli_options_map_["--changelog-out"] = + _cli_options_map_["--changelog-out"] = &::cli::thunk< options, database_map<std::string>, &options::changelog_out_, &options::changelog_out_specified_ >; - _cli_options_map_["--changelog-dir"] = + _cli_options_map_["--changelog-dir"] = &::cli::thunk< options, database_map<std::string>, &options::changelog_dir_, &options::changelog_dir_specified_ >; - _cli_options_map_["--init-changelog"] = - &::cli::thunk< options, bool, &options::init_changelog_ >; - _cli_options_map_["--odb-file-suffix"] = + _cli_options_map_["--init-changelog"] = + &::cli::thunk< options, &options::init_changelog_ >; + _cli_options_map_["--odb-file-suffix"] = &::cli::thunk< options, database_map<std::string>, &options::odb_file_suffix_, &options::odb_file_suffix_specified_ >; - _cli_options_map_["--sql-file-suffix"] = + _cli_options_map_["--sql-file-suffix"] = &::cli::thunk< options, database_map<std::string>, &options::sql_file_suffix_, &options::sql_file_suffix_specified_ >; - _cli_options_map_["--schema-file-suffix"] = + _cli_options_map_["--schema-file-suffix"] = &::cli::thunk< options, database_map<std::string>, &options::schema_file_suffix_, &options::schema_file_suffix_specified_ >; - _cli_options_map_["--changelog-file-suffix"] = + _cli_options_map_["--changelog-file-suffix"] = &::cli::thunk< options, database_map<std::string>, &options::changelog_file_suffix_, &options::changelog_file_suffix_specified_ >; - _cli_options_map_["--hxx-suffix"] = + _cli_options_map_["--hxx-suffix"] = &::cli::thunk< options, std::string, &options::hxx_suffix_, &options::hxx_suffix_specified_ >; - _cli_options_map_["--ixx-suffix"] = + _cli_options_map_["--ixx-suffix"] = &::cli::thunk< options, std::string, &options::ixx_suffix_, &options::ixx_suffix_specified_ >; - _cli_options_map_["--cxx-suffix"] = + _cli_options_map_["--cxx-suffix"] = &::cli::thunk< options, std::string, &options::cxx_suffix_, &options::cxx_suffix_specified_ >; - _cli_options_map_["--sql-suffix"] = + _cli_options_map_["--sql-suffix"] = &::cli::thunk< options, std::string, &options::sql_suffix_, &options::sql_suffix_specified_ >; - _cli_options_map_["--changelog-suffix"] = + _cli_options_map_["--changelog-suffix"] = &::cli::thunk< options, std::string, &options::changelog_suffix_, &options::changelog_suffix_specified_ >; - _cli_options_map_["--hxx-prologue"] = + _cli_options_map_["--hxx-prologue"] = &::cli::thunk< options, database_map<std::vector<std::string> >, &options::hxx_prologue_, &options::hxx_prologue_specified_ >; - _cli_options_map_["--ixx-prologue"] = + _cli_options_map_["--ixx-prologue"] = &::cli::thunk< options, database_map<std::vector<std::string> >, &options::ixx_prologue_, &options::ixx_prologue_specified_ >; - _cli_options_map_["--cxx-prologue"] = + _cli_options_map_["--cxx-prologue"] = &::cli::thunk< options, database_map<std::vector<std::string> >, &options::cxx_prologue_, &options::cxx_prologue_specified_ >; - _cli_options_map_["--schema-prologue"] = + _cli_options_map_["--schema-prologue"] = &::cli::thunk< options, database_map<std::vector<std::string> >, &options::schema_prologue_, &options::schema_prologue_specified_ >; - _cli_options_map_["--sql-prologue"] = + _cli_options_map_["--sql-prologue"] = &::cli::thunk< options, database_map<std::vector<std::string> >, &options::sql_prologue_, &options::sql_prologue_specified_ >; - _cli_options_map_["--migration-prologue"] = + _cli_options_map_["--migration-prologue"] = &::cli::thunk< options, database_map<std::vector<std::string> >, &options::migration_prologue_, &options::migration_prologue_specified_ >; - _cli_options_map_["--sql-interlude"] = + _cli_options_map_["--sql-interlude"] = &::cli::thunk< options, database_map<std::vector<std::string> >, &options::sql_interlude_, &options::sql_interlude_specified_ >; - _cli_options_map_["--hxx-epilogue"] = + _cli_options_map_["--hxx-epilogue"] = &::cli::thunk< options, database_map<std::vector<std::string> >, &options::hxx_epilogue_, &options::hxx_epilogue_specified_ >; - _cli_options_map_["--ixx-epilogue"] = + _cli_options_map_["--ixx-epilogue"] = &::cli::thunk< options, database_map<std::vector<std::string> >, &options::ixx_epilogue_, &options::ixx_epilogue_specified_ >; - _cli_options_map_["--cxx-epilogue"] = + _cli_options_map_["--cxx-epilogue"] = &::cli::thunk< options, database_map<std::vector<std::string> >, &options::cxx_epilogue_, &options::cxx_epilogue_specified_ >; - _cli_options_map_["--schema-epilogue"] = + _cli_options_map_["--schema-epilogue"] = &::cli::thunk< options, database_map<std::vector<std::string> >, &options::schema_epilogue_, &options::schema_epilogue_specified_ >; - _cli_options_map_["--sql-epilogue"] = + _cli_options_map_["--sql-epilogue"] = &::cli::thunk< options, database_map<std::vector<std::string> >, &options::sql_epilogue_, &options::sql_epilogue_specified_ >; - _cli_options_map_["--migration-epilogue"] = + _cli_options_map_["--migration-epilogue"] = &::cli::thunk< options, database_map<std::vector<std::string> >, &options::migration_epilogue_, &options::migration_epilogue_specified_ >; - _cli_options_map_["--hxx-prologue-file"] = + _cli_options_map_["--hxx-prologue-file"] = &::cli::thunk< options, database_map<std::vector<std::string> >, &options::hxx_prologue_file_, &options::hxx_prologue_file_specified_ >; - _cli_options_map_["--ixx-prologue-file"] = + _cli_options_map_["--ixx-prologue-file"] = &::cli::thunk< options, database_map<std::vector<std::string> >, &options::ixx_prologue_file_, &options::ixx_prologue_file_specified_ >; - _cli_options_map_["--cxx-prologue-file"] = + _cli_options_map_["--cxx-prologue-file"] = &::cli::thunk< options, database_map<std::vector<std::string> >, &options::cxx_prologue_file_, &options::cxx_prologue_file_specified_ >; - _cli_options_map_["--schema-prologue-file"] = + _cli_options_map_["--schema-prologue-file"] = &::cli::thunk< options, database_map<std::vector<std::string> >, &options::schema_prologue_file_, &options::schema_prologue_file_specified_ >; - _cli_options_map_["--sql-prologue-file"] = + _cli_options_map_["--sql-prologue-file"] = &::cli::thunk< options, database_map<std::vector<std::string> >, &options::sql_prologue_file_, &options::sql_prologue_file_specified_ >; - _cli_options_map_["--migration-prologue-file"] = + _cli_options_map_["--migration-prologue-file"] = &::cli::thunk< options, database_map<std::vector<std::string> >, &options::migration_prologue_file_, &options::migration_prologue_file_specified_ >; - _cli_options_map_["--sql-interlude-file"] = + _cli_options_map_["--sql-interlude-file"] = &::cli::thunk< options, database_map<std::vector<std::string> >, &options::sql_interlude_file_, &options::sql_interlude_file_specified_ >; - _cli_options_map_["--hxx-epilogue-file"] = + _cli_options_map_["--hxx-epilogue-file"] = &::cli::thunk< options, database_map<std::vector<std::string> >, &options::hxx_epilogue_file_, &options::hxx_epilogue_file_specified_ >; - _cli_options_map_["--ixx-epilogue-file"] = + _cli_options_map_["--ixx-epilogue-file"] = &::cli::thunk< options, database_map<std::vector<std::string> >, &options::ixx_epilogue_file_, &options::ixx_epilogue_file_specified_ >; - _cli_options_map_["--cxx-epilogue-file"] = + _cli_options_map_["--cxx-epilogue-file"] = &::cli::thunk< options, database_map<std::vector<std::string> >, &options::cxx_epilogue_file_, &options::cxx_epilogue_file_specified_ >; - _cli_options_map_["--schema-epilogue-file"] = + _cli_options_map_["--schema-epilogue-file"] = &::cli::thunk< options, database_map<std::vector<std::string> >, &options::schema_epilogue_file_, &options::schema_epilogue_file_specified_ >; - _cli_options_map_["--sql-epilogue-file"] = + _cli_options_map_["--sql-epilogue-file"] = &::cli::thunk< options, database_map<std::vector<std::string> >, &options::sql_epilogue_file_, &options::sql_epilogue_file_specified_ >; - _cli_options_map_["--migration-epilogue-file"] = + _cli_options_map_["--migration-epilogue-file"] = &::cli::thunk< options, database_map<std::vector<std::string> >, &options::migration_epilogue_file_, &options::migration_epilogue_file_specified_ >; - _cli_options_map_["--odb-prologue"] = + _cli_options_map_["--odb-prologue"] = &::cli::thunk< options, database_map<std::vector<std::string> >, &options::odb_prologue_, &options::odb_prologue_specified_ >; - _cli_options_map_["--odb-prologue-file"] = + _cli_options_map_["--odb-prologue-file"] = &::cli::thunk< options, database_map<std::vector<std::string> >, &options::odb_prologue_file_, &options::odb_prologue_file_specified_ >; - _cli_options_map_["--odb-epilogue"] = + _cli_options_map_["--odb-epilogue"] = &::cli::thunk< options, database_map<std::vector<std::string> >, &options::odb_epilogue_, &options::odb_epilogue_specified_ >; - _cli_options_map_["--odb-epilogue-file"] = + _cli_options_map_["--odb-epilogue-file"] = &::cli::thunk< options, database_map<std::vector<std::string> >, &options::odb_epilogue_file_, &options::odb_epilogue_file_specified_ >; - _cli_options_map_["--table-prefix"] = + _cli_options_map_["--table-prefix"] = &::cli::thunk< options, database_map<std::string>, &options::table_prefix_, &options::table_prefix_specified_ >; - _cli_options_map_["--index-suffix"] = + _cli_options_map_["--index-suffix"] = &::cli::thunk< options, database_map<std::string>, &options::index_suffix_, &options::index_suffix_specified_ >; - _cli_options_map_["--fkey-suffix"] = + _cli_options_map_["--fkey-suffix"] = &::cli::thunk< options, database_map<std::string>, &options::fkey_suffix_, &options::fkey_suffix_specified_ >; - _cli_options_map_["--sequence-suffix"] = + _cli_options_map_["--sequence-suffix"] = &::cli::thunk< options, database_map<std::string>, &options::sequence_suffix_, &options::sequence_suffix_specified_ >; - _cli_options_map_["--sql-name-case"] = + _cli_options_map_["--sql-name-case"] = &::cli::thunk< options, database_map<name_case>, &options::sql_name_case_, &options::sql_name_case_specified_ >; - _cli_options_map_["--table-regex"] = + _cli_options_map_["--table-regex"] = &::cli::thunk< options, database_map<std::vector<std::string> >, &options::table_regex_, &options::table_regex_specified_ >; - _cli_options_map_["--column-regex"] = + _cli_options_map_["--column-regex"] = &::cli::thunk< options, database_map<std::vector<std::string> >, &options::column_regex_, &options::column_regex_specified_ >; - _cli_options_map_["--index-regex"] = + _cli_options_map_["--index-regex"] = &::cli::thunk< options, database_map<std::vector<std::string> >, &options::index_regex_, &options::index_regex_specified_ >; - _cli_options_map_["--fkey-regex"] = + _cli_options_map_["--fkey-regex"] = &::cli::thunk< options, database_map<std::vector<std::string> >, &options::fkey_regex_, &options::fkey_regex_specified_ >; - _cli_options_map_["--sequence-regex"] = + _cli_options_map_["--sequence-regex"] = &::cli::thunk< options, database_map<std::vector<std::string> >, &options::sequence_regex_, &options::sequence_regex_specified_ >; - _cli_options_map_["--statement-regex"] = + _cli_options_map_["--statement-regex"] = &::cli::thunk< options, database_map<std::vector<std::string> >, &options::statement_regex_, &options::statement_regex_specified_ >; - _cli_options_map_["--sql-name-regex"] = + _cli_options_map_["--sql-name-regex"] = &::cli::thunk< options, database_map<std::vector<std::string> >, &options::sql_name_regex_, &options::sql_name_regex_specified_ >; - _cli_options_map_["--sql-name-regex-trace"] = - &::cli::thunk< options, bool, &options::sql_name_regex_trace_ >; - _cli_options_map_["--accessor-regex"] = + _cli_options_map_["--sql-name-regex-trace"] = + &::cli::thunk< options, &options::sql_name_regex_trace_ >; + _cli_options_map_["--accessor-regex"] = &::cli::thunk< options, std::vector<std::string>, &options::accessor_regex_, &options::accessor_regex_specified_ >; - _cli_options_map_["--accessor-regex-trace"] = - &::cli::thunk< options, bool, &options::accessor_regex_trace_ >; - _cli_options_map_["--modifier-regex"] = + _cli_options_map_["--accessor-regex-trace"] = + &::cli::thunk< options, &options::accessor_regex_trace_ >; + _cli_options_map_["--modifier-regex"] = &::cli::thunk< options, std::vector<std::string>, &options::modifier_regex_, &options::modifier_regex_specified_ >; - _cli_options_map_["--modifier-regex-trace"] = - &::cli::thunk< options, bool, &options::modifier_regex_trace_ >; - _cli_options_map_["--include-with-brackets"] = - &::cli::thunk< options, bool, &options::include_with_brackets_ >; - _cli_options_map_["--include-prefix"] = + _cli_options_map_["--modifier-regex-trace"] = + &::cli::thunk< options, &options::modifier_regex_trace_ >; + _cli_options_map_["--include-with-brackets"] = + &::cli::thunk< options, &options::include_with_brackets_ >; + _cli_options_map_["--include-prefix"] = &::cli::thunk< options, std::string, &options::include_prefix_, &options::include_prefix_specified_ >; - _cli_options_map_["--include-regex"] = + _cli_options_map_["--include-regex"] = &::cli::thunk< options, std::vector<std::string>, &options::include_regex_, &options::include_regex_specified_ >; - _cli_options_map_["--include-regex-trace"] = - &::cli::thunk< options, bool, &options::include_regex_trace_ >; - _cli_options_map_["--guard-prefix"] = + _cli_options_map_["--include-regex-trace"] = + &::cli::thunk< options, &options::include_regex_trace_ >; + _cli_options_map_["--guard-prefix"] = &::cli::thunk< options, std::string, &options::guard_prefix_, &options::guard_prefix_specified_ >; - _cli_options_map_["--show-sloc"] = - &::cli::thunk< options, bool, &options::show_sloc_ >; - _cli_options_map_["--sloc-limit"] = + _cli_options_map_["--show-sloc"] = + &::cli::thunk< options, &options::show_sloc_ >; + _cli_options_map_["--sloc-limit"] = &::cli::thunk< options, std::size_t, &options::sloc_limit_, &options::sloc_limit_specified_ >; - _cli_options_map_["--options-file"] = + _cli_options_map_["--options-file"] = &::cli::thunk< options, std::string, &options::options_file_, &options::options_file_specified_ >; - _cli_options_map_["-x"] = + _cli_options_map_["-x"] = &::cli::thunk< options, std::vector<std::string>, &options::x_, &options::x_specified_ >; - _cli_options_map_["-v"] = - &::cli::thunk< options, bool, &options::v_ >; - _cli_options_map_["--trace"] = - &::cli::thunk< options, bool, &options::trace_ >; - _cli_options_map_["--mysql-engine"] = + _cli_options_map_["-v"] = + &::cli::thunk< options, &options::v_ >; + _cli_options_map_["--trace"] = + &::cli::thunk< options, &options::trace_ >; + _cli_options_map_["--mysql-engine"] = &::cli::thunk< options, std::string, &options::mysql_engine_, &options::mysql_engine_specified_ >; - _cli_options_map_["--sqlite-override-null"] = - &::cli::thunk< options, bool, &options::sqlite_override_null_ >; - _cli_options_map_["--sqlite-lax-auto-id"] = - &::cli::thunk< options, bool, &options::sqlite_lax_auto_id_ >; - _cli_options_map_["--pgsql-server-version"] = + _cli_options_map_["--sqlite-override-null"] = + &::cli::thunk< options, &options::sqlite_override_null_ >; + _cli_options_map_["--sqlite-lax-auto-id"] = + &::cli::thunk< options, &options::sqlite_lax_auto_id_ >; + _cli_options_map_["--pgsql-server-version"] = &::cli::thunk< options, ::pgsql_version, &options::pgsql_server_version_, &options::pgsql_server_version_specified_ >; - _cli_options_map_["--oracle-client-version"] = + _cli_options_map_["--oracle-client-version"] = &::cli::thunk< options, ::oracle_version, &options::oracle_client_version_, &options::oracle_client_version_specified_ >; - _cli_options_map_["--oracle-warn-truncation"] = - &::cli::thunk< options, bool, &options::oracle_warn_truncation_ >; - _cli_options_map_["--mssql-server-version"] = + _cli_options_map_["--oracle-warn-truncation"] = + &::cli::thunk< options, &options::oracle_warn_truncation_ >; + _cli_options_map_["--mssql-server-version"] = &::cli::thunk< options, ::mssql_version, &options::mssql_server_version_, &options::mssql_server_version_specified_ >; - _cli_options_map_["--mssql-short-limit"] = + _cli_options_map_["--mssql-short-limit"] = &::cli::thunk< options, unsigned int, &options::mssql_short_limit_, &options::mssql_short_limit_specified_ >; } @@ -3774,7 +3953,7 @@ _parse (::cli::scanner& s, cf[2] = '\0'; int ac (1); - char* av[] = + char* av[] = { cf }; diff --git a/odb/options.hxx b/odb/pregenerated/odb/options.hxx index 883ad20..74406a0 100644 --- a/odb/options.hxx +++ b/odb/pregenerated/odb/options.hxx @@ -12,6 +12,7 @@ // // End prologue. +#include <list> #include <deque> #include <map> #include <vector> @@ -237,6 +238,14 @@ namespace cli // for the two previous arguments up until a call to a third // peek() or next(). // + // The position() function returns a monotonically-increasing + // number which, if stored, can later be used to determine the + // relative position of the argument returned by the following + // call to next(). Note that if multiple scanners are used to + // extract arguments from multiple sources, then the end + // position of the previous scanner should be used as the + // start position of the next. + // class scanner { public: @@ -254,13 +263,24 @@ namespace cli virtual void skip () = 0; + + virtual std::size_t + position () = 0; }; class argv_scanner: public scanner { public: - argv_scanner (int& argc, char** argv, bool erase = false); - argv_scanner (int start, int& argc, char** argv, bool erase = false); + argv_scanner (int& argc, + char** argv, + bool erase = false, + std::size_t start_position = 0); + + argv_scanner (int start, + int& argc, + char** argv, + bool erase = false, + std::size_t start_position = 0); int end () const; @@ -277,7 +297,11 @@ namespace cli virtual void skip (); - private: + virtual std::size_t + position (); + + protected: + std::size_t start_position_; int i_; int& argc_; char** argv_; @@ -290,13 +314,19 @@ namespace cli argv_file_scanner (int& argc, char** argv, const std::string& option, - bool erase = false); + bool erase = false, + std::size_t start_position = 0); argv_file_scanner (int start, int& argc, char** argv, const std::string& option, - bool erase = false); + bool erase = false, + std::size_t start_position = 0); + + argv_file_scanner (const std::string& file, + const std::string& option, + std::size_t start_position = 0); struct option_info { @@ -313,14 +343,21 @@ namespace cli char** argv, const option_info* options, std::size_t options_count, - bool erase = false); + bool erase = false, + std::size_t start_position = 0); argv_file_scanner (int start, int& argc, char** argv, const option_info* options, std::size_t options_count, - bool erase = false); + bool erase = false, + std::size_t start_position = 0); + + argv_file_scanner (const std::string& file, + const option_info* options = 0, + std::size_t options_count = 0, + std::size_t start_position = 0); virtual bool more (); @@ -334,6 +371,22 @@ namespace cli virtual void skip (); + virtual std::size_t + position (); + + // Return the file path if the peeked at argument came from a file and + // the empty string otherwise. The reference is guaranteed to be valid + // till the end of the scanner lifetime. + // + const std::string& + peek_file (); + + // Return the 1-based line number if the peeked at argument came from + // a file and zero otherwise. + // + std::size_t + peek_line (); + private: const option_info* find (const char*) const; @@ -348,7 +401,15 @@ namespace cli const option_info* options_; std::size_t options_count_; - std::deque<std::string> args_; + struct arg + { + std::string value; + const std::string* file; + std::size_t line; + }; + + std::deque<arg> args_; + std::list<std::string> files_; // Circular buffer of two arguments. // @@ -356,6 +417,9 @@ namespace cli std::size_t i_; bool skip_; + + static int zero_argc_; + static std::string empty_string_; }; typedef std::vector<std::string> option_names; @@ -416,6 +480,8 @@ namespace cli #include <cstddef> +#include <cstdint> + #include <odb/option-types.hxx> class options @@ -457,6 +523,21 @@ class options // Option accessors and modifiers. // + const std::uint64_t& + build2_metadata () const; + + std::uint64_t& + build2_metadata (); + + void + build2_metadata (const std::uint64_t&); + + bool + build2_metadata_specified () const; + + void + build2_metadata_specified (bool); + const bool& help () const; @@ -2043,6 +2124,8 @@ class options ::cli::unknown_mode argument); public: + std::uint64_t build2_metadata_; + bool build2_metadata_specified_; bool help_; bool version_; std::vector<std::string> I_; diff --git a/odb/options.ixx b/odb/pregenerated/odb/options.ixx index 8fafd73..9a78a2e 100644 --- a/odb/options.ixx +++ b/odb/pregenerated/odb/options.ixx @@ -141,14 +141,29 @@ namespace cli // argv_scanner // inline argv_scanner:: - argv_scanner (int& argc, char** argv, bool erase) - : i_ (1), argc_ (argc), argv_ (argv), erase_ (erase) + argv_scanner (int& argc, + char** argv, + bool erase, + std::size_t sp) + : start_position_ (sp + 1), + i_ (1), + argc_ (argc), + argv_ (argv), + erase_ (erase) { } inline argv_scanner:: - argv_scanner (int start, int& argc, char** argv, bool erase) - : i_ (start), argc_ (argc), argv_ (argv), erase_ (erase) + argv_scanner (int start, + int& argc, + char** argv, + bool erase, + std::size_t sp) + : start_position_ (sp + static_cast<std::size_t> (start)), + i_ (start), + argc_ (argc), + argv_ (argv), + erase_ (erase) { } @@ -164,8 +179,9 @@ namespace cli argv_file_scanner (int& argc, char** argv, const std::string& option, - bool erase) - : argv_scanner (argc, argv, erase), + bool erase, + std::size_t sp) + : argv_scanner (argc, argv, erase, sp), option_ (option), options_ (&option_info_), options_count_ (1), @@ -181,8 +197,9 @@ namespace cli int& argc, char** argv, const std::string& option, - bool erase) - : argv_scanner (start, argc, argv, erase), + bool erase, + std::size_t sp) + : argv_scanner (start, argc, argv, erase, sp), option_ (option), options_ (&option_info_), options_count_ (1), @@ -194,12 +211,30 @@ namespace cli } inline argv_file_scanner:: + argv_file_scanner (const std::string& file, + const std::string& option, + std::size_t sp) + : argv_scanner (0, zero_argc_, 0, sp), + option_ (option), + options_ (&option_info_), + options_count_ (1), + i_ (1), + skip_ (false) + { + option_info_.option = option_.c_str (); + option_info_.search_func = 0; + + load (file); + } + + inline argv_file_scanner:: argv_file_scanner (int& argc, char** argv, const option_info* options, std::size_t options_count, - bool erase) - : argv_scanner (argc, argv, erase), + bool erase, + std::size_t sp) + : argv_scanner (argc, argv, erase, sp), options_ (options), options_count_ (options_count), i_ (1), @@ -213,13 +248,28 @@ namespace cli char** argv, const option_info* options, std::size_t options_count, - bool erase) - : argv_scanner (start, argc, argv, erase), + bool erase, + std::size_t sp) + : argv_scanner (start, argc, argv, erase, sp), + options_ (options), + options_count_ (options_count), + i_ (1), + skip_ (false) + { + } + + inline argv_file_scanner:: + argv_file_scanner (const std::string& file, + const option_info* options, + std::size_t options_count, + std::size_t sp) + : argv_scanner (0, zero_argc_, 0, sp), options_ (options), options_count_ (options_count), i_ (1), skip_ (false) { + load (file); } inline const std::string& option:: @@ -271,6 +321,36 @@ namespace cli // options // +inline const std::uint64_t& options:: +build2_metadata () const +{ + return this->build2_metadata_; +} + +inline std::uint64_t& options:: +build2_metadata () +{ + return this->build2_metadata_; +} + +inline void options:: +build2_metadata (const std::uint64_t& x) +{ + this->build2_metadata_ = x; +} + +inline bool options:: +build2_metadata_specified () const +{ + return this->build2_metadata_specified_; +} + +inline void options:: +build2_metadata_specified (bool x) +{ + this->build2_metadata_specified_ = x; +} + inline const bool& options:: help () const { @@ -284,7 +364,7 @@ help () } inline void options:: -help(const bool& x) +help (const bool& x) { this->help_ = x; } @@ -302,7 +382,7 @@ version () } inline void options:: -version(const bool& x) +version (const bool& x) { this->version_ = x; } @@ -320,7 +400,7 @@ I () } inline void options:: -I(const std::vector<std::string>& x) +I (const std::vector<std::string>& x) { this->I_ = x; } @@ -332,7 +412,7 @@ I_specified () const } inline void options:: -I_specified(bool x) +I_specified (bool x) { this->I_specified_ = x; } @@ -350,7 +430,7 @@ D () } inline void options:: -D(const std::vector<std::string>& x) +D (const std::vector<std::string>& x) { this->D_ = x; } @@ -362,7 +442,7 @@ D_specified () const } inline void options:: -D_specified(bool x) +D_specified (bool x) { this->D_specified_ = x; } @@ -380,7 +460,7 @@ U () } inline void options:: -U(const std::vector<std::string>& x) +U (const std::vector<std::string>& x) { this->U_ = x; } @@ -392,7 +472,7 @@ U_specified () const } inline void options:: -U_specified(bool x) +U_specified (bool x) { this->U_specified_ = x; } @@ -410,7 +490,7 @@ database () } inline void options:: -database(const std::vector< ::database>& x) +database (const std::vector< ::database>& x) { this->database_ = x; } @@ -422,7 +502,7 @@ database_specified () const } inline void options:: -database_specified(bool x) +database_specified (bool x) { this->database_specified_ = x; } @@ -440,7 +520,7 @@ multi_database () } inline void options:: -multi_database(const ::multi_database& x) +multi_database (const ::multi_database& x) { this->multi_database_ = x; } @@ -452,7 +532,7 @@ multi_database_specified () const } inline void options:: -multi_database_specified(bool x) +multi_database_specified (bool x) { this->multi_database_specified_ = x; } @@ -470,7 +550,7 @@ default_database () } inline void options:: -default_database(const ::database& x) +default_database (const ::database& x) { this->default_database_ = x; } @@ -482,7 +562,7 @@ default_database_specified () const } inline void options:: -default_database_specified(bool x) +default_database_specified (bool x) { this->default_database_specified_ = x; } @@ -500,7 +580,7 @@ generate_query () } inline void options:: -generate_query(const bool& x) +generate_query (const bool& x) { this->generate_query_ = x; } @@ -518,7 +598,7 @@ generate_prepared () } inline void options:: -generate_prepared(const bool& x) +generate_prepared (const bool& x) { this->generate_prepared_ = x; } @@ -536,7 +616,7 @@ omit_unprepared () } inline void options:: -omit_unprepared(const bool& x) +omit_unprepared (const bool& x) { this->omit_unprepared_ = x; } @@ -554,7 +634,7 @@ generate_session () } inline void options:: -generate_session(const bool& x) +generate_session (const bool& x) { this->generate_session_ = x; } @@ -572,7 +652,7 @@ generate_schema () } inline void options:: -generate_schema(const bool& x) +generate_schema (const bool& x) { this->generate_schema_ = x; } @@ -590,7 +670,7 @@ generate_schema_only () } inline void options:: -generate_schema_only(const bool& x) +generate_schema_only (const bool& x) { this->generate_schema_only_ = x; } @@ -608,7 +688,7 @@ suppress_migration () } inline void options:: -suppress_migration(const bool& x) +suppress_migration (const bool& x) { this->suppress_migration_ = x; } @@ -626,7 +706,7 @@ suppress_schema_version () } inline void options:: -suppress_schema_version(const bool& x) +suppress_schema_version (const bool& x) { this->suppress_schema_version_ = x; } @@ -644,7 +724,7 @@ schema_version_table () } inline void options:: -schema_version_table(const database_map<qname>& x) +schema_version_table (const database_map<qname>& x) { this->schema_version_table_ = x; } @@ -656,7 +736,7 @@ schema_version_table_specified () const } inline void options:: -schema_version_table_specified(bool x) +schema_version_table_specified (bool x) { this->schema_version_table_specified_ = x; } @@ -674,7 +754,7 @@ schema_format () } inline void options:: -schema_format(const database_map<std::set< ::schema_format> >& x) +schema_format (const database_map<std::set< ::schema_format> >& x) { this->schema_format_ = x; } @@ -686,7 +766,7 @@ schema_format_specified () const } inline void options:: -schema_format_specified(bool x) +schema_format_specified (bool x) { this->schema_format_specified_ = x; } @@ -704,7 +784,7 @@ omit_drop () } inline void options:: -omit_drop(const bool& x) +omit_drop (const bool& x) { this->omit_drop_ = x; } @@ -722,7 +802,7 @@ omit_create () } inline void options:: -omit_create(const bool& x) +omit_create (const bool& x) { this->omit_create_ = x; } @@ -740,7 +820,7 @@ schema_name () } inline void options:: -schema_name(const database_map<std::string>& x) +schema_name (const database_map<std::string>& x) { this->schema_name_ = x; } @@ -752,7 +832,7 @@ schema_name_specified () const } inline void options:: -schema_name_specified(bool x) +schema_name_specified (bool x) { this->schema_name_specified_ = x; } @@ -770,7 +850,7 @@ fkeys_deferrable_mode () } inline void options:: -fkeys_deferrable_mode(const database_map<deferrable>& x) +fkeys_deferrable_mode (const database_map<deferrable>& x) { this->fkeys_deferrable_mode_ = x; } @@ -782,7 +862,7 @@ fkeys_deferrable_mode_specified () const } inline void options:: -fkeys_deferrable_mode_specified(bool x) +fkeys_deferrable_mode_specified (bool x) { this->fkeys_deferrable_mode_specified_ = x; } @@ -800,7 +880,7 @@ default_pointer () } inline void options:: -default_pointer(const std::string& x) +default_pointer (const std::string& x) { this->default_pointer_ = x; } @@ -812,7 +892,7 @@ default_pointer_specified () const } inline void options:: -default_pointer_specified(bool x) +default_pointer_specified (bool x) { this->default_pointer_specified_ = x; } @@ -830,7 +910,7 @@ session_type () } inline void options:: -session_type(const std::string& x) +session_type (const std::string& x) { this->session_type_ = x; } @@ -842,7 +922,7 @@ session_type_specified () const } inline void options:: -session_type_specified(bool x) +session_type_specified (bool x) { this->session_type_specified_ = x; } @@ -860,7 +940,7 @@ profile () } inline void options:: -profile(const std::string& x) +profile (const std::string& x) { this->profile_ = x; } @@ -872,7 +952,7 @@ profile_specified () const } inline void options:: -profile_specified(bool x) +profile_specified (bool x) { this->profile_specified_ = x; } @@ -890,7 +970,7 @@ at_once () } inline void options:: -at_once(const bool& x) +at_once (const bool& x) { this->at_once_ = x; } @@ -908,7 +988,7 @@ schema () } inline void options:: -schema(const database_map<qname>& x) +schema (const database_map<qname>& x) { this->schema_ = x; } @@ -920,7 +1000,7 @@ schema_specified () const } inline void options:: -schema_specified(bool x) +schema_specified (bool x) { this->schema_specified_ = x; } @@ -938,7 +1018,7 @@ export_symbol () } inline void options:: -export_symbol(const database_map<std::string>& x) +export_symbol (const database_map<std::string>& x) { this->export_symbol_ = x; } @@ -950,7 +1030,7 @@ export_symbol_specified () const } inline void options:: -export_symbol_specified(bool x) +export_symbol_specified (bool x) { this->export_symbol_specified_ = x; } @@ -968,7 +1048,7 @@ extern_symbol () } inline void options:: -extern_symbol(const database_map<std::string>& x) +extern_symbol (const database_map<std::string>& x) { this->extern_symbol_ = x; } @@ -980,7 +1060,7 @@ extern_symbol_specified () const } inline void options:: -extern_symbol_specified(bool x) +extern_symbol_specified (bool x) { this->extern_symbol_specified_ = x; } @@ -998,7 +1078,7 @@ std () } inline void options:: -std(const cxx_version& x) +std (const cxx_version& x) { this->std_ = x; } @@ -1010,7 +1090,7 @@ std_specified () const } inline void options:: -std_specified(bool x) +std_specified (bool x) { this->std_specified_ = x; } @@ -1028,7 +1108,7 @@ warn_hard_add () } inline void options:: -warn_hard_add(const bool& x) +warn_hard_add (const bool& x) { this->warn_hard_add_ = x; } @@ -1046,7 +1126,7 @@ warn_hard_delete () } inline void options:: -warn_hard_delete(const bool& x) +warn_hard_delete (const bool& x) { this->warn_hard_delete_ = x; } @@ -1064,7 +1144,7 @@ warn_hard () } inline void options:: -warn_hard(const bool& x) +warn_hard (const bool& x) { this->warn_hard_ = x; } @@ -1082,7 +1162,7 @@ output_dir () } inline void options:: -output_dir(const std::string& x) +output_dir (const std::string& x) { this->output_dir_ = x; } @@ -1094,7 +1174,7 @@ output_dir_specified () const } inline void options:: -output_dir_specified(bool x) +output_dir_specified (bool x) { this->output_dir_specified_ = x; } @@ -1112,7 +1192,7 @@ input_name () } inline void options:: -input_name(const std::string& x) +input_name (const std::string& x) { this->input_name_ = x; } @@ -1124,7 +1204,7 @@ input_name_specified () const } inline void options:: -input_name_specified(bool x) +input_name_specified (bool x) { this->input_name_specified_ = x; } @@ -1142,7 +1222,7 @@ changelog () } inline void options:: -changelog(const database_map<std::string>& x) +changelog (const database_map<std::string>& x) { this->changelog_ = x; } @@ -1154,7 +1234,7 @@ changelog_specified () const } inline void options:: -changelog_specified(bool x) +changelog_specified (bool x) { this->changelog_specified_ = x; } @@ -1172,7 +1252,7 @@ changelog_in () } inline void options:: -changelog_in(const database_map<std::string>& x) +changelog_in (const database_map<std::string>& x) { this->changelog_in_ = x; } @@ -1184,7 +1264,7 @@ changelog_in_specified () const } inline void options:: -changelog_in_specified(bool x) +changelog_in_specified (bool x) { this->changelog_in_specified_ = x; } @@ -1202,7 +1282,7 @@ changelog_out () } inline void options:: -changelog_out(const database_map<std::string>& x) +changelog_out (const database_map<std::string>& x) { this->changelog_out_ = x; } @@ -1214,7 +1294,7 @@ changelog_out_specified () const } inline void options:: -changelog_out_specified(bool x) +changelog_out_specified (bool x) { this->changelog_out_specified_ = x; } @@ -1232,7 +1312,7 @@ changelog_dir () } inline void options:: -changelog_dir(const database_map<std::string>& x) +changelog_dir (const database_map<std::string>& x) { this->changelog_dir_ = x; } @@ -1244,7 +1324,7 @@ changelog_dir_specified () const } inline void options:: -changelog_dir_specified(bool x) +changelog_dir_specified (bool x) { this->changelog_dir_specified_ = x; } @@ -1262,7 +1342,7 @@ init_changelog () } inline void options:: -init_changelog(const bool& x) +init_changelog (const bool& x) { this->init_changelog_ = x; } @@ -1280,7 +1360,7 @@ odb_file_suffix () } inline void options:: -odb_file_suffix(const database_map<std::string>& x) +odb_file_suffix (const database_map<std::string>& x) { this->odb_file_suffix_ = x; } @@ -1292,7 +1372,7 @@ odb_file_suffix_specified () const } inline void options:: -odb_file_suffix_specified(bool x) +odb_file_suffix_specified (bool x) { this->odb_file_suffix_specified_ = x; } @@ -1310,7 +1390,7 @@ sql_file_suffix () } inline void options:: -sql_file_suffix(const database_map<std::string>& x) +sql_file_suffix (const database_map<std::string>& x) { this->sql_file_suffix_ = x; } @@ -1322,7 +1402,7 @@ sql_file_suffix_specified () const } inline void options:: -sql_file_suffix_specified(bool x) +sql_file_suffix_specified (bool x) { this->sql_file_suffix_specified_ = x; } @@ -1340,7 +1420,7 @@ schema_file_suffix () } inline void options:: -schema_file_suffix(const database_map<std::string>& x) +schema_file_suffix (const database_map<std::string>& x) { this->schema_file_suffix_ = x; } @@ -1352,7 +1432,7 @@ schema_file_suffix_specified () const } inline void options:: -schema_file_suffix_specified(bool x) +schema_file_suffix_specified (bool x) { this->schema_file_suffix_specified_ = x; } @@ -1370,7 +1450,7 @@ changelog_file_suffix () } inline void options:: -changelog_file_suffix(const database_map<std::string>& x) +changelog_file_suffix (const database_map<std::string>& x) { this->changelog_file_suffix_ = x; } @@ -1382,7 +1462,7 @@ changelog_file_suffix_specified () const } inline void options:: -changelog_file_suffix_specified(bool x) +changelog_file_suffix_specified (bool x) { this->changelog_file_suffix_specified_ = x; } @@ -1400,7 +1480,7 @@ hxx_suffix () } inline void options:: -hxx_suffix(const std::string& x) +hxx_suffix (const std::string& x) { this->hxx_suffix_ = x; } @@ -1412,7 +1492,7 @@ hxx_suffix_specified () const } inline void options:: -hxx_suffix_specified(bool x) +hxx_suffix_specified (bool x) { this->hxx_suffix_specified_ = x; } @@ -1430,7 +1510,7 @@ ixx_suffix () } inline void options:: -ixx_suffix(const std::string& x) +ixx_suffix (const std::string& x) { this->ixx_suffix_ = x; } @@ -1442,7 +1522,7 @@ ixx_suffix_specified () const } inline void options:: -ixx_suffix_specified(bool x) +ixx_suffix_specified (bool x) { this->ixx_suffix_specified_ = x; } @@ -1460,7 +1540,7 @@ cxx_suffix () } inline void options:: -cxx_suffix(const std::string& x) +cxx_suffix (const std::string& x) { this->cxx_suffix_ = x; } @@ -1472,7 +1552,7 @@ cxx_suffix_specified () const } inline void options:: -cxx_suffix_specified(bool x) +cxx_suffix_specified (bool x) { this->cxx_suffix_specified_ = x; } @@ -1490,7 +1570,7 @@ sql_suffix () } inline void options:: -sql_suffix(const std::string& x) +sql_suffix (const std::string& x) { this->sql_suffix_ = x; } @@ -1502,7 +1582,7 @@ sql_suffix_specified () const } inline void options:: -sql_suffix_specified(bool x) +sql_suffix_specified (bool x) { this->sql_suffix_specified_ = x; } @@ -1520,7 +1600,7 @@ changelog_suffix () } inline void options:: -changelog_suffix(const std::string& x) +changelog_suffix (const std::string& x) { this->changelog_suffix_ = x; } @@ -1532,7 +1612,7 @@ changelog_suffix_specified () const } inline void options:: -changelog_suffix_specified(bool x) +changelog_suffix_specified (bool x) { this->changelog_suffix_specified_ = x; } @@ -1550,7 +1630,7 @@ hxx_prologue () } inline void options:: -hxx_prologue(const database_map<std::vector<std::string> >& x) +hxx_prologue (const database_map<std::vector<std::string> >& x) { this->hxx_prologue_ = x; } @@ -1562,7 +1642,7 @@ hxx_prologue_specified () const } inline void options:: -hxx_prologue_specified(bool x) +hxx_prologue_specified (bool x) { this->hxx_prologue_specified_ = x; } @@ -1580,7 +1660,7 @@ ixx_prologue () } inline void options:: -ixx_prologue(const database_map<std::vector<std::string> >& x) +ixx_prologue (const database_map<std::vector<std::string> >& x) { this->ixx_prologue_ = x; } @@ -1592,7 +1672,7 @@ ixx_prologue_specified () const } inline void options:: -ixx_prologue_specified(bool x) +ixx_prologue_specified (bool x) { this->ixx_prologue_specified_ = x; } @@ -1610,7 +1690,7 @@ cxx_prologue () } inline void options:: -cxx_prologue(const database_map<std::vector<std::string> >& x) +cxx_prologue (const database_map<std::vector<std::string> >& x) { this->cxx_prologue_ = x; } @@ -1622,7 +1702,7 @@ cxx_prologue_specified () const } inline void options:: -cxx_prologue_specified(bool x) +cxx_prologue_specified (bool x) { this->cxx_prologue_specified_ = x; } @@ -1640,7 +1720,7 @@ schema_prologue () } inline void options:: -schema_prologue(const database_map<std::vector<std::string> >& x) +schema_prologue (const database_map<std::vector<std::string> >& x) { this->schema_prologue_ = x; } @@ -1652,7 +1732,7 @@ schema_prologue_specified () const } inline void options:: -schema_prologue_specified(bool x) +schema_prologue_specified (bool x) { this->schema_prologue_specified_ = x; } @@ -1670,7 +1750,7 @@ sql_prologue () } inline void options:: -sql_prologue(const database_map<std::vector<std::string> >& x) +sql_prologue (const database_map<std::vector<std::string> >& x) { this->sql_prologue_ = x; } @@ -1682,7 +1762,7 @@ sql_prologue_specified () const } inline void options:: -sql_prologue_specified(bool x) +sql_prologue_specified (bool x) { this->sql_prologue_specified_ = x; } @@ -1700,7 +1780,7 @@ migration_prologue () } inline void options:: -migration_prologue(const database_map<std::vector<std::string> >& x) +migration_prologue (const database_map<std::vector<std::string> >& x) { this->migration_prologue_ = x; } @@ -1712,7 +1792,7 @@ migration_prologue_specified () const } inline void options:: -migration_prologue_specified(bool x) +migration_prologue_specified (bool x) { this->migration_prologue_specified_ = x; } @@ -1730,7 +1810,7 @@ sql_interlude () } inline void options:: -sql_interlude(const database_map<std::vector<std::string> >& x) +sql_interlude (const database_map<std::vector<std::string> >& x) { this->sql_interlude_ = x; } @@ -1742,7 +1822,7 @@ sql_interlude_specified () const } inline void options:: -sql_interlude_specified(bool x) +sql_interlude_specified (bool x) { this->sql_interlude_specified_ = x; } @@ -1760,7 +1840,7 @@ hxx_epilogue () } inline void options:: -hxx_epilogue(const database_map<std::vector<std::string> >& x) +hxx_epilogue (const database_map<std::vector<std::string> >& x) { this->hxx_epilogue_ = x; } @@ -1772,7 +1852,7 @@ hxx_epilogue_specified () const } inline void options:: -hxx_epilogue_specified(bool x) +hxx_epilogue_specified (bool x) { this->hxx_epilogue_specified_ = x; } @@ -1790,7 +1870,7 @@ ixx_epilogue () } inline void options:: -ixx_epilogue(const database_map<std::vector<std::string> >& x) +ixx_epilogue (const database_map<std::vector<std::string> >& x) { this->ixx_epilogue_ = x; } @@ -1802,7 +1882,7 @@ ixx_epilogue_specified () const } inline void options:: -ixx_epilogue_specified(bool x) +ixx_epilogue_specified (bool x) { this->ixx_epilogue_specified_ = x; } @@ -1820,7 +1900,7 @@ cxx_epilogue () } inline void options:: -cxx_epilogue(const database_map<std::vector<std::string> >& x) +cxx_epilogue (const database_map<std::vector<std::string> >& x) { this->cxx_epilogue_ = x; } @@ -1832,7 +1912,7 @@ cxx_epilogue_specified () const } inline void options:: -cxx_epilogue_specified(bool x) +cxx_epilogue_specified (bool x) { this->cxx_epilogue_specified_ = x; } @@ -1850,7 +1930,7 @@ schema_epilogue () } inline void options:: -schema_epilogue(const database_map<std::vector<std::string> >& x) +schema_epilogue (const database_map<std::vector<std::string> >& x) { this->schema_epilogue_ = x; } @@ -1862,7 +1942,7 @@ schema_epilogue_specified () const } inline void options:: -schema_epilogue_specified(bool x) +schema_epilogue_specified (bool x) { this->schema_epilogue_specified_ = x; } @@ -1880,7 +1960,7 @@ sql_epilogue () } inline void options:: -sql_epilogue(const database_map<std::vector<std::string> >& x) +sql_epilogue (const database_map<std::vector<std::string> >& x) { this->sql_epilogue_ = x; } @@ -1892,7 +1972,7 @@ sql_epilogue_specified () const } inline void options:: -sql_epilogue_specified(bool x) +sql_epilogue_specified (bool x) { this->sql_epilogue_specified_ = x; } @@ -1910,7 +1990,7 @@ migration_epilogue () } inline void options:: -migration_epilogue(const database_map<std::vector<std::string> >& x) +migration_epilogue (const database_map<std::vector<std::string> >& x) { this->migration_epilogue_ = x; } @@ -1922,7 +2002,7 @@ migration_epilogue_specified () const } inline void options:: -migration_epilogue_specified(bool x) +migration_epilogue_specified (bool x) { this->migration_epilogue_specified_ = x; } @@ -1940,7 +2020,7 @@ hxx_prologue_file () } inline void options:: -hxx_prologue_file(const database_map<std::vector<std::string> >& x) +hxx_prologue_file (const database_map<std::vector<std::string> >& x) { this->hxx_prologue_file_ = x; } @@ -1952,7 +2032,7 @@ hxx_prologue_file_specified () const } inline void options:: -hxx_prologue_file_specified(bool x) +hxx_prologue_file_specified (bool x) { this->hxx_prologue_file_specified_ = x; } @@ -1970,7 +2050,7 @@ ixx_prologue_file () } inline void options:: -ixx_prologue_file(const database_map<std::vector<std::string> >& x) +ixx_prologue_file (const database_map<std::vector<std::string> >& x) { this->ixx_prologue_file_ = x; } @@ -1982,7 +2062,7 @@ ixx_prologue_file_specified () const } inline void options:: -ixx_prologue_file_specified(bool x) +ixx_prologue_file_specified (bool x) { this->ixx_prologue_file_specified_ = x; } @@ -2000,7 +2080,7 @@ cxx_prologue_file () } inline void options:: -cxx_prologue_file(const database_map<std::vector<std::string> >& x) +cxx_prologue_file (const database_map<std::vector<std::string> >& x) { this->cxx_prologue_file_ = x; } @@ -2012,7 +2092,7 @@ cxx_prologue_file_specified () const } inline void options:: -cxx_prologue_file_specified(bool x) +cxx_prologue_file_specified (bool x) { this->cxx_prologue_file_specified_ = x; } @@ -2030,7 +2110,7 @@ schema_prologue_file () } inline void options:: -schema_prologue_file(const database_map<std::vector<std::string> >& x) +schema_prologue_file (const database_map<std::vector<std::string> >& x) { this->schema_prologue_file_ = x; } @@ -2042,7 +2122,7 @@ schema_prologue_file_specified () const } inline void options:: -schema_prologue_file_specified(bool x) +schema_prologue_file_specified (bool x) { this->schema_prologue_file_specified_ = x; } @@ -2060,7 +2140,7 @@ sql_prologue_file () } inline void options:: -sql_prologue_file(const database_map<std::vector<std::string> >& x) +sql_prologue_file (const database_map<std::vector<std::string> >& x) { this->sql_prologue_file_ = x; } @@ -2072,7 +2152,7 @@ sql_prologue_file_specified () const } inline void options:: -sql_prologue_file_specified(bool x) +sql_prologue_file_specified (bool x) { this->sql_prologue_file_specified_ = x; } @@ -2090,7 +2170,7 @@ migration_prologue_file () } inline void options:: -migration_prologue_file(const database_map<std::vector<std::string> >& x) +migration_prologue_file (const database_map<std::vector<std::string> >& x) { this->migration_prologue_file_ = x; } @@ -2102,7 +2182,7 @@ migration_prologue_file_specified () const } inline void options:: -migration_prologue_file_specified(bool x) +migration_prologue_file_specified (bool x) { this->migration_prologue_file_specified_ = x; } @@ -2120,7 +2200,7 @@ sql_interlude_file () } inline void options:: -sql_interlude_file(const database_map<std::vector<std::string> >& x) +sql_interlude_file (const database_map<std::vector<std::string> >& x) { this->sql_interlude_file_ = x; } @@ -2132,7 +2212,7 @@ sql_interlude_file_specified () const } inline void options:: -sql_interlude_file_specified(bool x) +sql_interlude_file_specified (bool x) { this->sql_interlude_file_specified_ = x; } @@ -2150,7 +2230,7 @@ hxx_epilogue_file () } inline void options:: -hxx_epilogue_file(const database_map<std::vector<std::string> >& x) +hxx_epilogue_file (const database_map<std::vector<std::string> >& x) { this->hxx_epilogue_file_ = x; } @@ -2162,7 +2242,7 @@ hxx_epilogue_file_specified () const } inline void options:: -hxx_epilogue_file_specified(bool x) +hxx_epilogue_file_specified (bool x) { this->hxx_epilogue_file_specified_ = x; } @@ -2180,7 +2260,7 @@ ixx_epilogue_file () } inline void options:: -ixx_epilogue_file(const database_map<std::vector<std::string> >& x) +ixx_epilogue_file (const database_map<std::vector<std::string> >& x) { this->ixx_epilogue_file_ = x; } @@ -2192,7 +2272,7 @@ ixx_epilogue_file_specified () const } inline void options:: -ixx_epilogue_file_specified(bool x) +ixx_epilogue_file_specified (bool x) { this->ixx_epilogue_file_specified_ = x; } @@ -2210,7 +2290,7 @@ cxx_epilogue_file () } inline void options:: -cxx_epilogue_file(const database_map<std::vector<std::string> >& x) +cxx_epilogue_file (const database_map<std::vector<std::string> >& x) { this->cxx_epilogue_file_ = x; } @@ -2222,7 +2302,7 @@ cxx_epilogue_file_specified () const } inline void options:: -cxx_epilogue_file_specified(bool x) +cxx_epilogue_file_specified (bool x) { this->cxx_epilogue_file_specified_ = x; } @@ -2240,7 +2320,7 @@ schema_epilogue_file () } inline void options:: -schema_epilogue_file(const database_map<std::vector<std::string> >& x) +schema_epilogue_file (const database_map<std::vector<std::string> >& x) { this->schema_epilogue_file_ = x; } @@ -2252,7 +2332,7 @@ schema_epilogue_file_specified () const } inline void options:: -schema_epilogue_file_specified(bool x) +schema_epilogue_file_specified (bool x) { this->schema_epilogue_file_specified_ = x; } @@ -2270,7 +2350,7 @@ sql_epilogue_file () } inline void options:: -sql_epilogue_file(const database_map<std::vector<std::string> >& x) +sql_epilogue_file (const database_map<std::vector<std::string> >& x) { this->sql_epilogue_file_ = x; } @@ -2282,7 +2362,7 @@ sql_epilogue_file_specified () const } inline void options:: -sql_epilogue_file_specified(bool x) +sql_epilogue_file_specified (bool x) { this->sql_epilogue_file_specified_ = x; } @@ -2300,7 +2380,7 @@ migration_epilogue_file () } inline void options:: -migration_epilogue_file(const database_map<std::vector<std::string> >& x) +migration_epilogue_file (const database_map<std::vector<std::string> >& x) { this->migration_epilogue_file_ = x; } @@ -2312,7 +2392,7 @@ migration_epilogue_file_specified () const } inline void options:: -migration_epilogue_file_specified(bool x) +migration_epilogue_file_specified (bool x) { this->migration_epilogue_file_specified_ = x; } @@ -2330,7 +2410,7 @@ odb_prologue () } inline void options:: -odb_prologue(const database_map<std::vector<std::string> >& x) +odb_prologue (const database_map<std::vector<std::string> >& x) { this->odb_prologue_ = x; } @@ -2342,7 +2422,7 @@ odb_prologue_specified () const } inline void options:: -odb_prologue_specified(bool x) +odb_prologue_specified (bool x) { this->odb_prologue_specified_ = x; } @@ -2360,7 +2440,7 @@ odb_prologue_file () } inline void options:: -odb_prologue_file(const database_map<std::vector<std::string> >& x) +odb_prologue_file (const database_map<std::vector<std::string> >& x) { this->odb_prologue_file_ = x; } @@ -2372,7 +2452,7 @@ odb_prologue_file_specified () const } inline void options:: -odb_prologue_file_specified(bool x) +odb_prologue_file_specified (bool x) { this->odb_prologue_file_specified_ = x; } @@ -2390,7 +2470,7 @@ odb_epilogue () } inline void options:: -odb_epilogue(const database_map<std::vector<std::string> >& x) +odb_epilogue (const database_map<std::vector<std::string> >& x) { this->odb_epilogue_ = x; } @@ -2402,7 +2482,7 @@ odb_epilogue_specified () const } inline void options:: -odb_epilogue_specified(bool x) +odb_epilogue_specified (bool x) { this->odb_epilogue_specified_ = x; } @@ -2420,7 +2500,7 @@ odb_epilogue_file () } inline void options:: -odb_epilogue_file(const database_map<std::vector<std::string> >& x) +odb_epilogue_file (const database_map<std::vector<std::string> >& x) { this->odb_epilogue_file_ = x; } @@ -2432,7 +2512,7 @@ odb_epilogue_file_specified () const } inline void options:: -odb_epilogue_file_specified(bool x) +odb_epilogue_file_specified (bool x) { this->odb_epilogue_file_specified_ = x; } @@ -2450,7 +2530,7 @@ table_prefix () } inline void options:: -table_prefix(const database_map<std::string>& x) +table_prefix (const database_map<std::string>& x) { this->table_prefix_ = x; } @@ -2462,7 +2542,7 @@ table_prefix_specified () const } inline void options:: -table_prefix_specified(bool x) +table_prefix_specified (bool x) { this->table_prefix_specified_ = x; } @@ -2480,7 +2560,7 @@ index_suffix () } inline void options:: -index_suffix(const database_map<std::string>& x) +index_suffix (const database_map<std::string>& x) { this->index_suffix_ = x; } @@ -2492,7 +2572,7 @@ index_suffix_specified () const } inline void options:: -index_suffix_specified(bool x) +index_suffix_specified (bool x) { this->index_suffix_specified_ = x; } @@ -2510,7 +2590,7 @@ fkey_suffix () } inline void options:: -fkey_suffix(const database_map<std::string>& x) +fkey_suffix (const database_map<std::string>& x) { this->fkey_suffix_ = x; } @@ -2522,7 +2602,7 @@ fkey_suffix_specified () const } inline void options:: -fkey_suffix_specified(bool x) +fkey_suffix_specified (bool x) { this->fkey_suffix_specified_ = x; } @@ -2540,7 +2620,7 @@ sequence_suffix () } inline void options:: -sequence_suffix(const database_map<std::string>& x) +sequence_suffix (const database_map<std::string>& x) { this->sequence_suffix_ = x; } @@ -2552,7 +2632,7 @@ sequence_suffix_specified () const } inline void options:: -sequence_suffix_specified(bool x) +sequence_suffix_specified (bool x) { this->sequence_suffix_specified_ = x; } @@ -2570,7 +2650,7 @@ sql_name_case () } inline void options:: -sql_name_case(const database_map<name_case>& x) +sql_name_case (const database_map<name_case>& x) { this->sql_name_case_ = x; } @@ -2582,7 +2662,7 @@ sql_name_case_specified () const } inline void options:: -sql_name_case_specified(bool x) +sql_name_case_specified (bool x) { this->sql_name_case_specified_ = x; } @@ -2600,7 +2680,7 @@ table_regex () } inline void options:: -table_regex(const database_map<std::vector<std::string> >& x) +table_regex (const database_map<std::vector<std::string> >& x) { this->table_regex_ = x; } @@ -2612,7 +2692,7 @@ table_regex_specified () const } inline void options:: -table_regex_specified(bool x) +table_regex_specified (bool x) { this->table_regex_specified_ = x; } @@ -2630,7 +2710,7 @@ column_regex () } inline void options:: -column_regex(const database_map<std::vector<std::string> >& x) +column_regex (const database_map<std::vector<std::string> >& x) { this->column_regex_ = x; } @@ -2642,7 +2722,7 @@ column_regex_specified () const } inline void options:: -column_regex_specified(bool x) +column_regex_specified (bool x) { this->column_regex_specified_ = x; } @@ -2660,7 +2740,7 @@ index_regex () } inline void options:: -index_regex(const database_map<std::vector<std::string> >& x) +index_regex (const database_map<std::vector<std::string> >& x) { this->index_regex_ = x; } @@ -2672,7 +2752,7 @@ index_regex_specified () const } inline void options:: -index_regex_specified(bool x) +index_regex_specified (bool x) { this->index_regex_specified_ = x; } @@ -2690,7 +2770,7 @@ fkey_regex () } inline void options:: -fkey_regex(const database_map<std::vector<std::string> >& x) +fkey_regex (const database_map<std::vector<std::string> >& x) { this->fkey_regex_ = x; } @@ -2702,7 +2782,7 @@ fkey_regex_specified () const } inline void options:: -fkey_regex_specified(bool x) +fkey_regex_specified (bool x) { this->fkey_regex_specified_ = x; } @@ -2720,7 +2800,7 @@ sequence_regex () } inline void options:: -sequence_regex(const database_map<std::vector<std::string> >& x) +sequence_regex (const database_map<std::vector<std::string> >& x) { this->sequence_regex_ = x; } @@ -2732,7 +2812,7 @@ sequence_regex_specified () const } inline void options:: -sequence_regex_specified(bool x) +sequence_regex_specified (bool x) { this->sequence_regex_specified_ = x; } @@ -2750,7 +2830,7 @@ statement_regex () } inline void options:: -statement_regex(const database_map<std::vector<std::string> >& x) +statement_regex (const database_map<std::vector<std::string> >& x) { this->statement_regex_ = x; } @@ -2762,7 +2842,7 @@ statement_regex_specified () const } inline void options:: -statement_regex_specified(bool x) +statement_regex_specified (bool x) { this->statement_regex_specified_ = x; } @@ -2780,7 +2860,7 @@ sql_name_regex () } inline void options:: -sql_name_regex(const database_map<std::vector<std::string> >& x) +sql_name_regex (const database_map<std::vector<std::string> >& x) { this->sql_name_regex_ = x; } @@ -2792,7 +2872,7 @@ sql_name_regex_specified () const } inline void options:: -sql_name_regex_specified(bool x) +sql_name_regex_specified (bool x) { this->sql_name_regex_specified_ = x; } @@ -2810,7 +2890,7 @@ sql_name_regex_trace () } inline void options:: -sql_name_regex_trace(const bool& x) +sql_name_regex_trace (const bool& x) { this->sql_name_regex_trace_ = x; } @@ -2828,7 +2908,7 @@ accessor_regex () } inline void options:: -accessor_regex(const std::vector<std::string>& x) +accessor_regex (const std::vector<std::string>& x) { this->accessor_regex_ = x; } @@ -2840,7 +2920,7 @@ accessor_regex_specified () const } inline void options:: -accessor_regex_specified(bool x) +accessor_regex_specified (bool x) { this->accessor_regex_specified_ = x; } @@ -2858,7 +2938,7 @@ accessor_regex_trace () } inline void options:: -accessor_regex_trace(const bool& x) +accessor_regex_trace (const bool& x) { this->accessor_regex_trace_ = x; } @@ -2876,7 +2956,7 @@ modifier_regex () } inline void options:: -modifier_regex(const std::vector<std::string>& x) +modifier_regex (const std::vector<std::string>& x) { this->modifier_regex_ = x; } @@ -2888,7 +2968,7 @@ modifier_regex_specified () const } inline void options:: -modifier_regex_specified(bool x) +modifier_regex_specified (bool x) { this->modifier_regex_specified_ = x; } @@ -2906,7 +2986,7 @@ modifier_regex_trace () } inline void options:: -modifier_regex_trace(const bool& x) +modifier_regex_trace (const bool& x) { this->modifier_regex_trace_ = x; } @@ -2924,7 +3004,7 @@ include_with_brackets () } inline void options:: -include_with_brackets(const bool& x) +include_with_brackets (const bool& x) { this->include_with_brackets_ = x; } @@ -2942,7 +3022,7 @@ include_prefix () } inline void options:: -include_prefix(const std::string& x) +include_prefix (const std::string& x) { this->include_prefix_ = x; } @@ -2954,7 +3034,7 @@ include_prefix_specified () const } inline void options:: -include_prefix_specified(bool x) +include_prefix_specified (bool x) { this->include_prefix_specified_ = x; } @@ -2972,7 +3052,7 @@ include_regex () } inline void options:: -include_regex(const std::vector<std::string>& x) +include_regex (const std::vector<std::string>& x) { this->include_regex_ = x; } @@ -2984,7 +3064,7 @@ include_regex_specified () const } inline void options:: -include_regex_specified(bool x) +include_regex_specified (bool x) { this->include_regex_specified_ = x; } @@ -3002,7 +3082,7 @@ include_regex_trace () } inline void options:: -include_regex_trace(const bool& x) +include_regex_trace (const bool& x) { this->include_regex_trace_ = x; } @@ -3020,7 +3100,7 @@ guard_prefix () } inline void options:: -guard_prefix(const std::string& x) +guard_prefix (const std::string& x) { this->guard_prefix_ = x; } @@ -3032,7 +3112,7 @@ guard_prefix_specified () const } inline void options:: -guard_prefix_specified(bool x) +guard_prefix_specified (bool x) { this->guard_prefix_specified_ = x; } @@ -3050,7 +3130,7 @@ show_sloc () } inline void options:: -show_sloc(const bool& x) +show_sloc (const bool& x) { this->show_sloc_ = x; } @@ -3068,7 +3148,7 @@ sloc_limit () } inline void options:: -sloc_limit(const std::size_t& x) +sloc_limit (const std::size_t& x) { this->sloc_limit_ = x; } @@ -3080,7 +3160,7 @@ sloc_limit_specified () const } inline void options:: -sloc_limit_specified(bool x) +sloc_limit_specified (bool x) { this->sloc_limit_specified_ = x; } @@ -3098,7 +3178,7 @@ options_file () } inline void options:: -options_file(const std::string& x) +options_file (const std::string& x) { this->options_file_ = x; } @@ -3110,7 +3190,7 @@ options_file_specified () const } inline void options:: -options_file_specified(bool x) +options_file_specified (bool x) { this->options_file_specified_ = x; } @@ -3128,7 +3208,7 @@ x () } inline void options:: -x(const std::vector<std::string>& x) +x (const std::vector<std::string>& x) { this->x_ = x; } @@ -3140,7 +3220,7 @@ x_specified () const } inline void options:: -x_specified(bool x) +x_specified (bool x) { this->x_specified_ = x; } @@ -3158,7 +3238,7 @@ v () } inline void options:: -v(const bool& x) +v (const bool& x) { this->v_ = x; } @@ -3176,7 +3256,7 @@ trace () } inline void options:: -trace(const bool& x) +trace (const bool& x) { this->trace_ = x; } @@ -3194,7 +3274,7 @@ mysql_engine () } inline void options:: -mysql_engine(const std::string& x) +mysql_engine (const std::string& x) { this->mysql_engine_ = x; } @@ -3206,7 +3286,7 @@ mysql_engine_specified () const } inline void options:: -mysql_engine_specified(bool x) +mysql_engine_specified (bool x) { this->mysql_engine_specified_ = x; } @@ -3224,7 +3304,7 @@ sqlite_override_null () } inline void options:: -sqlite_override_null(const bool& x) +sqlite_override_null (const bool& x) { this->sqlite_override_null_ = x; } @@ -3242,7 +3322,7 @@ sqlite_lax_auto_id () } inline void options:: -sqlite_lax_auto_id(const bool& x) +sqlite_lax_auto_id (const bool& x) { this->sqlite_lax_auto_id_ = x; } @@ -3260,7 +3340,7 @@ pgsql_server_version () } inline void options:: -pgsql_server_version(const ::pgsql_version& x) +pgsql_server_version (const ::pgsql_version& x) { this->pgsql_server_version_ = x; } @@ -3272,7 +3352,7 @@ pgsql_server_version_specified () const } inline void options:: -pgsql_server_version_specified(bool x) +pgsql_server_version_specified (bool x) { this->pgsql_server_version_specified_ = x; } @@ -3290,7 +3370,7 @@ oracle_client_version () } inline void options:: -oracle_client_version(const ::oracle_version& x) +oracle_client_version (const ::oracle_version& x) { this->oracle_client_version_ = x; } @@ -3302,7 +3382,7 @@ oracle_client_version_specified () const } inline void options:: -oracle_client_version_specified(bool x) +oracle_client_version_specified (bool x) { this->oracle_client_version_specified_ = x; } @@ -3320,7 +3400,7 @@ oracle_warn_truncation () } inline void options:: -oracle_warn_truncation(const bool& x) +oracle_warn_truncation (const bool& x) { this->oracle_warn_truncation_ = x; } @@ -3338,7 +3418,7 @@ mssql_server_version () } inline void options:: -mssql_server_version(const ::mssql_version& x) +mssql_server_version (const ::mssql_version& x) { this->mssql_server_version_ = x; } @@ -3350,7 +3430,7 @@ mssql_server_version_specified () const } inline void options:: -mssql_server_version_specified(bool x) +mssql_server_version_specified (bool x) { this->mssql_server_version_specified_ = x; } @@ -3368,7 +3448,7 @@ mssql_short_limit () } inline void options:: -mssql_short_limit(const unsigned int& x) +mssql_short_limit (const unsigned int& x) { this->mssql_short_limit_ = x; } @@ -3380,7 +3460,7 @@ mssql_short_limit_specified () const } inline void options:: -mssql_short_limit_specified(bool x) +mssql_short_limit_specified (bool x) { this->mssql_short_limit_specified_ = x; } diff --git a/odb/processor.cxx b/odb/processor.cxx index cd6d04a..d48baa7 100644 --- a/odb/processor.cxx +++ b/odb/processor.cxx @@ -1,5 +1,4 @@ // file : odb/processor.cxx -// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v3; see accompanying LICENSE file #include <odb/gcc.hxx> @@ -1396,8 +1395,6 @@ namespace string const& prefix, bool obj_ptr) { - process_wrapper (t); - if (composite_wrapper (t)) return; @@ -1666,6 +1663,16 @@ namespace } } + // Determine if container value/index/key types are wrappers. + // + process_wrapper (*vt); + + if (it != 0) + process_wrapper (*it); + + if (kt != 0) + process_wrapper (*kt); + // Check if we are versioned. For now we are not allowing for // soft-add/delete in container keys (might be used in WHERE, // primary key). @@ -1676,16 +1683,16 @@ namespace { case ck_ordered: { - comp = composite (*vt); + comp = composite_wrapper (*vt); break; } case ck_map: case ck_multimap: { - comp = composite (*kt); + comp = composite_wrapper (*kt); if (comp == 0 || column_count (*comp).soft == 0) { - comp = composite (*vt); + comp = composite_wrapper (*vt); break; } @@ -1697,7 +1704,7 @@ namespace case ck_set: case ck_multiset: { - comp = composite (*vt); + comp = composite_wrapper (*vt); if (comp == 0 || column_count (*comp).soft == 0) { comp = 0; @@ -2187,8 +2194,13 @@ namespace namespace_* ns (dynamic_cast<namespace_*> (s)); - if (ns == 0) - continue; // Some other scope. + if (ns == 0) // Some other scope. + { + if (!s->named_p ()) + break; + + continue; + } if (ns->extension ()) ns = &ns->original (); @@ -2200,7 +2212,7 @@ namespace break; } - if (ns->global_scope ()) + if (ns->global_scope ()) // Note: namespaces always named. break; } @@ -2695,15 +2707,20 @@ namespace namespace_* ns (dynamic_cast<namespace_*> (s)); - if (ns == 0) - continue; // Some other scope. + if (ns == 0) // Some other scope. + { + if (!s->named_p ()) + break; + + continue; + } if (ns->extension ()) ns = &ns->original (); if (!ns->count ("pointer")) { - if (ns->global_scope ()) + if (ns->global_scope ()) // Note: namespace always named. break; else continue; diff --git a/odb/processor.hxx b/odb/processor.hxx index 92cd34f..1e70cab 100644 --- a/odb/processor.hxx +++ b/odb/processor.hxx @@ -1,5 +1,4 @@ // file : odb/processor.hxx -// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v3; see accompanying LICENSE file #ifndef ODB_PROCESSOR_HXX diff --git a/odb/profile.cxx b/odb/profile.cxx index b5fd5fc..1a10bfb 100644 --- a/odb/profile.cxx +++ b/odb/profile.cxx @@ -1,5 +1,4 @@ // file : odb/profile.cxx -// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v3; see accompanying LICENSE file #include <unistd.h> // stat diff --git a/odb/profile.hxx b/odb/profile.hxx index 96b8e18..b6e8e53 100644 --- a/odb/profile.hxx +++ b/odb/profile.hxx @@ -1,5 +1,4 @@ // file : odb/profile.hxx -// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v3; see accompanying LICENSE file #ifndef ODB_PROFILE_HXX @@ -9,7 +8,7 @@ #include <vector> #include <string> -#include <cutl/fs/path.hxx> +#include <libcutl/fs/path.hxx> #include <odb/option-types.hxx> diff --git a/odb/relational/changelog.cxx b/odb/relational/changelog.cxx index 0e6d580..99f72da 100644 --- a/odb/relational/changelog.cxx +++ b/odb/relational/changelog.cxx @@ -1,5 +1,4 @@ // file : odb/relational/changelog.cxx -// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v3; see accompanying LICENSE file #include <map> diff --git a/odb/relational/common-query.cxx b/odb/relational/common-query.cxx index a543e77..53321ce 100644 --- a/odb/relational/common-query.cxx +++ b/odb/relational/common-query.cxx @@ -1,5 +1,4 @@ // file : odb/relational/common-query.cxx -// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v3; see accompanying LICENSE file #include <odb/relational/common-query.hxx> diff --git a/odb/relational/common-query.hxx b/odb/relational/common-query.hxx index 3b5db5a..c29df6b 100644 --- a/odb/relational/common-query.hxx +++ b/odb/relational/common-query.hxx @@ -1,5 +1,4 @@ // file : odb/relational/common-query.hxx -// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v3; see accompanying LICENSE file #ifndef ODB_RELATIONAL_COMMON_QUERY_HXX diff --git a/odb/relational/common.cxx b/odb/relational/common.cxx index 9b665cf..5c9126c 100644 --- a/odb/relational/common.cxx +++ b/odb/relational/common.cxx @@ -1,5 +1,4 @@ // file : odb/relational/common.cxx -// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v3; see accompanying LICENSE file #include <odb/relational/common.hxx> diff --git a/odb/relational/common.hxx b/odb/relational/common.hxx index c0c6a35..01266a0 100644 --- a/odb/relational/common.hxx +++ b/odb/relational/common.hxx @@ -1,5 +1,4 @@ // file : odb/relational/common.hxx -// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v3; see accompanying LICENSE file #ifndef ODB_RELATIONAL_COMMON_HXX diff --git a/odb/relational/common.txx b/odb/relational/common.txx index f2408b7..82a4a4a 100644 --- a/odb/relational/common.txx +++ b/odb/relational/common.txx @@ -1,5 +1,4 @@ // file : odb/relational/common.txx -// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v3; see accompanying LICENSE file namespace relational diff --git a/odb/relational/context.cxx b/odb/relational/context.cxx index 6ce3ab5..3fba69b 100644 --- a/odb/relational/context.cxx +++ b/odb/relational/context.cxx @@ -1,5 +1,4 @@ // file : odb/relational/context.cxx -// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v3; see accompanying LICENSE file #include <cassert> diff --git a/odb/relational/context.hxx b/odb/relational/context.hxx index 0063293..db9b5be 100644 --- a/odb/relational/context.hxx +++ b/odb/relational/context.hxx @@ -1,5 +1,4 @@ // file : odb/relational/context.hxx -// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v3; see accompanying LICENSE file #ifndef ODB_RELATIONAL_CONTEXT_HXX diff --git a/odb/relational/context.ixx b/odb/relational/context.ixx index 1695046..abf1fb5 100644 --- a/odb/relational/context.ixx +++ b/odb/relational/context.ixx @@ -1,5 +1,4 @@ // file : odb/relational/context.ixx -// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v3; see accompanying LICENSE file namespace relational diff --git a/odb/relational/generate.hxx b/odb/relational/generate.hxx index c354a8d..e597fb8 100644 --- a/odb/relational/generate.hxx +++ b/odb/relational/generate.hxx @@ -1,12 +1,11 @@ // file : odb/relational/generate.hxx -// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v3; see accompanying LICENSE file #ifndef ODB_RELATIONAL_GENERATE_HXX #define ODB_RELATIONAL_GENERATE_HXX #include <string> -#include <cutl/shared-ptr.hxx> +#include <libcutl/shared-ptr.hxx> #include <odb/context.hxx> #include <odb/semantics/relational/model.hxx> diff --git a/odb/relational/header.cxx b/odb/relational/header.cxx index 777f21f..364d48e 100644 --- a/odb/relational/header.cxx +++ b/odb/relational/header.cxx @@ -1,5 +1,4 @@ // file : odb/relational/header.cxx -// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v3; see accompanying LICENSE file #include <odb/relational/header.hxx> diff --git a/odb/relational/header.hxx b/odb/relational/header.hxx index b8131ea..964aff2 100644 --- a/odb/relational/header.hxx +++ b/odb/relational/header.hxx @@ -1,5 +1,4 @@ // file : odb/relational/header.hxx -// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v3; see accompanying LICENSE file #ifndef ODB_RELATIONAL_HEADER_HXX @@ -48,6 +47,8 @@ namespace relational typedef typename member_base_impl<T>::member_info member_info; + using member_base_impl<T>::container; + virtual bool pre (member_info& mi) { diff --git a/odb/relational/inline.cxx b/odb/relational/inline.cxx index 7101a17..5e60705 100644 --- a/odb/relational/inline.cxx +++ b/odb/relational/inline.cxx @@ -1,5 +1,4 @@ // file : odb/relational/inline.cxx -// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v3; see accompanying LICENSE file #include <odb/relational/inline.hxx> diff --git a/odb/relational/inline.hxx b/odb/relational/inline.hxx index 1fc1316..a609cc1 100644 --- a/odb/relational/inline.hxx +++ b/odb/relational/inline.hxx @@ -1,5 +1,4 @@ // file : odb/relational/inline.hxx -// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v3; see accompanying LICENSE file #ifndef ODB_RELATIONAL_INLINE_HXX @@ -679,6 +678,10 @@ namespace relational virtual void generate () { + if (versioned ()) + os << "#include <odb/schema-version.hxx>" << endl + << endl; + if (features.polymorphic_object && options.generate_query ()) os << "#include <odb/details/unique-ptr.hxx>" << endl << endl; diff --git a/odb/relational/model.cxx b/odb/relational/model.cxx index 8d4e320..45d555a 100644 --- a/odb/relational/model.cxx +++ b/odb/relational/model.cxx @@ -1,5 +1,4 @@ // file : odb/relational/model.cxx -// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v3; see accompanying LICENSE file #include <odb/diagnostics.hxx> diff --git a/odb/relational/model.hxx b/odb/relational/model.hxx index ef21e13..fdfa8fd 100644 --- a/odb/relational/model.hxx +++ b/odb/relational/model.hxx @@ -1,5 +1,4 @@ // file : odb/relational/model.hxx -// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v3; see accompanying LICENSE file #ifndef ODB_RELATIONAL_MODEL_HXX @@ -556,9 +555,9 @@ namespace relational } virtual string - table_options (semantics::data_member&, semantics::type&) + table_options (semantics::data_member& m, semantics::type& ct) { - return ""; + return context::table_options (m, ct); } virtual void @@ -785,9 +784,9 @@ namespace relational class_ (sema_rel::model& model): model_ (model) {} virtual string - table_options (type&) + table_options (type& c) { - return ""; + return context::table_options (c); } virtual void diff --git a/odb/relational/mssql/common.cxx b/odb/relational/mssql/common.cxx index aebdb96..1070d21 100644 --- a/odb/relational/mssql/common.cxx +++ b/odb/relational/mssql/common.cxx @@ -1,5 +1,4 @@ // file : odb/relational/mssql/common.cxx -// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v3; see accompanying LICENSE file #include <cassert> diff --git a/odb/relational/mssql/common.hxx b/odb/relational/mssql/common.hxx index dd7146f..42ea412 100644 --- a/odb/relational/mssql/common.hxx +++ b/odb/relational/mssql/common.hxx @@ -1,5 +1,4 @@ // file : odb/relational/mssql/common.hxx -// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v3; see accompanying LICENSE file #ifndef ODB_RELATIONAL_MSSQL_COMMON_HXX diff --git a/odb/relational/mssql/context.cxx b/odb/relational/mssql/context.cxx index 997e322..afe1aa5 100644 --- a/odb/relational/mssql/context.cxx +++ b/odb/relational/mssql/context.cxx @@ -1,5 +1,4 @@ // file : odb/relational/mssql/context.cxx -// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v3; see accompanying LICENSE file #include <cassert> diff --git a/odb/relational/mssql/context.hxx b/odb/relational/mssql/context.hxx index 0a36f06..7701aaa 100644 --- a/odb/relational/mssql/context.hxx +++ b/odb/relational/mssql/context.hxx @@ -1,5 +1,4 @@ // file : odb/relational/mssql/context.hxx -// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v3; see accompanying LICENSE file #ifndef ODB_RELATIONAL_MSSQL_CONTEXT_HXX diff --git a/odb/relational/mssql/header.cxx b/odb/relational/mssql/header.cxx index 529f547..ebdc734 100644 --- a/odb/relational/mssql/header.cxx +++ b/odb/relational/mssql/header.cxx @@ -1,5 +1,4 @@ // file : odb/relational/mssql/header.cxx -// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v3; see accompanying LICENSE file #include <odb/relational/header.hxx> diff --git a/odb/relational/mssql/inline.cxx b/odb/relational/mssql/inline.cxx index ce9504f..eb581d6 100644 --- a/odb/relational/mssql/inline.cxx +++ b/odb/relational/mssql/inline.cxx @@ -1,5 +1,4 @@ // file : odb/relational/mssql/inline.cxx -// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v3; see accompanying LICENSE file #include <odb/relational/inline.hxx> diff --git a/odb/relational/mssql/model.cxx b/odb/relational/mssql/model.cxx index a168ca6..0f5a85c 100644 --- a/odb/relational/mssql/model.cxx +++ b/odb/relational/mssql/model.cxx @@ -1,5 +1,4 @@ // file : odb/relational/mssql/model.cxx -// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v3; see accompanying LICENSE file #include <sstream> diff --git a/odb/relational/mssql/schema.cxx b/odb/relational/mssql/schema.cxx index 77a6271..c5f6bc1 100644 --- a/odb/relational/mssql/schema.cxx +++ b/odb/relational/mssql/schema.cxx @@ -1,5 +1,4 @@ // file : odb/relational/mssql/schema.cxx -// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v3; see accompanying LICENSE file #include <odb/relational/schema.hxx> diff --git a/odb/relational/mssql/source.cxx b/odb/relational/mssql/source.cxx index dd1e9c8..573104d 100644 --- a/odb/relational/mssql/source.cxx +++ b/odb/relational/mssql/source.cxx @@ -1,5 +1,4 @@ // file : odb/relational/mssql/source.cxx -// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v3; see accompanying LICENSE file #include <odb/relational/source.hxx> diff --git a/odb/relational/mysql/common.cxx b/odb/relational/mysql/common.cxx index b819dc4..d049443 100644 --- a/odb/relational/mysql/common.cxx +++ b/odb/relational/mysql/common.cxx @@ -1,5 +1,4 @@ // file : odb/relational/mysql/common.cxx -// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v3; see accompanying LICENSE file #include <cassert> diff --git a/odb/relational/mysql/common.hxx b/odb/relational/mysql/common.hxx index 04bb339..b43dc0d 100644 --- a/odb/relational/mysql/common.hxx +++ b/odb/relational/mysql/common.hxx @@ -1,5 +1,4 @@ // file : odb/relational/mysql/common.hxx -// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v3; see accompanying LICENSE file #ifndef ODB_RELATIONAL_MYSQL_COMMON_HXX diff --git a/odb/relational/mysql/context.cxx b/odb/relational/mysql/context.cxx index 2e243ef..8b3d983 100644 --- a/odb/relational/mysql/context.cxx +++ b/odb/relational/mysql/context.cxx @@ -1,5 +1,4 @@ // file : odb/relational/mysql/context.cxx -// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v3; see accompanying LICENSE file #include <cassert> diff --git a/odb/relational/mysql/context.hxx b/odb/relational/mysql/context.hxx index d648772..98574f2 100644 --- a/odb/relational/mysql/context.hxx +++ b/odb/relational/mysql/context.hxx @@ -1,5 +1,4 @@ // file : odb/relational/mysql/context.hxx -// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v3; see accompanying LICENSE file #ifndef ODB_RELATIONAL_MYSQL_CONTEXT_HXX diff --git a/odb/relational/mysql/header.cxx b/odb/relational/mysql/header.cxx index b2aa710..27bae48 100644 --- a/odb/relational/mysql/header.cxx +++ b/odb/relational/mysql/header.cxx @@ -1,5 +1,4 @@ // file : odb/relational/mysql/header.cxx -// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v3; see accompanying LICENSE file #include <odb/relational/header.hxx> diff --git a/odb/relational/mysql/inline.cxx b/odb/relational/mysql/inline.cxx index 0965eda..bfa2c94 100644 --- a/odb/relational/mysql/inline.cxx +++ b/odb/relational/mysql/inline.cxx @@ -1,5 +1,4 @@ // file : odb/relational/mysql/inline.cxx -// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v3; see accompanying LICENSE file #include <odb/relational/inline.hxx> diff --git a/odb/relational/mysql/model.cxx b/odb/relational/mysql/model.cxx index 2779f4c..17ed4c0 100644 --- a/odb/relational/mysql/model.cxx +++ b/odb/relational/mysql/model.cxx @@ -1,5 +1,4 @@ // file : odb/relational/mysql/model.cxx -// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v3; see accompanying LICENSE file #include <sstream> @@ -111,10 +110,23 @@ namespace relational member_create (base const& x): base (x) {} virtual string - table_options (semantics::data_member&, semantics::type&) + table_options (semantics::data_member& m, semantics::type& c) { + string r (relational::member_create::table_options (m, c)); + string const& engine (options.mysql_engine ()); - return engine != "default" ? "ENGINE=" + engine : ""; + if (engine != "default") + { + // Note: MySQL table options can be separated with spaces. + // + if (!r.empty ()) + r += ' '; + + r += "ENGINE="; + r += engine; + } + + return r; } }; entry<member_create> member_create_; @@ -124,10 +136,23 @@ namespace relational class_ (base const& x): base (x) {} virtual string - table_options (type&) + table_options (type& c) { + string r (relational::class_::table_options (c)); + string const& engine (options.mysql_engine ()); - return engine != "default" ? "ENGINE=" + engine : ""; + if (engine != "default") + { + // Note: MySQL table options can be separated with spaces. + // + if (!r.empty ()) + r += ' '; + + r += "ENGINE="; + r += engine; + } + + return r; } }; entry<class_> class__; diff --git a/odb/relational/mysql/schema.cxx b/odb/relational/mysql/schema.cxx index 07aba36..60dc95b 100644 --- a/odb/relational/mysql/schema.cxx +++ b/odb/relational/mysql/schema.cxx @@ -1,5 +1,4 @@ // file : odb/relational/mysql/schema.cxx -// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v3; see accompanying LICENSE file #include <odb/relational/schema.hxx> diff --git a/odb/relational/mysql/source.cxx b/odb/relational/mysql/source.cxx index 7f5d8a4..9131ea7 100644 --- a/odb/relational/mysql/source.cxx +++ b/odb/relational/mysql/source.cxx @@ -1,5 +1,4 @@ // file : odb/relational/mysql/source.cxx -// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v3; see accompanying LICENSE file #include <odb/relational/source.hxx> diff --git a/odb/relational/oracle/common.cxx b/odb/relational/oracle/common.cxx index 74cbc4f..7caafc9 100644 --- a/odb/relational/oracle/common.cxx +++ b/odb/relational/oracle/common.cxx @@ -1,5 +1,4 @@ // file : odb/relational/oracle/common.cxx -// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v3; see accompanying LICENSE file #include <cassert> diff --git a/odb/relational/oracle/common.hxx b/odb/relational/oracle/common.hxx index 8eaa0f2..1958aab 100644 --- a/odb/relational/oracle/common.hxx +++ b/odb/relational/oracle/common.hxx @@ -1,5 +1,4 @@ // file : odb/relational/oracle/common.hxx -// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v3; see accompanying LICENSE file #ifndef ODB_RELATIONAL_ORACLE_COMMON_HXX diff --git a/odb/relational/oracle/context.cxx b/odb/relational/oracle/context.cxx index 36d1343..12ce0aa 100644 --- a/odb/relational/oracle/context.cxx +++ b/odb/relational/oracle/context.cxx @@ -1,5 +1,4 @@ // file : odb/relational/oracle/context.cxx -// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v3; see accompanying LICENSE file #include <cassert> diff --git a/odb/relational/oracle/context.hxx b/odb/relational/oracle/context.hxx index 3cf9cd4..6c55853 100644 --- a/odb/relational/oracle/context.hxx +++ b/odb/relational/oracle/context.hxx @@ -1,5 +1,4 @@ // file : odb/relational/oracle/context.hxx -// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v3; see accompanying LICENSE file #ifndef ODB_RELATIONAL_ORACLE_CONTEXT_HXX diff --git a/odb/relational/oracle/header.cxx b/odb/relational/oracle/header.cxx index 0971865..bf50bb2 100644 --- a/odb/relational/oracle/header.cxx +++ b/odb/relational/oracle/header.cxx @@ -1,5 +1,4 @@ // file : odb/relational/oracle/header.cxx -// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v3; see accompanying LICENSE file #include <odb/relational/header.hxx> diff --git a/odb/relational/oracle/inline.cxx b/odb/relational/oracle/inline.cxx index 7a7cda5..1b6d606 100644 --- a/odb/relational/oracle/inline.cxx +++ b/odb/relational/oracle/inline.cxx @@ -1,5 +1,4 @@ // file : odb/relational/oracle/inline.cxx -// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v3; see accompanying LICENSE file #include <odb/relational/inline.hxx> diff --git a/odb/relational/oracle/model.cxx b/odb/relational/oracle/model.cxx index 15ce639..b65e201 100644 --- a/odb/relational/oracle/model.cxx +++ b/odb/relational/oracle/model.cxx @@ -1,5 +1,4 @@ // file : odb/relational/oracle/model.cxx -// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v3; see accompanying LICENSE file #include <sstream> diff --git a/odb/relational/oracle/schema.cxx b/odb/relational/oracle/schema.cxx index 4c0d483..75100b1 100644 --- a/odb/relational/oracle/schema.cxx +++ b/odb/relational/oracle/schema.cxx @@ -1,5 +1,4 @@ // file : odb/relational/oracle/schema.cxx -// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v3; see accompanying LICENSE file #include <map> diff --git a/odb/relational/oracle/source.cxx b/odb/relational/oracle/source.cxx index f081d54..adf9864 100644 --- a/odb/relational/oracle/source.cxx +++ b/odb/relational/oracle/source.cxx @@ -1,5 +1,4 @@ // file : odb/relational/oracle/source.cxx -// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v3; see accompanying LICENSE file #include <odb/relational/source.hxx> diff --git a/odb/relational/pgsql/common.cxx b/odb/relational/pgsql/common.cxx index c293811..6a59954 100644 --- a/odb/relational/pgsql/common.cxx +++ b/odb/relational/pgsql/common.cxx @@ -1,5 +1,4 @@ // file : odb/relational/pgsql/common.cxx -// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v3; see accompanying LICENSE file #include <cassert> diff --git a/odb/relational/pgsql/common.hxx b/odb/relational/pgsql/common.hxx index ea61080..1d383bf 100644 --- a/odb/relational/pgsql/common.hxx +++ b/odb/relational/pgsql/common.hxx @@ -1,5 +1,4 @@ // file : odb/relational/pgsql/common.hxx -// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v3; see accompanying LICENSE file #ifndef ODB_RELATIONAL_PGSQL_COMMON_HXX diff --git a/odb/relational/pgsql/context.cxx b/odb/relational/pgsql/context.cxx index e9aff14..7f99f5d 100644 --- a/odb/relational/pgsql/context.cxx +++ b/odb/relational/pgsql/context.cxx @@ -1,5 +1,4 @@ // file : odb/relational/pgsql/context.cxx -// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v3; see accompanying LICENSE file #include <cassert> @@ -86,7 +85,7 @@ namespace relational insert_send_auto_id = false; delay_freeing_statement_result = false; need_image_clone = false; - generate_bulk = false; + generate_bulk = true; global_index = true; global_fkey = false; data_->bind_vector_ = "pgsql::bind*"; diff --git a/odb/relational/pgsql/context.hxx b/odb/relational/pgsql/context.hxx index 52c3884..64e0b1a 100644 --- a/odb/relational/pgsql/context.hxx +++ b/odb/relational/pgsql/context.hxx @@ -1,5 +1,4 @@ // file : odb/relational/pgsql/context.hxx -// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v3; see accompanying LICENSE file #ifndef ODB_RELATIONAL_PGSQL_CONTEXT_HXX diff --git a/odb/relational/pgsql/header.cxx b/odb/relational/pgsql/header.cxx index 852588b..c3efc3e 100644 --- a/odb/relational/pgsql/header.cxx +++ b/odb/relational/pgsql/header.cxx @@ -1,5 +1,4 @@ // file : odb/relational/pgsql/header.cxx -// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v3; see accompanying LICENSE file #include <odb/relational/header.hxx> @@ -88,6 +87,20 @@ namespace relational } os << endl; + + if (poly_derived) + return; + + // Bulk operations batch size. + // + { + unsigned long long b (c.count ("bulk") + ? c.get<unsigned long long> ("bulk") + : 1); + + os << "static const std::size_t batch = " << b << "UL;" + << endl; + } } virtual void diff --git a/odb/relational/pgsql/inline.cxx b/odb/relational/pgsql/inline.cxx index a11a2b8..08688c3 100644 --- a/odb/relational/pgsql/inline.cxx +++ b/odb/relational/pgsql/inline.cxx @@ -1,5 +1,4 @@ // file : odb/relational/pgsql/inline.cxx -// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v3; see accompanying LICENSE file #include <odb/relational/inline.hxx> diff --git a/odb/relational/pgsql/model.cxx b/odb/relational/pgsql/model.cxx index 11e9643..092f8bb 100644 --- a/odb/relational/pgsql/model.cxx +++ b/odb/relational/pgsql/model.cxx @@ -1,5 +1,4 @@ // file : odb/relational/pgsql/model.cxx -// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v3; see accompanying LICENSE file #include <sstream> diff --git a/odb/relational/pgsql/schema.cxx b/odb/relational/pgsql/schema.cxx index 4326e3c..b9c3f2e 100644 --- a/odb/relational/pgsql/schema.cxx +++ b/odb/relational/pgsql/schema.cxx @@ -1,5 +1,4 @@ // file : odb/relational/pgsql/schema.cxx -// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v3; see accompanying LICENSE file #include <odb/relational/schema.hxx> diff --git a/odb/relational/pgsql/source.cxx b/odb/relational/pgsql/source.cxx index 27f76a4..b881e48 100644 --- a/odb/relational/pgsql/source.cxx +++ b/odb/relational/pgsql/source.cxx @@ -1,5 +1,4 @@ // file : odb/relational/pgsql/source.cxx -// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v3; see accompanying LICENSE file #include <sstream> @@ -204,7 +203,7 @@ namespace relational traverse_numeric (member_info& mi) { os << b << ".type = pgsql::bind::numeric;" - << b << ".buffer = " << arg << "." << mi.var << "value.data ();" + << b << ".buffer = " << arg << "." << mi.var << "value.data_ptr ();" << b << ".capacity = " << arg << "." << mi.var << "value.capacity ();" << b << ".size = &" << arg << "." << mi.var << "size;" @@ -225,7 +224,7 @@ namespace relational { os << b << ".type = " << char_bin_buffer_types[mi.st->type - sql_type::CHAR] << ";" - << b << ".buffer = " << arg << "." << mi.var << "value.data ();" + << b << ".buffer = " << arg << "." << mi.var << "value.data_ptr ();" << b << ".capacity = " << arg << "." << mi.var << "value.capacity ();" << b << ".size = &" << arg << "." << mi.var << "size;" @@ -246,7 +245,7 @@ namespace relational traverse_varbit (member_info& mi) { os << b << ".type = pgsql::bind::varbit;" - << b << ".buffer = " << arg << "." << mi.var << "value.data ();" + << b << ".buffer = " << arg << "." << mi.var << "value.data_ptr ();" << b << ".capacity = " << arg << "." << mi.var << "value.capacity ();" << b << ".size = &" << arg << "." << mi.var << "size;" diff --git a/odb/relational/processor.cxx b/odb/relational/processor.cxx index 3062911..0f60359 100644 --- a/odb/relational/processor.cxx +++ b/odb/relational/processor.cxx @@ -1,5 +1,4 @@ // file : odb/relational/processor.cxx -// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v3; see accompanying LICENSE file #include <odb/gcc.hxx> @@ -1457,6 +1456,8 @@ namespace relational object_members_base::traverse (*pointer.obj); } + using object_members_base::traverse; // Unhide. + virtual void traverse_pointer (semantics::data_member& m, semantics::class_& c) { diff --git a/odb/relational/processor.hxx b/odb/relational/processor.hxx index ac2b968..71b8643 100644 --- a/odb/relational/processor.hxx +++ b/odb/relational/processor.hxx @@ -1,5 +1,4 @@ // file : odb/relational/processor.hxx -// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v3; see accompanying LICENSE file #ifndef ODB_RELATIONAL_PROCESSOR_HXX diff --git a/odb/relational/schema-source.cxx b/odb/relational/schema-source.cxx index a2c6a4e..5659485 100644 --- a/odb/relational/schema-source.cxx +++ b/odb/relational/schema-source.cxx @@ -1,5 +1,4 @@ // file : odb/relational/schema-source.cxx -// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v3; see accompanying LICENSE file #include <odb/relational/schema-source.hxx> diff --git a/odb/relational/schema-source.hxx b/odb/relational/schema-source.hxx index a61d0ac..d2235f5 100644 --- a/odb/relational/schema-source.hxx +++ b/odb/relational/schema-source.hxx @@ -1,5 +1,4 @@ // file : odb/relational/schema-source.hxx -// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v3; see accompanying LICENSE file #ifndef ODB_RELATIONAL_SCHEMA_SOURCE_HXX diff --git a/odb/relational/schema.cxx b/odb/relational/schema.cxx index 2119e12..dd70bfa 100644 --- a/odb/relational/schema.cxx +++ b/odb/relational/schema.cxx @@ -1,5 +1,4 @@ // file : odb/relational/schema.cxx -// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v3; see accompanying LICENSE file #include <cassert> diff --git a/odb/relational/schema.hxx b/odb/relational/schema.hxx index 8cf7757..cd975b7 100644 --- a/odb/relational/schema.hxx +++ b/odb/relational/schema.hxx @@ -1,5 +1,4 @@ // file : odb/relational/schema.hxx -// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v3; see accompanying LICENSE file #ifndef ODB_RELATIONAL_SCHEMA_HXX @@ -443,6 +442,9 @@ namespace relational traverse (*t, true); } + using add_table::traverse; // Unhide. + using alter_table::traverse; // Unhide. + using table::names; void diff --git a/odb/relational/source.cxx b/odb/relational/source.cxx index dc22ec5..e00626a 100644 --- a/odb/relational/source.cxx +++ b/odb/relational/source.cxx @@ -1,5 +1,4 @@ // file : odb/relational/source.cxx -// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v3; see accompanying LICENSE file #include <map> @@ -1170,14 +1169,13 @@ traverse_object (type& c) os << ", bool top, bool dyn"; os << ")" - << "{" - << "ODB_POTENTIALLY_UNUSED (db);"; + << "{"; if (poly) - os << "ODB_POTENTIALLY_UNUSED (top);"; + os << "ODB_POTENTIALLY_UNUSED (top);" + << endl; - os << endl - << "using namespace " << db << ";" + os << "using namespace " << db << ";" << endl; if (poly) @@ -1202,7 +1200,7 @@ traverse_object (type& c) << endl; os << db << "::connection& conn (" << endl - << db << "::transaction::current ().connection ());" + << db << "::transaction::current ().connection (db));" << "statements_type& sts (" << endl << "conn.statement_cache ().find_object<object_type> ());"; @@ -1442,13 +1440,11 @@ traverse_object (type& c) << "std::size_t n," << endl << "multiple_exceptions& mex)" << "{" - << "ODB_POTENTIALLY_UNUSED (db);" - << endl << "using namespace " << db << ";" << endl; os << db << "::connection& conn (" << endl - << db << "::transaction::current ().connection ());" + << db << "::transaction::current ().connection (db));" << "statements_type& sts (" << endl << "conn.statement_cache ().find_object<object_type> ());"; @@ -1465,13 +1461,25 @@ traverse_object (type& c) << "{" << "const object_type& obj (*objs[i]);" << "callback (db, obj, callback_event::pre_persist);" - //@@ assumption: generate_grow is false + //@@ assumption: generate_grow is false or it only affects select (like + // in pgsql) so all we have to do is to increment image + // version if it grew. //@@ assumption: insert_send_auto_id is false - << "init (sts.image (i), obj, statement_insert" << - (versioned ? ", svm" : "") << ");" + << "image_type& im (sts.image (i));"; + + if (generate_grow) + os << "if ("; + + os << "init (im, obj, statement_insert" << (versioned ? ", svm" : "") << ")"; + + if (generate_grow) + os << " && i == 0)" << endl + << "im.version++"; + + os << ";" << "}"; - //@@ assumption: generate_grow is false + //@@ assumption: generate_grow: as above os << "binding& imb (sts.insert_image_binding ());" << "if (imb.version == 0)" << "{" @@ -1487,7 +1495,7 @@ traverse_object (type& c) if (bv || auto_id) { os << "binding& idb (sts.id_image_binding ());" - //@@ assumption: generate_grow is false + //@@ assumption: generate_grow: as above << "if (idb.version == 0)" << "{" << "bind (idb.bind, sts.id_image ());" @@ -1693,7 +1701,7 @@ traverse_object (type& c) sts = true; os << db << "::transaction& tr (" << db << "::transaction::current ());" - << db << "::connection& conn (tr.connection ());" + << db << "::connection& conn (tr.connection (db));" << "statements_type& sts (" << endl << "conn.statement_cache ().find_object<object_type> ());" << endl; @@ -1788,7 +1796,7 @@ traverse_object (type& c) { os << db << "::transaction& tr (" << db << "::transaction::current ());" - << db << "::connection& conn (tr.connection ());" + << db << "::connection& conn (tr.connection (db));" << "statements_type& sts (" << endl << "conn.statement_cache ().find_object<object_type> ());" << endl; @@ -1878,7 +1886,7 @@ traverse_object (type& c) if (!sts) os << db << "::transaction& tr (" << db << "::transaction::current ());" - << db << "::connection& conn (tr.connection ());" + << db << "::connection& conn (tr.connection (db));" << "statements_type& sts (" << endl << "conn.statement_cache ().find_object<object_type> ());" << endl; @@ -1977,7 +1985,7 @@ traverse_object (type& c) if (!sts) os << db << "::transaction& tr (" << db << "::transaction::current ());" - << db << "::connection& conn (tr.connection ());" + << db << "::connection& conn (tr.connection (db));" << "statements_type& sts (" << endl << "conn.statement_cache ().find_object<object_type> ());" << endl; @@ -2195,13 +2203,11 @@ traverse_object (type& c) << "std::size_t n," << endl << "multiple_exceptions& mex)" << "{" - << "ODB_POTENTIALLY_UNUSED (db);" - << endl << "using namespace " << db << ";" << "using " << db << "::update_statement;" << endl << db << "::connection& conn (" << endl - << db << "::transaction::current ().connection ());" + << db << "::transaction::current ().connection (db));" << "statements_type& sts (" << endl << "conn.statement_cache ().find_object<object_type> ());"; @@ -2218,9 +2224,24 @@ traverse_object (type& c) if (opt != 0) os << "const version_type& v (version (obj));"; - os << "init (sts.id_image (i), id (obj)" << (opt != 0 ? ", &v" : "") << ");" - //@@ assumption: generate_grow false - << "init (sts.image (i), obj, statement_update);" + os << "init (sts.id_image (i), id (obj)" << (opt != 0 ? ", &v" : "") << ");"; + + //@@ assumption: generate_grow is false or it only affects select (like + // in pgsql) so all we have to do is to increment image + // version if it grew. + + os << "image_type& im (sts.image (i));"; + + if (generate_grow) + os << "if ("; + + os << "init (im, obj, statement_update" << (versioned ? ", svm" : "") << ")"; + + if (generate_grow) + os << " && i == 0)" << endl + << "im.version++"; + + os << ";" << "}"; // Update bindings. @@ -2229,7 +2250,7 @@ traverse_object (type& c) << "binding& imb (sts.update_image_binding ());" << endl; - //@@ assumption: generate_grow false + //@@ assumption: generate_grow: as above // os << "bool u (false);" // Avoid incrementing version twice. << "if (imb.version == 0)" @@ -2240,7 +2261,7 @@ traverse_object (type& c) << "u = true;" << "}"; - //@@ assumption: generate_grow false + //@@ assumption: generate_grow: as above // os << "if (idb.version == 0)" << "{" @@ -2322,16 +2343,15 @@ traverse_object (type& c) os << ")" << "{" - << "using namespace " << db << ";" - << endl - << "ODB_POTENTIALLY_UNUSED (db);"; + << "using namespace " << db << ";"; if (poly) - os << "ODB_POTENTIALLY_UNUSED (top);"; + os << endl + << "ODB_POTENTIALLY_UNUSED (top);"; os << endl << db << "::connection& conn (" << endl - << db << "::transaction::current ().connection ());" + << db << "::transaction::current ().connection (db));" << "statements_type& sts (" << endl << "conn.statement_cache ().find_object<object_type> ());" << endl; @@ -2450,10 +2470,8 @@ traverse_object (type& c) << "{" << "using namespace " << db << ";" << endl - << "ODB_POTENTIALLY_UNUSED (db);" - << endl << db << "::connection& conn (" << endl - << db << "::transaction::current ().connection ());" + << db << "::transaction::current ().connection (db));" << "statements_type& sts (" << endl << "conn.statement_cache ().find_object<object_type> ());" << endl @@ -2461,7 +2479,8 @@ traverse_object (type& c) << "init (sts.id_image (i), *ids[i]);" << endl << "binding& idb (sts.id_image_binding ());" - //@@ assumption: generate_grow false + //@@ assumption: generate_grow is false or it only affects select (like + // in pgsql). << "if (idb.version == 0)" << "{" << "bind (idb.bind, sts.id_image ());" @@ -2543,7 +2562,7 @@ traverse_object (type& c) os << "using namespace " << db << ";" << endl << db << "::connection& conn (" << endl - << db << "::transaction::current ().connection ());" + << db << "::transaction::current ().connection (db));" << "statements_type& sts (" << endl << "conn.statement_cache ().find_object<object_type> ());"; @@ -2831,10 +2850,8 @@ traverse_object (type& c) { os << "using namespace " << db << ";" << endl - << "ODB_POTENTIALLY_UNUSED (db);" - << endl << db << "::connection& conn (" << endl - << db << "::transaction::current ().connection ());" + << db << "::transaction::current ().connection (db));" << "statements_type& sts (" << endl << "conn.statement_cache ().find_object<object_type> ());" << endl @@ -2847,7 +2864,8 @@ traverse_object (type& c) << "}"; os << "binding& idb (sts.id_image_binding ());" - //@@ assumption: generate_grow false + //@@ assumption: generate_grow is false or it only affects select + // (like in pgsql). << "if (idb.version == 0)" << "{" << "bind (idb.bind, sts.id_image ());" @@ -2918,7 +2936,7 @@ traverse_object (type& c) os << "}"; os << db << "::connection& conn (" << endl - << db << "::transaction::current ().connection ());" + << db << "::transaction::current ().connection (db));" << "statements_type& sts (" << endl << "conn.statement_cache ().find_object<object_type> ());"; @@ -3111,7 +3129,7 @@ traverse_object (type& c) if (!abst) { os << db << "::connection& conn (" << endl - << db << "::transaction::current ().connection ());" + << db << "::transaction::current ().connection (db));" << "statements_type& sts (" << endl << "conn.statement_cache ().find_object<object_type> ());"; @@ -3218,7 +3236,7 @@ traverse_object (type& c) if (!abst) { os << db << "::connection& conn (" << endl - << db << "::transaction::current ().connection ());" + << db << "::transaction::current ().connection (db));" << "statements_type& sts (" << endl << "conn.statement_cache ().find_object<object_type> ());"; @@ -3910,7 +3928,7 @@ traverse_object (type& c) << endl << "object_type& obj (static_cast<object_type&> (r));" << db << "::connection& conn (" << endl - << db << "::transaction::current ().connection ());" + << db << "::transaction::current ().connection (db));" << "statements_type& sts (" << endl << "conn.statement_cache ().find_object<object_type> ());" << endl @@ -4136,7 +4154,7 @@ traverse_object (type& c) // os << "result< " << traits << "::object_type >" << endl << traits << "::" << endl - << "query (database&, const query_base_type& q)" + << "query (database& db, const query_base_type& q)" << "{" << "using namespace " << db << ";" << "using odb::details::shared;" @@ -4144,7 +4162,7 @@ traverse_object (type& c) << endl; os << db << "::connection& conn (" << endl - << db << "::transaction::current ().connection ());" + << db << "::transaction::current ().connection (db));" << endl << "statements_type& sts (" << endl << "conn.statement_cache ().find_object<object_type> ());"; @@ -4225,12 +4243,12 @@ traverse_object (type& c) // erase_query // os << "unsigned long long " << traits << "::" << endl - << "erase_query (database&, const query_base_type& q)" + << "erase_query (database& db, const query_base_type& q)" << "{" << "using namespace " << db << ";" << endl << db << "::connection& conn (" << endl - << db << "::transaction::current ().connection ());" + << db << "::transaction::current ().connection (db));" << endl << "std::string text (erase_query_statement);" << "if (!q.empty ())" @@ -4364,16 +4382,15 @@ traverse_object (type& c) << "static_cast<select_statement*> (pq.stmt.get ())));" << endl; - os << db << "::connection& conn (" << endl - << db << "::transaction::current ().connection ());" + os << db << "::transaction& tr (" << db << "::transaction::current ());" << endl << "// The connection used by the current transaction and the" << endl << "// one used to prepare this statement must be the same." << endl << "//" << endl - << "assert (&conn == &st->connection ());" + << "assert (q.verify_connection (tr));" << endl << "statements_type& sts (" << endl - << "conn.statement_cache ().find_object<object_type> ());"; + << "st->connection ().statement_cache ().find_object<object_type> ());"; if (versioned) os << "const schema_version_migration& svm (" << @@ -5266,9 +5283,11 @@ traverse_view (type& c) << "throw session_required ();" << endl; + // Note: db must be not NULL in order to load pointers. + // if (has_a (c, test_pointer)) os << db << "::connection& conn (" << endl - << db << "::transaction::current ().connection ());" + << db << "::transaction::current ().connection (*db));" << endl; names (c, init_view_pointer_member_pre_names_); @@ -5515,7 +5534,7 @@ traverse_view (type& c) { os << "result< " << traits << "::view_type >" << endl << traits << "::" << endl - << "query (database&, const query_base_type& q)" + << "query (database& db, const query_base_type& q)" << "{" << "using namespace " << db << ";" << "using odb::details::shared;" @@ -5523,7 +5542,7 @@ traverse_view (type& c) << endl; os << db << "::connection& conn (" << endl - << db << "::transaction::current ().connection ());" + << db << "::transaction::current ().connection (db));" << "statements_type& sts (" << endl << "conn.statement_cache ().find_view<view_type> ());"; @@ -5663,16 +5682,15 @@ traverse_view (type& c) << "static_cast<select_statement*> (pq.stmt.get ())));" << endl; - os << db << "::connection& conn (" << endl - << db << "::transaction::current ().connection ());" + os << db << "::transaction& tr (" << db << "::transaction::current ());" << endl << "// The connection used by the current transaction and the" << endl << "// one used to prepare this statement must be the same." << endl << "//" << endl - << "assert (&conn == &st->connection ());" + << "assert (q.verify_connection (tr));" << endl << "statements_type& sts (" << endl - << "conn.statement_cache ().find_view<view_type> ());"; + << "st->connection ().statement_cache ().find_view<view_type> ());"; if (versioned) os << "const schema_version_migration& svm (" << diff --git a/odb/relational/source.hxx b/odb/relational/source.hxx index 681323a..3c6f5da 100644 --- a/odb/relational/source.hxx +++ b/odb/relational/source.hxx @@ -1,5 +1,4 @@ // file : odb/relational/source.hxx -// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v3; see accompanying LICENSE file #ifndef ODB_RELATIONAL_SOURCE_HXX @@ -1371,6 +1370,8 @@ namespace relational typedef typename member_base_impl<T>::member_info member_info; + using member_base_impl<T>::container; + virtual bool pre (member_info& mi) { @@ -1752,6 +1753,8 @@ namespace relational typedef typename member_base_impl<T>::member_info member_info; + using member_base_impl<T>::container; + virtual bool pre (member_info& mi) { @@ -2026,6 +2029,8 @@ namespace relational typedef typename member_base_impl<T>::member_info member_info; + using member_base_impl<T>::container; + virtual void set_null (member_info&) = 0; @@ -2497,6 +2502,8 @@ namespace relational typedef typename member_base_impl<T>::member_info member_info; + using member_base_impl<T>::container; + virtual void get_null (string const& var) const = 0; @@ -5327,9 +5334,14 @@ namespace relational if (!ma.synthesized) os << "// From " << location_string (ma.loc, true) << endl; + // Note that here we don't decay arrays. + // + const string& ref_type ( + member_ref_type (m, call_ != load_call, "v", false /* decay */)); + // VC++ cannot grok the constructor syntax. // - os << member_ref_type (m, call_ != load_call, "v") << " =" << endl + os << ref_type << " =" << endl << " "; // If this member is const and we have a synthesized direct @@ -5338,7 +5350,7 @@ namespace relational // bool cast (call_ == load_call && ma.direct () && const_member (m)); if (cast) - os << "const_cast< " << member_ref_type (m, false) << + os << "const_cast< " << member_ref_type (m, false, "", false) << " > (" << endl; os << ma.translate (obj_prefix_); @@ -6469,6 +6481,8 @@ namespace relational rs->base = 0; } + using class_::traverse; // Unhide. + protected: semantics::class_& c_; string scope_; @@ -6549,6 +6563,7 @@ namespace relational : typedefs_ (false), query_columns_type_ (false, false, false), view_query_columns_type_ (false), + index_ (0), grow_base_ (index_), grow_member_ (index_), grow_version_member_ (index_, "version_"), @@ -6577,6 +6592,7 @@ namespace relational typedefs_ (false), query_columns_type_ (false, false, false), view_query_columns_type_ (false), + index_ (0), grow_base_ (index_), grow_member_ (index_), grow_version_member_ (index_, "version_"), diff --git a/odb/relational/sqlite/common.cxx b/odb/relational/sqlite/common.cxx index 934b767..03a3599 100644 --- a/odb/relational/sqlite/common.cxx +++ b/odb/relational/sqlite/common.cxx @@ -1,5 +1,4 @@ // file : odb/relational/sqlite/common.cxx -// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v3; see accompanying LICENSE file #include <cassert> diff --git a/odb/relational/sqlite/common.hxx b/odb/relational/sqlite/common.hxx index ed69600..4d6089e 100644 --- a/odb/relational/sqlite/common.hxx +++ b/odb/relational/sqlite/common.hxx @@ -1,5 +1,4 @@ // file : odb/relational/sqlite/common.hxx -// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v3; see accompanying LICENSE file #ifndef ODB_RELATIONAL_SQLITE_COMMON_HXX diff --git a/odb/relational/sqlite/context.cxx b/odb/relational/sqlite/context.cxx index ab67502..9a4369f 100644 --- a/odb/relational/sqlite/context.cxx +++ b/odb/relational/sqlite/context.cxx @@ -1,5 +1,4 @@ // file : odb/relational/sqlite/context.cxx -// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v3; see accompanying LICENSE file #include <vector> diff --git a/odb/relational/sqlite/context.hxx b/odb/relational/sqlite/context.hxx index 16a700b..777998b 100644 --- a/odb/relational/sqlite/context.hxx +++ b/odb/relational/sqlite/context.hxx @@ -1,5 +1,4 @@ // file : odb/relational/sqlite/context.hxx -// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v3; see accompanying LICENSE file #ifndef ODB_RELATIONAL_SQLITE_CONTEXT_HXX diff --git a/odb/relational/sqlite/header.cxx b/odb/relational/sqlite/header.cxx index 213b3a3..1aafe7a 100644 --- a/odb/relational/sqlite/header.cxx +++ b/odb/relational/sqlite/header.cxx @@ -1,5 +1,4 @@ // file : odb/relational/sqlite/header.cxx -// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v3; see accompanying LICENSE file #include <odb/relational/header.hxx> diff --git a/odb/relational/sqlite/inline.cxx b/odb/relational/sqlite/inline.cxx index fec9e2a..dd3274f 100644 --- a/odb/relational/sqlite/inline.cxx +++ b/odb/relational/sqlite/inline.cxx @@ -1,5 +1,4 @@ // file : odb/relational/sqlite/inline.cxx -// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v3; see accompanying LICENSE file #include <odb/relational/inline.hxx> diff --git a/odb/relational/sqlite/model.cxx b/odb/relational/sqlite/model.cxx index 9757e4b..da16ded 100644 --- a/odb/relational/sqlite/model.cxx +++ b/odb/relational/sqlite/model.cxx @@ -1,5 +1,4 @@ // file : odb/relational/sqlite/model.cxx -// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v3; see accompanying LICENSE file #include <sstream> diff --git a/odb/relational/sqlite/schema.cxx b/odb/relational/sqlite/schema.cxx index c0603c1..f5549b4 100644 --- a/odb/relational/sqlite/schema.cxx +++ b/odb/relational/sqlite/schema.cxx @@ -1,5 +1,4 @@ // file : odb/relational/sqlite/schema.cxx -// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v3; see accompanying LICENSE file #include <odb/relational/schema.hxx> diff --git a/odb/relational/sqlite/source.cxx b/odb/relational/sqlite/source.cxx index cd88b69..5a4b9d3 100644 --- a/odb/relational/sqlite/source.cxx +++ b/odb/relational/sqlite/source.cxx @@ -1,5 +1,4 @@ // file : odb/relational/sqlite/source.cxx -// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v3; see accompanying LICENSE file #include <odb/relational/source.hxx> @@ -400,7 +399,8 @@ namespace relational virtual void process_statement_columns (relational::statement_columns& cols, - statement_kind sk) + statement_kind sk, + bool) { statement_columns_common::process (cols, sk); } diff --git a/odb/relational/validator.cxx b/odb/relational/validator.cxx index 9bebcf0..50c887e 100644 --- a/odb/relational/validator.cxx +++ b/odb/relational/validator.cxx @@ -1,5 +1,4 @@ // file : odb/relational/validator.cxx -// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v3; see accompanying LICENSE file #include <map> diff --git a/odb/relational/validator.hxx b/odb/relational/validator.hxx index 9e9dea5..d6602f7 100644 --- a/odb/relational/validator.hxx +++ b/odb/relational/validator.hxx @@ -1,5 +1,4 @@ // file : odb/relational/validator.hxx -// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v3; see accompanying LICENSE file #ifndef ODB_RELATIONAL_VALIDATOR_HXX diff --git a/odb/semantics.hxx b/odb/semantics.hxx index 30958c8..83416a6 100644 --- a/odb/semantics.hxx +++ b/odb/semantics.hxx @@ -1,5 +1,4 @@ // file : odb/semantics.hxx -// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v3; see accompanying LICENSE file #ifndef ODB_SEMANTICS_HXX diff --git a/odb/semantics/class-template.cxx b/odb/semantics/class-template.cxx index 2a87907..f8bbca4 100644 --- a/odb/semantics/class-template.cxx +++ b/odb/semantics/class-template.cxx @@ -1,8 +1,7 @@ // file : odb/semantics/class-template.cxx -// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v3; see accompanying LICENSE file -#include <cutl/compiler/type-info.hxx> +#include <libcutl/compiler/type-info.hxx> #include <odb/semantics/class-template.hxx> namespace semantics diff --git a/odb/semantics/class-template.hxx b/odb/semantics/class-template.hxx index 9d80880..bffb3f2 100644 --- a/odb/semantics/class-template.hxx +++ b/odb/semantics/class-template.hxx @@ -1,5 +1,4 @@ // file : odb/semantics/class-template.hxx -// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v3; see accompanying LICENSE file #ifndef ODB_SEMANTICS_CLASS_TEMPLATE_HXX diff --git a/odb/semantics/class.cxx b/odb/semantics/class.cxx index 57ddab5..97cf088 100644 --- a/odb/semantics/class.cxx +++ b/odb/semantics/class.cxx @@ -1,10 +1,9 @@ // file : odb/semantics/class.cxx -// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v3; see accompanying LICENSE file #include <odb/gcc.hxx> // TYPE_HAS_DEFAULT_CONSTRUCTOR -#include <cutl/compiler/type-info.hxx> +#include <libcutl/compiler/type-info.hxx> #include <odb/semantics/class.hxx> namespace semantics @@ -26,11 +25,39 @@ namespace semantics { tree t (tree_node ()); - // TYPE_HAS_DEFAULT_CONSTRUCTOR() returns true if we have a - // deleted default ctor. locate_ctor(), on the other hand, - // returns NULL_TREE in this case. + // TYPE_HAS_DEFAULT_CONSTRUCTOR() returns true if we have a deleted + // default ctor. locate_ctor(), on the other hand, returns NULL_TREE in + // this case. // - return TYPE_HAS_DEFAULT_CONSTRUCTOR (t) && locate_ctor (t) != NULL_TREE; + if (TYPE_HAS_DEFAULT_CONSTRUCTOR (t)) + { +#if BUILDING_GCC_MAJOR >= 8 + + // Work around GCC bug 86441. Essentially, we should not trigger an + // instantiation or completion of the default ctor. As a result, we will + // assume that if we have a lazy default ctor, it is not implicitly + // deleted. + // + if (CLASSTYPE_LAZY_DEFAULT_CTOR (t)) + return true; + + for (ovl_iterator i (CLASSTYPE_CONSTRUCTORS (t)); i; ++i) + { + tree f (*i); + + if (TREE_CODE (f) == FUNCTION_DECL && DECL_DELETED_FN (f)) + continue; + + if (default_ctor_p (f)) + return true; + } +#else + return locate_ctor (t) != NULL_TREE; +#endif + + } + + return false; } bool class_:: diff --git a/odb/semantics/class.hxx b/odb/semantics/class.hxx index a70a0bb..e02337a 100644 --- a/odb/semantics/class.hxx +++ b/odb/semantics/class.hxx @@ -1,5 +1,4 @@ // file : odb/semantics/class.hxx -// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v3; see accompanying LICENSE file #ifndef ODB_SEMANTICS_CLASS_HXX diff --git a/odb/semantics/derived.cxx b/odb/semantics/derived.cxx index ef866db..771ad21 100644 --- a/odb/semantics/derived.cxx +++ b/odb/semantics/derived.cxx @@ -1,10 +1,9 @@ // file : odb/semantics/derived.cxx -// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v3; see accompanying LICENSE file #include <sstream> -#include <cutl/compiler/type-info.hxx> +#include <libcutl/compiler/type-info.hxx> #include <odb/semantics/derived.hxx> using namespace std; diff --git a/odb/semantics/derived.hxx b/odb/semantics/derived.hxx index ae8763c..e58ec9f 100644 --- a/odb/semantics/derived.hxx +++ b/odb/semantics/derived.hxx @@ -1,5 +1,4 @@ // file : odb/semantics/derived.hxx -// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v3; see accompanying LICENSE file #ifndef ODB_SEMANTICS_DERIVED_HXX @@ -417,6 +416,8 @@ namespace semantics string fq_name (names*, string& trailer) const; + using derived_type::fq_name; // Unhide. + public: array (path const&, size_t line, diff --git a/odb/semantics/elements.cxx b/odb/semantics/elements.cxx index 6590942..b5793d0 100644 --- a/odb/semantics/elements.cxx +++ b/odb/semantics/elements.cxx @@ -1,10 +1,9 @@ // file : odb/semantics/elements.cxx -// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v3; see accompanying LICENSE file #include <odb/gcc.hxx> -#include <cutl/compiler/type-info.hxx> +#include <libcutl/compiler/type-info.hxx> #include <odb/cxx-lexer.hxx> @@ -57,7 +56,7 @@ namespace semantics if (p == &s) return true; - if (p->global_scope ()) + if (!p->named_p () || p->global_scope ()) break; } @@ -76,7 +75,7 @@ namespace semantics if (tree decl = TYPE_NAME (n)) name = DECL_NAME (decl); - return name != 0 && anon_aggrname_p (name); + return name != 0 && IDENTIFIER_ANON_P (name); } return true; @@ -125,7 +124,7 @@ namespace semantics if (tree decl = TYPE_NAME (type)) { name = DECL_NAME (decl); - if (name != 0 && anon_aggrname_p (name)) + if (name != 0 && IDENTIFIER_ANON_P (name)) return true; tree s (CP_DECL_CONTEXT (decl)); @@ -477,7 +476,7 @@ namespace semantics // Look in the outer scope unless requested not to or if this is // the global scope. // - if ((flags & exclude_outer) == 0 && !global_scope ()) + if ((flags & exclude_outer) == 0 && named_p () && !global_scope ()) return scope ().lookup (name, ti, flags, hidden); return 0; diff --git a/odb/semantics/elements.hxx b/odb/semantics/elements.hxx index 6326d3f..699a1be 100644 --- a/odb/semantics/elements.hxx +++ b/odb/semantics/elements.hxx @@ -1,5 +1,4 @@ // file : odb/semantics/elements.hxx -// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v3; see accompanying LICENSE file #ifndef ODB_SEMANTICS_ELEMENTS_HXX @@ -14,11 +13,11 @@ #include <utility> // std::pair #include <cassert> -#include <cutl/fs/path.hxx> -#include <cutl/container/graph.hxx> -#include <cutl/container/pointer-iterator.hxx> -#include <cutl/compiler/type-id.hxx> -#include <cutl/compiler/context.hxx> +#include <libcutl/fs/path.hxx> +#include <libcutl/container/graph.hxx> +#include <libcutl/container/pointer-iterator.hxx> +#include <libcutl/compiler/type-id.hxx> +#include <libcutl/compiler/context.hxx> #include <odb/gcc-fwd.hxx> #include <odb/location.hxx> diff --git a/odb/semantics/elements.ixx b/odb/semantics/elements.ixx index a513dfc..32f9ced 100644 --- a/odb/semantics/elements.ixx +++ b/odb/semantics/elements.ixx @@ -1,5 +1,4 @@ // file : odb/semantics/elements.ixx -// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v3; see accompanying LICENSE file namespace semantics diff --git a/odb/semantics/enum.cxx b/odb/semantics/enum.cxx index 6e44186..6432986 100644 --- a/odb/semantics/enum.cxx +++ b/odb/semantics/enum.cxx @@ -1,8 +1,7 @@ // file : odb/semantics/enum.cxx -// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v3; see accompanying LICENSE file -#include <cutl/compiler/type-info.hxx> +#include <libcutl/compiler/type-info.hxx> #include <odb/semantics/enum.hxx> namespace semantics diff --git a/odb/semantics/enum.hxx b/odb/semantics/enum.hxx index af72f41..bfcce53 100644 --- a/odb/semantics/enum.hxx +++ b/odb/semantics/enum.hxx @@ -1,5 +1,4 @@ // file : odb/semantics/enum.hxx -// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v3; see accompanying LICENSE file #ifndef ODB_SEMANTICS_ENUM_HXX diff --git a/odb/semantics/fundamental.cxx b/odb/semantics/fundamental.cxx index 3cbde5e..ed4a67f 100644 --- a/odb/semantics/fundamental.cxx +++ b/odb/semantics/fundamental.cxx @@ -1,10 +1,9 @@ // file : odb/semantics/fundamental.cxx -// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v3; see accompanying LICENSE file #include <odb/gcc.hxx> -#include <cutl/compiler/type-info.hxx> +#include <libcutl/compiler/type-info.hxx> #include <odb/semantics/fundamental.hxx> namespace semantics diff --git a/odb/semantics/fundamental.hxx b/odb/semantics/fundamental.hxx index c9b0d1b..15b5cbb 100644 --- a/odb/semantics/fundamental.hxx +++ b/odb/semantics/fundamental.hxx @@ -1,5 +1,4 @@ // file : odb/semantics/fundamental.hxx -// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v3; see accompanying LICENSE file #ifndef ODB_SEMANTICS_FUNDAMENTAL_HXX diff --git a/odb/semantics/namespace.cxx b/odb/semantics/namespace.cxx index b9dc253..d9be903 100644 --- a/odb/semantics/namespace.cxx +++ b/odb/semantics/namespace.cxx @@ -1,8 +1,7 @@ // file : odb/semantics/namespace.cxx -// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v3; see accompanying LICENSE file -#include <cutl/compiler/type-info.hxx> +#include <libcutl/compiler/type-info.hxx> #include <odb/semantics/namespace.hxx> namespace semantics diff --git a/odb/semantics/namespace.hxx b/odb/semantics/namespace.hxx index 07dc7ca..b025c2e 100644 --- a/odb/semantics/namespace.hxx +++ b/odb/semantics/namespace.hxx @@ -1,5 +1,4 @@ // file : odb/semantics/namespace.hxx -// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v3; see accompanying LICENSE file #ifndef ODB_SEMANTICS_NAMESPACE_HXX diff --git a/odb/semantics/relational.hxx b/odb/semantics/relational.hxx index c058a8d..db08a61 100644 --- a/odb/semantics/relational.hxx +++ b/odb/semantics/relational.hxx @@ -1,5 +1,4 @@ // file : odb/semantics/relational.hxx -// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v3; see accompanying LICENSE file #ifndef ODB_SEMANTICS_RELATIONAL_HXX diff --git a/odb/semantics/relational/changelog.cxx b/odb/semantics/relational/changelog.cxx index 492150b..353497f 100644 --- a/odb/semantics/relational/changelog.cxx +++ b/odb/semantics/relational/changelog.cxx @@ -1,11 +1,10 @@ // file : odb/semantics/relational/changelog.cxx -// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v3; see accompanying LICENSE file #include <vector> #include <sstream> -#include <cutl/compiler/type-info.hxx> +#include <libcutl/compiler/type-info.hxx> #include <odb/semantics/relational/changelog.hxx> #include <odb/semantics/relational/model.hxx> diff --git a/odb/semantics/relational/changelog.hxx b/odb/semantics/relational/changelog.hxx index 20b5fb9..2398cf6 100644 --- a/odb/semantics/relational/changelog.hxx +++ b/odb/semantics/relational/changelog.hxx @@ -1,5 +1,4 @@ // file : odb/semantics/relational/changelog.hxx -// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v3; see accompanying LICENSE file #ifndef ODB_SEMANTICS_RELATIONAL_CHANGELOG_HXX diff --git a/odb/semantics/relational/changeset.cxx b/odb/semantics/relational/changeset.cxx index 7ce5709..b044a0c 100644 --- a/odb/semantics/relational/changeset.cxx +++ b/odb/semantics/relational/changeset.cxx @@ -1,8 +1,7 @@ // file : odb/semantics/relational/changeset.cxx -// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v3; see accompanying LICENSE file -#include <cutl/compiler/type-info.hxx> +#include <libcutl/compiler/type-info.hxx> #include <odb/semantics/relational/changeset.hxx> diff --git a/odb/semantics/relational/changeset.hxx b/odb/semantics/relational/changeset.hxx index a15345e..efe2c61 100644 --- a/odb/semantics/relational/changeset.hxx +++ b/odb/semantics/relational/changeset.hxx @@ -1,5 +1,4 @@ // file : odb/semantics/relational/changeset.hxx -// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v3; see accompanying LICENSE file #ifndef ODB_SEMANTICS_RELATIONAL_CHANGESET_HXX diff --git a/odb/semantics/relational/column.cxx b/odb/semantics/relational/column.cxx index c672588..9d4d6e5 100644 --- a/odb/semantics/relational/column.cxx +++ b/odb/semantics/relational/column.cxx @@ -1,8 +1,7 @@ // file : odb/semantics/relational/column.cxx -// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v3; see accompanying LICENSE file -#include <cutl/compiler/type-info.hxx> +#include <libcutl/compiler/type-info.hxx> #include <odb/semantics/relational/column.hxx> diff --git a/odb/semantics/relational/column.hxx b/odb/semantics/relational/column.hxx index 8125939..b7a2c31 100644 --- a/odb/semantics/relational/column.hxx +++ b/odb/semantics/relational/column.hxx @@ -1,5 +1,4 @@ // file : odb/semantics/relational/column.hxx -// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v3; see accompanying LICENSE file #ifndef ODB_SEMANTICS_RELATIONAL_COLUMN_HXX diff --git a/odb/semantics/relational/deferrable.cxx b/odb/semantics/relational/deferrable.cxx index 7bbfb2d..076ff69 100644 --- a/odb/semantics/relational/deferrable.cxx +++ b/odb/semantics/relational/deferrable.cxx @@ -1,5 +1,4 @@ // file : odb/semantics/relational/deferrable.cxx -// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v3; see accompanying LICENSE file #include <ostream> diff --git a/odb/semantics/relational/deferrable.hxx b/odb/semantics/relational/deferrable.hxx index daf8439..b2f888d 100644 --- a/odb/semantics/relational/deferrable.hxx +++ b/odb/semantics/relational/deferrable.hxx @@ -1,5 +1,4 @@ // file : odb/semantics/relational/deferrable.hxx -// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v3; see accompanying LICENSE file #ifndef ODB_SEMANTICS_RELATIONAL_DEFERRABLE_HXX diff --git a/odb/semantics/relational/elements.cxx b/odb/semantics/relational/elements.cxx index 2eb2b50..de1878a 100644 --- a/odb/semantics/relational/elements.cxx +++ b/odb/semantics/relational/elements.cxx @@ -1,8 +1,7 @@ // file : odb/semantics/relational/elements.cxx -// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v3; see accompanying LICENSE file -#include <cutl/compiler/type-info.hxx> +#include <libcutl/compiler/type-info.hxx> #include <odb/semantics/relational/elements.hxx> #include <odb/semantics/relational/column.hxx> diff --git a/odb/semantics/relational/elements.hxx b/odb/semantics/relational/elements.hxx index cc9fdb6..06ec552 100644 --- a/odb/semantics/relational/elements.hxx +++ b/odb/semantics/relational/elements.hxx @@ -1,5 +1,4 @@ // file : odb/semantics/relational/elements.hxx -// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v3; see accompanying LICENSE file #ifndef ODB_SEMANTICS_RELATIONAL_ELEMENTS_HXX @@ -11,16 +10,16 @@ #include <string> #include <cassert> -#include <cutl/container/graph.hxx> -#include <cutl/container/pointer-iterator.hxx> -#include <cutl/compiler/context.hxx> +#include <libcutl/container/graph.hxx> +#include <libcutl/container/pointer-iterator.hxx> +#include <libcutl/compiler/context.hxx> #ifdef ODB_BUILD2 #include <libstudxml/parser.hxx> #include <libstudxml/serializer.hxx> #else -#include <cutl/xml/parser.hxx> -#include <cutl/xml/serializer.hxx> +#include <libcutl/xml/parser.hxx> +#include <libcutl/xml/serializer.hxx> namespace cutl {namespace xml {typedef parser content;}} #endif diff --git a/odb/semantics/relational/elements.txx b/odb/semantics/relational/elements.txx index be82197..2362d48 100644 --- a/odb/semantics/relational/elements.txx +++ b/odb/semantics/relational/elements.txx @@ -1,5 +1,4 @@ // file : odb/semantics/relational/elements.txx -// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v3; see accompanying LICENSE file namespace semantics diff --git a/odb/semantics/relational/foreign-key.cxx b/odb/semantics/relational/foreign-key.cxx index 9cc3a3c..0357d95 100644 --- a/odb/semantics/relational/foreign-key.cxx +++ b/odb/semantics/relational/foreign-key.cxx @@ -1,11 +1,10 @@ // file : odb/semantics/relational/foreign-key.cxx -// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v3; see accompanying LICENSE file #include <ostream> #include <istream> -#include <cutl/compiler/type-info.hxx> +#include <libcutl/compiler/type-info.hxx> #include <odb/semantics/relational/foreign-key.hxx> diff --git a/odb/semantics/relational/foreign-key.hxx b/odb/semantics/relational/foreign-key.hxx index 6de4f06..32179fa 100644 --- a/odb/semantics/relational/foreign-key.hxx +++ b/odb/semantics/relational/foreign-key.hxx @@ -1,5 +1,4 @@ // file : odb/semantics/relational/foreign-key.hxx -// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v3; see accompanying LICENSE file #ifndef ODB_SEMANTICS_RELATIONAL_FOREIGN_KEY_HXX diff --git a/odb/semantics/relational/index.cxx b/odb/semantics/relational/index.cxx index 8d004e0..2329f3a 100644 --- a/odb/semantics/relational/index.cxx +++ b/odb/semantics/relational/index.cxx @@ -1,8 +1,7 @@ // file : odb/semantics/relational/index.cxx -// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v3; see accompanying LICENSE file -#include <cutl/compiler/type-info.hxx> +#include <libcutl/compiler/type-info.hxx> #include <odb/semantics/relational/index.hxx> diff --git a/odb/semantics/relational/index.hxx b/odb/semantics/relational/index.hxx index c2c3a3f..68648cb 100644 --- a/odb/semantics/relational/index.hxx +++ b/odb/semantics/relational/index.hxx @@ -1,5 +1,4 @@ // file : odb/semantics/relational/index.hxx -// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v3; see accompanying LICENSE file #ifndef ODB_SEMANTICS_RELATIONAL_INDEX_HXX diff --git a/odb/semantics/relational/key.cxx b/odb/semantics/relational/key.cxx index b576402..3511618 100644 --- a/odb/semantics/relational/key.cxx +++ b/odb/semantics/relational/key.cxx @@ -1,8 +1,7 @@ // file : odb/semantics/relational/key.cxx -// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v3; see accompanying LICENSE file -#include <cutl/compiler/type-info.hxx> +#include <libcutl/compiler/type-info.hxx> #include <odb/semantics/relational/key.hxx> #include <odb/semantics/relational/column.hxx> diff --git a/odb/semantics/relational/key.hxx b/odb/semantics/relational/key.hxx index af5197f..814d2ec 100644 --- a/odb/semantics/relational/key.hxx +++ b/odb/semantics/relational/key.hxx @@ -1,5 +1,4 @@ // file : odb/semantics/relational/key.hxx -// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v3; see accompanying LICENSE file #ifndef ODB_SEMANTICS_RELATIONAL_KEY_HXX diff --git a/odb/semantics/relational/model.cxx b/odb/semantics/relational/model.cxx index 57a7465..8763045 100644 --- a/odb/semantics/relational/model.cxx +++ b/odb/semantics/relational/model.cxx @@ -1,8 +1,7 @@ // file : odb/semantics/relational/model.cxx -// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v3; see accompanying LICENSE file -#include <cutl/compiler/type-info.hxx> +#include <libcutl/compiler/type-info.hxx> #include <odb/semantics/relational/model.hxx> diff --git a/odb/semantics/relational/model.hxx b/odb/semantics/relational/model.hxx index 3617967..02d1863 100644 --- a/odb/semantics/relational/model.hxx +++ b/odb/semantics/relational/model.hxx @@ -1,5 +1,4 @@ // file : odb/semantics/relational/model.hxx -// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v3; see accompanying LICENSE file #ifndef ODB_SEMANTICS_RELATIONAL_MODEL_HXX diff --git a/odb/semantics/relational/name.cxx b/odb/semantics/relational/name.cxx index eaaec7e..6eb2e16 100644 --- a/odb/semantics/relational/name.cxx +++ b/odb/semantics/relational/name.cxx @@ -1,5 +1,4 @@ // file : odb/semantics/relational/name.cxx -// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v3; see accompanying LICENSE file #include <ostream> diff --git a/odb/semantics/relational/name.hxx b/odb/semantics/relational/name.hxx index 1686962..5268b4a 100644 --- a/odb/semantics/relational/name.hxx +++ b/odb/semantics/relational/name.hxx @@ -1,5 +1,4 @@ // file : odb/semantics/relational/name.hxx -// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v3; see accompanying LICENSE file #ifndef ODB_SEMANTICS_RELATIONAL_NAME_HXX diff --git a/odb/semantics/relational/primary-key.cxx b/odb/semantics/relational/primary-key.cxx index 5412cd1..235340f 100644 --- a/odb/semantics/relational/primary-key.cxx +++ b/odb/semantics/relational/primary-key.cxx @@ -1,8 +1,7 @@ // file : odb/semantics/relational/primary-key.cxx -// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v3; see accompanying LICENSE file -#include <cutl/compiler/type-info.hxx> +#include <libcutl/compiler/type-info.hxx> #include <odb/semantics/relational/primary-key.hxx> diff --git a/odb/semantics/relational/primary-key.hxx b/odb/semantics/relational/primary-key.hxx index a705e91..114f682 100644 --- a/odb/semantics/relational/primary-key.hxx +++ b/odb/semantics/relational/primary-key.hxx @@ -1,5 +1,4 @@ // file : odb/semantics/relational/primary-key.hxx -// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v3; see accompanying LICENSE file #ifndef ODB_SEMANTICS_RELATIONAL_PRIMARY_KEY_HXX diff --git a/odb/semantics/relational/table.cxx b/odb/semantics/relational/table.cxx index 080ed77..3bf763d 100644 --- a/odb/semantics/relational/table.cxx +++ b/odb/semantics/relational/table.cxx @@ -1,8 +1,7 @@ // file : odb/semantics/relational/table.cxx -// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v3; see accompanying LICENSE file -#include <cutl/compiler/type-info.hxx> +#include <libcutl/compiler/type-info.hxx> #include <odb/semantics/relational/table.hxx> diff --git a/odb/semantics/relational/table.hxx b/odb/semantics/relational/table.hxx index c561d0c..1c4efcf 100644 --- a/odb/semantics/relational/table.hxx +++ b/odb/semantics/relational/table.hxx @@ -1,5 +1,4 @@ // file : odb/semantics/relational/table.hxx -// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v3; see accompanying LICENSE file #ifndef ODB_SEMANTICS_RELATIONAL_TABLE_HXX diff --git a/odb/semantics/template.cxx b/odb/semantics/template.cxx index c40f977..f492be0 100644 --- a/odb/semantics/template.cxx +++ b/odb/semantics/template.cxx @@ -1,8 +1,7 @@ // file : odb/semantics/template.cxx -// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v3; see accompanying LICENSE file -#include <cutl/compiler/type-info.hxx> +#include <libcutl/compiler/type-info.hxx> #include <odb/semantics/template.hxx> namespace semantics diff --git a/odb/semantics/template.hxx b/odb/semantics/template.hxx index 105920e..11fe340 100644 --- a/odb/semantics/template.hxx +++ b/odb/semantics/template.hxx @@ -1,5 +1,4 @@ // file : odb/semantics/template.hxx -// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v3; see accompanying LICENSE file #ifndef ODB_SEMANTICS_TEMPLATE_HXX diff --git a/odb/semantics/union-template.cxx b/odb/semantics/union-template.cxx index 0482168..21fc9c0 100644 --- a/odb/semantics/union-template.cxx +++ b/odb/semantics/union-template.cxx @@ -1,8 +1,7 @@ // file : odb/semantics/union-template.cxx -// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v3; see accompanying LICENSE file -#include <cutl/compiler/type-info.hxx> +#include <libcutl/compiler/type-info.hxx> #include <odb/semantics/union-template.hxx> namespace semantics diff --git a/odb/semantics/union-template.hxx b/odb/semantics/union-template.hxx index cf20625..3e719b7 100644 --- a/odb/semantics/union-template.hxx +++ b/odb/semantics/union-template.hxx @@ -1,5 +1,4 @@ // file : odb/semantics/union-template.hxx -// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v3; see accompanying LICENSE file #ifndef ODB_SEMANTICS_UNION_TEMPLATE_HXX diff --git a/odb/semantics/union.cxx b/odb/semantics/union.cxx index 66683a0..007ef57 100644 --- a/odb/semantics/union.cxx +++ b/odb/semantics/union.cxx @@ -1,8 +1,7 @@ // file : odb/semantics/union.cxx -// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v3; see accompanying LICENSE file -#include <cutl/compiler/type-info.hxx> +#include <libcutl/compiler/type-info.hxx> #include <odb/semantics/union.hxx> namespace semantics diff --git a/odb/semantics/union.hxx b/odb/semantics/union.hxx index 325bd76..79adc42 100644 --- a/odb/semantics/union.hxx +++ b/odb/semantics/union.hxx @@ -1,5 +1,4 @@ // file : odb/semantics/union.hxx -// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v3; see accompanying LICENSE file #ifndef ODB_SEMANTICS_UNION_HXX diff --git a/odb/semantics/unit.cxx b/odb/semantics/unit.cxx index 672fdb8..4f92aed 100644 --- a/odb/semantics/unit.cxx +++ b/odb/semantics/unit.cxx @@ -1,10 +1,9 @@ // file : odb/semantics/unit.cxx -// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v3; see accompanying LICENSE file #include <odb/gcc.hxx> -#include <cutl/compiler/type-info.hxx> +#include <libcutl/compiler/type-info.hxx> #include <odb/semantics/unit.hxx> namespace semantics diff --git a/odb/semantics/unit.hxx b/odb/semantics/unit.hxx index 8fd2339..cfccbff 100644 --- a/odb/semantics/unit.hxx +++ b/odb/semantics/unit.hxx @@ -1,5 +1,4 @@ // file : odb/semantics/unit.hxx -// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v3; see accompanying LICENSE file #ifndef ODB_SEMANTICS_UNIT_HXX diff --git a/odb/source.cxx b/odb/source.cxx index 7aa5f48..b2a39be 100644 --- a/odb/source.cxx +++ b/odb/source.cxx @@ -1,5 +1,4 @@ // file : odb/source.cxx -// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v3; see accompanying LICENSE file #include <odb/common.hxx> diff --git a/odb/sql-lexer.cxx b/odb/sql-lexer.cxx index 862de88..ab6f549 100644 --- a/odb/sql-lexer.cxx +++ b/odb/sql-lexer.cxx @@ -1,5 +1,4 @@ // file : odb/sql-lexer.cxx -// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v3; see accompanying LICENSE file #include <iostream> diff --git a/odb/sql-lexer.hxx b/odb/sql-lexer.hxx index ecb9bf9..9d24233 100644 --- a/odb/sql-lexer.hxx +++ b/odb/sql-lexer.hxx @@ -1,5 +1,4 @@ // file : odb/sql-lexer.hxx -// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v3; see accompanying LICENSE file #ifndef ODB_SQL_LEXER_HXX diff --git a/odb/sql-lexer.ixx b/odb/sql-lexer.ixx index fbe29e4..9179804 100644 --- a/odb/sql-lexer.ixx +++ b/odb/sql-lexer.ixx @@ -1,5 +1,4 @@ // file : odb/sql-lexer.ixx -// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v3; see accompanying LICENSE file // sql_lexer::xchar diff --git a/odb/sql-token.cxx b/odb/sql-token.cxx index f3c4808..da9ecb2 100644 --- a/odb/sql-token.cxx +++ b/odb/sql-token.cxx @@ -1,5 +1,4 @@ // file : odb/sql-token.cxx -// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v3; see accompanying LICENSE file #include <ostream> diff --git a/odb/sql-token.hxx b/odb/sql-token.hxx index 767fc64..c34de21 100644 --- a/odb/sql-token.hxx +++ b/odb/sql-token.hxx @@ -1,5 +1,4 @@ // file : odb/sql-token.hxx -// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v3; see accompanying LICENSE file #ifndef ODB_SQL_TOKEN_HXX diff --git a/odb/sql-token.ixx b/odb/sql-token.ixx index 97dde7c..5118c9f 100644 --- a/odb/sql-token.ixx +++ b/odb/sql-token.ixx @@ -1,5 +1,4 @@ // file : odb/sql-token.ixx -// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v3; see accompanying LICENSE file inline sql_token::token_type sql_token:: diff --git a/odb/traversal.hxx b/odb/traversal.hxx index ca2c757..7f421b1 100644 --- a/odb/traversal.hxx +++ b/odb/traversal.hxx @@ -1,5 +1,4 @@ // file : odb/traversal.hxx -// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v3; see accompanying LICENSE file #ifndef ODB_TRAVERSAL_HXX diff --git a/odb/traversal/class-template.cxx b/odb/traversal/class-template.cxx index 63ab9af..b04b625 100644 --- a/odb/traversal/class-template.cxx +++ b/odb/traversal/class-template.cxx @@ -1,5 +1,4 @@ // file : odb/traversal/class-template.cxx -// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v3; see accompanying LICENSE file #include <odb/traversal/class-template.hxx> diff --git a/odb/traversal/class-template.hxx b/odb/traversal/class-template.hxx index 738ef55..18e1e5b 100644 --- a/odb/traversal/class-template.hxx +++ b/odb/traversal/class-template.hxx @@ -1,5 +1,4 @@ // file : odb/traversal/class-template.hxx -// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v3; see accompanying LICENSE file #ifndef ODB_TRAVERSAL_CLASS_TEMPLATE_HXX diff --git a/odb/traversal/class.cxx b/odb/traversal/class.cxx index 766e91a..80c8b80 100644 --- a/odb/traversal/class.cxx +++ b/odb/traversal/class.cxx @@ -1,5 +1,4 @@ // file : odb/traversal/class.cxx -// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v3; see accompanying LICENSE file #include <odb/traversal/class.hxx> diff --git a/odb/traversal/class.hxx b/odb/traversal/class.hxx index 9a6985d..de86cc0 100644 --- a/odb/traversal/class.hxx +++ b/odb/traversal/class.hxx @@ -1,5 +1,4 @@ // file : odb/traversal/class.hxx -// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v3; see accompanying LICENSE file #ifndef ODB_TRAVERSAL_CLASS_HXX diff --git a/odb/traversal/derived.cxx b/odb/traversal/derived.cxx index 1f58f1c..a0acab8 100644 --- a/odb/traversal/derived.cxx +++ b/odb/traversal/derived.cxx @@ -1,5 +1,4 @@ // file : odb/traversal/derived.cxx -// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v3; see accompanying LICENSE file #include <odb/traversal/derived.hxx> diff --git a/odb/traversal/derived.hxx b/odb/traversal/derived.hxx index a91e397..b7648aa 100644 --- a/odb/traversal/derived.hxx +++ b/odb/traversal/derived.hxx @@ -1,5 +1,4 @@ // file : odb/traversal/derived.hxx -// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v3; see accompanying LICENSE file #ifndef ODB_TRAVERSAL_DERIVED_HXX diff --git a/odb/traversal/elements.cxx b/odb/traversal/elements.cxx index 9d7e9cd..f95917a 100644 --- a/odb/traversal/elements.cxx +++ b/odb/traversal/elements.cxx @@ -1,5 +1,4 @@ // file : odb/traversal/elements.cxx -// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v3; see accompanying LICENSE file #include <odb/traversal/elements.hxx> diff --git a/odb/traversal/elements.hxx b/odb/traversal/elements.hxx index 8c85a1b..d67a6d8 100644 --- a/odb/traversal/elements.hxx +++ b/odb/traversal/elements.hxx @@ -1,11 +1,10 @@ // file : odb/traversal/elements.hxx -// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v3; see accompanying LICENSE file #ifndef ODB_TRAVERSAL_ELEMENTS_HXX #define ODB_TRAVERSAL_ELEMENTS_HXX -#include <cutl/compiler/traversal.hxx> +#include <libcutl/compiler/traversal.hxx> #include <odb/semantics/elements.hxx> namespace traversal diff --git a/odb/traversal/enum.cxx b/odb/traversal/enum.cxx index cee3f58..fa33f92 100644 --- a/odb/traversal/enum.cxx +++ b/odb/traversal/enum.cxx @@ -1,5 +1,4 @@ // file : odb/traversal/enum.cxx -// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v3; see accompanying LICENSE file #include <odb/traversal/enum.hxx> diff --git a/odb/traversal/enum.hxx b/odb/traversal/enum.hxx index fd1ec39..cd141f2 100644 --- a/odb/traversal/enum.hxx +++ b/odb/traversal/enum.hxx @@ -1,5 +1,4 @@ // file : odb/traversal/enum.hxx -// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v3; see accompanying LICENSE file #ifndef ODB_TRAVERSAL_ENUM_HXX diff --git a/odb/traversal/fundamental.hxx b/odb/traversal/fundamental.hxx index a326eaa..974e74f 100644 --- a/odb/traversal/fundamental.hxx +++ b/odb/traversal/fundamental.hxx @@ -1,5 +1,4 @@ // file : odb/traversal/fundamental.hxx -// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v3; see accompanying LICENSE file #ifndef ODB_TRAVERSAL_FUNDAMENTAL_HXX diff --git a/odb/traversal/namespace.hxx b/odb/traversal/namespace.hxx index e1179df..223322b 100644 --- a/odb/traversal/namespace.hxx +++ b/odb/traversal/namespace.hxx @@ -1,5 +1,4 @@ // file : odb/traversal/namespace.hxx -// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v3; see accompanying LICENSE file #ifndef ODB_TRAVERSAL_NAMESPACE_HXX diff --git a/odb/traversal/relational.hxx b/odb/traversal/relational.hxx index 50255d1..a78e26b 100644 --- a/odb/traversal/relational.hxx +++ b/odb/traversal/relational.hxx @@ -1,5 +1,4 @@ // file : odb/traversal/relational.hxx -// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v3; see accompanying LICENSE file #ifndef ODB_TRAVERSAL_RELATIONAL_HXX diff --git a/odb/traversal/relational/changelog.cxx b/odb/traversal/relational/changelog.cxx index 0f2bd8c..149d93d 100644 --- a/odb/traversal/relational/changelog.cxx +++ b/odb/traversal/relational/changelog.cxx @@ -1,5 +1,4 @@ // file : odb/traversal/relational/changelog.cxx -// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v3; see accompanying LICENSE file #include <odb/traversal/relational/changelog.hxx> diff --git a/odb/traversal/relational/changelog.hxx b/odb/traversal/relational/changelog.hxx index 7c84d4c..4b7f18f 100644 --- a/odb/traversal/relational/changelog.hxx +++ b/odb/traversal/relational/changelog.hxx @@ -1,5 +1,4 @@ // file : odb/traversal/relational/changelog.hxx -// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v3; see accompanying LICENSE file #ifndef ODB_TRAVERSAL_RELATIONAL_CHANGELOG_HXX diff --git a/odb/traversal/relational/changeset.hxx b/odb/traversal/relational/changeset.hxx index 22651a9..3cc522a 100644 --- a/odb/traversal/relational/changeset.hxx +++ b/odb/traversal/relational/changeset.hxx @@ -1,5 +1,4 @@ // file : odb/traversal/relational/changeset.hxx -// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v3; see accompanying LICENSE file #ifndef ODB_TRAVERSAL_RELATIONAL_CHANGESET_HXX diff --git a/odb/traversal/relational/column.hxx b/odb/traversal/relational/column.hxx index f8718b7..b9c586d 100644 --- a/odb/traversal/relational/column.hxx +++ b/odb/traversal/relational/column.hxx @@ -1,5 +1,4 @@ // file : odb/traversal/relational/column.hxx -// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v3; see accompanying LICENSE file #ifndef ODB_TRAVERSAL_RELATIONAL_COLUMN_HXX diff --git a/odb/traversal/relational/elements.hxx b/odb/traversal/relational/elements.hxx index f8a8921..2b43ab0 100644 --- a/odb/traversal/relational/elements.hxx +++ b/odb/traversal/relational/elements.hxx @@ -1,11 +1,10 @@ // file : odb/traversal/relational/elements.hxx -// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v3; see accompanying LICENSE file #ifndef ODB_TRAVERSAL_RELATIONAL_ELEMENTS_HXX #define ODB_TRAVERSAL_RELATIONAL_ELEMENTS_HXX -#include <cutl/compiler/traversal.hxx> +#include <libcutl/compiler/traversal.hxx> #include <odb/semantics/relational/elements.hxx> namespace traversal diff --git a/odb/traversal/relational/foreign-key.hxx b/odb/traversal/relational/foreign-key.hxx index e5008ae..b8ccba3 100644 --- a/odb/traversal/relational/foreign-key.hxx +++ b/odb/traversal/relational/foreign-key.hxx @@ -1,5 +1,4 @@ // file : odb/traversal/relational/foreign-key.hxx -// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v3; see accompanying LICENSE file #ifndef ODB_TRAVERSAL_RELATIONAL_FOREIGN_KEY_HXX diff --git a/odb/traversal/relational/index.hxx b/odb/traversal/relational/index.hxx index bef8b02..2277fee 100644 --- a/odb/traversal/relational/index.hxx +++ b/odb/traversal/relational/index.hxx @@ -1,5 +1,4 @@ // file : odb/traversal/relational/index.hxx -// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v3; see accompanying LICENSE file #ifndef ODB_TRAVERSAL_RELATIONAL_INDEX_HXX diff --git a/odb/traversal/relational/key.cxx b/odb/traversal/relational/key.cxx index c10b584..15a131c 100644 --- a/odb/traversal/relational/key.cxx +++ b/odb/traversal/relational/key.cxx @@ -1,5 +1,4 @@ // file : odb/traversal/relational/key.cxx -// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v3; see accompanying LICENSE file #include <odb/traversal/relational/key.hxx> diff --git a/odb/traversal/relational/key.hxx b/odb/traversal/relational/key.hxx index c887198..d0ba2d7 100644 --- a/odb/traversal/relational/key.hxx +++ b/odb/traversal/relational/key.hxx @@ -1,5 +1,4 @@ // file : odb/traversal/relational/key.hxx -// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v3; see accompanying LICENSE file #ifndef ODB_TRAVERSAL_RELATIONAL_KEY_HXX diff --git a/odb/traversal/relational/model.hxx b/odb/traversal/relational/model.hxx index 59e86d6..03d70b1 100644 --- a/odb/traversal/relational/model.hxx +++ b/odb/traversal/relational/model.hxx @@ -1,5 +1,4 @@ // file : odb/traversal/relational/model.hxx -// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v3; see accompanying LICENSE file #ifndef ODB_TRAVERSAL_RELATIONAL_MODEL_HXX diff --git a/odb/traversal/relational/primary-key.hxx b/odb/traversal/relational/primary-key.hxx index ecfb880..dcefab6 100644 --- a/odb/traversal/relational/primary-key.hxx +++ b/odb/traversal/relational/primary-key.hxx @@ -1,5 +1,4 @@ // file : odb/traversal/relational/primary-key.hxx -// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v3; see accompanying LICENSE file #ifndef ODB_TRAVERSAL_RELATIONAL_PRIMARY_KEY_HXX diff --git a/odb/traversal/relational/table.hxx b/odb/traversal/relational/table.hxx index 1c3703d..d80e37e 100644 --- a/odb/traversal/relational/table.hxx +++ b/odb/traversal/relational/table.hxx @@ -1,5 +1,4 @@ // file : odb/traversal/relational/table.hxx -// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v3; see accompanying LICENSE file #ifndef ODB_TRAVERSAL_RELATIONAL_TABLE_HXX diff --git a/odb/traversal/template.cxx b/odb/traversal/template.cxx index bf24345..21a846d 100644 --- a/odb/traversal/template.cxx +++ b/odb/traversal/template.cxx @@ -1,5 +1,4 @@ // file : odb/traversal/template.cxx -// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v3; see accompanying LICENSE file #include <odb/traversal/template.hxx> diff --git a/odb/traversal/template.hxx b/odb/traversal/template.hxx index afec6d8..28a64d5 100644 --- a/odb/traversal/template.hxx +++ b/odb/traversal/template.hxx @@ -1,5 +1,4 @@ // file : odb/traversal/template.hxx -// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v3; see accompanying LICENSE file #ifndef ODB_TRAVERSAL_TEMPLATE_HXX diff --git a/odb/traversal/union-template.cxx b/odb/traversal/union-template.cxx index 5275541..9d72fcd 100644 --- a/odb/traversal/union-template.cxx +++ b/odb/traversal/union-template.cxx @@ -1,5 +1,4 @@ // file : odb/traversal/union-template.cxx -// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v3; see accompanying LICENSE file #include <odb/traversal/union-template.hxx> diff --git a/odb/traversal/union-template.hxx b/odb/traversal/union-template.hxx index 3ff8e19..10d1d49 100644 --- a/odb/traversal/union-template.hxx +++ b/odb/traversal/union-template.hxx @@ -1,5 +1,4 @@ // file : odb/traversal/union-template.hxx -// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v3; see accompanying LICENSE file #ifndef ODB_TRAVERSAL_UNION_TEMPLATE_HXX diff --git a/odb/traversal/union.hxx b/odb/traversal/union.hxx index 7dfa8c8..2d1a7af 100644 --- a/odb/traversal/union.hxx +++ b/odb/traversal/union.hxx @@ -1,5 +1,4 @@ // file : odb/traversal/union.hxx -// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v3; see accompanying LICENSE file #ifndef ODB_TRAVERSAL_UNION_HXX diff --git a/odb/traversal/unit.hxx b/odb/traversal/unit.hxx index 2f31c16..a90418a 100644 --- a/odb/traversal/unit.hxx +++ b/odb/traversal/unit.hxx @@ -1,5 +1,4 @@ // file : odb/traversal/unit.hxx -// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v3; see accompanying LICENSE file #ifndef ODB_TRAVERSAL_UNIT_HXX diff --git a/odb/validator.cxx b/odb/validator.cxx index 64a539f..bf9aa6b 100644 --- a/odb/validator.cxx +++ b/odb/validator.cxx @@ -1,5 +1,4 @@ // file : odb/validator.cxx -// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v3; see accompanying LICENSE file #include <odb/gcc.hxx> @@ -1656,6 +1655,9 @@ namespace // temporarily redirect diagnostics to /dev/null, which is // where asm_out_file points to (see plugin.cxx). // + // Needless to say, this is very hacky and we should quickly fail + // (as we do below) if there were errors. + // int ec (errorcount); FILE* s (global_dc->printer->buffer->stream); global_dc->printer->buffer->stream = asm_out_file; diff --git a/odb/validator.hxx b/odb/validator.hxx index 40ef11c..d0aeac9 100644 --- a/odb/validator.hxx +++ b/odb/validator.hxx @@ -1,5 +1,4 @@ // file : odb/validator.hxx -// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v3; see accompanying LICENSE file #ifndef ODB_VALIDATOR_HXX diff --git a/odb/version.hxx b/odb/version.hxx index b0c1549..4ad389a 100644 --- a/odb/version.hxx +++ b/odb/version.hxx @@ -1,5 +1,4 @@ // file : odb/version.hxx -// copyright : Copyright (c) 2005-2019 Code Synthesis Tools CC // license : GNU GPL v3; see accompanying LICENSE file #ifndef ODB_VERSION_HXX @@ -24,12 +23,15 @@ // ODB interface version: minor, major, and alpha/beta versions. // -#define ODB_VERSION 20466 -#define ODB_VERSION_STR "2.5-b.16" +#define ODB_VERSION 20476 +#define ODB_VERSION_STR "2.5-b.26" // ODB compiler version: interface version plus the bugfix version. // -#define ODB_COMPILER_VERSION 2049966 -#define ODB_COMPILER_VERSION_STR "2.5.0-b.16" +// NOTE: remember to update metadata to full version when switching to +// version.hxx.in. +// +#define ODB_COMPILER_VERSION 2049976 +#define ODB_COMPILER_VERSION_STR "2.5.0-b.26" #endif // ODB_VERSION_HXX diff --git a/repositories.manifest b/repositories.manifest index b5047b5..e0c2961 100644 --- a/repositories.manifest +++ b/repositories.manifest @@ -8,3 +8,7 @@ location: https://git.codesynthesis.com/libcutl/libcutl.git##HEAD : role: prerequisite location: https://git.codesynthesis.com/libstudxml/libstudxml.git##HEAD + +: +role: prerequisite +location: https://git.codesynthesis.com/cli/cli.git##HEAD diff --git a/tests/build/bootstrap.build b/tests/build/bootstrap.build index 6e073dc..5e48571 100644 --- a/tests/build/bootstrap.build +++ b/tests/build/bootstrap.build @@ -1,5 +1,4 @@ # file : tests/build/bootstrap.build -# copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC # license : GNU GPL v3; see accompanying LICENSE file project = # Unnamed subproject. diff --git a/tests/build/root.build b/tests/build/root.build index 18d4506..0995b7b 100644 --- a/tests/build/root.build +++ b/tests/build/root.build @@ -1,10 +1,14 @@ # file : tests/build/root.build -# copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC # license : GNU GPL v3; see accompanying LICENSE file +# We need to configure C++ module to obtain the target information (see +# below). +# +using cxx.config + # Import the ODB compiler we will be testing. # -import odb = odb%exe{odb} +import! [metadata] odb = odb%exe{odb} testscript{*}: test = $odb # Specify the test target for cross-testing. diff --git a/tests/buildfile b/tests/buildfile index 0597f5c..80a4e67 100644 --- a/tests/buildfile +++ b/tests/buildfile @@ -1,5 +1,4 @@ # file : tests/buildfile -# copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC # license : GNU GPL v3; see accompanying LICENSE file ./: testscript $odb diff --git a/tests/testscript b/tests/testscript index 3c810f5..5448eca 100644 --- a/tests/testscript +++ b/tests/testscript @@ -1,5 +1,4 @@ # file : tests/testscript -# copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC # license : GNU GPL v3; see accompanying LICENSE file : version @@ -1 +1 @@ -2.5.0-b.16 +2.5.0-b.26 |