// file : odb/options.cli // copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC // license : GNU GPL v3; see accompanying LICENSE file include ; include ; include ; include ; class options { // // Wrapper options. These are not passed to the plugin. // bool --help {"Print usage information and exit."}; bool --version {"Print version and exit."}; // // C++ preprocessor options. Also not passed to the plugin. // std::vector -I { "", "Add to the beginning of the list of directories to be searched for included header files." }; std::vector -D { "[=]", "Define macro with definition . If definition is omitted, define to be 1." }; std::vector -U { "", "Cancel any previous definitions of macro , either built-in or provided with the \cb{-D} option." }; // // Plugin options. // ::database --database | -d { "", "Generate code for the database. Valid values are \cb{mssql}, \cb{mysql}, \cb{oracle}, \cb{pgsql}, and \cb{sqlite}." }; bool --generate-query | -q { "Generate query support code. Without this support you cannot use views and can only load objects via their ids." }; bool --generate-schema | -s { "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 (\cb{--database} 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 \cb{--schema-format} option to alter the default schema format." }; std::set< ::schema_format> --schema-format { "", "Generate the database schema in the specified format. Pass \cb{sql} as to generate the database schema as a standalone SQL file or pass \cb{embedded} to embed the schema into the generated C++ code. Repeat this option to generate the same database schema in multiple formats." }; std::string --schema-name = "" { "", "Use 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 \cb{--schema} option. If this option is not specified, the empty name, which is the default schema name, is used." }; std::string --default-pointer = "*" { "", "Use as the default pointer for persistent objects and views. Objects and views that do not have a pointer assigned with the \cb{db pointer} pragma will use this pointer by default. The value of this option can be \cb{*} which denotes the raw pointer and is the default, or qualified name of a smart pointer class template, for example, \cb{std::auto_ptr}. 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 \cb{std::auto_ptr}. 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 \cb{} 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 \cb{--hxx-prologue} option to add the necessary \cb{#include} directive to the generated code." }; // The following option is "fake" in that it is actually handled by // argv_file_scanner. We have it here to get the documentation. // std::string --profile | -p { "", "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 \cb{-}\ci{database}\cb{.options} suffix to , where \ci{database} is the database name as specified with the \cb{--database} 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 \cb{.options} suffix. The profile options files are searched for in the same set of directories as C++ headers included with the \cb{#include <...>} directive (built-in paths plus those specified with the \cb{-I} options). The options file is first searched for in the directory itself and then in its \cb{odb/} subdirectory. For the format of the options file refer to the \cb{--options-file} option below. You can repeat this option to specify more than one profile." }; qname --schema { "", "Specify a database schema (database namespace) that should be assigned to the persistent classes in a file being compiled. Database schemas are not to be confused with database schema names (schema catalog names) which are specified with the \cb{--schema-name} option." }; std::string --table-prefix { "", "Add to table and index names. The prefix is added to both names that were specified with the \cb{db table} pragma and those that were automatically derived from class 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." }; std::string --output-dir | -o { "", "Write the generated files to instead of the current directory." }; std::string --odb-file-suffix = "-odb" { "", "Use instead of the default \cb{-odb} to construct the names of the generated C++ files." }; std::string --hxx-suffix = ".hxx" { "", "Use instead of the default \cb{.hxx} to construct the name of the generated C++ header file." }; std::string --ixx-suffix = ".ixx" { "", "Use instead of the default \cb{.ixx} to construct the name of the generated C++ inline file." }; std::string --cxx-suffix = ".cxx" { "", "Use instead of the default \cb{.cxx} to construct the name of the generated C++ source file." }; std::string --sql-suffix = ".sql" { "", "Use instead of the default \cb{.sql} to construct the name of the generated database schema file." }; // Prologues. // std::vector --hxx-prologue { "", "Insert at the beginning of the generated C++ header file." }; std::vector --ixx-prologue { "", "Insert at the beginning of the generated C++ inline file." }; std::vector --cxx-prologue { "", "Insert at the beginning of the generated C++ source file." }; std::vector --sql-prologue { "", "Insert at the beginning of the generated database schema file." }; // Epilogues. // std::vector --hxx-epilogue { "", "Insert at the end of the generated C++ header file." }; std::vector --ixx-epilogue { "", "Insert at the end of the generated C++ inline file." }; std::vector --cxx-epilogue { "", "Insert at the end of the generated C++ source file." }; std::vector --sql-epilogue { "", "Insert at the end of the generated database schema file." }; // Prologue files. // std::string --hxx-prologue-file { "", "Insert the content of at the beginning of the generated C++ header file." }; std::string --ixx-prologue-file { "", "Insert the content of at the beginning of the generated C++ inline file." }; std::string --cxx-prologue-file { "", "Insert the content of at the beginning of the generated C++ source file." }; std::string --sql-prologue-file { "", "Insert the content of at the beginning of the generated database schema file." }; // Epilogue files. // std::string --hxx-epilogue-file { "", "Insert the content of at the end of the generated C++ header file." }; std::string --ixx-epilogue-file { "", "Insert the content of at the end of the generated C++ inline file." }; std::string --cxx-epilogue-file { "", "Insert the content of at the end of the generated C++ source file." }; std::string --sql-epilogue-file { "", "Insert the content of at the end of the generated database schema file." }; // ODB compilation prologue/epilogue. // std::vector --odb-prologue { "", "Compile before the input header file. This option allows you to add additional declarations, such as custom traits specializations, to the ODB compilation process." }; std::vector --odb-prologue-file { "", "Compile contents before the input header file. Prologue files are compiled after all the prologue text fragments (\cb{--odb-prologue} option)." }; std::vector --odb-epilogue { "", "Compile after the input header file. This option allows you to add additional declarations, such as custom traits specializations, to the ODB compilation process." }; std::vector --odb-epilogue-file { "", "Compile contents after the input header file. Epilogue files are compiled after all the epilogue text fragments (\cb{--odb-epilogue} option)." }; // Include options. // bool --include-with-brackets { "Use angle brackets (<>) instead of quotes (\"\") in the generated \cb{#include} directives." }; std::string --include-prefix { "", "Add to the generated \cb{#include} directive paths." }; std::vector --include-regex { "", "Add to the list of regular expressions used to transform generated \cb{#include} directive paths. The argument to this option is a Perl-like regular expression in the form \c{\b{/}\i{pattern}\b{/}\i{replacement}\b{/}}. Any character can be used as a delimiter instead of \cb{/} and the delimiter can be escaped inside \ci{pattern} and \ci{replacement} with a backslash (\cb{\\}). 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 \cb{foo/bar-odb.h} to paths in the form \cb{foo/generated/bar-odb.h}: \cb{%foo/(.+)-odb.h%foo/generated/$1-odb.h%} See also the REGEX AND SHELL QUOTING section below." }; bool --include-regex-trace { "Trace the process of applying regular expressions specified with the \cb{--include-regex} option. Use this option to find out why your regular expressions don't do what you expected them to do." }; std::string --guard-prefix { "", "Add 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." }; // The following option is "fake" in that it is actually handled by // argv_file_scanner. We have it here to get the documentation. // std::string --options-file { "", "Read additional options from with each option appearing on a separate line optionally followed by space and an option value. Empty lines and lines starting with \cb{#} are ignored. Option values can be enclosed in double (\cb{\"}) or single (\cb{'}) 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 \cb{'\"x\"'}. 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 \cb{--options-file} option is specified except that the shell escaping and quoting is not required. You can repeat this option to specify more than one options file." }; std::vector -x { "