ADDED Bakefiles.bkgen Index: Bakefiles.bkgen ================================================================== --- /dev/null +++ Bakefiles.bkgen @@ -0,0 +1,24 @@ + + + + ./mysql++.bkl + + + + + autoconf,mingw,msvs2003prj,msvs2005prj,msvs2008prj,xcode2 + + + + -o$(INPUT_FILE_DIR)/Makefile.mingw + + + -ovc2003/mysql++.sln + + + -ovc2005/mysql++.sln + + + -ovc2008/mysql++.sln -DMSVS_PLATFORMS=win64 + + DELETED COPYING Index: COPYING ================================================================== --- COPYING +++ /dev/null @@ -1,10 +0,0 @@ -The MySQL++ library proper and the reference manual derived from -comments in the library source code are licensed under the GNU Lesser -General Public License. A copy is provided in this directory, in the -file LGPL. - -The MySQL++ User Manual is licensed under a unique license derived from -the Linux Documentation Project License. (The only changes are due to -the fact that the User Manual isn't actually part of the LDP, so a lot -of the language in the LDPL doesn't make sense when applied to the user -manual.) This license is provided in the file doc/userman/LICENSE. ADDED COPYING.txt Index: COPYING.txt ================================================================== --- /dev/null +++ COPYING.txt @@ -0,0 +1,10 @@ +The MySQL++ library proper and the reference manual derived from +comments in the library source code are licensed under the GNU Lesser +General Public License. A copy is provided in this directory, in the +file LICENSE.txt. + +The MySQL++ User Manual is licensed under a unique license derived from +the Linux Documentation Project License. (The only changes are due to +the fact that the User Manual isn't actually part of the LDP, so a lot +of the language in the LDPL doesn't make sense when applied to the user +manual.) This license is provided in the file doc/userman/LICENSE.txt. DELETED CREDITS Index: CREDITS ================================================================== --- CREDITS +++ /dev/null @@ -1,76 +0,0 @@ -MySQL++ was created by Kevin Atkinson during 1998. From version 1.0 -(released in June 1999) through 1.7.9 (May 2001), the primary maintainer -was Sinisa Milivojevic . Neither Kevin nor Sinisa -are currently involved in MySQL++ development. The current maintainer -is Warren Young , starting with version 1.7.10 in -August of 2004. - -For a fuller account of the library's history, see the first chapter -of the user manual. For the nitty-gritty details, see the ChangeLog -in the root package directory. ChangeLog items since 1.7.9 that -aren't attributed to anyone else were done by Warren Young. - - -Other contributors of note since 1.7.10: - - Chris Frey : Lots of GCC warning fixes for - the bleeding-edge compiler versions, and Gentoo ebuild support. - Also, if there were a "steering committee" for MySQL++, he'd be - on it. - - Totte Karlsson : Primary force behind Borland - C++ Builder support. - - Mark Meredino : Several fixes and - additions, including a lot of work on Microsoft Visual C++ - compatibility, and discoveries made while spelunking in the - library. - - Evan Wies : Contributed several C++ code - style cleanups. - - Arnon Jalon : Added the multi-query - result set handling features, and multiquery example to demonstrate - it. - - -Here are the personal credits from the old 1.7.9 documentation, -apparently written by Kevin Atkinson: - - Chris Halverson - For helping me get it to compile under Solaris. - - Fredric Fredricson - For a long talk about automatic conversions. - - Michael Widenius - MySQL developer who has been very supportive of - my efforts. - - Paul J. Lucas - For the original idea of treating the query object - like a stream. - - Scott Barron - For helping me with the shared libraries. - - Jools Enticknap - For giving me the Template Queries idea. - - M. S. Sriram - For a detailed dission of how the Template Queries - should be implemented, the suggestion to throw exceptions on bad - queries, and the idea of having a back-end independent query - object (ie SQLQuery). - - Sinisa Milivojevic - For becoming the new offical maintainer. - - D. Hawkins and E. Loic for their autoconf + automake contribution. - - -See the ChangeLog for further credits, and details about the differences -between the many versions of this library. - - -Please do not email any of these people with general questions about -MySQL++. All of us who are still active in MySQL++ development read the -mailing list, so questions sent there do get to us: - - http://lists.mysql.com/plusplus - -The mailing list is superior to private email because the answers are -archived for future questioners to find, and because you are likely to -get answers from more people. ADDED CREDITS.txt Index: CREDITS.txt ================================================================== --- /dev/null +++ CREDITS.txt @@ -0,0 +1,101 @@ +MySQL++ was created by Kevin Atkinson during 1998. From version +1.0 (released in June 1999) through 1.7.9 (May 2001), the primary +maintainer was Sinisa Milivojevic . Neither Kevin +nor Sinisa are currently involved in MySQL++ development. The current +maintainer is Warren Young , starting with +version 1.7.10 in August of 2004. + +For a fuller account of the library's history, see the first chapter +of the user manual. For the nitty-gritty details, see the ChangeLog +in the root package directory. ChangeLog items since 1.7.9 that +aren't attributed to anyone else were done by Warren Young. + + +Other contributors of note since 1.7.10: + + Chris Frey : Lots of GCC warning fixes + for the bleeding-edge compiler versions, Gentoo ebuild support, + and misc other fixes. + + Mark Meredino : Several fixes and + additions, including a lot of work on Microsoft Visual C++ + compatibility, and discoveries made while spelunking in the + library. + + Evan Wies : Contributed several C++ code + style cleanups. + + Arnon Jalon : Added the multi-query + result set handling features, and examples/multiquery.cpp to + demonstrate it. + + Korolyov Ilya has submitted several patches in many different + areas of the library. + + Remi Collet is maintaining offical RPMs + for Fedora, with other systems on the way. His work has improved + the RPM spec file we distribute greatly. + + Joel Fielder of Switchplane, + Ltd. created the ScopedConnection class, came up with the original + idea for Query's for_each() and store_in() methods, provided the + basis for examples/for_each.cpp, and provided a fix for exception + flag propagation in Query. + + Jim Wallace demonstrated the need + for BadQuery::errnum(), and contributed the patches and also + examples/deadlock.cpp to test that this feature does what it is + supposed to. + + Jonathan Wakely rebuilt my original versions + of ConnectionPool, RefCountedPointer, and RefCountedBuffer. + They're now simpler and safer. He also created the numeric + conversion logic in lib/mystring.h introduced in v3.0. + + Adrian Cornish Several fixes and + additions. + + Rick Gutleber contributed the + Query::insertfrom() method and associated InsertPolicy object, + as well as the SQLStream class. + +Here are the personal credits from the old 1.7.9 documentation, +apparently written by Kevin Atkinson: + + Chris Halverson - For helping me get it to compile under Solaris. + + Fredric Fredricson - For a long talk about automatic conversions. + + Michael Widenius - MySQL developer who has been very supportive of + my efforts. + + Paul J. Lucas - For the original idea of treating the query object + like a stream. + + Scott Barron - For helping me with the shared libraries. + + Jools Enticknap - For giving me the Template Queries idea. + + M. S. Sriram - For a detailed dission of how the Template Queries + should be implemented, the suggestion to throw exceptions on bad + queries, and the idea of having a back-end independent query + object (ie SQLQuery). + + Sinisa Milivojevic - For becoming the new offical maintainer. + + D. Hawkins and E. Loic for their autoconf + automake contribution. + + +See the ChangeLog for further credits, and details about the differences +between the many versions of this library. + + +Please do not email any of these people with general questions about +MySQL++. All of us who are still active in MySQL++ development read the +mailing list, so questions sent there do get to us: + + http://lists.mysql.com/plusplus + +The mailing list is superior to private email because the answers are +archived for future questioners to find, and because you are likely to +get answers from more people. Index: ChangeLog ================================================================== --- ChangeLog +++ ChangeLog @@ -1,1047 +1,2828 @@ +3.2.3, 2016.12.29 (r2790) + + o Now using snprintf() instead of _snprintf() on Visual C++ 2015. + + o Cygwin changed its naming for the MySQL C API library since the + last time we successfully tried building MySQL++ there. Reworked + the autoconf detection macro to make it less dependent on such + individual platform differences. + + The macro is in fact now entirely side-effect-free, just setting + MYSQL_C_* variables that the top-level Bakefile uses when and + as it needs them, rather than expecting that major variables + like CPPLFAGS and LIBS were overridden by the autoconf macro. + This makes the autoconf case more like that of the non-autoconf + Bakefile outputs. + + o Squished a Clang warning + + +3.2.2, 2015.03.18 (r2780) + + o The DBDriver::operator= would leak a live connection if you + assigned a disconnected DBDriver to it. Patch by Quentin Armitage. + + o Plugged a potential DBDriver instance leak in Connection ctor. + Patch by Yury Alekseev. + + o Explicitly #including algorithm.h in examples/multiquery.cpp for + std::max(). + + o Added missing "break;" statements in Transaction ctor taking an + isolation level parameter, which caused only the last one to do + the right thing. Problem noticed by Tony Whyman, fix by me. + + o The bootstrap script now checks for the existence of needed build + tools before trying to use them. This lets us emit a clearer + error message than the shell will. Original patch by Adrian + Cornish. + + o Fixed a build problem related to std::min/max with Visual C++ 2013 + due to a change in the definitions provided by its header files. + + o Tracked several changes made to Connector/C made since 3.2.1. + + o Assorted documentation updates. + + o Generating HTML with UTF-8 encoding, not 8859-1 + + +3.2.1, 2013.12.10 (r2756) + + o Connection copy ctor wasn't copying the "throw exceptions" + flag. The copy always had exceptions enabled. + + o The resetdb example would print a bogus message about logging in + as '1'@'1' instead of showing the actual values passed on the + command line. This did not affect how it actually logged in. + + o Previous release tarball was missing a few text files present in + the source repository. + + o Updated build paths for VC++ and MinGW to track a file layout + change in Connector/C 6.1.2. + + +3.2.0, 2013.06.20 (r2747) + + o References to MySQL 5.1 have been replaced with 5.6, that + being the current GA release. + + o All Windows builds now assume you're using Connector/C 6.1 + instead of having installed the MySQL server on your machine + just to get development files. If you are running a MySQL + server on your development machine and don't want to install + Connector/C just to make MySQL++ happy, see the README-*.txt + file for your platform to get instructions on fixing the paths + so the build system finds the development files under the MySQL + server directory. + + o The generated VC++ 2008 project files now assume you want 64-bit + executables. (It is 2013 now, after all.) + + Since the VC++ 2005 project files continue to be configured for + 32-bit builds, the easiest way to get a 32-bit project in VC++ + 2008+ is to import the VC++ *2005* project files, rather than + adjust the build target settings of all 44 vc2008/*.vcproj + files within the IDE. + + See README-Visual-C++.txt for more on this change. + + o Added Query::replacefrom(): like insertfrom() but it uses + REPLACE statements instead of INSERT. Patch by Adrian Cornish. + + o Added support for SQL "unsigned float" columns. Patch by + Leonardo Lang. + + o Added "abicheck" top-level build target, which runs the + ISPRAS ABI checker tool (http://goo.gl/e19lD) against + a predecided "ABI-stable" version of MySQL++, comparing it + against the current version. This should help avoid future + unplanned ABI breakages, as happened between 3.0.9 and 3.1.0. + + We have chosen not to revert those changes that broke the ABI, + but instead have chosen to accept the 3.1.0 ABI as the new + stable ABI for the rest of the 3.x series. Running the ABI + checker is now part of the release process, so we should not + change the ABI again until 4.0! + + o The Query::insert() and replace() overloads that take a pair + of iterators now work with containers that only provide forward + iterators. Idea by Adrian Cornish. + + o Using libtool again on Autotools systems. It gives us + relocatable libraries, which is needed in some linking + situations. Patch by Adrian Cornish. + + o VC++ release builds now have optimization enabled. This might + also affect other toolchains that create separate Debug and + Release builds, if Bakefile obeys the directive for those + systems. (Such as, perhaps, Xcode.) Initial patch by Matthew + Bradbury. + + o Fixed a crash in CommandLine mechanism when the usage message is + called up for programs that have no "extra" parameter and + corresponding usage appendage. Initial patch by "Crazy Pete". + + o Query::storein() now tolerates empty result sets, due either to + DBMS failure or passing a query that never returns results, + such as INSERT. + + o Exposed DBDriver::result_empty() as Query::result_empty(). We + did this primarily because it was needed as a helper for the + previous fix, but it could also be useful more broadly. + + o Added -Wextra to the pedantic build flags. + + o Fixed the "escape" manipulator so it will work with Null<> + wrapped types. Patch by "Kemet". + + o ssqls2parse now depends on libmysqlpp. (It wasn't getting + relinked when you changed the library.) + + o The configure script's test for the existence of mysql_ssl_set() + got broken by a change in the mysql_loc.m4 test, causing it to + always return "no" even if the platform's MySQL C API library did + have the function. Therefore, the SslOption could never be set. + Fixes this bug: stackoverflow.com/questions/7794408 + + o Fixed a missing a "buried headers" ifdef wrapper for + type_info.cpp. Patch provided by Xavier Richez. + + o We now export the DBDriver class from the MySQL++ DLL when + building on Windows. Client programs can now access it directly, + instead of being able to access only the fields and members + exposed through Connection and Query. Fix suggested by Xavier + Richez. + + o MinGW builds no longer require that you manually create an import + library for the MySQL C API DLL from a .def file we provide, + which would inevitably get outdated. We can now link directly to + the DLL, and rely on the MinGW linker to figure out the imports. + + o Split the -l flags out of LDFLAGS in the userman's example + Makefiles. They're now in LDLIBS, which causes them to be + put after -o $(EXE) by the default GNU make rules, where they + should be. + + o Assorted documentation and build system improvements. + + o Assorted fixes for newer GCCs. + + +3.1.0, 2010.06.03 (r2670) + + o Default MySQL version now 5.1, having entered GA since 3.0.9. + + o Lots of platform updates tracked, lots of warnings from newer + compilers squished. Most by me, some by Adrian Cornish. + + o Added Query::insertfrom(), plus associated classes SQLStream, + NoTransactions, and the InsertPolicy hierarchy. Also adds + examples/ssqls6.cpp, which shows how to use this new feature. + Thanks for this feature go to Rick Gutleber, except for + RowCountInsertPolicy, by me. + + o Added comparison operators to tiny_int. Thanks for this patch + go to Edward Diener. + + o Added SQLTypeAdapter::is_null(). This lets you retrieve a + nullable column from the DB, then re-insert a value from that + column back into the DB via a template query without explicit + checks for null-ness; it will do the right thing now. + + o Added -f flags to lib/*.pl header file generating scripts to + allow overriding the default limit of 25 fields for tqueries + and SSQLSes without having to edit the file, as in previous + versions of MySQL++. Also added --with-field-limit option to + the configure script so you can give both -f options at once + during the build process. This latter is especially useful + for automated binary package builders. + + o The file lib/querydef.h (generated by lib/querydef.pl) now + defines the MYSQLPP_TQUERY_MAX_PARAMETERS macro, giving the + maximum number of parameters the functions in the generated file + allow for template queries. Similarly, lib/ssqls.h (generated + by lib/ssqls.pl) defines MYSQLPP_SSQLS_MAX_MEMBERS. + + o Added ConnectionPool::safe_grab(), which pings the grabbed + connection before returning it. If the ping fails, we remove + the dead connection from the pool and try again. This doesn't + eliminate the possibility of returning a dead connection; + there is no protection against race conditions. It is merely + a best-effort attempt. + + o Added ConnectionPool::remove(Connection*), which removes a + connection from the pool. + + o Added ConnectionPool::exchange(), which wraps remove() + and grab(). It works like a customer support counter in a + store: "I'm sorry, but this Connection is defective. Can I + have another, please?" + + o Added a feature to Transaction, where it can send a SET + TRANSACTION ISOLATION LEVEL query before it starts the + transaction proper, affecting the isolation level and the scope + of that change. + + o Added ScopedConnection class. Initial version by Joel Fielder, + lots of changes by me. Using it instead of explicit safe_grab() + and release() calls on the pool in examples/cpool.cpp. + + o Added FieldNames::operator[](size_type) overloads. This is + necessary to correctly overload the base class versions inherited + from std::vector. + + o FieldNames wasn't doing field-by-name matches case insentitively, + most likely since 3.0.0 when we changed it to derive from + std::vector. This caused SSQLS (at least) to be case sensitive. + Fixed this and renamed the stock.sdate field in the SSQLS + examples to stock.sDate to test this. + + o Added Query::replace(iter, iter), on the model of existing + insert(iter, iter). Thanks for this patch go to David Walthour. + + o Added Query::operator!(), overriding basic_ios version so that + "if (!query)" does the right thing. Fixes problem report in + thread http://lists.mysql.com/plusplus/8594 + + o Query copy ctor and assignment operator now perform deeper + copies, so you can pass Query objects around in certain ways + that used to cause crashes. Thanks for this patch go to Steven + Van Ingelgem. + + o Defined *_null variants for every sql_* typedef, wrapping + all those earlier types in Null<>. All example programs now use + these types instead of explicit Null<>-wrapped types. + + o Created a C++ command line parsing mechanism for the examples + today, and for programs coming in the future. It uses the + platform version of getopt() if available, substituting a + public-domain implementation that gets built into MySQL++ + itself otherwise. It's documented in the refman -- see + the CommandLineBase class -- but it's in the newly created + mysqlpp::internal namespace, which means we don't promise any + sort of ABI or API stability for it. You're welcome to use it + in your own programs, but expect it to change without warning. + + o Added a few missing MYSQLPP_EXPORTs to operator<<()s for stream + manipulators, to allow their use when MySQL++ is built as a DLL. + + o Added backticks around table and column identifiers in all + code paths exercised by dtest. There are some others remaining, + particularly things like Row::field_list(). Thanks for this + patch go to Adrian Cornish. + + o Added mysqlpp::NOW() which returns a value that, when inserted + into a SQL query, results in a call to SQL's NOW() function. + DateTime::now() -- added in 3.0.0 -- does the same thing, + but this is shorter and matches the SQL syntax. + + o Calling DBDriver::disconnect() twice no longer calls + mysql_close() twice. + + o Worked around a weakness on Windows that caused problems in code + with a connect(), disconnect(), connect() call pattern, when + also using a named pipe to connect to the DB. (There never + has been a problem with this on other platforms or with other + IPC mechanisms.) + + o Initializing a SQLTypeAdapter with a floating-point value + equal to infinity or NaN results in SQL null if the type + is also nullable, or 0 otherwise. Previously, we got an + implementation-defined string, which could give invalid SQL, + or could give 0, a different value from NaN, infinity, or + SQL null. This does collapse the notions of NaN and infinity, + but the MySQL reference manual doesn't say how you're supposed + to preserve these differences. + + o Removed the dependency of stadapter.h on sql_types.h, just to get + sql_tinyint*. #including tinyint.h instead, and using equivalent + types to what sql_types.h defines. This is necessary because + sql_types.h should be one of the last things included from + mysql++.h, so that it can define sql_* equivalents for everything + else in MySQL++, which means all those other things need to be + #included by that point. + + o The "find MySQL++" autoconf macro (config/mysql++.m4) now + searches for the library in lib64 subdirectories everywhere it + also looks in lib. We did this for the C API finder macro way + back in MySQL++ 2.2.0, and only neglected to do it for this + macro because it's not used by MySQL++ itself, just provided + as a courtesy to MySQL++ users that also use autoconf. + + o Also improved the "find C API" macro (config/mysql_loc.m4) + so it, too, is more useful in third-party projects. + + o Moved private FieldNames::str_to_lwr() method out into its + own module, in the new mysqlpp::internal namespace, so other + modules can use it. Also added an overload for this new global + method taking std::string instead of char*. + + o userman build process can now find FOP when installed from + the standard Ubuntu/Debian package repository. + + o No longer generating refman.pdf. It's difficult to generate + properly on some platforms, and isn't all that useful anyway + compared to the HTML version, which builds properly everywhere. + + o Dropped custom.h backwards-compatibility header. (Deprecated + over a year ago in MySQL++ 3.0.0.) + + o Fixed a bad pointer access crash in Connection::set_option() + triggered when the option set call fails. Thanks for this + patch go to Kevin Regan. + + o ReconnectOption behavior now knows about a fix in MySQL 5.1.6 and + newer that lets you set it either before the connection is up, + or after. If you try to set this option when MySQL++ is built + against earlier versions of the MySQL C API, it will refuse to + set the option because it knows the option will be reset when + the connection comes up. + + o No longer trying to make the C API library read from a "my" + options file before connect. It does that by default, and + the file is supposed to be .my.cnf anyway. + + o Reworked the load_jpeg example code for clarity, extracting + load_jpeg_file() routine as an implementation detail and + making that use the C++ stringstream "slurp into string" idiom + instead of allocating a C char buffer and copying that into + a std::string. + + o Restored support for repeating query parameters. Apparently + you could say things like "stuff %0 morestuff %0" in v2.1, + but this was broken by initial 1-parameter fixes in v2.2. + This patch reportedly lets us have both things at once, and + improves handling of 1-parameter template queries in general. + Thanks for this patch go to Martin Gallwey. + + o Added examples/tquery4.cpp based on test code and feedback + from Martin. + + o Put Comparable class in namespace mysqlpp, where it should always + have been. Aside from being just plain wrong, it caused a + conflict with Boost if you used its Comparable class and hoist + them both into the global namespace. Thanks for this patch go + to Michael Radzewitz. + + o Fixed all the known problems with the Xcode project files. + + o Skeletal support for SSQLS v2. Doesn't do anything useful + yet, it just got caught up in the need to release 3.1 as-is. + + o Various enhancements to the test suite. + + o Many, many documentation enhancements. + + +3.0.9, 2009.02.04 (r2442) + + o It is now possible to use Null objects in const context. + + o Query was emitting thousands separators when used in some + locales. Thanks for the fix go to Tomaž Å olc. + + o Restored support for using Query::storein() with template + queries. Was mistakenly removed in the 3.0.0 development + process. + + o GCC 4.4 build fixes. Thanks for this go to Remi Collet. + + +3.0.8, 2008.11.27 (r2432) The "Thanksgiving" release + + o Fixed a VC++ build error introduced in 3.0.7 in the Sun CC fix. + + o Fixed the Makefile we generate from Makefile.simple for the + devel RPM. The recent Bakefile upgrade changed the output so + our munger stopped munging. + + o Changed all instances of "CREDITS" in header comments to + "CREDITS.txt". + + o Brought ebuild file up to date with what Gentoo has been + using for 2.3.2. + + +3.0.7, 2008.11.21 (r2423) + + o Fixed bug where initting a Query with a query string and then + appending more to it with operator <<() would start overwriting + the beginning of the buffer. Thanks for the fix go to Chris + Frey. + + o Added String::empty(), to parallel std::string better. + + o Added SQLTypeAdapter ctor for Null, to allow SSQLS with + NULL BLOB columns. Thanks for this patch go to Russell Robinson. + + o Passing on "throw exceptions" flag in Query::storein() to the + temporary Row objects it creates. (Should have done this + all along.) + + o All MySQL++ classes with operator[]() and at() methods now + throw the new BadIndex exception on out of range indices now, + unconditionally. Before, it was a mishmash of MySQL++-specific + mechanisms, std::range_error, and unchecked access. + + o Fixed some bugs in load_jpeg and cgi_jpeg examples that prevented + them from working correctly on Windows. + + o Squished some warnings and incompatibilities that caused + difficulty with Solaris CC. + + o Several minor fixes to allow building on Cygwin again. + + o Dedicated VC++ 2008 support. (Not just a clone of VC++ 2005 + project files in a different directory.) + + o Lots of documentation improvements. + + +3.0.6, 2008.08.16 (r2350) + + o Several fixes to allow thread-aware build on Solaris + + o More improvements to search for Fink version of C API library. + + o Various improvements to Windows installer (install.hta) + + +3.0.5, 2008.08.06 (r2332) + + o Replaced install.bat with new install.hta, which has a GUI and a + lot of embeded logic for doing The Right Thing, which we couldn't + do in a dumb batch file. + + o Several fixes to allow it to build on Solaris 10. + + o Fixed a bug in comparison of Null to T: wouldn't always give + the right result for one particular combination of argument + values and order of parameters to operator <(). It wouldn't + fail all the time, either; it depended on the way the system's + memory allocator dealt with newly allocated RAM. The bug was + discovered during the Solaris 10 porting effort, but it is not + a Solaris-specific bug. + + o Split Linux-specific material out of README-Unix.txt into + README-Linux.txt, and created README-Solaris.txt. + + o Shipping a vc2008 directory. Populated by bootstrap script with + copies of vc2005 files when those are newer, with the idea being + to update them by hand by running them through VC++2008 before + release. + + o Several fixes to VS-only examples. They hadn't been updated to + track several of the changes in MySQL++ v3, so they wouldn't + build OOTB at all, crashed when you did get them building, and + emitted a lot of warnings during the build. Cleaned it all up. + + o Autoconf now explicitly checks whether we need to link to zlib + to link to MySQL C API library. It used to be required, but + lately, MySQL has been shipping the library with zlib stuff + embedded, causing multiply defined symbol errors on some systems. + + o configure script now looks in more locations for the MySQL C API + library, adding default locations for Fink and Solaris. + + +3.0.4, 2008.07.02 (r2303) + + o Fixed a few bugs in SslOption that prevented it from actually + working. If you've been having SSL problems since upgrading + to MySQL++ v3, this is why! Thanks for these patches go to + Petteri Kiiskinen. + + o Changed type of String's internal "size" typedefs so it'll + build without errors on 64-bit systems where these ints are + different sizes. + + o Many user manual improvements. + + +3.0.3, 2008.05.11 (r2284) + + o Fixed query well-formedness handling in Query::store() and use(). + It was quietly eating these errors, confusing them with the + no-results case. + + o Fixed examples/cpool.cpp to build without thread support. + + o No longer hiding all stdint.h typedefs inside namespace mysqlpp. + + o Fixed mysqlpp::String comparisons of empty strings against + nonempty strings; if the empty string was on the left hand side, + it would succeed because it was only comparing against characters + in the empty side, which matches everything. (Fixes bug 11588.) + + +3.0.2, 2008.04.13 (r2275) + + o Increased float to string conversion precision from 7 to 9 and + double from 16 to 17 digits. Previous values weren't enough + near the maximum values that each can hold. + + o Replaced Query's safe bool mechanism with an override of + basic_ios::operator void*() to avoid a conflict between the + two mechanisms. As the base class version isn't virtual, + this is arguably evil, but it should be harmless in typical use. + Besides, testing Query in bool context usually isn't the right + thing anyway: test the result set instead. + + o Made ConnectionPool::grab() virtual. + + o Overriding ConnectionPool::grab() and release() in + examples/cpool.cpp to show how to do connection-in-use count + limiting. Also, added a few more output indicator states to + allow one to better understand program flow. + + +3.0.1, 2008.03.23 (r2263) + + o String objects can now be compared to mysqlpp::null directly. + + o Added a template operator== and operator!= to String, syntactic + sugar for the existing String::compare() methods. + + o String::compare() now returns 0 ("equal") when one of the + strings is an uninitialized String() (no refcounted buffer) + and the other is empty. It used to consider any initialized + string greater than an uninitted one. An uninitialized String + appears empty, though, so this was incorrect. + + o Made Connection::thread_aware(), thread_start() and thread_end() + static methods, so they can be called before you create your + first connection. Ditto for DBDriver versions of these methods. + + o Calling Connection::thread_start() and thread_end() in + examples/cpool.cpp, as appropriate. Above changes were necessary + to make this work sensibly. + + o Made ConnectionPool::release() virtual, so your pool subclass can + override it. + + o Added ConnectionPool::size(), so a subclass can know the current + number of extant connections. + + o No longer single-quoting NOW() call generated for default + init of DateTime type when building queries from SSQLS objects + in Query::insert(), replace() and update(). The template query + and stream interfaces of Query treated NOW() correctly already. + + o Fixed a bug that left SSQLS::table_override_ uninitted if + you used certain of the generated ctors or set() member + functions instead of others used by the examples. This could + cause a crash any time you caused SSQLS.table() to be called, + such as when passing the SSQLS to Query::insert(). + + o Minor memset bug fixed in test/uds.cpp. Patch by Dave Jones. + + +3.0.0, 2008.02.29 (r2236) The "Giant Leap Forward" release + + THIS IS NOT A DROP-IN REPLACEMENT FOR MySQL++ v2.x! + + You will have to recompile your program against this version + of the library, and you will almost certainly have to make code + changes as well. Please see these sections in the user manual + for information on migrating your code to this new version: + + http://tangentsoft.net/mysql++/doc/html/userman/breakages.html#api-3.0.0 + http://tangentsoft.net/mysql++/doc/html/userman/breakages.html#abi-3.0.0 + + o Added ConnectionPool class, primarily to let multithreaded + programs share a set of Connection objects safely in situations + where it isn't acceptable to have a Connection per thread. + + o Created examples/cpool.cpp to demonstrate this new class. + + o Added RefCountedPointer template, which provides automatic + memory management and data sharing. It's not intended + for use outside of MySQL++ itself, but it's the mechanism + behind everything below where reference counting is mentioned. + I created the initial version of it, but Jonathan Wakely almost + completely rebuilt it, and Joseph Artsimovich provided helpful + commentary and advice as well. + + o Many improvements to Specialized SQL Structures (SSQLS): + + - Renamed custom* to ssqls*. There's still a custom.h which + #includes ssqls.h for you, but it's only intended to ease + the transition to the new name. It will go away in a future + release, probably as soon as v3.1. + + - SSQLSes are finally compatible with Null<>-wrapped types. This + feature is based loosely on the "Waba" patch posted to the + mailing list back in the v2.0 days, but extended to allow + Null types for key fields. (The Waba patch only allowed + these types in non-key fields.) + + - It's no longer necessary to define a different SSQLS for each + different field set you use in queries. That is to say, + you can define an SSQLS for an entire table and store just a + subset of the table in it now, with the other fields keeping + default values. Removed examples/custom6.cpp, as custom1.cpp + can now demonstrate the same thing, implicitly. + + - An SSQLS's field order no longer has to match the order of + fields in the result set it is populated from. + + - As a result of previous, removed sql_create_c_order_* macros; + they have no purpose now. + + - Removed order parameters from sql_create_complete_*, which now + gives it the same functionality as sql_create_c_names_* so + removed the latter, too. + + - Removed "basic" variants of SSQLS creation macros. They've + been unofficially deprecated by dint of being all but + undocumented and unexemplified for a very long time now. + + - It's now possible to use mysqlpp::String, Date, DateTime, and + Time types in the key field positions in an SSQLS as they + now support the necessary comparison interfaces. + + - If you use a floating-point data type in one of the key field + positions, it no longer uses exact comparison logic. Instead, + it now does [in]equality comparisons by testing whether the + difference between two floating-point values is less than a + configurable threshold defaulting to 0.00001. + + - You can now use 'bool' type in an SSQLS. + + - Renamed _table static member variable in each SSQLS to table_ + and made it private. There are now public setter and getter + methods, table(). + + - Added per-instance table name overriding via instance_table() + setter. table() getter returns static version if this is not + set, so it's still a global setting by default. + + o You can now use mysqlpp::null as a template query parameter to + get a SQL null. + + o Replaced template ColData_Tmpl: + + - Used to have typedef ColData_Tmpl MutableColData. + It was used only once within MySQL++ itself, and was never + documented as a class for end users. This one use within + the library was a crock, so we just replaced this use with + std::string and removed the typedef. + + - This left just one use of ColData_Tmpl, instantiating it + with the MySQL++ utility class const_string, basically a + clone of std::string with all the mutating features removed. + Folded the functionality of const_string into the template, + renamed the result to String, and deleted the const_string + class. It'd be a complete std::string replacement -- with + SQL-related enhancements -- if it were modifiable, but MySQL++ + doesn't need it to be modifiable. Yet, it's still the closest + thing MySQL++ has to its own string type; thus the name. + + - Replaced its internal buffer management with a much more + clever reference counted scheme. This shows its greatest + advantage in the return from Row::operator[](), which for + technical reasons must return by value, not by reference + as is more common. This lets you pass around Strings by + value while having the efficiency of reference semantics. + This can be important with large return values, like BLOBs. + + - Converting String to numeric types (ints, floats...) uses a + new, cleaner system by Jonathan Wakely. Unless you were + abusing weaknesses in the old system, you won't see a + difference. It's just more robust and flexible. + + o Redesigned SQLString: + + - It used to derive from std::string, and while MySQL++'s + internals did use it in place of std::string, these places + didn't take advantage of the additional features offered + by SQLString. So, replaced all those uses with std::string. + + - All the remaining uses are MySQL++ public interfaces that + need to be able to accept any of many different data types, + and we want that data to be automatically converted to a + SQL-compatible string form. Because it no longer has the + parentage to be a general-purpose string type and MySQL++ has + a new contender for that role (String), renamed SQLString to + SQLTypeAdapter to reflect its new, limited purpose. ("STA" + for short.) + + - Since we don't have the std::string base class to manage the + string buffer any more, using the same reference counted + buffer mechanism as String. In addition to saving code by + not creating yet another buffer management mechanism, it means + objects of the two classes can share a buffer when you assign + one to the other or pass one to the other's copy ctor. + + - Added many more conversion ctors. + + - STA interfaces using the 'char' data type now treat them as + single-character strings instead of one-byte integers, as + does the Standard C++ Library. + + - Added mysqlpp::tiny_int interfaces to STA to replace the + former char interfaces for those needing one-byte integers. + + o As a result of the ColData -> String redesign, removed + Row::raw_*(). Before String copies were efficient, this + was helpful in accessing BLOB data efficiently. It was also + required back when ColData didn't deal correctly with embedded + null characters, but that reason is gone now, too. + + o Row::operator[](const char*) no longer unconditionally throws the + BadFieldName exception when you ask for a field that doesn't + exist. It will still throw it if exceptions are enabled, but if + not, it'll just return an empty String. This was necessary to + make the SSQLS subset and field order independence features work. + + o Similarly, Result::field_num() returns -1 when exceptions are + disabled and you ask for a field that doesn't exist. + + o You can now use the OptionalExceptions mechanism to disable + exceptions on const MySQL++ objects. + + o Redesigned query result classes: + + - Instead of Result deriving from ResUse, the two derive from + a common base class -- ResultBase -- containing the bits that + are truly the same between them. Before, Result inherited + several methods that didn't really make sense for "store" + query result sets. + + - Renamed Result to StoreQueryResult and ResUse to UseQueryResult + so it's clearer what each is for. + + - Renamed ResNSel to SimpleResult. + + - Made all SimpleResult data members private and hid them behind + const accessor functions of the same name. + + - The result set classes all used to be friends of Connection + for various lame reasons. Since they are created by Query, + and Query has a good reason for a strong relationship with + Connection, moved Connection access out of each result set + class into the code in Query that creates that type of result + set object. + + - StoreQueryResult now derives from vector in addition to + ResultBase; it used to merely emulate a vector of Rows, poorly. + It can now dispose of the MYSQL_RESULT at the end of object + construction, because it creates all the Row objects up front + instead of on the fly. And as a result of *that*, operator[] + returns by reference instead of by value, operator -> works + correctly on iterators, all STL algorithms work, etc., etc. + + - IMPORTANT COMPATIBILITY BREAK: because we used fetch_row() + stuff in Result previously, it was okay to index past the + end of the result set: you'd just get a falsy Row when you + did this, just as happens when doing the same thing in a + "use" query. The simple1 and simple2 examples did this, + so it's likely that code exists that takes advantage of this + misfeature. New versions of these examples show how to index + through a StoreQueryResult without running past its end. + + - ResUse used to delay creation of its FieldNames and FieldTypes + objects until the point of need. This had several implications + for thread and exception safety that we fix by just creating + them in the ctor. If your code is multi-threaded and was + avoiding certain usage patterns due to crashes, it's worth + trying your preferred way again. + + - Result sets create a few data structures to hold information + common to all rows in that set. The row objects need access + to these shared data structures, so on creation each gets + a pointer back to the result set object that creates it. + This was efficient, but required that a result set object + outlive any row objects it creates. Now these shared data + structures are reference-counted, decoupling the lifetime of + the child row objects from their result set parent. + + - Copy operations for result sets used to actually be "moves" + before, for efficiency. (MySQL++ itelf only copied result + sets in returning them by value from the query execution + methods of Query, so this was acceptable if you didn't do + anything uncommon with these objects.) Reference counted + data structures allow us to have copy semantics now without + sacrificing efficiency. + + - You can now use Query::storein() with an STL container of Row + objects now, instead of having to use SSQLSes. The lifetime + issue guaranteed a crash if you tried this before. + + - Removed a bunch of unnecessary alias methods: + + - columns() -> num_fields() + - names() -> field_names() + - rows() -> num_rows() + - types() -> field_types() + + - Renamed several methods for grammar reasons: + + - fields(unsigned int) -> field(unsigned int) + - names(const std::string&) -> field_num(const std::string&) + - names(int) -> field_name(int) + - types(int) -> field_type(int) + + - Removed several "smelly" methods: + + - purge() + - raw_result() + - reset_names() + - reset_field_names() + - reset_types() + - reset_field_types() + + o Field class used to just be a typedef for the corresponding C + API class. Now it's a real C++ class providing a more MySQL++ + sort of interface, plus good OO things like information hiding + and implementation detail abstraction. This changes several + things about the interface. + + o Fields class was basically a specialized std::vector work-alike + for dealing with the C API to get access to MYSQL_FIELD objects + and present them as contained Field objects. New Field type + let us replace it with "typedef std::vector Fields" + + o Major improvements to the quoting and escaping mechanisms: + + - Replaced almost all of the type-specific interfaces in manip.h + with a single version taking STA. The compiler can convert + almost anything to STA without losing any information we need + for correct quoting and escaping. This has the side benefit + that we can now do correct quoting and escaping for more data + types now, including plain C and C++ string types. + + - Fixed a bug in quote_double_only manipulator for String: was + using single quotes by mistake. + + - Escaping and quoting only works in instances where MySQL++ + can tell you're building a SQL query and are using a data type + that requires it. This affects many things, but the one most + likely to cause trouble is that inserting MySQL++'s quoting + and escaping manipulators in non-Query ostreams is now a no-op. + + - Added escape_string() member functions to Query and + SQLQueryParms::escape_string(), and removed the global function + of the same name. Because these are tied indirectly to a + Connection object, this also has the effect that escaping is + now aware of the current default character set used by the + database server. There's only one case where this isn't done + now, and that's when we're disconnected from the server. + + - Previous two items form a trade-off: if your code was depending + on MySQL++ to get SQL escaping and it no longer happens for + what we consider a good reason, you can build a replacement + mechanism using these new functions. Quoting needs no special + support in MySQL++. + + - Removed 'r' and 'R' template query parameter modifiers, + which meant "always quote" and "always quote and escape" + regardless of the data type of the parameter. There are no + corresponding manipulators (for good reason), so the removal + restores symmetry. + + o Created DBDriver class from code previously in Connection and + Query to almost completely wrap the low-level MySQL C API: + + - Connection creates a DBDriver object upon connection and + passes a pointer to it down to Query objects it creates. + In turn, they pass the pointer on to any of their children + that need access to the C API. + + - Nothing outside DBDriver calls the C API directly now, though + DBDriver leaks C API data structures quite a lot, so this + feature doesn't constitute "database independence." See the + Wishlist for what must be done to get to that point. + + o Completely redesigned the connection option setting mechanism: + + - There's now just a single Connection::set_option() method that + takes a pointer to the abstract Option base class, and there is + an Option subclass for every connection option we understand. + Thus, type errors are now caught at compile time instead of + at run time. + + - Replaced Connection::enable_ssl() with SslOption class. + + - Enabling data compression and setting the connection timeout + are no longer set via parameters to Connection interfaces. + These are now set with CompressOption and ConnectTimeoutOption. + + - Similarly, removed client_flag parameters from Connection's + ctor and connect() method and added corresponding Option + subclasses. There's about a dozen, so rather than list them + here, look for similarly-named classes in lib/options.h. + + o Added Connection::count_rows() to execute "SELECT COUNT(*) FROM + tablename" queries for you. + + o Moved Connection::affected_rows(), info() and insert_id() methods + to class Query, as they relate to the most recently-executed + query, not to the connection. + + o Several method name changes in Connection: + + - client_info() -> client_version() + - host_info() -> ipc_info() + - proto_info() -> protocol_version() + - server_info() -> server_version() + - stat() -> status() + + o Removed Connection::api_version(). It does the same thing as + client_version(). + + o Lots of changes to Date, DateTime, and Time classes: + + - If you use the default constructor for DateTime and don't + subsequently set its year, month, day, hour, minute or second + data members to nonzero values, it becomes the SQL function + "NOW()" in a query string. You can also use DateTime::now() + as syntactic sugar for this. + + - As a result of above, had to hide all of DateTime's data + members behind accessor functions, to keep the state of the + object consistent. (If it's initialized as "now" and you + give it an explicit year value, say, it is no longer "now", + so the setter has to clear the now-flag.) There are getters + and setters for year, month, day, hour, minute and second, + all named after the member. + + - Did the same for Date and Time for consistency, even though it + isn't technically required. + + - The sql_timestamp typedef now aliases DateTime instead of Time. + + - Renamed template class DTbase to Comparable. The fact + that it's the common base class of all date and time classes + is irrelevant; making subclasses comparable is what it does, + so that's what it should be named after. + + - Added a DateTime ctor taking discrete year, month, day, hour, + minute, and second values. + + - Implicit conversion from stringish types to the date and time + types is no longer allowed. This is part of the "Waba" + Null patch mentioned above; allowing implicit conversions + would break this new feature. + + - Added operator std::string and str() methods to all of these + classes. Adding this to the existing operator << support, you + now have several ways to convert these objects to string form. + + - Added time_t conversion to Date and Time classes. DateTime + already had it, since it's more legitimate to convert time_t + to DateTime, but you could already "slice" it with something + like Time(DateTime(time(0))) so there's no point pretending + you can't get from time_t to Date or Time. Might as well + legitimize it. + + o Improved tiny_int class: + + - Turned it into a template parameterized on the value type so + you can get both signed and unsigned TINYINTs + + - Changed the sql_tinyint and sql_tinyint_unsigned typedefs to + use mysqlpp::tiny_int instead of raw chars + + - Added a bool conversion ctor and operator, and typedef'd it + to sql_bool and sql_boolean to match MySQL server behavior + + o Added many more sql_* typedefs. We now have a typedef for every + type the MySQL server knows about, including those it supports + just for compatibility with other database servers. + + o Changed the sql_*int* typedefs to use integer types of the same + size as the MySQL server. (Run test/inttypes.cpp to test it.) + + o Added copy ctor and assignment operator to Row. + + o Row::operator[]() takes int now instead of unsigned int. + This finally (!) makes it possible to say row[0] without the + compiler giving an ambiguous overload error. + + o Changed all uses of row.at(0) in the examples to row[0] + + o Added operator[] to all classes that only had at(). + + o Query now automatically resets itself unless the query fails + or you're using template queries. In either case, the contents + of the query's internal buffers are considered precious, + either for debugging, or future queries. Except when using + template queries, this means you may be able to avoid calling + Query::reset() entirely. It's still safe to call reset() + as before, just unnecessary most of the time. + + o Removed reset_query parameter from all Query methods. It was + almost completely broken before, and above change does what + was really wanted to begin with. + + o Query::store_next() and Result::fetch_row() no longer throw + the EndOfResults and EndOfResultSets exceptions; these are not + exceptional conditions! These methods simply return false now. + + o Removed examples/usequery.cpp: there's no essential difference + between what it did and what examples/simple3.cpp does now as + a result of the previous change. + + o Added Query::exec(void), paralleling Query::execute(void). + + o Removed Query::preview(). The most direct replacement is str(), + which has always done the same thing. + + o You can now insert a Query object into an ostream to get a copy + of the built query. This means Query::str() is only necessary + when using template queries. + + o Removed overloads of Query::execute(), store(), and use() + that take const char*. It was redundant because const char* + converts implicitly to STA, for which overloads already exist. + + o Renamed Query::def to Query::template_defaults to make its + purpose clearer. + + o Query::error() now returns const char*, not a std::string by + value. There's no point in making a copy of the error string. + The method is now const as well, as it doesn't change the + Query object. + + o Added Query::errnum(), which just wraps Connection::errnum(). + + o Added error number parameters and accessor functions to BadQuery, + ConnectionFailed and DBSelectionFailed exceptions, to preserve + the state of Connection::errnum() at the point of the exception, + so you don't have to rely on this value remaining unchanged + during the exception throw process. All places that use these + exceptions now include this value where possible. Thanks for the + initial patch go to Jim Wallace. + + o Removed Lockable mechanism from Connection and Query; it was + conceptually flawed. See the new user manual chapter on + threading for advice on using MySQL++ safely without locking. + There is mutex locking now in ConnectionPool, but that's it. + + o Connection::query() now takes an optional query string, allowing + the returned Query object to start off with a value. Especially + useful when the query string is static, either because it's + a simple query or because it's a template. You can now build + chains like "if (conn.query("CREATE INDEX ...").exec()) { ..." + + o Added Connection::thread_aware(), thread_end(), thread_id() + and thread_safe(). See user manual's threading chapter for + explanations. + + o Renamed "success" data members in Connection, Query and + SimpleResult (neé ResNSel) to "copacetic_", making them private + if they weren't before. This better reflects their actual + use, which isn't to say that there has necessarily been actual + success, but rather that everything's okay with the object. + + o Removed success() member functions from above classes. All can + be tested in bool context to get the same information. + + o Replaced all operator bool()s in MySQL++ classes with safer + alternatives. See http://www.artima.com/cppsource/safebool.html + Thanks to Jonathan Wakely for much helpful commentary, advice, + and code used in these mechanisms. + + o Decoupled Connection::copacetic_ from Connection::is_connected_. + It is now possible for the object to be copacetic without being + connected. However, if it tries to connect and fails, then + it is not copacetic. If it is copacetic and not connected, it + means we haven't even tried to connect yet, a useful distinction. + + o Collapsed Connection's host, port, and socket_name down into + a new combined 'server' parameter which is parsed to determine + what kind of connection you mean. These interfaces are still + compatible with v2.3 and earlier up through the port parameter. + There are differences beyond this. + + o Added TCPConnection, UnixDomainSocketConnection and + WindowsNamedPipeConnection subclasses for Connection giving + simpler construction and connect() method interfaces for + instances where you know what kind of connection you want at + compile time. + + o Changed Connection::ping() return value from int to bool. + + o Renamed NullisNull to NullIsNull -- capital I -- and similar for + NullisZero and NullisBlank. + + o It's now a compile-time error to try to convert a MySQL++ + representation of a SQL null to any other data type, rather + than a run-time error as in previous versions. Removed + BadNullConversion exception as a result. + + o Way back in v1.7.x we used the BadQuery exception for all kinds + of exceptional conditions, not just bad queries. Replaced + most of these in v2.0.0 with new dedicated exceptions, but a + few remained: + + - Errors that occur during the processing of a "use" query after + the query itself executes correctly now throw UseQueryError. + It's not a "bad query", because the query executed + successfully. It just choked during subsequent processing, + so it's a different exception. Thanks for this patch go to + Jim Wallace. + + - Replaced BadQuery exceptions thrown in Row constructor due + to bad ctor parameters with new ObjectNotInitialized exception + This is also Jim Wallace's work. + + o The examples now all use getopt() type command line options + instead of positional options. This makes it possible to + pass options in any order, leave at their default options that + used to be in the middle of the sequence, and offer different + subsets of options for different programs. Also allows for + special internal-use options, like -D passed by dtest to let + examples change their behavior when run under dtest to produce + only predictable output. + + o Split old libutil functionality into two modules, one holding + all the "print data" functions, and another holding all the + command line parsing stuff. This makes it easier for newbies + to ignore the command line stuff, treating it like a black box. + The wish to understand the "print data" routines is much more + common, so the two needed to be disentangled. + + o Renamed examples' libutil to libexcommon. + + o Removed connect_to_db() libutil function. It combined command + line parsing, which users don't care about, with database + connection establishment, which they do care about. Now the + examples just call out to libexcommon to parse the command + line, and use the values they get back to explicitly make the + connection, so it isn't hidden. + + o Removed cchar and uint typedefs. + + o Redesigned dbinfo example's output to be easier to read. + + o Fixed an output formatting bug created in 2.3.0 that caused the + tabular output from examples to not line up. + + o Renamed examples/tquery.cpp to tquery1.cpp. Created tquery2.cpp + to demonstrate passing parameters via a SQLQueryParametrs object + instead of discretely. Created tquery3.cpp for testing unquoted + template parameters, such as integers. + + o Renamed fieldinf1.cpp example to fieldinf.cpp, and simplified + its output so it can be part of the dtest sequence. + + o Renamed examples/xaction.cpp to transaction.cpp. It created too + much cognotive dissonance whenever thinking about both it and + lib/transaction.cpp. + + o Added examples/deadlock.cpp, to test handling of exceptions due + to server-side transaction deadlock detection. Also added + code to resetdb to create a table needed to test this. + Initial version created by Jim Wallace to test the value of + all his BadQuery exception work, with reworking by me. + + o Greatly expanded dtest suite. Primary change is that we now + have a handful of unit tests, where in v2.3.2 we only tested + a subset of the examples. Still very low coverage ratio, + but it's a big improvement. + + o Optimized #includes, especially in lib/*.h to reduce + dependencies and thus compile time when one of these changes. + + o Fixed a typo in RPM filename generation that prevented -devel + RPM from recognizing that the corresponding MySQL++ library + RPM was installed. + + o RPM spec file improvements by Remi Collet. + + o Renamed NO_LONG_LONGS to MYSQLPP_NO_LONG_LONGS to avoid a risk + of collision in the global macro namespace. + + o First cut at Xcode2 project support. Testing needed! + + o Debug build of library on VC++ and Xcode have a _d suffix now + so you can have both versions of the library installed without + conflict. + + o Moved the VC++ 2003 project files into a new vs2003 subdirectory + because there are so many of them. Also created vs2005 + subdirectory for VC++ 2005 and 2008 compatible project files. + 2005 makes an even bigger mess of the directory containing + the .sln file, so the incentive is bigger. Plus, we have to + disable several things to get VC++ 2003 to build MySQL++ now, + so we need a special 2005+ version of the project files for a + complete build, if the user has one of the newer compilers. + + o ...plus dozens of small bug fixes and internal enhancements, + many documentation improvements, and expansion of support for + newer operating systems and compilers. + + +2.3.2, 2007.07.11 (r1669) + + o Previous release's const_string change caused more problems + than it fixed. This release contains the real fix. :) + + o New Connection::set_option() handling deals with the multi + statements option correctly again. examples/multiquery now + runs again as a result. + + o Added new unit testing script, called dtest. See the + HACKERS file for details. (This tool caught the previous + two problems!) + + o Squished a GCC pedantic warning. Thanks for the patch go to + Andrew Sayers. + + +2.3.1, 2007.07.10 (r1659) The "After the Fireworks" release + + o const_string objects now keep a copy of their data, not + just a pointer to it. This is less efficient, but necessary + to allow SSQLS to work with BLOBs. Without this, we were + seeing segfaults due to accessing freed memory pointed to + by the const_string, because the underlying object went + out of scope. + + o Fixed many more potential embedded null handling problems + in manip.h. + + o MySQL++ can now optionally reference MySQL C API headers as + being in a mysql subdirectory, a common thing on *ix systems, + by defining MYSQLPP_MYSQL_HEADERS_BURIED before #including + mysql++.h. + + o Restored ColData_Tmpl::get_string(), removed in v2.3.0, + along with warnings in the docs saying why you don't want + to use it, and what your alternatives are. + + o VC++ and MinGW builds now define the HAVE_MYSQL_SSL_SET + macro, which lets you use the C API's SSL features. + This assumes your C API library does actually have these + features enabled, which is the case with the official binary + releases on Windows. (Builds on *ix systems continue to + test for these features at configure time.) + + o Fixed simple examples-only Makefile generation, for RPMs. + + +2.3.0, 2007.07.02 (r1645) + + o Added Query::for_each() and Query::store_if() methods + proposed by Joel Fielder, and added examples for each. + + o It's now possible to store BLOB data in an SSQLS. It's not + foolproof, so added a section to the user manual (5.9) to + document the method. Also, changed examples/cgi_jpeg to use + this new mechanism, instead of the ugly "raw row data" method + it used to use. + + o Revamped Connection::set_option() handling. These options + used to be queued up, and applied only just before actually + establishing the connection. This made error reporting less + helpful because the diagnostic was separated from the cause. + Plus, the error messages were misleading to begin with. Now, + set_option() takes effect immediately if the connection is not + yet up (excepting one special option that can actually be set + after the connection is up) and issues better diagnostics when + it detects errors. + + o Connection::connect() used to set a few options in such a + way that the user couldn't override them. Now it's smart enough + to set them with the desired default values only when we see + that the user hasn't given them other values. + + o SQLString can now be initialized from a mysqlpp::null, + giving a "NULL" string. This is useful for template queries. + Patch by Michael Hanselmann. + + o resetdb error message about mixing library and header version + numbers is now more explicit. + + o Changed BadConversion exception's "what" message text to be + more like the other exceptions. The inconsistency lead one + to incorrectly copy-paste code from another exception handler, + expecting it to behave the same way. Now it does. + + o Added Row::raw_size(), as a shortcut for Row::at().size(). + + o ssqls-pretty now detects when it's being run from within + the MySQL++ distribution tree and gives a different -I flag + to the compiler, so that it picks up the distribution headers + instead of those that may be on the system already. + + o The quote manipulator now works for char[] correctly. + Thanks for this patch go to Andrew Sayers. (It's always + worked for char*, but C++ doesn't consider that to be the + same type, so it used the generic quote handling path, + which doesn't do anything for char[].) + + o Fixed a build bug on older Solaris versions where the + test for the C API library was erroneously failing, stopping + the configuration process. + + o Simplified mysql_shutdown() level argument detection. + Already had to do a version number ifdef check for the + Windows case, so there's really no point to doing it with + autoconf on Unixy platforms. Moved version number check + into lib/connection.cpp, and nuked the separate autoconf and + Windows tests. + + o Removed dependency of sql_types.h on myset.h and (indirectly) + datetime.h. Now we only define sql_* typedef aliases for those + MySQL++ types if the headers are included before sql_types.h. + + o Fixed a typo in one of the storein_sequence() template + overloads, which is apparently rarely (or never?) used, because + no one reported the compiler error you'd get if you tried. + + o Fixed a few more embedded null handling problems. + + o ColData used to keep two copies of all data it held. + Now it keeps just one. + + o Fixed install.bat script to track the unified Bakefile change + and the lack of separate debug and release builds under MinGW. + + o Yet another STLport + Query memory leak fix. + + o Squished a warning in newer GCCs having to do with identifier + shadowing. Patch by Jonathan Wakely. + + o Fixed a null-termination bug in Query::parse(). If you + somehow constructed a query string without a terminating null + character, then tried to parse it as a template query, it could + walk off the end of the string. Patch by Worster Chen. + + o Removed MYSQLPP_EXPORT tag from FieldNames and FieldTypes + class declarations, as this can cause problems in programs + that use vector in VC++. It has to do with multiply + defined templates, since these classes derive from that + template, and VC++ can't resolve the conflict without help. + Since these classes aren't actually used outside the library, + this shouldn't cause a problem. Patch by Nils Woetzel. + + o Partial fix to Doxygen PDF build on RHEL4 and 5. Needs + hand-coaxing to complete successfully on RHEL4, and doesn't + yet work at all on RHEL5. + + o Shortened the "no*" options to the bootstrap script, so that + the usage message fits on a single line. + + o Added "nodoc" bootstrap script option, for disabling the + documentation build during the dist target build. Allows for + building binary RPMs on CentOS 5.0, where doc building is + currently broken. + + o Removed the updel example program. It was kind of silly, + and if you were to rewrite it today, you'd use for_each() anyway. + + o Lots of documentation improvements. + + +2.2.3, 2007.04.17 (r1538) The "Tax Day" release + + o Previous version left examples/vstudio/* out of the tarball + by accident. + + o Improved generation of RPM temporary build directory path + name generation. Was using a hacked variant of the Fedora + Packaging Guidelines' second best choice. Now we're using + the choice they recommend most highly, without changes. + + o Removed unnecessary resources from vstudio/wforms example. + + o Minor URL fix in refman + + +2.2.2, 2007.04.13 (r1526) The "Nervousmaking Friday the 13th" release + + o More small fixes to embedded null handling in Query. + + o Fixed a bug in single-parameter template query handling. + + o Added tquery example, to demonstrate proper use of template + queries. Previously, resetdb was the only exemplar, and + it wasn't really suited for that. This example also tests + the previous item. + + o Added examples/vstudio/mfc, allowing us to improve the way + we demonstrate Unicode handling. Old way wasn't realistic. + On *ix, people will depend on the terminal code to handle + UTF-8. On Windows, users are almost certain to be writing + a GUI program, which requires different Unicode handling + than the old examples showed. + + o Removed explicit Unicode conversion stuff from command line + examples, and reworked the Unicode chapter in the user + manual. + + o Added examples/vstudio/wforms to show integration with + C++/CLI and Windows Forms. Documented this in README.vc. + + o Rewrote load_file and cgi_image examples to be more + useful, renaming them to load_jpeg and cgi_jpeg along + the way. Also, resetdb now creates a second table in the + sample database for these two examples' use. Also, added + examples/logo.jpg to the distribution as sample data for + these examples. + + o Limited the ostream base class casting stuff in Query to + VC++ 2003, which is the only platform that really needed it. + VC++ 2005 emits a warning with that hack in place, and on + other platforms it's just replicating work that the compiler + does already. + + o Added library version information to main library target + so that systems that version shared libraries work as + expected. Thanks for this patch go to Jack Eidsness. + + o Merged much of the diffs between Remi Collet's RPM spec file + into the official one. + + o Reorganized the doc subdir a bit. Generated HTML is now all + under doc/html instead of scattered under other subdirs, + and renamed doc/README.mysql++ to doc/README.manuals. + + o Improvements to top-level manual building make targets: + manuals now only rebuild at need, it's easier to request + a rebuild of all manuals, and we force a rebuild attempt + before building the distribution tarball so we don't ship + outdated manuals. + + o Added ability to run examples under gdb using exrun, + using same mechanism as we currently have for valgrind. + Thanks for this patch go to Michael Hanselmann. + + o Added "Important Underlying C API Limitations" chapter to the + user manual, to cover problems we keep seeing on the + mailing list that are the result of ignorance of the way + libmysqlclient behaves, not bugs MySQL++ is really in a + position to fix. + + +2.2.1, 2007.02.28 (r1433) + + o Fixed the new localtime() alternative selection code + for VS2003 and various uses of STLport. + + o No longer inserting a null character into the query stream + on calling one of the preview() functions. This was harmless + in v2.1, which used C strings more extensively, but began + causing problems in v2.2 due to its wider use of C++ strings. + + o Fixed a bug in the Connection copy ctor where it didn't + completely initialize the object. + + o Optimized Query::preview_char() a bit. Patch by Jonathan + Wakely. + + o Reordered directory list used by autconf when locating the + MySQL C API library. The list is now ordered with the + most likely locations for the library first, so we're less + distracted by incorrect libraries. This fixes a specific + build error under RHEL4 with recent versions of MySQL 5.0. + + +2.2.0, 2007.01.23 (r1417) + + o ColData, const_string, and SQLString can now be constructed + with an explicit length parameter. Furthermore, Query + class's execute(), store() and use() call chains terminate + in a version taking an explicit length parameter, instead + of one taking a simple C string. Together, this means + that it's now easier to handle data from the SQL server + containing nulls. The library is almost certainly not yet + capable of handling embedded nulls in all cases, but this + is a big first step towards that. + + o Can now construct a DateTime object from a time_t, and + convert a DateTime back to a time_t. Patch by Korolyov Ilya. + + o Changed the way we're handling exported functions in the + Windows DLL case so that it works more reliably under MinGW. + + o Added proper copy semantics to Connection, so that you get a + new connection with the same parameters, not just a bitwise + copy of the object. + + o Using an explicitly thread-safe variant of localtime() for + time conversions where one is available. + + o Removed ListInsert template from myset.h. This wasn't used + within the library, and was never documented, so I'm betting + that no one actually uses it. + + o Result::copy() was not copying the exception flag in + all cases. Fix by Steven Van Ingelgem. + + o Added exrun shell script and exrun.bat files to distribution, + to avoid linkage errors when running the examples while + you still have an older version of MySQL++ installed. + + o Renamed MYSQLPP_LIB_VERSION to MYSQLPP_HEADER_VERSION, as + what it really encodes is the version number in the mysql++.h + file you're using, not the actual library version number. + + o Added mysqlpp::get_library_version(), which returns the + library version number at build time. Between this and + the header version constant, you can check that you're not + mixing MySQL++ header and library versions. + + o resetdb example uses these new version number affordances to + double-check that you're not mixing libraries and headers + from different versions. This happens easily unless you + take care of it (such as by using exrun) when you have one + version of MySQL++ installed and you're trying to build and + test a new version without blowing away the old one first + or overwriting it. + + o No longer using recursive Makefiles on Unixy platforms + or split lib + examples project files on VC++. Everything is + handled by a single top-level Makefile or project file, which + is simpler for the end user, and makes better dependency + management possible. + + o When looking for the MySQL C library on systems using + autoconf, looking in .../lib64 wherever we are also looking + in .../lib. + + o RPM build process no longer depends on Bakefile. It means + you have to build the examples when building an RPM even + though they're never used within the RPM, but it's a better + tradeoff in my opinion. + + o Updated include and library paths on Windows to reflect + changes in the most recent MySQL installers. + + o Merged lib/defs.h and lib/platform.h into new file, + lib/common.h. Just cleans up the library internals. + + o Fixed build errors on Windows due to recent changes in MySQL. + + o Fixed a few memory leaks and double-deletes in Query class. + + o Fixed compatibility with STLPort's string implementation. + Patch by dengxy at cse.buaa.edu.cn. + + o Fixed a compatibility problem between Set<> template and + SSQLS. Patch by Korolyov Ilya. + + o Fixed build bug in SQLQueryParms due to a character + signedness issue on PowerPC with GCC. Patch by Michael + Hanselmann. + + o ~Transaction() can no longer throw exceptions. It'll just + quietly eat them, to avoid program termination. Fix + suggested by Alex Burton. + + o Fixed thread safety testing in autoconf case, accidentally + broken during v2.1.0 development cycle. + + o Using Doxygen 1.5.1 to generate documentation. + + +2.1.1, 2006.04.04 (r1289) + + o MinGW and Cygwin will now build and link to mysqlpp DLLs. + + o Fixed bug in Query, causing it to initialize the "throw + exceptions" flag incorrectly. Thanks for this patch go to + Joel Fielder. + + o Added -v flag for custom.pl script, which turns off the + multiply-defined static variable fix. Needed for VS 2003, + which doesn't support variadic macros. Also, added + a diagnostic to detect the need for the -v flag, and + suppressed the test for this feature in examples/util.cpp. + + +2.1.0, 2006.03.24 (r1269) + + o Converted automake and makemake files to their equivalents in + Bakefile format. + + o Added the Transaction class, which makes it easy to use + transaction sets in MySQL++. + + o Added xaction example to test new Transaction class. + + o Resetdb example now creates its example table using the + InnoDB storage engine, in order to test the new transaction + support. Resetdb also declares the table as using UTF-8 + text; this doesn't change anything, but it does correctly + document what we're doing. + + o Added sql_types.h header, containing C++ typedefs + corresponding to each MySQL column type. Using those new + types in the type_info module, and in the SSQLS examples. + + o Replaced the way we were handling the template query + version of Query member functions, to allow an arbitrary + number of template query parameters. By default, we + now support 25 parameters, up from the old limit of 12. + It's now possible to change just one number, run a script, + and have a new limit. + + o Connection class does a better job of returning error + messages if you call certain member functions that depend + on a connection to the server before the connection is + established. + + o Updated libmysqlclient.def for newer versions of MySQL. (Fixes + build errors having to do with mysql_more_results() and + mysql_next_result(). + + o Replaced final use of strcpy() with strncpy(). + + o custom.pl now runs without complaint in strict mode, with + warnings turned on. Thanks for this patch go to "Waba". + + o Fixed a bug in custom.pl where incorrect code would be + generated for some SSQLS set() methods. Thanks for this + patch go to "Waba". + + o SSQLS structures now support long and unsigned long fields. + Thanks for this patch go to "Waba". + + o It's now possible to put SSQLS definitions in a header + file used by multiple modules in a program without + getting multiple static member definition errors. See the + documentation for details. Thanks for this patch go to + Viktor Stark. + + o Moved the definition of the 'stock' SSQLS out of the + custom*.cpp example files and into a new stock.h file. + Also, #including that file in the util module to test out + the new SSQLS multiple static definition fix. + + o Using all of the digits of precision guaranteed by the + IEEE 754 spec when stringizing floating point numbers + to build queries. Previously, we would use the platform + default, which can be as few as 6 digits. + + o Removed lib/compare.h. Not used within the library, never + documented, and nobody seems to want to defend it. + + +2.0.7, 2005.11.23 (r1147) + + o Added explicit mysqlpp namespace qualifiers to generated code in + custom*.h so you can use SSQLS in places where it doesn't make + sense to say "using namespace mysqlpp" before the declaration. + Also updated some of the examples to not have this "using" + declaration to make it clear to users that it isn't needed, if you + want to use explicit namespace qualifiers as well. Thanks for + this patch to Chris Frey. + + o Removed an apparently useless unlock() call from ResUse; there is + no nearby lock() call, so if this unlock() is in fact necessary, + it shouldn't be here anyway, because the two calls should be + nearby each other. Thanks for this patch to Chris Frey. + + o Fixed Query ostream initialization bug affecting SunPro CC (at + least). While this bug violates the Standard, it doesn't affect + many real compilers because they don't enforce this rule. Fixed + by Chris Frey. + + o Previously, we only used the C99 style "long long" support when + building under GNU CC. This is now the default. This should + allow the code to work under SunPro CC. + + o Added another dynamic cast needed for proper Query ostream + subclass overloading under VC++. (7.1 at least...) + + o Detecting whether MySQL is built with SSL support on platforms + using autotools. Needed on some old Sun systems, for instance. + Thanks for this patch to Ovidiu Bivolaru. + + o Fixed a potential memory bug in ColData's conversion to SQL null. + + o Many minor packaging tweaks. (README clarifications, file + permission fixes, better adherence to GNU packaging standards, + etc.) + + +2.0.6, 2005.09.28 (r1123) + + o Fixed makemake.bat so it works on cmd.exe, not just 4NT. + + o Documentation fixes. + + +2.0.5, 2005.09.13 (r1114) + + o Visual C++ build now requires GNU make. It is tested to work + with either the Cygwin or the MinGW versions. The previous + version of MySQL++ used nmake. This change enabled the + following features: + + o Debug and Release versions are both built into + separate subdirectories. + + o Dependency tracking for release version works + correctly now. (Previously dependencies worked + only for debug version.) + + o 'make clean' removes release version binaries + in addition to debug versions. + + o MinGW makemake support updated to support new release/debug + subdirectory system. This is probationary support, since + this code currently can't be built as a DLL. As a result, + it is no more useful than the Cygwin version, for licensing + reasons. + + o Several fixes to allow building on Solaris 8. These fixes may + also help on other SVR4-derived systems. + + o Removed Borland C++ makemake support, because this version + of the library does not work completely, and there seems + to be almost no user interest in fixing it. + + o Clarified "Handling SQL Nulls" section of user manual's + Tutorial chapter. + + +2.0.4, 2005.08.29 (r1076) + + o Made mysql_shutdown() second parameter autoconf check less + sensitive to compiler pedantry. + + o VC++ library Makefile is now smart enough to re-create the + import library, if it is deleted while leaving the DLL alone. + + o Added libmysqlclient.def to tarball. + + o Reworked most of the top-level README* files. + + o Renamed LGPL file to LICENSE. + + +2.0.3, 2005.08.25 (r1060) + + o Visual C++ makemake system updated to build both debug and + release versions of library DLL. + + o Fixed bug in simple1 example that caused crashes on Windows. + + o Doing UTF-8 to ANSI text translation in simple examples now. + + o Previous two releases built libmysqlpp with wrong soname on + autotools-based systems. Fixed. + + +2.0.2, 2005.08.18 (r1050) + + o Fixes to makemake system for cmd.exe. + + o Fixed the case where the system's C++ library includes an slist + implementation in namespace std. + + 2.0.1, 2005.08.17 (r1046) - o Added new simple1 example, showing how to retrieve just one - column from a table. Old simple1 is now called simple2, and - simple2 is likewise shifted to simple3. - - o Added custom6 example, showing how to do the same thing with - SSQLS. - - o Updated user manual to cover new examples. - - o Was accidentally shipping Subversion crap with tarball. Fixed. + o Added new simple1 example, showing how to retrieve just one + column from a table. Old simple1 is now called simple2, and + simple2 is likewise shifted to simple3. + + o Added custom6 example, showing how to do the same thing with + SSQLS. + + o Updated user manual to cover new examples. + + o Was accidentally shipping Subversion crap with tarball. Fixed. 2.0.0, 2005.08.16 (r1031) The "Excess Hair Removal" release - THIS IS NOT A DROP-IN REPLACEMENT FOR MySQL++ v1.7! - - At minimum, you will have to recompile your program against - this library. You may also have to make code changes. - Please see the "Incompatible Library Changes" chapter of - the user manual for a guide to migrating your code to this - new version: - - http://tangentsoft.net/mysql++/doc/userman/html/breakages.html - - o The library's shared object file name (soname) scheme has - changed. (This mainly affects POSIX systems.) - - The soname for the last 1.7.x releases of MySQL++ was - libmysqlpp.so.4, meaning the fourth version of the library's - application binary interface (ABI). (The first ABI version - in this scheme was that provided by 1.7.9.) MySQL++ - 2.0.0's soname is libmysqlpp.so.2.0.0. Since the dynamic - linker setup on some systems will create a symlink to - that file called libmysqlpp.so.2, it's possible that this - library could be confused with that for MySQL++ 1.7.19 - through .21, which also used this number. Do not install - this library on a system which still has binaries linked - against that version of the library! - - The new scheme is {ABI}.{feature}.{bug fix}. That is, - the first number changes whenever we break the library's - binary interface; the second changes when adding features - that do not break the ABI; and the last changes when the - release contains only internal bug fixes. This means - that we will probably end up with MySQL++ 3.0 and 4.0 at - some point, so there will be further soname conflicts. - Hopefully we can put these ABI changes off long enough - to avoid any real problems. - - o autoconf now installs headers into $prefix/include/mysql++, - instead of $prefix/include. If you were using the - --includedir configure script option to get this behavior - before, you no longer need it. - - o Linux binary RPMs will henceforth include only the - libmysqlpp.so.X.Y.Z file, and create any short names - required, to allow multiple versions to be installed at - once. Currently, you cannot install two MySQL++ library - RPMs at once, because they both have /usr/lib/libmysqlpp.so.X, - for instance. - - o Replaced the Visual C++ and Borland C++ project files with - a new "makemake" system, which creates Makefiles specific - to a particular toolchain. This new mechanism also supports - MinGW and generic GCC-on-*ix. This was done partly to reduce - the number of places we have to change when changing the - file names in MySQL++ or adding new ones, and partly so we're - not tied to one particular version of each of these tools. - - o VC++ Makefiles create a DLL version of the library only - now, so there's no excuse for LGPL violations now. - This same mechanism should make DLL builds under other - Windows compilers easy. - - o Added Connection::enable_ssl(), which enables encrypted - connections to the database server using SSL. - - o Connection::create_db() and drop_db() now return true on - success, not false. - - o Connection::create_db() and drop_db() use Query::exec() - now, for efficiency, rather than Query::execute(). - - o Removed Connection::infoo(). Apparently just there to - save you from a typo when calling the info() method, since - it was a mere alias. - - o Renamed Connection::real_connect() to connect(), gave - several more of its parameters defaults, and removed old - connect() function. Then changed user manual and examples - to use new APIs. - - o Replaced Connection::read_option() with new set_option() - mechanism. The name change matches the method's purpose - better. Functional changes are that it returns true on - success instead of 0, it supports a broader set of options - than read_option() did, and it enforces the correct option - argument type. - - o You can now call Connection::set_option() before the - connection is established, which will simply queue the option - request up until the connection comes up. If you use this - feature, you should use exceptions, because that's the only - way an option setting failure can be signalled in this case. - - o Removed query-building functions (exec*(), store*(), - use()) from class Connection, and moved all the implementation - code to class Query. Query no longer delegates the final - step of sending the query to the database server to - Connection(). - - o Added Connection::enable_ssl(), for turning on SSL support on - a connection. - - o Extracted exception disabling mechanism out of the many - classes that had the feature into a new OptionalExceptions - base class, which all classes having this feature now - derive from. Also, removed all per-method exception - handling flags. Finally, added NoExceptions class. With - all of these changes, there is now a common way to disable - exceptions with fine granularity on all objects that - support the feature. - - o All custom MySQL++ exceptions now derive from the new - Exceptions class. This regularizes the exception interface - and allows you to use a single catch() block if you want. - - o The "throw exceptions" flag is passed from parent to child - in all situations now. (Or if not, please report it as - a bug.) This fulfills a promise made in the v1.7.9 user - manual, with the cost being that some programs will see - new exceptions thrown that they're not expecting. - - o Added a bunch of new exception types: BadOption, - ConnectionFailed, DBSelectionFailed, EndOfResults, - EndOfResultSets, LockFailed, and ObjectNotInitialized. - Some of these replace the use of BadQuery, which in v1.7.x - was a kind of generic exception, thrown when something more - specific wasn't available. Beware, this means that programs - may start crashing after recompiling them under v2.0 due to - uncaught exceptions, if they were only trying to catch BadQuery. - - There are additional instances where the library will - throw new exceptions. One is when calling a method that - forces the internals to use an out-of-bounds index on a - vector; previously, this would just make the program - likely to crash. Another is that the library uses the - BadFieldName exception -- created in v1.7.30 -- in more - apropos situations. - - o Renamed SQLQueryNEParms to BadParamCount, to match naming - style of other concrete exception types. - - o Extracted lock()/unlock() functions from Connection and - Query classes into a new Lockable interface class. Locking - is implemented in terms of a different class hierarchy, Lock, - which allows multiple locking strategies with a single ABI. - - o Removed ResUse::eof(). It's based on a deprecated MySQL - C API feature, and it isn't needed anyway. - - o Removed arrow operator (->) for iterator returned by Fields, - Result and Row containers. It was inherently buggy, because - a correct arrow operator must return the address of an - object, but the underlying element access functions in these - classes (e.g. at()) return objects by value, of necessity. - Therefore, this operator could only return the address of - a temporary, which cannot be safely dereferenced. - - o Returned Row subscripting to something more like the - v1.7.9 scheme: there are two operator[] overloads, one for an - integer (field by index) and another for const char* (field - by name). lookup_by_name() has been removed. Because row[0] - is ambiguous again, added Row::at() (by analogy with STL - sequence containers), which always works. - - o Collapsed two of the Row::value_list*() overloads into - two other similar functions using default parameters. - This changes the API, but the removed functions aren't - used within the library, and I doubt they are used outside, - either. - - o Merged RowTemplate into Row. - - o Merged SQLQuery class into Query class. - - o Query is now derived from std::ostream instead of - std::stringstream, and we manage our own internal string - buffer. - - o Moved SQLParseElement and SQLQueryParms into their own - module, qparms. - - o Added multiple result set handling to Query. MySQL 4.1 - and higher allow you to give multiple SQL statements in a - single "store" call, which requires extensions to MySQL++ - so you can iterate through the multiple result sets. Also, - stored procedures in MySQL 5.0 reportedly return multiple - result sets. Thanks for the initial patch go to Arnon Jalon; - I reworked it quite a bit. - - o Query::storein*() now supports more varieties of the - nonstandard slist comtainer. (Singly-linked version of - STL std::list.) - - o Template query mechanism and user manual had several - mismatches. Made manual match actual behavior, or - made library match documented behavior, as apropriate. - Initial patch by Jürgen MF Gleiss, with corrections and - enhancements by Warren Young. - - o Collapsed mysql_* date and time base classes' methods and - data into the subclasses. Also, DateTime no longer derives - from Date and Time; you could get away with that in the - old hierarchy, but now it creates an inheritance diamond, - and allows unsupported concepts like comparing a Time to - a DateTime. - - o Removed "field name" form of Row::field_list(). It was - pretty much redundant -- if you have the field names, why - do you need a list of field names? - - o ColData can convert itself to bool now. Thanks for this - patch go to Byrial Jensen. - - o Removed simp_list_b type; wasn't being used, and doesn't - look to be useful for end-user code. - - o Several methods that used to take objects by value now - do so by const reference, for efficiency. - - o Several variable and function renamings so that MySQL++ - isn't needlessly tied to MySQL. Even if we never make - the library work with other database servers, there's - little point in tying this library to MySQL blindly. - - o Renamed all private data members of MySQL++ classes to - have trailing underscores. - - o 'private' section follows 'public' section in all classes - now. - - o Removed mysql++.hh and sqlplus.hh backwards-compatibility - headers. - - o Added copy ctors to Date/Time classes so that they will - work in SSQLS under GCC 4.0.0. Without these, the compiler - couldn't make the conversion from raw MySQL row data. - - o Fixed a bunch of GCC 4.0 pedantic warnings: added virtual - dtors to all base classes, calling base class ctors from leaf - classes, etc. - - o All warnings fixed under VC++ at warning level 3. (Mostly - harmless signedness and integer conversion stuff.) - - o Updated LGPL license/copyright comments at the top of - several files to use FSF's new physical address. - - o Relicensed user manual under a close variant of the Linux - Documentation Project License, as it's designed for - documentation, which the LGPL is not. Permission for this - received from Kevin Atkinson and MySQL AB. - - o Added ABI and API breakages chapter to user manual. It - is basically a subset of this ChangeLog, with only the - information an end-user must know when migrating between - versions. - - o Reworked user manual's DocBook code quite a bit after - reading Bob Stayton's book "DocBook XSL" 3/e. Better handling - of stylesheets, taking advantage of some superior DocBook - features, prettier output (especially the HTML version), etc. - - o Rewrote doc/userman/README to make it clearer how to get - started contributing to the user manual. It's essentially a - "getting started with DocBook" guide now! - - o Lots of small text improvements to user and reference - manuals. Aside from the obvious tracking of library changes, - made a bunch of minor style and clarity improvements. - - o Added CSS stylesheets for userman and refman to - make the HTML versions of each a) not ugly; and b) match - tangentsoft.net. (Yes, some may say that these are incompatible - goals....) - - o Standardized exception handling code in the examples that - use it. - - o Fixed a potential memory leak due to exceptions thrown from - ResUse. Thanks for this patch go to Chris Frey. - - o Using new "no exceptions" feature of library in simple1 - example, so it is now truly simple. - - o simple1 example no longer depends as much on util module, so - that all of the important code is in one place. Makes - learning MySQL++ a little less intimidating. - - o Added new simple2 and usequery examples, to demonstrate - the proper way to handle a "use" query, with exceptions - disabled, and not, respectively. Added them to the user - manual, in the appropriate place. - - o Refactored the "print stock table" example functions - again, to make code using them clearer. - - o UTF-8 to UCS-2 handling in examples is now automatic on - Windows. - - o Removed debug code from Windows Unicode output examples - that slipped into previous release. - - o resetdb example is now clearer, and more robust in the - face of database errors. - - o Simplified connect_to_db() in examples' util module. - - o Added sample autoconf macro for finding MySQL++ libraries, for - people to use in their own autotools-based projects. - - o Lots and lots of minor cleanups not worth mentioning - individually... + THIS IS NOT A DROP-IN REPLACEMENT FOR MySQL++ v1.7! + + At minimum, you will have to recompile your program against + this library. You may also have to make code changes. + Please see the "Incompatible Library Changes" chapter of + the user manual for a guide to migrating your code to this + new version: + + http://tangentsoft.net/mysql++/doc/html/userman/breakages.html + + o The library's shared object file name (soname) scheme has + changed. (This mainly affects POSIX systems.) + + The soname for the last 1.7.x releases of MySQL++ was + libmysqlpp.so.4, meaning the fourth version of the library's + application binary interface (ABI). (The first ABI version + in this scheme was that provided by 1.7.9.) MySQL++ + 2.0.0's soname is libmysqlpp.so.2.0.0. Since the dynamic + linker setup on some systems will create a symlink to + that file called libmysqlpp.so.2, it's possible that this + library could be confused with that for MySQL++ 1.7.19 + through .21, which also used this number. Do not install + this library on a system which still has binaries linked + against that version of the library! + + The new scheme is {ABI}.{feature}.{bug fix}. That is, + the first number changes whenever we break the library's + binary interface; the second changes when adding features + that do not break the ABI; and the last changes when the + release contains only internal bug fixes. This means + that we will probably end up with MySQL++ 3.0 and 4.0 at + some point, so there will be further soname conflicts. + Hopefully we can put these ABI changes off long enough + to avoid any real problems. + + o autoconf now installs headers into $prefix/include/mysql++, + instead of $prefix/include. If you were using the + --includedir configure script option to get this behavior + before, you no longer need it. + + o Linux binary RPMs will henceforth include only the + libmysqlpp.so.X.Y.Z file, and create any short names + required, to allow multiple versions to be installed at + once. Currently, you cannot install two MySQL++ library + RPMs at once, because they both have /usr/lib/libmysqlpp.so.X, + for instance. + + o Replaced the Visual C++ and Borland C++ project files with + a new "makemake" system, which creates Makefiles specific + to a particular toolchain. This new mechanism also supports + MinGW and generic GCC-on-*ix. This was done partly to reduce + the number of places we have to change when changing the + file names in MySQL++ or adding new ones, and partly so we're + not tied to one particular version of each of these tools. + + o VC++ Makefiles create a DLL version of the library only + now, so there's no excuse for LGPL violations now. + This same mechanism should make DLL builds under other + Windows compilers easy. + + o Added Connection::enable_ssl(), which enables encrypted + connections to the database server using SSL. + + o Connection::create_db() and drop_db() now return true on + success, not false. + + o Connection::create_db() and drop_db() use Query::exec() + now, for efficiency, rather than Query::execute(). + + o Removed Connection::infoo(). Apparently just there to + save you from a typo when calling the info() method, since + it was a mere alias. + + o Renamed Connection::real_connect() to connect(), gave + several more of its parameters defaults, and removed old + connect() function. Then changed user manual and examples + to use new APIs. + + o Replaced Connection::read_option() with new set_option() + mechanism. The name change matches the method's purpose + better. Functional changes are that it returns true on + success instead of 0, it supports a broader set of options + than read_option() did, and it enforces the correct option + argument type. + + o You can now call Connection::set_option() before the + connection is established, which will simply queue the option + request up until the connection comes up. If you use this + feature, you should use exceptions, because that's the only + way an option setting failure can be signalled in this case. + + o Removed query-building functions (exec*(), store*(), + use()) from class Connection, and moved all the implementation + code to class Query. Query no longer delegates the final + step of sending the query to the database server to + Connection(). + + o Added Connection::enable_ssl(), for turning on SSL support on + a connection. + + o Extracted exception disabling mechanism out of the many + classes that had the feature into a new OptionalExceptions + base class, which all classes having this feature now + derive from. Also, removed all per-method exception + handling flags. Finally, added NoExceptions class. With + all of these changes, there is now a common way to disable + exceptions with fine granularity on all objects that + support the feature. + + o All custom MySQL++ exceptions now derive from the new + Exceptions class. This regularizes the exception interface + and allows you to use a single catch() block if you want. + + o The "throw exceptions" flag is passed from parent to child + in all situations now. (Or if not, please report it as + a bug.) This fulfills a promise made in the v1.7.9 user + manual, with the cost being that some programs will see + new exceptions thrown that they're not expecting. + + o Added a bunch of new exception types: BadOption, + ConnectionFailed, DBSelectionFailed, EndOfResults, + EndOfResultSets, LockFailed, and ObjectNotInitialized. + Some of these replace the use of BadQuery, which in v1.7.x + was a kind of generic exception, thrown when something more + specific wasn't available. Beware, this means that programs + may start crashing after recompiling them under v2.0 due to + uncaught exceptions, if they were only trying to catch BadQuery. + + There are additional instances where the library will + throw new exceptions. One is when calling a method that + forces the internals to use an out-of-bounds index on a + vector; previously, this would just make the program + likely to crash. Another is that the library uses the + BadFieldName exception -- created in v1.7.30 -- in more + apropos situations. + + o Renamed SQLQueryNEParms to BadParamCount, to match naming + style of other concrete exception types. + + o Extracted lock()/unlock() functions from Connection and + Query classes into a new Lockable interface class. Locking + is implemented in terms of a different class hierarchy, Lock, + which allows multiple locking strategies with a single ABI. + + o Removed ResUse::eof(). It's based on a deprecated MySQL + C API feature, and it isn't needed anyway. + + o Removed arrow operator (->) for iterator returned by Fields, + Result and Row containers. It was inherently buggy, because + a correct arrow operator must return the address of an + object, but the underlying element access functions in these + classes (e.g. at()) return objects by value, of necessity. + Therefore, this operator could only return the address of + a temporary, which cannot be safely dereferenced. + + o Returned Row subscripting to something more like the + v1.7.9 scheme: there are two operator[] overloads, one for an + integer (field by index) and another for const char* (field + by name). lookup_by_name() has been removed. Because row[0] + is ambiguous again, added Row::at() (by analogy with STL + sequence containers), which always works. + + o Collapsed two of the Row::value_list*() overloads into + two other similar functions using default parameters. + This changes the API, but the removed functions aren't + used within the library, and I doubt they are used outside, + either. + + o Merged RowTemplate into Row. + + o Merged SQLQuery class into Query class. + + o Query is now derived from std::ostream instead of + std::stringstream, and we manage our own internal string + buffer. + + o Moved SQLParseElement and SQLQueryParms into their own + module, qparms. + + o Added multiple result set handling to Query. MySQL 4.1 + and higher allow you to give multiple SQL statements in a + single "store" call, which requires extensions to MySQL++ + so you can iterate through the multiple result sets. Also, + stored procedures in MySQL 5.0 reportedly return multiple + result sets. Thanks for the initial patch go to Arnon Jalon; + I reworked it quite a bit. + + o Query::storein*() now supports more varieties of the + nonstandard slist comtainer. (Singly-linked version of + STL std::list.) + + o Template query mechanism and user manual had several + mismatches. Made manual match actual behavior, or + made library match documented behavior, as apropriate. + Initial patch by Jürgen MF Gleiss, with corrections and + enhancements by Warren Young. + + o Collapsed mysql_* date and time base classes' methods and + data into the subclasses. Also, DateTime no longer derives + from Date and Time; you could get away with that in the + old hierarchy, but now it creates an inheritance diamond, + and allows unsupported concepts like comparing a Time to + a DateTime. + + o Removed "field name" form of Row::field_list(). It was + pretty much redundant -- if you have the field names, why + do you need a list of field names? + + o ColData can convert itself to bool now. Thanks for this + patch go to Byrial Jensen. + + o Removed simp_list_b type; wasn't being used, and doesn't + look to be useful for end-user code. + + o Several methods that used to take objects by value now + do so by const reference, for efficiency. + + o Several variable and function renamings so that MySQL++ + isn't needlessly tied to MySQL. Even if we never make + the library work with other database servers, there's + little point in tying this library to MySQL blindly. + + o Renamed all private data members of MySQL++ classes to + have trailing underscores. + + o 'private' section follows 'public' section in all classes + now. + + o Removed mysql++.hh and sqlplus.hh backwards-compatibility + headers. + + o Added copy ctors to Date/Time classes so that they will + work in SSQLS under GCC 4.0.0. Without these, the compiler + couldn't make the conversion from raw MySQL row data. + + o Fixed a bunch of GCC 4.0 pedantic warnings: added virtual + dtors to all base classes, calling base class ctors from leaf + classes, etc. + + o All warnings fixed under VC++ at warning level 3. (Mostly + harmless signedness and integer conversion stuff.) + + o Updated LGPL license/copyright comments at the top of + several files to use FSF's new physical address. + + o Relicensed user manual under a close variant of the Linux + Documentation Project License, as it's designed for + documentation, which the LGPL is not. Permission for this + received from Kevin Atkinson and MySQL AB. + + o Added ABI and API breakages chapter to user manual. It + is basically a subset of this ChangeLog, with only the + information an end-user must know when migrating between + versions. + + o Reworked user manual's DocBook code quite a bit after + reading Bob Stayton's book "DocBook XSL" 3/e. Better handling + of stylesheets, taking advantage of some superior DocBook + features, prettier output (especially the HTML version), etc. + + o Rewrote doc/userman/README to make it clearer how to get + started contributing to the user manual. It's essentially a + "getting started with DocBook" guide now! + + o Lots of small text improvements to user and reference + manuals. Aside from the obvious tracking of library changes, + made a bunch of minor style and clarity improvements. + + o Added CSS stylesheets for userman and refman to + make the HTML versions of each a) not ugly; and b) match + tangentsoft.net. (Yes, some may say that these are incompatible + goals....) + + o Standardized exception handling code in the examples that + use it. + + o Fixed a potential memory leak due to exceptions thrown from + ResUse. Thanks for this patch go to Chris Frey. + + o Using new "no exceptions" feature of library in simple1 + example, so it is now truly simple. + + o simple1 example no longer depends as much on util module, so + that all of the important code is in one place. Makes + learning MySQL++ a little less intimidating. + + o Added new simple2 and usequery examples, to demonstrate + the proper way to handle a "use" query, with exceptions + disabled, and not, respectively. Added them to the user + manual, in the appropriate place. + + o Refactored the "print stock table" example functions + again, to make code using them clearer. + + o UTF-8 to UCS-2 handling in examples is now automatic on + Windows. + + o Removed debug code from Windows Unicode output examples + that slipped into previous release. + + o resetdb example is now clearer, and more robust in the + face of database errors. + + o Simplified connect_to_db() in examples' util module. + + o Added sample autoconf macro for finding MySQL++ libraries, for + people to use in their own autotools-based projects. + + o Lots and lots of minor cleanups not worth mentioning + individually... 1.7.40, 2005.05.26 (r719) - o Multiple item form of insert() now works if you're using the - SQLQuery class, or its derivative, Query. Thanks to Mark - Meredino for this patch. - - o Fixed a bug in const_string::compare(), in which MySQL++ - would walk off the end of the shorter of the two strings. - All was well if the two were the same length. - - o ResUse::operator=() now fully updates the object, so it's more - like the behavior of the full ctor. - - o All source files now contain a license and copyright statement - somewhere within them. - - o Optimized mysql++.h a bit: it now #includes only the minimum set - of files required, and there is now an idempotency guard. - This improves compile times a smidge, but mainly it was - done to clean up the generated #include file graph in the - reference manual. Before, it was a frightful tangle because - we #included everything except custom*.h. - - o Constness fix in MySQL++ date/time classes to avoid compiler - warnings with SSQLS. Thanks to Wolfram Arnold for this patch. - - o Fixed some compiler warnings in custom*.h. Thanks to Chris Frey - for this patch. - - o Added "Submitting Patches" and "Maintaining a Private CVS - Repository" sections to the HACKERS file. Thanks to Chris - Frey for the source material for these sections. The HACKERS - file was improved in several other ways at the same time. - - o PDF version of user manual no longer has links to the reference - manual. They were ugly, and they were broken anyway due to the - way we move the PDFs after generating them. If you want - interlinked manuals, use the HTML version. - - o PDF version of user manual now has hard page breaks between - chapters. - - o Removed complic1 example. Wasn't pulling its own weight. - Everything it is supposed to demonstrate is shown in other - examples already. - - o Refactored print_stock_table() in examples/util module to be - four functions, and made all the examples use various of - these functions where appropriate. Before, several of - the examples had one-off stock table printing code because - print_stock_table() wasn't exactly the right thing, for one - reason or another. One practical problem with this is that - some of the examples missed out on the recent Unicode updates; - now such a change affects all examples the same way. - - o Since so many of the examples rely on the util module, the user - manual now covers it. The simple1 example in the user manual - didn't make much sense before, in particular, because it's - really just a driver for the util module. - - o Added custom5 example. It shows how to use the equal_list() - functionality of SSQLS. Thanks to Chris Frey for the original - version of this program. (I simplified it quite a bit after - accepting it.) - - o New user manual now covers the value_list(), equal_list() and - field_list() stuff that the old manual covered but which was - left out in previous versions of the new manaul. Most of the - examples are the same, but the prose is almost completely new. - This new section includes the custom5 example. - - o Every declaration in MySQL++ is now documented in the reference - manual, or explicitly treated as "internal only". - - o Improved docs for MySQL++'s mechanism to map between MySQL - server types and C++ types. Initial doc patch by Chris Frey, - which I greatly reworked. - - o Improved a lot of existing reference manual documentation while - adding the new stuff. - - o Expanded greatly on the exception handling discussion in the user - manual. - - o Added all-new "Quoting and Escaping" section to the user - manual's Tutorial chapter. Moved some existing comments on - quoting and escaping around and added some new ones to other - sections as a result. - - o Added all-new "Handling SQL Nulls" section to the user manual's - Tutorial chapter. - - o Many improvements to the Overview section of the user manual. - - o Row::operator[] reference now explains the right and wrong way to - use the values it returns. This is in response to a mailing list - post where someone was incorrectly using this feature and getting - a bunch of dangling pointers. - - o Updated Doxyfile so 1.3.19.1 parses it without warnings. Still - works with versions back to 1.2.18, at least. (These are - the versions shipped with Fedora Core 3 and Red Hat Linux 9, - respectively.) - - o Using a superior method to make Doxygen ignore certain sections - of the source code. Between this change and the fact that - everything not so ignored is documented, Doxygen no longer - generates any warnings. - - o Lots of code style updates. Everything should now be consistently - formatted. + o Multiple item form of insert() now works if you're using the + SQLQuery class, or its derivative, Query. Thanks to Mark + Meredino for this patch. + + o Fixed a bug in const_string::compare(), in which MySQL++ + would walk off the end of the shorter of the two strings. + All was well if the two were the same length. + + o ResUse::operator=() now fully updates the object, so it's more + like the behavior of the full ctor. + + o All source files now contain a license and copyright statement + somewhere within them. + + o Optimized mysql++.h a bit: it now #includes only the minimum set + of files required, and there is now an idempotency guard. + This improves compile times a smidge, but mainly it was + done to clean up the generated #include file graph in the + reference manual. Before, it was a frightful tangle because + we #included everything except custom*.h. + + o Constness fix in MySQL++ date/time classes to avoid compiler + warnings with SSQLS. Thanks to Wolfram Arnold for this patch. + + o Fixed some compiler warnings in custom*.h. Thanks to Chris Frey + for this patch. + + o Added "Submitting Patches" and "Maintaining a Private CVS + Repository" sections to the HACKERS file. Thanks to Chris + Frey for the source material for these sections. The HACKERS + file was improved in several other ways at the same time. + + o PDF version of user manual no longer has links to the reference + manual. They were ugly, and they were broken anyway due to the + way we move the PDFs after generating them. If you want + interlinked manuals, use the HTML version. + + o PDF version of user manual now has hard page breaks between + chapters. + + o Removed complic1 example. Wasn't pulling its own weight. + Everything it is supposed to demonstrate is shown in other + examples already. + + o Refactored print_stock_table() in examples/util module to be + four functions, and made all the examples use various of + these functions where appropriate. Before, several of + the examples had one-off stock table printing code because + print_stock_table() wasn't exactly the right thing, for one + reason or another. One practical problem with this is that + some of the examples missed out on the recent Unicode updates; + now such a change affects all examples the same way. + + o Since so many of the examples rely on the util module, the user + manual now covers it. The simple1 example in the user manual + didn't make much sense before, in particular, because it's + really just a driver for the util module. + + o Added custom5 example. It shows how to use the equal_list() + functionality of SSQLS. Thanks to Chris Frey for the original + version of this program. (I simplified it quite a bit after + accepting it.) + + o New user manual now covers the value_list(), equal_list() and + field_list() stuff that the old manual covered but which was + left out in previous versions of the new manaul. Most of the + examples are the same, but the prose is almost completely new. + This new section includes the custom5 example. + + o Every declaration in MySQL++ is now documented in the reference + manual, or explicitly treated as "internal only". + + o Improved docs for MySQL++'s mechanism to map between MySQL + server types and C++ types. Initial doc patch by Chris Frey, + which I greatly reworked. + + o Improved a lot of existing reference manual documentation while + adding the new stuff. + + o Expanded greatly on the exception handling discussion in the user + manual. + + o Added all-new "Quoting and Escaping" section to the user + manual's Tutorial chapter. Moved some existing comments on + quoting and escaping around and added some new ones to other + sections as a result. + + o Added all-new "Handling SQL Nulls" section to the user manual's + Tutorial chapter. + + o Many improvements to the Overview section of the user manual. + + o Row::operator[] reference now explains the right and wrong way to + use the values it returns. This is in response to a mailing list + post where someone was incorrectly using this feature and getting + a bunch of dangling pointers. + + o Updated Doxyfile so 1.3.19.1 parses it without warnings. Still + works with versions back to 1.2.18, at least. (These are + the versions shipped with Fedora Core 3 and Red Hat Linux 9, + respectively.) + + o Using a superior method to make Doxygen ignore certain sections + of the source code. Between this change and the fact that + everything not so ignored is documented, Doxygen no longer + generates any warnings. + + o Lots of code style updates. Everything should now be consistently + formatted. 1.7.35, 2005.05.05 (r601) The "Cinco de Mayo" release - o Added a "how to use Unicode with MySQL++" chapter to the user - manual. (Too bad "Cinco de Mayo" doesn't have any accented - characters. That would be just _too_ precious.) - - o VC++ examples now use the Unicode Win32 APIs, so they can display - Unicode data from MySQL++. - - o Added an optional conversion function to examples/util.cpp to - handle the conversion from UTF-8 to UCS-2 on Win32. - - o Moved "brief history of MySQL++" from intro section of refman to - intro section of userman. - - o Lots of small bits of documentation polishing. - - o Made some minor constness fixes. Thanks to Erwin van Eijk - for this patch. - - o Made some warning fixes for GCC 4.0. Not all warnings are - fixed, because some of the needed changes would break the ABI. - Thanks to Chris Frey for this patch. - - o Added lib/Doxyfile to distribution. - + o Added a "how to use Unicode with MySQL++" chapter to the user + manual. (Too bad "Cinco de Mayo" doesn't have any accented + characters. That would be just _too_ precious.) + + o VC++ examples now use the Unicode Win32 APIs, so they can display + Unicode data from MySQL++. + + o Added an optional conversion function to examples/util.cpp to + handle the conversion from UTF-8 to UCS-2 on Win32. + + o Moved "brief history of MySQL++" from intro section of refman to + intro section of userman. + + o Lots of small bits of documentation polishing. + + o Made some minor constness fixes. Thanks to Erwin van Eijk + for this patch. + + o Made some warning fixes for GCC 4.0. Not all warnings are + fixed, because some of the needed changes would break the ABI. + Thanks to Chris Frey for this patch. + + o Added lib/Doxyfile to distribution. + 1.7.34, 2005.04.30 (r573) - o Added a multiple-insert method for Query, which lets you insert - a range of records from an STL container (or the whole thing, - if you like) in a single SQL query. This is faster, and it - reduces coding errors due to less repetition. Thanks to Mark - Meredino for the patch. - - o Reference and user manual now get rebuilt automatically when - required. (E.g. on 'make dist', or explicitly now through 'make - docs'.) - - o Made it easier to change the maximum number of SSQLS data members - in generated custom-macros.h file. It used to be hard-coded in - several places in lib/custom.pl; now it's a variable at the top of - the file. - - o Changed default SSQLS data member limit to 25, which is what it - has been documented as for a long time now. It was actually 26 - within custom.pl. - - o Fixed a regression in previous version. - - o Trimmed some fat from the distribution packages. - - o Some more small doucmentation improvements. + o Added a multiple-insert method for Query, which lets you insert + a range of records from an STL container (or the whole thing, + if you like) in a single SQL query. This is faster, and it + reduces coding errors due to less repetition. Thanks to Mark + Meredino for the patch. + + o Reference and user manual now get rebuilt automatically when + required. (E.g. on 'make dist', or explicitly now through 'make + docs'.) + + o Made it easier to change the maximum number of SSQLS data members + in generated custom-macros.h file. It used to be hard-coded in + several places in lib/custom.pl; now it's a variable at the top of + the file. + + o Changed default SSQLS data member limit to 25, which is what it + has been documented as for a long time now. It was actually 26 + within custom.pl. + + o Fixed a regression in previous version. + + o Trimmed some fat from the distribution packages. + + o Some more small doucmentation improvements. 1.7.33, 2005.04.29 (r555) - o Worked around an overloaded operator lookup bug in VC++ 7.1 - that caused SSQLS insert, replace and update queries to get - mangled. (Symptom was that custom2 and custom3 examples didn't - work right.) Thanks to Mark Meredino for digging up the - following, which explains the problem and gives the solution: - - http://groups-beta.google.com/group/microsoft.public.vc.stl/browse_thread/thread/9a68d84644e64f15 - - o Some VC++ warning fixes. - - o Major documentation improvements: - - o Using DocBook for user manual and Doxygen for reference - manual. The former now references the latter where - useful. - - o Split out HACKERS and CREDITS files from main README, - and improved remaining bits of README. - - o Moved the text from the old v1.7.9 LaTeX-based - documentation over into the new systems, and reworked - it to more closely resemble English. - - o Added a lot of new material to documentation, and - simplified a lot of what already existed. - - o Documentation is now being built in HTML and PDF forms. - - o ebuild file updated to take advantage of recent configure script - features. Thanks to Chris Frey for this patch. + o Worked around an overloaded operator lookup bug in VC++ 7.1 + that caused SSQLS insert, replace and update queries to get + mangled. (Symptom was that custom2 and custom3 examples didn't + work right.) Thanks to Mark Meredino for digging up the + following, which explains the problem and gives the solution: + + http://groups-beta.google.com/group/microsoft.public.vc.stl/browse_thread/thread/9a68d84644e64f15 + + o Some VC++ warning fixes. + + o Major documentation improvements: + + o Using DocBook for user manual and Doxygen for reference + manual. The former now references the latter where + useful. + + o Split out HACKERS and CREDITS files from main README, + and improved remaining bits of README. + + o Moved the text from the old v1.7.9 LaTeX-based + documentation over into the new systems, and reworked + it to more closely resemble English. + + o Added a lot of new material to documentation, and + simplified a lot of what already existed. + + o Documentation is now being built in HTML and PDF forms. + + o ebuild file updated to take advantage of recent configure script + features. Thanks to Chris Frey for this patch. 1.7.32, 2005.03.10 (r479) - o Example building may now be skipped with --disable-examples - configure script flag. - - o Changed stock items added in resetdb. One is now UTF-8 encoded, - to show that basic use of Unicode with MySQL++ is easy, yet not - foolproof. (See formatting of table on systems where cout isn't - UTF-8 aware!) Other stock items now follow a theme, for your - amusement. :) - - o custom3 example now changes UTF-8 item's name to the 7-bit ASCII - equivalent. Previously, this example would fix a spelling error - in the table. - - o resetdb example now says 'why' when it is unable to create the - sample database. - - o Small formatting change to print_stock_table(), used by several - examples. - - o Was issuing a VC++-specific warning-disable pragma when built by - any Windows compiler. Fixed. - + o Example building may now be skipped with --disable-examples + configure script flag. + + o Changed stock items added in resetdb. One is now UTF-8 encoded, + to show that basic use of Unicode with MySQL++ is easy, yet not + foolproof. (See formatting of table on systems where cout isn't + UTF-8 aware!) Other stock items now follow a theme, for your + amusement. :) + + o custom3 example now changes UTF-8 item's name to the 7-bit ASCII + equivalent. Previously, this example would fix a spelling error + in the table. + + o resetdb example now says 'why' when it is unable to create the + sample database. + + o Small formatting change to print_stock_table(), used by several + examples. + + o Was issuing a VC++-specific warning-disable pragma when built by + any Windows compiler. Fixed. + 1.7.31, 2005.03.05 (r462) The "Inevitable Point-one Followup" release - o Check for threads support must now be explicitly requested via - configure script's new --enable-thread-check flag. - - o Fix for contacting MySQL server on a nonstandard port number. - Thanks to Chris Frey for this patch. - - o Example programs using standard command line format now accept a - fourth optional parameter, a port number for the server. Thanks - to Chris Frey for this patch. - - o One more g++ 3.4 pedantic warning fix by Chris Frey. - - o Exception handling in resetdb is no longer nested, because you'd - get a segfault on some systems when an exception was thrown from - one of the inner try blocks. - - o Improvements to Connection class's handling of locking mechanism. - Concept based on patches by Rongjun Mu. - - o Implemented the declared-but-never-defined Query::lock(). Thanks - to Rongjun Mu for this patch. - - o Cleaned up some unclear if/else blocks in connection.cpp by - adding explicit braces, correct indenting and putting normal - code path in the if side instead of the else. + o Check for threads support must now be explicitly requested via + configure script's new --enable-thread-check flag. + + o Fix for contacting MySQL server on a nonstandard port number. + Thanks to Chris Frey for this patch. + + o Example programs using standard command line format now accept a + fourth optional parameter, a port number for the server. Thanks + to Chris Frey for this patch. + + o One more g++ 3.4 pedantic warning fix by Chris Frey. + + o Exception handling in resetdb is no longer nested, because you'd + get a segfault on some systems when an exception was thrown from + one of the inner try blocks. + + o Improvements to Connection class's handling of locking mechanism. + Concept based on patches by Rongjun Mu. + + o Implemented the declared-but-never-defined Query::lock(). Thanks + to Rongjun Mu for this patch. + + o Cleaned up some unclear if/else blocks in connection.cpp by + adding explicit braces, correct indenting and putting normal + code path in the if side instead of the else. 1.7.30, 2005.02.28 (r443) The "Power of Round Numbers" release - o bootstrap script now accepts a 'pedantic' argument, which sets a - bunch of CFLAGS that make g++ very picky about the code it - accepts without warnings. - - o Fixed a bunch of things that generated warnings with g++ in - pedantic mode. Only two warnings remain, having to do with - floating point comparisons. (See Wishlist for plans on how to - deal with these.) Thanks to Chris Frey for this patch. - - o Split long tests out of configure.in into M4 files in new config - subdir. This makes configure.in easier to read. - - o Added preliminary thread support. Currently, this just means that - we detect the required compiler and linker thread flags, and link - against the proper thread-safe libraries. THERE MAY BE - UN-THREAD-SAFE CODE IN MYSQL++ STILL! - - o Standard C++ exceptions are the default now. Old pre-Standard - exception stuff removed. - - o Row::lookup_by_name() will throw the new BadFieldName exception if - you pass a bad field name. Thanks for this patch to Chris Frey. - - o Row::operator[] will throw a Standard C++ out of bounds exception - by way of std::vector::at() if you pass it a bad index. Thanks - for this patch to Chris Frey. - - o Setting Connection::is_connected flag to false on close(). - Previously, is_connected() would continue to return true after - close() was called. - - o All number-to-string conversion ctors in SQLString class now use - ostringstream to do the conversion. Previously, we used - snprintf(), which isn't available on all systems. Also, we used a - C99 format specifier for the "long long" conversion, which is also - not available on all systems. This new ostringstream code should - be platform-independent, finally. + o bootstrap script now accepts a 'pedantic' argument, which sets a + bunch of CFLAGS that make g++ very picky about the code it + accepts without warnings. + + o Fixed a bunch of things that generated warnings with g++ in + pedantic mode. Only two warnings remain, having to do with + floating point comparisons. (See Wishlist for plans on how to + deal with these.) Thanks to Chris Frey for this patch. + + o Split long tests out of configure.in into M4 files in new config + subdir. This makes configure.in easier to read. + + o Added preliminary thread support. Currently, this just means that + we detect the required compiler and linker thread flags, and link + against the proper thread-safe libraries. THERE MAY BE + UN-THREAD-SAFE CODE IN MYSQL++ STILL! + + o Standard C++ exceptions are the default now. Old pre-Standard + exception stuff removed. + + o Row::lookup_by_name() will throw the new BadFieldName exception if + you pass a bad field name. Thanks for this patch to Chris Frey. + + o Row::operator[] will throw a Standard C++ out of bounds exception + by way of std::vector::at() if you pass it a bad index. Thanks + for this patch to Chris Frey. + + o Setting Connection::is_connected flag to false on close(). + Previously, is_connected() would continue to return true after + close() was called. + + o All number-to-string conversion ctors in SQLString class now use + ostringstream to do the conversion. Previously, we used + snprintf(), which isn't available on all systems. Also, we used a + C99 format specifier for the "long long" conversion, which is also + not available on all systems. This new ostringstream code should + be platform-independent, finally. 1.7.28, 2005.02.04 (r403) - o --with-mysql* flags to configure script now try the given - directory explicitly, and only if that fails do they try - variations, like tacking '/lib' and such onto it to try and find - the MySQL includes and libraries. Thanks to Matthew Walton for - the patch. - - o Finally removed sql_quote.h's dependence on custom.h, by moving - the one definition it needed from custom.h to deps.h. This will - help portability to compilers that can't handle the SSQLS macros, - by making that part of the library truly optional. + o --with-mysql* flags to configure script now try the given + directory explicitly, and only if that fails do they try + variations, like tacking '/lib' and such onto it to try and find + the MySQL includes and libraries. Thanks to Matthew Walton for + the patch. + + o Finally removed sql_quote.h's dependence on custom.h, by moving + the one definition it needed from custom.h to deps.h. This will + help portability to compilers that can't handle the SSQLS macros, + by making that part of the library truly optional. 1.7.27, 2005.01.12 (r395) - o configure check for libmysqlclient now halts configuration if the - library isn't found. Previously, it would just be flagged as - missing, and MySQL++ would fail to build. - - o Added sql_string.cpp to VC++ and BCBuilder project files. - - o Removed Totte Karlsson's 'populate' example, which never made it - into the distribution anyway. - - o Removed last vestiges of 'dummy.cpp'. - - o Renamed *.cc to *.cpp in BCBuilder project files. - - o Worked around a BCBuilder C++ syntax processing bug in row.h. + o configure check for libmysqlclient now halts configuration if the + library isn't found. Previously, it would just be flagged as + missing, and MySQL++ would fail to build. + + o Added sql_string.cpp to VC++ and BCBuilder project files. + + o Removed Totte Karlsson's 'populate' example, which never made it + into the distribution anyway. + + o Removed last vestiges of 'dummy.cpp'. + + o Renamed *.cc to *.cpp in BCBuilder project files. + + o Worked around a BCBuilder C++ syntax processing bug in row.h. 1.7.26, 2004.12.17 (r382) - o Moved all of the SQLString definitions out of the header and into - a new .cpp file, reformatted it all, and made the integer - conversion functions use snprintf() or _snprintf() instead of - sprintf(). Also, widened some of the buffers for 64-bit systems. - - o Using quoted #include form for internal library headers, to avoid - some problems with file name clashes. (The headers should still - be installed in their own separate directory for best results, - however.) Thanks to Chris Frey and Evan Wies for the patch and - the discussion that lead to it. - - o Removed unnecessary semicolons on namespace block closures. - Thanks to Evan Wies for this patch. - - o Fixed namespace handling in the legacy headers mysql++.hh and - sqlplus.hh. Thanks to Chris Frey for this patch. - - o #including iostream instead of ostream in lib/null.h for - broader C++ compatibility. (This may allow MySQL++ to work on GCC - 2.95.2 again, but this is unconfirmed.) - - o Detecting proper mysql_shutdown() argument handling automatically - in platform.h for the Windows compiler case instead of making the - user edit the file. Thanks to Evan Wies for this patch. - - o Fixed examples/Makefile.simple to use new *.cpp file naming. - - o Fix to Gentoo ebuild file's exception configure switch handling. - Thanks to Chris Frey for this patch. - - o Rebuilding lib/custom*.h intelligently now, to avoid unnecessary - recompiles after running bootstrap script. + o Moved all of the SQLString definitions out of the header and into + a new .cpp file, reformatted it all, and made the integer + conversion functions use snprintf() or _snprintf() instead of + sprintf(). Also, widened some of the buffers for 64-bit systems. + + o Using quoted #include form for internal library headers, to avoid + some problems with file name clashes. (The headers should still + be installed in their own separate directory for best results, + however.) Thanks to Chris Frey and Evan Wies for the patch and + the discussion that lead to it. + + o Removed unnecessary semicolons on namespace block closures. + Thanks to Evan Wies for this patch. + + o Fixed namespace handling in the legacy headers mysql++.hh and + sqlplus.hh. Thanks to Chris Frey for this patch. + + o #including iostream instead of ostream in lib/null.h for + broader C++ compatibility. (This may allow MySQL++ to work on GCC + 2.95.2 again, but this is unconfirmed.) + + o Detecting proper mysql_shutdown() argument handling automatically + in platform.h for the Windows compiler case instead of making the + user edit the file. Thanks to Evan Wies for this patch. + + o Fixed examples/Makefile.simple to use new *.cpp file naming. + + o Fix to Gentoo ebuild file's exception configure switch handling. + Thanks to Chris Frey for this patch. + + o Rebuilding lib/custom*.h intelligently now, to avoid unnecessary + recompiles after running bootstrap script. 1.7.25, 2004.12.09 (r360) - o Yet more fixes to the --with-mysql-lib and --with-mysql-include - flags. - - o Added DLLEXPORT stuff to platform.h, hopefully so that someone - can figure out how to make VC++ make a DLL version of MySQL++. - - o Renamed *.cc to *.cpp. - - o Made 'set -> myset' change in VC++ project files. - - o Some style changes (mostly whitespace) in header files. + o Yet more fixes to the --with-mysql-lib and --with-mysql-include + flags. + + o Added DLLEXPORT stuff to platform.h, hopefully so that someone + can figure out how to make VC++ make a DLL version of MySQL++. + + o Renamed *.cc to *.cpp. + + o Made 'set -> myset' change in VC++ project files. + + o Some style changes (mostly whitespace) in header files. 1.7.24, 2004.12.08 (r343) - o Fixed the --with-mysql-lib and --with-mysql-include flags' - behavior, and extended their search ability to handle one other - common case. (Fixed by Steve Roberts) - - o Fixes to put freestanding functions in namespace mysqlpp. (They - weren't in the namespace, while all the class member functions - were.) This required bumping the ABI version number to 4. - - o Renamed set module to myset, to avoid conflicts with Standard C++ - Library's set.h when MySQL++ headers were installed into one of - the standard system include directories. - - o Renamed all the idempotency guards to make them consistent in - style and unique to MySQL++. - - o Reformatted all of lib/*.cc. + o Fixed the --with-mysql-lib and --with-mysql-include flags' + behavior, and extended their search ability to handle one other + common case. (Fixed by Steve Roberts) + + o Fixes to put freestanding functions in namespace mysqlpp. (They + weren't in the namespace, while all the class member functions + were.) This required bumping the ABI version number to 4. + + o Renamed set module to myset, to avoid conflicts with Standard C++ + Library's set.h when MySQL++ headers were installed into one of + the standard system include directories. + + o Renamed all the idempotency guards to make them consistent in + style and unique to MySQL++. + + o Reformatted all of lib/*.cc. 1.7.23, 2004.11.20 (r333) - o Query::reset() now empties the stored query string. If you - subsequently stored a longer query in the object, you'd overwrite - the previous query, but otherwise the longer part of the previous - one would stick out past the new query. - - o We now look to the NO_LONG_LONGS macro only to decide whether to - fake 64-bit integer support using 32-bit integers. - - o 64-bit integer support under Visual C++ may be working now, using - that platform's __int64_t type. This has not been tested. - - o Removed 64-bit integer support for Codewarrior on Mac OS 9 and - earlier. OS X uses GCC, so it requires no special support. - - o Added MinGW detection in platform.h. - - o If you pass a flag (-X) to the examples that take the standard - parameters (resetdb, simple1, etc.), it prints a usage message. - - o Better error handling in resetdb example, where errors are the - most critical. (If that one runs without errors, the others - probably will, too, and you have to run that one first.) - - o resetdb now reports success, rather than succeeding silently. - - o Removed the code in sample1 example that duplicated util module's - print_stock_table(), and called that function instead. - - o Moved the preview() calls in the example programs to before the - query execution calls, because execution modifies the query. - - o All examples that take the standard command line parameters now - exit when connect_to_db() fails in one of the ways that don't - throw an exception, rather than bulling onward until the next - MySQL database call fails because the connection isn't up. - - o dbinfo example now takes the standard command line parameters. - - o Much better output formatting in dbinfo example. - - o Calling reset() where appropriate in the various example programs. - Before, the programs may have worked, but not for the right - reason. This lead some people to believe that calling reset() - was not necessary. - - o Fixed an incorrect use of row["string"] in complic1 example. - - o Lots of code style improvements to the examples. - - o Some VC++ type warnings squished. Some remain. - + o Query::reset() now empties the stored query string. If you + subsequently stored a longer query in the object, you'd overwrite + the previous query, but otherwise the longer part of the previous + one would stick out past the new query. + + o We now look to the NO_LONG_LONGS macro only to decide whether to + fake 64-bit integer support using 32-bit integers. + + o 64-bit integer support under Visual C++ may be working now, using + that platform's __int64_t type. This has not been tested. + + o Removed 64-bit integer support for Codewarrior on Mac OS 9 and + earlier. OS X uses GCC, so it requires no special support. + + o Added MinGW detection in platform.h. + + o If you pass a flag (-X) to the examples that take the standard + parameters (resetdb, simple1, etc.), it prints a usage message. + + o Better error handling in resetdb example, where errors are the + most critical. (If that one runs without errors, the others + probably will, too, and you have to run that one first.) + + o resetdb now reports success, rather than succeeding silently. + + o Removed the code in sample1 example that duplicated util module's + print_stock_table(), and called that function instead. + + o Moved the preview() calls in the example programs to before the + query execution calls, because execution modifies the query. + + o All examples that take the standard command line parameters now + exit when connect_to_db() fails in one of the ways that don't + throw an exception, rather than bulling onward until the next + MySQL database call fails because the connection isn't up. + + o dbinfo example now takes the standard command line parameters. + + o Much better output formatting in dbinfo example. + + o Calling reset() where appropriate in the various example programs. + Before, the programs may have worked, but not for the right + reason. This lead some people to believe that calling reset() + was not necessary. + + o Fixed an incorrect use of row["string"] in complic1 example. + + o Lots of code style improvements to the examples. + + o Some VC++ type warnings squished. Some remain. + 1.7.22, 2004.11.17 (r302) - o Applied patches by Zahroof Mohammed to allow it to build under GCC - 3.4.2. Tested on MinGW and Fedora Core 3 systems. - - o Removed all the forward declarations in defs.h, and added - forward declarations where necessary in individual header files. - #including defs.h in fewer locations as a result. - - o Legacy headers sqlplus.hh and mysql++.hh now declare they are - using namespace mysqlpp, to allow old code to compile against the - new library without changes. - - o Removed query_reset parameter from several class Query member - functions. In the implementation, these parameters were always - overridden! No sense pretending that we pay attention to these - parameters. This changes the ABI version to 3. - - o #including custom.h in sql_query.h again...it's necessary on GCC - 3.4. - - o bootstrap script runs lib/config.pl after configure. This is - just a nicety for those running in 'maintainer mode'. + o Applied patches by Zahroof Mohammed to allow it to build under GCC + 3.4.2. Tested on MinGW and Fedora Core 3 systems. + + o Removed all the forward declarations in defs.h, and added + forward declarations where necessary in individual header files. + #including defs.h in fewer locations as a result. + + o Legacy headers sqlplus.hh and mysql++.hh now declare they are + using namespace mysqlpp, to allow old code to compile against the + new library without changes. + + o Removed query_reset parameter from several class Query member + functions. In the implementation, these parameters were always + overridden! No sense pretending that we pay attention to these + parameters. This changes the ABI version to 3. + + o #including custom.h in sql_query.h again...it's necessary on GCC + 3.4. + + o bootstrap script runs lib/config.pl after configure. This is + just a nicety for those running in 'maintainer mode'. 1.7.21, 2004.11.05 (r273) - o Generating a main mysql++ RPM containing just the library files - and basic documentation, and the -devel package containing - everything else. - - o Devel package contains examples now, along with a new Makefile - that uses the system include and library files, rather than the - automake-based Makefile.am we currently have which uses the files - in the mysql++ source directory. - - o Renamed sqlplusint subdirectory in the package to lib. - - o Removed the obsolete lib/README file. - - o lib/sql_query.h no longer #includes custom.h, simplifying - build-time dependencies and shortening compile times. + o Generating a main mysql++ RPM containing just the library files + and basic documentation, and the -devel package containing + everything else. + + o Devel package contains examples now, along with a new Makefile + that uses the system include and library files, rather than the + automake-based Makefile.am we currently have which uses the files + in the mysql++ source directory. + + o Renamed sqlplusint subdirectory in the package to lib. + + o Removed the obsolete lib/README file. + + o lib/sql_query.h no longer #includes custom.h, simplifying + build-time dependencies and shortening compile times. 1.7.20, 2004.11.03 (r258) - o Collapsed all numbered *.hh headers into a single *.h file. For - example, the contents of row1.hh, row2.hh and row3.hh are now in - row.h. - - o While doing the previous change, broke several circular - dependencies. (The numbered file scheme was probably partly done - to avoid this problem.) The practical upshot of most of these - changes is that some functions are no longer inline. - - o Removed define_short.hh and everything associated with it. The - library now uses the short names exclusively (e.g. Row instead of - MysqlRow). - - o Put all definitions into namespace mysqlpp. For most programs, - simply adding a 'using namespace mysqlpp' near the top of the - program will suffice to convert to this version. - - o Once again, the main include file was renamed, this time to - mysql++.h. Hopefully this is the last renaming! - - o mysql++.hh still exists. It emits a compiler warning that the - file is obsolete, then it #includes mysql++.h for you. - - o sqlplus.hh is back, being a copy of the new mysql++.hh. Both of - these files may go away at any time. They exist simply to help - people transition to the new file naming scheme. - - o Renamed mysql++-windows.hh to platform.h, and added code to it to - handle #inclusion of config.h on autotools-based systems - intelligently. This fixes the config.h error when building under - Visual C++. - - o There is now only one place where conditional inclusion of - winsock.h happens: platform.h. - - o Beautified the example programs. + o Collapsed all numbered *.hh headers into a single *.h file. For + example, the contents of row1.hh, row2.hh and row3.hh are now in + row.h. + + o While doing the previous change, broke several circular + dependencies. (The numbered file scheme was probably partly done + to avoid this problem.) The practical upshot of most of these + changes is that some functions are no longer inline. + + o Removed define_short.hh and everything associated with it. The + library now uses the short names exclusively (e.g. Row instead of + MysqlRow). + + o Put all definitions into namespace mysqlpp. For most programs, + simply adding a 'using namespace mysqlpp' near the top of the + program will suffice to convert to this version. + + o Once again, the main include file was renamed, this time to + mysql++.h. Hopefully this is the last renaming! + + o mysql++.hh still exists. It emits a compiler warning that the + file is obsolete, then it #includes mysql++.h for you. + + o sqlplus.hh is back, being a copy of the new mysql++.hh. Both of + these files may go away at any time. They exist simply to help + people transition to the new file naming scheme. + + o Renamed mysql++-windows.hh to platform.h, and added code to it to + handle #inclusion of config.h on autotools-based systems + intelligently. This fixes the config.h error when building under + Visual C++. + + o There is now only one place where conditional inclusion of + winsock.h happens: platform.h. + + o Beautified the example programs. 1.7.19, 2004.10.25 (r186) - o Fixed an infinite loop in the query mechanism resulting from the - strstream change in the previous version. There is an overloaded - set of str() member functions that weren't a problem when query - objects were based on strstream. - - o Query mechanism had a bunch of const-incorrectness: there were - several function parameters and functions that were const for - the convenience of other parts of the code, but within these - functions the constness was const_cast away! This was evil - and wrong; now there are fewer const promises, and only one is - still quietly broken within the code. (It's in the SQLQuery - copy ctor implementation; it should be harmless.) - - o Removed operator=() in Query and SQLQuery classes. It cannot take - a const argument for the same reason we have to cast away const - in the SQLQuery copy ctor. It's tolerable to do this in the copy - ctor, but intolerable in an operator. Since the copy ctor is good - enough for all code within the library and within my own code, I'm - removing the operator. - - o Above changes required bumping the ABI to version 2. - - o Visual C++ projects now look for MySQL build files in c:\mysql, - since that's the default install location. (Previously, it was - c:\program files\mysql.) + o Fixed an infinite loop in the query mechanism resulting from the + strstream change in the previous version. There is an overloaded + set of str() member functions that weren't a problem when query + objects were based on strstream. + + o Query mechanism had a bunch of const-incorrectness: there were + several function parameters and functions that were const for + the convenience of other parts of the code, but within these + functions the constness was const_cast away! This was evil + and wrong; now there are fewer const promises, and only one is + still quietly broken within the code. (It's in the SQLQuery + copy ctor implementation; it should be harmless.) + + o Removed operator=() in Query and SQLQuery classes. It cannot take + a const argument for the same reason we have to cast away const + in the SQLQuery copy ctor. It's tolerable to do this in the copy + ctor, but intolerable in an operator. Since the copy ctor is good + enough for all code within the library and within my own code, I'm + removing the operator. + + o Above changes required bumping the ABI to version 2. + + o Visual C++ projects now look for MySQL build files in c:\mysql, + since that's the default install location. (Previously, it was + c:\program files\mysql.) 1.7.18, 2004.10.01 (r177) - o Changed all the strstream (and friends) stuff to stringstream type - classes. Let there be much rejoicing. - - o Query object now lets you use store() even when the SQL query - cannot return a result, such as a DROP TABLE command. This is - useful for sending arbitrary SQL to the server. Thanks to - Jose Mortensen for the patch. - - o Quote fix in configure.in, thanks to David Sward. - - o Renamed undef_short file to undef_short.hh. - - o Gentoo ebuild file is actually being shipped with the tarball, - instead of just sitting in my private CVS tree since 1.7.14 was - current. Ooops.... + o Changed all the strstream (and friends) stuff to stringstream type + classes. Let there be much rejoicing. + + o Query object now lets you use store() even when the SQL query + cannot return a result, such as a DROP TABLE command. This is + useful for sending arbitrary SQL to the server. Thanks to + Jose Mortensen for the patch. + + o Quote fix in configure.in, thanks to David Sward. + + o Renamed undef_short file to undef_short.hh. + + o Gentoo ebuild file is actually being shipped with the tarball, + instead of just sitting in my private CVS tree since 1.7.14 was + current. Ooops.... 1.7.17, 2004.09.16 (r170) - o Reverted one of the VC++ warning fix changes from 1.7.16 that - caused crashes on Linux. + o Reverted one of the VC++ warning fix changes from 1.7.16 that + caused crashes on Linux. - o Added a configure test that conditionally adds the extra 'level' - parameter to mysql_shutdown() that was added in MySQL 4.1.3 and - 5.0.1. + o Added a configure test that conditionally adds the extra 'level' + parameter to mysql_shutdown() that was added in MySQL 4.1.3 and + 5.0.1. 1.7.16, 2004.09.13 (r160) - o Building VC++ version with DLL version of C runtime libraries, and - at warning level 3 with no warnings emitted. + o Building VC++ version with DLL version of C runtime libraries, and + at warning level 3 with no warnings emitted. - o VC++ build no longer attempts to fake "long long" support. See - the Wishlist for further thoughts on this. + o VC++ build no longer attempts to fake "long long" support. See + the Wishlist for further thoughts on this. 1.7.15, 2004.09.02 (r144) - o Renamed Configure file to common.am, to avoid file name conflict - with configure script on case-sensitive file systems. - - o Added ebuild file and ebuild target to top-level Makefile for - Gentoo systems. Thanks to Chris Frey for this. - - o Small efficiency improvements to BadQuery exception handling. - Initial idea by Chris Frey, improvements by Warren Young. + o Renamed Configure file to common.am, to avoid file name conflict + with configure script on case-sensitive file systems. + + o Added ebuild file and ebuild target to top-level Makefile for + Gentoo systems. Thanks to Chris Frey for this. + + o Small efficiency improvements to BadQuery exception handling. + Initial idea by Chris Frey, improvements by Warren Young. 1.7.14, 2004.08.26 (r130) - o Builds with Visual C++ 7.1. + o Builds with Visual C++ 7.1. - o Fixed a bug in custom macro generation that caused problems with - GCC 3.4. (X_cus_value_list ctor definition was broken.) + o Fixed a bug in custom macro generation that caused problems with + GCC 3.4. (X_cus_value_list ctor definition was broken.) 1.7.13, 2004.08.23 (r92) - o Removed USL CC support. (System V stock system compiler.) Use - GCC on these platforms instead. - - o Added examples/README, explaining how to use the examples, and - what they all do. - - o Most of the example programs now accept command line arguments for - host name, user name and password, like resetdb does. - - o Renamed sinisa_ex example to dbinfo. - - o Several Standard C++ syntax fixes to quash errors emitted by - GCC 3.4 and Borland C++ Builder 6. Thanks to Steffen Schumacher - and Totte Karlsson for their testing and help with these. - - o Added proper #includes for BCBuilder, plus project files for same. - Thanks to Totte Karlsson for these. + o Removed USL CC support. (System V stock system compiler.) Use + GCC on these platforms instead. + + o Added examples/README, explaining how to use the examples, and + what they all do. + + o Most of the example programs now accept command line arguments for + host name, user name and password, like resetdb does. + + o Renamed sinisa_ex example to dbinfo. + + o Several Standard C++ syntax fixes to quash errors emitted by + GCC 3.4 and Borland C++ Builder 6. Thanks to Steffen Schumacher + and Totte Karlsson for their testing and help with these. + + o Added proper #includes for BCBuilder, plus project files for same. + Thanks to Totte Karlsson for these. 1.7.12, 2004.08.19 (r63) - o Many Standard C++ fixes, most from the GCC 3.4 patch by - Rune Kleveland. - - o Added Wishlist file to distribution. - - o Fixed a problem in the bootstrap script that caused complaints - from the autotools on some systems. - - o RPM building is working properly now. - - o Fixed the idempotency guard in datetime1.hh. + o Many Standard C++ fixes, most from the GCC 3.4 patch by + Rune Kleveland. + + o Added Wishlist file to distribution. + + o Fixed a problem in the bootstrap script that caused complaints + from the autotools on some systems. + + o RPM building is working properly now. + + o Fixed the idempotency guard in datetime1.hh. 1.7.11, 2004.08.17 (r50) - o Renamed mysql++, defs and define_short files, adding .hh to the - end of each. (They're header files!) This shouldn't impact - library users, since these are hopefully used internal to the - library only. - - o Removed sqlplus.hh file. Use mysql++.hh instead. - - o Added mysql++.spec, extracted from contributed 1.7.9 source RPM, - and updated it significantly. Also, added an 'rpm' target to - Makefile.am to automate the process of building RPMs. - - o Added bootstrap and LGPL files to distribution tarball. - - o Added pre-1.7.10 history to this file. - - o Removed .version file. Apparently it's something required by old - versions of libtool. + o Renamed mysql++, defs and define_short files, adding .hh to the + end of each. (They're header files!) This shouldn't impact + library users, since these are hopefully used internal to the + library only. + + o Removed sqlplus.hh file. Use mysql++.hh instead. + + o Added mysql++.spec, extracted from contributed 1.7.9 source RPM, + and updated it significantly. Also, added an 'rpm' target to + Makefile.am to automate the process of building RPMs. + + o Added bootstrap and LGPL files to distribution tarball. + + o Added pre-1.7.10 history to this file. + + o Removed .version file. Apparently it's something required by old + versions of libtool. 1.7.10, 2004.08.16 (r27) - o Maintenance taken over by Warren Young (mysqlpp at etr dash usa - dot com.) See http://lists.mysql.com/plusplus/3326 for details. - - o Applied many of the GCC 3.x patches submitted for 1.7.9 over - the years. This allows it to build on everything from 3.0 to - 3.3.3, at least. Because so many patches are rolled up in one - big jump, it's difficult to describe all the changes and where - they came from. Mostly they're Standard C++ fixes, as GCC - has become more strict in the source code that it will accept. - - o MysqlRow used to overload operator[] for string types as well as - integers so you could look up a field by its name, rather than by - its index. GCC 3.3 says this is illegal C++ due to ambiguities in - resolving which overload should be used in various situations. - operator[] is now overloaded only for one integer type, and a - new member function lookup_by_name() was added to maintain the old - by-field-name functionality. - - o Fixed another operator overloading problem in SSQLS macro - generation with GCC 3.3. - - o The _table member of SSQLS-defined structures is now const char*, - so you can assign to it from a const char* string. - - o Got autoconf/automake build system working with current versions - of those tools again. Removed the generated autotools files from - CVS. - - o Renamed library file from libsqlplus to libmysqlpp. + o Maintenance taken over by Warren Young (mysqlpp at etr dash usa + dot com.) See http://lists.mysql.com/plusplus/3326 for details. + + o Applied many of the GCC 3.x patches submitted for 1.7.9 over + the years. This allows it to build on everything from 3.0 to + 3.3.3, at least. Because so many patches are rolled up in one + big jump, it's difficult to describe all the changes and where + they came from. Mostly they're Standard C++ fixes, as GCC + has become more strict in the source code that it will accept. + + o MysqlRow used to overload operator[] for string types as well as + integers so you could look up a field by its name, rather than by + its index. GCC 3.3 says this is illegal C++ due to ambiguities in + resolving which overload should be used in various situations. + operator[] is now overloaded only for one integer type, and a + new member function lookup_by_name() was added to maintain the old + by-field-name functionality. + + o Fixed another operator overloading problem in SSQLS macro + generation with GCC 3.3. + + o The _table member of SSQLS-defined structures is now const char*, + so you can assign to it from a const char* string. + + o Got autoconf/automake build system working with current versions + of those tools again. Removed the generated autotools files from + CVS. + + o Renamed library file from libsqlplus to libmysqlpp. 1.7.9 (May 1 2001) Sinisa Milivojevic * Fixed a serious bug in Connection constructor when reading MySQL DELETED HACKERS Index: HACKERS ================================================================== --- HACKERS +++ /dev/null @@ -1,105 +0,0 @@ -If you are going to make any changes to MySQL++, this file has some -hints and commentary you may find helpful. - - -SUBVERSION ACCESS - - To check out the current development version from the Gna! - Subversion repository, say: - - $ svn co svn://svn.gna.org/svn/mysqlpp/trunk mysqlpp - - If you're a MySQL++ committer, use svn over ssh instead: - - $ svn co svn+ssh://LOGIN@svn.gna.org/svn/mysqlpp/trunk mysqlpp - - where LOGIN is your Gna! login name. You will have to have your - ssh public key registered with Gna! for this to work. - - -SUBMITTING PATCHES - - If you wish to submit a patch to the library, please send it to - the MySQL++ mailing list. We want it in unified diff format. - - The easiest way to do this is to check out a copy of the current - MySQL++ tree as described in the previous section. Then make - your change, cd to the root directory of the project, and ask - Subversion to generate the diff for you: - - $ svn diff > mychange.patch - - If your patch adds new files to the distribution, you can say - "svn add newfile" before you do the diff, which will include - the contents of that file in the patch. (You can do this even - when you've checked out the tree anonymously.) Then say "svn - revert newfile" to make Subversion forget about the new file. - - If you're making a patch against a MySQL++ distribution tarball, - then you can generate the diff this way: - - $ diff -ruN mysql++-olddir mysql++-newdir > mychange.patch - - The diff command is part of every Unix and Linux system, and - should be installed by default. If you're on a Windows machine, - GNU diff is part of Cygwin (http://cygwin.com/). Subversion is - also available for all of these systems. There are no excuses - for not being able to make unified diffs. :) - - -MAINTAINING A PRIVATE CVS REPOSITORY - - You may find it helpful to maintain your own CVS repository. - Whenever there is a new MySQL++ release, import it on the vendor - branch like this: - - $ cvs import -m "Version 1.7.35" software/mysql++ mysql++ mysql++-1_7_35 - - (This assumes that you have your CVSROOT environment variable - set properly.) - - Update the HEAD branch like this: - - $ cd mysql++ - $ cvs update -PdA - $ cvs update -j HEAD -j mysql++-1_7_35 -Pd - $ cvs ci -m "merged 1.7.35 into HEAD" - $ cvs tag mysql++-1_7_35-merged - - Then any changes you make can easily be tracked, and diffs can - be produced with rdiff: - - $ cvs rdiff -ru mysql++-1_7_35 -r mysql++-1_7_35_equal_list \ - $(cat CVS/Repository) > equal_list.patch - - -ON MANIPULATING THE AUTOTOOLS INPUT FILES - - If you are going to hack on the autotools files (*.am, *.in and - everything in the config subdir), run the command: - - $ ./bootstrap [pedantic] [options] - - The primary purpose of this command is to rebuild all the - autotools output files, and to enable "maintainer mode". - In maintainer mode, the build system is set up such that if you - change any of these autotools input files in the future, their - dependents will be re-generated automatically. Occasionally - automake/autoconf gets confused and you have to run it again, - but this is rare. - - If the first argument to the bootstrap script is 'pedantic' - (without the quotes) it will turn on a bunch of GCC-specific - flags which make the compiler much pickier about the source - code it will accept without warnings. It is useful to enable - this mode whenever you are making large changes to the library, - to ensure that you haven't done something silly. We strive to - keep MySQL++ in a state where it never gives compiler warnings - in pedantic mode. We're not 100% there yet with all compilers, - but we're trying... - - Anything after the optional pedantic argument is passed as - arguments to the configure script. See the README file in - this directory for more information about the flags that the - script accepts. - ADDED HACKERS.md Index: HACKERS.md ================================================================== --- /dev/null +++ HACKERS.md @@ -0,0 +1,535 @@ +# Hacking on MySQL++ + +If you are going to make any changes to MySQL++, this file has some +hints and commentary you may find helpful. + + +## Code Repository Access + +MySQL++ uses the [Fossil][fsl] [distributed version control +system][dvcs]. See its [quick start guide][fslq] if you are unfamilar +with Fossil. + +You must be running Fossil version 2.1 or higher to access the MySQL++ +repository. If your operating system includes an older Fossil package, +you will either have to install [an official binary][fslb] or [build +it from source][fsls]. + +To clone the code repository anonymously, say: + + $ fossil clone https://tangentsoft.com/mysqlpp mysqlpp.fossil + +If you have a developer account on the MySQL++ Fossil instance, just add +your username to the URL like so: + + $ fossil clone https://username@tanentsoft.com/mysqlpp mysqlpp.fossil + +That will get you a file called `mysqlpp.fossil` containing the [abridged +version history][avh] of MySQL++ back to the project's founding. + +The repository clone file can be named anything you like. Even the +`.fossil` extension is just a convention, not a requirement. + +To "open" the repo clone so you can hack on it, say: + + $ mkdir mysqlpp + $ cd mysqlpp + $ fossil open ../mysqlpp.fossil + +We created a new subdirectory because the `open` command checks out the +tip of the repository's trunk into the current directory by default. + +As with `mysqlpp.fossil`, you can call the working directory anythihg +you like. I actually prefer a working tree that looks like this: + + ~/museum/ # Where fossils are kept + mysqlpp.fossil + ~/src/ # Working tree for software projects + mysqlpp/ + skull/ # Fossil head, get it? I crack me up. + trunk -> skull/ # Alias to match Fossil branch naming + some-branch/ # Separately-opened working branch + 3.2.3/ # Release branch checkout + +Fossil will let you make any modifications you like to your local +repository copy. For those with privileges on the upstream copy, +checkins get automatically synced with it by default. (If you prefer +Git or Mercurial style two-phase commits, you can say `fossil settings +autosync off`.) If you don't have such permissions, you just modify +your local copy, then have to merge in upstream changes when updating +your local clone. + +Developers are expected to make all changes that affect the libary's +API, ABI, or behavior on a branch, rather than check such changes +directly into the trunk. Once we have discussed the change on the +[mailing list][ml] and resolved any isssues with the experimental +branch, it will be merged into the trunk. + +Creating a branch in Fossil is scary-simple, to the point that those +coming from other version control systems may ask, "Is that really all +there is to it?" Yes, really, this is it: + + $ fossil checkin --branch new-branch-name + +That is to say, you make your changes as you normally would; then when +you go to check them in, you give the `--branch` option to the +`ci/checkin` command to put the changes on a new branch, rather than add +them to the same branch the changes were made against. + +At some point, the trunk version becomes the next major version. Stable +versions become either tags or branches. (The only difference between +tags and branches in Fossil is that branches may have subsequent changes +made to them.) + +[avh]: https://tangentsoft.com/mysqlpp/wiki?name=Abridged+Version+History +[dvcs]: http://en.wikipedia.org/wiki/Distributed_revision_control +[fsl]: http://fossil-scm.org/ +[fslb]: http://fossil-scm.org/index.html/uv/download.html +[fslq]: http://fossil-scm.org/index.html/doc/trunk/www/quickstart.wiki +[fsls]: http://fossil-scm.org/index.html/doc/trunk/www/build.wiki +[ml]: https://lists.mysql.com/plusplus/ + + +## Bootstrapping the Library + +When you check out MySQL++ from Fossil, there are a lot of things +"missing" as compared to a distributed tarball, because the Fossil +repository contains only source files, no generated files. The +process that turns a fresh MySQL++ repository checkout into +something you can build and hack on is called bootstrapping. + +Boostrapping is best done on a modern Unix type platform: Linux, OS +X, BSD, Solaris...any version released since 2005 or so. It's +possible to do it on Windows, but much harder; we cover the options +below in a separate section. + +Two of the tools you need to do this are commonly available on Unixy +systems, at least as an option: Perl 5, and GNU Autoconf 1.59 or higher. +If they're not installed, you can probably run your system's package +manager to install suitable versions. + +There's a third tool you'll need to bootstrap MySQL++, called +Bakefile, which you can get from http://bakefile.org/ You will +need Bakefile 0.2.5 or higher, which in turn requires Python 2.3 +or higher to run. To build Bakefile from source, you will also +need SWIG, so if you don't have that, you'll want to use one of +the binary builds of Bakefile. + +Once you have all the tools in place, you can bootstrap MySQL++ +with a Bourne shell script called bootstrap, which you get as part +of the Fossil checkout. It's fairly powerful, with many options. +For most cases, it suffices to just run it without any arguments: + + $ ./bootstrap + +For more unusual situations, here's the complete usage: + + $ ./bootstrap [no{doc,ex,lib,opt}] [pedantic] [bat] \ + [configure flags] + +Arguments: + +* `nodoc` + + The documentation won't be considered a prerequisite for building + the distribution tarball. This is useful on systems where the + documentation doesn't build correctly, and you only need to make a + binary RPM. That process requires a tarball, but doesn't need the + documentation. Don't distribute the tarball or SRPM that results, as + they are no good for any other purpose. + +* `noex` + + The generated `Makefiles` and project files won't try to build any of + the examples. + +* `nolib` + + The generated `Makefiles` and project files won't try to build the + MySQL++ library. + +* `nomaint` + + Turn off "maintainer mode" stuff in the build. These are features + used only by those building MySQL++ from Fossil. The `dist` build + target uses this when creating the tarball. + +* `noopt` + + Compiler optimization will be turned off. (This currently has no + effect on MinGW or Visual C++.) + +* `pedantic` + + Turns on all of GCC's warnings and portability checks. Good for + checking changes before making a public release. + +* `bat` + + Asks `cmd.exe` to run `bootstrap.bat` for you. This is useful when + using Cygwin just as a command shell in preference to `cmd.exe`, as + opposed to using Cygwin to build MySQL++ using its native tools. + Passing 'bat' stops all command line processing in the bootstrap + script, so if you also pass some of the other options, make "`bat`" + last. The only options that affect the built project files and + `Makefiles` work are the no* ones. + +* `configure` script options + + As soon as the bootstrap script sees an option that it doesn't + understand, it stops processing the command line. Any subsequent + options are passed to the configure script. See README-Unix.txt for + more on configure script options. + + +## Bootstrapping the Library Using Only Windows + +The thing that makes bootstrapping on Windows difficult is that one of +the required steps uses a Unix-centric tool, `autoconf`. This section +is about working out a way to get that working on Windows, or avoiding +the need for it, so you can get on with hacking on MySQL++ on Windows. + +The thing `autoconf` does that's relevant to Windows builds of MySQL++ +is that it substitutes the current MySQL++ version number into several +source files. This allows us to change the version number in just one +place — `configure.ac` — and have it applied to all these other places. +Until you do this step, an Fossil checkout of MySQL++ won't build, +because these files with the version numbers in them won't be generated. + + +### Option 1: Copy the generated files over from a released version + +Only one of these generated files is absolutely critical to allowing +MySQL++ to build: `lib/mysql++.h`. So, the simplest option you have to +bootstrap MySQL++ entirely on Windows is to copy `lib/mysql++.h` over +from a released version of MySQL++. While you're doing that, you might +copy over the other such generated files: + + install.hta + mysql++.spec + doc/userman/userman.dbx + lib/Doxyfile + +Having done that, you can complete the bootstrapping process by running +`bootstrap.bat`. It has the same purpose as the Bourne shell script +described above, but much simpler. It has none of the command line +options described above, for one thing. + +The main downside of doing it this way is that your changed version will +have the same version number as the release of MySQL++ you copied the +files from, unless you go into each file and change the version numbers. + + +### Option 2: Cygwin + +If you'd like to hack on MySQL++ entirely on Windows and have all the +build freedoms enjoyed by those working on Unixy platforms, the simplest +solution is probably to install Cygwin. + +Get [the Cygwin installer](http://cygwin.com/setup-x86_64.exe). (64-bit. +A [32-bit installer](http://cygwin.com/setup-x86.exe) is also +available.) + +When you run it, it will walk you through the steps to install Cygwin. +Autoconf and Perl 5 aren't installed in Cygwin by default, so when you +get to the packages list, be sure to select them. Autoconf is in the +Devel category, and Perl 5 in the Interpreters category. + +You will also need to install the native Windows binary version of +[Bakefile](http://bakefile.org/). Don't get the source version and try +to build Bakefile under Cygwin; it won't work. The Windows binary +version of Bakefile includes an embedded version of Python, so you won't +need to install Cygwin's Python. + +Having done all this, you can follow the Unix bootstrapping +instructions in the previous section. + + +### Option 3: ["Here's a nickel, kid, get yourself a better computer."][dc] + +Finally, you might have access to a Unixy system, or the ability to set +one up. You don't even need a separate physical computer, now that +virtual machine techology is free. + +Given such a machine, you'd do the Fossil checkout of MySQL++ on that +machine, then bootstrap it there using the instructions in the previous +section, and copy the generated files back to the Windows box. + +[dc]: http://tomayko.com/writings/that-dilbert-cartoon + + +## On Manipulating the Build System Source Files + +One of the things the bootstrapping system described above +does is produces various types of project and make files from a +small number of source files. This system lets us support many +platforms without having to maintain separate build system files +for each platform. + +[Bakefile](http://bakefile.org/) produces most of these project and make +files from a single source file called [`mysql++.bkl`][bkl]. + +Except for small local changes, it's best to change `mysql++.bkl` and +"re-bake" the project and make files rather than change those files +directly. You can do this with the bootstrap scripts covered above. On +Windows, if all you've changed is `mysql++.bkl`, you can use +`rebake.bat` instead, which doesn't try to do as much as +`bootstrap.bat`. + +Bakefile produces finished project files for Visual C++ and Xcode and +finished `Makefiles` for MinGW. It also produces `Makefile.in`, which is +input to GNU Autoconf along with configure.ac and `config/*`. You may +need to change these latter files in addition to or instead of +`mysql++.bkl` to get the effect you want. Running bootstrap +incorporates changes to all of these files in the GNU Autoconf output. + +While Bakefile's documentation isn't as comprehensive as it +ought to be, you can at least count on it to list all of the +available features. So, if you can't see a way to make Bakefile +do something, it's likely it just can't do it. Bakefile is a +high-level abstraction of build systems in general, so it'll never +support all the particulars of every odd build system out there. + +[bkl]: https://tangentsoft.com/mysqlpp/file/mysql%2B%2B.bkl + + +## Submitting Patches + +If you wish to submit a patch to the library, please send it to the +[MySQL++ mailing list][ml]. We want patches in unified diff format. + +We will also accept trivial patches not needing discussion as text +in a Fossil ticket. + +The easiest way to get a unified diff is to check out a copy of the +current MySQL++ tree as described above. Then make your change, `cd` +to the MySQL++ root directory, and ask Fossil to generate the patch +for you: + + $ fossil diff > mychange.patch + +If your patch adds new files, moves files, or needs to be understood in +terms of multiple checkins, it's best to do that work on a [local +private branch](#private), then send a [bundle][fb] instead of a patch. + +If you've sent patches to MySQL++ before and don't have a Fossil +developer login, another alternative is to ask for a login before you +begin work so that your changes are automatically sync'd to the main +Fossil repository as you work, so you don't have to send bundles or +patch files. We generally don't refuse such requests if you've already +proven your ability to work well with the MySQL++ project. + +If you're making a patch against a MySQL++ distribution tarball, then +you can generate a patch this way: + + $ diff -ruN mysql++-olddir mysql++-newdir > mychange.patch + +The `diff` command is part of every Unix and Linux system, and should be +installed by default. If you're on a Windows machine, GNU diff is part +of [Cygwin](http://cygwin.com/). Fossil is also available for all of +these systems. There are no excuses for not being able to make unified +diffs. :) + +[fb]: http://fossil-scm.org/index.html/help?cmd=bundle + + +## The MySQL++ Code Style + +Every code base should have a common code style. Love it or +hate it, here are MySQL++'s current code style rules: + + +### Source Code + +File types: `ac`, `cpp`, `h`, `in`, `m4`, `pl` + +- Tabs for indents, size 4 + +- Unix line endings. Any decent programmer's editor can cope with + this, even on Windows. + +- C/C++ rules: + + - Base whitespace style is AT&Tish: K&R/Stroustrup, plus a little + local spice. If you have the indent(1) program, the command is: + + indent -kr -nce -cli4 -ss -di1 -psl -ts4 FILES... + + That is, don't cuddle else, indent case statement labels, space + before semicolon with empty loop body, no extra space between a + variable type and name, return value of function on separate + line from rest of definition. + + - Class names are in `CamelCase`, uppercased first letter + + - Method names are in `all_lower_case_with_underscores()`; + ditto most other global symbols. + + - Macro names are in `ALL_UPPERCASE_WITH_UNDERSCORES` + + - Doxygen comment for all public declarations, unless there is a + very good reason to keep the thing undocumented. + +- Perl and shell script rules are more or less the same as for C/C++, + to the extent this makes sense. + + +### XML/HTML Dialects + +File types: `bkl`, `dbx`, `hta` + +- Spaces for indents, size 2. Shallow indents due to the high level of + nesting occurring in such files, and spaces because they're not as + annoying at shallow indent levels in editors that don't treat space + indents like tabs. + +- Unix line endings. Again, these are intended to be viewed in a + programmer's text editor, which should work with Unix line endings + no matter the platform. + + +### Plain Text Files + +File types: `txt` + +- Spaces for indents, size 4. Spaces because such files are often + viewed in Notepad and similarly crippled text editors which use a + default indent level of 8. + +- DOS line endings, again for the Notepad reason. And on modern Unixy + platforms, the tools cope with DOS line endings reasonably well. + Better than the converse, anyway. + + +When in doubt, mimic what you see in the current code. When still in +doubt, ask on the [mailing list][ml]. + + +## Testing Your Proposed Change + +MySQL++ includes a self-test mechanism called `dtest`. It's a Bourne shell +script, run much like `exrun`: + + $ ./dtest [-s server_addr] [-u user] [-p password] + +This automatically runs most of the examples, captures the outputs to a +file, and then compares that to a known-good run's outputs, stored in +bmark.txt. So, before you submit a patch, run dtest to see if anything +has changed. If something has and you can't account for it, it +represents a problem that you'll have to fix before submitting the +patch. If it gives an expected change, remove bmark.txt, re-run dtest, +and include the bmark.txt diffs in your patch. This communicates to us +the fact that you know there are differences and want the patch +evaluated anyway. Otherwise, we are likely to view the change as a bug. + +`dtest` also runs all of the unit tests in `test/*`. The purpose of +`test/*` is different from that of `examples/*`: + +- `test/*` are unit tests: each tests only one MySQL++ class, + independent of everything else. Because DB access requires + several MySQL++ classes to cooperate, a unit test never accesses + a database; hence, no unit test needs DB connection parameters. + We will never get 100% code coverage from `test/*` alone. + +- `examples/*` can be thought of as integration tests: they test + many pieces of MySQL++ working together, accessing a real + database server. In addition to ensuring that all the pieces + work together and give consistent results from platform to + platform and run to run, it also fills in gaps in the code + coverage where no suitable test/* module could be created. + +- `test/*` programs always run silently on success, writing output + only to indicate test failures. This is because they're usually + only run via dtest. + +- `examples/*` are always "noisy," regardless of whether they + succeed or fail, because they're also run interactively by + people learning to use MySQL++. + +Patches should include tests if they introduce new functionality or fix +a bug that the existing test coverage failed to catch. If the test is +noisy, needs DB access, or tests multiple parts of the library at once, +it goes in `examples/*`. If your change affects only one class in +MySQL++ and testing it can be done without instantiating other MySQL++ +classes -- other than by composition, of course -- it should go in +`test/*`. + +In general, prefer modifying an existing `examples/*` or `test/*` +program. Add a new one only if you're introducing brand new +functionality or when a given feature currently has no test at all. + +Beware that the primary role the examples is to illustrate points in the +user manual. If an existing example does something similar to what a +proper test would need to do and the test doesn't change the nature of +the example, don't worry about changing the example code. If your test +would change the nature of the example, you either need to do the test +another way, or also submit a change to `doc/userman/*.dbx` that +incorporates the difference. + + +## Adding Support for a Different Compiler + +As described above, MySQL++ uses the Bakefile system for creating +project files and makefiles. This allows us to make changes to a single +set of files, and have the proper changes be made to all generated +project files and makefiles. In the past, we used more ad-hoc systems, +and we'd frequently forget to update individual project files and +makefiles, so at any given time, at least one target was likely to be +broken. + +If MySQL++ doesn't currently ship with project files or makefiles tuned +for your compiler of choice, you need to work through the Bakefile +mechanism to add support. We're not willing to do ad-hoc platform +support any more, so please don't ask if you can send us project files +instead; we don't want them. + +If you want to port MySQL++ to another platform, we need to be confident +that the entire library works on your platform before we'll accept +patches. In the past, we've had broken ports that were missing important +library features, or that crashed when built in certain ways. Few people +will knowingly use a crippled version of MySQL++, since there are +usually acceptable alternatives. Therefore, such ports become +maintenance baggage with little compensating value. + + +## Maintaining a Private Repository + +Although Fossil syncs changes back to the `tangentsoft.com/mysqlpp` +Fossil repository by default, it is possible to maintain a private copy +that simply pulls changes in occasionally. + +The first step is to turn off the auto-sync feature: + + $ fossil set autosync 0 + +Then, I recommend that you make any local changes on a branch: + + ...hack, hack, hack... + $ fossil ci --branch my-local-branch + +After you give the `--branch` option on a checkin, Fossil automatically +switches your local checkout to tht branch, so that all further checkins +can be made without the `--branch` option. To get back to the trunk, +you'd say `fossil up trunk`, but under this workflow, the need for that +will be rare. + +When something happens on the official trunk on `tangentsoft.com` that +you want pulled into your private repository, say: + + $ fossil sync + $ fossil merge trunk + +The first command pulls all remote changes into your local clone, but +since those changes don't affect your private branch, you won't see any +immediate change. The second attempts to merge the trunk branch's +changes since the last branch or merge point into your private branch. + +Whether the merge is successful or not, Fossil does not immediately +modify your clone, only the working checkout directory. You must then +say `fossil ci` once you're happy with the merge. Until then, all the +usual Fossil commands like `fossil diff` and `fossil status` will help +you come to that decision. + +If you ever decide to contribute your private branch to the MySQL++ +project, there are a couple of easy ways to achieve that. Ask about it +on the [mailing list][ml] if you find yourself in this situation. ADDED INSTALL.txt Index: INSTALL.txt ================================================================== --- /dev/null +++ INSTALL.txt @@ -0,0 +1,16 @@ +The installation procedure depends on the compiler you use to build +MySQL++ and the OS you build it on. There are platform-specific +instructions for all popular platforms: + + README-Cygwin.txt - for Cygwin + README-Linux.txt - for Linux + README-Mac-OS-X.txt - for Mac OS X + README-MinGW.txt - for MinGW + README-Solaris.txt - for Solaris + README-Visual-C++.txt - for Visual C++ + +If you're on some Unix variant (Linux, OS X, *BSD, Solaris, Cygwin...) +there are additional general instructions in README-Unix.txt. + +See the main README.txt file for high-level instructions that apply +to all platforms MySQL++ works on. DELETED LGPL Index: LGPL ================================================================== --- LGPL +++ /dev/null @@ -1,504 +0,0 @@ - GNU LESSER GENERAL PUBLIC LICENSE - Version 2.1, February 1999 - - Copyright (C) 1991, 1999 Free Software Foundation, Inc. - 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - Everyone is permitted to copy and distribute verbatim copies - of this license document, but changing it is not allowed. - -[This is the first released version of the Lesser GPL. It also counts - as the successor of the GNU Library Public License, version 2, hence - the version number 2.1.] - - Preamble - - The licenses for most software are designed to take away your -freedom to share and change it. By contrast, the GNU General Public -Licenses are intended to guarantee your freedom to share and change -free software--to make sure the software is free for all its users. - - This license, the Lesser General Public License, applies to some -specially designated software packages--typically libraries--of the -Free Software Foundation and other authors who decide to use it. You -can use it too, but we suggest you first think carefully about whether -this license or the ordinary General Public License is the better -strategy to use in any particular case, based on the explanations below. - - When we speak of free software, we are referring to freedom of use, -not price. Our General Public Licenses are designed to make sure that -you have the freedom to distribute copies of free software (and charge -for this service if you wish); that you receive source code or can get -it if you want it; that you can change the software and use pieces of -it in new free programs; and that you are informed that you can do -these things. - - To protect your rights, we need to make restrictions that forbid -distributors to deny you these rights or to ask you to surrender these -rights. These restrictions translate to certain responsibilities for -you if you distribute copies of the library or if you modify it. - - For example, if you distribute copies of the library, whether gratis -or for a fee, you must give the recipients all the rights that we gave -you. You must make sure that they, too, receive or can get the source -code. If you link other code with the library, you must provide -complete object files to the recipients, so that they can relink them -with the library after making changes to the library and recompiling -it. And you must show them these terms so they know their rights. - - We protect your rights with a two-step method: (1) we copyright the -library, and (2) we offer you this license, which gives you legal -permission to copy, distribute and/or modify the library. - - To protect each distributor, we want to make it very clear that -there is no warranty for the free library. Also, if the library is -modified by someone else and passed on, the recipients should know -that what they have is not the original version, so that the original -author's reputation will not be affected by problems that might be -introduced by others. - - Finally, software patents pose a constant threat to the existence of -any free program. We wish to make sure that a company cannot -effectively restrict the users of a free program by obtaining a -restrictive license from a patent holder. Therefore, we insist that -any patent license obtained for a version of the library must be -consistent with the full freedom of use specified in this license. - - Most GNU software, including some libraries, is covered by the -ordinary GNU General Public License. This license, the GNU Lesser -General Public License, applies to certain designated libraries, and -is quite different from the ordinary General Public License. We use -this license for certain libraries in order to permit linking those -libraries into non-free programs. - - When a program is linked with a library, whether statically or using -a shared library, the combination of the two is legally speaking a -combined work, a derivative of the original library. The ordinary -General Public License therefore permits such linking only if the -entire combination fits its criteria of freedom. The Lesser General -Public License permits more lax criteria for linking other code with -the library. - - We call this license the "Lesser" General Public License because it -does Less to protect the user's freedom than the ordinary General -Public License. It also provides other free software developers Less -of an advantage over competing non-free programs. These disadvantages -are the reason we use the ordinary General Public License for many -libraries. However, the Lesser license provides advantages in certain -special circumstances. - - For example, on rare occasions, there may be a special need to -encourage the widest possible use of a certain library, so that it becomes -a de-facto standard. To achieve this, non-free programs must be -allowed to use the library. A more frequent case is that a free -library does the same job as widely used non-free libraries. In this -case, there is little to gain by limiting the free library to free -software only, so we use the Lesser General Public License. - - In other cases, permission to use a particular library in non-free -programs enables a greater number of people to use a large body of -free software. For example, permission to use the GNU C Library in -non-free programs enables many more people to use the whole GNU -operating system, as well as its variant, the GNU/Linux operating -system. - - Although the Lesser General Public License is Less protective of the -users' freedom, it does ensure that the user of a program that is -linked with the Library has the freedom and the wherewithal to run -that program using a modified version of the Library. - - The precise terms and conditions for copying, distribution and -modification follow. Pay close attention to the difference between a -"work based on the library" and a "work that uses the library". The -former contains code derived from the library, whereas the latter must -be combined with the library in order to run. - - GNU LESSER GENERAL PUBLIC LICENSE - TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION - - 0. This License Agreement applies to any software library or other -program which contains a notice placed by the copyright holder or -other authorized party saying it may be distributed under the terms of -this Lesser General Public License (also called "this License"). -Each licensee is addressed as "you". - - A "library" means a collection of software functions and/or data -prepared so as to be conveniently linked with application programs -(which use some of those functions and data) to form executables. - - The "Library", below, refers to any such software library or work -which has been distributed under these terms. A "work based on the -Library" means either the Library or any derivative work under -copyright law: that is to say, a work containing the Library or a -portion of it, either verbatim or with modifications and/or translated -straightforwardly into another language. (Hereinafter, translation is -included without limitation in the term "modification".) - - "Source code" for a work means the preferred form of the work for -making modifications to it. For a library, complete source code means -all the source code for all modules it contains, plus any associated -interface definition files, plus the scripts used to control compilation -and installation of the library. - - Activities other than copying, distribution and modification are not -covered by this License; they are outside its scope. The act of -running a program using the Library is not restricted, and output from -such a program is covered only if its contents constitute a work based -on the Library (independent of the use of the Library in a tool for -writing it). Whether that is true depends on what the Library does -and what the program that uses the Library does. - - 1. You may copy and distribute verbatim copies of the Library's -complete source code as you receive it, in any medium, provided that -you conspicuously and appropriately publish on each copy an -appropriate copyright notice and disclaimer of warranty; keep intact -all the notices that refer to this License and to the absence of any -warranty; and distribute a copy of this License along with the -Library. - - You may charge a fee for the physical act of transferring a copy, -and you may at your option offer warranty protection in exchange for a -fee. - - 2. You may modify your copy or copies of the Library or any portion -of it, thus forming a work based on the Library, and copy and -distribute such modifications or work under the terms of Section 1 -above, provided that you also meet all of these conditions: - - a) The modified work must itself be a software library. - - b) You must cause the files modified to carry prominent notices - stating that you changed the files and the date of any change. - - c) You must cause the whole of the work to be licensed at no - charge to all third parties under the terms of this License. - - d) If a facility in the modified Library refers to a function or a - table of data to be supplied by an application program that uses - the facility, other than as an argument passed when the facility - is invoked, then you must make a good faith effort to ensure that, - in the event an application does not supply such function or - table, the facility still operates, and performs whatever part of - its purpose remains meaningful. - - (For example, a function in a library to compute square roots has - a purpose that is entirely well-defined independent of the - application. Therefore, Subsection 2d requires that any - application-supplied function or table used by this function must - be optional: if the application does not supply it, the square - root function must still compute square roots.) - -These requirements apply to the modified work as a whole. If -identifiable sections of that work are not derived from the Library, -and can be reasonably considered independent and separate works in -themselves, then this License, and its terms, do not apply to those -sections when you distribute them as separate works. But when you -distribute the same sections as part of a whole which is a work based -on the Library, the distribution of the whole must be on the terms of -this License, whose permissions for other licensees extend to the -entire whole, and thus to each and every part regardless of who wrote -it. - -Thus, it is not the intent of this section to claim rights or contest -your rights to work written entirely by you; rather, the intent is to -exercise the right to control the distribution of derivative or -collective works based on the Library. - -In addition, mere aggregation of another work not based on the Library -with the Library (or with a work based on the Library) on a volume of -a storage or distribution medium does not bring the other work under -the scope of this License. - - 3. You may opt to apply the terms of the ordinary GNU General Public -License instead of this License to a given copy of the Library. To do -this, you must alter all the notices that refer to this License, so -that they refer to the ordinary GNU General Public License, version 2, -instead of to this License. (If a newer version than version 2 of the -ordinary GNU General Public License has appeared, then you can specify -that version instead if you wish.) Do not make any other change in -these notices. - - Once this change is made in a given copy, it is irreversible for -that copy, so the ordinary GNU General Public License applies to all -subsequent copies and derivative works made from that copy. - - This option is useful when you wish to copy part of the code of -the Library into a program that is not a library. - - 4. You may copy and distribute the Library (or a portion or -derivative of it, under Section 2) in object code or executable form -under the terms of Sections 1 and 2 above provided that you accompany -it with the complete corresponding machine-readable source code, which -must be distributed under the terms of Sections 1 and 2 above on a -medium customarily used for software interchange. - - If distribution of object code is made by offering access to copy -from a designated place, then offering equivalent access to copy the -source code from the same place satisfies the requirement to -distribute the source code, even though third parties are not -compelled to copy the source along with the object code. - - 5. A program that contains no derivative of any portion of the -Library, but is designed to work with the Library by being compiled or -linked with it, is called a "work that uses the Library". Such a -work, in isolation, is not a derivative work of the Library, and -therefore falls outside the scope of this License. - - However, linking a "work that uses the Library" with the Library -creates an executable that is a derivative of the Library (because it -contains portions of the Library), rather than a "work that uses the -library". The executable is therefore covered by this License. -Section 6 states terms for distribution of such executables. - - When a "work that uses the Library" uses material from a header file -that is part of the Library, the object code for the work may be a -derivative work of the Library even though the source code is not. -Whether this is true is especially significant if the work can be -linked without the Library, or if the work is itself a library. The -threshold for this to be true is not precisely defined by law. - - If such an object file uses only numerical parameters, data -structure layouts and accessors, and small macros and small inline -functions (ten lines or less in length), then the use of the object -file is unrestricted, regardless of whether it is legally a derivative -work. (Executables containing this object code plus portions of the -Library will still fall under Section 6.) - - Otherwise, if the work is a derivative of the Library, you may -distribute the object code for the work under the terms of Section 6. -Any executables containing that work also fall under Section 6, -whether or not they are linked directly with the Library itself. - - 6. As an exception to the Sections above, you may also combine or -link a "work that uses the Library" with the Library to produce a -work containing portions of the Library, and distribute that work -under terms of your choice, provided that the terms permit -modification of the work for the customer's own use and reverse -engineering for debugging such modifications. - - You must give prominent notice with each copy of the work that the -Library is used in it and that the Library and its use are covered by -this License. You must supply a copy of this License. If the work -during execution displays copyright notices, you must include the -copyright notice for the Library among them, as well as a reference -directing the user to the copy of this License. Also, you must do one -of these things: - - a) Accompany the work with the complete corresponding - machine-readable source code for the Library including whatever - changes were used in the work (which must be distributed under - Sections 1 and 2 above); and, if the work is an executable linked - with the Library, with the complete machine-readable "work that - uses the Library", as object code and/or source code, so that the - user can modify the Library and then relink to produce a modified - executable containing the modified Library. (It is understood - that the user who changes the contents of definitions files in the - Library will not necessarily be able to recompile the application - to use the modified definitions.) - - b) Use a suitable shared library mechanism for linking with the - Library. A suitable mechanism is one that (1) uses at run time a - copy of the library already present on the user's computer system, - rather than copying library functions into the executable, and (2) - will operate properly with a modified version of the library, if - the user installs one, as long as the modified version is - interface-compatible with the version that the work was made with. - - c) Accompany the work with a written offer, valid for at - least three years, to give the same user the materials - specified in Subsection 6a, above, for a charge no more - than the cost of performing this distribution. - - d) If distribution of the work is made by offering access to copy - from a designated place, offer equivalent access to copy the above - specified materials from the same place. - - e) Verify that the user has already received a copy of these - materials or that you have already sent this user a copy. - - For an executable, the required form of the "work that uses the -Library" must include any data and utility programs needed for -reproducing the executable from it. However, as a special exception, -the materials to be distributed need not include anything that is -normally distributed (in either source or binary form) with the major -components (compiler, kernel, and so on) of the operating system on -which the executable runs, unless that component itself accompanies -the executable. - - It may happen that this requirement contradicts the license -restrictions of other proprietary libraries that do not normally -accompany the operating system. Such a contradiction means you cannot -use both them and the Library together in an executable that you -distribute. - - 7. You may place library facilities that are a work based on the -Library side-by-side in a single library together with other library -facilities not covered by this License, and distribute such a combined -library, provided that the separate distribution of the work based on -the Library and of the other library facilities is otherwise -permitted, and provided that you do these two things: - - a) Accompany the combined library with a copy of the same work - based on the Library, uncombined with any other library - facilities. This must be distributed under the terms of the - Sections above. - - b) Give prominent notice with the combined library of the fact - that part of it is a work based on the Library, and explaining - where to find the accompanying uncombined form of the same work. - - 8. You may not copy, modify, sublicense, link with, or distribute -the Library except as expressly provided under this License. Any -attempt otherwise to copy, modify, sublicense, link with, or -distribute the Library is void, and will automatically terminate your -rights under this License. However, parties who have received copies, -or rights, from you under this License will not have their licenses -terminated so long as such parties remain in full compliance. - - 9. You are not required to accept this License, since you have not -signed it. However, nothing else grants you permission to modify or -distribute the Library or its derivative works. These actions are -prohibited by law if you do not accept this License. Therefore, by -modifying or distributing the Library (or any work based on the -Library), you indicate your acceptance of this License to do so, and -all its terms and conditions for copying, distributing or modifying -the Library or works based on it. - - 10. Each time you redistribute the Library (or any work based on the -Library), the recipient automatically receives a license from the -original licensor to copy, distribute, link with or modify the Library -subject to these terms and conditions. You may not impose any further -restrictions on the recipients' exercise of the rights granted herein. -You are not responsible for enforcing compliance by third parties with -this License. - - 11. If, as a consequence of a court judgment or allegation of patent -infringement or for any other reason (not limited to patent issues), -conditions are imposed on you (whether by court order, agreement or -otherwise) that contradict the conditions of this License, they do not -excuse you from the conditions of this License. If you cannot -distribute so as to satisfy simultaneously your obligations under this -License and any other pertinent obligations, then as a consequence you -may not distribute the Library at all. For example, if a patent -license would not permit royalty-free redistribution of the Library by -all those who receive copies directly or indirectly through you, then -the only way you could satisfy both it and this License would be to -refrain entirely from distribution of the Library. - -If any portion of this section is held invalid or unenforceable under any -particular circumstance, the balance of the section is intended to apply, -and the section as a whole is intended to apply in other circumstances. - -It is not the purpose of this section to induce you to infringe any -patents or other property right claims or to contest validity of any -such claims; this section has the sole purpose of protecting the -integrity of the free software distribution system which is -implemented by public license practices. Many people have made -generous contributions to the wide range of software distributed -through that system in reliance on consistent application of that -system; it is up to the author/donor to decide if he or she is willing -to distribute software through any other system and a licensee cannot -impose that choice. - -This section is intended to make thoroughly clear what is believed to -be a consequence of the rest of this License. - - 12. If the distribution and/or use of the Library is restricted in -certain countries either by patents or by copyrighted interfaces, the -original copyright holder who places the Library under this License may add -an explicit geographical distribution limitation excluding those countries, -so that distribution is permitted only in or among countries not thus -excluded. In such case, this License incorporates the limitation as if -written in the body of this License. - - 13. The Free Software Foundation may publish revised and/or new -versions of the Lesser General Public License from time to time. -Such new versions will be similar in spirit to the present version, -but may differ in detail to address new problems or concerns. - -Each version is given a distinguishing version number. If the Library -specifies a version number of this License which applies to it and -"any later version", you have the option of following the terms and -conditions either of that version or of any later version published by -the Free Software Foundation. If the Library does not specify a -license version number, you may choose any version ever published by -the Free Software Foundation. - - 14. If you wish to incorporate parts of the Library into other free -programs whose distribution conditions are incompatible with these, -write to the author to ask for permission. For software which is -copyrighted by the Free Software Foundation, write to the Free -Software Foundation; we sometimes make exceptions for this. Our -decision will be guided by the two goals of preserving the free status -of all derivatives of our free software and of promoting the sharing -and reuse of software generally. - - NO WARRANTY - - 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO -WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. -EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR -OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY -KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE -LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME -THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. - - 16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN -WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY -AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU -FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR -CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE -LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING -RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A -FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF -SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH -DAMAGES. - - END OF TERMS AND CONDITIONS - - How to Apply These Terms to Your New Libraries - - If you develop a new library, and you want it to be of the greatest -possible use to the public, we recommend making it free software that -everyone can redistribute and change. You can do so by permitting -redistribution under these terms (or, alternatively, under the terms of the -ordinary General Public License). - - To apply these terms, attach the following notices to the library. It is -safest to attach them to the start of each source file to most effectively -convey the exclusion of warranty; and each file should have at least the -"copyright" line and a pointer to where the full notice is found. - - - Copyright (C) - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - -Also add information on how to contact you by electronic and paper mail. - -You should also get your employer (if you work as a programmer) or your -school, if any, to sign a "copyright disclaimer" for the library, if -necessary. Here is a sample; alter the names: - - Yoyodyne, Inc., hereby disclaims all copyright interest in the - library `Frob' (a library for tweaking knobs) written by James Random Hacker. - - , 1 April 1990 - Ty Coon, President of Vice - -That's all there is to it! - - ADDED LICENSE.txt Index: LICENSE.txt ================================================================== --- /dev/null +++ LICENSE.txt @@ -0,0 +1,504 @@ + GNU LESSER GENERAL PUBLIC LICENSE + Version 2.1, February 1999 + + Copyright (C) 1991, 1999 Free Software Foundation, Inc. + 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + +[This is the first released version of the Lesser GPL. It also counts + as the successor of the GNU Library Public License, version 2, hence + the version number 2.1.] + + Preamble + + The licenses for most software are designed to take away your +freedom to share and change it. By contrast, the GNU General Public +Licenses are intended to guarantee your freedom to share and change +free software--to make sure the software is free for all its users. + + This license, the Lesser General Public License, applies to some +specially designated software packages--typically libraries--of the +Free Software Foundation and other authors who decide to use it. You +can use it too, but we suggest you first think carefully about whether +this license or the ordinary General Public License is the better +strategy to use in any particular case, based on the explanations below. + + When we speak of free software, we are referring to freedom of use, +not price. Our General Public Licenses are designed to make sure that +you have the freedom to distribute copies of free software (and charge +for this service if you wish); that you receive source code or can get +it if you want it; that you can change the software and use pieces of +it in new free programs; and that you are informed that you can do +these things. + + To protect your rights, we need to make restrictions that forbid +distributors to deny you these rights or to ask you to surrender these +rights. These restrictions translate to certain responsibilities for +you if you distribute copies of the library or if you modify it. + + For example, if you distribute copies of the library, whether gratis +or for a fee, you must give the recipients all the rights that we gave +you. You must make sure that they, too, receive or can get the source +code. If you link other code with the library, you must provide +complete object files to the recipients, so that they can relink them +with the library after making changes to the library and recompiling +it. And you must show them these terms so they know their rights. + + We protect your rights with a two-step method: (1) we copyright the +library, and (2) we offer you this license, which gives you legal +permission to copy, distribute and/or modify the library. + + To protect each distributor, we want to make it very clear that +there is no warranty for the free library. Also, if the library is +modified by someone else and passed on, the recipients should know +that what they have is not the original version, so that the original +author's reputation will not be affected by problems that might be +introduced by others. + + Finally, software patents pose a constant threat to the existence of +any free program. We wish to make sure that a company cannot +effectively restrict the users of a free program by obtaining a +restrictive license from a patent holder. Therefore, we insist that +any patent license obtained for a version of the library must be +consistent with the full freedom of use specified in this license. + + Most GNU software, including some libraries, is covered by the +ordinary GNU General Public License. This license, the GNU Lesser +General Public License, applies to certain designated libraries, and +is quite different from the ordinary General Public License. We use +this license for certain libraries in order to permit linking those +libraries into non-free programs. + + When a program is linked with a library, whether statically or using +a shared library, the combination of the two is legally speaking a +combined work, a derivative of the original library. The ordinary +General Public License therefore permits such linking only if the +entire combination fits its criteria of freedom. The Lesser General +Public License permits more lax criteria for linking other code with +the library. + + We call this license the "Lesser" General Public License because it +does Less to protect the user's freedom than the ordinary General +Public License. It also provides other free software developers Less +of an advantage over competing non-free programs. These disadvantages +are the reason we use the ordinary General Public License for many +libraries. However, the Lesser license provides advantages in certain +special circumstances. + + For example, on rare occasions, there may be a special need to +encourage the widest possible use of a certain library, so that it becomes +a de-facto standard. To achieve this, non-free programs must be +allowed to use the library. A more frequent case is that a free +library does the same job as widely used non-free libraries. In this +case, there is little to gain by limiting the free library to free +software only, so we use the Lesser General Public License. + + In other cases, permission to use a particular library in non-free +programs enables a greater number of people to use a large body of +free software. For example, permission to use the GNU C Library in +non-free programs enables many more people to use the whole GNU +operating system, as well as its variant, the GNU/Linux operating +system. + + Although the Lesser General Public License is Less protective of the +users' freedom, it does ensure that the user of a program that is +linked with the Library has the freedom and the wherewithal to run +that program using a modified version of the Library. + + The precise terms and conditions for copying, distribution and +modification follow. Pay close attention to the difference between a +"work based on the library" and a "work that uses the library". The +former contains code derived from the library, whereas the latter must +be combined with the library in order to run. + + GNU LESSER GENERAL PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. This License Agreement applies to any software library or other +program which contains a notice placed by the copyright holder or +other authorized party saying it may be distributed under the terms of +this Lesser General Public License (also called "this License"). +Each licensee is addressed as "you". + + A "library" means a collection of software functions and/or data +prepared so as to be conveniently linked with application programs +(which use some of those functions and data) to form executables. + + The "Library", below, refers to any such software library or work +which has been distributed under these terms. A "work based on the +Library" means either the Library or any derivative work under +copyright law: that is to say, a work containing the Library or a +portion of it, either verbatim or with modifications and/or translated +straightforwardly into another language. (Hereinafter, translation is +included without limitation in the term "modification".) + + "Source code" for a work means the preferred form of the work for +making modifications to it. For a library, complete source code means +all the source code for all modules it contains, plus any associated +interface definition files, plus the scripts used to control compilation +and installation of the library. + + Activities other than copying, distribution and modification are not +covered by this License; they are outside its scope. The act of +running a program using the Library is not restricted, and output from +such a program is covered only if its contents constitute a work based +on the Library (independent of the use of the Library in a tool for +writing it). Whether that is true depends on what the Library does +and what the program that uses the Library does. + + 1. You may copy and distribute verbatim copies of the Library's +complete source code as you receive it, in any medium, provided that +you conspicuously and appropriately publish on each copy an +appropriate copyright notice and disclaimer of warranty; keep intact +all the notices that refer to this License and to the absence of any +warranty; and distribute a copy of this License along with the +Library. + + You may charge a fee for the physical act of transferring a copy, +and you may at your option offer warranty protection in exchange for a +fee. + + 2. You may modify your copy or copies of the Library or any portion +of it, thus forming a work based on the Library, and copy and +distribute such modifications or work under the terms of Section 1 +above, provided that you also meet all of these conditions: + + a) The modified work must itself be a software library. + + b) You must cause the files modified to carry prominent notices + stating that you changed the files and the date of any change. + + c) You must cause the whole of the work to be licensed at no + charge to all third parties under the terms of this License. + + d) If a facility in the modified Library refers to a function or a + table of data to be supplied by an application program that uses + the facility, other than as an argument passed when the facility + is invoked, then you must make a good faith effort to ensure that, + in the event an application does not supply such function or + table, the facility still operates, and performs whatever part of + its purpose remains meaningful. + + (For example, a function in a library to compute square roots has + a purpose that is entirely well-defined independent of the + application. Therefore, Subsection 2d requires that any + application-supplied function or table used by this function must + be optional: if the application does not supply it, the square + root function must still compute square roots.) + +These requirements apply to the modified work as a whole. If +identifiable sections of that work are not derived from the Library, +and can be reasonably considered independent and separate works in +themselves, then this License, and its terms, do not apply to those +sections when you distribute them as separate works. But when you +distribute the same sections as part of a whole which is a work based +on the Library, the distribution of the whole must be on the terms of +this License, whose permissions for other licensees extend to the +entire whole, and thus to each and every part regardless of who wrote +it. + +Thus, it is not the intent of this section to claim rights or contest +your rights to work written entirely by you; rather, the intent is to +exercise the right to control the distribution of derivative or +collective works based on the Library. + +In addition, mere aggregation of another work not based on the Library +with the Library (or with a work based on the Library) on a volume of +a storage or distribution medium does not bring the other work under +the scope of this License. + + 3. You may opt to apply the terms of the ordinary GNU General Public +License instead of this License to a given copy of the Library. To do +this, you must alter all the notices that refer to this License, so +that they refer to the ordinary GNU General Public License, version 2, +instead of to this License. (If a newer version than version 2 of the +ordinary GNU General Public License has appeared, then you can specify +that version instead if you wish.) Do not make any other change in +these notices. + + Once this change is made in a given copy, it is irreversible for +that copy, so the ordinary GNU General Public License applies to all +subsequent copies and derivative works made from that copy. + + This option is useful when you wish to copy part of the code of +the Library into a program that is not a library. + + 4. You may copy and distribute the Library (or a portion or +derivative of it, under Section 2) in object code or executable form +under the terms of Sections 1 and 2 above provided that you accompany +it with the complete corresponding machine-readable source code, which +must be distributed under the terms of Sections 1 and 2 above on a +medium customarily used for software interchange. + + If distribution of object code is made by offering access to copy +from a designated place, then offering equivalent access to copy the +source code from the same place satisfies the requirement to +distribute the source code, even though third parties are not +compelled to copy the source along with the object code. + + 5. A program that contains no derivative of any portion of the +Library, but is designed to work with the Library by being compiled or +linked with it, is called a "work that uses the Library". Such a +work, in isolation, is not a derivative work of the Library, and +therefore falls outside the scope of this License. + + However, linking a "work that uses the Library" with the Library +creates an executable that is a derivative of the Library (because it +contains portions of the Library), rather than a "work that uses the +library". The executable is therefore covered by this License. +Section 6 states terms for distribution of such executables. + + When a "work that uses the Library" uses material from a header file +that is part of the Library, the object code for the work may be a +derivative work of the Library even though the source code is not. +Whether this is true is especially significant if the work can be +linked without the Library, or if the work is itself a library. The +threshold for this to be true is not precisely defined by law. + + If such an object file uses only numerical parameters, data +structure layouts and accessors, and small macros and small inline +functions (ten lines or less in length), then the use of the object +file is unrestricted, regardless of whether it is legally a derivative +work. (Executables containing this object code plus portions of the +Library will still fall under Section 6.) + + Otherwise, if the work is a derivative of the Library, you may +distribute the object code for the work under the terms of Section 6. +Any executables containing that work also fall under Section 6, +whether or not they are linked directly with the Library itself. + + 6. As an exception to the Sections above, you may also combine or +link a "work that uses the Library" with the Library to produce a +work containing portions of the Library, and distribute that work +under terms of your choice, provided that the terms permit +modification of the work for the customer's own use and reverse +engineering for debugging such modifications. + + You must give prominent notice with each copy of the work that the +Library is used in it and that the Library and its use are covered by +this License. You must supply a copy of this License. If the work +during execution displays copyright notices, you must include the +copyright notice for the Library among them, as well as a reference +directing the user to the copy of this License. Also, you must do one +of these things: + + a) Accompany the work with the complete corresponding + machine-readable source code for the Library including whatever + changes were used in the work (which must be distributed under + Sections 1 and 2 above); and, if the work is an executable linked + with the Library, with the complete machine-readable "work that + uses the Library", as object code and/or source code, so that the + user can modify the Library and then relink to produce a modified + executable containing the modified Library. (It is understood + that the user who changes the contents of definitions files in the + Library will not necessarily be able to recompile the application + to use the modified definitions.) + + b) Use a suitable shared library mechanism for linking with the + Library. A suitable mechanism is one that (1) uses at run time a + copy of the library already present on the user's computer system, + rather than copying library functions into the executable, and (2) + will operate properly with a modified version of the library, if + the user installs one, as long as the modified version is + interface-compatible with the version that the work was made with. + + c) Accompany the work with a written offer, valid for at + least three years, to give the same user the materials + specified in Subsection 6a, above, for a charge no more + than the cost of performing this distribution. + + d) If distribution of the work is made by offering access to copy + from a designated place, offer equivalent access to copy the above + specified materials from the same place. + + e) Verify that the user has already received a copy of these + materials or that you have already sent this user a copy. + + For an executable, the required form of the "work that uses the +Library" must include any data and utility programs needed for +reproducing the executable from it. However, as a special exception, +the materials to be distributed need not include anything that is +normally distributed (in either source or binary form) with the major +components (compiler, kernel, and so on) of the operating system on +which the executable runs, unless that component itself accompanies +the executable. + + It may happen that this requirement contradicts the license +restrictions of other proprietary libraries that do not normally +accompany the operating system. Such a contradiction means you cannot +use both them and the Library together in an executable that you +distribute. + + 7. You may place library facilities that are a work based on the +Library side-by-side in a single library together with other library +facilities not covered by this License, and distribute such a combined +library, provided that the separate distribution of the work based on +the Library and of the other library facilities is otherwise +permitted, and provided that you do these two things: + + a) Accompany the combined library with a copy of the same work + based on the Library, uncombined with any other library + facilities. This must be distributed under the terms of the + Sections above. + + b) Give prominent notice with the combined library of the fact + that part of it is a work based on the Library, and explaining + where to find the accompanying uncombined form of the same work. + + 8. You may not copy, modify, sublicense, link with, or distribute +the Library except as expressly provided under this License. Any +attempt otherwise to copy, modify, sublicense, link with, or +distribute the Library is void, and will automatically terminate your +rights under this License. However, parties who have received copies, +or rights, from you under this License will not have their licenses +terminated so long as such parties remain in full compliance. + + 9. You are not required to accept this License, since you have not +signed it. However, nothing else grants you permission to modify or +distribute the Library or its derivative works. These actions are +prohibited by law if you do not accept this License. Therefore, by +modifying or distributing the Library (or any work based on the +Library), you indicate your acceptance of this License to do so, and +all its terms and conditions for copying, distributing or modifying +the Library or works based on it. + + 10. Each time you redistribute the Library (or any work based on the +Library), the recipient automatically receives a license from the +original licensor to copy, distribute, link with or modify the Library +subject to these terms and conditions. You may not impose any further +restrictions on the recipients' exercise of the rights granted herein. +You are not responsible for enforcing compliance by third parties with +this License. + + 11. If, as a consequence of a court judgment or allegation of patent +infringement or for any other reason (not limited to patent issues), +conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot +distribute so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you +may not distribute the Library at all. For example, if a patent +license would not permit royalty-free redistribution of the Library by +all those who receive copies directly or indirectly through you, then +the only way you could satisfy both it and this License would be to +refrain entirely from distribution of the Library. + +If any portion of this section is held invalid or unenforceable under any +particular circumstance, the balance of the section is intended to apply, +and the section as a whole is intended to apply in other circumstances. + +It is not the purpose of this section to induce you to infringe any +patents or other property right claims or to contest validity of any +such claims; this section has the sole purpose of protecting the +integrity of the free software distribution system which is +implemented by public license practices. Many people have made +generous contributions to the wide range of software distributed +through that system in reliance on consistent application of that +system; it is up to the author/donor to decide if he or she is willing +to distribute software through any other system and a licensee cannot +impose that choice. + +This section is intended to make thoroughly clear what is believed to +be a consequence of the rest of this License. + + 12. If the distribution and/or use of the Library is restricted in +certain countries either by patents or by copyrighted interfaces, the +original copyright holder who places the Library under this License may add +an explicit geographical distribution limitation excluding those countries, +so that distribution is permitted only in or among countries not thus +excluded. In such case, this License incorporates the limitation as if +written in the body of this License. + + 13. The Free Software Foundation may publish revised and/or new +versions of the Lesser General Public License from time to time. +Such new versions will be similar in spirit to the present version, +but may differ in detail to address new problems or concerns. + +Each version is given a distinguishing version number. If the Library +specifies a version number of this License which applies to it and +"any later version", you have the option of following the terms and +conditions either of that version or of any later version published by +the Free Software Foundation. If the Library does not specify a +license version number, you may choose any version ever published by +the Free Software Foundation. + + 14. If you wish to incorporate parts of the Library into other free +programs whose distribution conditions are incompatible with these, +write to the author to ask for permission. For software which is +copyrighted by the Free Software Foundation, write to the Free +Software Foundation; we sometimes make exceptions for this. Our +decision will be guided by the two goals of preserving the free status +of all derivatives of our free software and of promoting the sharing +and reuse of software generally. + + NO WARRANTY + + 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO +WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. +EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR +OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY +KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE +LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME +THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. + + 16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN +WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY +AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU +FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR +CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE +LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING +RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A +FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF +SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH +DAMAGES. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Libraries + + If you develop a new library, and you want it to be of the greatest +possible use to the public, we recommend making it free software that +everyone can redistribute and change. You can do so by permitting +redistribution under these terms (or, alternatively, under the terms of the +ordinary General Public License). + + To apply these terms, attach the following notices to the library. It is +safest to attach them to the start of each source file to most effectively +convey the exclusion of warranty; and each file should have at least the +"copyright" line and a pointer to where the full notice is found. + + + Copyright (C) + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +Also add information on how to contact you by electronic and paper mail. + +You should also get your employer (if you work as a programmer) or your +school, if any, to sign a "copyright disclaimer" for the library, if +necessary. Here is a sample; alter the names: + + Yoyodyne, Inc., hereby disclaims all copyright interest in the + library `Frob' (a library for tweaking knobs) written by James Random Hacker. + + , 1 April 1990 + Ty Coon, President of Vice + +That's all there is to it! + + DELETED Makefile.am Index: Makefile.am ================================================================== --- Makefile.am +++ /dev/null @@ -1,86 +0,0 @@ -# This file is free software; you can redistribute it and/or modify it -# under the terms of the GNU Lesser General Public License as published -# by the Free Software Foundation; either version 2.1 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, but -# WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -# Lesser General Public License for more details. -# -# You should have received a copy of the GNU Lesser General Public -# License along with MySQL++; if not, write to the Free Software -# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 -# USA - -EXTRA_DIST = \ - CREDITS \ - HACKERS \ - LGPL \ - README.* \ - Wishlist \ - bootstrap \ - common.am \ - config/*.m4 \ - doc/mysqlpp-refman.pdf \ - doc/mysqlpp-userman.pdf \ - doc/README* \ - doc/ssqls-pretty \ - doc/refman/html/*.css \ - doc/refman/html/*.html \ - doc/refman/html/*.png \ - doc/userman/*.xml \ - doc/userman/*.xsl \ - doc/userman/mktxt \ - doc/userman/html/*.css \ - doc/userman/html/*.html \ - doc/userman/Makefile \ - doc/userman/README \ - makemake.* \ - *.ebuild \ - *.spec - -#SUBDIRS = lib examples doc -SUBDIRS = lib @OPTIONAL_EXAMPLES@ - -# Override default aclocal command, to force it to look in config subdir -# for *.m4 macros when automatically rebuilding configure script when -# configure.in file changes. -ACLOCAL=aclocal -I config - - -rpm-setup: dist - cp $(distdir).tar.gz /usr/src/redhat/SOURCES - cp mysql++.spec /usr/src/redhat/SPECS - -rpm: rpm-setup - ( cd /usr/src/redhat/SPECS ; rpmbuild -bb mysql++.spec ) - -srpm: rpm-setup - ( cd /usr/src/redhat/SPECS ; rpmbuild -bs mysql++.spec ) - -ebuild: dist - cp $(distdir).tar.gz /usr/portage/distfiles - cp mysql++.ebuild /usr/portage/dev-db/mysql++/$(distdir).ebuild - ebuild /usr/portage/dev-db/mysql++/$(distdir).ebuild digest - -docs: doc/mysqlpp-refman.pdf doc/mysqlpp-userman.pdf - - -doc/mysqlpp-refman.pdf: lib/*.h - ( cd lib ; make refman ) - -doc/mysqlpp-userman.pdf: doc/userman/userman.xml - ( cd doc/userman ; make && make pdf ) - -tags: ctags - -ctags: - find . -name TAGS -o -name tags -exec rm {} \; - ctags `pwd`/*/*.cpp `pwd`/*/*.h - find . -type d -mindepth 1 -exec ln tags {} \; - -clean-local: - ( cd lib ; make clean-docs ) - ( cd doc/userman ; make clean ) - find . -name tags -exec rm {} \; ADDED Makefile.mingw Index: Makefile.mingw ================================================================== --- /dev/null +++ Makefile.mingw @@ -0,0 +1,724 @@ +# ========================================================================= +# This makefile was generated by +# Bakefile 0.2.9 (http://www.bakefile.org) +# Do not modify, all changes will be overwritten! +# ========================================================================= + + + +# ------------------------------------------------------------------------- +# These are configurable options: +# ------------------------------------------------------------------------- + +# Compiler flags to link shared library +LINK_DLL_FLAGS ?= -shared + +# C++ compiler +CXX = g++ + +# Standard flags for C++ +CXXFLAGS ?= + +# Standard preprocessor flags (common for CC and CXX) +CPPFLAGS ?= + +# Standard linker flags +LDFLAGS ?= + +# Type of compiled binaries [debug,release] +BUILD ?= debug + + + +# ------------------------------------------------------------------------- +# Do not modify the rest of this file! +# ------------------------------------------------------------------------- + +### Variables: ### + +CPPDEPS = -MT$@ -MF$@.d -MD -MP +MYSQLPP_CXXFLAGS = $(__DEBUGINFO) $(__OPTIMIZE_FLAG) -mthreads -DUNICODE \ + -D_UNICODE -DMYSQLPP_NO_DLL -DHAVE_MYSQL_SSL_SET -I"C:\Program \ + Files\MySQL\MySQL Connector C 6.1\include" $(CPPFLAGS) $(CXXFLAGS) +MYSQLPP_OBJECTS = \ + mysqlpp_beemutex.o \ + mysqlpp_cmdline.o \ + mysqlpp_connection.o \ + mysqlpp_cpool.o \ + mysqlpp_datetime.o \ + mysqlpp_dbdriver.o \ + mysqlpp_field_names.o \ + mysqlpp_field_types.o \ + mysqlpp_manip.o \ + mysqlpp_myset.o \ + mysqlpp_mysql++.o \ + mysqlpp_mystring.o \ + mysqlpp_null.o \ + mysqlpp_options.o \ + mysqlpp_qparms.o \ + mysqlpp_query.o \ + mysqlpp_result.o \ + mysqlpp_row.o \ + mysqlpp_scopedconnection.o \ + mysqlpp_sql_buffer.o \ + mysqlpp_sqlstream.o \ + mysqlpp_ssqls2.o \ + mysqlpp_stadapter.o \ + mysqlpp_tcp_connection.o \ + mysqlpp_transaction.o \ + mysqlpp_type_info.o \ + mysqlpp_uds_connection.o \ + mysqlpp_utility.o \ + mysqlpp_vallist.o \ + mysqlpp_wnp_connection.o +SSQLS2PARSE_CXXFLAGS = -mthreads $(__DEBUGINFO) $(__OPTIMIZE_FLAG) -Ilib \ + -I@MYSQL_C_INC_DIR@ -DUNICODE -D_UNICODE -DMYSQLPP_NO_DLL -I"C:\Program \ + Files\MySQL\MySQL Connector C 6.1\include" -I. $(CPPFLAGS) $(CXXFLAGS) +SSQLS2PARSE_OBJECTS = \ + ssqls2parse_parsev2.o +SSQLSXLAT_CXXFLAGS = -mthreads $(__DEBUGINFO) $(__OPTIMIZE_FLAG) -Ilib \ + -I@MYSQL_C_INC_DIR@ -DUNICODE -D_UNICODE -DMYSQLPP_NO_DLL -I"C:\Program \ + Files\MySQL\MySQL Connector C 6.1\include" $(CPPFLAGS) $(CXXFLAGS) +SSQLSXLAT_OBJECTS = \ + ssqlsxlat_genv2.o \ + ssqlsxlat_main.o +TEST_ARRAY_INDEX_CXXFLAGS = -mthreads $(__DEBUGINFO) $(__OPTIMIZE_FLAG) -Ilib \ + -I@MYSQL_C_INC_DIR@ -DUNICODE -D_UNICODE -DMYSQLPP_NO_DLL -I"C:\Program \ + Files\MySQL\MySQL Connector C 6.1\include" $(CPPFLAGS) $(CXXFLAGS) +TEST_ARRAY_INDEX_OBJECTS = \ + test_array_index_array_index.o +TEST_CPOOL_CXXFLAGS = -mthreads $(__DEBUGINFO) $(__OPTIMIZE_FLAG) -Ilib \ + -I@MYSQL_C_INC_DIR@ -DUNICODE -D_UNICODE -DMYSQLPP_NO_DLL -I"C:\Program \ + Files\MySQL\MySQL Connector C 6.1\include" $(CPPFLAGS) $(CXXFLAGS) +TEST_CPOOL_OBJECTS = \ + test_cpool_cpool.o +TEST_DATETIME_CXXFLAGS = -mthreads $(__DEBUGINFO) $(__OPTIMIZE_FLAG) -Ilib \ + -I@MYSQL_C_INC_DIR@ -DUNICODE -D_UNICODE -DMYSQLPP_NO_DLL -I"C:\Program \ + Files\MySQL\MySQL Connector C 6.1\include" $(CPPFLAGS) $(CXXFLAGS) +TEST_DATETIME_OBJECTS = \ + test_datetime_datetime.o +TEST_INTTYPES_CXXFLAGS = -mthreads $(__DEBUGINFO) $(__OPTIMIZE_FLAG) -Ilib \ + -I@MYSQL_C_INC_DIR@ -DUNICODE -D_UNICODE -DMYSQLPP_NO_DLL -I"C:\Program \ + Files\MySQL\MySQL Connector C 6.1\include" $(CPPFLAGS) $(CXXFLAGS) +TEST_INTTYPES_OBJECTS = \ + test_inttypes_inttypes.o +TEST_INSERTPOLICY_CXXFLAGS = -mthreads $(__DEBUGINFO) $(__OPTIMIZE_FLAG) -Ilib \ + -I@MYSQL_C_INC_DIR@ -DUNICODE -D_UNICODE -DMYSQLPP_NO_DLL -I"C:\Program \ + Files\MySQL\MySQL Connector C 6.1\include" $(CPPFLAGS) $(CXXFLAGS) +TEST_INSERTPOLICY_OBJECTS = \ + test_insertpolicy_insertpolicy.o +TEST_MANIP_CXXFLAGS = -mthreads $(__DEBUGINFO) $(__OPTIMIZE_FLAG) -Ilib \ + -I@MYSQL_C_INC_DIR@ -DUNICODE -D_UNICODE -DMYSQLPP_NO_DLL -I"C:\Program \ + Files\MySQL\MySQL Connector C 6.1\include" $(CPPFLAGS) $(CXXFLAGS) +TEST_MANIP_OBJECTS = \ + test_manip_manip.o +TEST_NULL_COMPARISON_CXXFLAGS = -mthreads $(__DEBUGINFO) $(__OPTIMIZE_FLAG) \ + -Ilib -I@MYSQL_C_INC_DIR@ -DUNICODE -D_UNICODE -DMYSQLPP_NO_DLL -I"C:\Program \ + Files\MySQL\MySQL Connector C 6.1\include" $(CPPFLAGS) $(CXXFLAGS) +TEST_NULL_COMPARISON_OBJECTS = \ + test_null_comparison_null_comparison.o +TEST_QUERY_COPY_CXXFLAGS = -mthreads $(__DEBUGINFO) $(__OPTIMIZE_FLAG) -Ilib \ + -I@MYSQL_C_INC_DIR@ -DUNICODE -D_UNICODE -DMYSQLPP_NO_DLL -I"C:\Program \ + Files\MySQL\MySQL Connector C 6.1\include" $(CPPFLAGS) $(CXXFLAGS) +TEST_QUERY_COPY_OBJECTS = \ + test_query_copy_query_copy.o +TEST_QSSQLS_CXXFLAGS = -mthreads $(__DEBUGINFO) $(__OPTIMIZE_FLAG) -Ilib \ + -I@MYSQL_C_INC_DIR@ -DUNICODE -D_UNICODE -DMYSQLPP_NO_DLL -I"C:\Program \ + Files\MySQL\MySQL Connector C 6.1\include" $(CPPFLAGS) $(CXXFLAGS) +TEST_QSSQLS_OBJECTS = \ + test_qssqls_qssqls.o +TEST_QSTREAM_CXXFLAGS = -mthreads $(__DEBUGINFO) $(__OPTIMIZE_FLAG) -Ilib \ + -I@MYSQL_C_INC_DIR@ -DUNICODE -D_UNICODE -DMYSQLPP_NO_DLL -I"C:\Program \ + Files\MySQL\MySQL Connector C 6.1\include" $(CPPFLAGS) $(CXXFLAGS) +TEST_QSTREAM_OBJECTS = \ + test_qstream_qstream.o +TEST_SQLSTREAM_CXXFLAGS = -mthreads $(__DEBUGINFO) $(__OPTIMIZE_FLAG) -Ilib \ + -I@MYSQL_C_INC_DIR@ -DUNICODE -D_UNICODE -DMYSQLPP_NO_DLL -I"C:\Program \ + Files\MySQL\MySQL Connector C 6.1\include" $(CPPFLAGS) $(CXXFLAGS) +TEST_SQLSTREAM_OBJECTS = \ + test_sqlstream_sqlstream.o +TEST_SSQLS2_CXXFLAGS = -mthreads $(__DEBUGINFO) $(__OPTIMIZE_FLAG) -Ilib \ + -I@MYSQL_C_INC_DIR@ -DUNICODE -D_UNICODE -DMYSQLPP_NO_DLL -I"C:\Program \ + Files\MySQL\MySQL Connector C 6.1\include" $(CPPFLAGS) $(CXXFLAGS) +TEST_SSQLS2_OBJECTS = \ + test_ssqls2_ssqls2.o +TEST_STRING_CXXFLAGS = -mthreads $(__DEBUGINFO) $(__OPTIMIZE_FLAG) -Ilib \ + -I@MYSQL_C_INC_DIR@ -DUNICODE -D_UNICODE -DMYSQLPP_NO_DLL -I"C:\Program \ + Files\MySQL\MySQL Connector C 6.1\include" $(CPPFLAGS) $(CXXFLAGS) +TEST_STRING_OBJECTS = \ + test_string_string.o +TEST_TCP_CXXFLAGS = -mthreads $(__DEBUGINFO) $(__OPTIMIZE_FLAG) -Ilib \ + -I@MYSQL_C_INC_DIR@ -DUNICODE -D_UNICODE -DMYSQLPP_NO_DLL -I"C:\Program \ + Files\MySQL\MySQL Connector C 6.1\include" $(CPPFLAGS) $(CXXFLAGS) +TEST_TCP_OBJECTS = \ + test_tcp_tcp.o +TEST_UDS_CXXFLAGS = -mthreads $(__DEBUGINFO) $(__OPTIMIZE_FLAG) -Ilib \ + -I@MYSQL_C_INC_DIR@ -DUNICODE -D_UNICODE -DMYSQLPP_NO_DLL -I"C:\Program \ + Files\MySQL\MySQL Connector C 6.1\include" $(CPPFLAGS) $(CXXFLAGS) +TEST_UDS_OBJECTS = \ + test_uds_uds.o +TEST_WNP_CXXFLAGS = -mthreads $(__DEBUGINFO) $(__OPTIMIZE_FLAG) -Ilib \ + -I@MYSQL_C_INC_DIR@ -DUNICODE -D_UNICODE -DMYSQLPP_NO_DLL -I"C:\Program \ + Files\MySQL\MySQL Connector C 6.1\include" $(CPPFLAGS) $(CXXFLAGS) +TEST_WNP_OBJECTS = \ + test_wnp_wnp.o +EXCOMMON_CXXFLAGS = -mthreads $(__DEBUGINFO) $(__OPTIMIZE_FLAG) -Ilib \ + -I@MYSQL_C_INC_DIR@ -DUNICODE -D_UNICODE -DMYSQLPP_NO_DLL -I"C:\Program \ + Files\MySQL\MySQL Connector C 6.1\include" $(CPPFLAGS) $(CXXFLAGS) +EXCOMMON_OBJECTS = \ + excommon_printdata.o +CGI_JPEG_CXXFLAGS = -mthreads $(__DEBUGINFO) $(__OPTIMIZE_FLAG) -Ilib \ + -I@MYSQL_C_INC_DIR@ -DUNICODE -D_UNICODE -DMYSQLPP_NO_DLL -I"C:\Program \ + Files\MySQL\MySQL Connector C 6.1\include" $(CPPFLAGS) $(CXXFLAGS) +CGI_JPEG_OBJECTS = \ + cgi_jpeg_cgi_jpeg.o +CPOOL_CXXFLAGS = -mthreads $(__DEBUGINFO) $(__OPTIMIZE_FLAG) -Ilib \ + -I@MYSQL_C_INC_DIR@ -DUNICODE -D_UNICODE -DMYSQLPP_NO_DLL -I"C:\Program \ + Files\MySQL\MySQL Connector C 6.1\include" $(CPPFLAGS) $(CXXFLAGS) +CPOOL_OBJECTS = \ + cpool_cpool.o +DBINFO_CXXFLAGS = -mthreads $(__DEBUGINFO) $(__OPTIMIZE_FLAG) -Ilib \ + -I@MYSQL_C_INC_DIR@ -DUNICODE -D_UNICODE -DMYSQLPP_NO_DLL -I"C:\Program \ + Files\MySQL\MySQL Connector C 6.1\include" $(CPPFLAGS) $(CXXFLAGS) +DBINFO_OBJECTS = \ + dbinfo_dbinfo.o +DEADLOCK_CXXFLAGS = -mthreads $(__DEBUGINFO) $(__OPTIMIZE_FLAG) -Ilib \ + -I@MYSQL_C_INC_DIR@ -DUNICODE -D_UNICODE -DMYSQLPP_NO_DLL -I"C:\Program \ + Files\MySQL\MySQL Connector C 6.1\include" $(CPPFLAGS) $(CXXFLAGS) +DEADLOCK_OBJECTS = \ + deadlock_deadlock.o +FIELDINF_CXXFLAGS = -mthreads $(__DEBUGINFO) $(__OPTIMIZE_FLAG) -Ilib \ + -I@MYSQL_C_INC_DIR@ -DUNICODE -D_UNICODE -DMYSQLPP_NO_DLL -I"C:\Program \ + Files\MySQL\MySQL Connector C 6.1\include" $(CPPFLAGS) $(CXXFLAGS) +FIELDINF_OBJECTS = \ + fieldinf_fieldinf.o +FOR_EACH_CXXFLAGS = -mthreads $(__DEBUGINFO) $(__OPTIMIZE_FLAG) -Ilib \ + -I@MYSQL_C_INC_DIR@ -DUNICODE -D_UNICODE -DMYSQLPP_NO_DLL -I"C:\Program \ + Files\MySQL\MySQL Connector C 6.1\include" $(CPPFLAGS) $(CXXFLAGS) +FOR_EACH_OBJECTS = \ + for_each_for_each.o +LOAD_JPEG_CXXFLAGS = -mthreads $(__DEBUGINFO) $(__OPTIMIZE_FLAG) -Ilib \ + -I@MYSQL_C_INC_DIR@ -DUNICODE -D_UNICODE -DMYSQLPP_NO_DLL -I"C:\Program \ + Files\MySQL\MySQL Connector C 6.1\include" $(CPPFLAGS) $(CXXFLAGS) +LOAD_JPEG_OBJECTS = \ + load_jpeg_load_jpeg.o +MULTIQUERY_CXXFLAGS = -mthreads $(__DEBUGINFO) $(__OPTIMIZE_FLAG) -Ilib \ + -I@MYSQL_C_INC_DIR@ -DUNICODE -D_UNICODE -DMYSQLPP_NO_DLL -I"C:\Program \ + Files\MySQL\MySQL Connector C 6.1\include" $(CPPFLAGS) $(CXXFLAGS) +MULTIQUERY_OBJECTS = \ + multiquery_multiquery.o +RESETDB_CXXFLAGS = -mthreads $(__DEBUGINFO) $(__OPTIMIZE_FLAG) -Ilib \ + -I@MYSQL_C_INC_DIR@ -DUNICODE -D_UNICODE -DMYSQLPP_NO_DLL -I"C:\Program \ + Files\MySQL\MySQL Connector C 6.1\include" $(CPPFLAGS) $(CXXFLAGS) +RESETDB_OBJECTS = \ + resetdb_resetdb.o +SIMPLE1_CXXFLAGS = -mthreads $(__DEBUGINFO) $(__OPTIMIZE_FLAG) -Ilib \ + -I@MYSQL_C_INC_DIR@ -DUNICODE -D_UNICODE -DMYSQLPP_NO_DLL -I"C:\Program \ + Files\MySQL\MySQL Connector C 6.1\include" $(CPPFLAGS) $(CXXFLAGS) +SIMPLE1_OBJECTS = \ + simple1_simple1.o +SIMPLE2_CXXFLAGS = -mthreads $(__DEBUGINFO) $(__OPTIMIZE_FLAG) -Ilib \ + -I@MYSQL_C_INC_DIR@ -DUNICODE -D_UNICODE -DMYSQLPP_NO_DLL -I"C:\Program \ + Files\MySQL\MySQL Connector C 6.1\include" $(CPPFLAGS) $(CXXFLAGS) +SIMPLE2_OBJECTS = \ + simple2_simple2.o +SIMPLE3_CXXFLAGS = -mthreads $(__DEBUGINFO) $(__OPTIMIZE_FLAG) -Ilib \ + -I@MYSQL_C_INC_DIR@ -DUNICODE -D_UNICODE -DMYSQLPP_NO_DLL -I"C:\Program \ + Files\MySQL\MySQL Connector C 6.1\include" $(CPPFLAGS) $(CXXFLAGS) +SIMPLE3_OBJECTS = \ + simple3_simple3.o +SSQLS1_CXXFLAGS = -mthreads $(__DEBUGINFO) $(__OPTIMIZE_FLAG) -Ilib \ + -I@MYSQL_C_INC_DIR@ -DUNICODE -D_UNICODE -DMYSQLPP_NO_DLL -I"C:\Program \ + Files\MySQL\MySQL Connector C 6.1\include" $(CPPFLAGS) $(CXXFLAGS) +SSQLS1_OBJECTS = \ + ssqls1_ssqls1.o +SSQLS2_CXXFLAGS = -mthreads $(__DEBUGINFO) $(__OPTIMIZE_FLAG) -Ilib \ + -I@MYSQL_C_INC_DIR@ -DUNICODE -D_UNICODE -DMYSQLPP_NO_DLL -I"C:\Program \ + Files\MySQL\MySQL Connector C 6.1\include" $(CPPFLAGS) $(CXXFLAGS) +SSQLS2_OBJECTS = \ + ssqls2_ssqls2.o +SSQLS3_CXXFLAGS = -mthreads $(__DEBUGINFO) $(__OPTIMIZE_FLAG) -Ilib \ + -I@MYSQL_C_INC_DIR@ -DUNICODE -D_UNICODE -DMYSQLPP_NO_DLL -I"C:\Program \ + Files\MySQL\MySQL Connector C 6.1\include" $(CPPFLAGS) $(CXXFLAGS) +SSQLS3_OBJECTS = \ + ssqls3_ssqls3.o +SSQLS4_CXXFLAGS = -mthreads $(__DEBUGINFO) $(__OPTIMIZE_FLAG) -Ilib \ + -I@MYSQL_C_INC_DIR@ -DUNICODE -D_UNICODE -DMYSQLPP_NO_DLL -I"C:\Program \ + Files\MySQL\MySQL Connector C 6.1\include" $(CPPFLAGS) $(CXXFLAGS) +SSQLS4_OBJECTS = \ + ssqls4_ssqls4.o +SSQLS5_CXXFLAGS = -mthreads $(__DEBUGINFO) $(__OPTIMIZE_FLAG) -Ilib \ + -I@MYSQL_C_INC_DIR@ -DUNICODE -D_UNICODE -DMYSQLPP_NO_DLL -I"C:\Program \ + Files\MySQL\MySQL Connector C 6.1\include" $(CPPFLAGS) $(CXXFLAGS) +SSQLS5_OBJECTS = \ + ssqls5_ssqls5.o +SSQLS6_CXXFLAGS = -mthreads $(__DEBUGINFO) $(__OPTIMIZE_FLAG) -Ilib \ + -I@MYSQL_C_INC_DIR@ -DUNICODE -D_UNICODE -DMYSQLPP_NO_DLL -I"C:\Program \ + Files\MySQL\MySQL Connector C 6.1\include" $(CPPFLAGS) $(CXXFLAGS) +SSQLS6_OBJECTS = \ + ssqls6_ssqls6.o +STORE_IF_CXXFLAGS = -mthreads $(__DEBUGINFO) $(__OPTIMIZE_FLAG) -Ilib \ + -I@MYSQL_C_INC_DIR@ -DUNICODE -D_UNICODE -DMYSQLPP_NO_DLL -I"C:\Program \ + Files\MySQL\MySQL Connector C 6.1\include" $(CPPFLAGS) $(CXXFLAGS) +STORE_IF_OBJECTS = \ + store_if_store_if.o +TQUERY1_CXXFLAGS = -mthreads $(__DEBUGINFO) $(__OPTIMIZE_FLAG) -Ilib \ + -I@MYSQL_C_INC_DIR@ -DUNICODE -D_UNICODE -DMYSQLPP_NO_DLL -I"C:\Program \ + Files\MySQL\MySQL Connector C 6.1\include" $(CPPFLAGS) $(CXXFLAGS) +TQUERY1_OBJECTS = \ + tquery1_tquery1.o +TQUERY2_CXXFLAGS = -mthreads $(__DEBUGINFO) $(__OPTIMIZE_FLAG) -Ilib \ + -I@MYSQL_C_INC_DIR@ -DUNICODE -D_UNICODE -DMYSQLPP_NO_DLL -I"C:\Program \ + Files\MySQL\MySQL Connector C 6.1\include" $(CPPFLAGS) $(CXXFLAGS) +TQUERY2_OBJECTS = \ + tquery2_tquery2.o +TQUERY3_CXXFLAGS = -mthreads $(__DEBUGINFO) $(__OPTIMIZE_FLAG) -Ilib \ + -I@MYSQL_C_INC_DIR@ -DUNICODE -D_UNICODE -DMYSQLPP_NO_DLL -I"C:\Program \ + Files\MySQL\MySQL Connector C 6.1\include" $(CPPFLAGS) $(CXXFLAGS) +TQUERY3_OBJECTS = \ + tquery3_tquery3.o +TQUERY4_CXXFLAGS = -mthreads $(__DEBUGINFO) $(__OPTIMIZE_FLAG) -Ilib \ + -I@MYSQL_C_INC_DIR@ -DUNICODE -D_UNICODE -DMYSQLPP_NO_DLL -I"C:\Program \ + Files\MySQL\MySQL Connector C 6.1\include" $(CPPFLAGS) $(CXXFLAGS) +TQUERY4_OBJECTS = \ + tquery4_tquery4.o +TRANSACTION_CXXFLAGS = -mthreads $(__DEBUGINFO) $(__OPTIMIZE_FLAG) -Ilib \ + -I@MYSQL_C_INC_DIR@ -DUNICODE -D_UNICODE -DMYSQLPP_NO_DLL -I"C:\Program \ + Files\MySQL\MySQL Connector C 6.1\include" $(CPPFLAGS) $(CXXFLAGS) +TRANSACTION_OBJECTS = \ + transaction_transaction.o + +### Conditionally set variables: ### + +ifeq ($(BUILD),debug) +__OPTIMIZE_FLAG = -O0 +endif +ifeq ($(BUILD),release) +__OPTIMIZE_FLAG = -O2 +endif +ifeq ($(BUILD),debug) +__DEBUGINFO = -g +endif +ifeq ($(BUILD),release) +__DEBUGINFO = +endif + + +### Targets: ### + +all: mysqlpp.dll libmysqlpp_ssqls2parse.a ssqlsxlat.exe test_array_index.exe test_cpool.exe test_datetime.exe test_inttypes.exe test_insertpolicy.exe test_manip.exe test_null_comparison.exe test_query_copy.exe test_qssqls.exe test_qstream.exe test_sqlstream.exe test_ssqls2.exe test_string.exe test_tcp.exe test_uds.exe test_wnp.exe libmysqlpp_excommon.a cgi_jpeg.exe cpool.exe dbinfo.exe deadlock.exe fieldinf.exe for_each.exe load_jpeg.exe multiquery.exe resetdb.exe simple1.exe simple2.exe simple3.exe ssqls1.exe ssqls2.exe ssqls3.exe ssqls4.exe ssqls5.exe ssqls6.exe store_if.exe tquery1.exe tquery2.exe tquery3.exe tquery4.exe transaction.exe + +clean: + -if exist .\*.o del .\*.o + -if exist .\*.d del .\*.d + -if exist mysqlpp.dll del mysqlpp.dll + -if exist libmysqlpp.a del libmysqlpp.a + -if exist libmysqlpp_ssqls2parse.a del libmysqlpp_ssqls2parse.a + -if exist ssqlsxlat.exe del ssqlsxlat.exe + -if exist test_array_index.exe del test_array_index.exe + -if exist test_cpool.exe del test_cpool.exe + -if exist test_datetime.exe del test_datetime.exe + -if exist test_inttypes.exe del test_inttypes.exe + -if exist test_insertpolicy.exe del test_insertpolicy.exe + -if exist test_manip.exe del test_manip.exe + -if exist test_null_comparison.exe del test_null_comparison.exe + -if exist test_query_copy.exe del test_query_copy.exe + -if exist test_qssqls.exe del test_qssqls.exe + -if exist test_qstream.exe del test_qstream.exe + -if exist test_sqlstream.exe del test_sqlstream.exe + -if exist test_ssqls2.exe del test_ssqls2.exe + -if exist test_string.exe del test_string.exe + -if exist test_tcp.exe del test_tcp.exe + -if exist test_uds.exe del test_uds.exe + -if exist test_wnp.exe del test_wnp.exe + -if exist libmysqlpp_excommon.a del libmysqlpp_excommon.a + -if exist cgi_jpeg.exe del cgi_jpeg.exe + -if exist cpool.exe del cpool.exe + -if exist dbinfo.exe del dbinfo.exe + -if exist deadlock.exe del deadlock.exe + -if exist fieldinf.exe del fieldinf.exe + -if exist for_each.exe del for_each.exe + -if exist load_jpeg.exe del load_jpeg.exe + -if exist multiquery.exe del multiquery.exe + -if exist resetdb.exe del resetdb.exe + -if exist simple1.exe del simple1.exe + -if exist simple2.exe del simple2.exe + -if exist simple3.exe del simple3.exe + -if exist ssqls1.exe del ssqls1.exe + -if exist ssqls2.exe del ssqls2.exe + -if exist ssqls3.exe del ssqls3.exe + -if exist ssqls4.exe del ssqls4.exe + -if exist ssqls5.exe del ssqls5.exe + -if exist ssqls6.exe del ssqls6.exe + -if exist store_if.exe del store_if.exe + -if exist tquery1.exe del tquery1.exe + -if exist tquery2.exe del tquery2.exe + -if exist tquery3.exe del tquery3.exe + -if exist tquery4.exe del tquery4.exe + -if exist transaction.exe del transaction.exe + +mysqlpp.dll: $(MYSQLPP_OBJECTS) + $(CXX) $(LINK_DLL_FLAGS) -fPIC -o $@ $(MYSQLPP_OBJECTS) -Wl,--out-implib=libmysqlpp.a $(__DEBUGINFO) -mthreads -Wl,--enable-stdcall-fixup -L"C:\Program Files\MySQL\MySQL Connector C 6.1\lib" $(LDFLAGS) -lwsock32 -lmysql + +libmysqlpp_ssqls2parse.a: $(SSQLS2PARSE_OBJECTS) mysqlpp.dll mysqlpp.dll + if exist $@ del $@ + ar rcu $@ $(SSQLS2PARSE_OBJECTS) + ranlib $@ + +ssqlsxlat.exe: $(SSQLSXLAT_OBJECTS) mysqlpp.dll libmysqlpp_ssqls2parse.a + $(CXX) -o $@ $(SSQLSXLAT_OBJECTS) -mthreads $(__DEBUGINFO) -L@MYSQL_C_LIB_DIR@ -L. -Wl,--enable-auto-import -Wl,--enable-runtime-pseudo-reloc -Wl,--enable-stdcall-fixup -L"C:\Program Files\MySQL\MySQL Connector C 6.1\lib" $(LDFLAGS) -lmysql -lmysqlpp -lmysqlpp_ssqls2parse -lmysqlpp + +test_array_index.exe: $(TEST_ARRAY_INDEX_OBJECTS) mysqlpp.dll + $(CXX) -o $@ $(TEST_ARRAY_INDEX_OBJECTS) -mthreads $(__DEBUGINFO) -L@MYSQL_C_LIB_DIR@ -L. -Wl,--enable-auto-import -Wl,--enable-runtime-pseudo-reloc -Wl,--enable-stdcall-fixup -L"C:\Program Files\MySQL\MySQL Connector C 6.1\lib" $(LDFLAGS) -lmysql -lmysqlpp + +test_cpool.exe: $(TEST_CPOOL_OBJECTS) mysqlpp.dll + $(CXX) -o $@ $(TEST_CPOOL_OBJECTS) -mthreads $(__DEBUGINFO) -L@MYSQL_C_LIB_DIR@ -L. -Wl,--enable-auto-import -Wl,--enable-runtime-pseudo-reloc -Wl,--enable-stdcall-fixup -L"C:\Program Files\MySQL\MySQL Connector C 6.1\lib" $(LDFLAGS) -lmysql -lmysqlpp + +test_datetime.exe: $(TEST_DATETIME_OBJECTS) mysqlpp.dll + $(CXX) -o $@ $(TEST_DATETIME_OBJECTS) -mthreads $(__DEBUGINFO) -L@MYSQL_C_LIB_DIR@ -L. -Wl,--enable-auto-import -Wl,--enable-runtime-pseudo-reloc -Wl,--enable-stdcall-fixup -L"C:\Program Files\MySQL\MySQL Connector C 6.1\lib" $(LDFLAGS) -lmysql -lmysqlpp + +test_inttypes.exe: $(TEST_INTTYPES_OBJECTS) mysqlpp.dll + $(CXX) -o $@ $(TEST_INTTYPES_OBJECTS) -mthreads $(__DEBUGINFO) -L@MYSQL_C_LIB_DIR@ -L. -Wl,--enable-auto-import -Wl,--enable-runtime-pseudo-reloc -Wl,--enable-stdcall-fixup -L"C:\Program Files\MySQL\MySQL Connector C 6.1\lib" $(LDFLAGS) -lmysql -lmysqlpp + +test_insertpolicy.exe: $(TEST_INSERTPOLICY_OBJECTS) mysqlpp.dll + $(CXX) -o $@ $(TEST_INSERTPOLICY_OBJECTS) -mthreads $(__DEBUGINFO) -L@MYSQL_C_LIB_DIR@ -L. -Wl,--enable-auto-import -Wl,--enable-runtime-pseudo-reloc -Wl,--enable-stdcall-fixup -L"C:\Program Files\MySQL\MySQL Connector C 6.1\lib" $(LDFLAGS) -lmysql -lmysqlpp + +test_manip.exe: $(TEST_MANIP_OBJECTS) mysqlpp.dll + $(CXX) -o $@ $(TEST_MANIP_OBJECTS) -mthreads $(__DEBUGINFO) -L@MYSQL_C_LIB_DIR@ -L. -Wl,--enable-auto-import -Wl,--enable-runtime-pseudo-reloc -Wl,--enable-stdcall-fixup -L"C:\Program Files\MySQL\MySQL Connector C 6.1\lib" $(LDFLAGS) -lmysql -lmysqlpp + +test_null_comparison.exe: $(TEST_NULL_COMPARISON_OBJECTS) mysqlpp.dll + $(CXX) -o $@ $(TEST_NULL_COMPARISON_OBJECTS) -mthreads $(__DEBUGINFO) -L@MYSQL_C_LIB_DIR@ -L. -Wl,--enable-auto-import -Wl,--enable-runtime-pseudo-reloc -Wl,--enable-stdcall-fixup -L"C:\Program Files\MySQL\MySQL Connector C 6.1\lib" $(LDFLAGS) -lmysql -lmysqlpp + +test_query_copy.exe: $(TEST_QUERY_COPY_OBJECTS) mysqlpp.dll + $(CXX) -o $@ $(TEST_QUERY_COPY_OBJECTS) -mthreads $(__DEBUGINFO) -L@MYSQL_C_LIB_DIR@ -L. -Wl,--enable-auto-import -Wl,--enable-runtime-pseudo-reloc -Wl,--enable-stdcall-fixup -L"C:\Program Files\MySQL\MySQL Connector C 6.1\lib" $(LDFLAGS) -lmysql -lmysqlpp + +test_qssqls.exe: $(TEST_QSSQLS_OBJECTS) mysqlpp.dll + $(CXX) -o $@ $(TEST_QSSQLS_OBJECTS) -mthreads $(__DEBUGINFO) -L@MYSQL_C_LIB_DIR@ -L. -Wl,--enable-auto-import -Wl,--enable-runtime-pseudo-reloc -Wl,--enable-stdcall-fixup -L"C:\Program Files\MySQL\MySQL Connector C 6.1\lib" $(LDFLAGS) -lmysql -lmysqlpp + +test_qstream.exe: $(TEST_QSTREAM_OBJECTS) mysqlpp.dll + $(CXX) -o $@ $(TEST_QSTREAM_OBJECTS) -mthreads $(__DEBUGINFO) -L@MYSQL_C_LIB_DIR@ -L. -Wl,--enable-auto-import -Wl,--enable-runtime-pseudo-reloc -Wl,--enable-stdcall-fixup -L"C:\Program Files\MySQL\MySQL Connector C 6.1\lib" $(LDFLAGS) -lmysql -lmysqlpp + +test_sqlstream.exe: $(TEST_SQLSTREAM_OBJECTS) mysqlpp.dll + $(CXX) -o $@ $(TEST_SQLSTREAM_OBJECTS) -mthreads $(__DEBUGINFO) -L@MYSQL_C_LIB_DIR@ -L. -Wl,--enable-auto-import -Wl,--enable-runtime-pseudo-reloc -Wl,--enable-stdcall-fixup -L"C:\Program Files\MySQL\MySQL Connector C 6.1\lib" $(LDFLAGS) -lmysql -lmysqlpp + +test_ssqls2.exe: $(TEST_SSQLS2_OBJECTS) mysqlpp.dll libmysqlpp_ssqls2parse.a + $(CXX) -o $@ $(TEST_SSQLS2_OBJECTS) -mthreads $(__DEBUGINFO) -L@MYSQL_C_LIB_DIR@ -L. -Wl,--enable-auto-import -Wl,--enable-runtime-pseudo-reloc -Wl,--enable-stdcall-fixup -L"C:\Program Files\MySQL\MySQL Connector C 6.1\lib" $(LDFLAGS) -lmysql -lmysqlpp -lmysqlpp_ssqls2parse -lmysqlpp + +test_string.exe: $(TEST_STRING_OBJECTS) mysqlpp.dll + $(CXX) -o $@ $(TEST_STRING_OBJECTS) -mthreads $(__DEBUGINFO) -L@MYSQL_C_LIB_DIR@ -L. -Wl,--enable-auto-import -Wl,--enable-runtime-pseudo-reloc -Wl,--enable-stdcall-fixup -L"C:\Program Files\MySQL\MySQL Connector C 6.1\lib" $(LDFLAGS) -lmysql -lmysqlpp + +test_tcp.exe: $(TEST_TCP_OBJECTS) mysqlpp.dll + $(CXX) -o $@ $(TEST_TCP_OBJECTS) -mthreads $(__DEBUGINFO) -L@MYSQL_C_LIB_DIR@ -L. -Wl,--enable-auto-import -Wl,--enable-runtime-pseudo-reloc -Wl,--enable-stdcall-fixup -L"C:\Program Files\MySQL\MySQL Connector C 6.1\lib" $(LDFLAGS) -lmysql -lmysqlpp + +test_uds.exe: $(TEST_UDS_OBJECTS) mysqlpp.dll + $(CXX) -o $@ $(TEST_UDS_OBJECTS) -mthreads $(__DEBUGINFO) -L@MYSQL_C_LIB_DIR@ -L. -Wl,--enable-auto-import -Wl,--enable-runtime-pseudo-reloc -Wl,--enable-stdcall-fixup -L"C:\Program Files\MySQL\MySQL Connector C 6.1\lib" $(LDFLAGS) -lmysql -lmysqlpp + +test_wnp.exe: $(TEST_WNP_OBJECTS) mysqlpp.dll + $(CXX) -o $@ $(TEST_WNP_OBJECTS) -mthreads $(__DEBUGINFO) -L@MYSQL_C_LIB_DIR@ -L. -Wl,--enable-auto-import -Wl,--enable-runtime-pseudo-reloc -Wl,--enable-stdcall-fixup -L"C:\Program Files\MySQL\MySQL Connector C 6.1\lib" $(LDFLAGS) -lmysql -lmysqlpp + +libmysqlpp_excommon.a: $(EXCOMMON_OBJECTS) mysqlpp.dll + if exist $@ del $@ + ar rcu $@ $(EXCOMMON_OBJECTS) + ranlib $@ + +cgi_jpeg.exe: $(CGI_JPEG_OBJECTS) libmysqlpp_excommon.a mysqlpp.dll + $(CXX) -o $@ $(CGI_JPEG_OBJECTS) -mthreads $(__DEBUGINFO) -L@MYSQL_C_LIB_DIR@ -L. -Wl,--enable-auto-import -Wl,--enable-runtime-pseudo-reloc -Wl,--enable-stdcall-fixup -L"C:\Program Files\MySQL\MySQL Connector C 6.1\lib" $(LDFLAGS) -lmysqlpp_excommon -lmysql -lmysqlpp + +cpool.exe: $(CPOOL_OBJECTS) libmysqlpp_excommon.a mysqlpp.dll + $(CXX) -o $@ $(CPOOL_OBJECTS) -mthreads $(__DEBUGINFO) -L@MYSQL_C_LIB_DIR@ -L. -Wl,--enable-auto-import -Wl,--enable-runtime-pseudo-reloc -Wl,--enable-stdcall-fixup -L"C:\Program Files\MySQL\MySQL Connector C 6.1\lib" $(LDFLAGS) -lmysqlpp_excommon -lmysql -lmysqlpp + +dbinfo.exe: $(DBINFO_OBJECTS) libmysqlpp_excommon.a mysqlpp.dll + $(CXX) -o $@ $(DBINFO_OBJECTS) -mthreads $(__DEBUGINFO) -L@MYSQL_C_LIB_DIR@ -L. -Wl,--enable-auto-import -Wl,--enable-runtime-pseudo-reloc -Wl,--enable-stdcall-fixup -L"C:\Program Files\MySQL\MySQL Connector C 6.1\lib" $(LDFLAGS) -lmysqlpp_excommon -lmysql -lmysqlpp + +deadlock.exe: $(DEADLOCK_OBJECTS) libmysqlpp_excommon.a mysqlpp.dll + $(CXX) -o $@ $(DEADLOCK_OBJECTS) -mthreads $(__DEBUGINFO) -L@MYSQL_C_LIB_DIR@ -L. -Wl,--enable-auto-import -Wl,--enable-runtime-pseudo-reloc -Wl,--enable-stdcall-fixup -L"C:\Program Files\MySQL\MySQL Connector C 6.1\lib" $(LDFLAGS) -lmysqlpp_excommon -lmysql -lmysqlpp + +fieldinf.exe: $(FIELDINF_OBJECTS) libmysqlpp_excommon.a mysqlpp.dll + $(CXX) -o $@ $(FIELDINF_OBJECTS) -mthreads $(__DEBUGINFO) -L@MYSQL_C_LIB_DIR@ -L. -Wl,--enable-auto-import -Wl,--enable-runtime-pseudo-reloc -Wl,--enable-stdcall-fixup -L"C:\Program Files\MySQL\MySQL Connector C 6.1\lib" $(LDFLAGS) -lmysqlpp_excommon -lmysql -lmysqlpp + +for_each.exe: $(FOR_EACH_OBJECTS) libmysqlpp_excommon.a mysqlpp.dll + $(CXX) -o $@ $(FOR_EACH_OBJECTS) -mthreads $(__DEBUGINFO) -L@MYSQL_C_LIB_DIR@ -L. -Wl,--enable-auto-import -Wl,--enable-runtime-pseudo-reloc -Wl,--enable-stdcall-fixup -L"C:\Program Files\MySQL\MySQL Connector C 6.1\lib" $(LDFLAGS) -lmysqlpp_excommon -lmysql -lmysqlpp + +load_jpeg.exe: $(LOAD_JPEG_OBJECTS) libmysqlpp_excommon.a mysqlpp.dll + $(CXX) -o $@ $(LOAD_JPEG_OBJECTS) -mthreads $(__DEBUGINFO) -L@MYSQL_C_LIB_DIR@ -L. -Wl,--enable-auto-import -Wl,--enable-runtime-pseudo-reloc -Wl,--enable-stdcall-fixup -L"C:\Program Files\MySQL\MySQL Connector C 6.1\lib" $(LDFLAGS) -lmysqlpp_excommon -lmysql -lmysqlpp + +multiquery.exe: $(MULTIQUERY_OBJECTS) libmysqlpp_excommon.a mysqlpp.dll + $(CXX) -o $@ $(MULTIQUERY_OBJECTS) -mthreads $(__DEBUGINFO) -L@MYSQL_C_LIB_DIR@ -L. -Wl,--enable-auto-import -Wl,--enable-runtime-pseudo-reloc -Wl,--enable-stdcall-fixup -L"C:\Program Files\MySQL\MySQL Connector C 6.1\lib" $(LDFLAGS) -lmysqlpp_excommon -lmysql -lmysqlpp + +resetdb.exe: $(RESETDB_OBJECTS) libmysqlpp_excommon.a mysqlpp.dll + $(CXX) -o $@ $(RESETDB_OBJECTS) -mthreads $(__DEBUGINFO) -L@MYSQL_C_LIB_DIR@ -L. -Wl,--enable-auto-import -Wl,--enable-runtime-pseudo-reloc -Wl,--enable-stdcall-fixup -L"C:\Program Files\MySQL\MySQL Connector C 6.1\lib" $(LDFLAGS) -lmysqlpp_excommon -lmysql -lmysqlpp + +simple1.exe: $(SIMPLE1_OBJECTS) libmysqlpp_excommon.a mysqlpp.dll + $(CXX) -o $@ $(SIMPLE1_OBJECTS) -mthreads $(__DEBUGINFO) -L@MYSQL_C_LIB_DIR@ -L. -Wl,--enable-auto-import -Wl,--enable-runtime-pseudo-reloc -Wl,--enable-stdcall-fixup -L"C:\Program Files\MySQL\MySQL Connector C 6.1\lib" $(LDFLAGS) -lmysqlpp_excommon -lmysql -lmysqlpp + +simple2.exe: $(SIMPLE2_OBJECTS) libmysqlpp_excommon.a mysqlpp.dll + $(CXX) -o $@ $(SIMPLE2_OBJECTS) -mthreads $(__DEBUGINFO) -L@MYSQL_C_LIB_DIR@ -L. -Wl,--enable-auto-import -Wl,--enable-runtime-pseudo-reloc -Wl,--enable-stdcall-fixup -L"C:\Program Files\MySQL\MySQL Connector C 6.1\lib" $(LDFLAGS) -lmysqlpp_excommon -lmysql -lmysqlpp + +simple3.exe: $(SIMPLE3_OBJECTS) libmysqlpp_excommon.a mysqlpp.dll + $(CXX) -o $@ $(SIMPLE3_OBJECTS) -mthreads $(__DEBUGINFO) -L@MYSQL_C_LIB_DIR@ -L. -Wl,--enable-auto-import -Wl,--enable-runtime-pseudo-reloc -Wl,--enable-stdcall-fixup -L"C:\Program Files\MySQL\MySQL Connector C 6.1\lib" $(LDFLAGS) -lmysqlpp_excommon -lmysql -lmysqlpp + +ssqls1.exe: $(SSQLS1_OBJECTS) libmysqlpp_excommon.a mysqlpp.dll + $(CXX) -o $@ $(SSQLS1_OBJECTS) -mthreads $(__DEBUGINFO) -L@MYSQL_C_LIB_DIR@ -L. -Wl,--enable-auto-import -Wl,--enable-runtime-pseudo-reloc -Wl,--enable-stdcall-fixup -L"C:\Program Files\MySQL\MySQL Connector C 6.1\lib" $(LDFLAGS) -lmysqlpp_excommon -lmysql -lmysqlpp + +ssqls2.exe: $(SSQLS2_OBJECTS) libmysqlpp_excommon.a mysqlpp.dll + $(CXX) -o $@ $(SSQLS2_OBJECTS) -mthreads $(__DEBUGINFO) -L@MYSQL_C_LIB_DIR@ -L. -Wl,--enable-auto-import -Wl,--enable-runtime-pseudo-reloc -Wl,--enable-stdcall-fixup -L"C:\Program Files\MySQL\MySQL Connector C 6.1\lib" $(LDFLAGS) -lmysqlpp_excommon -lmysql -lmysqlpp + +ssqls3.exe: $(SSQLS3_OBJECTS) libmysqlpp_excommon.a mysqlpp.dll + $(CXX) -o $@ $(SSQLS3_OBJECTS) -mthreads $(__DEBUGINFO) -L@MYSQL_C_LIB_DIR@ -L. -Wl,--enable-auto-import -Wl,--enable-runtime-pseudo-reloc -Wl,--enable-stdcall-fixup -L"C:\Program Files\MySQL\MySQL Connector C 6.1\lib" $(LDFLAGS) -lmysqlpp_excommon -lmysql -lmysqlpp + +ssqls4.exe: $(SSQLS4_OBJECTS) libmysqlpp_excommon.a mysqlpp.dll + $(CXX) -o $@ $(SSQLS4_OBJECTS) -mthreads $(__DEBUGINFO) -L@MYSQL_C_LIB_DIR@ -L. -Wl,--enable-auto-import -Wl,--enable-runtime-pseudo-reloc -Wl,--enable-stdcall-fixup -L"C:\Program Files\MySQL\MySQL Connector C 6.1\lib" $(LDFLAGS) -lmysqlpp_excommon -lmysql -lmysqlpp + +ssqls5.exe: $(SSQLS5_OBJECTS) libmysqlpp_excommon.a mysqlpp.dll + $(CXX) -o $@ $(SSQLS5_OBJECTS) -mthreads $(__DEBUGINFO) -L@MYSQL_C_LIB_DIR@ -L. -Wl,--enable-auto-import -Wl,--enable-runtime-pseudo-reloc -Wl,--enable-stdcall-fixup -L"C:\Program Files\MySQL\MySQL Connector C 6.1\lib" $(LDFLAGS) -lmysqlpp_excommon -lmysql -lmysqlpp + +ssqls6.exe: $(SSQLS6_OBJECTS) libmysqlpp_excommon.a mysqlpp.dll + $(CXX) -o $@ $(SSQLS6_OBJECTS) -mthreads $(__DEBUGINFO) -L@MYSQL_C_LIB_DIR@ -L. -Wl,--enable-auto-import -Wl,--enable-runtime-pseudo-reloc -Wl,--enable-stdcall-fixup -L"C:\Program Files\MySQL\MySQL Connector C 6.1\lib" $(LDFLAGS) -lmysqlpp_excommon -lmysql -lmysqlpp + +store_if.exe: $(STORE_IF_OBJECTS) libmysqlpp_excommon.a mysqlpp.dll + $(CXX) -o $@ $(STORE_IF_OBJECTS) -mthreads $(__DEBUGINFO) -L@MYSQL_C_LIB_DIR@ -L. -Wl,--enable-auto-import -Wl,--enable-runtime-pseudo-reloc -Wl,--enable-stdcall-fixup -L"C:\Program Files\MySQL\MySQL Connector C 6.1\lib" $(LDFLAGS) -lmysqlpp_excommon -lmysql -lmysqlpp + +tquery1.exe: $(TQUERY1_OBJECTS) libmysqlpp_excommon.a mysqlpp.dll + $(CXX) -o $@ $(TQUERY1_OBJECTS) -mthreads $(__DEBUGINFO) -L@MYSQL_C_LIB_DIR@ -L. -Wl,--enable-auto-import -Wl,--enable-runtime-pseudo-reloc -Wl,--enable-stdcall-fixup -L"C:\Program Files\MySQL\MySQL Connector C 6.1\lib" $(LDFLAGS) -lmysqlpp_excommon -lmysql -lmysqlpp + +tquery2.exe: $(TQUERY2_OBJECTS) libmysqlpp_excommon.a mysqlpp.dll + $(CXX) -o $@ $(TQUERY2_OBJECTS) -mthreads $(__DEBUGINFO) -L@MYSQL_C_LIB_DIR@ -L. -Wl,--enable-auto-import -Wl,--enable-runtime-pseudo-reloc -Wl,--enable-stdcall-fixup -L"C:\Program Files\MySQL\MySQL Connector C 6.1\lib" $(LDFLAGS) -lmysqlpp_excommon -lmysql -lmysqlpp + +tquery3.exe: $(TQUERY3_OBJECTS) libmysqlpp_excommon.a mysqlpp.dll + $(CXX) -o $@ $(TQUERY3_OBJECTS) -mthreads $(__DEBUGINFO) -L@MYSQL_C_LIB_DIR@ -L. -Wl,--enable-auto-import -Wl,--enable-runtime-pseudo-reloc -Wl,--enable-stdcall-fixup -L"C:\Program Files\MySQL\MySQL Connector C 6.1\lib" $(LDFLAGS) -lmysqlpp_excommon -lmysql -lmysqlpp + +tquery4.exe: $(TQUERY4_OBJECTS) libmysqlpp_excommon.a mysqlpp.dll + $(CXX) -o $@ $(TQUERY4_OBJECTS) -mthreads $(__DEBUGINFO) -L@MYSQL_C_LIB_DIR@ -L. -Wl,--enable-auto-import -Wl,--enable-runtime-pseudo-reloc -Wl,--enable-stdcall-fixup -L"C:\Program Files\MySQL\MySQL Connector C 6.1\lib" $(LDFLAGS) -lmysqlpp_excommon -lmysql -lmysqlpp + +transaction.exe: $(TRANSACTION_OBJECTS) libmysqlpp_excommon.a mysqlpp.dll + $(CXX) -o $@ $(TRANSACTION_OBJECTS) -mthreads $(__DEBUGINFO) -L@MYSQL_C_LIB_DIR@ -L. -Wl,--enable-auto-import -Wl,--enable-runtime-pseudo-reloc -Wl,--enable-stdcall-fixup -L"C:\Program Files\MySQL\MySQL Connector C 6.1\lib" $(LDFLAGS) -lmysqlpp_excommon -lmysql -lmysqlpp + +mysqlpp_beemutex.o: ./lib/beemutex.cpp + $(CXX) -c -o $@ $(MYSQLPP_CXXFLAGS) $(CPPDEPS) $< + +mysqlpp_cmdline.o: ./lib/cmdline.cpp + $(CXX) -c -o $@ $(MYSQLPP_CXXFLAGS) $(CPPDEPS) $< + +mysqlpp_connection.o: ./lib/connection.cpp + $(CXX) -c -o $@ $(MYSQLPP_CXXFLAGS) $(CPPDEPS) $< + +mysqlpp_cpool.o: ./lib/cpool.cpp + $(CXX) -c -o $@ $(MYSQLPP_CXXFLAGS) $(CPPDEPS) $< + +mysqlpp_datetime.o: ./lib/datetime.cpp + $(CXX) -c -o $@ $(MYSQLPP_CXXFLAGS) $(CPPDEPS) $< + +mysqlpp_dbdriver.o: ./lib/dbdriver.cpp + $(CXX) -c -o $@ $(MYSQLPP_CXXFLAGS) $(CPPDEPS) $< + +mysqlpp_field_names.o: ./lib/field_names.cpp + $(CXX) -c -o $@ $(MYSQLPP_CXXFLAGS) $(CPPDEPS) $< + +mysqlpp_field_types.o: ./lib/field_types.cpp + $(CXX) -c -o $@ $(MYSQLPP_CXXFLAGS) $(CPPDEPS) $< + +mysqlpp_manip.o: ./lib/manip.cpp + $(CXX) -c -o $@ $(MYSQLPP_CXXFLAGS) $(CPPDEPS) $< + +mysqlpp_myset.o: ./lib/myset.cpp + $(CXX) -c -o $@ $(MYSQLPP_CXXFLAGS) $(CPPDEPS) $< + +mysqlpp_mysql++.o: ./lib/mysql++.cpp + $(CXX) -c -o $@ $(MYSQLPP_CXXFLAGS) $(CPPDEPS) $< + +mysqlpp_mystring.o: ./lib/mystring.cpp + $(CXX) -c -o $@ $(MYSQLPP_CXXFLAGS) $(CPPDEPS) $< + +mysqlpp_null.o: ./lib/null.cpp + $(CXX) -c -o $@ $(MYSQLPP_CXXFLAGS) $(CPPDEPS) $< + +mysqlpp_options.o: ./lib/options.cpp + $(CXX) -c -o $@ $(MYSQLPP_CXXFLAGS) $(CPPDEPS) $< + +mysqlpp_qparms.o: ./lib/qparms.cpp + $(CXX) -c -o $@ $(MYSQLPP_CXXFLAGS) $(CPPDEPS) $< + +mysqlpp_query.o: ./lib/query.cpp + $(CXX) -c -o $@ $(MYSQLPP_CXXFLAGS) $(CPPDEPS) $< + +mysqlpp_result.o: ./lib/result.cpp + $(CXX) -c -o $@ $(MYSQLPP_CXXFLAGS) $(CPPDEPS) $< + +mysqlpp_row.o: ./lib/row.cpp + $(CXX) -c -o $@ $(MYSQLPP_CXXFLAGS) $(CPPDEPS) $< + +mysqlpp_scopedconnection.o: ./lib/scopedconnection.cpp + $(CXX) -c -o $@ $(MYSQLPP_CXXFLAGS) $(CPPDEPS) $< + +mysqlpp_sql_buffer.o: ./lib/sql_buffer.cpp + $(CXX) -c -o $@ $(MYSQLPP_CXXFLAGS) $(CPPDEPS) $< + +mysqlpp_sqlstream.o: ./lib/sqlstream.cpp + $(CXX) -c -o $@ $(MYSQLPP_CXXFLAGS) $(CPPDEPS) $< + +mysqlpp_ssqls2.o: ./lib/ssqls2.cpp + $(CXX) -c -o $@ $(MYSQLPP_CXXFLAGS) $(CPPDEPS) $< + +mysqlpp_stadapter.o: ./lib/stadapter.cpp + $(CXX) -c -o $@ $(MYSQLPP_CXXFLAGS) $(CPPDEPS) $< + +mysqlpp_tcp_connection.o: ./lib/tcp_connection.cpp + $(CXX) -c -o $@ $(MYSQLPP_CXXFLAGS) $(CPPDEPS) $< + +mysqlpp_transaction.o: ./lib/transaction.cpp + $(CXX) -c -o $@ $(MYSQLPP_CXXFLAGS) $(CPPDEPS) $< + +mysqlpp_type_info.o: ./lib/type_info.cpp + $(CXX) -c -o $@ $(MYSQLPP_CXXFLAGS) $(CPPDEPS) $< + +mysqlpp_uds_connection.o: ./lib/uds_connection.cpp + $(CXX) -c -o $@ $(MYSQLPP_CXXFLAGS) $(CPPDEPS) $< + +mysqlpp_utility.o: ./lib/utility.cpp + $(CXX) -c -o $@ $(MYSQLPP_CXXFLAGS) $(CPPDEPS) $< + +mysqlpp_vallist.o: ./lib/vallist.cpp + $(CXX) -c -o $@ $(MYSQLPP_CXXFLAGS) $(CPPDEPS) $< + +mysqlpp_wnp_connection.o: ./lib/wnp_connection.cpp + $(CXX) -c -o $@ $(MYSQLPP_CXXFLAGS) $(CPPDEPS) $< + +ssqls2parse_parsev2.o: ./ssx/parsev2.cpp + $(CXX) -c -o $@ $(SSQLS2PARSE_CXXFLAGS) $(CPPDEPS) $< + +ssqlsxlat_genv2.o: ./ssx/genv2.cpp + $(CXX) -c -o $@ $(SSQLSXLAT_CXXFLAGS) $(CPPDEPS) $< + +ssqlsxlat_main.o: ./ssx/main.cpp + $(CXX) -c -o $@ $(SSQLSXLAT_CXXFLAGS) $(CPPDEPS) $< + +test_array_index_array_index.o: ./test/array_index.cpp + $(CXX) -c -o $@ $(TEST_ARRAY_INDEX_CXXFLAGS) $(CPPDEPS) $< + +test_cpool_cpool.o: ./test/cpool.cpp + $(CXX) -c -o $@ $(TEST_CPOOL_CXXFLAGS) $(CPPDEPS) $< + +test_datetime_datetime.o: ./test/datetime.cpp + $(CXX) -c -o $@ $(TEST_DATETIME_CXXFLAGS) $(CPPDEPS) $< + +test_inttypes_inttypes.o: ./test/inttypes.cpp + $(CXX) -c -o $@ $(TEST_INTTYPES_CXXFLAGS) $(CPPDEPS) $< + +test_insertpolicy_insertpolicy.o: ./test/insertpolicy.cpp + $(CXX) -c -o $@ $(TEST_INSERTPOLICY_CXXFLAGS) $(CPPDEPS) $< + +test_manip_manip.o: ./test/manip.cpp + $(CXX) -c -o $@ $(TEST_MANIP_CXXFLAGS) $(CPPDEPS) $< + +test_null_comparison_null_comparison.o: ./test/null_comparison.cpp + $(CXX) -c -o $@ $(TEST_NULL_COMPARISON_CXXFLAGS) $(CPPDEPS) $< + +test_query_copy_query_copy.o: ./test/query_copy.cpp + $(CXX) -c -o $@ $(TEST_QUERY_COPY_CXXFLAGS) $(CPPDEPS) $< + +test_qssqls_qssqls.o: ./test/qssqls.cpp + $(CXX) -c -o $@ $(TEST_QSSQLS_CXXFLAGS) $(CPPDEPS) $< + +test_qstream_qstream.o: ./test/qstream.cpp + $(CXX) -c -o $@ $(TEST_QSTREAM_CXXFLAGS) $(CPPDEPS) $< + +test_sqlstream_sqlstream.o: ./test/sqlstream.cpp + $(CXX) -c -o $@ $(TEST_SQLSTREAM_CXXFLAGS) $(CPPDEPS) $< + +test_ssqls2_ssqls2.o: ./test/ssqls2.cpp + $(CXX) -c -o $@ $(TEST_SSQLS2_CXXFLAGS) $(CPPDEPS) $< + +test_string_string.o: ./test/string.cpp + $(CXX) -c -o $@ $(TEST_STRING_CXXFLAGS) $(CPPDEPS) $< + +test_tcp_tcp.o: ./test/tcp.cpp + $(CXX) -c -o $@ $(TEST_TCP_CXXFLAGS) $(CPPDEPS) $< + +test_uds_uds.o: ./test/uds.cpp + $(CXX) -c -o $@ $(TEST_UDS_CXXFLAGS) $(CPPDEPS) $< + +test_wnp_wnp.o: ./test/wnp.cpp + $(CXX) -c -o $@ $(TEST_WNP_CXXFLAGS) $(CPPDEPS) $< + +excommon_printdata.o: ./examples/printdata.cpp + $(CXX) -c -o $@ $(EXCOMMON_CXXFLAGS) $(CPPDEPS) $< + +cgi_jpeg_cgi_jpeg.o: ./examples/cgi_jpeg.cpp + $(CXX) -c -o $@ $(CGI_JPEG_CXXFLAGS) $(CPPDEPS) $< + +cpool_cpool.o: ./examples/cpool.cpp + $(CXX) -c -o $@ $(CPOOL_CXXFLAGS) $(CPPDEPS) $< + +dbinfo_dbinfo.o: ./examples/dbinfo.cpp + $(CXX) -c -o $@ $(DBINFO_CXXFLAGS) $(CPPDEPS) $< + +deadlock_deadlock.o: ./examples/deadlock.cpp + $(CXX) -c -o $@ $(DEADLOCK_CXXFLAGS) $(CPPDEPS) $< + +fieldinf_fieldinf.o: ./examples/fieldinf.cpp + $(CXX) -c -o $@ $(FIELDINF_CXXFLAGS) $(CPPDEPS) $< + +for_each_for_each.o: ./examples/for_each.cpp + $(CXX) -c -o $@ $(FOR_EACH_CXXFLAGS) $(CPPDEPS) $< + +load_jpeg_load_jpeg.o: ./examples/load_jpeg.cpp + $(CXX) -c -o $@ $(LOAD_JPEG_CXXFLAGS) $(CPPDEPS) $< + +multiquery_multiquery.o: ./examples/multiquery.cpp + $(CXX) -c -o $@ $(MULTIQUERY_CXXFLAGS) $(CPPDEPS) $< + +resetdb_resetdb.o: ./examples/resetdb.cpp + $(CXX) -c -o $@ $(RESETDB_CXXFLAGS) $(CPPDEPS) $< + +simple1_simple1.o: ./examples/simple1.cpp + $(CXX) -c -o $@ $(SIMPLE1_CXXFLAGS) $(CPPDEPS) $< + +simple2_simple2.o: ./examples/simple2.cpp + $(CXX) -c -o $@ $(SIMPLE2_CXXFLAGS) $(CPPDEPS) $< + +simple3_simple3.o: ./examples/simple3.cpp + $(CXX) -c -o $@ $(SIMPLE3_CXXFLAGS) $(CPPDEPS) $< + +ssqls1_ssqls1.o: ./examples/ssqls1.cpp + $(CXX) -c -o $@ $(SSQLS1_CXXFLAGS) $(CPPDEPS) $< + +ssqls2_ssqls2.o: ./examples/ssqls2.cpp + $(CXX) -c -o $@ $(SSQLS2_CXXFLAGS) $(CPPDEPS) $< + +ssqls3_ssqls3.o: ./examples/ssqls3.cpp + $(CXX) -c -o $@ $(SSQLS3_CXXFLAGS) $(CPPDEPS) $< + +ssqls4_ssqls4.o: ./examples/ssqls4.cpp + $(CXX) -c -o $@ $(SSQLS4_CXXFLAGS) $(CPPDEPS) $< + +ssqls5_ssqls5.o: ./examples/ssqls5.cpp + $(CXX) -c -o $@ $(SSQLS5_CXXFLAGS) $(CPPDEPS) $< + +ssqls6_ssqls6.o: ./examples/ssqls6.cpp + $(CXX) -c -o $@ $(SSQLS6_CXXFLAGS) $(CPPDEPS) $< + +store_if_store_if.o: ./examples/store_if.cpp + $(CXX) -c -o $@ $(STORE_IF_CXXFLAGS) $(CPPDEPS) $< + +tquery1_tquery1.o: ./examples/tquery1.cpp + $(CXX) -c -o $@ $(TQUERY1_CXXFLAGS) $(CPPDEPS) $< + +tquery2_tquery2.o: ./examples/tquery2.cpp + $(CXX) -c -o $@ $(TQUERY2_CXXFLAGS) $(CPPDEPS) $< + +tquery3_tquery3.o: ./examples/tquery3.cpp + $(CXX) -c -o $@ $(TQUERY3_CXXFLAGS) $(CPPDEPS) $< + +tquery4_tquery4.o: ./examples/tquery4.cpp + $(CXX) -c -o $@ $(TQUERY4_CXXFLAGS) $(CPPDEPS) $< + +transaction_transaction.o: ./examples/transaction.cpp + $(CXX) -c -o $@ $(TRANSACTION_CXXFLAGS) $(CPPDEPS) $< + +.PHONY: all clean + + +SHELL := $(COMSPEC) + +# Dependencies tracking: +-include ./*.d ADDED Makefile.simple Index: Makefile.simple ================================================================== --- /dev/null +++ Makefile.simple @@ -0,0 +1,533 @@ +# ========================================================================= +# This makefile was generated by +# Bakefile 0.2.9 (http://www.bakefile.org) +# Do not modify, all changes will be overwritten! +# ========================================================================= + + + +# ------------------------------------------------------------------------- +# These are configurable options: +# ------------------------------------------------------------------------- + +# +AR ?= ar + +# +RANLIB ?= ranlib + +# C++ compiler +CXX = g++ + +# Standard flags for C++ +CXXFLAGS ?= + +# Standard preprocessor flags (common for CC and CXX) +CPPFLAGS ?= + +# Standard linker flags +LDFLAGS ?= + +# Type of compiled binaries [debug,release] +BUILD ?= debug + + + +# ------------------------------------------------------------------------- +# Do not modify the rest of this file! +# ------------------------------------------------------------------------- + +### Variables: ### + +CPPDEPS = -MT$@ -MF`echo $@ | sed -e 's,\.o$$,.d,'` -MD -MP +TEST_ARRAY_INDEX_CXXFLAGS = $(__DEBUGINFO) $(__OPTIMIZE_FLAG) -Ilib \ + -I@MYSQL_C_INC_DIR@ -I/usr/include/mysql -I/usr/include/mysql++ $(CPPFLAGS) \ + $(CXXFLAGS) +TEST_ARRAY_INDEX_OBJECTS = \ + test_array_index_array_index.o +TEST_CPOOL_CXXFLAGS = $(__DEBUGINFO) $(__OPTIMIZE_FLAG) -Ilib \ + -I@MYSQL_C_INC_DIR@ -I/usr/include/mysql -I/usr/include/mysql++ $(CPPFLAGS) \ + $(CXXFLAGS) +TEST_CPOOL_OBJECTS = \ + test_cpool_cpool.o +TEST_DATETIME_CXXFLAGS = $(__DEBUGINFO) $(__OPTIMIZE_FLAG) -Ilib \ + -I@MYSQL_C_INC_DIR@ -I/usr/include/mysql -I/usr/include/mysql++ $(CPPFLAGS) \ + $(CXXFLAGS) +TEST_DATETIME_OBJECTS = \ + test_datetime_datetime.o +TEST_INTTYPES_CXXFLAGS = $(__DEBUGINFO) $(__OPTIMIZE_FLAG) -Ilib \ + -I@MYSQL_C_INC_DIR@ -I/usr/include/mysql -I/usr/include/mysql++ $(CPPFLAGS) \ + $(CXXFLAGS) +TEST_INTTYPES_OBJECTS = \ + test_inttypes_inttypes.o +TEST_INSERTPOLICY_CXXFLAGS = $(__DEBUGINFO) $(__OPTIMIZE_FLAG) -Ilib \ + -I@MYSQL_C_INC_DIR@ -I/usr/include/mysql -I/usr/include/mysql++ $(CPPFLAGS) \ + $(CXXFLAGS) +TEST_INSERTPOLICY_OBJECTS = \ + test_insertpolicy_insertpolicy.o +TEST_MANIP_CXXFLAGS = $(__DEBUGINFO) $(__OPTIMIZE_FLAG) -Ilib \ + -I@MYSQL_C_INC_DIR@ -I/usr/include/mysql -I/usr/include/mysql++ $(CPPFLAGS) \ + $(CXXFLAGS) +TEST_MANIP_OBJECTS = \ + test_manip_manip.o +TEST_NULL_COMPARISON_CXXFLAGS = $(__DEBUGINFO) $(__OPTIMIZE_FLAG) -Ilib \ + -I@MYSQL_C_INC_DIR@ -I/usr/include/mysql -I/usr/include/mysql++ $(CPPFLAGS) \ + $(CXXFLAGS) +TEST_NULL_COMPARISON_OBJECTS = \ + test_null_comparison_null_comparison.o +TEST_QUERY_COPY_CXXFLAGS = $(__DEBUGINFO) $(__OPTIMIZE_FLAG) -Ilib \ + -I@MYSQL_C_INC_DIR@ -I/usr/include/mysql -I/usr/include/mysql++ $(CPPFLAGS) \ + $(CXXFLAGS) +TEST_QUERY_COPY_OBJECTS = \ + test_query_copy_query_copy.o +TEST_QSSQLS_CXXFLAGS = $(__DEBUGINFO) $(__OPTIMIZE_FLAG) -Ilib \ + -I@MYSQL_C_INC_DIR@ -I/usr/include/mysql -I/usr/include/mysql++ $(CPPFLAGS) \ + $(CXXFLAGS) +TEST_QSSQLS_OBJECTS = \ + test_qssqls_qssqls.o +TEST_QSTREAM_CXXFLAGS = $(__DEBUGINFO) $(__OPTIMIZE_FLAG) -Ilib \ + -I@MYSQL_C_INC_DIR@ -I/usr/include/mysql -I/usr/include/mysql++ $(CPPFLAGS) \ + $(CXXFLAGS) +TEST_QSTREAM_OBJECTS = \ + test_qstream_qstream.o +TEST_SQLSTREAM_CXXFLAGS = $(__DEBUGINFO) $(__OPTIMIZE_FLAG) -Ilib \ + -I@MYSQL_C_INC_DIR@ -I/usr/include/mysql -I/usr/include/mysql++ $(CPPFLAGS) \ + $(CXXFLAGS) +TEST_SQLSTREAM_OBJECTS = \ + test_sqlstream_sqlstream.o +TEST_STRING_CXXFLAGS = $(__DEBUGINFO) $(__OPTIMIZE_FLAG) -Ilib \ + -I@MYSQL_C_INC_DIR@ -I/usr/include/mysql -I/usr/include/mysql++ $(CPPFLAGS) \ + $(CXXFLAGS) +TEST_STRING_OBJECTS = \ + test_string_string.o +TEST_TCP_CXXFLAGS = $(__DEBUGINFO) $(__OPTIMIZE_FLAG) -Ilib -I@MYSQL_C_INC_DIR@ \ + -I/usr/include/mysql -I/usr/include/mysql++ $(CPPFLAGS) $(CXXFLAGS) +TEST_TCP_OBJECTS = \ + test_tcp_tcp.o +TEST_UDS_CXXFLAGS = $(__DEBUGINFO) $(__OPTIMIZE_FLAG) -Ilib -I@MYSQL_C_INC_DIR@ \ + -I/usr/include/mysql -I/usr/include/mysql++ $(CPPFLAGS) $(CXXFLAGS) +TEST_UDS_OBJECTS = \ + test_uds_uds.o +TEST_WNP_CXXFLAGS = $(__DEBUGINFO) $(__OPTIMIZE_FLAG) -Ilib -I@MYSQL_C_INC_DIR@ \ + -I/usr/include/mysql -I/usr/include/mysql++ $(CPPFLAGS) $(CXXFLAGS) +TEST_WNP_OBJECTS = \ + test_wnp_wnp.o +EXCOMMON_CXXFLAGS = $(__DEBUGINFO) $(__OPTIMIZE_FLAG) -Ilib -I@MYSQL_C_INC_DIR@ \ + -I/usr/include/mysql -I/usr/include/mysql++ $(CPPFLAGS) $(CXXFLAGS) +EXCOMMON_OBJECTS = \ + excommon_printdata.o +CGI_JPEG_CXXFLAGS = $(__DEBUGINFO) $(__OPTIMIZE_FLAG) -Ilib -I@MYSQL_C_INC_DIR@ \ + -I/usr/include/mysql -I/usr/include/mysql++ $(CPPFLAGS) $(CXXFLAGS) +CGI_JPEG_OBJECTS = \ + cgi_jpeg_cgi_jpeg.o +CPOOL_CXXFLAGS = $(__DEBUGINFO) $(__OPTIMIZE_FLAG) -Ilib -I@MYSQL_C_INC_DIR@ \ + -I/usr/include/mysql -I/usr/include/mysql++ $(CPPFLAGS) $(CXXFLAGS) +CPOOL_OBJECTS = \ + cpool_cpool.o +DBINFO_CXXFLAGS = $(__DEBUGINFO) $(__OPTIMIZE_FLAG) -Ilib -I@MYSQL_C_INC_DIR@ \ + -I/usr/include/mysql -I/usr/include/mysql++ $(CPPFLAGS) $(CXXFLAGS) +DBINFO_OBJECTS = \ + dbinfo_dbinfo.o +DEADLOCK_CXXFLAGS = $(__DEBUGINFO) $(__OPTIMIZE_FLAG) -Ilib -I@MYSQL_C_INC_DIR@ \ + -I/usr/include/mysql -I/usr/include/mysql++ $(CPPFLAGS) $(CXXFLAGS) +DEADLOCK_OBJECTS = \ + deadlock_deadlock.o +FIELDINF_CXXFLAGS = $(__DEBUGINFO) $(__OPTIMIZE_FLAG) -Ilib -I@MYSQL_C_INC_DIR@ \ + -I/usr/include/mysql -I/usr/include/mysql++ $(CPPFLAGS) $(CXXFLAGS) +FIELDINF_OBJECTS = \ + fieldinf_fieldinf.o +FOR_EACH_CXXFLAGS = $(__DEBUGINFO) $(__OPTIMIZE_FLAG) -Ilib -I@MYSQL_C_INC_DIR@ \ + -I/usr/include/mysql -I/usr/include/mysql++ $(CPPFLAGS) $(CXXFLAGS) +FOR_EACH_OBJECTS = \ + for_each_for_each.o +LOAD_JPEG_CXXFLAGS = $(__DEBUGINFO) $(__OPTIMIZE_FLAG) -Ilib \ + -I@MYSQL_C_INC_DIR@ -I/usr/include/mysql -I/usr/include/mysql++ $(CPPFLAGS) \ + $(CXXFLAGS) +LOAD_JPEG_OBJECTS = \ + load_jpeg_load_jpeg.o +MULTIQUERY_CXXFLAGS = $(__DEBUGINFO) $(__OPTIMIZE_FLAG) -Ilib \ + -I@MYSQL_C_INC_DIR@ -I/usr/include/mysql -I/usr/include/mysql++ $(CPPFLAGS) \ + $(CXXFLAGS) +MULTIQUERY_OBJECTS = \ + multiquery_multiquery.o +RESETDB_CXXFLAGS = $(__DEBUGINFO) $(__OPTIMIZE_FLAG) -Ilib -I@MYSQL_C_INC_DIR@ \ + -I/usr/include/mysql -I/usr/include/mysql++ $(CPPFLAGS) $(CXXFLAGS) +RESETDB_OBJECTS = \ + resetdb_resetdb.o +SIMPLE1_CXXFLAGS = $(__DEBUGINFO) $(__OPTIMIZE_FLAG) -Ilib -I@MYSQL_C_INC_DIR@ \ + -I/usr/include/mysql -I/usr/include/mysql++ $(CPPFLAGS) $(CXXFLAGS) +SIMPLE1_OBJECTS = \ + simple1_simple1.o +SIMPLE2_CXXFLAGS = $(__DEBUGINFO) $(__OPTIMIZE_FLAG) -Ilib -I@MYSQL_C_INC_DIR@ \ + -I/usr/include/mysql -I/usr/include/mysql++ $(CPPFLAGS) $(CXXFLAGS) +SIMPLE2_OBJECTS = \ + simple2_simple2.o +SIMPLE3_CXXFLAGS = $(__DEBUGINFO) $(__OPTIMIZE_FLAG) -Ilib -I@MYSQL_C_INC_DIR@ \ + -I/usr/include/mysql -I/usr/include/mysql++ $(CPPFLAGS) $(CXXFLAGS) +SIMPLE3_OBJECTS = \ + simple3_simple3.o +SSQLS1_CXXFLAGS = $(__DEBUGINFO) $(__OPTIMIZE_FLAG) -Ilib -I@MYSQL_C_INC_DIR@ \ + -I/usr/include/mysql -I/usr/include/mysql++ $(CPPFLAGS) $(CXXFLAGS) +SSQLS1_OBJECTS = \ + ssqls1_ssqls1.o +SSQLS2_CXXFLAGS = $(__DEBUGINFO) $(__OPTIMIZE_FLAG) -Ilib -I@MYSQL_C_INC_DIR@ \ + -I/usr/include/mysql -I/usr/include/mysql++ $(CPPFLAGS) $(CXXFLAGS) +SSQLS2_OBJECTS = \ + ssqls2_ssqls2.o +SSQLS3_CXXFLAGS = $(__DEBUGINFO) $(__OPTIMIZE_FLAG) -Ilib -I@MYSQL_C_INC_DIR@ \ + -I/usr/include/mysql -I/usr/include/mysql++ $(CPPFLAGS) $(CXXFLAGS) +SSQLS3_OBJECTS = \ + ssqls3_ssqls3.o +SSQLS4_CXXFLAGS = $(__DEBUGINFO) $(__OPTIMIZE_FLAG) -Ilib -I@MYSQL_C_INC_DIR@ \ + -I/usr/include/mysql -I/usr/include/mysql++ $(CPPFLAGS) $(CXXFLAGS) +SSQLS4_OBJECTS = \ + ssqls4_ssqls4.o +SSQLS5_CXXFLAGS = $(__DEBUGINFO) $(__OPTIMIZE_FLAG) -Ilib -I@MYSQL_C_INC_DIR@ \ + -I/usr/include/mysql -I/usr/include/mysql++ $(CPPFLAGS) $(CXXFLAGS) +SSQLS5_OBJECTS = \ + ssqls5_ssqls5.o +SSQLS6_CXXFLAGS = $(__DEBUGINFO) $(__OPTIMIZE_FLAG) -Ilib -I@MYSQL_C_INC_DIR@ \ + -I/usr/include/mysql -I/usr/include/mysql++ $(CPPFLAGS) $(CXXFLAGS) +SSQLS6_OBJECTS = \ + ssqls6_ssqls6.o +STORE_IF_CXXFLAGS = $(__DEBUGINFO) $(__OPTIMIZE_FLAG) -Ilib -I@MYSQL_C_INC_DIR@ \ + -I/usr/include/mysql -I/usr/include/mysql++ $(CPPFLAGS) $(CXXFLAGS) +STORE_IF_OBJECTS = \ + store_if_store_if.o +TQUERY1_CXXFLAGS = $(__DEBUGINFO) $(__OPTIMIZE_FLAG) -Ilib -I@MYSQL_C_INC_DIR@ \ + -I/usr/include/mysql -I/usr/include/mysql++ $(CPPFLAGS) $(CXXFLAGS) +TQUERY1_OBJECTS = \ + tquery1_tquery1.o +TQUERY2_CXXFLAGS = $(__DEBUGINFO) $(__OPTIMIZE_FLAG) -Ilib -I@MYSQL_C_INC_DIR@ \ + -I/usr/include/mysql -I/usr/include/mysql++ $(CPPFLAGS) $(CXXFLAGS) +TQUERY2_OBJECTS = \ + tquery2_tquery2.o +TQUERY3_CXXFLAGS = $(__DEBUGINFO) $(__OPTIMIZE_FLAG) -Ilib -I@MYSQL_C_INC_DIR@ \ + -I/usr/include/mysql -I/usr/include/mysql++ $(CPPFLAGS) $(CXXFLAGS) +TQUERY3_OBJECTS = \ + tquery3_tquery3.o +TQUERY4_CXXFLAGS = $(__DEBUGINFO) $(__OPTIMIZE_FLAG) -Ilib -I@MYSQL_C_INC_DIR@ \ + -I/usr/include/mysql -I/usr/include/mysql++ $(CPPFLAGS) $(CXXFLAGS) +TQUERY4_OBJECTS = \ + tquery4_tquery4.o +TRANSACTION_CXXFLAGS = $(__DEBUGINFO) $(__OPTIMIZE_FLAG) -Ilib \ + -I@MYSQL_C_INC_DIR@ -I/usr/include/mysql -I/usr/include/mysql++ $(CPPFLAGS) \ + $(CXXFLAGS) +TRANSACTION_OBJECTS = \ + transaction_transaction.o + +### Conditionally set variables: ### + +ifeq ($(BUILD),debug) +__OPTIMIZE_FLAG = -O0 +endif +ifeq ($(BUILD),release) +__OPTIMIZE_FLAG = -O2 +endif +ifeq ($(BUILD),debug) +__DEBUGINFO = -g +endif +ifeq ($(BUILD),release) +__DEBUGINFO = +endif + + +### Targets: ### + +all: test_array_index test_cpool test_datetime test_inttypes test_insertpolicy test_manip test_null_comparison test_query_copy test_qssqls test_qstream test_sqlstream test_string test_tcp test_uds test_wnp libmysqlpp_excommon.a cgi_jpeg cpool dbinfo deadlock fieldinf for_each load_jpeg multiquery resetdb simple1 simple2 simple3 ssqls1 ssqls2 ssqls3 ssqls4 ssqls5 ssqls6 store_if tquery1 tquery2 tquery3 tquery4 transaction + +install: + +uninstall: + +clean: + rm -f ./*.o + rm -f ./*.d + rm -f test_array_index + rm -f test_cpool + rm -f test_datetime + rm -f test_inttypes + rm -f test_insertpolicy + rm -f test_manip + rm -f test_null_comparison + rm -f test_query_copy + rm -f test_qssqls + rm -f test_qstream + rm -f test_sqlstream + rm -f test_string + rm -f test_tcp + rm -f test_uds + rm -f test_wnp + rm -f libmysqlpp_excommon.a + rm -f cgi_jpeg + rm -f cpool + rm -f dbinfo + rm -f deadlock + rm -f fieldinf + rm -f for_each + rm -f load_jpeg + rm -f multiquery + rm -f resetdb + rm -f simple1 + rm -f simple2 + rm -f simple3 + rm -f ssqls1 + rm -f ssqls2 + rm -f ssqls3 + rm -f ssqls4 + rm -f ssqls5 + rm -f ssqls6 + rm -f store_if + rm -f tquery1 + rm -f tquery2 + rm -f tquery3 + rm -f tquery4 + rm -f transaction + +test_array_index: $(TEST_ARRAY_INDEX_OBJECTS) + $(CXX) -o $@ $(TEST_ARRAY_INDEX_OBJECTS) $(__DEBUGINFO) -L@MYSQL_C_LIB_DIR@ -L. $(LDFLAGS) -lmysqlpp -lmysqlclient + +test_cpool: $(TEST_CPOOL_OBJECTS) + $(CXX) -o $@ $(TEST_CPOOL_OBJECTS) $(__DEBUGINFO) -L@MYSQL_C_LIB_DIR@ -L. $(LDFLAGS) -lmysqlpp -lmysqlclient + +test_datetime: $(TEST_DATETIME_OBJECTS) + $(CXX) -o $@ $(TEST_DATETIME_OBJECTS) $(__DEBUGINFO) -L@MYSQL_C_LIB_DIR@ -L. $(LDFLAGS) -lmysqlpp -lmysqlclient + +test_inttypes: $(TEST_INTTYPES_OBJECTS) + $(CXX) -o $@ $(TEST_INTTYPES_OBJECTS) $(__DEBUGINFO) -L@MYSQL_C_LIB_DIR@ -L. $(LDFLAGS) -lmysqlpp -lmysqlclient + +test_insertpolicy: $(TEST_INSERTPOLICY_OBJECTS) + $(CXX) -o $@ $(TEST_INSERTPOLICY_OBJECTS) $(__DEBUGINFO) -L@MYSQL_C_LIB_DIR@ -L. $(LDFLAGS) -lmysqlpp -lmysqlclient + +test_manip: $(TEST_MANIP_OBJECTS) + $(CXX) -o $@ $(TEST_MANIP_OBJECTS) $(__DEBUGINFO) -L@MYSQL_C_LIB_DIR@ -L. $(LDFLAGS) -lmysqlpp -lmysqlclient + +test_null_comparison: $(TEST_NULL_COMPARISON_OBJECTS) + $(CXX) -o $@ $(TEST_NULL_COMPARISON_OBJECTS) $(__DEBUGINFO) -L@MYSQL_C_LIB_DIR@ -L. $(LDFLAGS) -lmysqlpp -lmysqlclient + +test_query_copy: $(TEST_QUERY_COPY_OBJECTS) + $(CXX) -o $@ $(TEST_QUERY_COPY_OBJECTS) $(__DEBUGINFO) -L@MYSQL_C_LIB_DIR@ -L. $(LDFLAGS) -lmysqlpp -lmysqlclient + +test_qssqls: $(TEST_QSSQLS_OBJECTS) + $(CXX) -o $@ $(TEST_QSSQLS_OBJECTS) $(__DEBUGINFO) -L@MYSQL_C_LIB_DIR@ -L. $(LDFLAGS) -lmysqlpp -lmysqlclient + +test_qstream: $(TEST_QSTREAM_OBJECTS) + $(CXX) -o $@ $(TEST_QSTREAM_OBJECTS) $(__DEBUGINFO) -L@MYSQL_C_LIB_DIR@ -L. $(LDFLAGS) -lmysqlpp -lmysqlclient + +test_sqlstream: $(TEST_SQLSTREAM_OBJECTS) + $(CXX) -o $@ $(TEST_SQLSTREAM_OBJECTS) $(__DEBUGINFO) -L@MYSQL_C_LIB_DIR@ -L. $(LDFLAGS) -lmysqlpp -lmysqlclient + +test_string: $(TEST_STRING_OBJECTS) + $(CXX) -o $@ $(TEST_STRING_OBJECTS) $(__DEBUGINFO) -L@MYSQL_C_LIB_DIR@ -L. $(LDFLAGS) -lmysqlpp -lmysqlclient + +test_tcp: $(TEST_TCP_OBJECTS) + $(CXX) -o $@ $(TEST_TCP_OBJECTS) $(__DEBUGINFO) -L@MYSQL_C_LIB_DIR@ -L. $(LDFLAGS) -lmysqlpp -lmysqlclient + +test_uds: $(TEST_UDS_OBJECTS) + $(CXX) -o $@ $(TEST_UDS_OBJECTS) $(__DEBUGINFO) -L@MYSQL_C_LIB_DIR@ -L. $(LDFLAGS) -lmysqlpp -lmysqlclient + +test_wnp: $(TEST_WNP_OBJECTS) + $(CXX) -o $@ $(TEST_WNP_OBJECTS) $(__DEBUGINFO) -L@MYSQL_C_LIB_DIR@ -L. $(LDFLAGS) -lmysqlpp -lmysqlclient + +libmysqlpp_excommon.a: $(EXCOMMON_OBJECTS) + rm -f $@ + $(AR) rcu $@ $(EXCOMMON_OBJECTS) + $(RANLIB) $@ + +cgi_jpeg: $(CGI_JPEG_OBJECTS) libmysqlpp_excommon.a + $(CXX) -o $@ $(CGI_JPEG_OBJECTS) $(__DEBUGINFO) -L@MYSQL_C_LIB_DIR@ -L. $(LDFLAGS) -lmysqlpp_excommon -lmysqlpp -lmysqlclient + +cpool: $(CPOOL_OBJECTS) libmysqlpp_excommon.a + $(CXX) -o $@ $(CPOOL_OBJECTS) $(__DEBUGINFO) -L@MYSQL_C_LIB_DIR@ -L. $(LDFLAGS) -lmysqlpp_excommon -lmysqlpp -lmysqlclient + +dbinfo: $(DBINFO_OBJECTS) libmysqlpp_excommon.a + $(CXX) -o $@ $(DBINFO_OBJECTS) $(__DEBUGINFO) -L@MYSQL_C_LIB_DIR@ -L. $(LDFLAGS) -lmysqlpp_excommon -lmysqlpp -lmysqlclient + +deadlock: $(DEADLOCK_OBJECTS) libmysqlpp_excommon.a + $(CXX) -o $@ $(DEADLOCK_OBJECTS) $(__DEBUGINFO) -L@MYSQL_C_LIB_DIR@ -L. $(LDFLAGS) -lmysqlpp_excommon -lmysqlpp -lmysqlclient + +fieldinf: $(FIELDINF_OBJECTS) libmysqlpp_excommon.a + $(CXX) -o $@ $(FIELDINF_OBJECTS) $(__DEBUGINFO) -L@MYSQL_C_LIB_DIR@ -L. $(LDFLAGS) -lmysqlpp_excommon -lmysqlpp -lmysqlclient + +for_each: $(FOR_EACH_OBJECTS) libmysqlpp_excommon.a + $(CXX) -o $@ $(FOR_EACH_OBJECTS) $(__DEBUGINFO) -L@MYSQL_C_LIB_DIR@ -L. $(LDFLAGS) -lmysqlpp_excommon -lmysqlpp -lmysqlclient + +load_jpeg: $(LOAD_JPEG_OBJECTS) libmysqlpp_excommon.a + $(CXX) -o $@ $(LOAD_JPEG_OBJECTS) $(__DEBUGINFO) -L@MYSQL_C_LIB_DIR@ -L. $(LDFLAGS) -lmysqlpp_excommon -lmysqlpp -lmysqlclient + +multiquery: $(MULTIQUERY_OBJECTS) libmysqlpp_excommon.a + $(CXX) -o $@ $(MULTIQUERY_OBJECTS) $(__DEBUGINFO) -L@MYSQL_C_LIB_DIR@ -L. $(LDFLAGS) -lmysqlpp_excommon -lmysqlpp -lmysqlclient + +resetdb: $(RESETDB_OBJECTS) libmysqlpp_excommon.a + $(CXX) -o $@ $(RESETDB_OBJECTS) $(__DEBUGINFO) -L@MYSQL_C_LIB_DIR@ -L. $(LDFLAGS) -lmysqlpp_excommon -lmysqlpp -lmysqlclient + +simple1: $(SIMPLE1_OBJECTS) libmysqlpp_excommon.a + $(CXX) -o $@ $(SIMPLE1_OBJECTS) $(__DEBUGINFO) -L@MYSQL_C_LIB_DIR@ -L. $(LDFLAGS) -lmysqlpp_excommon -lmysqlpp -lmysqlclient + +simple2: $(SIMPLE2_OBJECTS) libmysqlpp_excommon.a + $(CXX) -o $@ $(SIMPLE2_OBJECTS) $(__DEBUGINFO) -L@MYSQL_C_LIB_DIR@ -L. $(LDFLAGS) -lmysqlpp_excommon -lmysqlpp -lmysqlclient + +simple3: $(SIMPLE3_OBJECTS) libmysqlpp_excommon.a + $(CXX) -o $@ $(SIMPLE3_OBJECTS) $(__DEBUGINFO) -L@MYSQL_C_LIB_DIR@ -L. $(LDFLAGS) -lmysqlpp_excommon -lmysqlpp -lmysqlclient + +ssqls1: $(SSQLS1_OBJECTS) libmysqlpp_excommon.a + $(CXX) -o $@ $(SSQLS1_OBJECTS) $(__DEBUGINFO) -L@MYSQL_C_LIB_DIR@ -L. $(LDFLAGS) -lmysqlpp_excommon -lmysqlpp -lmysqlclient + +ssqls2: $(SSQLS2_OBJECTS) libmysqlpp_excommon.a + $(CXX) -o $@ $(SSQLS2_OBJECTS) $(__DEBUGINFO) -L@MYSQL_C_LIB_DIR@ -L. $(LDFLAGS) -lmysqlpp_excommon -lmysqlpp -lmysqlclient + +ssqls3: $(SSQLS3_OBJECTS) libmysqlpp_excommon.a + $(CXX) -o $@ $(SSQLS3_OBJECTS) $(__DEBUGINFO) -L@MYSQL_C_LIB_DIR@ -L. $(LDFLAGS) -lmysqlpp_excommon -lmysqlpp -lmysqlclient + +ssqls4: $(SSQLS4_OBJECTS) libmysqlpp_excommon.a + $(CXX) -o $@ $(SSQLS4_OBJECTS) $(__DEBUGINFO) -L@MYSQL_C_LIB_DIR@ -L. $(LDFLAGS) -lmysqlpp_excommon -lmysqlpp -lmysqlclient + +ssqls5: $(SSQLS5_OBJECTS) libmysqlpp_excommon.a + $(CXX) -o $@ $(SSQLS5_OBJECTS) $(__DEBUGINFO) -L@MYSQL_C_LIB_DIR@ -L. $(LDFLAGS) -lmysqlpp_excommon -lmysqlpp -lmysqlclient + +ssqls6: $(SSQLS6_OBJECTS) libmysqlpp_excommon.a + $(CXX) -o $@ $(SSQLS6_OBJECTS) $(__DEBUGINFO) -L@MYSQL_C_LIB_DIR@ -L. $(LDFLAGS) -lmysqlpp_excommon -lmysqlpp -lmysqlclient + +store_if: $(STORE_IF_OBJECTS) libmysqlpp_excommon.a + $(CXX) -o $@ $(STORE_IF_OBJECTS) $(__DEBUGINFO) -L@MYSQL_C_LIB_DIR@ -L. $(LDFLAGS) -lmysqlpp_excommon -lmysqlpp -lmysqlclient + +tquery1: $(TQUERY1_OBJECTS) libmysqlpp_excommon.a + $(CXX) -o $@ $(TQUERY1_OBJECTS) $(__DEBUGINFO) -L@MYSQL_C_LIB_DIR@ -L. $(LDFLAGS) -lmysqlpp_excommon -lmysqlpp -lmysqlclient + +tquery2: $(TQUERY2_OBJECTS) libmysqlpp_excommon.a + $(CXX) -o $@ $(TQUERY2_OBJECTS) $(__DEBUGINFO) -L@MYSQL_C_LIB_DIR@ -L. $(LDFLAGS) -lmysqlpp_excommon -lmysqlpp -lmysqlclient + +tquery3: $(TQUERY3_OBJECTS) libmysqlpp_excommon.a + $(CXX) -o $@ $(TQUERY3_OBJECTS) $(__DEBUGINFO) -L@MYSQL_C_LIB_DIR@ -L. $(LDFLAGS) -lmysqlpp_excommon -lmysqlpp -lmysqlclient + +tquery4: $(TQUERY4_OBJECTS) libmysqlpp_excommon.a + $(CXX) -o $@ $(TQUERY4_OBJECTS) $(__DEBUGINFO) -L@MYSQL_C_LIB_DIR@ -L. $(LDFLAGS) -lmysqlpp_excommon -lmysqlpp -lmysqlclient + +transaction: $(TRANSACTION_OBJECTS) libmysqlpp_excommon.a + $(CXX) -o $@ $(TRANSACTION_OBJECTS) $(__DEBUGINFO) -L@MYSQL_C_LIB_DIR@ -L. $(LDFLAGS) -lmysqlpp_excommon -lmysqlpp -lmysqlclient + +test_array_index_array_index.o: ./test/array_index.cpp + $(CXX) -c -o $@ $(TEST_ARRAY_INDEX_CXXFLAGS) $(CPPDEPS) $< + +test_cpool_cpool.o: ./test/cpool.cpp + $(CXX) -c -o $@ $(TEST_CPOOL_CXXFLAGS) $(CPPDEPS) $< + +test_datetime_datetime.o: ./test/datetime.cpp + $(CXX) -c -o $@ $(TEST_DATETIME_CXXFLAGS) $(CPPDEPS) $< + +test_inttypes_inttypes.o: ./test/inttypes.cpp + $(CXX) -c -o $@ $(TEST_INTTYPES_CXXFLAGS) $(CPPDEPS) $< + +test_insertpolicy_insertpolicy.o: ./test/insertpolicy.cpp + $(CXX) -c -o $@ $(TEST_INSERTPOLICY_CXXFLAGS) $(CPPDEPS) $< + +test_manip_manip.o: ./test/manip.cpp + $(CXX) -c -o $@ $(TEST_MANIP_CXXFLAGS) $(CPPDEPS) $< + +test_null_comparison_null_comparison.o: ./test/null_comparison.cpp + $(CXX) -c -o $@ $(TEST_NULL_COMPARISON_CXXFLAGS) $(CPPDEPS) $< + +test_query_copy_query_copy.o: ./test/query_copy.cpp + $(CXX) -c -o $@ $(TEST_QUERY_COPY_CXXFLAGS) $(CPPDEPS) $< + +test_qssqls_qssqls.o: ./test/qssqls.cpp + $(CXX) -c -o $@ $(TEST_QSSQLS_CXXFLAGS) $(CPPDEPS) $< + +test_qstream_qstream.o: ./test/qstream.cpp + $(CXX) -c -o $@ $(TEST_QSTREAM_CXXFLAGS) $(CPPDEPS) $< + +test_sqlstream_sqlstream.o: ./test/sqlstream.cpp + $(CXX) -c -o $@ $(TEST_SQLSTREAM_CXXFLAGS) $(CPPDEPS) $< + +test_string_string.o: ./test/string.cpp + $(CXX) -c -o $@ $(TEST_STRING_CXXFLAGS) $(CPPDEPS) $< + +test_tcp_tcp.o: ./test/tcp.cpp + $(CXX) -c -o $@ $(TEST_TCP_CXXFLAGS) $(CPPDEPS) $< + +test_uds_uds.o: ./test/uds.cpp + $(CXX) -c -o $@ $(TEST_UDS_CXXFLAGS) $(CPPDEPS) $< + +test_wnp_wnp.o: ./test/wnp.cpp + $(CXX) -c -o $@ $(TEST_WNP_CXXFLAGS) $(CPPDEPS) $< + +excommon_printdata.o: ./examples/printdata.cpp + $(CXX) -c -o $@ $(EXCOMMON_CXXFLAGS) $(CPPDEPS) $< + +cgi_jpeg_cgi_jpeg.o: ./examples/cgi_jpeg.cpp + $(CXX) -c -o $@ $(CGI_JPEG_CXXFLAGS) $(CPPDEPS) $< + +cpool_cpool.o: ./examples/cpool.cpp + $(CXX) -c -o $@ $(CPOOL_CXXFLAGS) $(CPPDEPS) $< + +dbinfo_dbinfo.o: ./examples/dbinfo.cpp + $(CXX) -c -o $@ $(DBINFO_CXXFLAGS) $(CPPDEPS) $< + +deadlock_deadlock.o: ./examples/deadlock.cpp + $(CXX) -c -o $@ $(DEADLOCK_CXXFLAGS) $(CPPDEPS) $< + +fieldinf_fieldinf.o: ./examples/fieldinf.cpp + $(CXX) -c -o $@ $(FIELDINF_CXXFLAGS) $(CPPDEPS) $< + +for_each_for_each.o: ./examples/for_each.cpp + $(CXX) -c -o $@ $(FOR_EACH_CXXFLAGS) $(CPPDEPS) $< + +load_jpeg_load_jpeg.o: ./examples/load_jpeg.cpp + $(CXX) -c -o $@ $(LOAD_JPEG_CXXFLAGS) $(CPPDEPS) $< + +multiquery_multiquery.o: ./examples/multiquery.cpp + $(CXX) -c -o $@ $(MULTIQUERY_CXXFLAGS) $(CPPDEPS) $< + +resetdb_resetdb.o: ./examples/resetdb.cpp + $(CXX) -c -o $@ $(RESETDB_CXXFLAGS) $(CPPDEPS) $< + +simple1_simple1.o: ./examples/simple1.cpp + $(CXX) -c -o $@ $(SIMPLE1_CXXFLAGS) $(CPPDEPS) $< + +simple2_simple2.o: ./examples/simple2.cpp + $(CXX) -c -o $@ $(SIMPLE2_CXXFLAGS) $(CPPDEPS) $< + +simple3_simple3.o: ./examples/simple3.cpp + $(CXX) -c -o $@ $(SIMPLE3_CXXFLAGS) $(CPPDEPS) $< + +ssqls1_ssqls1.o: ./examples/ssqls1.cpp + $(CXX) -c -o $@ $(SSQLS1_CXXFLAGS) $(CPPDEPS) $< + +ssqls2_ssqls2.o: ./examples/ssqls2.cpp + $(CXX) -c -o $@ $(SSQLS2_CXXFLAGS) $(CPPDEPS) $< + +ssqls3_ssqls3.o: ./examples/ssqls3.cpp + $(CXX) -c -o $@ $(SSQLS3_CXXFLAGS) $(CPPDEPS) $< + +ssqls4_ssqls4.o: ./examples/ssqls4.cpp + $(CXX) -c -o $@ $(SSQLS4_CXXFLAGS) $(CPPDEPS) $< + +ssqls5_ssqls5.o: ./examples/ssqls5.cpp + $(CXX) -c -o $@ $(SSQLS5_CXXFLAGS) $(CPPDEPS) $< + +ssqls6_ssqls6.o: ./examples/ssqls6.cpp + $(CXX) -c -o $@ $(SSQLS6_CXXFLAGS) $(CPPDEPS) $< + +store_if_store_if.o: ./examples/store_if.cpp + $(CXX) -c -o $@ $(STORE_IF_CXXFLAGS) $(CPPDEPS) $< + +tquery1_tquery1.o: ./examples/tquery1.cpp + $(CXX) -c -o $@ $(TQUERY1_CXXFLAGS) $(CPPDEPS) $< + +tquery2_tquery2.o: ./examples/tquery2.cpp + $(CXX) -c -o $@ $(TQUERY2_CXXFLAGS) $(CPPDEPS) $< + +tquery3_tquery3.o: ./examples/tquery3.cpp + $(CXX) -c -o $@ $(TQUERY3_CXXFLAGS) $(CPPDEPS) $< + +tquery4_tquery4.o: ./examples/tquery4.cpp + $(CXX) -c -o $@ $(TQUERY4_CXXFLAGS) $(CPPDEPS) $< + +transaction_transaction.o: ./examples/transaction.cpp + $(CXX) -c -o $@ $(TRANSACTION_CXXFLAGS) $(CPPDEPS) $< + +.PHONY: all install uninstall clean + + +# Dependencies tracking: +-include ./*.d DELETED README Index: README ================================================================== --- README +++ /dev/null @@ -1,64 +0,0 @@ -WHAT IT IS - - MySQL++ is a C++ wrapper for MySQL's C API. - - For authorship credits, see the CREDITS file. - - Send feedback to the MySQL++ mailing list: - - http://lists.mysql.com/plusplus/ - - -BUILDING THE LIBRARY - - MySQL++ has two supported build systems. - - The first is based on the GNU autotools (autoconf, automake, - and libtool), and is primarily for Unixy[*] systems. To build - the library on such a system, the minimum build commands are: - - $ ./configure - $ make - $ su - # make install - - See README.unix for further details, including useful flags for - the configure script. - - [*] Unixy = Linux, Mac OS X, Cygwin, and the "real" Unices. - Does not include MinGW, MKS, or Microsoft SFU. - - - For Win32-based systems other than Cygwin, use makemake.bat. - If your platform is one of those supported, it will have a - secondary README file in this directory with more details. - - - If your system isn't supported by the autotools or makemake.bat - systems, you will have to either add that support, or find some - way to build the library yourself. We welcome patches to add new - platform support on the mailing list. We would much prefer to - have extensions to the existing build systems than completely - new systems, such as project files for proprietary IDEs. - We may accept such files, but the project's history shows that - they tend to be neglected as new library features are added. - We're therefore reluctant to accept these. - - -EXAMPLE PROGRAMS - - You may want to try out the programs in the examples subdirectory - to ensure that the MySQL++ API and your MySQL database are both - working properly. Also, these examples give many examples of the - proper use of MySQL++. See examples/README for further details. - - -IF YOU WANT TO HACK ON MYSQL++... - - If you intend to change the library or example code, please read - the HACKERS file. - - If you want to change the user manual, read doc/userman/README. - - If you want to change the reference manual, see the Doxygen - manual: http://www.stack.nl/~dimitri/doxygen/manual.html ADDED README-Cygwin.txt Index: README-Cygwin.txt ================================================================== --- /dev/null +++ README-Cygwin.txt @@ -0,0 +1,22 @@ +Prerequisite: Install MySQL +~~~~~~~~~~~~~~~~~~~~~~~~~~~ + Before you can build MySQL++, you need to install the + libmysqlclient-devel package with Cygwin's setup.exe. + + In the past, you had to build MySQL from source, since + there was no reliable place to get a binary version of the + client library for Cygwin. If you must still do this for + some reason, here's a hint on how to build just the client + library, since you probably will be running either a native + Windows version of the server, or have the server installed + on another machine entirely: + + $ ./configure --prefix=/usr --sysconfdir=/etc --localstatedir=/var \ + --infodir=/usr/share/info --mandir=/usr/share/man \ + --disable-shared --without-{debug,readline,libedit,server} + + +Building the Library and Example Programs +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + Having done that, Cygwin behaves like any other Unixy system. + See the instructions in README-Unix.txt. ADDED README-Linux.txt Index: README-Linux.txt ================================================================== --- /dev/null +++ README-Linux.txt @@ -0,0 +1,84 @@ +Linux is basically Unix, so README-Unix.txt covers the generic bits. +I'll just cover a few of the issues specific to Linux here. + + +Prerequisite: Install the MySQL Development Files +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + MySQL++ is built on top of the MySQL C API library, so it needs the + C API development files to build against. Most distributions of + the MySQL server for Linux don't come with these development files; + they're packaged separately. This is because you don't actually + need the server on your development machine, though it's often more + convenient to use a local server than a remote one, for testing. + + There are about as many different ways to get the C API development + files on your system as there are major Linux distributions. + More actually, because you also have the option of the official + MySQL binaries from mysql.com: + + http://dev.mysql.com/downloads/mysql/5.0.html#linux + + For RPM-based distributions, MySQL comes in several different + packages. You need at least the -devel and the -shared packages + to build MySQL++. + + The other binary distributions seem to come in just a single file, + presumably with everything included. + + You can also build from source, in which case you will also get + the entire kit and kaboodle. + + MySQL frequently comes with Linux distributions as well. If your + distribution doesn't come with at least MySQL v4.1, I recommend + using the official MySQL.com packages instead. MySQL++ can be + made to run with 4.0 and older, but it takes some work. + + On Red Hat type systems with yum, say: + + # yum install mysql-devel + + If you want to use rpm directly, you need that package and probably + the base mysql package as well. + + On Debian/Ubuntu type systems, say: + + $ sudo apt-get install libmysqlclient15-dev + + The version number is the ABI version of the MySQL C API library. + ABI version 15 corresponds to MySQL version 5.0, the recommended + stable version as of this writing. + + +Dealing with the Dynamic Linker, ld.so +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + ld.so is a system-level program on Linux which is used to run any + program that uses shared libraries (lib*.so). Its job is to find + the libraries and link them to the base executable so it will run. + + Because ld.so only looks in a few places for libraries on most + systems, a common problem is a program that builds without error + but won't run, complaining about libmysqlpp.SOMETHING. + + There are a number of ways to deal with this. + + First, you could just configure MySQL++ to install under /usr + instead of /usr/local, like system-provided packages: + + $ ./configure --prefix=/usr + + This isn't recommended practice when building packages from source, + but it does work. + + Second, you can add the MySQL++ library directory to the + LD_LIBRARY_PATH environment variable. This works like the shell's + PATH variable: a colon-separated list of directories to search. + This is best when the installation directory is something totally + uncommon, or you don't have root permissions on the box so you + can't do the next option. + + Finally, the most robust way to tell ld.so about a nonstandard + library directory is to put it in /etc/ld.so.conf or in one of + the files included from there. Then, run ldconfig as root to + rebuild the cache file ld.so uses to find libraries in these + nonstandard directories. Running ldconfig isn't necessary for + the previous two methods. ADDED README-Mac-OS-X.txt Index: README-Mac-OS-X.txt ================================================================== --- /dev/null +++ README-Mac-OS-X.txt @@ -0,0 +1,134 @@ +Building MySQL++ +~~~~~~~~~~~~~~~~ + There are two major ways to build MySQL++: from the command line, or + from within the Xcode IDE. + + MySQL++ has its roots in Unix and Linux, like MySQL itself. As a + result, the most well-supported way to build MySQL++ is from the + command line, or Terminal as Apple likes to call it. See + README-Unix.txt for the generic instructions. Further Mac-specific + details are given elsewhere in this file. + + The option to build MySQL++ from within Xcode is new. We added + experimental support for it in 3.0.0, but it didn't actually get + tested and debugged until 3.1.0. It may still be buggy, and over + time it's more likely to break again than the command line method, + simply because it receives less testing during development. Even + fully functional, it is less flexible than building from the command + line; Xcode's project system cannot match the power available within + the autotools build system. + + If you try the Xcode method and find that it doesn't work, the + easiest way around that roadblock is to build from the command line + instead. If you're the adventurous sort and want to contribute to + the development of MySQL++, see the file HACKERS.txt for more info + on fixing the source file used as input in the project file + generation process. We don't want fixed project files, we want a + process that lets us consistently generate correct project files. + + +Prerequisite: Install the MySQL Development Files +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + MySQL++ is built on top of the MySQL C API library, so for MySQL++ + to build, it needs at least that library and its header files + installed. You don't need the server itself installed on your + development machine, though it's often helpful anyway, for testing. + There are many suitable sources: + + - The simplest option is to download the MySQL server DMG from + mysql.com. In addition to the C API files you absolultely must + have, this gives you a nice Mac-like installation procedure and a + preference pane for bringing the server up and down and setting it + to start on system boot. + + - If you really only want the C API development files, MySQL offers + them separately as Connector/C. As of this writing, you get the + files as a tarball, and you have to copy its contents to some + suitable location on your hard drive. If you're using Xcode to + build MySQL++, you'll want to put them under /usr/local/mysql. + MySQL++'s command line build system is far more tolerant, looking + there and in many other typical locations. + + - If you use Fink, you can install the C API files with: + + $ fink install mysql15-dev + + If you also want a local MySQL server, say this instead: + + $ fink install mysql mysql15-dev + + - From MacPorts, http://macports.org. I have zero information on + this other than that it's theoretically possible for it to work. + If you figure out how to make it work, please post the method + to the mailing list so I can update this document. + + +Dealing with the 64-Bit Transition in Snow Leopard +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + Xcode for Snow Leopard installs two independent versions of the GNU + Compiler Collection. The default is GCC 4.2, and it is set up to + build 64-bit executables by default, even if your system is booted + into 32-bit mode. You also get GCC 4.0, which builds 32-bit + executables by default. On top of that, you have the confusion + added by Apple's decision to make all 64-bit capable machines boot + into 32-bit mode by default, except for the Xserves. + + The first symptom most people run into as a result of this mess is + that the "configure" script fails, yelling something about being + unable to link to libmysqlclient, the MySQL C API client library. + It's because the library was probably built as a 32-bit executable + and you're using the default compiler which tries to build a 64-bit + test executable against this library and fails. + + There are many ways out of this tarpit. Here are the ones I prefer: + + First, you can force GCC 4.2 to build 32-bit binaries: + + ./configure CFLAGS=-m32 CXXFLAGS=-m32 LDFLAGS=-m32 --other-flags-here + + Second, you can make the MySQL++ build system use GCC 4.0 instead: + + ./configure CC=gcc-4.0 CXX=g++-4.0 --other-flags-here + + Last, you could just take Apple's implied advice and start booting + your Mac into 64-bit mode, if it will support it. Here's an article + that goes into all the details: + + http://macperformanceguide.com/SnowLeopard-64bit.html + + I'm aware of other solutions to the problem, but I expect one among + these will work for you. + + +Making Universal Binaries +~~~~~~~~~~~~~~~~~~~~~~~~~ + By default, the command line build system will generate libraries + that only work with the platform you build MySQL++ on. It can be + convinced to build "universal" binaries instead by configuring + the library like so: + + $ ./configure --disable-dependency-tracking \ + CXXFLAGS='-arch ppc -arch i386' + + This builds the library for the two 32-bit OS X architectures, and + is what most people have traditionally thought of as "universal". + However, you may also want a 64-bit build, meaning there are four + different architectures, and thus four -arch flags needed: + + $ ./configure --disable-dependency-tracking \ + CXXFLAGS='-arch ppc -arch ppc64 -arch i386 -arch x86_64' + + These are single commands, with the line broken to keep the line + lengths in this document reasonable. + + The first command doubles build time relative to the default + configuration, and the second quadruples it. It also makes the + resulting binaries larger, which increases the amount of time + it takes to start a program. Build MySQL++ like this only if + you must. + + The --disable-dependency-tracking flag is necessary because, + when building universal binaries, it has to rebuild each source + module multiple times, which confuses the logic that tries to tell + when a given module needs rebuiding based on its dependencies on + other files. ADDED README-MinGW.txt Index: README-MinGW.txt ================================================================== --- /dev/null +++ README-MinGW.txt @@ -0,0 +1,165 @@ +Prerequisite: GCC Version +~~~~~~~~~~~~~~~~~~~~~~~~~ + If your MinGW version isn't using at least GCC 3.4.5, it needs + to be updated. Older versions are known to not work with MySQL++. + + As of MySQL++ 3.1.1, the required version might need to be even + newer, as we are now depending on improvements to the MinGW linker + which probably don't go back that far. + + +Prerequisite: MySQL C Development Files +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + MySQL++ is built atop MySQL's C API library. The easiest way to + get that is to install Connector/C on your development system, + which you can download from mysql.com. The distribution assumes + these files are in: + + C:\Program Files\MySQL\MySQL Connector C 6.1\ + + There are a number of reasons why that path may not work for you: + + - You have a newer version of Connector/C installed + + - You're on a 64-bit system, but have the 32-bit versions of + Connector/C and MinGW installed and wish to build a 32-bit + binary. In that case, the path will look like this instead: + + C:\Program Files (x86)\MySQL\MySQL Connector C 6.1\ + + - You may have the MySQL Server on your system and installed the + development files along with it, and therefore don't want to + install Connector/C separately. In that case, the path will + look like this instead: + + C:\Program Files\MySQL\MySQL Server 5.6\ + + Regardless of the reason you have for changing this path, there are + two ways that work: + + - The easy way is to do a global search and replace on the path + in Makefile.mingw. This is a generated file, but if that's the + only change to MySQL++ you need, it works fine. + + - If you're doing deeper work on MySQL++, you should change the + MYSQL_WIN_DIR variable at the top of mysql++.bkl instead. + + Having done that, you can generate Makefile.mingw from that + file using the Windows port of Bakefile (http://bakefile.org/): + + bakefile_gen -f mingw + + +Building the Library and Example Programs +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + With the prerequisites above taken care of, you can build MySQL++ + with this command: + + mingw32-make -f Makefile.mingw + + Notice that we're using the MinGW-specific version of GNU make, not + the Cygwin or MSYS versions. Many things will break otherwise: path + separator handling, shell commands used by the Makefile, etc. + + Speaking of Cygwin and MSYS, if you have either these or any other + Unix emulation environment installed, be sure their executables + aren't in the PATH when building MySQL++. MinGW's version of GNU + make does some funny things if it thinks it's running in the + presence of Unixy tools, which will break the MySQL++ build. + + Once the library is built, you should run the examples. At minimum, + run resetdb and simple1. + + Once you're satisfied that the library is working correctly, you can + run install.hta to automatically install the library files and + headers in subdirectories under c:\mysql++. + + +Cygwin and MinGW Coexistence +~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + It's possible to have both Cygwin and MinGW installed and build + with the MinGW tools without interference from the Cygwin bits. + The main thing you have to take care of is that MinGW's bin + directory must precede the Cygwin bin directory in the PATH, + so that its tools are found first. If you use Cygwin's bash + as a command shell in preference to the DOS-like cmd.exe, you + can use this shell script to temporarily set the environment to + "MinGW mode" and make it easy to get back to "Cygwin mode": + + #!/bin/sh + PATH=/c/mingw/bin:/c/windows:/c/windows/system32:/c/cygwin/bin + echo "Say 'exit' to leave MinGW shell and restore Cygwin environment." + /usr/bin/bash --rcfile ~/.mingwrc + + I recommend having at least this in the ~/.mingwrc file: + + alias make=mingw32-make + PS1='MinGW: \W \$ ' + + The prompt change reminds you that you are in a sub-shell set up for + MinGW. The alias for 'make' ensures you don't accidentally run + Cygwin's make, which won't work with Makefile.mingw. We could just + leave /c/cygwin/bin out of the environment, but there are Cygwin + tools we want access to, like vim. As long as all the MinGW ones + override those Cygwin also provides, we don't need to worry about + having both in the PATH. Besides, having the alias is nice for + those who have 'make' committed to muscle memory. + + +Building on Linux +~~~~~~~~~~~~~~~~~ + You might wish to build MySQL++ with MinGW because you're + not actually running Windows, but need Windows executables. + The thought being that this lets you use GCC, the same compiler + you're probably using to make native executables. There are + indeed ways to make this work. + + The most "native" way to do this is to run MinGW under Wine. + Leonti Bielski provided these instructions: + + 1. Install MinGW through Wine: + + $ wine MinGW-5.1.6.exe + + 2. Add the MinGW directory to Wine's PATH with Wine regedit: + + http://winehq.org/site/docs/wineusr-guide/environment-variables + + 3. Install MySQL under Wine, or at least unpack the Windows + ZIP file version of MySQL in a place where Wine can find it. + You don't need to run a Windows MySQL server under Wine. + We're only doing this to get the MySQL C API library and + its headers, which MySQL++ builds against. The resulting + MinGW build of MySQL++ can talk to a native MySQL server + out in Wine's host environment or on some other machine. + + 4. Modify Makefile.mingw to match the install location for + the MySQL C API files. + + 5. Build MySQL++ with: + + $ wine mingw32-make -f Makefile.mingw + + Another way is to build a Windows virtual machine, such as with + VMware or VirtualBox. In that case, you'd use the regular build + instructions at the top of this document. + + You might think to avoid the need for Wine or Windows by use of a + MinGW cross-compiler: + + $ ./configure --target=mingw32 + $ make + + Unfortunately, that currently doesn't work. + + The reason is that our autoconf build system assumes a + typical POSIX type target, which MinGW is not. We made this + assumption because we have a perfectly good MinGW build option, + Makefile.mingw. But, that also won't work on a POSIX system + because that Makefile assumes external commands run under cmd.exe, + not some Unixy shell. Thus the advice to build with Makefile.mingw + under Windows or something sufficiently close to it. + + If you really wanted to, you could extend the autoconf build system + to make it realize when it's being used to cross-compile for MinGW. + Patches thoughtfully considered; see HACKERS.txt. ADDED README-Solaris.txt Index: README-Solaris.txt ================================================================== --- /dev/null +++ README-Solaris.txt @@ -0,0 +1,37 @@ +For the most part, Solaris is just another Unix variant as far as +MySQL++ is concerned. See README-Unix.txt for most of what you need +to know to build and use MySQL++. + + +Prerequisite: Install the MySQL Development Files +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + MySQL++ is built on top of the MySQL C API library, so it needs the + C API development files to build against. + + With the current version of Solaris, at least, a MySQL package + is included on the operating system disk, but not installed + by default. To install it, oull down the GNOME System menu, + go to Administration, and then to Package Manager. Search for + "mysql5" and install those packages. While there, you may also + need to install the gcc packages, if you haven't done that already. + I'm not sure, but you may need to install Perl as well. + + Don't search for just "mysql" in Package Manager, as that will also + bring up legacy MySQL 4.0 packages. MySQL++ may build against 4.0 + still; it's been a while since we've tested it. What is certain + is that the examples won't run against 4.0 without modification, + as they assume the availability of UTF-8 character set support, + which was added in 4.1. + + It's no doubt possible to use the official binaries from mysql.com + instead, or to build from source. We don't do that ourselves, + though, and don't have reports from those who have, so we can't + advise on how to do it. + + +C API Development File Directories +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + Sun's MySQL package installs the development files in relatively + uncommon locations. The libraries are in /usr/mysql/lib/mysql, + and the headers are in /usr/mysql/include/mysql. Way to be + redundant, guys. :) ADDED README-Unix.txt Index: README-Unix.txt ================================================================== --- /dev/null +++ README-Unix.txt @@ -0,0 +1,111 @@ +Platform Variations +~~~~~~~~~~~~~~~~~~~ + This file only covers details common to all Unix variants + supported by MySQL++. For platform-specific details, see the + file appropriate to your OS: + + README-Cygwin.txt + README-Linux.txt + README-Mac-OS-X.txt + README-Solaris.txt + + There are no special instructions for any other Unix flavors. + + +Building the Library and Example Programs +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + MySQL++ uses GNU autoconf, so you can build it with the standard + commands: + + $ ./configure + $ make + $ su + # make install + + +Configure Options +~~~~~~~~~~~~~~~~~ + The configure script takes several interesting options. Say: + + $ ./configure --help + + to get a list. Some of the more interesting flags are: + + --prefix: + + If you wish to install mysql++ in a root directory other than + /usr/local, run configure with --prefix=/some/dir/name + + --with-mysql*: + + If you installed MySQL in an atypical location, the configure + script will not be able to find the library and header + files without help. The simplest way to clue configure into + where MySQL is installed is with the --with-mysql option. + Try something like "--with-mysql=/usr/local/mysql", for + instance. The configure script will then try to guess which + subdirectories under the given directory contain the library + and include files. + + If that doesn't work, it's because the library and header + files aren't in typical locations under the directory you gave + for configure to find them. So, you need to specify them + separately with --with-mysql-include and --with-mysql-lib + instead. As with --with-mysql, configure can often guess + which subdirectory under the given directory contains the + needed files, so you don't necessarily have to give the full + path to these files. + + --with-field-limit: + + This lets you increase the maximum field limit for template + queries and SSQLSes. By default, both are limited to 25 + fields. See chapter 8.2 in the user manual for details: + + http://tangentsoft.net/mysql++/doc/html/userman/configuration.html + + --enable-thread-check: + + Builds MySQL++ with threading support, if possible. + + This option simply turns on two tests: first, that your + system uses a compatible threading library; and second, + that the thread-safe version of the MySQL C API library + (libmysqlclient_r) is installed and working. If both of + these are true, you get a thread-aware version of MySQL++. + "Thread-aware" means that the library does make an effort to + prevent problems, but we don't guarantee that all possible + uses of MySQL++ are thread-safe. + + Note that this is a suggestion, not a command. If we can't + figure out the system's threading model or can't find the + thread-aware build of the C API library, configure won't fail. + It just reverts to the standard single-thread build. + + See the chapter on threading in the user manual for more + details and advice on creating thread-safe programs with + MySQL++. + + +Building a Static Library +~~~~~~~~~~~~~~~~~~~~~~~~~ + As shipped, MySQL++ only builds a shared library. It's possible to + change things so you get a static library instead. + + Before we get to "how," beware that liking statically to MySQL++ has + legal consequences that may matter to you, due to the library's + license, the GNU LGPL. Familiarize yourself with the license, and + consider getting legal counsel before proceeding. Also, see the + MySQL++ FAQ: http://tangentsoft.net/mysql++/#faq There is more on + this topic there. + + The necessary changes are all in mysql++.bkl: + + - Change the tag to . (Remember the closing tag!) + + - Remove the tag + + - Remove the tag + + Then, re-bootstrap the library. See HACKERS.txt if you need further + instruction on doing that. ADDED README-Visual-C++.txt Index: README-Visual-C++.txt ================================================================== --- /dev/null +++ README-Visual-C++.txt @@ -0,0 +1,170 @@ +Prerequisites +~~~~~~~~~~~~~ + You need to have the MySQL C API development files on your system, + since MySQL++ is built on top of it. + + The easiest way to get it is to download Connector/C from + mysql.com. + + If you need the MySQL server on your development system anyway, + you you can choose to install the development files along with + the server. Some versions of the MySQL Server installer for + Windows have installed the development files by default, while + others have made it an optional install. + + +Project Files +~~~~~~~~~~~~~ + The distribution comes with three sets of .sln and .vcproj files + in the vc2003, vc2005 and vc2008 subdirectories. + + We do this for several reasons: + + 1. It lets you build MySQL++ with multiple versions of Visual + C++ without the build products conflicting. + + 2. For Visual C++ 2003, we had to disable the SSQLS feature + because changes made in MySQL++ 3.0 now cause the compiler + to crash while building. See the Breakages chapter in the + user manual for workarounds if you must still use VC++ 2003. + + 3. The VC++ 2008 project files get built for 64-bit output, while + the other two build 32-bit executables. + + With VC++ 2003, we have no choice about this, since it only + supports 32-bit targets. + + VC++ 2005 did have experimental 64-bit compilers available, + but their beta nature was only one reason we chose not to + use them. The real reason is that the current MySQL++ build + system isn't currently set up to make it easy to build both + 32- and 64-bit libraries and executables at the same time + within the same solution. Bakefile allows it, but it would + require forking many of the build rules in mysql++.bkl so + we can do things like have separate MYSQL_WIN_DIR values + for each bitness. (See below for more on this variable.) + + For that same reason, the VC++ 2008 project files are set + up to build 64-bit libraries and executables *only*. + + It is possible to upgrade these project files to work with newer + versions of Visual C++, but beware that the upgrade feature tends + to be problematic. + + If you want to do a 32-bit build on VC++ 2008 or newer, it is + easiest to open the vc2005\* project files and let Visual Studio + upgrade them for you. The alternative, starting with the vc2008 + files, requires that you add a 32-bit build option to all of the + many targets in MySQL++, then optionally delete the 64-bit targets. + This is a lot more work. Plus, it only works if you have the + 64-bit compilers installed, since Visual Studio will refuse to + open project files where all targets must be built with compilers + that aren't installed, even if your goal is to immediately adjust + them to use compilers that *are* installed. + + When converting the VC++ 2008 project files to VC++ 2012, Visual + Studio will change the output directories from Debug to Debug\x64 + (and similar for Release), but it won't also change the link paths + from Debug to Debug\x64, so that the library and examples will + compile but not link. The migration tool detects that there is + a problem, but it can't fix its own mess. You have to manually + fix it. + + There were also problems in VC++ 2010 when you had converted 32-bit + VC++ 2008 projects and then were trying to switch them to 64-bit. + It ended up being simpler in this case to just start over from + scratch and build your own project files. + + +Using Nonstandard MySQL Installations +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + The Visual Studio project files that come with MySQL++ have + everything set up correctly for the common case. The biggest + assumption in the settings is that you're building against the + current stable version of Connector/C, which gets installed here + at the time of this writing: + + C:\Program Files\MySQL\MySQL Connector C 6.1\ + + If you installed a different version, or it's in a different + directory, or you've installed the development files as part of + MySQL Server on the same machine, you need to change the project + files to reference the C API development files in that other + location. There are two ways to do this. + + The hard way is to make 16 different changes each to 44 separate + project files. If you're a talented Visual Studio driver, + you can do this in as little as about 5 or 6 steps. You might + even get it right the first time. If you are not so talented, + you have to make all ~700 changes one at a time, and you almost + certainly will *not* get it right the first time. + + The somewhat easier way is to open all these files in a text + editor that lets you make a global search and replace on all + open files. + + The easy way is to install Bakefile (http://bakefile.org/), + change the value of the MYSQL_WIN_DIR variable near the top of + mysql++.bkl in the top level of the MySQL++ source tree, and run + rebake.bat. This will rebuild all of the project files for you, + using the new MySQL path in all the many places it's needed. + + +Building the Library and Example Programs +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + You must build both the Debug and Release versions of the library, + because a release build of your program won't work with a Debug + version of the MySQL++ DLL. These DLLs get different names, so + you can install them in the same directory if needed: mysqlpp_d.dll + for the Debug version, and mysqlpp.dll for the Release version. + + With the library built, run at least the resetdb and simple1 + examples to ensure that the library is working correctly. + In addition to the other generic examples, there are a few + Visual C++ specific examples that you might want to look at in + examples\vstudio. See README-examples.txt for further details. + + Once you're sure the library is working correctly, you can run + the install.hta file at the project root to install the library + files and headers in a directory of your choosing. + + (Aside: You may not have come across the .hta extension before. + It's for a rarely-used feature of Microsoft's Internet Explorer, + called HTML Applications. Know what Adobe AIR is? Kinda like + that, only without the compilation into a single binary blob which + you must install before you can run it. Just open install.hta + in a text editor to see how it works.) + + +Using MySQL++ in Your Own Projects +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + This is covered in the user manual, chapter 9. + + +Working With Bakefile +~~~~~~~~~~~~~~~~~~~~~ + MySQL++'s top-level Visual Studio project files aren't + maintained directly. Instead, we use a tool called Bakefile + (http://bakefile.org/) to generate them from mysql++.bkl. Since + there are so many project files in MySQL++, it's often simpler to + edit this source file and "re-bake" the project files from it than + to make your changes in Visual Studio. + + To do this, download the native Windows version of Bakefile from the + web site given above. Install it, and then put the installation + directory in your Windows PATH. Then, open up a command window, cd + into the MySQL++ directory, and type "rebake". This will run + rebake.bat, which rebuilds the Visual Studio project files from + mysql++.bkl. + + There's more information about using Bakefile in HACKERS.txt. + + +If You Run Into Problems... +~~~~~~~~~~~~~~~~~~~~~~~~~~~ + Especially if you have linking problems, make sure your project + settings match the above. Visual C++ is very picky about things + like run time library settings. When in doubt, try running one + of the example programs. If it works, the problem is likely in + your project settings, not in MySQL++. + ADDED README-examples.txt Index: README-examples.txt ================================================================== --- /dev/null +++ README-examples.txt @@ -0,0 +1,186 @@ +Building the Examples +~~~~~~~~~~~~~~~~~~~~~ + If you're installing MySQL++ from the source tarball, the example + programs get built when you build the library. If you change + any example code, just say 'make' to rebuild the examples. + The examples are built against the headers and library in the + lib subdirectory, not against the ones you may have installed + elsewhere on the system. + + If these example files were installed on your system as part of + the -devel RPM, copy all the files to a directory you can write + to, then say 'make' in that directory. This uses a simplified + Makefile, which builds the examples against the headers and + libraries installed in the system directories. + + +Getting Started with the Examples +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + MySQL++ is built as a shared library on most systems, and a DLL + on Windows. Since it isn't built in the same directory as the + examples, this means that your system won't be able to find the + library without help until you install it. Since you generally + want to run the examples _before_ installing the library, to test + that the library actually works, we need a workaround. + + That workaround is the exrun script. There are two versions, + a Bourne shell script called just exrun for POSIX systems, and + exrun.bat for Windows. + + Before running the other examples, you must first create the + sample database. On POSIX systems, you do that like so: + + $ ./exrun resetdb [-s server_addr] [-u user] [-p password] + + On Windows, that would instead be: + + C:\mysql++\> exrun.bat resetdb [-s server] [-u user] [-p pass] + + You don't have to give any of these options. If you don't pass -s, + it assumes the database server is running on the same machine, + and so tries to contact the server over some form of local IPC. + If you don't pass -u, it uses your own user name when logging + into to the database server. If you don't pass -p, it assumes the + database user has an empty password, which hopefully is not true. + + The -s option accepts many different forms of address. The main + one is some sort of TCP/IP address, with an optional port number + or service name. On Unixy systems, you can give a Unix domain + socket name. On Windows, you can give just a period to use named + pipes, if the server supports it. All of these are legal: + + . + localhost + 172.20.0.252:12345 + /var/run/mysqld.sock + my.server.name.com:mysql + + If you give -s but don't give a port number or service name with + it, it assumes the default, port 3306. + + +Running the Other Command Line Examples +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + The following examples use the database set up by resetdb, and + have the same command line format as resetdb: + + simple1: Shows the item names for all records in the sample + stock table. Try this one if you do nothing else. + + simple2: Similar to simple1, but it displays all columns + from the sample stock table, not just the item name. + + simple3: Same as simple2, except that it retrieves the data + with a "use" query instead of a "store" query. See the + user manual for the difference between these methods. + + ssqls1-5: These demonstrate the SSQLS features. Read the + SSQLS sections in the user manual for details about + these examples. + + multiquery: MySQL++ allows you to issue multiple queries at + once, and get the results as separate sets. This shows + that, and also how to use stored procedures, which return + their results in the same way as a multiquery. + + tquery1-3: Shows how to use the template query facility. + + transaction: Shows how to use the Transaction class to create + transaction sets which automatically roll back if not + explicitly committed. + + deadlock: Shows how to handle errors that happen when the + database server detects a deadlock in a transaction set. + Also demonstrates the need for BadQuery::errnum() + + store_if: Demonstrates the Query::store_if() method, which + allows you to store the results of a query in an STL + container conditionally. Think of it as a way to express + rules for selecting records in C++, to be used when SQL's + WHERE clause isn't powerful enough. + + for_each: Demonstrates the Query::for_each() method, which + allows you to execute a query and call a functor on each + returned row. This example uses this to gather statistics + on the sample table's contents. + + cpoolp, cpoolw: Respectively, the POSIX and Windows threads + variants of the ConnectionPool class demonstration. + + load_jpeg: Inserts a JPEG file into the sample database, + for use by the cgi_jpeg example. (See below.) Unlike the + other examples, this one takes anything given on the + command line that isn't a switch to be a JPEG file name. + We've included examples/logo.jpg as a sample, if you want + to use that. + + fieldinf: Shows how to get information about the fields in + a result set. (Types, etc.) + + dbinfo: Dumps a bunch of information about the database + server and some of the data it's managing. + + If you run the load_jpeg example, you should consider also + playing with the other half of the demonstration, cgi_jpeg. + To run it, you'll need to install MySQL++ on a machine with + a web server, then copy the cgi_jpeg program to the server's + CGI directory. For example, on a stock Red Hat type box, + that would be /var/www/cgi-bin. At that point, a request like + http://my.server.com/cgi-bin/cgi_jpeg?id=1 should show the JPEG you + loaded. The ID value to use will be that reported by load_jpeg. + + +Dedicated Windows Examples +~~~~~~~~~~~~~~~~~~~~~~~~~~ + If you're a Visual C++ user, there are two GUI examples, too: + + examples\vstudio\mfc.vcproj: MFC-based replacement for + the simple2 example. + + examples\vstudio\wforms.vcproj: The same thing, only written in + C++/CLI and using Windows Forms. Please follow the + instructions in README-Visual-C++.txt before trying to + build and run this example. The MySQL++ library build + settings must be modified and the library rebuilt first. + + Although these examples show use of MySQL++ in a GUI rather than + command line program, that's not the main point of these examples. + What we're really showing here is how to deal with Unicode. + The MySQL server prefers the UTF-8 encoding for Unicode, which + works naturally with most non-Windows systems. Windows, on the + other hand, uses a different Unicode character encoding, UCS-2. + These examples show how to do the necessary conversions. (See the + Unicode chapter in the user manual for more on this topic.) + + We need two different examples because Unicode conversions and + string handling are so wildly different under .NET than with the + native Win32 API. .NET makes these tasks much easier. + + These examples build and run as-is under Visual C++ 2005. To make + them work with VC++ 2008, you will have to change several paths + in both project's settings to reference the "vc2008" subdirectory + instead of "vc2005": + + o Configuration Properties > Debugging > Working Directory + + o Configuration Properties > Linker > General > + Additional Library Directories + + If you want to backport these examples to VC++ 2003, it's probably + not hard. The main difficulty is that VS 2003 supports Managed + C++, which isn't the same thing as C++/CLI. + + +Special exrun Capabilities +~~~~~~~~~~~~~~~~~~~~~~~~~~ + The Bourne shell version of the exrun script has a few features + not avaiable in the Windows batch file version. These features + let you run the examples under various debugging tools. + + You can get simple gdb debugging if you run an example like this: + + $ ./exrun gdb simple1 foo bar qux + + The script also supports valgrind, in memory leak testing mode: + + $ ./exrun valgrind simple1 foo bar qux DELETED README.bc Index: README.bc ================================================================== --- README.bc +++ /dev/null @@ -1,50 +0,0 @@ -Compatibility -~~~~~~~~~~~~~ - MySQL++ does NOT work with the free Borland C++ 5.5 compilers - you can download from borland.com. The library and most of the - examples do build, but the examples either hang or crash when - you try to run them. - - Some have had better luck with Borland C++ Builder, but as it - isn't free and I have no good reason to buy it, I can't test it. - - Please send a message to the mailing list if you either get it - working with the free compiler, or can confirm that it works - with the commercial version. - - If you must use a free compiler, I recommend the free version - of Visual C++. See the MySQL++ home page for details. - - -Building the Library and Example Programs -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Before you get started, you will need to create a Borland-compatible - import library. Assuming you installed MySQL in c:\mysql, the - commands to do this are: - - mkdir c:\mysql\lib\bc - cd c:\mysql\lib\opt - implib ..\bc\libmysql.lib libmysql.dll - - To create the Makefiles, say "makemake bc" in the project's root - directory. You only have to do this once, unless you change - Makefile.base or Makefile.bc. This also starts building the - library and the examples. - - If you change the library or example source code after creating - the Makefiles, you can simply say "make". This works in the - project root, as well as in the examples and lib subdirectories. - - The build process creates a DLL and an import library for that - DLL. It's possible to create a static library, but we don't - do this in the distributed Makefiles because linking to such a - library is a license violation for programs not licensed under the - GPL or LGPL. Using the library in DLL form avoids this problem. - - If you didn't install MySQL in c:\mysql, you will have to change - Makefile.bc in the lib and examples subdirectories and re-run - "makemake bc". You may also look at changing these files for - various other reasons, such as if you don't like the way we name - the DLL file, or want the 'install' target to put the MySQL++ - development files somewhere other than c:\mysql++\bc. - DELETED README.cygwin Index: README.cygwin ================================================================== --- README.cygwin +++ /dev/null @@ -1,42 +0,0 @@ -Limitations -~~~~~~~~~~~ - At the moment, Cygwin can only build a static version - of MySQL++. Unless you're one of the few that have a - commercial Cygwin license, this isn't likely to matter to you, - since without this, your program is under the GPL anyway. - (See http://www.redhat.com/software/cygwin/ for details.) - - If you're making a closed-source program and do not have a - commercial Cygwin license, I recommend that you use either - Visual C++ (preferred) or MinGW. See README.vc or README.mingw - for details. - - -Building the Library and Example Programs -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Before you can build MySQL++, you need to build the MySQL - client-side library from source. I recommend that you use - MySQL v4.1.x at this time. The best instructions I've found - for that are here: - - http://cygwin.com/ml/cygwin/2004-11/msg00159.html - - Skip the step changing the pthread stuff in my_thr_init.c, - as it isn't necessary in newer versions of MySQL. With those - changes applied, build and install MySQL like so: - - $ autoreconf --install --verbose --force - $ ./configure --prefix=/usr --sysconfdir=/etc --localstatedir=/var \ - --infodir=/usr/share/info --mandir=/usr/share/man \ - --disable-shared --without-{debug,readline,libedit,server} - $ make && make install - - Now that the MySQL client library is built and installed, - you need to configure MySQL++ to build statically: - - $ ./bootstrap --disable-shared [other options] - - The "other options" are passed to the configure script. See - README.unix for some suggestions. - - Beyond that, it's the old "make && make install" bit. DELETED README.mingw Index: README.mingw ================================================================== --- README.mingw +++ /dev/null @@ -1,37 +0,0 @@ -Limitations -~~~~~~~~~~~ - At the moment, MinGW can only build a static version - of MySQL++. This means that you can only use MySQL++ in - programs with LGPL-compatible license. There's an effort - under way to get it to build a MySQL++ DLL; if you'd like to - contribute to that effort, by all means, do so. - - If you cannot wait for this effort to bear results, I - recommend that you switch to Visual C++; it builds a DLL - version of MySQL++ without fuss. If the cost is the only - thing keeping you from using Visual C++, see the Visual C++ - item in the MySQL++ FAQ: http://tangentsoft.net/mysql++/#faq - - -Building the Library and Example Programs -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Before you get started, you will need to create a MinGW-compatible - import library. Assuming you installed MySQL in c:\mysql, the - commands to do this are: - - mkdir c:\mysql\lib\gcc - cd c:\mysql\lib\gcc - dlltool -k -d c:\mysql++\libmysqlclient.def -l libmysqlclient.a - - Then to configure and build the MySQL++ library, say - "makemake mingw" in the project's root directory. You only - have to give the "makemake" command once, unless you change - the Makefile.base or Makefile.mingw files. Thenceforth, - you can just say "make". - - If you didn't install MySQL in c:\mysql, you will have to change - Makefile.mingw in the lib and examples subdirectories and re-run - "makemake mingw". You may also look at changing these files for - various other reasons, such as if you don't like the way we name - the DLL file, or want the 'install' target to put the MySQL++ - development files somewhere other than c:\mysql++\mingw. ADDED README.txt Index: README.txt ================================================================== --- /dev/null +++ README.txt @@ -0,0 +1,128 @@ +What It Is +~~~~~~~~~~ + MySQL++ is a C++ wrapper for MySQL's C API. It is built around STL + principles, to make dealing with the database as easy as dealing + with an STL container. MySQL++ relieves the programmer of dealing + with cumbersome C data structures, generation of repetitive SQL + statements, and manual creation of C++ data structures to mirror + the database schema. + + Its home page is http://tangentsoft.net/mysql++/ + + +Prerequisites +~~~~~~~~~~~~~ + To build MySQL++, you must have the MySQL C API development + files installed. + + On Unixy systems (Linux, Mac OS X, Cygwin, *BSD, Solaris...), + the MySQL development files are installed if you build MySQL + from source. If you installed MySQL as a binary package, then + the development files are often packaged separately from the + MySQL server itself. It's common for the package containing the + development files to be called something like "MySQL-devel". + + If you're building on Windows with Visual C++ or MinGW, you + need to install the native Win32 port of MySQL from mysql.com. + The development files are only included with the "complete" + version of the MySQL installer, and some versions of this + installer won't actually install them unless you do a custom + install. Another pitfall is that MySQL++'s project files assume + that you've installed the current General Availability release of + MySQL (v5.0 right now) and it's installed in the default location. + If you've installed a different version, or if MySQL Inc. changes + the default location (which they seem to do regularly!) you'll have + to adjust the link and include file paths in the project settings. + + +Additional Things to Read +~~~~~~~~~~~~~~~~~~~~~~~~~ + Each major platform we support has a dedicated README-*.txt + file for it containing information specific to that platform. + Please read it. + + For authorship information, see the CREDITS.txt file. + + For license information, see the COPYING.txt file. + + If you want to change MySQL++, see the HACKERS.txt file. + + You should have received a user manual and a reference manual + with MySQL++. If not, you can read a recent version online: + + http://tangentsoft.net/mysql++/doc/ + + Search the MySQL++ mailing list archives if you have more + questions: + + http://lists.mysql.com/plusplus/ + + +Building the Library +~~~~~~~~~~~~~~~~~~~~ + MySQL++ uses Bakefile (http://bakefile.org/) to generate + platform-specific project files and makefiles from a single set + of input files. We currently support these build systems: + + autoconf: + For Unixy platforms, including Linux, Mac OS X, and Cygwin, in + addition to the "real" Unices. See README-Unix.txt for general + instructions. Supplementary platform-specific details are + in README-Cygwin.txt, README-Linux.txt, README-Mac-OS-X.txt, + and README-Solaris.txt. + + MinGW: + We ship Makefile.mingw for MinGW. It currently only builds the + static version of the library for technical reasons. This has + licensing ramifications. See README-MinGW.txt for details. + + Visual C++: + We ship Visual Studio 2003, 2005, and 2008 project files. + No older version of Visual C++ will build MySQL++, due to + compiler limitations. See README-Visual-C++.txt for more + details. + + Xcode: + We ship an Xcode v2 project file. It hasn't been tested + much yet, since the autoconf method works just fine on OS X. + As a result, we need both success and failure reports on the + mailing list. See README-Mac-OS-X.txt for more information. + + +Example Programs +~~~~~~~~~~~~~~~~ + You may want to try out the programs in the examples subdirectory + to ensure that the MySQL++ API and your MySQL database are both + working properly. Also, these examples give many examples of + the proper use of MySQL++. See README-examples.txt for further + details. + + +Unsupported Compliers +~~~~~~~~~~~~~~~~~~~~~ + If you're on Windows but want to use some other compiler besides + Visual C++ or GCC, you are currently on your own. There have + been past efforts to port MySQL++ to other Windows compilers, + but for one reason or another, all of these ports have died. + + On Unixy systems, GCC still works best. "Native" compilers and + third-party compilers may work, but you're on your own to get + it working. + + We have nothing in particular against these unsupported systems. + We just lack the time and resources to support everything + ourselves. If you are sufficiently motivated to get MySQL++ + working on one of these alternate systems, see the HACKERS.txt + file first for guidance. If you follow the advice in that file, + your patch will be more likely to be accepted. + + +If You Want to Hack on MySQL++... +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + If you intend to change the library or example code, please read + the HACKERS.txt file. + + If you want to change the user manual, read doc/userman/README.txt + + If you want to change the reference manual, see the Doxygen manual: + http://www.stack.nl/~dimitri/doxygen/manual.html DELETED README.unix Index: README.unix ================================================================== --- README.unix +++ /dev/null @@ -1,49 +0,0 @@ -CONFIGURE OPTIONS - - The configure script takes several interesting options. Say: - - $ ./configure --help - - to get a list. Some of the more interesting flags are: - - --prefix: - - If you wish to install mysql++ in a root directory - other than /usr/local, run configure with - --prefix=/some/dir/name - - --with-mysql*: - - If you installed MySQL in an atypical location, - the configure script will not be able to find the - library and header files without help. The simplest - way to clue configure into where MySQL is installed - is with the --with-mysql option. Try something like - "--with-mysql=/usr/local/mysql", for instance. The - configure script will then try to guess which - subdirectories under the given directory contain the - library and include files. - - If that still doesn't work, use --with-mysql-include and - --with-mysql-lib instead. As when given --with-mysql, - configure will try to guess (if necessary) which - subdirectory under the given directory contains the - needed files, so you don't necessarily have to give the - full path to these files. - - --enable-thread-check: - - If you with be using MySQL++ in a multi-threaded program, - you need to give the --enable-thread-check option to - the configure script. It will then try to determine - whether your system has a threads implementation it can - understand, and whether it can use the thread-safe MySQL - C library. If both of these aren't true, you won't get a - thread-safe MySQL++ library. Beware that a thread-aware - MySQL++ library requires that you link your program - differently, so if you depend on ABI stability and - have been using MySQL++ for some time, you will almost - certainly want to leave this option out. - - - DELETED README.vc Index: README.vc ================================================================== --- README.vc +++ /dev/null @@ -1,107 +0,0 @@ -Compatibility -~~~~~~~~~~~~~ - MySQL++ only builds under Visual C++ 7.1 (a.k.a. Visual Studio - 2003, a.k.a. cl version 13.10) or later. Earlier versions did - not support a sufficiently broad set of the Standard C++ language. - - -Building the Library and Example Programs -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - As of MySQL++ v2.0, we have changed the VC++ build system over to - a command-line based system, instead of Visual Studio project files. - We've done this for many reasons: - - 1. Not everyone has the IDE: Microsoft offers their - command-line compilers for free, and these offers - often do not include the Visual Studio IDE. - - 2. Project files tend to be tied to one version of - Visual Studio. Newer versions can migrate old project - files, but then old versions cannot read the new files. - So, each time there's a new version of Visual Studio, - there's a transition period where at least two versions - of the IDE are still in common use. Makefiles, - by contrast, work with all versions, without changes. - - 3. Standardization: we would frequently forget to - update the VC++ project files whenever a new file - was added to the library, or a new example created. - This is primarily because each non-autotools using - system had its own project files, so it was daunting to - consider adding this file to so many different project - files. With this new system, we hope there will be - more incentive to keep the Makefiles synchronized - with library features, since it affects more than - just one development system. - - Before you build the library, make sure the environment variables - that Visual C++ needs are set up. Recent versions of the Visual - Studio installer put a special CMD.EXE shortcut in the Start menu - in the same folder as the IDE shortcuts; run this shortcut to - get a command prompt with the variables all set up. The older - way (which still works) is to run the vcvars32 batch file that - comes with the tools. (It may not be in your PATH by default, - so you might have to search your hard drive for it.) - - To create the Makefiles, say "makemake vc" in the project's root - directory. You only have to do this once, unless you change - Makefile.base or Makefile.vc. This also starts building the - library and the examples. - - If you change the library or example source code after creating - the Makefiles, you can simply say "make". This works in the - project root, as well as in the examples and lib subdirectories. - - The build process creates a DLL and an import library for that - DLL. It's possible to create a static library, but we don't - do this in the distributed Makefiles because linking to such a - library is a license violation for programs not licensed under the - GPL or LGPL. Using the library in DLL form avoids this problem. - - If you didn't install MySQL in c:\mysql, you will have to change - Makefile.vc in the lib and examples subdirectories and re-run - "makemake vc". You may also look at changing these files for - various other reasons, such as if you don't like the way we name - the DLL file, or want the 'install' target to put the MySQL++ - development files somewhere other than c:\mysql++\vc. - - -Using MySQL++ in Your Own Projects -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -(This material is based on a post by Steve Hulet ) - - Fire up VS .NET, create a Blank Solution. Add a new project. - Choose Empty Project (.NET) under Visual C++ Projects. Add a - .cpp file to the solution so it _knows_ it's a C/C++ solution. - Go to the solution Property Pages and make the following changes. - (Where it doesn't specify Debug or Release, make the change to - both configurations.) - - o Under Configuration Properties::General change "Use - Managed Extensions" to "No" - - o Under C/C++::General add to "Additional Include - Directories": c:\mysql++\vc\include, c:\mysql\include - - o Under C/C++::Code Generation change "Runtime Library" to - "Multi-threaded Debug DLL (/MDd)" for the Debug - configuration. For the Release configuration, make it - "Multi-threaded DLL (/MD)". - - o Under Linker::General add to "Additional Library - Directories": "c:\mysql\lib\debug, c:\mysql++\vc\lib" for - the Debug configuration. For the Release configuration, - make it "c:\mysql\lib\opt, c:\mysql++\lib" - - o Under Linker::Input add to "Additional Dependencies": - "libmysql.lib wsock32.lib mysql++.lib" - - -If You Run into Problems... -~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Especially if you have linking problems, make sure your project - settings match the above. Visual C++ is very picky about things - like run time library settings. If you still can't get things - going, try running one of the example programs. If it works, - the problem is likely in your project settings, not in MySQL++. - ADDED RELEASE-CHECKLIST.txt Index: RELEASE-CHECKLIST.txt ================================================================== --- /dev/null +++ RELEASE-CHECKLIST.txt @@ -0,0 +1,38 @@ +- Change version number in configure.ac and mysql++.bkl. + + All other places the version number occurs are generated files + created from one of these two. If there's a corresponding *.in file + for the one you're looking at, the version number was substituted in + by autoconf from configure.ac. Otherwise, the file was most likely + created by the build system using the version number in mysql++.bkl. + +- Run "make abicheck". There should be no changes. + + You may have to run the following command in the current "stable" + directory before this will succeed, since it depends on there being + an ACC dump file in place already. + + $ abi-compliance-checker -lib mysqlpp -dump abi.xml + + ("Stable" is assumed to be in ../3.1.0 relative to the svn "head" + checkout, as I write this.) + + This dependence on an existing ABI dump file is deemed reasonable + since the ABI of the stable version had better not be changing! + Plus, it saves some processing time, since ACC can load the stable + ABI info without re-parsing its headers and library file. + +- Re-bootstrap the system in pedantic mode, then do a clean rebuild. + Fix any new errors and warnings. + + Known bogus warnings: + + - Query's std::basic_ios<> base class is not being initialized. + Yes, we know. We don't care. + + - The "==" float comparisons in lib/stadapter.cpp are harmless. + They're comparisons against special NaN and infinity constants. + Those are safe. + +- Re-bootstrap it again without "pedantic", to avoid shipping the + pedantic build files. Index: Wishlist ================================================================== --- Wishlist +++ Wishlist @@ -1,320 +1,525 @@ -Patches for any of these thoughtfully considered! See the HACKERS file -for instructions on sending patches. - -The items in the bug fix/maintenance section are the easiest to do -without breaking things, so if you're looking for a project.... - -Here's a meta-item that doesn't really fit into any of the categories -below: any time you must hand-roll some SQL code in your program, -consider whether it could be reduced to an API feature that would be -widely useful. Patches or proposals of this sort are always welcome. - - -v2.1 Plan ---------- - - This plan is not set in stone. These are simply the features - we want to try and tackle for the v2.1 release. - - Items in this plan may slip to a future release. This - typically happens when the proper solution is unclear, - so the best way to prevent this is to get on the mailing - list and help discuss it. Or even better, provide a patch; - we rarely reject working code outright. - - Items from the following sections may make it in, but if - you don't help make that happen, this will just be on the - whim of one of MySQL++'s developers. Don't forget that it's - possible to subclass yourself from the "MySQL++'s developers" - base class. - - - o Transaction support. Create a "Transaction" class, an - object of which you create on the stack, giving it a - reference to the Connection object. Transaction object's - ctor calls a function on the Connection object to start - a transaction set, and its dtor calls another function to - commit the transaction. Also provide a "commit()" member - function, to commit before destruction. This has a couple - of uses. First, it's useful for avoiding exceptions coming - from ~Transaction(), if such a thing is possible. Second, - sometimes it's inconvenient to wait until the end of a block - to commit the transaction, and adding artifical blocks is - somewhat ugly. - - o Add a configure script option to allow the new lock - mechanism to use platform mutexes via the Boost.Threads - library. - - Mechanism must reflect these MySQL C API restrictions: - - - Only one query executing at once per connection - - - For "use" queries, Connection (and therefore Query) object must - remain locked until last row is consumed - - - Safest to have one Connection per thread. Rules for sharing: - http://dev.mysql.com/doc/mysql/en/threaded-clients.html - - Need some way to call mysql_thread_init() and - mysql_thread_end() per thread. Also, work in some way to - call mysql_thread_safe() automatically, perhaps the first - time through the function that calls mysql_thread_init(). - If the C API library reports that it is not thread-safe, - report this to the caller, perhaps through an exception, - or simply by refusing to init more than one thread. - - o Currently, all overloads for Query's execute(), store() - and use() methods eventually call the const char* - version, which does the actual work of executing the query. - This rules out query strings with embedded nulls, as you're - likely to get with BLOB columns. Also, it means MySQL++ - must scan the string for length in a few places. The C API - isn't limited in this way if you use mysql_real_query(), - but you need an accurate length value to call it. We could - get that length with binary data if the end of the call - chain were a std::string overload, but we can't do that - easily because each of these functions has a version taking - a SQLString (a subclass of std:string) for template queries. - - One way around this is to add a parallel set of functions - (e.g. do_execute(), or execute_(), or some such) that take - a single std::string, which are the new terminus of the call - chain. Reimplement const char* versions in terms of these. - - Another way is to rename the template query versions (e.g. to - execute_tq()) to avoid the overload conflict. With that - done, we can use C API functions like mysql_real_query(), - which can take binary data. - - Yet another way is to add a length parameter to the call - chain end functions. - - And finally, we may be able to co-opt the first template - query version of each of these functions, as it takes a - single SQLString. - - o Date and time classes are pretty minimalistic; they could - be so much more powerful. Some ideas: - - - Add time_t conversion. - - - Arithmetic features. (See "Algorithms for Programmers" - by Binstock and Rex.) - - - It may be possible to get some nice syntactic sugar, - such as a way to call SQL functions like NOW() when - inserting certain Date/Time objects into a Query stream. - - Don't forget to write an example showing how to use these - new mechanisms. - - It may be possible to find existing date and time classes - that can be extended, instead of reinventing the wheel. - Boost, perhaps? - - o When you create a Connection object with its default ctor and - don't .connect() it, several of its functions can fail to - work correctly. ping(), for one, because the MYSQL handle - isn't initialized until the connection is established. - Decide how to cope: a) init the handle in all ctors; b) - throw ObjectNotInitialized when the library knows the - call will fail; or c) just return a failure code and hope - the user is checking it. Could be a different answer for - each function. Keep in mind the consequences for database- - independence here. - - o Build a forward iterator mechanism for ResUse. Make it - general enough that you can use it with STL algorithms - like find_if(). Then make an example to demonstrate this - augmentation of SELECT. Also, update usequery example - to use the iterator. Tricky bit: how do we make it not - interfere with subclass Result's random-access iterator? - - o Write an example to demonstrate compare.h features, or throw - the header away. It's not being used within the library. - - o Have resetdb create a second table containing a BLOB column - that load_file and cgi_image can use. - - Rework load_image to take the standard command line - parameters, and load a JPEG or something into the BLOB table. - Include a suitable JPEG with the distribution. (A cheesy - Photoshopped "MySQL++ Rocks!" thing should suffice.) - - Rework cgi_image so that you can drop it into a cgi-image - directory and immediately use it to query the database and - return the image data in CGI format. - - o It may be possible to optimize the use of ColData in - the return from Row::operator[]. Currently, that operator - returns a temporary ColData object, which contains a - std::string buffer which is initialized by a const char* - pointer to data within the Row object. Since the ColData - object is temporary, you currently must copy the data a - second time to store it when using Row::operator[]. If the - end user just wants a const char*, this double copy could - be prevented. See http://lists.mysql.com/plusplus/4451 - for the proposal. - - -Future Features ---------------- - - These changes are planned for versions after v2.1. If you - need one of these changes to happen on some particular - schedule, the best way to ensure it is to start coding and - provide a patch! - - - o Define operator<< for Fields, Row, ResUse, etc. In other - words, there should be a way to get a user-readable version - of received data without a lot of code. Perhaps use a CSV - output format, or a mysql(1) one (ASCII grid). - - o Abstract all uses of MySQL C API functions into a database - driver class with a generic interface. This is a step - towards database-independence, without the parallel class - hierarchy required by the MySQL++ 1.7 design. Also, it - will make it easier to make class Connection completely - friend-less. Right now, the main reason it needs friends - is because these other classes make C API calls using its - private MYSQL data member. The other reasons for it having - friends aren't nearly as compelling, so it wouldn't be - hard to justify redesigning Connection to eliminate these - final reasons. - - While it would be easy to have just one global database - driver object, it's probably going to be necessary to have - one per Connection. Consider what happens when you have one - program connected to two very different MySQL databases, - and you indirectly call C API functions that take MYSQL - parameters. It's likely that those calls are supposed - to behave different, depending on the data in that MYSQL - object; for instance, different character encodings in the - selected databases. So, there must somehow be a way to pass - the database driver's instance pointer down to all objects - that will need to use the driver. A side benefit is that - a single program could talk to multiple different database - server types. Imagine a program for importing data from - PostgreSQL and loading it into a MySQL table, for instance. - - o manip.cpp uses mysql_escape_string(), which doesn't take the - selected database's character set into account. To do that, - you must use mysql_real_escape_string(), which differs - by taking a MYSQL instance as an additional parameter. - The problem is, Connection owns the relevant MYSQL instance, - and the manipulator functionality is implemented in global - functions (operator<<() and such) so they have no direct - access to the relevant Connection object. - - The key question for all operator<<'s for manipulators - to ask is, "which Query object am I being inserted into?" - From there, you can look up the associated Connection object. - - In some cases, this answer to the question is easy, because - the operator takes an ostream parameter, which can be - dynamically cast to Query. From there, it's just a lookup - table problem. - - Other operator<<'s don't take an ostream, but they do take - a manipulator. Right now, manipulators are just enum values, - but they could in fact be classes. Classes can carry data, - so there may be a way to "bind" them to the appropriate - Connection object. If not, then perhaps some other method - will pop out of the database driver class idea. The driver - object may be able to look up a suitable Connection object - for the manipulators. - - o SSQLS structures include some static elements (_table and - names[]), which are defined within the macro. If you - put an SSQLS declaration in a header file and #include - that from multiple locations, you get a multiply-defined - symbol warning. Some ways to separate the definition from - the declaration: - - o Give the SSQLS macros another parameter, to - suppress static definition. - - o Put statics in a separate macro, which the - user must instantiate once in a .cpp file. - (Similar to the way MFC message maps work.) - - o Put statics in a sub-macro, conditionally defined, - which SSQLS is implemented in terms of. Define the - condition macro in one module within your - program. - - o Redesign the SSQLS mechanism entirely. Instead of - defining SSQLSes by instantiating macros, you could - declare the structure in, say, an XML format, - which could be tranformed (XSLT? Perl + a DOM - parser?) into code very much like in the current - SSQLS macros, except that it would generate - separate .cpp and .h files for each structure. - In addition to solving the static member problem, - it would have other advantages, like side-stepping - the Borland C++ macro size limit. - - o Deprecate sql_create_basic_* ? They have less functionality - and they're no easier to use than sql_create and friends, - so why bother with them? I suppose the code generated - is a bit smaller, but *really*.... Only possible saving - grace is if BC++ can compile them due to the macro code - being shorter. They also don't have the static members, - mentioned in the previous item. - - o Consider whether some of the current boilerplate can be - made into a base class that all SSQLSes derive from. - This may have implications for some templates, like - Query::insert...they might become regular member - functions, taking a reference to the base class. - - o MySQL++ handles automatic quoting and escaping differently - for cout and cerr than for Query streams. This should - probably be simplified so that automatic quoting is only - done for Query streams. No other stream type should be - treated specially. - - o Some field_list() functions use the do_nothing manipulator, - while others use the quote manipulator. Need to pick one. - In the vast majority of cases, quoting won't be necessary, - so make that the default. But, it should be possible to turn - it on, if needed. If all uses of quoting are in template - code, this can be a #define, allowing different programs - built on the same system to get different quoting rules. - Otherwise, it will probably have to be a configure script - flag, which will "burn" the choice into the built binary. - - o User-settable floating-point comparison precisions? - Something like this: http://lists.mysql.com/plusplus/3984 - As it currently stands, sql_cmp(double,double) is foolish. - One shouldn't do exact equality comparison on floating - point values. - - o Consider using MySQL C API enum constants in - mysql_type_info::types definition instead of hard-coded - values. This could potentially break a lot of - infrastructure, though, so do it only with care. - - -Bug Fix/Maintenance Items -------------------------- - - These items could happen in any version. - - - o Storing a subset row in an SSQLS defined to hold the entire - row currently causes a segfault. To see this, copy the SSQLS - definition from custom1 to custom6. This is arguably a bug; - see if we can't make it just fill out the fields queried for, - and leave the rest unchanged. - - o 64-bit integer support has been reported to work, but more - confirmation is wanted. - - o Template ListInsert in lib/myset.h isn't being used within the - library. It could probably be used in place of SetInsert - in the same file, which things like type_info.h do use now, - but it isn't clear how one would go about doing that without - changing the library code. Document it or throw it away. +Patches for any of these thoughtfully considered! See the HACKERS.txt +file for instructions on sending patches. + +Any Version +----------- + o The DateTime family's time_t conversion operators should detect + DATETIME("0") type values and return time_t(0) rather than + attempt to stuff an out-of-range value into a smaller box. + + o Any time you must hand-roll some SQL code in your program, + consider whether it could be generalized to a widely-useful + API feature. + + o Suppress DOS line-ending related diffs from examples/cgi_jpeg + output when running dtest on Windows. Check for -D? + + o Need to link statically to connect to MySQL Embedded? + + http://stackoverflow.com/questions/672451/ + + o When Bakefile allows, bring examples/vstudio/* into the top-level + build system. This will let us generate separate project + files for each VC++ version we support, let us use MYSQL_WIN_DIR + variable instead of hard-coded paths, and build against the local + version of MySQL++ instead of requiring it to be installed first. + Should probably drop the MFC example project, to avoid requiring + Visual C++ Professional. + + o Query::storein(slist&) is unusable. As a template method, it + must be defined in a header file; we cannot #include config.h from + a header, thus the proper HAVE macro that would let us define this + template method is never defined. + + One solution is to create lib/slist.h.in, parameterized by the + detected slist type name and the header file defining it. This + will #include the proper header file, define SList::Type (a + template typdedef: http://www.gotw.ca/gotw/079.htm), and #define + MYSQLPP_HAVE_SLIST. Then Query::storein() can be wrapped by an + ifdef checking for MYSQLPP_HAVE_SLIST, only defined when the + configure script found a suitable slist type. + + Also create a default lib/slist.h file, checked into svn as + lib/slistdef.h and copied to slist.h on tarball creation. Remove + this file early in configure script run, so we're forced to + overwrite its contents with detected values. Default version + contains ifdefs for non-autoconf platforms where we know what + slist definition is available on that platform. Xcode, for + instance, will let us use . + + o Add ctor and assignment operator that takes mysqlpp::null. You + now have to call a 4-argument version of either the ctor or + assign() to get a NULL SQL string. + + o The escape_q() functions aren't returning the right value when + dealing with Null wrapped types, such as sql_blob_null. + + o The current method SSQLS uses to compare floating point numbers + is highly dubious. It just subtracts them, and checks that + the absolute difference is under some threshold. The manual + warns that this is fine for "human scale" applications, but even + that's not actually true. It means that if Larry Ellison loses + a hundredth of a penny in his couch, it is somehow significant. + I have no idea how much money Larry Ellison is comfortable losing + to his couch cushions, but it's probably closer to 1 ppm than + the current threshold, which is 100 parts per quadrillion on + the scale of $1 bn. + + For backards compatibility, we should keep this method, but we + should add these two more mathematically sound methods: + + - Percentage: Divide the smaller number into the larger, then + compare against a threshold. The default should be + something like 1.000001 (1 ppm), which lets us make much + finer distinctions without running out of precision, even + with single-precision numbers counting Bill Gates' losses to + his couch cushions. + + - Logarithmic, or "Bels": Same as percentage, but on a log10 + scale so it works better for FP numbers, which are based on + powers of 10. Logarithms are more costly than division, + and we still need a division for this, so it shouldn't be + the new default. + + 1 ppm is ~4.3e-7, which is below what single-precision FP + can distinguish. Increasing the threshold to a value you + *can* distinghish with a 32-bit IEEE float makes it ignore + significant amounts of money in Carlos Slim's couch cusions. + (Hundreds of dollars.) Therefore, we should use something + like 1e-7 or 1e-8 anyway, and make it clear that the default + threshold is only suitable for doubles. + + Someone using single precision FP should increase the threshold + to 1e-5 or so. Such a person would be assumed to know what + they're doing. + + It's probably more efficient to change the algorithm from: + + double diff = log10(a > b ? a / b : b / a); + + to: + + double diff = fabs(log10(a / b)); + + Logarithms give the same magnitude result for a/b as b/a, + differing only in sign. fabs() is probably implemented as + an intrinsic that just clears a single bit, which should be + cheaper than a floating point comparison followed by a jump. + + With suitable tuning, this method would allow you to + distinguish the change lost by a single Pentagon contractor's + lobbyist to a single couch, on a single occasion, as compared + to the combined net worth of all Pentagon contractors and + their employees, assigns, mistresses, and, ah, hired help. + If you use doubles, anyway. + + +v3.3 Plan: Finish SSQLS v2 +-------------------------- + See http://lists.mysql.com/plusplus/6929 for high-level plan. + + o Goal: Restore VC++ 2003 compatibility with SSQLS, lost with v1 + + o C++ code generator, from walking DSL parse tree: + + examples/stock.ssqls gives ssqls_stock.h containing: + + class SQLStock : public mysqlpp::SsqlsBase + { + public: + SQLStock(Connection* conn = 0); // default ctor + SQLStock(const SQLStock& other); + SQLStock(const mysqlpp::Row& row, + Connection* conn = 0); // full init from query + SQLStock(mysqlpp::sql_bigint key1); // exemplar creation + SQLStock(Connection* conn, + mysqlpp::sql_bigint key1) // calls load(); + SQLStock( + mysqlpp::sql_bigint f1, + mysqlpp::sql_bigint f2, + mysqlpp::sql_double f3, + mysqlpp::sql_double f4, + const mysqlpp::sql_date& f5, + const mysqlpp::sql_mediumtext& f6); // full init + SQLStock(Connection* conn, + mysqlpp::sql_bigint f2, + mysqlpp::sql_double f3, + mysqlpp::sql_double f4, + const mysqlpp::sql_date& f5, + const mysqlpp::sql_mediumtext& f6); // calls create() + SQLStock(Connection* conn, + mysqlpp::sql_bigint f1, + mysqlpp::sql_bigint f2, + mysqlpp::sql_double f3, + mysqlpp::sql_double f4, + const mysqlpp::sql_date& f5, + const mysqlpp::sql_mediumtext& f6); // calls save() + + bool createTable(Connection* conn = 0) const; + const char* getTableName() const + { return class_table_name_ || table(); } + void setTableName(const char* name) + { instance_table(name); } + static void setTableName(const char* name) + { class_table_name_ = name; } + + std::ostream& equal_list(std::ostream& os) const; + std::ostream& json(std::ostream& os) const; + std::ostream& name_list(std::ostream& os) const; + std::ostream& value_list(std::ostream& os) const; + std::ostream& xml(std::ostream& os) const; + + mysqlpp::sql_bigint getId() const; + mysqlpp::sql_bigint getNum() const; + mysqlpp::sql_double getWeight() const; + mysqlpp::sql_double getPrice() const; + const mysqlpp::sql_date& getSdate() const; + const mysqlpp::sql_mediumtext& getDescription() const; + + void setId(mysqlpp::sql_bigint value); + void setNum(mysqlpp::sql_bigint value); + void setWeight(mysqlpp::sql_double value); + void setPrice(mysqlpp::sql_double value); + void setSdate(const mysqlpp::sql_date& value); + void setDescripion(const mysqlpp::sql_mediumtext& value); + + bool operator<(const SQLStock& rhs) const; + SQLStock& operator=(const SQLStock& rhs); + + protected: + mysqlpp::sql_bigint id_; + mysqlpp::sql_bigint num_; + mysqlpp::sql_double weight_; + mysqlpp::sql_double price_; + mysqlpp::sql_date sdate_; + mysqlpp::sql_mediumtext description_; + + std::bitset<6> set_fields_; + + private: + static const char* class_table_name_; + }; + + ...and ssqls_stock.cc, containing implementation for same. + + o Ensure we're using case-insensitive SQL column to C++ field name + matching. Column names aren't case-sensitive in SQL. + + o SQL table updater/builder, -T option, taking .ssqls and + creating or updating the DB table to match. + + o If using accessors, generate "std::bitset is_set_", + and set the appropriate bit when calling each setFoo() so we + can intuit which fields were set. Probably also need an enum: + + enum FieldIndices { + id_field_index_, + num_field_index_, + ... + }; + + This will allow Query::select(), for instance, to figure out that + we want it to select by a non-key field, returning all matches. + + o Define operator<< for SSQLS and a set of manipulators which + govern whether the operator calls equal_list(), json(), + name_list(), value_list(), or xml() to do the actual insertion. + + o Define operator<< for sequence_container and similar + for associative containers. Give mysql(1)-like ASCII grid or + some other table format. + + o Define operator>> for SSQLS, taking XML as input, in the form + emitted via xml(). expat uses the new BSD license, so maybe + we can just drop it in the tree, with an option to use the + platform expat on autoconf systems. + + o MySQL table metadata to SSQLSv2 data structure translator. + (-s, -u, -p and -t flag support.) Add this to dtest, extracting + stock.ssqls definition from DB. + + o Replace Query's template methods taking SSQLSes with concrete + methods taking const SsqlsBase&. + + o Create Query::remove(const SsqlsBase&) + + o Try to remove of 'explicit' from Date, DateTime and Time + ctors taking stringish types. (Can't do it for real until v4, + but we can lay the ground work here.) + + o Auto-create() ctor: if there is an auto_increment field, + populate it on query success. + + o Detect ctor conflicts corresponding to sql_create_N(N, N...) + in SSQLSv1. ssqlsxlat can be smart enough to just not emit + duplicate ctors. + + o Special case of ctor suppression: if the number of key fields + equals the total number of fields, you get an auto-load() ctor, + not auto-update(). + + o Replace CREATE TABLE SQL in resetdb with create_table() calls. + + o Option to use integer indices into Row when populating? Only + bother if it gives a speed advantage we can actually see, + because it removes all the dynamic typing advantages we got + with the change to field name indices in v3.0. + + o Try to add Query::storein(container, ssqls), which generates + SELECT * from {ssqls.table()} and stores the result. May not be + possible due to existing overloads, but try. If it works, use + this form in the userman Overview section, saving one LOC. + + o Convert SSQLS v1 examples to v2. SSQLS v2 isn't done until + there's a straightformward conversion path for all examples. + + o Add #warning to generated ssqls.h saying that you should now use + SSQLS v2. Wrap it in a check for MYSQLPP_ALLOW_SSQLS_V1, + so people can disable the warning. + + +v3.4 Tentative Plan +------------------- + o Add Query::storein(container), getting table + name from container::value_type.table() instead. + + o Define operator<< for Fields, Row, StoreQueryResult, etc., giving + CSV format. + + o Remove libexcommon. Between above and SSQLSv2, we should have + everything we need to get equivalent output without special + purpose code. There should be no ad hoc data dumping code in + the examples. + + o Bring back mandatory quoting for manipulators? If someone says + os << mysqlpp::escape << foo; do they not really really mean + escape foo? Automatic quoting and escaping is different. See + + http://lists.mysql.com/plusplus/7999 + + o Configure script should try to get MySQL C API directories + from mysql_config. + + o If pkg-config is available, register ourselves with it using + information discovered by configure. Also, write out a + mysql++-config script, which either wraps pkg-config or + reinvents it, poorly, for systems that don't have it. + + o Add String::operator==(const mysqlpp::null_type&). Needed to + allow comparison of row[x] returns to SQL null. Change one of + the examples to show it? + + o Memory "leak" and C API library init fixes: + + - Add DBDriver::library_begin() and library_end(), wrapping + similarly named functions in the C API. + + - Create Process class, which you create at the top of main() + on the stack, purely to call these automatically. + + - Update userman to recommend creating Process object in + ConnectionPool derivatives, instead. + + - Create Thread class to call existing DBDriver::thread_start() + and thread_end(), similar to Process, created on the stack + of the thread entry function. + + - Move memory leak FAQ into userman, rewriting it to cover + all this. + + o mysqlpp::execute manipulator. Immediately executes built + query string. Works best with exceptions, as that's the only way + to detect failures. + + o Chris Frey's packarray class + + o Create adaptors for std::bitset, for storing binary data in a + MySQL table. Make two options available, one for storing the + return from bitset::to_ulong() in an UNSIGNED INTEGER column, + and another for storing a larger set of bits in a more flexible + way, perhaps as a BLOB. + + o Create a backtick manipulator for use by field_list() in row.h + and ssqls.h. These currently use do_nothing0, but that prevents + use of SQL reserved words as identifiers. + + o Has experience with new thread awareness changed our mind on + atomic inc/dec of reference counts in RefCounted*? + + o Create a fixed-point data type for use with SQL's DECIMAL and + related types. Right now, sql_decimal is a typedef for double, + so you lose accuracy in the fractional part. Don't forget to + include an "is_null" flag to cope with conversion from infinite + or NaN float values; that's how MySQL stores these. + + o Optional checked conversions in String for numerics: throw + BadConversion on range overflow? + + o Add Query::storein_if(), mirroring store_if() + + o Add a method to mysqlpp::String to return a widened version of the + string. Probably make return type templatized so we can return + wstring, C++/CLI native strings, etc. Then convert examples that + do this conversion to use this new mechanism. + + o Try to add operator std::string to String. If it doesn't work, + explain why not in the userman, and in Row::operator[] refman. + + o Wrap LOAD DATA INFILE: + + bool Query::load_file( + const char* path, + bool local_path, + const char* table, + const char* field_terminator = 0, // default \t + const char* field_encloser = 0, // default none + const char* field_escape = 0, // default \ + const char* line_terminator = 0, // \n on *ix, \r\n on Windows + const char* line_starter = 0, // default none + const char* character_set = 0, // default UTF-8 + const char* comment_prefix = 0, // ignore no lines + bool replace_existing = false, + bool ignore_duplicates = false, + bool low_priority = false, + int skip_lines = 0); + + o Wrappers for above: load_local_tab_file(), load_local_csv_file(), + load_remote_*()... + + o Query::save_file() interfaces, wrapping SELECT ... INTO FILE, + modeled on above. + + +v4.0 or Later +------------- + o Database independence: + + - Use libdbi or similar? http://libdbi.sf.net/ + + - Make DBDriver class purely abstract; move its entire functional + contents to new MysqlDriver. + + - Must create at least two other DBDriver subclasses to + ensure base class is reusable before releasing v4.0. + PostgresDriver and SqlLiteDriver? + + - Templatize all classes that use DBDriver interface with the + DB driver type. This lets you specify the driver type to use + with a Connection and all its children without modifying the + existing method parameter lists. This also lets us worry less + about C API types, as they can be hidden away behind typedefs: + + class MysqlDriver : public DBDriver { ... + typedef MYSQL_ROW row_type; + ... + } + + template + class Connection ... { ... + Query query(); + ... + } + + template + class UseQueryResult { ... + DBD::row_type fetch_raw_row(); + } + + - Tricky bits: + + - Initializing result set objects. + + - type_info module. Extremely closely tied to MySQL C API + right now. Will probably have to turn it into a parallel + class hierarchy to DBDriver, or fold it in with same. + + - Building MySQL++ on systems without autoconf. How to + specify what DB engines are available? Probably default to + supporting MySQL only, and let people turn things on manually + as they need them. Or, maybe make them use Bakefile so they + can fiddle with the options if they want something atypical. + + o Fork mysqlpp::String into mysqlpp::Blob, which differs only in + that it knows that it should be automatically quoted and escaped + when inserted into a SQL query. Could do this in 3.x, but it's a + pretty serious API breakage. + + o Some sort of support for prepared statements. Can we hijack + the template query mechanism? + + o If SSQLSv2 does use a common base class, change Query template + methods taking SSQLS into concrete methods taking SsqlsBase&. + + o Make Query::insert(), replace() and update() execute their + queries immediately. Requires an ABI break, because they'll + have to return SimpleResult. + + o Switch Query's safe bool to overload basic_ios<>::operator + void*() instead. We create an ambiguous conversion in bool + context with some C++ standard libraries otherwise. + + o Templatize mysqlpp::String on value_type so it can be used to + hold wide characters. Then the method that converts UTF-8 to the + platform's best wide character type can just return a different + variant of mysqlpp::String. + + o Add wrapper functions to Null<> like length() that call the + corresponding function on data member, if present, to make it + more transparent. At minimum, mirror the std::string API. + + o Transaction class should check an "in transaction" flag on + Connection (or DBDriver) before sending BEGIN, defaulting to + false. If set, the Transaction object does nothing. If not + set, set it and send the query. This prevents it from trying + to set up nested queries, which MySQL doesn't support. + + o Remove throw-spec for std::out_of_range from SQLTypeAdapter::at(). + It no longer throws this, and throw-specs are passee' anyway. + + o Store failed query string in BadQuery exception object, to make + logging and debugging easier. One could have a try block wrapping + many queries, and be able to recover the failed query string from + the exception object, instead of somehow keeping track yourself. + + Patch: http://lists.mysql.com/plusplus/8374 + + o Query and SQLStream could have a common base class that would + allow the stream manipulator functions to catch and modify + strings based on only one dynamic_cast instead of requiring + two as it does since the addition of the SQLStream class. + + o Make internal call chain steps like Query::execute(SQLQueryParms&) + protected? No good reason for end users to call it, and making + it part of the public API causes people to try calling it, and + discovering that it's not a very elegant interface, compared to + the ones taking SQLStrings. + + o SQL time type allows +/- 839 hours of range. v3.0 code doesn't + cope with negative times, and if we change it to use signed + integers, we'll still only get +/-127 hours instead of +255. + Need to switch the hour field to a short to get the full range. + + o Create a thread-safe message queue for separating DB access and + data use into multiple threads. Something like ConnectionPool, + optional and with no ties to the internals of MySQL++. There + could be an adapter between one end of the queue and a Connection + object, which creates Queries to handle standardized messages, + delivering the results back to the queue. + + o Get rid of two-step create in DBDriver, requiring a connection to + be established in ctor for object to be valid? RAII. The + DB-specific functions that don't require a connection can be + static methods. Tricky bit: a failed Connection::connect() call + will likely be followed by an indirect call to DBDriver::err*(). + Does Connection cache the error value and message? If we can pull + this off, we can drop the DBDriver::is_connected_ flag and change + Connection::connected() to "return driver_ != 0". + + o Add STL-like custom Allocator template parameters to memory-hungry + classes like Row? Useful in apps that process lots of data over + long periods, causing heap fragmentation with the default C++ + allocator. + + o Audit library for non-virtual methods that could be profitably + made virtual. Many are non-overridable now purely because + changing them would break the ABI, so now's the time to fix that. ADDED abi.xml.in Index: abi.xml.in ================================================================== --- /dev/null +++ abi.xml.in @@ -0,0 +1,9 @@ + + @MYSQLPP_VERSION_MAJOR@.@MYSQLPP_VERSION_MINOR@.@MYSQLPP_VERSION_BUGFIX@ + + + lib + + + . + ADDED bk-deps Index: bk-deps ================================================================== --- /dev/null +++ bk-deps @@ -0,0 +1,122 @@ +#!/bin/sh + +# This script is part of Bakefile (http://www.bakefile.org) autoconf +# script. It is used to track C/C++ files dependencies in portable way. +# +# Permission is given to use this file in any way. + +DEPSMODE=gcc +DEPSFLAG="-MMD" +DEPSDIRBASE=.deps + +if test $DEPSMODE = gcc ; then + $* ${DEPSFLAG} + status=$? + + # determine location of created files: + while test $# -gt 0; do + case "$1" in + -o ) + shift + objfile=$1 + ;; + -* ) + ;; + * ) + srcfile=$1 + ;; + esac + shift + done + objfilebase=`basename $objfile` + builddir=`dirname $objfile` + depfile=`basename $srcfile | sed -e 's/\..*$/.d/g'` + depobjname=`echo $depfile |sed -e 's/\.d/.o/g'` + depsdir=$builddir/$DEPSDIRBASE + mkdir -p $depsdir + + # if the compiler failed, we're done: + if test ${status} != 0 ; then + rm -f $depfile + exit ${status} + fi + + # move created file to the location we want it in: + if test -f $depfile ; then + sed -e "s,$depobjname:,$objfile:,g" $depfile >${depsdir}/${objfilebase}.d + rm -f $depfile + else + # "g++ -MMD -o fooobj.o foosrc.cpp" produces fooobj.d + depfile=`echo "$objfile" | sed -e 's/\..*$/.d/g'` + if test ! -f $depfile ; then + # "cxx -MD -o fooobj.o foosrc.cpp" creates fooobj.o.d (Compaq C++) + depfile="$objfile.d" + fi + if test -f $depfile ; then + sed -e "\,^$objfile,!s,$depobjname:,$objfile:,g" $depfile >${depsdir}/${objfilebase}.d + rm -f $depfile + fi + fi + exit 0 + +elif test $DEPSMODE = mwcc ; then + $* || exit $? + # Run mwcc again with -MM and redirect into the dep file we want + # NOTE: We can't use shift here because we need $* to be valid + prevarg= + for arg in $* ; do + if test "$prevarg" = "-o"; then + objfile=$arg + else + case "$arg" in + -* ) + ;; + * ) + srcfile=$arg + ;; + esac + fi + prevarg="$arg" + done + + objfilebase=`basename $objfile` + builddir=`dirname $objfile` + depsdir=$builddir/$DEPSDIRBASE + mkdir -p $depsdir + + $* $DEPSFLAG >${depsdir}/${objfilebase}.d + exit 0 + +elif test $DEPSMODE = unixcc; then + $* || exit $? + # Run compiler again with deps flag and redirect into the dep file. + # It doesn't work if the '-o FILE' option is used, but without it the + # dependency file will contain the wrong name for the object. So it is + # removed from the command line, and the dep file is fixed with sed. + cmd="" + while test $# -gt 0; do + case "$1" in + -o ) + shift + objfile=$1 + ;; + * ) + eval arg$#=\$1 + cmd="$cmd \$arg$#" + ;; + esac + shift + done + + objfilebase=`basename $objfile` + builddir=`dirname $objfile` + depsdir=$builddir/$DEPSDIRBASE + mkdir -p $depsdir + + eval "$cmd $DEPSFLAG" | sed "s|.*:|$objfile:|" >${depsdir}/${objfilebase}.d + exit 0 + +else + $* + exit $? +fi ADDED bmark.txt Index: bmark.txt ================================================================== --- /dev/null +++ bmark.txt @@ -0,0 +1,257 @@ +All unit tests passed +---------------- BEGIN resetdb OUTPUT ---------------- +Connecting to database server... +Dropping existing sample data tables... +Creating stock table... +Populating stock table...inserted 4 rows. +Creating empty images table... +Creating deadlock testing tables... +Reinitialized sample database successfully. +================ END resetdb OUTPUT ================ + +---------------- BEGIN simple1 OUTPUT ---------------- +We have: + Nürnberger Brats + Pickle Relish + Hot Mustard + Hotdog Buns +================ END simple1 OUTPUT ================ + +---------------- BEGIN simple2 OUTPUT ---------------- +Item Num Weight Price Date + +Nürnberger Brats 97 1.5 8.79 2005-03-10 +Pickle Relish 87 1.5 1.75 1998-09-04 +Hot Mustard 73 0.95 0.97 1998-05-25 +Hotdog Buns 65 1.1 1.10 1998-04-23 +================ END simple2 OUTPUT ================ + +---------------- BEGIN simple3 OUTPUT ---------------- +Item Num Weight Price Date + +Nürnberger Brats 97 1.5 8.79 2005-03-10 +Pickle Relish 87 1.5 1.75 1998-09-04 +Hot Mustard 73 0.95 0.97 1998-05-25 +Hotdog Buns 65 1.1 1.10 1998-04-23 +================ END simple3 OUTPUT ================ + +---------------- BEGIN store_if OUTPUT ---------------- +Records found: 2 + +Item Num Weight Price Date + +Nürnberger Brats 97 1.5 8.79 2005-03-10 +Hot Mustard 73 0.95 0.97 1998-05-25 +================ END store_if OUTPUT ================ + +---------------- BEGIN for_each OUTPUT ---------------- +There are 322 items weighing 416.85 stone and costing 1147.19 cowrie shells. +================ END for_each OUTPUT ================ + +---------------- BEGIN multiquery OUTPUT ---------------- +Multi-query: +DROP TABLE IF EXISTS test_table; CREATE TABLE test_table(id INT); INSERT INTO test_table VALUES(10); UPDATE test_table SET id=20 WHERE id=10; SELECT * FROM test_table; DROP TABLE test_table +Result set 0 is empty. +Result set 1 is empty. +Result set 2 is empty. +Result set 3 is empty. +Result set 4 has 1 row: + +----+ + | id | + +----+ + | 20 | + +----+ +Result set 5 is empty. +Stored procedure query: +DROP PROCEDURE IF EXISTS get_stock; CREATE PROCEDURE get_stock( i_item varchar(20) ) BEGIN SET i_item = concat('%', i_item, '%'); SELECT * FROM stock WHERE lower(item) like lower(i_item); END; +Result set 0 is empty. +Result set 1 is empty. +Query: CALL get_stock('relish') +Result set 0 has 1 row: + +---------------+-----+--------+-------+------------+-------------+ + | item | num | weight | price | sdate | description | + +---------------+-----+--------+-------+------------+-------------+ + | Pickle Relish | 87 | 1.5 | 1.75 | 1998-09-04 | NULL | + +---------------+-----+--------+-------+------------+-------------+ +Result set 1 is empty. +================ END multiquery OUTPUT ================ + +---------------- BEGIN tquery1 OUTPUT ---------------- +Query: select * from stock +Records found: 4 + +Item Num Weight Price Date + +Nuerenberger Bratwurst 97 1.5 8.79 2005-03-10 +Pickle Relish 87 1.5 1.75 1998-09-04 +Hot Mustard 73 0.95 0.97 1998-05-25 +Hotdog Buns 65 1.1 1.1 1998-04-23 +================ END tquery1 OUTPUT ================ + +---------------- BEGIN resetdb OUTPUT ---------------- +Connecting to database server... +Dropping existing sample data tables... +Creating stock table... +Populating stock table...inserted 4 rows. +Creating empty images table... +Creating deadlock testing tables... +Reinitialized sample database successfully. +================ END resetdb OUTPUT ================ + +---------------- BEGIN tquery2 OUTPUT ---------------- +Query: select * from stock +Records found: 4 + +Item Num Weight Price Date + +Nuerenberger Bratwurst 97 1.5 8.79 2005-03-10 +Pickle Relish 87 1.5 1.75 1998-09-04 +Hot Mustard 73 0.95 0.97 1998-05-25 +Hotdog Buns 65 1.1 1.1 1998-04-23 +================ END tquery2 OUTPUT ================ + +---------------- BEGIN tquery3 OUTPUT ---------------- +Stuff we have a lot of in stock: + Nuerenberger Bratwurst + Pickle Relish +================ END tquery3 OUTPUT ================ + +---------------- BEGIN tquery4 OUTPUT ---------------- +Query: update stock set num = 70 where num < 70 +Query: select * from stock +Records found: 4 + +Item Num Weight Price Date + +Nuerenberger Bratwurst 97 1.5 8.79 2005-03-10 +Pickle Relish 87 1.5 1.75 1998-09-04 +Hot Mustard 73 0.95 0.97 1998-05-25 +Hotdog Buns 70 1.1 1.1 1998-04-23 + +Query: select * from stock where weight > 1.2 or description like '%Mustard%' +Records found: 3 + +Item Num Weight Price Date + +Nuerenberger Bratwurst 97 1.5 8.79 2005-03-10 +Pickle Relish 87 1.5 1.75 1998-09-04 +Hot Mustard 73 0.95 0.97 1998-05-25 +================ END tquery4 OUTPUT ================ + +---------------- BEGIN resetdb OUTPUT ---------------- +Connecting to database server... +Dropping existing sample data tables... +Creating stock table... +Populating stock table...inserted 4 rows. +Creating empty images table... +Creating deadlock testing tables... +Reinitialized sample database successfully. +================ END resetdb OUTPUT ================ + +---------------- BEGIN ssqls1 OUTPUT ---------------- +We have: + Nürnberger Brats + Pickle Relish + Hot Mustard (good American yellow mustard, not that European stuff) + Hotdog Buns +================ END ssqls1 OUTPUT ================ + +---------------- BEGIN ssqls2 OUTPUT ---------------- +Query: INSERT INTO `stock` (`item`,`num`,`weight`,`price`,`sDate`,`description`) VALUES ('Hot Dogs',100,1.5,NULL,'1998-09-25',NULL) +Query: select * from stock +Records found: 5 + +Item Num Weight Price Date + +Nürnberger Brats 97 1.5 8.79 2005-03-10 +Pickle Relish 87 1.5 1.75 1998-09-04 +Hot Mustard 73 0.95 0.97 1998-05-25 +Hotdog Buns 65 1.1 1.1 1998-04-23 +Hot Dogs 100 1.5 (NULL) 1998-09-25 +================ END ssqls2 OUTPUT ================ + +---------------- BEGIN ssqls3 OUTPUT ---------------- +Query: UPDATE `stock` SET `item` = 'Nuerenberger Bratwurst',`num` = 97,`weight` = 1.5,`price` = 8.7899999999999991,`sDate` = '2005-03-10',`description` = NULL WHERE `item` = 'Nürnberger Brats' +Query: select * from stock +Records found: 5 + +Item Num Weight Price Date + +Nuerenberger Bratwurst 97 1.5 8.79 2005-03-10 +Pickle Relish 87 1.5 1.75 1998-09-04 +Hot Mustard 73 0.95 0.97 1998-05-25 +Hotdog Buns 65 1.1 1.1 1998-04-23 +Hot Dogs 100 1.5 (NULL) 1998-09-25 +================ END ssqls3 OUTPUT ================ + +---------------- BEGIN ssqls4 OUTPUT ---------------- +Records found: 5 + +Item Num Weight Price Date + +Hot Dogs 100 1.5 (NULL) 1998-09-25 +Hot Mustard 73 0.95 0.97 1998-05-25 +Hotdog Buns 65 1.1 1.1 1998-04-23 +Nuerenberger Bratwurst 97 1.5 8.79 2005-03-10 +Pickle Relish 87 1.5 1.75 1998-09-04 + +Currently 65 hotdog buns in stock. +================ END ssqls4 OUTPUT ================ + +---------------- BEGIN ssqls5 OUTPUT ---------------- +Custom query: +select * from stock where `weight` = 1.5 and `price` = 8.7899999999999991 +================ END ssqls5 OUTPUT ================ + +---------------- BEGIN ssqls6 OUTPUT ---------------- +Query: select * from stock +Records found: 26 + +Item Num Weight Price Date + +Tiny Screws 1000 0.01 0.05 2008-11-11 +Needle-nose Pliers 50 0.5 5.95 2008-11-12 +Small Soldering Iron 40 0.5 15.95 2008-09-01 +Large Soldering Iron 35 0.75 24.95 2008-08-01 +Solder Wick 100 0.1 2.95 2008-04-01 +Mini Screwdrivers, 3 pc. 30 0.4 8.95 2008-03-25 +Mini Screwdrivers, 6 pc. 40 0.6 12.95 2008-04-01 +Wire-wrapping Tool 25 0.2 4.95 2008-04-23 +Red LED, 5mm, 3000mcd 300 0.01 0.29 2008-10-02 +Orange LED, 5mm, 2500mcd 250 0.01 0.29 2008-07-31 +Yellow LED, 5mm, 3000mcd 400 0.01 0.25 2008-09-30 +Green LED, 5mm, 1000mcd 350 0.01 0.45 2008-09-27 +Blue LED, 5mm, 3900mcd 500 0.01 0.34 2007-12-01 +White LED, 5mm, 15000mcd 750 0.01 0.43 2008-02-01 +AA Battery, single 220 0.05 0.5 2007-09-19 +AA Battery, 4-pack 60 0.2 1.79 2007-08-03 +AA Battery, 24-pack 8 1.2 9.99 2007-04-25 +C Battery, single 100 0.075 0.65 2007-11-14 +C Battery, 4-pack 25 0.3 2.29 2007-06-05 +C Battery, 24-pack 5 1.8 10.99 2007-06-13 +D Battery, single 180 0.08 0.7 2007-12-03 +D Battery, 4-pack 45 0.3 2.59 2007-04-01 +D Battery, 24-pack 12 1.9 11.99 2007-05-15 +9-volt Battery, single 90 0.06 0.75 2008-01-02 +9-volt Battery, 3-pack 17 0.2 1.99 2008-02-28 +9-volt Batter, 20-pack 12 1.2 12.99 2007-12-28 +================ END ssqls6 OUTPUT ================ + +---------------- BEGIN load_jpeg OUTPUT ---------------- +Inserted "NULL" into images table, 0 bytes, ID 1 +================ END load_jpeg OUTPUT ================ + +---------------- BEGIN cgi_jpeg OUTPUT ---------------- +Content-type: text/plain + +No image content! +================ END cgi_jpeg OUTPUT ================ + +--- BEGIN ssqlsxlat -i examples/common.ssqls -o ERROR OUTPUT --- +==== END ssqlsxlat -i examples/common.ssqls -o ERROR OUTPUT ==== +--- BEGIN ssqlsxlat -i examples/stock.ssqls -o ERROR OUTPUT --- +==== END ssqlsxlat -i examples/stock.ssqls -o ERROR OUTPUT ==== +--- BEGIN ssqlsxlat -i test/test1.ssqls -o ERROR OUTPUT --- +==== END ssqlsxlat -i test/test1.ssqls -o ERROR OUTPUT ==== +--- BEGIN ssqlsxlat -i test/test2.ssqls -o ERROR OUTPUT --- +==== END ssqlsxlat -i test/test2.ssqls -o ERROR OUTPUT ==== Index: bootstrap ================================================================== --- bootstrap +++ bootstrap @@ -1,18 +1,119 @@ -#!/bin/sh +#!/bin/bash + +ARGS=1 +BF_OPTIONS= +MAINT_FLAGS="--cache-file=config.cache" +while [ $ARGS != 0 ] +do + case "$1" in + bat) + cmd /c bootstrap.bat $BF_OPTIONS + exit 0 + ;; + + nodoc) + BF_OPTIONS="-DBUILDDOCS=no $BF_OPTIONS" + shift + ;; + + noex) + BF_OPTIONS="-DBUILDEXAMPLES=no $BF_OPTIONS" + shift + ;; + + nolib) + BF_OPTIONS="-DBUILDLIBRARY=no $BF_OPTIONS" + shift + ;; + + nomaint) + MAINT_FLAGS= + shift + ;; + + noopt) + export CXXFLAGS="-g -O0" + shift + ;; + + pedantic) + export CXXFLAGS="-g -O2 -ansi -pedantic -Wall -Wextra -W -Wold-style-cast -Wfloat-equal -Wwrite-strings -Wno-overloaded-virtual -Wno-long-long -Wno-variadic-macros -D_GLIBCXX_DEBUG -D_GLIBCXX_DEBUG_PEDANTIC" + shift + ;; + + *) + ARGS=0 + ;; + esac +done + +# Check for existence of needed tools, so we can give a better error +# message than the shell will. +tools="make" # POSIX +tools="$tools aclocal autoconf autoheader libtoolize" # autotools +tools="$tools bakefile bakefilize bakefile_gen" # Bakefile +for tool in $tools +do + if ! type -p $tool > /dev/null + then + echo "FAILED to find build tool '$tool'!" + echo + echo BOOTSTRAP FAILED! + echo + exit 1 + fi +done + +# Find location of Bakefile's stock M4 autoconf macros +for d in /usr/share/aclocal /usr/local/share/aclocal \ + '/c/Program Files (x86)/Bakefile/autoconf' +do + BAKEFILE_M4="$d" + if [ -e "$BAKEFILE_M4/bakefile.m4" ] ; then break ; fi +done +if [ ! -e "$BAKEFILE_M4/bakefile.m4" ] +then + echo + echo "Failed to find bakefile.m4. Add the directory containing" + echo "this to the bootstrap script." + echo + exit 1 +fi + +# Do Bakefile stuff first. Autoconf can't succeed without +# autoconf_in.m4, which Bakefile creates. +success= +set -x && + for d in 3 5 8 ; do mkdir -p vc200$d ; done && + bakefilize && + rm -f INSTALL && + bakefile_gen $BF_OPTIONS && + bakefile -f gnu -o Makefile.simple -DBUILDLIBRARY=no mysql++.bkl && + set +x && + success=shonuff -if [ "$1" == "pedantic" ] -then - export CXXFLAGS="-g -O2 -ansi -pedantic -Wall -W -Wold-style-cast -Wfloat-equal -Wwrite-strings -Woverloaded-virtual -Wno-long-long" - shift +# Do the autotools stuff if Bakefile steps succeeded +if [ -n "$success" ] +then + rm -f config.cache + mv autoconf_inc.m4 config > /dev/null 2>&1 # don't care if it fails + set -x && + aclocal -I config -I "$BAKEFILE_M4" && + libtoolize && + autoheader && + autoconf && + ./configure $MAINT_FLAGS $* && + make lib/querydef.h lib/ssqls.h && + set +x && + success=awyeah fi -rm -f config.cache -set -x - -aclocal -I config && \ - libtoolize --force --copy && \ - autoheader && \ - automake --add-missing --copy --foreign && \ - autoconf && - ./reconf $* && - ( cd lib ; make custom.h ) +# Detect failure in any part of above +if [ -z "$success" ] +then + echo + echo BOOTSTRAP FAILED! + echo + exit 1 +fi + ADDED bootstrap.bat Index: bootstrap.bat ================================================================== --- /dev/null +++ bootstrap.bat @@ -0,0 +1,63 @@ +@echo off +if not exist vc2003 mkdir vc2003 +if not exist vc2005 mkdir vc2005 +if not exist vc2008 mkdir vc2008 + +bakefile_gen %* +if errorlevel 1 exit +if not exist vc2003\mysql++.sln goto no_bakefile +if not exist vc2005\mysql++.sln goto no_bakefile +if not exist vc2008\mysql++.sln goto no_bakefile + +cd lib +perl querydef.pl +if errorlevel 1 exit +if not exist querydef.h goto no_perl +perl ssqls.pl +if errorlevel 1 exit +if not exist ssqls.h goto no_perl + +if not exist mysql++.h goto no_mysqlpp_h +cd .. + +exit + +:no_bakefile +echo. +echo Bakefile doesn't seem to be installed on this system. Download it +echo from http://bakefile.org/ You need version 0.2.3 or newer. +echo. +exit + +:no_perl +echo. +echo You need a Perl interpreter installed on your system, somewhere in +echo the PATH. Any recent version or flavor should work; we don't use +echo any special extensions. The easiest to install on Windows would be +echo ActivePerl, from http://activestate.com/Products/activeperl/ +echo If you're familiar with Unix, you might like Cygwin better instead: +echo http://cygwin.com/setup.exe +echo. +cd .. +exit + +:no_mysqlpp_h +echo. +echo WARNING: Can't make lib/mysql++.h +echo. +echo On Unixy systems, autoconf creates lib/mysql++.h from lib/mysql++.h.in +echo but there is no easy way to do this on Windows. You can do it manually: +echo just copy the file to the new name, and edit the MYSQLPP_HEADER_VERSION +echo definition to put the proper version number parts into the macro. It +echo needs to look something like this: +echo. +echo #define MYSQLPP_HEADER_VERSION MYSQLPP_VERSION(3, 0, 0) +echo. +echo It's important that the three numbers match the actual library version +echo number, or else programs that check this (like resetdb) will fail. +echo. +echo Alternately, if you've also got MySQL++ installed on some Unixy type +echo system, you can let its bootstrap procedure create mysql++.h and then +echo copy it to the Windows machine. +echo. +cd .. ADDED cleanmf Index: cleanmf ================================================================== --- /dev/null +++ cleanmf @@ -0,0 +1,3 @@ +#!/bin/sh +rm -f Makefile* +rm -rf *.xcodeproj vc200? DELETED common.am Index: common.am ================================================================== --- common.am +++ /dev/null @@ -1,4 +0,0 @@ -INCLUDES = -I$(top_srcdir)/lib -LIBS = -lz -l@MYSQL_C_LIB@ - -MYSQLPP_LIB = $(top_builddir)/lib/libmysqlpp.la Index: config.h.in ================================================================== --- config.h.in +++ config.h.in @@ -1,6 +1,6 @@ -/* config.h.in. Generated from configure.in by autoheader. */ +/* config.h.in. Generated from configure.ac by autoheader. */ /* Define to 1 if you have the header file. */ #undef HAVE_DLFCN_H /* Define if you have __gnu_cxx:slist container in */ @@ -9,28 +9,28 @@ /* Define if you have ::slist container in */ #undef HAVE_GLOBAL_SLIST /* Define to 1 if you have the header file. */ #undef HAVE_INTTYPES_H + +/* Define if getopt() is available in libiberty.h */ +#undef HAVE_LIBIBERTY_GETOPT /* Define to 1 if you have the `intl' library (-lintl). */ #undef HAVE_LIBINTL -/* Define to 1 if you have the `nsl' library (-lnsl). */ -#undef HAVE_LIBNSL - -/* Define to 1 if you have the `socket' library (-lsocket). */ -#undef HAVE_LIBSOCKET - -/* Define to 1 if you have the `z' library (-lz). */ -#undef HAVE_LIBZ +/* Define if you have the localtime_r() facility */ +#undef HAVE_LOCALTIME_R /* Define to 1 if you have the header file. */ #undef HAVE_MEMORY_H -/* Define if mysql_shutdown() has a second 'level' argument */ -#undef HAVE_MYSQL_SHUTDOWN_LEVEL_ARG +/* Define if your MySQL library has SSL functions */ +#undef HAVE_MYSQL_SSL_SET + +/* Define if getopt() is available in unistd.h */ +#undef HAVE_POSIX_GETOPT /* Define if you have POSIX threads libraries and header files. */ #undef HAVE_PTHREAD /* Define to 1 if you have the header file. */ @@ -46,12 +46,12 @@ #undef HAVE_STRINGS_H /* Define to 1 if you have the header file. */ #undef HAVE_STRING_H -/* Define to 1 if you have the `strtol' function. */ -#undef HAVE_STRTOL +/* Define to 1 if you have the header file. */ +#undef HAVE_SYNCH_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_STAT_H /* Define to 1 if you have the header file. */ @@ -58,15 +58,13 @@ #undef HAVE_SYS_TYPES_H /* Define to 1 if you have the header file. */ #undef HAVE_UNISTD_H -/* Define to 1 if you have the header file. */ -#undef HAVE_ZLIB_H - -/* Name of package */ -#undef PACKAGE +/* Define to the sub-directory in which libtool stores uninstalled libraries. + */ +#undef LT_OBJDIR /* Define to the address where bug reports for this package should be sent. */ #undef PACKAGE_BUGREPORT /* Define to the full name of this package. */ @@ -75,10 +73,13 @@ /* Define to the full name and version of this package. */ #undef PACKAGE_STRING /* Define to the one symbol short name of this package. */ #undef PACKAGE_TARNAME + +/* Define to the home page for this package. */ +#undef PACKAGE_URL /* Define to the version of this package. */ #undef PACKAGE_VERSION /* Define to necessary symbol if this constant uses a non-standard name on @@ -85,14 +86,5 @@ your system. */ #undef PTHREAD_CREATE_JOINABLE /* Define to 1 if you have the ANSI C header files. */ #undef STDC_HEADERS - -/* Version number of package */ -#undef VERSION - -/* Define if using the dmalloc debugging malloc package */ -#undef WITH_DMALLOC - -/* Define to empty if `const' does not conform to ANSI C. */ -#undef const Index: config/acx_pthread.m4 ================================================================== --- config/acx_pthread.m4 +++ config/acx_pthread.m4 @@ -1,48 +1,85 @@ -dnl @synopsis ACX_PTHREAD([ACTION-IF-FOUND[, ACTION-IF-NOT-FOUND]]) -dnl -dnl This macro figures out how to build C programs using POSIX -dnl threads. It sets the PTHREAD_LIBS output variable to the threads -dnl library and linker flags, and the PTHREAD_CFLAGS output variable -dnl to any special C compiler flags that are needed. (The user can also -dnl force certain compiler flags/libs to be tested by setting these -dnl environment variables.) -dnl -dnl Also sets PTHREAD_CC to any special C compiler that is needed for -dnl multi-threaded programs (defaults to the value of CC otherwise). -dnl (This is necessary on AIX to use the special cc_r compiler alias.) -dnl -dnl NOTE: You are assumed to not only compile your program with these -dnl flags, but also link it with them as well. e.g. you should link -dnl with $PTHREAD_CC $CFLAGS $PTHREAD_CFLAGS $LDFLAGS ... $PTHREAD_LIBS $LIBS -dnl -dnl If you are only building threads programs, you may wish to -dnl use these variables in your default LIBS, CFLAGS, and CC: -dnl -dnl LIBS="$PTHREAD_LIBS $LIBS" -dnl CFLAGS="$CFLAGS $PTHREAD_CFLAGS" -dnl CC="$PTHREAD_CC" -dnl -dnl In addition, if the PTHREAD_CREATE_JOINABLE thread-attribute -dnl constant has a nonstandard name, defines PTHREAD_CREATE_JOINABLE -dnl to that name (e.g. PTHREAD_CREATE_UNDETACHED on AIX). -dnl -dnl ACTION-IF-FOUND is a list of shell commands to run if a threads -dnl library is found, and ACTION-IF-NOT-FOUND is a list of commands -dnl to run it if it is not found. If ACTION-IF-FOUND is not specified, -dnl the default action will define HAVE_PTHREAD. -dnl -dnl Please let the authors know if this macro fails on any platform, -dnl or if you have any other suggestions or comments. This macro was -dnl based on work by SGJ on autoconf scripts for FFTW (www.fftw.org) -dnl (with help from M. Frigo), as well as ac_pthread and hb_pthread -dnl macros posted by Alejandro Forero Cuervo to the autoconf macro -dnl repository. We are also grateful for the helpful feedback of -dnl numerous users. -dnl -dnl @version $Id: acx_pthread.m4 433 2005-03-01 04:20:54Z tangent $ -dnl @author Steven G. Johnson +# =========================================================================== +# http://autoconf-archive.cryp.to/acx_pthread.html +# =========================================================================== +# +# SYNOPSIS +# +# ACX_PTHREAD([ACTION-IF-FOUND[, ACTION-IF-NOT-FOUND]]) +# +# DESCRIPTION +# +# This macro figures out how to build C programs using POSIX threads. It +# sets the PTHREAD_LIBS output variable to the threads library and linker +# flags, and the PTHREAD_CFLAGS output variable to any special C compiler +# flags that are needed. (The user can also force certain compiler +# flags/libs to be tested by setting these environment variables.) +# +# Also sets PTHREAD_CC to any special C compiler that is needed for +# multi-threaded programs (defaults to the value of CC otherwise). (This +# is necessary on AIX to use the special cc_r compiler alias.) +# +# NOTE: You are assumed to not only compile your program with these flags, +# but also link it with them as well. e.g. you should link with +# $PTHREAD_CC $CFLAGS $PTHREAD_CFLAGS $LDFLAGS ... $PTHREAD_LIBS $LIBS +# +# If you are only building threads programs, you may wish to use these +# variables in your default LIBS, CFLAGS, and CC: +# +# LIBS="$PTHREAD_LIBS $LIBS" +# CFLAGS="$CFLAGS $PTHREAD_CFLAGS" +# CC="$PTHREAD_CC" +# +# In addition, if the PTHREAD_CREATE_JOINABLE thread-attribute constant +# has a nonstandard name, defines PTHREAD_CREATE_JOINABLE to that name +# (e.g. PTHREAD_CREATE_UNDETACHED on AIX). +# +# ACTION-IF-FOUND is a list of shell commands to run if a threads library +# is found, and ACTION-IF-NOT-FOUND is a list of commands to run it if it +# is not found. If ACTION-IF-FOUND is not specified, the default action +# will define HAVE_PTHREAD. +# +# Please let the authors know if this macro fails on any platform, or if +# you have any other suggestions or comments. This macro was based on work +# by SGJ on autoconf scripts for FFTW (http://www.fftw.org/) (with help +# from M. Frigo), as well as ac_pthread and hb_pthread macros posted by +# Alejandro Forero Cuervo to the autoconf macro repository. We are also +# grateful for the helpful feedback of numerous users. +# +# LAST MODIFICATION +# +# 2008-04-12 +# +# COPYLEFT +# +# Copyright (c) 2008 Steven G. Johnson +# +# This program is free software: you can redistribute it and/or modify it +# under the terms of the GNU General Public License as published by the +# Free Software Foundation, either version 3 of the License, or (at your +# option) any later version. +# +# This program is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General +# Public License for more details. +# +# You should have received a copy of the GNU General Public License along +# with this program. If not, see . +# +# As a special exception, the respective Autoconf Macro's copyright owner +# gives unlimited permission to copy, distribute and modify the configure +# scripts that are the output of Autoconf when processing the Macro. You +# need not follow the terms of the GNU General Public License when using +# or distributing such scripts, even though portions of the text of the +# Macro appear in them. The GNU General Public License (GPL) does govern +# all other use of the material that constitutes the Autoconf Macro. +# +# This special exception to the GPL applies to versions of the Autoconf +# Macro released by the Autoconf Macro Archive. When you make and +# distribute a modified version of the Autoconf Macro, you may extend this +# special exception to the GPL to apply to your modified version as well. AC_DEFUN([ACX_PTHREAD], [ AC_REQUIRE([AC_CANONICAL_HOST]) AC_LANG_SAVE AC_LANG_C @@ -96,26 +133,27 @@ # -pthreads: Solaris/gcc # -mthreads: Mingw32/gcc, Lynx/gcc # -mt: Sun Workshop C (may only link SunOS threads [-lthread], but it # doesn't hurt to check since this sometimes defines pthreads too; # also defines -D_REENTRANT) +# ... -mt is also the pthreads flag for HP/aCC # pthread: Linux, etcetera # --thread-safe: KAI C++ # pthread-config: use pthread-config program (for GNU Pth library) case "${host_cpu}-${host_os}" in *solaris*) # On Solaris (at least, for some versions), libc contains stubbed # (non-functional) versions of the pthreads routines, so link-based - # tests will erroneously succeed. (We need to link with -pthread or + # tests will erroneously succeed. (We need to link with -pthreads/-mt/ # -lpthread.) (The stubs are missing pthread_cleanup_push, or rather # a function called by this macro, so we could check for that, but # who knows whether they'll stub that too in a future libc.) So, # we'll just look for -pthreads and -lpthread first: - acx_pthread_flags="-pthread -pthreads pthread -mt $acx_pthread_flags" + acx_pthread_flags="-pthreads pthread -mt -pthread $acx_pthread_flags" ;; esac if test x"$acx_pthread_ok" = xno; then for flag in $acx_pthread_flags; do @@ -185,11 +223,11 @@ # Detect AIX lossage: JOINABLE attribute is called UNDETACHED. AC_MSG_CHECKING([for joinable pthread attribute]) attr_name=unknown for attr in PTHREAD_CREATE_JOINABLE PTHREAD_CREATE_UNDETACHED; do - AC_TRY_LINK([#include ], [int attr=$attr;], + AC_TRY_LINK([#include ], [int attr=$attr; return attr;], [attr_name=$attr; break]) done AC_MSG_RESULT($attr_name) if test "$attr_name" != PTHREAD_CREATE_JOINABLE; then AC_DEFINE_UNQUOTED(PTHREAD_CREATE_JOINABLE, $attr_name, @@ -209,12 +247,16 @@ fi LIBS="$save_LIBS" CFLAGS="$save_CFLAGS" - # More AIX lossage: must compile with cc_r - AC_CHECK_PROG(PTHREAD_CC, cc_r, cc_r, ${CC}) + # More AIX lossage: must compile with xlc_r or cc_r + if test x"$GCC" != xyes; then + AC_CHECK_PROGS(PTHREAD_CC, xlc_r cc_r, ${CC}) + else + PTHREAD_CC=$CC + fi else PTHREAD_CC="$CC" fi AC_SUBST(PTHREAD_LIBS) ADDED config/autoconf_inc.m4 Index: config/autoconf_inc.m4 ================================================================== --- /dev/null +++ config/autoconf_inc.m4 @@ -0,0 +1,116 @@ +dnl ### begin block 00_header[./mysql++.bkl] ### +dnl +dnl This macro was generated by +dnl Bakefile 0.2.9 (http://www.bakefile.org) +dnl Do not modify, all changes will be overwritten! + +BAKEFILE_AUTOCONF_INC_M4_VERSION="0.2.9" + +dnl ### begin block 20_COND_BUILD_debug[./mysql++.bkl] ### + COND_BUILD_debug="#" + if test "x$BUILD" = "xdebug" ; then + COND_BUILD_debug="" + fi + AC_SUBST(COND_BUILD_debug) +dnl ### begin block 20_COND_BUILD_release[./mysql++.bkl] ### + COND_BUILD_release="#" + if test "x$BUILD" = "xrelease" ; then + COND_BUILD_release="" + fi + AC_SUBST(COND_BUILD_release) +dnl ### begin block 20_COND_DEPS_TRACKING_0[./mysql++.bkl] ### + COND_DEPS_TRACKING_0="#" + if test "x$DEPS_TRACKING" = "x0" ; then + COND_DEPS_TRACKING_0="" + fi + AC_SUBST(COND_DEPS_TRACKING_0) +dnl ### begin block 20_COND_DEPS_TRACKING_1[./mysql++.bkl] ### + COND_DEPS_TRACKING_1="#" + if test "x$DEPS_TRACKING" = "x1" ; then + COND_DEPS_TRACKING_1="" + fi + AC_SUBST(COND_DEPS_TRACKING_1) +dnl ### begin block 20_COND_PLATFORM_MACOSX_0_USE_SOVERCYGWIN_0_USE_SOVERSION_1[./mysql++.bkl] ### + COND_PLATFORM_MACOSX_0_USE_SOVERCYGWIN_0_USE_SOVERSION_1="#" + if test "x$PLATFORM_MACOSX" = "x0" -a "x$USE_SOVERCYGWIN" = "x0" -a "x$USE_SOVERSION" = "x1" ; then + COND_PLATFORM_MACOSX_0_USE_SOVERCYGWIN_0_USE_SOVERSION_1="" + fi + AC_SUBST(COND_PLATFORM_MACOSX_0_USE_SOVERCYGWIN_0_USE_SOVERSION_1) +dnl ### begin block 20_COND_PLATFORM_MACOSX_0_USE_SOVERSION_1[./mysql++.bkl] ### + COND_PLATFORM_MACOSX_0_USE_SOVERSION_1="#" + if test "x$PLATFORM_MACOSX" = "x0" -a "x$USE_SOVERSION" = "x1" ; then + COND_PLATFORM_MACOSX_0_USE_SOVERSION_1="" + fi + AC_SUBST(COND_PLATFORM_MACOSX_0_USE_SOVERSION_1) +dnl ### begin block 20_COND_PLATFORM_MACOSX_1[./mysql++.bkl] ### + COND_PLATFORM_MACOSX_1="#" + if test "x$PLATFORM_MACOSX" = "x1" ; then + COND_PLATFORM_MACOSX_1="" + fi + AC_SUBST(COND_PLATFORM_MACOSX_1) +dnl ### begin block 20_COND_PLATFORM_MACOSX_1_USE_SOVERSION_1[./mysql++.bkl] ### + COND_PLATFORM_MACOSX_1_USE_SOVERSION_1="#" + if test "x$PLATFORM_MACOSX" = "x1" -a "x$USE_SOVERSION" = "x1" ; then + COND_PLATFORM_MACOSX_1_USE_SOVERSION_1="" + fi + AC_SUBST(COND_PLATFORM_MACOSX_1_USE_SOVERSION_1) +dnl ### begin block 20_COND_PLATFORM_MAC_0[./mysql++.bkl] ### + COND_PLATFORM_MAC_0="#" + if test "x$PLATFORM_MAC" = "x0" ; then + COND_PLATFORM_MAC_0="" + fi + AC_SUBST(COND_PLATFORM_MAC_0) +dnl ### begin block 20_COND_PLATFORM_MAC_1[./mysql++.bkl] ### + COND_PLATFORM_MAC_1="#" + if test "x$PLATFORM_MAC" = "x1" ; then + COND_PLATFORM_MAC_1="" + fi + AC_SUBST(COND_PLATFORM_MAC_1) +dnl ### begin block 20_COND_PLATFORM_OS2_1[./mysql++.bkl] ### + COND_PLATFORM_OS2_1="#" + if test "x$PLATFORM_OS2" = "x1" ; then + COND_PLATFORM_OS2_1="" + fi + AC_SUBST(COND_PLATFORM_OS2_1) +dnl ### begin block 20_COND_USE_SOTWOSYMLINKS_1[./mysql++.bkl] ### + COND_USE_SOTWOSYMLINKS_1="#" + if test "x$USE_SOTWOSYMLINKS" = "x1" ; then + COND_USE_SOTWOSYMLINKS_1="" + fi + AC_SUBST(COND_USE_SOTWOSYMLINKS_1) +dnl ### begin block 20_COND_USE_SOVERCYGWIN_1_USE_SOVERSION_1[./mysql++.bkl] ### + COND_USE_SOVERCYGWIN_1_USE_SOVERSION_1="#" + if test "x$USE_SOVERCYGWIN" = "x1" -a "x$USE_SOVERSION" = "x1" ; then + COND_USE_SOVERCYGWIN_1_USE_SOVERSION_1="" + fi + AC_SUBST(COND_USE_SOVERCYGWIN_1_USE_SOVERSION_1) +dnl ### begin block 20_COND_USE_SOVERLINUX_1[./mysql++.bkl] ### + COND_USE_SOVERLINUX_1="#" + if test "x$USE_SOVERLINUX" = "x1" ; then + COND_USE_SOVERLINUX_1="" + fi + AC_SUBST(COND_USE_SOVERLINUX_1) +dnl ### begin block 20_COND_USE_SOVERSION_0[./mysql++.bkl] ### + COND_USE_SOVERSION_0="#" + if test "x$USE_SOVERSION" = "x0" ; then + COND_USE_SOVERSION_0="" + fi + AC_SUBST(COND_USE_SOVERSION_0) +dnl ### begin block 20_COND_USE_SOVERSION_1_USE_SOVERSOLARIS_1[./mysql++.bkl] ### + COND_USE_SOVERSION_1_USE_SOVERSOLARIS_1="#" + if test "x$USE_SOVERSION" = "x1" -a "x$USE_SOVERSOLARIS" = "x1" ; then + COND_USE_SOVERSION_1_USE_SOVERSOLARIS_1="" + fi + AC_SUBST(COND_USE_SOVERSION_1_USE_SOVERSOLARIS_1) +dnl ### begin block 20_COND_USE_SOVERSOLARIS_1[./mysql++.bkl] ### + COND_USE_SOVERSOLARIS_1="#" + if test "x$USE_SOVERSOLARIS" = "x1" ; then + COND_USE_SOVERSOLARIS_1="" + fi + AC_SUBST(COND_USE_SOVERSOLARIS_1) +dnl ### begin block 20_COND_WINDOWS_IMPLIB_1[./mysql++.bkl] ### + COND_WINDOWS_IMPLIB_1="#" + if test "x$WINDOWS_IMPLIB" = "x1" ; then + COND_WINDOWS_IMPLIB_1="" + fi + AC_SUBST(COND_WINDOWS_IMPLIB_1) ADDED config/libm.m4 Index: config/libm.m4 ================================================================== --- /dev/null +++ config/libm.m4 @@ -0,0 +1,37 @@ +dnl @synopsis LIB_MATH +dnl +dnl This macro figures out how whether programs using C's math routines +dnl need to link to libm or not. This is common on SysV Unices. +dnl +dnl @category C +dnl @author Warren Young +dnl @version 1.2, 2006-03-06 + +AC_DEFUN([LIB_MATH], +[ + AC_MSG_CHECKING([whether -lm is needed to use C math functions]) + + MYSQLPP_EXTRA_LIBS= + TRY_LIBM=no + AC_TRY_LINK( + [ #include ], + [ floor(0); ], AC_MSG_RESULT(no), TRY_LIBM=yes) + + if test "x$TRY_LIBM" = "xyes" + then + save_LIBS=$LIBS + LIBS="$LIBS -lm" + AC_TRY_LINK( + [ #include ], + [ floor(0); ], + [ + MYSQLPP_EXTRA_LIBS=-lm + AC_MSG_RESULT(yes) + ], + AC_MSG_ERROR([Failed to build program containing math functions!])) + LIBS="$save_LIBS" + fi + + AC_SUBST(MYSQLPP_EXTRA_LIBS) +]) + ADDED config/localtime_r.m4 Index: config/localtime_r.m4 ================================================================== --- /dev/null +++ config/localtime_r.m4 @@ -0,0 +1,30 @@ +dnl @synopsis AX_C_LOCALTIME_R +dnl +dnl This macro determines whether the C runtime library contains +dnl localtime_r(), a thread-safe replacement for localtime(). +dnl +dnl @version 1.0, 2007/02/20 +dnl @author Warren Young +AC_DEFUN([AX_C_LOCALTIME_R], +[ + AC_MSG_CHECKING([for localtime_r()]) + + AC_TRY_RUN([ + #include + int main(void) + { + time_t tt; + struct tm stm; + localtime_r(&tt, &stm); + return 0; + } + ], [localtime_r_found=yes], [localtime_r_found=no], [localtime_r_found=no]) + + AC_MSG_RESULT([$localtime_r_found]) + if test x"$localtime_r_found" = xyes + then + AC_DEFINE(HAVE_LOCALTIME_R, 1, + [Define if you have the localtime_r() facility]) + fi +]) dnl AX_C_LOCALTIME_R + Index: config/mysql++.m4 ================================================================== --- config/mysql++.m4 +++ config/mysql++.m4 @@ -1,10 +1,10 @@ #-###################################################################### # mysql++.m4 - Example autoconf macro showing how to find MySQL++ # library and header files. # -# Copyright (c) 2004-2005 by Educational Technology Resources, Inc. +# Copyright (c) 2004-2009 by Educational Technology Resources, Inc. # # This file is free software; you can redistribute it and/or modify it # under the terms of the GNU Lesser General Public License as published # by the Free Software Foundation; either version 2.1 of the License, or # (at your option) any later version. @@ -35,97 +35,97 @@ dnl dnl This macro depends on having the default compiler and linker flags dnl set up for building programs against the MySQL C API. The mysql.m4 dnl macro in this directory fits this bill; run it first. dnl -dnl @version 1.0, 2005/07/13 +dnl @version 1.3, 2009/11/22 dnl @author Warren Young AC_DEFUN([MYSQLPP_DEVEL], [ -AC_CACHE_CHECK([for MySQL++ devel stuff], ac_cv_mysqlpp_devel, -[ - # - # Set up configure script macros - # + dnl + dnl Set up configure script macros + dnl AC_ARG_WITH(mysqlpp, [ --with-mysqlpp= path containing MySQL++ header and library subdirs], - [MYSQLPP_lib_check="$with_mysqlpp/lib $with_mysqlpp/lib/mysql++" + [MYSQLPP_lib_check="$with_mysqlpp/lib64 $with_mysqlpp/lib $with_mysqlpp/lib64/mysql++ $with_mysqlpp/lib/mysql++" MYSQLPP_inc_check="$with_mysqlpp/include $with_mysqlpp/include/mysql++"], - [MYSQLPP_lib_check="/usr/local/mysql++/lib /usr/local/lib/mysql++ /opt/mysql++/lib /usr/lib/mysql++ /usr/local/lib /usr/lib" + [MYSQLPP_lib_check="/usr/local/mysql++/lib64 /usr/local/mysql++/lib /usr/local/lib64/mysql++ /usr/local/lib/mysql++ /opt/mysql++/lib64 /opt/mysql++/lib /usr/lib64/mysql++ /usr/lib/mysql++ /usr/local/lib64 /usr/local/lib /usr/lib64 /usr/lib" MYSQLPP_inc_check="/usr/local/mysql++/include /usr/local/include/mysql++ /opt/mysql++/include /usr/local/include/mysql++ /usr/local/include /usr/include/mysql++ /usr/include"]) AC_ARG_WITH(mysqlpp-lib, [ --with-mysqlpp-lib= directory path of MySQL++ library], - [MYSQLPP_lib_check="$with_mysqlpp_lib $with_mysqlpp_lib/lib $with_mysqlpp_lib/lib/mysql"]) + [MYSQLPP_lib_check="$with_mysqlpp_lib $with_mysqlpp_lib/lib64 $with_mysqlpp_lib/lib $with_mysqlpp_lib/lib64/mysql $with_mysqlpp_lib/lib/mysql"]) AC_ARG_WITH(mysqlpp-include, [ --with-mysqlpp-include= directory path of MySQL++ headers], [MYSQLPP_inc_check="$with_mysqlpp_include $with_mysqlpp_include/include $with_mysqlpp_include/include/mysql"]) - # - # Look for MySQL++ library - # - MYSQLPP_libdir= - for dir in $MYSQLPP_lib_check - do - if test -d "$dir" && \ - ( test -f "$dir/libmysqlpp.so" || - test -f "$dir/libmysqlpp.a" ) - then - MYSQLPP_libdir=$dir - break - fi - done - - if test -z "$MYSQLPP_libdir" - then - AC_MSG_ERROR([Didn't find the MySQL++ library dir in '$MYSQLPP_lib_check']) - fi - - case "$MYSQLPP_libdir" in - /* ) ;; - * ) AC_MSG_ERROR([The MySQL++ library directory ($MYSQLPP_libdir) must be an absolute path.]) ;; - esac - - AC_MSG_RESULT([lib in $MYSQLPP_libdir]) - - case "$MYSQLPP_libdir" in - /usr/lib) ;; - *) LDFLAGS="$LDFLAGS -L${MYSQLPP_libdir}" ;; - esac - - - # - # Look for MySQL++ headers - # - AC_MSG_CHECKING([for MySQL++ header directory]) - MYSQLPP_incdir= - for dir in $MYSQLPP_inc_check - do - if test -d "$dir" && test -f "$dir/mysql++.h" - then - MYSQLPP_incdir=$dir - break - fi - done - - if test -z "$MYSQLPP_incdir" - then - AC_MSG_ERROR([Didn't find the MySQL++ header dir in '$MYSQLPP_inc_check']) - fi - - case "$MYSQLPP_incdir" in - /* ) ;; - * ) AC_MSG_ERROR([The MySQL++ header directory ($MYSQLPP_incdir) must be an absolute path.]) ;; - esac - - AC_MSG_RESULT([$MYSQLPP_incdir]) - - CPPFLAGS="$CPPFLAGS -I${MYSQLPP_incdir}" - + dnl + dnl Look for MySQL++ library + dnl + AC_CACHE_CHECK([for MySQL++ library location], [ac_cv_mysqlpp_lib], + [ + for dir in $MYSQLPP_lib_check + do + if test -d "$dir" && \ + ( test -f "$dir/libmysqlpp.so" || + test -f "$dir/libmysqlpp.a" ) + then + ac_cv_mysqlpp_lib=$dir + break + fi + done + + if test -z "$ac_cv_mysqlpp_lib" + then + AC_MSG_ERROR([Didn't find the MySQL++ library dir in '$MYSQLPP_lib_check']) + fi + + case "$ac_cv_mysqlpp_lib" in + /* ) ;; + * ) AC_MSG_ERROR([The MySQL++ library directory ($ac_cv_mysqlpp_lib) must be an absolute path.]) ;; + esac + ]) + AC_SUBST([MYSQLPP_LIB_DIR],[$ac_cv_mysqlpp_lib]) + + dnl + dnl Look for MySQL++ header file directory + dnl + AC_CACHE_CHECK([for MySQL++ include path], [ac_cv_mysqlpp_inc], + [ + for dir in $MYSQLPP_inc_check + do + if test -d "$dir" && test -f "$dir/mysql++.h" + then + ac_cv_mysqlpp_inc=$dir + break + fi + done + + if test -z "$ac_cv_mysqlpp_inc" + then + AC_MSG_ERROR([Didn't find the MySQL++ header dir in '$MYSQLPP_inc_check']) + fi + + case "$ac_cv_mysqlpp_inc" in + /* ) ;; + * ) AC_MSG_ERROR([The MySQL++ header directory ($ac_cv_mysqlpp_inc) must be an absolute path.]) ;; + esac + ]) + AC_SUBST([MYSQLPP_INC_DIR],[$ac_cv_mysqlpp_inc]) + + dnl + dnl Now check that the above checks resulted in -I and -L flags that + dnl let us build actual programs against MySQL++. + dnl + case "$ac_cv_mysqlpp_lib" in + /usr/lib) ;; + *) LDFLAGS="$LDFLAGS -L${ac_cv_mysqlpp_lib}" ;; + esac + CPPFLAGS="$CPPFLAGS -I${ac_cv_mysqlpp_inc} -I${MYSQL_C_INC_DIR}" AC_MSG_CHECKING([that we can build MySQL++ programs]) AC_COMPILE_IFELSE( [AC_LANG_PROGRAM([#include ], - [std::string s; mysqlpp::escape_string(s)])], - ac_cv_mysqlpp_devel=yes, - AC_MSG_ERROR(no)) -])]) dnl End MYSQLPP_DEVEL + [mysqlpp::Connection c(false)])], + AC_MSG_RESULT([yes]), + AC_MSG_ERROR([no])) +]) dnl End MYSQLPP_DEVEL Index: config/mysql_loc.m4 ================================================================== --- config/mysql_loc.m4 +++ config/mysql_loc.m4 @@ -1,109 +1,131 @@ -dnl @synopsis MYSQL_API_LOCATION +dnl @synopsis MYSQL_C_API_LOCATION dnl dnl This macro tries to find MySQL C API header and library locations. dnl dnl We define the following configure script flags: dnl dnl --with-mysql: Give prefix for both library and headers, and try -dnl to guess subdirectory names for each. (e.g. Tack /lib and -dnl /include onto given dir name, and other common schemes.) -dnl --with-mysql-lib: Similar to --with-mysql, but for library only. -dnl --with-mysql-include: Similar to --with-mysql, but for headers -dnl only. +dnl to guess subdirectory names for each by tacking common +dnl suffixes on like /lib and /include. +dnl --with-mysql-lib: Same as --with-mysql, but for library only. +dnl --with-mysql-include: Same as --with-mysql, but for headers only. dnl -dnl @version 1.1, 2005/02/28 +dnl @version 1.5, 2016/12/31 dnl @author Warren Young -AC_DEFUN([MYSQL_API_LOCATION], +AC_DEFUN([MYSQL_C_API_LOCATION], [ # # Set up configure script macros # AC_ARG_WITH(mysql, [ --with-mysql= root directory path of MySQL installation], [MYSQL_lib_check="$with_mysql/lib/mysql $with_mysql/lib" MYSQL_inc_check="$with_mysql/include $with_mysql/include/mysql"], - [MYSQL_lib_check="/usr/local/mysql/lib/mysql /usr/local/lib/mysql /opt/mysql/lib/mysql /usr/lib/mysql /usr/local/mysql/lib /usr/local/lib /opt/mysql/lib /usr/lib" - MYSQL_inc_check="/usr/local/mysql/include/mysql /usr/local/include/mysql /opt/mysql/include/mysql /usr/include/mysql"]) + [MYSQL_lib_check="/usr/lib64 /usr/lib /usr/lib64/mysql /usr/lib/mysql /usr/local/lib64 /usr/local/lib /usr/local/lib/mysql /usr/local/mysql/lib /usr/local/mysql/lib/mysql /usr/mysql/lib/mysql /opt/mysql/lib /opt/mysql/lib/mysql /sw/lib /sw/lib/mysql" + MYSQL_inc_check="/usr/include/mysql /usr/local/include/mysql /usr/local/mysql/include /usr/local/mysql/include/mysql /usr/mysql/include/mysql /opt/mysql/include/mysql /sw/include/mysql"]) AC_ARG_WITH(mysql-lib, [ --with-mysql-lib= directory path of MySQL library installation], - [MYSQL_lib_check="$with_mysql_lib $with_mysql_lib/lib $with_mysql_lib/lib/mysql"]) + [MYSQL_lib_check="$with_mysql_lib $with_mysql_lib/lib64 $with_mysql_lib/lib $with_mysql_lib/lib64/mysql $with_mysql_lib/lib/mysql"]) AC_ARG_WITH(mysql-include, [ --with-mysql-include= directory path of MySQL header installation], [MYSQL_inc_check="$with_mysql_include $with_mysql_include/include $with_mysql_include/include/mysql"]) + # # Decide which C API library to use, based on thread support # if test "x$acx_pthread_ok" = xyes then - MYSQL_C_LIB=mysqlclient_r + MYSQL_C_LIB_NAME=mysqlclient_r else - MYSQL_C_LIB=mysqlclient - fi - - # - # Look for MySQL C API library - # - AC_MSG_CHECKING([for MySQL library directory]) - MYSQL_libdir= - for m in $MYSQL_lib_check - do - if test -d "$m" && \ - (test -f "$m/lib$MYSQL_C_LIB.so" || test -f "$m/lib$MYSQL_C_LIB.a") - then - MYSQL_libdir=$m - break - fi - done - - if test -z "$MYSQL_libdir" - then - AC_MSG_ERROR([Didn't find $MYSQL_C_LIB library in '$MYSQL_lib_check']) - fi - - case "$MYSQL_libdir" in - /* ) ;; - * ) AC_MSG_ERROR([The MySQL library directory ($MYSQL_libdir) must be an absolute path.]) ;; - esac - - AC_MSG_RESULT([$MYSQL_libdir]) - - case "$MYSQL_libdir" in - /usr/lib) ;; - *) LDFLAGS="$LDFLAGS -L${MYSQL_libdir}" ;; - esac + MYSQL_C_LIB_NAME=mysqlclient + fi # # Look for MySQL C API headers # AC_MSG_CHECKING([for MySQL include directory]) - MYSQL_incdir= + MYSQL_C_INC_DIR= for m in $MYSQL_inc_check do if test -d "$m" && test -f "$m/mysql.h" then - MYSQL_incdir=$m + MYSQL_C_INC_DIR=$m break fi done - if test -z "$MYSQL_incdir" + if test -z "$MYSQL_C_INC_DIR" then AC_MSG_ERROR([Didn't find the MySQL include dir in '$MYSQL_inc_check']) fi - case "$MYSQL_incdir" in + case "$MYSQL_C_INC_DIR" in + /* ) ;; + * ) AC_MSG_ERROR([The MySQL include directory ($MYSQL_C_INC_DIR) must be an absolute path.]) ;; + esac + + AC_MSG_RESULT([$MYSQL_C_INC_DIR]) + + + # + # Look for MySQL C API library + # + AC_MSG_CHECKING([for MySQL C API library directory]) + save_CPPFLAGS=$CPPFLAGS + save_LIBS=$LIBS + save_LDFLAGS=$LDFLAGS + CPPFLAGS="$CPPFLAGS -I$MYSQL_C_INC_DIR" + MYSQL_C_LIB_DIR= + for m in $MYSQL_lib_check + do + LDFLAGS="$save_LDFLAGS -L$m" + LIBS="$save_LIBS -l$MYSQL_C_LIB_NAME" + AC_TRY_LINK( + [ #include ], + [ mysql_store_result(0); ], + [ AC_MSG_RESULT([$m]) + MYSQL_C_LIB_DIR=$m + break + ], + [ LIBS="$save_LIBS -l$MYSQL_C_LIB_NAME -lz" + AC_TRY_LINK( + [ #include ], + [ mysql_store_result(0); ], + [ AC_MSG_RESULT([$m]) + MYSQLPP_EXTRA_LIBS="$MYSQLPP_EXTRA_LIBS -lz" + MYSQL_C_LIB_DIR=$m + break + ], + [ ] + ) + ]) + done + CPPFLAGS=$save_CPPFLAGS + LIBS=$save_LIBS + LDFLAGS=$save_LDFLAGS + + if test -z "$MYSQL_C_LIB_DIR" + then + AC_MSG_RESULT([no joy]) + AC_MSG_ERROR([Didn't find $MYSQL_C_LIB_NAME library in '$MYSQL_lib_check']) + fi + + case "$MYSQL_C_LIB_DIR" in /* ) ;; - * ) AC_MSG_ERROR([The MySQL include directory ($MYSQL_incdir) must be an absolute path.]) ;; + * ) AC_MSG_ERROR([The MySQL library directory ($MYSQL_C_LIB_DIR) must be an absolute path.]) ;; esac - AC_MSG_RESULT([$MYSQL_incdir]) - - CPPFLAGS="$CPPFLAGS -I${MYSQL_incdir}" - - AC_CHECK_LIB($MYSQL_C_LIB, mysql_store_result, [], [ - AC_MSG_ERROR([Could not find working MySQL client library!]) ]) - AC_SUBST(MYSQL_C_LIB) -]) dnl MYSQL_API_LOCATION + if [ "$MYSQL_C_LIB_DIR" = "/usr/lib" -o \ + "$MYSQL_C_LIB_DIR" = "/usr/lib64" ] + then + # Remove redundant lib paths + MYSQL_C_LIB_DIR= + fi + + AC_SUBST(MYSQL_C_INC_DIR) + AC_SUBST(MYSQL_C_LIB_DIR) + AC_SUBST(MYSQL_C_LIB_NAME) +]) dnl MYSQL_C_API_LOCATION DELETED config/mysql_shutdown.m4 Index: config/mysql_shutdown.m4 ================================================================== --- config/mysql_shutdown.m4 +++ /dev/null @@ -1,26 +0,0 @@ -dnl @synopsis MYSQL_SHUTDOWN_ARG -dnl -dnl This macro determines whether mysql_shutdown() API call takes -dnl extra 'level' argument. This was added in MySQL 4.1.3 and 5.0.1. -dnl -dnl @version 1.1, 2005/02/28 -dnl @author Warren Young -AC_DEFUN([MYSQL_SHUTDOWN_ARG], -[ - AC_CACHE_CHECK([for level argument to mysql_shutdown()], ac_cv_mysql_shutdown_arg, - [ - AC_TRY_LINK( - [ #include ], - [ mysql_shutdown(0, 0); ], - ac_cv_mysql_shutdown_arg=yes, - ac_cv_mysql_shutdown_arg=no) - ]) - - if test x"$ac_cv_mysql_shutdown_arg" = "xyes" - then - AC_DEFINE(HAVE_MYSQL_SHUTDOWN_LEVEL_ARG, 1, - [ Define if mysql_shutdown() has a second 'level' argument ]) - fi -]) dnl MYSQL_SHUTDOWN_ARG - - ADDED config/mysql_ssl.m4 Index: config/mysql_ssl.m4 ================================================================== --- /dev/null +++ config/mysql_ssl.m4 @@ -0,0 +1,17 @@ +dnl @synopsis MYSQL_WITH_SSL +dnl +dnl This macro determines whether mysql_ssl_set() API call exists. +dnl Requires at least MySQL 4.0.1. +dnl +dnl @version $Id$, $Date$ +dnl @author Ovidiu Bivolaru +AC_DEFUN([MYSQL_WITH_SSL], +[ + # + # Check for mysql_ssl_set() in libmysqlclient(_r) + # + AC_CHECK_LIB($MYSQL_C_LIB_NAME, mysql_ssl_set, [ + AC_DEFINE(HAVE_MYSQL_SSL_SET,, Define if your MySQL library has SSL functions) + ]) dnl AC_CHECK_LIB(mysqlclient, mysql_ssl_set) +]) dnl MYSQL_WITH_SSL + ADDED config/socket_nsl.m4 Index: config/socket_nsl.m4 ================================================================== --- /dev/null +++ config/socket_nsl.m4 @@ -0,0 +1,72 @@ +dnl @synopsis LIB_SOCKET_NSL +dnl +dnl This macro figures out what libraries are required on this platform +dnl to link sockets programs. +dnl +dnl The common cases are not to need any extra libraries, or to need +dnl -lsocket and -lnsl. We need to avoid linking with libnsl unless +dnl we need it, though, since on some OSes where it isn't necessary it +dnl will totally break networking. Unisys also includes gethostbyname() +dnl in libsocket but needs libnsl for socket(). +dnl +dnl @category Misc +dnl @author Warren Young +dnl @version 1.5, 2006-03-06 + +AC_DEFUN([LIB_SOCKET_NSL], +[ + save_LIBS="$LIBS" + + AC_MSG_CHECKING([whether -lsocket is needed]) + TRY_LSOCKET=no + AC_TRY_LINK( + [ + #include + #include + #include + #include + ], + [ socket(AF_INET, SOCK_STREAM, 0); ], + AC_MSG_RESULT(no), TRY_LSOCKET=yes) + + if test "x$TRY_LSOCKET" = "xyes" + then + LIBS="-lsocket $LIBS" + AC_TRY_LINK( + [ + #include + #include + #include + #include + ], + [ socket(AF_INET, SOCK_STREAM, 0); ], + [ + MYSQLPP_EXTRA_LIBS="-lsocket $MYSQLPP_EXTRA_LIBS" + AC_MSG_RESULT(yes) + ], + AC_MSG_ERROR([failed to link using -lsocket!])) + fi + + AC_MSG_CHECKING([whether -lnsl is needed]) + TRY_LNSL=no + AC_TRY_LINK( + [ #include ], + [ gethostbyname("gna.org"); ], + AC_MSG_RESULT(no), TRY_LNSL=yes) + + if test "x$TRY_LNSL" = "xyes" + then + LIBS="-lnsl $LIBS" + AC_TRY_LINK( + [ #include ], + [ gethostbyname("gna.org"); ], + [ + MYSQLPP_EXTRA_LIBS="-lnsl $MYSQLPP_EXTRA_LIBS" + AC_MSG_RESULT(yes) + ], + AC_MSG_ERROR([failed to link using -lnsl!])) + fi + + AC_SUBST(MYSQLPP_EXTRA_LIBS) +]) + ADDED configure.ac Index: configure.ac ================================================================== --- /dev/null +++ configure.ac @@ -0,0 +1,123 @@ +# This file is free software; you can redistribute it and/or modify it +# under the terms of the GNU Lesser General Public License as published +# by the Free Software Foundation; either version 2.1 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with MySQL++; if not, write to the Free Software +# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 +# USA + +# Standard autotools stuff +AC_INIT(mysql++, 3.2.3, plusplus@lists.mysql.com, mysql++) +AC_CONFIG_HEADER(config.h) +AC_CONFIG_MACRO_DIR([config]) +AC_CANONICAL_SYSTEM + + +# Enable libtool to decide shared library compile flags (ie -fPIC) +AC_PROG_LIBTOOL +AC_SUBST([LIBTOOL_DEPS]) + + +# Break package version up into major, minor and bugfix components. +MYSQLPP_VERSION_MAJOR=`echo $PACKAGE_VERSION | cut -f1 -d.` +AC_SUBST(MYSQLPP_VERSION_MAJOR) +MYSQLPP_VERSION_MINOR=`echo $PACKAGE_VERSION | cut -f2 -d.` +AC_SUBST(MYSQLPP_VERSION_MINOR) +MYSQLPP_VERSION_BUGFIX=`echo $PACKAGE_VERSION | cut -f3 -d.` +AC_SUBST(MYSQLPP_VERSION_BUGFIX) + + +# Check for Standard C support +AC_PROG_CC +AC_HEADER_STDC + + +# Figure out whether/how to handle threading support, if available. +AC_ARG_ENABLE(thread-check, + [ --enable-thread-check Check for threads, and use if available. ], + [ thread_check=yes ]) +if test "x$thread_check" = "xyes" +then + ACX_PTHREAD + LIBS="$PTHREAD_LIBS $LIBS" + CFLAGS="$CFLAGS $PTHREAD_CFLAGS" + CC="$PTHREAD_CC" + AC_CHECK_HEADERS(synch.h) + AC_CHECK_HEADERS(unistd.h) +fi + + +# Let caller provide -f to lib/*.pl scripts in a uniform way +AC_ARG_WITH([field-limit], + AS_HELP_STRING([--with-field-limit=], + [set max template query and SSQLS field count]), + [], []) +if test -n "$with_field_limit" +then + ( cd lib ; + ./querydef.pl -f $with_field_limit ; + ./ssqls.pl -f $with_field_limit + ) +fi + + +# Try to find local getopt(); if we fail, we'll use the one in lib/cmdline.* +AC_CHECK_FUNC(getopt, + [AC_DEFINE(HAVE_POSIX_GETOPT, [], Define if getopt() is available in unistd.h)], + [AC_CHECK_LIB(iberty, getopt, + [AC_DEFINE(HAVE_LIBIBERTY_GETOPT, [], Define if getopt() is available in libiberty.h)], + [])]) + + +# Checks for libraries and local system features +LIB_MATH +LIB_SOCKET_NSL +MYSQL_C_API_LOCATION +MYSQL_WITH_SSL +AX_C_LOCALTIME_R +AC_CHECK_LIB(intl, main) + + +# If this is Cygwin, add a linker flag to suppress a silly link message. +case "${host}" in + *cygwin*) + LDFLAGS="$LDFLAGS -Wl,--enable-auto-import" + ;; +esac + + +# Check for Standard C++ support, and extensions. This must be near +# the end, because the CPLUSPLUS directive makes autoconf use C++ +# compiler for all subsequent tests! +AC_PROG_CXX +AC_LANG_CPLUSPLUS +STL_SLIST_EXTENSION + + +# Include Bakefile macros +AC_BAKEFILE([m4_include(config/autoconf_inc.m4)]) + + +# +# Configure process complete; write out files generated from *.in. +# +AC_OUTPUT([\ + doc/userman/userman.dbx \ + install.hta \ + lib/Doxyfile \ + lib/mysql++.h \ + ssx/Doxyfile \ + abi.xml \ + mysql++.spec \ + Makefile \ + version +]) +chmod +x version + DELETED configure.in Index: configure.in ================================================================== --- configure.in +++ /dev/null @@ -1,109 +0,0 @@ -# This file is free software; you can redistribute it and/or modify it -# under the terms of the GNU Lesser General Public License as published -# by the Free Software Foundation; either version 2.1 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, but -# WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -# Lesser General Public License for more details. -# -# You should have received a copy of the GNU Lesser General Public -# License along with MySQL++; if not, write to the Free Software -# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 -# USA - - -dnl Don't forget to change libtool version below. -AC_INIT(mysql++, 2.0.1, plusplus@lists.mysql.com, mysql++) - -# Libtool version scheme is: interface:change:age. Interface number -# goes up any time the library interface changes. Change number goes up -# any time library changes without affecting interface. Age goes up any -# time interface changes without breaking backwards compatibility, such -# as by adding new functions; must always be less than interface number. -AC_SUBST(MYSQLPP_LIBTOOL_VERSION, [2:0:1]) - -dnl Break package version up into major, minor and bugfix components. -dnl Avoid temptation to use these to define MYSQLPP_LIBTOOL_VERSION: -dnl only in the x.0.0 case do these two schemes take the same values! -MYSQLPP_VERSION_MAJOR=`echo $PACKAGE_VERSION | cut -f1 -d.` -AC_SUBST(MYSQLPP_VERSION_MAJOR) -MYSQLPP_VERSION_MINOR=`echo $PACKAGE_VERSION | cut -f2 -d.` -AC_SUBST(MYSQLPP_VERSION_MINOR) -MYSQLPP_VERSION_BUGFIX=`echo $PACKAGE_VERSION | cut -f3 -d.` -AC_SUBST(MYSQLPP_VERSION_BUGFIX) - -dnl Standard autotools stuff -AM_INIT_AUTOMAKE -AM_CONFIG_HEADER(config.h) -AC_PROG_MAKE_SET -AC_DISABLE_STATIC -AC_PROG_LIBTOOL -AM_MAINTAINER_MODE - - -dnl Checks for build system tools -AC_PROG_CC -AC_PROG_CXX - - -dnl Checks for Standard C support -AC_HEADER_STDC -AC_C_CONST -AC_CHECK_FUNCS(strtol) - - -dnl Figure out whether/how to handle threading support, if available. -AC_ARG_ENABLE(thread-check, - [ --enable-thread-check Check for threads, and use if available. ], - [ thread_check=yes ]) -if test "x$thread_check" = "xyes" -then - ACX_PTHREAD - LIBS="$PTHREAD_LIBS $LIBS" - CFLAGS="$CFLAGS $PTHREAD_CFLAGS" - CC="$PTHREAD_CC" -fi - - -dnl Checks for libraries and local system features -AC_CHECK_HEADERS(zlib.h, AC_CHECK_LIB(z, gzread, [], - [ AC_MSG_ERROR([zlib is required]) ])) -MYSQL_API_LOCATION -MYSQL_SHUTDOWN_ARG -AC_CHECK_LIB(intl, main) -AC_CHECK_LIB(socket, main) -AC_CHECK_LIB(nsl, main) -AM_WITH_DMALLOC() - - -dnl Check for Standard C++ support, and extensions. This must be near -dnl the end, because the CPLUSPLUS directive makes autoconf use C++ -dnl compiler for all subsequent tests! -AC_LANG_CPLUSPLUS -STL_SLIST_EXTENSION - - -dnl Decide if examples are to be built or not. -AC_ARG_ENABLE(examples, - [ --enable-examples Build the examples (built by default) ], - [ build_examples=$enableval ], - [ build_examples=yes ]) -if test "x$build_examples" = xyes -then - OPTIONAL_EXAMPLES=examples - echo will build examples -else - OPTIONAL_EXAMPLES= - echo will NOT build examples -fi -AC_SUBST([OPTIONAL_EXAMPLES]) - - -# -# Done with checks! -# -AC_OUTPUT([Makefile mysql++.spec lib/mysql++.h lib/Makefile lib/Doxyfile examples/Makefile]) - -./makemake.sh simple gcc ADDED doc/README-devel-RPM.txt Index: doc/README-devel-RPM.txt ================================================================== --- /dev/null +++ doc/README-devel-RPM.txt @@ -0,0 +1,10 @@ +mysql++-devel RPM installs the files you need when building your own +MySQL++ based programs, as well as documentation and examples that +can help you learn how to use the library. + +The MySQL++ header files are in /usr/include/mysql++, the library +is in /usr/lib, and the example programs' source code is in +/usr/share/doc/mysql++-devel-*/examples. For more information on +the examples, see the README-examples.txt file in the directory +containing the examples. + ADDED doc/README-manuals-RPM.txt Index: doc/README-manuals-RPM.txt ================================================================== --- /dev/null +++ doc/README-manuals-RPM.txt @@ -0,0 +1,5 @@ +For more information about MySQL++, see its home page: + + http://tangentsoft.net/mysql++/ + +See the LICENSE file in this directory for the library's license. DELETED doc/README.devel Index: doc/README.devel ================================================================== --- doc/README.devel +++ /dev/null @@ -1,11 +0,0 @@ -This file comes with the mysql++-devel RPM. This RPM installs the -files you need when building your own MySQL++ based programs, as well as -documentation and examples that can help you learn how to use the library. -The documentation is pretty badly out of date at the moment. See the -example programs for the "official" word on how to use this library. - -This RPM installs the MySQL++ header files in /usr/include/mysql++, -the MySQL++ library in /usr/lib, and a set of example programs in -/usr/src/mysql++/examples. For more information on the examples, see -the README.examples file in this directory. - DELETED doc/README.mysql++ Index: doc/README.mysql++ ================================================================== --- doc/README.mysql++ +++ /dev/null @@ -1,5 +0,0 @@ -For more information about MySQL++, see its home page: - - http://tangentsoft.net/mysql++/ - -See the LICENSE file in this directory for the library's license. Index: doc/ssqls-pretty ================================================================== --- doc/ssqls-pretty +++ doc/ssqls-pretty @@ -3,23 +3,28 @@ use IPC::Open2; if ($ARGV[0] =~ /^--command\=(.+)/) { $command = $1; } else { - $command = "g++ -E"; + $command = "g++ -E -I /usr/include/mysql"; +} + +if (-e 'lib/mysql++.h') { + $command .= " -I lib"; } - -$command .= " -I /usr/include/mysql++/"; +else { + $command .= " -I /usr/include/mysql++/"; +} $/ = undef; $orgcode = ; ($macro) = $orgcode =~ /(sql_create_.+? *\(.+?\))/s; $out = << "---"; -#include +#include $macro --- Index: doc/userman/Makefile ================================================================== --- doc/userman/Makefile +++ doc/userman/Makefile @@ -1,36 +1,31 @@ -## ------------------------ -## Things you may need to diddle for your local system -## ------------------------ - -FOPDIR=/usr/local/fop - - ## ------------------------ ## Input files ## ------------------------ +HTML_DIR=../html/userman BASENAME=userman -DOCFILE=$(BASENAME).xml -PDFFILE=$(BASENAME).pdf +DOCFILE=$(BASENAME).dbx +PDFFILE=../pdf/$(BASENAME).pdf FOFILE=$(BASENAME).fo COMMON_SS=common.xsl FO_SS=fo.xsl HTML_SS=html.xsl -EX_TXT=cgi_image.txt custom1.txt custom2.txt custom3.txt custom4.txt \ - custom5.txt custom6.txt fieldinf1.txt load_file.txt \ - resetdb.txt simple1.txt simple2.txt simple3.txt updel.txt \ - util.txt +EX_TXT=cgi_jpeg.txt cpool.txt deadlock.txt fieldinf.txt for_each.txt \ + load_jpeg.txt multiquery.txt resetdb.txt simple1.txt \ + simple2.txt simple3.txt ssqls1.txt ssqls2.txt ssqls3.txt \ + ssqls4.txt ssqls5.txt ssqls6.txt stock.txt store_if.txt \ + tquery1.txt transaction.txt ## ------------------------ ## Major output rules ## ------------------------ -html: html/index.html +html: $(EX_TXT) $(HTML_DIR)/index.html -pdf: $(PDFFILE) +pdf: $(EX_TXT) $(PDFFILE) ## ------------------------ ## Standard Makefile targets ## ------------------------ @@ -41,29 +36,31 @@ # default. You can explicitly say "make pdf" or "make all" when you're # sure the DocBook file's contents are correct. all: html pdf clean: - rm -f tags *.fo html/*.html *.log *.out *.pdf *.txt + @rm -f tags *.fo $(HTML_DIR)/*.html *.log *.out *.pdf $(EX_TXT) $(PDFFILE) ## ------------------------ ## How to make output files ## ------------------------ -$(PDFFILE): $(DOCFILE) $(FO_SS) $(COMMON_SS) - xsltproc --xinclude $(FO_SS) $(DOCFILE) > $(FOFILE) - $(FOPDIR)/fop.sh -q -fo $(FOFILE) $(PDFFILE) - cp $(PDFFILE) ../mysqlpp-$(PDFFILE) - -html/index.html: $(DOCFILE) $(EX_TXT) $(HTML_SS) $(COMMON_SS) - @mkdir -p html - @xmllint --xinclude --postvalid --noent --noout $(DOCFILE) - xsltproc --xinclude -o html/ $(HTML_SS) $(DOCFILE) +$(PDFFILE): *.dbx *.in $(FO_SS) $(COMMON_SS) + xsltproc --xinclude $(FO_SS) $(DOCFILE) > $(FOFILE) + mkdir -p ../pdf + ./fo2pdf $(FOFILE) $(PDFFILE) + +$(HTML_DIR)/index.html: *.dbx *.in *.mod *.txt *.xsl + @xmllint --xinclude --nonet --postvalid --noent --noout $(DOCFILE) + xsltproc --xinclude --nonet -o $(HTML_DIR)/ $(HTML_SS) $(DOCFILE) ## ------------------------ ## Dependency rules ## ------------------------ $(EX_TXT): @./mktxt $@ + +userman.dbx: userman.dbx.in + ( cd ../.. ; ./config.status ) ADDED doc/userman/Makefile.hello.mingw Index: doc/userman/Makefile.hello.mingw ================================================================== --- /dev/null +++ doc/userman/Makefile.hello.mingw @@ -0,0 +1,11 @@ +SHELL := $(COMSPEC) +MYSQL_DIR := "c:/Program Files/MySQL/MySQL Connector C 6.1" +CXXFLAGS := -I$(MYSQL_DIR)/include -Ic:/MySQL++/include +LDFLAGS := -L$(MYSQL_DIR)/lib -Lc:/MySQL++/lib/MinGW +LDLIBS := -lmysql -lmysqlpp +EXECUTABLE := hello + +all: $(EXECUTABLE) + +clean: + del $(EXECUTABLE) ADDED doc/userman/Makefile.hello.posix Index: doc/userman/Makefile.hello.posix ================================================================== --- /dev/null +++ doc/userman/Makefile.hello.posix @@ -0,0 +1,9 @@ +CXXFLAGS := -I/usr/include/mysql -I/usr/local/include/mysql++ +LDFLAGS := -L/usr/local/lib +LDLIBS := -lmysqlpp -lmysqlclient +EXECUTABLE := hello + +all: $(EXECUTABLE) + +clean: + rm -f $(EXECUTABLE) *.o DELETED doc/userman/README Index: doc/userman/README ================================================================== --- doc/userman/README +++ /dev/null @@ -1,128 +0,0 @@ -The user manual is written in XML DocBook format, version 4.2. -It uses the official DocBook XSL stylesheets, and will build with -versions as old as 1.58.1. (Why these versions? They're what comes -with Red Hat Linux 9, the oldest system I still use.) We restrict -ourselves to Simplified DocBook 1.1 as much as practical, to make it -easier for new people to get started hacking on the manual. - -To make the HTML version of the user manual, just type 'make' in this -directory. (Or 'make html' if you want to be pedantic.) To make the -PDF version of the manual, say 'make pdf'. To make both versions, -say 'make all'. - - - -The most likely cause of build failures is not having the right -processing programs installed. The DocBook processing model looks -like this: - - DocBook --[XSLT proc.]-+-> HTML - ^ | - | +-> XSL-FO --[XSL-FO proc.]--> PDF - | - {XSL stylesheets} - -"DocBook" above is a file in DocBook XML format. In this case, -it's in userman.xml. - -There are many alternatives for the tools in the square brackets: - - The first replaceable piece is an XSLT processor, which - translates XML into other text formats, such as HTML or other - varieties of XML. We use xsltproc from the Gnome project. - (http://xmlsoft.org/XSLT/) There are numerous alternatives, - but each supports different extensions to the standard, - so it's simplest if everyone uses the same processor for a - given document. - - We use the XSLT processor to do two transforms. One is - directly to HTML. The other is to XSL-FO, an XML-based page - layout language. We do this intermediary transform because - XSLT is not good at creating binary formats like PDF. - - The second replaceable piece in the diagram above is an - XSL-FO processor, which converts XSL-FO to a more directly - useful page layout format, like PDF. We've chosen FOP from - the Apache Project (http://xml.apache.org/fop/), because it's - the best of the free-as-in-freedom XSL-FO processors. - - FOP isn't without its faults. If you'd like to try some of - the commercial XSL-FO processors, RenderX's XEP (renderx.com) - is avalable in a free-as-in-beer version that adds watermarks - to your pages. Another popular option is Antenna House's XSL - Formatter (antennahouse.com), but there is no free offering. - The low-end commercial version of each of these is around $300. - Another relatively inexpensive option is Lunasil's Xinc - (lunasil.com), which is available in a personal-use edition - for under $100. - -The third replaceable piece above is the DocBook XSL stylesheet set. -The stylesheets are the XSLT processor's rules, controlling how -the input XML gets transformed to the output format. The standard -DocBook stylesheet set (link below) includes stylesheets for HTML -and XSL-FO output. If you don't have them on your system, the XSLT -processor will try to download them using your Internet connection -during processing. This slows processing quite a bit even if you -have a fast Internet connection, and it obviously doesn't work when -your net connection is down. - -A better option is to have a copy of the stylesheets on your system. -It's likely that there is a pre-built package for your system: - - Red Hat Linux: docbook-style-xsl RPM (same for Fedora Core) - Mac OS X: docbook-xsl Fink package (http://fink.sf.net) - Cygwin: docbook-xml?? package (?? = DocBook version) - -(Please send the name of the package for your system to the mailing -list if it isn't listed above, and I'll add it to the list.) - -If you can't find a package for your system, you can get the DocBook -stylesheets from the source: http://docbook.sourceforge.net/ They're -a bit tricky to set up correctly, so it's better to use a pre-built -package if you can. - -If you are still having problems, post the details about it to the -MySQL++ mailing list, and I'll try to help you debug the problem. -You might also find the FOP and/or DocBook mailing lists helpful. - - - - -If you're looking to hack on the manual, here are some helpful resources -for getting up to speed on DocBook: - - Mills' "Installing And Using An XML/SGML DocBook Editing Suite" article: - - http://tinyurl.com/8alb2 - - This is the best tutorial I've found. - - - Walsh and Muellner's _Simplified DocBook: The Definitive Guide_ book: - - http://www.docbook.org/tdg/simple/en/html/sdocbook.html - - This is the most accessible reference. - - - Walsh and Muellner's _DocBook: The Definitive Guide_ book, second - edition, online version: - - http://www.docbook.org/tdg/en/html/docbook.html - - This is the official DocBook referece; the "Simplified" guide is a - subset of this book. - - - DocBook FAQ: - - http://www.dpawson.co.uk/docbook/ - - Go here when you have a question that the tutorials and references - do not answer. - - - The official DocBook site: - - http://docbook.org/ - ADDED doc/userman/breakages.dbx Index: doc/userman/breakages.dbx ================================================================== --- /dev/null +++ doc/userman/breakages.dbx @@ -0,0 +1,1215 @@ + + + + + Incompatible Library Changes + + This chapter documents those library changes since the epochal + 1.7.9 release that break end-user programs. You can dig this stuff out + of the ChangeLog, but the ChangeLog focuses more on explaining and + justifying the facets of each change, while this section focuses on + how to migrate your code between these library versions. + + Since pure additions do not break programs, those changes are + still documented only in the ChangeLog. + + + + API Changes + + This section documents files, functions, methods and classes + that were removed or changed in an incompatible way. If your program + uses the changed item, you will have to change something in your + program to get it to compile after upgrading to each of these + versions. + + + v1.7.10 + + Removed Row::operator[]() overloads + except the one for size_type, and added + Row::lookup_by_name() to provide the + “subscript by string” functionality. In practical + terms, this change means that the row["field"] + syntax no longer works; you must use the new + lookup_by_name method instead. + + Renamed the generated library on POSIX systems from + libsqlplus to + libmysqlpp. + + + + + v1.7.19 + + Removed SQLQuery::operator=(), and + the same for its Query subclass. Use the + copy constructor instead, if you need to copy one query to another + query object. + + + + + v1.7.20 + + The library used to have two names for many core classes: a + short one, such as Row and a longer one, + MysqlRow. The library now uses the shorter + names exclusively. + + All symbols within MySQL++ are in the + mysqlpp namespace now if you use the new + mysql++.h header. If you use the older + sqlplus.hh or mysql++.hh + headers, these symbols are hoist up into the global namespace. The + older headers cause the compiler to emit warnings if you use them, + and they will go away someday. + + + + + v2.0.0 + + + Connection class changes + + + Connection::create_db() + and drop_db() return + true on success. They returned + false in v1.7.x! This + change will only affect your code if you have exceptions + disabled. + + Renamed + Connection::real_connect() + to connect(), made several + more of its parameters default, and removed the + old connect() method, as + it’s now a strict subset of the new one. The + only practical consequence is that if your program + was using real_connect(), + you will have to change it to + connect(). + + Replaced + Connection::read_option() with new + set_option() mechanism. In addition + to changing the name, programs using this function will have + to use the new Connection::Option + enumerated values, accept a true + return value as meaning success instead of 0, and + use the proper argument type. Regarding the latter, + read_option() took a const + char* argument, but because it was just a thin wrapper + over the MySQL C API function , the actual value being pointed to could + be any of several types. This new mechanism is properly + type-safe. + + + + + + Exception-related changes + + + Classes Connection, + Query, Result, + ResUse, and Row + now derive from which gives these classes a common + interface for disabling exceptions. In addition, almost all + of the per-method exception-disabling flags were removed. The + preferred method for disabling exceptions on these objects + is to create an instance of the new class on the stack, which disables + exceptions on an OptionalExceptions + subclass as long as the NoExceptions + instance is in scope. You can instead call + disable_exceptions() on any + of these objects, but if you only want them disabled + temporarily, it’s easy to forget to re-enable them + later. + + In the previous version of MySQL++, + those classes that supported optional exceptions that + could create instances of other such classes were + supposed to pass this flag on to their children. That + is, if you created a Connection + object with exceptions enabled, and then asked it to + create a Query object, the + Query object also had exceptions + disabled. The problem is, this didn’t happen in all + cases where it should have in v1.7. This bug is fixed in + v2.0. If your program begins crashing due to uncaught + exceptions after upgrading to v2.0, this is the most likely + cause. The most expeditious fix in this situation is to + use the new NoExceptions feature to + return these code paths to the v1.7 behavior. A better fix + is to rework your program to avoid or deal with the new + exceptions. + + All custom MySQL++ exceptions now derive from + the new interface. + The practical upshot of this is that the variability between + the various exception types has been eliminated. For instance, + to get the error string, the BadQuery + exception had a string member called error + plus a method called what(). Both + did the same thing, and the what() + method is more common, so the error string was dropped + from the interface. None of the example programs had to be + changed to work with the new exceptions, so if your program + handles MySQL++ exceptions the same way they do, your program + won’t need to change, either. + + Renamed + SQLQueryNEParams exception to + BadParamCount to match style of other + exception names. + + Added , , , , , , and exception types, to fix + overuse of BadQuery. Now the + latter is used only for errors on query execution. If + your program has a “catch-all” block taking a + std::exception for each try block + containing MySQL++ statements, you probably won’t + need to change your program. Otherwise, the new exceptions + will likely show up as program crashes due to unhandled + exceptions. + + + + + + Query class changes + + + + In previous versions, + Connection had + a querying interface similar to class + Query’s. These methods were + intended only for Query’s use; no + example ever used this interface directly, so no end-user code + is likely to be affected by this change. + + A more likely problem arising from + the above change is code that tests for query success + by calling the Connection + object’s success() method + or by casting it to bool. This will now give + misleading results, because queries no longer go through + the Connection object. Class + Query has the same success-testing + interface, so use it instead. + + Query now derives + from std::ostream instead of + std::stringstream. + + + + + + + Result/ResUse class changes + + + + Renamed + ResUse::mysql_result() to + raw_result() so it’s database + server neutral. + + Removed + ResUse::eof(), as it wrapped + the deprecated and unnecessary MySQL C API function + . See the + simple3 and usequery + examples to see the proper way to test for the end of a result + set. + + + + + + + Row class changes + + + + Removed “field name” form + of Row::field_list(). It was + pointless. + + Row subscripting + works more like v1.7.9: one can subscript a + Row with a string (e.g. + row["myfield"]), or with + an integer (e.g. row[5]). + lookup_by_name() was + removed. Because row[0] is + ambiguous (0 could mean the first field, or be a null + pointer to const char*), there is now + Row::at(), which can look up any + field by index. + + + + + + + Miscellaneous changes + + + + Where possible, all distributed Makefiles only + build dynamic libraries. (Shared objects on most Unices, DLLs + on Windows, etc.) Unless your program is licensed under the + GPL or LGPL, you shouldn’t have been using the static + libraries from previous versions anyway. + + Removed the backwards-compatibility + headers sqlplus.hh and + mysql++.hh. If you were + still using these, you will have to change to + mysql++.h, which will put all symbols in + namespace mysqlpp. + + Can no longer use arrow operator + (->) on the iterators into the + Fields, Result + and Row containers. + + + + + + + v2.2.0 + + Code like this will have to change: + + +query << "delete from mytable where myfield=%0:myvalue"; +query.parse(); +query.def["myvalue"] = some_value; +query.execute(); + + ...to something more like this: + + +query << "delete from mytable where myfield=%0"; +query.parse(); +query.execute(some_value); + + The first code snippet abuses the default template query + parameter mechanism (Query::def) to fill out + the template instead of using one of the overloaded forms of + execute(), + store() or use() + taking one or more SQLString parameters. + The purpose of Query::def is to allow for + default template parameters over multiple queries. In the first + snippet above, there is only one parameter, so in order to justify + the use of template queries in the first place, it must be + changing with each query. Therefore, it isn’t really a + “default” parameter at all. We did not make this + change maliciously, but you can understand why we are not in any + hurry to restore this “feature”. + + (Incidentally, this change was made to allow better support + for BLOB columns.) + + + + + v2.3.0 + + Connection::set_option() calls now + set the connection option immediately, instead of waiting until + just before the connnection is actually established. Code that + relied on the old behavior could see unhandled exceptions, since + option setting errors are now thrown from a different part of the + code. You want to wrap the actual + set_option() call now, not + Connection::connect() + + FieldNames and + FieldTypes are no longer exported from the + library. If you are using these classes directly from Visual C++ + or MinGW, your code won’t be able to dynamically link to a + DLL version of the library any more. These are internal classes, + however, so no one should be using them directly. + + + + + v3.0.0 + + + Class name changes + + Several classes changed names in this + release: + + + ColData is now + String. + + NullisBlank + is now NullIsBlank. (Note + the capital I.) Similar + changes for NullisNull and + NullisZero. + + ResNSel is now + SimpleResult. + + Result is now + StoreQueryResult. + + ResUse is now + UseQueryResult. + + SQLString is now + SQLTypeAdapter. + + + When first building existing code against this version, + you may find it helpful to define the macro + MYSQLPP_OLD_CLASS_NAMES in your + program’s build options. This will turn on some macros + that set up aliases for the new class names matching their + corresponding old names. Then, when you’ve fixed up any + other issues that may prevent your program from building with + the new MySQL++, you can turn it back off and fix up any class + name differences. + + If you were only using ColData in a + BLOB context, you should use sql_blob or + one of the related typedefs defined in + lib/sql_types.h instead, to insulate your + code from changes like these. + + The SQLString change + shouldn’t affect you, as this class was not designed to be + used by end user code. But, due to the old name and the fact + that it used to derive from std::string, + some might have been tempted to use it as an enhanced + std::string. Such code will undoubtedly + break, but can probably be fixed by just changing it to use + std::string instead. + + + + + Connection class changes + + The option setting mechanism has been redesigned. (Yes, + again.) There used to be an enum in + Connection with a value for each option + we understood, and an overload of + Connection::set_option() for each + argument type we understood. It was possible to pass any option + value to any set_option() overload, and + the problem would only be detected at run time. Now each option + is represented by a class derived from the new + Option abstract base class, and + set_option() simply takes a pointer to + one of these objects. See + examples/multiquery.cpp for the syntax. + Since each Option subclass takes only the + parameter types it actually understands, it’s now + completely type-safe at compile time. + + The new option setting mechanism also has the virtue of + being more powerful so it let us replace several existing things + within Connection with new + options: + + + Replaced + enable_ssl() with + SslOption. + + Replaced the compress + parameter to the Connection + create-and-connect constructor and + Connection::connect() method with + CompressOption. + + Replaced the + connect_timeout parameter with + ConnectTimeoutOption. + + Defined Option + subclasses for each of the flags you would previously set + using the client_flag parameter. There + are about a dozen of these, so instead of listing them, + look in lib/options.h for something + with a similar name. + + + Collapsed Connection’s + host, port, and + socket_name parameters down into a new + combined server parameter which is parsed to + determine what kind of connection you mean. These interfaces are + still compatible with v2.3 and earlier up through the port + parameter. + + Moved + Connection::affected_rows(), + info() and + insert_id() methods to class + Query, as they relate to the most + recently-executed query. + + Changed the return type of + Connection::ping() from + int to bool. If you were calling + ping() in bool context + or using its return value in bool context, + you will need to reverse the sense of the test because the + previous return code used zero to mean success. Now it returns + true to indicate success. + + Renamed several methods: + + + Use client_version() + instead of api_version() or + client_info(). + + Use + ipc_version() instead of + host_info(). + + Use + protocol_version() instead of + proto_info(). + + Use + server_version() instead of + server_info(). + + Use + status() instead of + stat(). + + + Also, removed close() in favor + of disconnect(), which has always + done the same thing. + + + + + Date and Time class changes + + The sql_timestamp typedef is now + an alias for DateTime, not + Time. + + There used to be implicit conversion constructors from + ColData (now + String), + std::string and const char* + for the Date, + DateTime, and Time + classes. It’s still possible to do these conversions, but + only explicitly. (This had to be done to make + Null<T> work in SSQLSes.) + + The most likely place to run into problems as a result + of this change is in code like this: + + +void some_function(const mysqlpp::DateTime& dt); + +some_function("2007-12-22"); + + The function call needs to be changed to: + + +some_function(mysqlpp::DateTime("2007-12-22")); + + + + + Exception changes + + If an error occurs during the processing of a + “use” query (as opposed to the initial execution) we + throw the new UseQueryError exception + instead of BadQuery. + + If you pass bad values to the Row + ctor so that it can’t initialize itself properly, it + throws the ObjectNotInitialized + exception instead of BadQuery. + + Together, these two changes mean that + BadQuery is now used solely to indicate + a problem executing the actual SQL query statement. + + + + + Field and Fields class changes + + Field is now a real C++ class, + not just a typedef for the corresponding C API class. Major + portability impacts are: + + + It has no public data members. Where + sensible, there is a public accessor function of the + same name as the corresponding field in the C API + structure. + + The main exception to this is the + flags data member. This is a bitfield in + the C API data structure and you had to use MySQL-specific + constants to break values out of it. MySQL++’s new + Field class provides a public member + function returning bool for each of these + flags. + + The new class doesn’t include all of the + data members from the C API version. We left out those that + aren’t used within MySQL++ or its examples, or whose + function we couldn’t understand. Basically, if we + couldn’t document a reason to use it, we left it + out. + + + Fields used to be a + std::vector work-alike which + worked with the C API to access fields and return them + as though they were simply contained directly within the + Fields object. Now that we have a + real MySQL++ class to hold information about each field + without reference to the C API, we were able to replace the + Fields class with: + + +typedef std::vector<Field> Fields; + + If anything, this should give a pure superset of the old + functionality, but it’s possible it could break end user + code. + + + + + Query class changes + + If you were using char as an 8-bit integer + in query building, there are several places in MySQL++ v3 where + it will now be treated as a single-character string. MySQL++ + has had the tiny_int class for many + years now specifically to provide a true 8-bit integer without + the semantic confusion surrounding the old C char + type. Either use tiny_int, or + use the SQL type aliases sql_tinyint and + sql_tinyint_unsigned instead. + + The ‘r’ and ‘R’ template query + parameter modifiers were removed. They made the library do + quoting and both quoting and escaping (respectively) regardless + of the data type of the parameter. There are no corresponding + Query stream manipulators, so for + symmetery we had to decide whether to add such manipulators or + remove the tquery modifiers. There should never be a reason to + force quoting or escaping other than to work around a MySQL++ + bug, and it’s better to just fix the bug than work around + it, so removed the tquery modifiers. + + Query::store_next() + and Result::fetch_row() no + longer throw the EndOfResults and + EndOfResultSets exceptions; these + are not exceptional conditions! These methods simply return + false when you hit the end of the result set + now. + + Renamed Query::def to + Query::template_defaults to make its + purpose clearer. + + Removed Query::preview(). The + most direct replacement for this set of overloaded methods is + the parallel set of str() methods, + which were just aliases before. (Chose + str() over + preview() because it’s standard + C++ nomenclature.) But if you’re just looking to get a + copy of a built query string and you aren’t using template + queries, you can now insert the Query + into a stream and get the same result. + + For example, a lot of code in the examples that used to + say things like: + + +cout << query.preview() << endl; + + now looks like this: + + +cout << query << endl; + + + + + Result, ResUse, and ResNSel class changes + + In addition to the class name changes described above, + UseQueryResult is no longer + StoreQueryResult’s base class. + There is a new abstract class called + ResultBase containing much of what used + to be in ResUse, and it is the base of + both of these concrete result set types. This should only affect + your code if you were using ResUse + references to refer to Result + objects. + + Removed a bunch of duplicate methods: + + + Use + num_fields() instead of + columns(). + + Use + field_names() instead of + names(). + + Use + num_rows() instead of + rows(). + + Use + field_types() instead of + types(). + + + Renamed several methods for “grammar” reasons. + For example, some methods returned a single object but had a + “plural” name, implying that it returned a container + of objects. In cases like this, we changed the name to agree + with the return value. Some of these also fall into the + duplicate method category above: + + + Use + field(unsigned int) + instead of fields(unsigned + int). + + Use field_num(const + std::string&) + instead of names(const + std::string&). + + Use + field_name(int) instead of + names(int). + + Use + field_type(int) instead of + types(int). + + + Removed several “smelly” methods: + + + purge(): was an + internal implementation detail, not something for end user + code to call + + raw_result(): end + user code shouldn’t be digging down to the C API data + structures, but if you really need something like this, look + at the implementation of + Query::storein(). Its workings will + probably be educational. + + reset_names(): + no reason to call this, especially now that the field + name list is initialized once at startup and then never + changed + + reset_field_names(): + just an alias for previous + + reset_types(): + same argument as for + reset_names() + + reset_field_types(): + just an alias for previous + + + ResUse::field_num() would + unconditionally throw a BadFieldName + exception when you asked for a field that doesn’t exist. + Now, if exceptions are disabled on the object, it just returns + -1. + + SimpleResult’s member + variables are all now private, and have read-only accessor + functions of the same name. + + Code like this used to work: + + +mysqlpp::Row row; +mysqlpp::Result::size_type i; +for (i = 0; row = res[i]; ++i) { + // Do something with row here +} + + That is, indexing past the end of a “store” + result set would just return an empty row object, which tests as + false in bool context, so it ends the loop. Now + that StoreQueryResult is a + std::vector derivative, this either + crashes your program or causes the standard library to throw an + exception, depending on what debugging features your version of + STL has. The proper technique is: + + +mysqlpp::Row row; +mysqlpp::StoreQueryResult::size_type i; +for (i = 0; i < res.num_rows(); ++i) { + row = res[i]; + // Do something with row here +} + + ...or, in a more C++ish idiom: + + +mysqlpp::Row row; +mysqlpp::StoreQueryResult::const_iterator it; +for (it = res.begin(); it != res.end(); ++it) { + row = *it; + // Do something with row here +} + + + + + Row class changes + + Removed Row::raw_data(), + raw_size() and + raw_string(). These were useful with + BLOB data back when MySQL++ didn’t handle embedded null + characters very well, and when copies of + ColData objects were expensive. Neither + is true now, so they have no value any more. Equivalent calls + are: + + +mysqlpp::String s = row[0]; +s.data(); // raw_data() equivalent +s.length(); // raw_size() equivalent +std::string(s.data(), s.length()); // raw_string() equivalent + + Row::operator[](const char*) + would unconditionally throw a + BadFieldName exception when you asked for + a field that doesn’t exist. Now, if exceptions are + disabled on the Row object, it just + returns a reference to an empty String + object. You can tell when this happens because such an object + tests as false in bool context. + + + + + Specialized SQL Structure (SSQLS) changes + + Renamed custom* to + ssqls*. There is a backwards-compatibility + header custom.h which includes + ssqls.h for you, but it will go away in a + future version of MySQL++. + + SSQLSes get populated by field name now, not by + field order. In v2, it was absolutely required that your + SSQLS had its fields declared in exactly the same order + as the fields in the database server, and there could be + no gaps. An ALTER TABLE command would + almost always necessitate redefining the corresponding SSQLS + and rebuilding your program. Some alterations actually made + using SSQLS impossible. For the most part, this change just + gives your program additional flexibility in the face of + future changes. However, code that was taking advantage of + this low-level fact will break when moving to v3. Before I + explain how, let’s go over the high-level functional + changes you’ll find in v3’s SSQLS mechanism. + + Because MySQL++ no longer needs the + SSQLS field order to match the SQL field order, + the sql_create_c_order_* + SSQLS creation macro was dropped in v3. We were + also able to drop the ordering parameters from + sql_create_complete_*. That in turn + means there is no longer a difference between the way it and + sql_create_c_names_* work, so the latter + was also dropped. Thus, there are now only two groups of SSQLS + creation macros left: sql_create_*, + which works pretty much as it always has, and + sql_create_complete_*, which is the same + except for the lack of ordering parameters. + + In general, you should be using + sql_create_* for all SSQLSes unless + you need to use different names for data members in C++ than + you use for the corresponding columns in SQL. In that case, + use sql_create_complete_* instead. + + In v2, it was possible to have different SQL column + names than SSQLS data member names while still using + sql_create_* if you only used SSQLS + for data retrieval.In MySQL++ v2, data + retreival (Query::storein(), + SSQLS(const Row& other), + etc.) worked fine regardless of whether your SSQLS field names + matched those in the corresponding SQL table, because the + SSQLS was populated by position, not by field name. Thus, + if all you used SSQLS for was data retrieval, you could + define your structures with sql_create_* + in v2. This was never recommended, because such an SSQLS + wouldn’t work with other features of MySQL++ like + Query::insert() because they depend + on being able to map names from C++ to SQL and back. You + needed to use sql_create_c_names_* + to make these features work in v2 in the face of a naming + scheme difference between C++ and SQL. In + v3, you must use sql_create_complete_* + for absolutely all uses of SSQLS when you want the C++ field + names to differ from the SQL column names. + + The new Null<T> support in + SSQLSes causes an internal compiler error in Visual C++ 2003. + (VC++ 2005 and newer have no trobule with it.) A poll on the + mailing list says there aren’t many people still stuck on + this version, so we just ifdef’d out the SSQLS mechanism + and all the examples that use it when built with VC++ 2003. If + this affects you, see for + suggestions on ways to cope. + + If you are using types other than MySQL++’s + sql_* ones These typedefs + have been available since MySQL++ v2.1. + in your SSQLSes, code that previously worked may now see + TypeLookupFailed exceptions. (This + can be thrown even if exceptions are otherwise disabled in + MySQL++.) This version of MySQL++ is stricter about mapping + SQL to C++ type information, and vice versa. If the library + can’t find a suitable mapping from one type system + to the other, it throws this exception, because its only + other option would be to crash or raise an assertion. This + typically happens when building SQL queries, so you can + probably handle it the same way as if the subsequent + query excecution failed. If you’re catching the + generic mysqlpp::Exception, your + error handling code might not need to change. If you see + this exception, it does mean you need to look into your + use of data types, though. The table that controls this is + mysql_type_info::types, defined at the top + of lib/type_info.cpp. Every data type in + lib/sql_types.h has a corresponding record + in this table, so if you stick to those types, you’ll + be fine. It’s also okay to use types your C++ compiler + can convert directly to these predefined types. + + The _table static member variable + for each SSQLS is now private. The recommended way to access + this remains unchanged: the table() + static member function. + + table() used to return a modifiable + reference to the table name. Now there are two overloads, + one which returns an unmodifiable pointer to the table name, + and the other which takes const char* so you + can override the default table name. So, the code we used to + recommend for changing the SSQLS’s table name: + + +my_ssqls_type::table() = "MyTableName"; + + now needs to be: + + +my_ssqls_type::table("MyTableName"); + + + + + Miscellaneous changes + + MySQL++ does quoting and escaping much more selectively + now. Basically, if the library can tell you’re not + building a SQL query using one of the standard methods, it + assumes you’re outputting values for human consumption, so + it disables quoting and SQL escaping. If you need to build your + own mechanism to replace this, quoting is easy to do, and + Query::escape_string() can do SQL + escaping for you. + + Removed success() in + Connection, Query + and SimpleResult (neé + ResNSel) and simply made these classes + testable in bool context to get the same + information. An additional change in + Connection is that it used to be + considered “unsuccessful” when the connection was + down. Since the sense of this test is now whether the object is + in a good state, it only returns false when the + connection attempt fails. Call + Connection::is_connected() if you just + want to test whether the connection is up. + + The debug mode build of the library now has a "_d" suffix + for Visual C++, and Xcode. This lets you have both versions + installed without conflict. The release build uses the current + naming scheme. If you have an existing program building against + MySQL++ on these platforms, you’ll need to change your + build options to use the new name in debug mode. + + Renamed NO_LONG_LONGS to + MYSQLPP_NO_LONG_LONGS to avoid a risk of + collision in the global macro namespace. + + + + + + v3.0.7 + + Most MySQL++ classes with at() + or operator []() methods now + throw the new + exception when you pass an out-of-range index. These + methods variously either did not check their indices, + or threw std::out_of_range when + passed a bad index. + + I say “most” because there is at + least one MySQL++ class that doesn’t follow this + rule. Fields is just a typedef for a + specialization of std::vector, and the + Standard has its own rules for index checking. + + + + + + ABI Changes + + This section documents those library changes that require you + to rebuild your program so that it will link with the new library. + Most of the items in the previous section are also ABI changes, but + this section is only for those items that shouldn’t require + any code changes in your program. + + If you were going to rebuild your program after + installing the new library anyway, you can probably ignore this + section. + + + + v1.7.18 + + The Query classes now subclass from + stringstream instead of the deprecated + strstream. + + + + + v1.7.19 + + Fixed several const-incorrectnesses in the + Query classes. + + + + + v1.7.22 + + Removed “reset query” parameters from several + Query class members. This is not an API + change, because the parameters were given default values, and the + library would ignore any value other than the default. So, any + program that tried to make them take another value wouldn’t + have worked anyway. + + + + + v1.7.24 + + Some freestanding functions didn’t get moved into + namespace mysqlpp when that namespace was + created. This release fixed that. It doesn’t affect the API + if your program’s C++ source files say using + namespace mysqlpp within them. + + + + + v2.0.0 + + Removed Connection::infoo(). + (I’d call this an API change if I thought there were any + programs out there actually using this...) + + Collapsed the Connection constructor + taking a bool (for setting the throw_exceptions flag) and the + default constructor into a single constructor using a default for + the parameter. + + Classes Connection and + Query are now derived from the + Lockable interface, instead of implementing + their own lock/unlock functions. + + In several instances, functions that took objects by + value now take them by const reference, for efficiency. + + Merged SQLQuery class’s members + into class Query. + + Merged RowTemplate class’s + members into class Row. + + Reordered member variable declarations in some classes. The + most common instance is when the private section was declared + before the public section; it is now the opposite way. This + can change the object’s layout in memory, so a program + linking to the library must be rebuilt. + + Simplified the date and time class hierarchy. + used to + derive from mysql_date, + used to derive + from mysql_time, and used to derive from + both of those. All three of these classes used to derive + from mysql_dt_base. All of the + mysql_* classes’ functionality + and data has been folded into the leaf classes, and now the + only thing shared between them is their dependence on the + template. Since the + leaf classes’ interface has not changed and end-user + code shouldn’t have been using the other classes, this + shouldn’t affect the API in any practical way. + + mysql_type_info now always + initializes its private num member. + Previously, this would go uninitialized if you used the default + constructor. Now there is no default ctor, but the ctor taking one + argument (which sets num) has a default. + + + + + v3.0.0 + + Removed reset_query parameters from + Query member functions. None of these have + been honored at least going back to v1.7.9, so this is not an API + change. As of this version, Query now + automatically detects when it can safely reset itself after + executing a query, so it’s not necessary to ask for a reset + except when using template queries. + + Removed overloads of + Query::execute(), + store(), and + use() that take only a const + char*. This is not an API change because there was an + equivalent call chain for this already. This change just snaps + a layer of indirection. + + Query::error() is now + const and returns const char* instead + of a std::string by value. + + Removed Lockable mechanism as it was + conceptually flawed. Connection and + Query consequently no longer derive from + Lockable. Since it was basically useless in + prior versions, it can’t be construed as an API + change. + + + + + v3.0.1 + + Connection::thread_aware(), + thread_start() and + thread_end() are now static methods, so + a program can call them before creating a connection. Ditto for + DBDriver methods of the same name. + + ConnectionPool::release() is now + virtual, so a subclass can override it. + + + + + v3.0.2 + + ConnectionPool::grab() is now + virtual; same reason as above. + + Query can now be tested in + bool context, as was intended for v3.0.0. Had to + change the “safe bool” method signature to make it + happen, so technically it’s an API change, but it’s + still used the same way. + + + + + v3.1.0 + + The addition of a few new virtual methods to + ConnectionPool inadvertently changed + the library ABI. I knew adding fields changed the ABI, but + erroneously assumed that the inverse of that truth — that + adding methods was always safe — + was also true. Adding normal methods is + safe, but adding virtual methods breaks + the ABI because it changes the class’s vtable size. + + That left us with two bad choices: either we could come + out with a 3.1.1 that removed these methods to restore the prior + ABI, or we could just declare this the “new ABI” + and move on, resolving not to fall into this trap again. + We’ve chosen the latter path. + + + Index: doc/userman/common.xsl ================================================================== --- doc/userman/common.xsl +++ doc/userman/common.xsl @@ -2,36 +2,16 @@ - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + ADDED doc/userman/configuration.dbx Index: doc/userman/configuration.dbx ================================================================== --- /dev/null +++ doc/userman/configuration.dbx @@ -0,0 +1,211 @@ + + + + + Configuring MySQL++ + + The default configuration of MySQL++ is suitable for most + purposes, but there are a few things you can change to make it meet + special needs. + + + The Location of the MySQL Development Files + + MySQL++ is built on top + of the MySQL C API. (Now called Connector/C.) + MySQL++ relies on this low-level library for all communication + with the database server. Consequently, the build process for + MySQL++ may fail if it can’t find the C API headers and + library. + + On platforms that use AutoconfLinux, + Solaris, the BSDs, Mac OS X command line (as opposed to the + Xcode IDE), Cygwin... Basically, Unix or anything that works + like it., the configure + script can usually figure out the location of the C API + development files by itselfI don’t say + “Connector/C” here because the name change generally + hasn’t percolated out to Unixy systems. It’s more + commonly used on Windows systems, since the separate Connector/C + download lets them avoid installing a MySQL server just to get + development headers and libraries. It simply + tries a bunch of common installation locations until it finds one + that works. If your MySQL server was installed in a nonstandard + location, you will have to tell the configure + script where these files are with some combination + of the --with-mysql, + --with-mysql-include, and + --with-mysql-lib flags. See + README-Unix.txt for details. + + No other platform allows this sort of auto-discovery, so + the build files for these platforms simply hard-code the default + installation location for the current GA version of Connector/C + at the time that version of MySQL++ was released. For example, + the Visual C++ project files currently assume MySQL is in + c:\Program Files\MySQL\MySQL Server 5.1. If + you’re using some other release of MySQL or you installed it + somewhere else, you will have to modify the build files. How you + do this, exactly, varies based on platform and what tools you + have on hand. See README-Visual-C++.txt, + README-MinGW.txt, or + README-Mac-OS-X.txt, as appropriate. + + + + + The Maximum Number of Fields Allowed + + MySQL++ offers two ways to automatically build SQL + queries at run time: and SSQLS. There’s a limit on the number + of fields these mechanisms support, defaulting to 25 fields in the + official MySQL++ packages.If you’re using + a third-party MySQL++ package, its maintainer may have increased + these field counts so the resulting headers more closely approach + the size limit of the compiler the package was built with. In that + case, you can look at the top of each generated header file to + find out how many fields each supports. The files + embodying these limits are lib/querydef.h and + lib/ssqls.h, each generated by Perl scripts of + the same name but with a .pl extension. + + The default querydef.h is small and + its size only increases linearly with respect to maximum field + count. + + ssqls.h is a totally + different story. The default 25 field limit + makes ssqls.pl generate an + ssqls.h over 1 MB. Worse, + the field limit to file size relation is + quadratic.The file + size equation, for you amateur mathematicians out there, + is Nlines = + 18.5f2 + 454.5f + 196.4, + where f is the field count. + This has a number of bad effects: + + + + Generating header files to support more fields than + you actually require is a waste of space and bandwidth. + + + + Some compilers have arbitrary limits on the size of + macros they’re able to parse. Exceeding these limits + usually causes the compiler to misbehave badly, rather than + fail gracefully. + + + + Because it increases the size of two key files used + in building MySQL++ itself and programs built on it, it + increases compile times significantly. One test I did here + showed a tripling of compile time from quadrupling the field + limit. + + + + More than 25 fields in a table is a good sign of a bad + database design, most likely a denormalization problem. + + + + The default limits try to mitigate against all of these + factors while still being high enough to be useful with most + DB designs. + + If you’re building MySQL++ from source on a platform + that uses Autoconf, the easiest way to change these limits is at + configuration time: + + +./configure --with-field-limit=50 + + That causes the configuration script to pass the + -f flag to the two Perl scripts named above, + overriding the default of 25 fields. Obviously you need a + Perl interpreter on the system for this to work, but Perl is + usually installed by default on systems MySQL++ supports via + Autoconf. + + On all other platforms, you’ll have to give the + -f flag to these scripts yourself. This + may require installing Perl and putting it in the command + path first. Having done that, you can do something like this to + raise the limits: + + +cd lib +perl ssqls.pl -f 50 +perl querydef.pl -f 50 + + Note the need to run these commands within the + lib subdirectory of the MySQL++ source + tree. (This is done for you automatically on systems where you + are able to use the Autoconf method.) + + + + + Buried MySQL C API Headers + + It’s common these days on Unixy systems to install + the MySQL C API headers in a mysql directory + under some common include directory. If the + C API headers are in /usr/include/mysql, we + say they are “buried” underneath the system’s + main include directory, /usr/include. Since + the MySQL++ headers depend on these C API headers, it can be + useful for MySQL++ to know this fact. + + When MySQL++ includes one of the C API headers, it normally + does so in the obvious way: + + +#include <mysql.h> + + + But, if you define the + MYSQLPP_MYSQL_HEADERS_BURIED macro, it switches + to this style: + + +#include <mysql/mysql.h> + + + In common situations like the + /usr/include/mysql one, this simplifies the + include path options you pass to your compiler. + + + + + Building MySQL++ on Systems Without Complete C99 + Support + + MySQL++ uses the C99 + header stdint.h for portable fixed-size + integer typedefs where possible. The C99 extensions aren’t + yet officially part of the C++ Standard, so there are still + some C++ compilers that don’t offer this header. MySQL++ + works around the lack of this header where it knows it needs + to, but your platform might not be recognized, causing + the build to break. If this happens, you can define the + MYSQLPP_NO_STDINT_H macro to make MySQL++ + use its best guess for suitable integer types instead of relying + on stdint.h. + + MySQL++ also uses C99’s long long + data type where available. MySQL++ has workarounds for platforms + where this is known not to be available, but if you get errors in + common.h about this type, you can define the + macro MYSQLPP_NO_LONG_LONGS to make MySQL++ + fall back to portable constructs. + + Index: doc/userman/fo.xsl ================================================================== --- doc/userman/fo.xsl +++ doc/userman/fo.xsl @@ -42,6 +42,30 @@ + + + + false + + + + + left + + + + + 85% + + + + ADDED doc/userman/fo2pdf Index: doc/userman/fo2pdf ================================================================== --- /dev/null +++ doc/userman/fo2pdf @@ -0,0 +1,39 @@ +#!/bin/bash +AHCMD=/usr/XSLFormatterV42/run.sh +FOPCMD=$(type -p fop) +XEPCMD=/usr/local/xep/xep + +FOFILE=$1 +PDFFILE=$2 +if [ -n "$FOFILE" -a -r "$FOFILE" -a -n "$PDFFILE" ] +then + if [ -x "$XEPCMD" ] + then + echo Rendering $FOFILE to $PDFFILE with RenderX XEP... + $XEPCMD -quiet -fo $FOFILE -pdf $PDFFILE + elif [ -x "$AHCMD" ] + then + echo Rendering $FOFILE to $PDFFILE with Antenna House XSL Formatter... + $AHCMD -silent -d $FOFILE -o $PDFFILE + elif [ -x "$FOPCMD" ] + then + echo "Rendering $FOFILE to $PDFFILE with Apache FOP ($FOPCMD)..." + $FOPCMD -q -fo $FOFILE $PDFFILE + else + echo 'Cannot find a working XSL-FO processor on your system! See' + echo 'doc/usrman/README.txt for instructions on installing one.' + echo + exit 1 + fi +else + if [ -n "$FOFILE" ] + then + echo "XSL-FO file $FOFILE does not exist." + echo + fi + echo "usage: $0 fofile pdffile" + echo + echo ' Translates XSL-FO in fofile to PDF output in pdffile.' + echo + exit 1 +fi Index: doc/userman/html.xsl ================================================================== --- doc/userman/html.xsl +++ doc/userman/html.xsl @@ -13,13 +13,19 @@ + + + - + @@ -47,11 +53,11 @@ reference manual, given its name. --> - ../../refman/html/classmysqlpp_1_1 + ../refman/classmysqlpp_1_1 .html @@ -69,11 +75,11 @@ reference manual, given its name. --> - ../../refman/html/structmysqlpp_1_1 + ../refman/structmysqlpp_1_1 .html ADDED doc/userman/incorporating.dbx Index: doc/userman/incorporating.dbx ================================================================== --- /dev/null +++ doc/userman/incorporating.dbx @@ -0,0 +1,348 @@ + + + + + Using MySQL++ in Your Own Project + + Up to now, this manual has only discussed MySQL++ + in conjunction with the example programs that come with the + library. This chapter covers the steps you need to take to + incorporate MySQL++ into your own projects. + + The first thing you have to do is include + mysql++.h in each module + that uses MySQL++. In modules that use SSQLS v1, you also need to include + ssqls.h.MySQL++ has many header + files, but the only one that isn’t intertwined with the rest is + ssqls.h. mysql++.h brings + in all of the others in the correct order. Some have tried to speed + their build times by finding a subset of MySQL++ headers to include, + but mysql++.h already does as much of this as + is practical. MySQL++’s monolithic nature rules out finding + a true subset of the library headers. + + At this point, your project probably still won’t compile, + and it certainly won’t link. The remaining steps are dependent + on the operating system and tools you are using. The rest of this + chapter is broken up into several sections, one for each major + platform type. You can skip over the sections for platforms you + don’t use. + + + + Visual C++ + + + Using MySQL++ in an MFC Project + + If you don’t already have a project set up, open + Visual Studio, say File | New | Project, then choose Visual C++ + | MFC | MFC Application. Go through the wizard setting up the + project as you see fit. + + Once you have your project open, right click on your + top-level executable in the Solution Explorer, choose Properties, + and make the following changes. (Where it doesn’t + specify Debug or Release, make the same change to both + configurations.) + + + Append the following to C/C++ | General | + Additional Include Directories: C:\Program + Files\MySQL\MySQL Connector C 6.1\include, + C:\mysql++\include + + Under C/C++ | Code Generation change + “Runtime Library” to “Multi-threaded + Debug DLL (/MDd)” for the Debug configuration. For + the Release configuration, make it “Multi-threaded DLL + (/MD)”. + + + For both Release and Debug builds, append the following + to Linker | General | Additional Library Directories: + C:\Program Files\MySQL\MySQL Connector C 6.1\lib, + C:\mysql++\lib + + Connector/C does include debug libraries, but you + will probably not need to use them. + + + + Under Linker | Input add the following to + “Additional Dependencies” for the Debug + configuration: libmysql.lib wsock32.lib + mysqlpp_d.lib + + ...and then for the Release configuration: + libmysql.lib wsock32.lib + mysqlpp.lib + + This difference is because MySQL++’s Debug + DLL and import library have a _d + suffix so you can have both in the same directory without + conflicts. + + + + You may want to study + examples\vstudio\mfc\mfc.vcproj + to see this in action. Note that some of the paths will + be different, because it can use relative paths for + mysqlpp.dll. + + + + + Using MySQL++ in a Windows Forms C++/CLI Project + + Before you start work on getting MySQL++ working with your + own program, you need to make some changes to the MySQL++ build + settings. Open mysqlpp.sln, then right-click + on the mysqlpp target and select Properties. Make the following + changes for both the Debug and Release configurations: + + + Under Configuration Properties | General, + change “Common Language Runtime support” to the + /clr setting. + + Under C/C++ | Code Generation, change + “Enable C++ Exceptions” from “Yes + (/EHsc)” to “Yes With SEH Exceptions + (/EHa)” + + + If you have already built MySQL++, be sure to perform a + complete rebuild after changing these options. The compiler + will emit several C4835 warnings after making those changes, + which are harmless when using the DLL with a C++/CLI + program, but which warn of real problems when using it with + unmanaged C++. This is why MySQL++’s Windows installer + (install.hta) offers the option to install + the CLR version into a separate directory; use it if you need + both managed and unmanaged versions installed! + + For the same reason, you might give some thought about + where you install mysqlpp.dll on your + end user’s machines when distributing your program. + My recommendation is to install it in the same directory as + the .exe file that uses it, rather than + installing into a system directory where it could conflict + with a mysqlpp.dll built with different + settings. + + Once you have MySQL++ built with CLR support, open your + program’s project. If you don’t already have a + project set up, open Visual Studio, say File | New | Project, + then choose Visual C++ | CLR | Windows Forms Application. + Go through the wizard setting up the project as you see + fit. + + The configuration process isn’t much different from + that for an MFC project, so go through the list above first. + Then, make the following changes particular to .NET and + C++/CLI: + + + Under Configuration Properties | General + change the setting from /clr:pure to /clr. (You need mixed + assembly support to allow a C++/CLI program to use a plain C++ + library like MySQL++.) + + For the Linker | Input settings, you + don’t need wsock32.lib. The mere + fact that you’re using .NET takes care of that dependency + for you. + + + In the MFC instructions above, it said that you need to + build it using the Multi-threaded DLL version of the C++ Runtime + Library. That’s not strictly true for MFC, but it’s + an absolute requirement for C++/CLI. See the Remarks in the + MSDN article on the /clr switch for details. + + You may want to study + examples\vstudio\wforms\wforms.vcproj + to see all this in action. Note that some of the + paths will be different, because it can use relative + paths for mysqlpp_d.dll and + mysqlpp.dll. + + + + + + Unixy Platforms: Linux, *BSD, OS X, Cygwin, Solaris... + + There are lots of ways to build programs on Unixy + platforms. We’ll cover just the most generic way + here, Makefiles. We’ll use a very + simple example so it’s clear how to translate this + to more sophisticated build systems such as GNU Autotools or + Bakefile. + + “Hello, world!” for MySQL++ might look something + like this: + + + + Here’s a Makefile for building + that program: + + + + The *FLAGS lines are where all of the + assumptions about file and path names are laid out. Probably at + least one of these assumptions isn’t true for your system, + and so will require changing. + + The trickiest line is the LDLIBS + one. MySQL++ programs need to get built against both the MySQL + and MySQL++ libraries, because MySQL++ is built on top of the + MySQL C API libraryThe MySQL C API library + is most commonly called libmysqlclient + on Unixy systems, though it is also known as Connector/C. + If you’re building a threaded program, use + -lmysqlclient_r instead of + -lmysqlclient here. (See for more details on building thread-aware + programs.) + + On some systems, the order of libraries in the + LDLIBS line is important: these linkers collect + symbols from right to left, so the rightmost library needs to + be the most generic. In this example, MySQL++ depends on MySQL, + so the MySQL C API library is rightmost. + + You might need to add more libraries to the + LDLIBS line. -lnsl, + -lz and -lm are + common. If you study how MySQL++ itself gets built on your system, + you can see what it uses, and emulate that. + + You may be wondering why we have used both + LDLIBS and LDFLAGS here. Some + Makefiles you have seen collect both types + of flags in a single variable. That can work if the variable + is used in the right place in the link command. However, this + particular Makefile is made with GNU make + in mind, and uses its standard rules implicitly. Those rules + are designed to use these two variables separately like this. + If you were writing your own compilation rules, you could write + them in such a way that you didn’t have to do this. + + Beyond that, we have a pretty vanilla + Makefile, thanks in large part to the fact + that the default make rules are fine for + such a simple program. + + + + + OS X + + + Makefiles + + The generic + Makefile instructions above + cover most of what you need to know about using Makefiles on + OS X. + + One thing that may trip you up on OS X is that it uses an + uncommon dynamic linkage system. The easiest way to cope with + this is to link your executables with the compiler, rather than + call ld directly. + + Another tricky bit on OS X is the concept of Universal + binaries. See README-Mac-OS-X.txt for + details on building a Universal version of the MySQL++ library, + if you need one. By default, you only get a version tuned for + the system type you build it on. + + + + Xcode + + I have no information on how to incorporate MySQL++ in + an Xcode project. Send a message to the MySQL++ mailing list + if you can help out here. + + + + + + MinGW + + + Makefiles + + The generic + Makefile instructions above apply + to MinGW’s version of GNU make as + well. You will have some differences due to the platform, so + here’s the adjusted Makefile: + + + + Note that I’ve used del + instead of rm in the clean target. In + the past, at least, MinGW make + had some funny rules about whether commands in target + rules would get run with sh.exe + or with cmd.exe. I can’t + currently get my installation of MinGW to do anything + but use sh.exe by default, but that + may be because I have Cygwin installed, which provides + sh.exe. This explains the first + line in the file, which overrides the default shell with + cmd.exe, purely to get consistent + behavior across platforms. If you knew all your platforms + would have a better shell, you’d probably want to use + that instead. + + Note the use of forward slashes in the path to the MySQL + Connector/C development files. GNU make + uses the backslash as an escape character, so you’d + have to double them if you’re unwilling to use forward + slashes. + + + + Third-Party MinGW IDEs (Dev-C++, Code::Blocks...) + + I have no information on how to do this. We’ve + received reports on the mailing list from people that have made + it work, but no specifics on what all needs to be done. The + Makefile discussion above should give you + some hints. + + + + + + Eclipse + + As far as I can tell, the simplest way to build a C++ project + with Eclipse is to set up a Makefile for it + as described above, then add an + external run configuration for your local make + tool. Get the project building from the command line with + make, then go to Run | External Tools | Open + External Tools Dialog and add a new launch configuration. + + For example, on my OS X system I use + /usr/bin/gnumake for the program location + and pick the project root with the Browse Workspace button to + set the working directory. + + ADDED doc/userman/intro.dbx Index: doc/userman/intro.dbx ================================================================== --- /dev/null +++ doc/userman/intro.dbx @@ -0,0 +1,123 @@ + + + + + Introduction + + MySQL++ is a powerful C++ wrapper for MySQL’s + C APIThe MySQL C API is also known as Connector/C.. + Its purpose is to make working with queries as easy as working with + STL containers. + + The latest version of MySQL++ can be found at the official web + site. + + Support for MySQL++ can be had on the mailing list. That + page hosts the mailing list archives, and tells you how you can + subscribe. + + + + A Brief History of MySQL++ + + MySQL++ was created in 1998 by Kevin Atkinson. It started + out MySQL-specific, but there were early efforts to try and + make it database-independent, and call it SQL++. This is where + the old library name “sqlplus” came from. This + is also why the old versions prefixed some class names with + “Mysql” but not others: the others were supposed to + be the database-independent parts. All of Kevin’s releases + had pre-1.0 version numbers. + + Then in 1999, MySQL + AB took over development of the library. In the beginning, + Monty + Widenius himself did some of the work, but later gave it + over to another MySQL employee, Sinisa Milivojevic. MySQL released + versions 1.0 and 1.1, and then Kevin gave over maintenance to + Sinisa officially with 1.2, and ceased to have any involvement + with the library’s maintenance. Sinisa went on to maintain + the library through 1.7.9, released in mid-2001. It seems to be + during this time that the dream of multiple-database compatibility + died, for obvious reasons. + + With version 1.7.9, MySQL++ went into a period of + stasis, lasting over three years. (Perhaps it was the + ennui and retrenchment following the collapse of the + bubble that caused them to lose interest.) During this + time, Sinisa ran the MySQL++ mailing list and supported its users, + but made no new releases. Contributed patches were either ignored + or put up on the MySQL++ web site for users to try, without any + official blessing. + + The biggest barrier to using MySQL++ during this period + is that the popular C++ compilers of 2001 weren’t all + that compatible with the C++ Standard. As a result, MySQL++ + used many nonstandard constructs, to allow for compatibility + with older compilers. Each new compiler released in the + following years increased compliance, either warning + about or rejecting code using pre-Standard constructs. + In particular, GCC + was emerging from the mess following the EGCS + fork during this time. The fork was healed officially + in 1999, but there’s always a delay of a few years between + the release of a new GCC and widespread adoption. The post-EGCS + versions of GCC were only beginning to become popular by 2001, + when development on MySQL++ halted. As a result, it became + increasingly difficult to get MySQL++ to build cleanly as newer + compilers came out. Since MySQL++ uses templates heavily, this + affected end user programs as well: MySQL++ code got included + directly in your program, so any warnings or errors it caused + became your program’s problem. + + As a result, most of the patches contributed to the MySQL++ + project during this period were to fix up standards compliance + issues. Because no one was bothering to officially test and bless + these patches, you ended up with the worst aspects of a bazaar + development model: complete freedom of development, but no guiding + hand to select from the good stuff and reject the rest. Many of the + patches were mutually incompatible. Some would build upon other + patches, so you had to apply them in the proper sequence. Others + did useful things, but didn’t give a fully functional copy of + MySQL++. Figuring out which patch(es) to use was an increasingly + frustrating exercise as the years wore on, and newer GCCs became + popular. + + In early August of 2004, Warren Young got fed up with this + situation and took over. He released 1.7.10 later that month, + which did little more than make the code build with GCC 3.3 without + warnings. Since then, with a little help from his friends on the + Net, MySQL++ has lost a lot of bugs, gained a lot of features, + gained a few more bugs, lost them again... MySQL++ is alive and + healthy now. + + + + + If You Have Questions... + + If you want to email someone to ask questions about + this library, we greatly prefer that you send mail to the + MySQL++ mailing + list. The mailing list is archived, so if you have + questions, do a search to see if the question has been asked + before. + + You may find people’s individual email addresses in various + files within the MySQL++ distribution. Please do not send mail + to them unless you are sending something that is inherently + personal. Not all of the principal developers of MySQL++ are still + active in its development; those who have dropped out have no wish + to be bugged about MySQL++. Those of us still active in MySQL++ + development monitor the mailing list, so you aren’t getting any + extra “coverage” by sending messages to additional + email addresses. + + ADDED doc/userman/licenses.dbx Index: doc/userman/licenses.dbx ================================================================== --- /dev/null +++ doc/userman/licenses.dbx @@ -0,0 +1,685 @@ + + + + + Licensing + + The primary copyright holders on the MySQL++ library and its + documentation are Kevin Atkinson (1998), MySQL AB (1999 through 2001) + and Educational Technology Resources, Inc. (2004 through the date of + this writing). There are other contributors, who also retain + copyrights on their additions; see the ChangeLog file in the MySQL++ + distribution tarball for details. + + The MySQL++ library and its Reference Manual are released under + the GNU Lesser General Public License (LGPL), reproduced below. + + The MySQL++ User Manual — excepting some example code from + the library reproduced within it — is offered under a license + closely based on the Linux Documentation Project License (LDPL) v2.0, + included below. (The MySQL++ documentation isn’t actually part + of the Linux Documentation Project, so the main changes are to + LDP-related language. Also, generic language such as + “author’s (or authors’)” has been replaced + with specific language, because the license applies to only this one + document.) + + These licenses basically state that you are free to use, + distribute and modify these works, whether for personal or commercial + purposes, as long as you grant the same rights to those you distribute + the works to, whether you changed them or not. See the licenses below + for full details. + + + + + GNU Lesser General Public License + Version 2.1, February 1999 + + Copyright (C) 1991, 1999 Free Software Foundation, Inc. 59 + Temple Place, Suite 330, Boston, MA 02111-1307 USA Everyone is + permitted to copy and distribute verbatim copies of this license + document, but changing it is not allowed. + + [This is the first released version of the Lesser GPL. It + also counts as the successor of the GNU Library Public License, + version 2, hence the version number 2.1.] + + + Preamble + + The licenses for most software are designed to take away + your freedom to share and change it. By contrast, the GNU General + Public Licenses are intended to guarantee your freedom to share + and change free software--to make sure the software is free for + all its users. + + This license, the Lesser General Public License, applies to + some specially designated software packages--typically + libraries--of the Free Software Foundation and other authors who + decide to use it. You can use it too, but we suggest you first + think carefully about whether this license or the ordinary General + Public License is the better strategy to use in any particular + case, based on the explanations below. + + When we speak of free software, we are referring to freedom + of use, not price. Our General Public Licenses are designed to + make sure that you have the freedom to distribute copies of free + software (and charge for this service if you wish); that you + receive source code or can get it if you want it; that you can + change the software and use pieces of it in new free programs; and + that you are informed that you can do these things. + + To protect your rights, we need to make restrictions that + forbid distributors to deny you these rights or to ask you to + surrender these rights. These restrictions translate to certain + responsibilities for you if you distribute copies of the library + or if you modify it. + + For example, if you distribute copies of the library, + whether gratis or for a fee, you must give the recipients all the + rights that we gave you. You must make sure that they, too, + receive or can get the source code. If you link other code with + the library, you must provide complete object files to the + recipients, so that they can relink them with the library after + making changes to the library and recompiling it. And you must + show them these terms so they know their rights. + + We protect your rights with a two-step method: (1) we + copyright the library, and (2) we offer you this license, which + gives you legal permission to copy, distribute and/or modify the + library. + + To protect each distributor, we want to make it very clear + that there is no warranty for the free library. Also, if the + library is modified by someone else and passed on, the recipients + should know that what they have is not the original version, so + that the original author’s reputation will not be affected + by problems that might be introduced by others. + + Finally, software patents pose a constant threat to the + existence of any free program. We wish to make sure that a + company cannot effectively restrict the users of a free program by + obtaining a restrictive license from a patent holder. Therefore, + we insist that any patent license obtained for a version of the + library must be consistent with the full freedom of use specified + in this license. + + Most GNU software, including some libraries, is covered by + the ordinary GNU General Public License. This license, the GNU + Lesser General Public License, applies to certain designated + libraries, and is quite different from the ordinary General Public + License. We use this license for certain libraries in order to + permit linking those libraries into non-free programs. + + When a program is linked with a library, whether statically + or using a shared library, the combination of the two is legally + speaking a combined work, a derivative of the original library. + The ordinary General Public License therefore permits such linking + only if the entire combination fits its criteria of freedom. The + Lesser General Public License permits more lax criteria for + linking other code with the library. + + We call this license the “Lesser” General Public + License because it does Less to protect the user’s freedom + than the ordinary General Public License. It also provides other + free software developers Less of an advantage over competing + non-free programs. These disadvantages are the reason we use the + ordinary General Public License for many libraries. However, the + Lesser license provides advantages in certain special + circumstances. + + For example, on rare occasions, there may be a special need + to encourage the widest possible use of a certain library, so that + it becomes a de-facto standard. To achieve this, non-free + programs must be allowed to use the library. A more frequent case + is that a free library does the same job as widely used non-free + libraries. In this case, there is little to gain by limiting the + free library to free software only, so we use the Lesser General + Public License. + + In other cases, permission to use a particular library in + non-free programs enables a greater number of people to use a + large body of free software. For example, permission to use the + GNU C Library in non-free programs enables many more people to use + the whole GNU operating system, as well as its variant, the + GNU/Linux operating system. + + Although the Lesser General Public License is Less + protective of the users’ freedom, it does ensure that the + user of a program that is linked with the Library has the freedom + and the wherewithal to run that program using a modified version + of the Library. + + The precise terms and conditions for copying, distribution + and modification follow. Pay close attention to the difference + between a “work based on the library” and a + “work that uses the library”. The former contains + code derived from the library, whereas the latter must be combined + with the library in order to run. + + + + + GNU LESSER GENERAL PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND + MODIFICATION + + 0. This License Agreement applies to any software library or + other program which contains a notice placed by the copyright + holder or other authorized party saying it may be distributed + under the terms of this Lesser General Public License (also called + “this License”). Each licensee is addressed as + “you”. + + A “library” means a collection of software + functions and/or data prepared so as to be conveniently linked + with application programs (which use some of those functions and + data) to form executables. + + The “Library”, below, refers to any such + software library or work which has been distributed under these + terms. A “work based on the Library” means either the + Library or any derivative work under copyright law: that is to + say, a work containing the Library or a portion of it, either + verbatim or with modifications and/or translated straightforwardly + into another language. (Hereinafter, translation is included + without limitation in the term “modification”.) + + “Source code” for a work means the preferred + form of the work for making modifications to it. For a library, + complete source code means all the source code for all modules it + contains, plus any associated interface definition files, plus the + scripts used to control compilation and installation of the + library. + + Activities other than copying, distribution and modification + are not covered by this License; they are outside its scope. The + act of running a program using the Library is not restricted, and + output from such a program is covered only if its contents + constitute a work based on the Library (independent of the use of + the Library in a tool for writing it). Whether that is true + depends on what the Library does and what the program that uses + the Library does. + + 1. You may copy and distribute verbatim copies of the + Library’s complete source code as you receive it, in any + medium, provided that you conspicuously and appropriately publish + on each copy an appropriate copyright notice and disclaimer of + warranty; keep intact all the notices that refer to this License + and to the absence of any warranty; and distribute a copy of this + License along with the Library. + + You may charge a fee for the physical act of transferring a + copy, and you may at your option offer warranty protection in + exchange for a fee. + + 2. You may modify your copy or copies of the Library or any + portion of it, thus forming a work based on the Library, and copy + and distribute such modifications or work under the terms of + Section 1 above, provided that you also meet all of these + conditions: + +
+ a) The modified work must itself be a software + library. + + b) You must cause the files modified to carry prominent + notices stating that you changed the files and the date of any + change. + + c) You must cause the whole of the work to be licensed at + no charge to all third parties under the terms of this + License. + + d) If a facility in the modified Library refers to a + function or a table of data to be supplied by an application + program that uses the facility, other than as an argument passed + when the facility is invoked, then you must make a good faith + effort to ensure that, in the event an application does not + supply such function or table, the facility still operates, and + performs whatever part of its purpose remains meaningful. + + (For example, a function in a library to compute square + roots has a purpose that is entirely well-defined independent of + the application. Therefore, Subsection 2d requires that any + application-supplied function or table used by this function + must be optional: if the application does not supply it, the + square root function must still compute square roots.) +
+ + These requirements apply to the modified work as a whole. + If identifiable sections of that work are not derived from the + Library, and can be reasonably considered independent and separate + works in themselves, then this License, and its terms, do not + apply to those sections when you distribute them as separate + works. But when you distribute the same sections as part of a + whole which is a work based on the Library, the distribution of + the whole must be on the terms of this License, whose permissions + for other licensees extend to the entire whole, and thus to each + and every part regardless of who wrote it. + + Thus, it is not the intent of this section to claim rights + or contest your rights to work written entirely by you; rather, + the intent is to exercise the right to control the distribution of + derivative or collective works based on the Library. + + In addition, mere aggregation of another work not based on + the Library with the Library (or with a work based on the Library) + on a volume of a storage or distribution medium does not bring the + other work under the scope of this License. + + 3. You may opt to apply the terms of the ordinary GNU + General Public License instead of this License to a given copy of + the Library. To do this, you must alter all the notices that + refer to this License, so that they refer to the ordinary GNU + General Public License, version 2, instead of to this License. + (If a newer version than version 2 of the ordinary GNU General + Public License has appeared, then you can specify that version + instead if you wish.) Do not make any other change in these + notices. + + Once this change is made in a given copy, it is irreversible + for that copy, so the ordinary GNU General Public License applies + to all subsequent copies and derivative works made from that + copy. + + This option is useful when you wish to copy part of the code + of the Library into a program that is not a library. + + 4. You may copy and distribute the Library (or a portion or + derivative of it, under Section 2) in object code or executable + form under the terms of Sections 1 and 2 above provided that you + accompany it with the complete corresponding machine-readable + source code, which must be distributed under the terms of Sections + 1 and 2 above on a medium customarily used for software + interchange. + + If distribution of object code is made by offering access to + copy from a designated place, then offering equivalent access to + copy the source code from the same place satisfies the requirement + to distribute the source code, even though third parties are not + compelled to copy the source along with the object code. + + 5. A program that contains no derivative of any portion of + the Library, but is designed to work with the Library by being + compiled or linked with it, is called a “work that uses the + Library”. Such a work, in isolation, is not a derivative + work of the Library, and therefore falls outside the scope of this + License. + + However, linking a “work that uses the Library” + with the Library creates an executable that is a derivative of the + Library (because it contains portions of the Library), rather than + a “work that uses the library”. The executable is + therefore covered by this License. Section 6 states terms for + distribution of such executables. + + When a “work that uses the Library” uses + material from a header file that is part of the Library, the + object code for the work may be a derivative work of the Library + even though the source code is not. Whether this is true is + especially significant if the work can be linked without the + Library, or if the work is itself a library. The threshold for + this to be true is not precisely defined by law. + + If such an object file uses only numerical parameters, data + structure layouts and accessors, and small macros and small inline + functions (ten lines or less in length), then the use of the + object file is unrestricted, regardless of whether it is legally a + derivative work. (Executables containing this object code plus + portions of the Library will still fall under Section 6.) + + Otherwise, if the work is a derivative of the Library, you + may distribute the object code for the work under the terms of + Section 6. Any executables containing that work also fall under + Section 6, whether or not they are linked directly with the + Library itself. + + 6. As an exception to the Sections above, you may also + combine or link a “work that uses the Library” with + the Library to produce a work containing portions of the Library, + and distribute that work under terms of your choice, provided that + the terms permit modification of the work for the customer’s + own use and reverse engineering for debugging such + modifications. + + You must give prominent notice with each copy of the work + that the Library is used in it and that the Library and its use + are covered by this License. You must supply a copy of this + License. If the work during execution displays copyright notices, + you must include the copyright notice for the Library among them, + as well as a reference directing the user to the copy of this + License. Also, you must do one of these things: + +
+ a) Accompany the work with the complete corresponding + machine-readable source code for the Library including whatever + changes were used in the work (which must be distributed under + Sections 1 and 2 above); and, if the work is an executable + linked with the Library, with the complete machine-readable + “work that uses the Library”, as object code and/or + source code, so that the user can modify the Library and then + relink to produce a modified executable containing the modified + Library. (It is understood that the user who changes the + contents of definitions files in the Library will not + necessarily be able to recompile the application to use the + modified definitions.) + + b) Use a suitable shared library mechanism for linking + with the Library. A suitable mechanism is one that (1) uses at + run time a copy of the library already present on the + user’s computer system, rather than copying library + functions into the executable, and (2) will operate properly + with a modified version of the library, if the user installs + one, as long as the modified version is interface-compatible + with the version that the work was made with. + + c) Accompany the work with a written offer, valid for at + least three years, to give the same user the materials specified + in Subsection 6a, above, for a charge no more than the cost of + performing this distribution. + + d) If distribution of the work is made by offering access + to copy from a designated place, offer equivalent access to copy + the above specified materials from the same place. + + e) Verify that the user has already received a copy of + these materials or that you have already sent this user a + copy. +
+ + For an executable, the required form of the “work that + uses the Library” must include any data and utility programs + needed for reproducing the executable from it. However, as a + special exception, the materials to be distributed need not + include anything that is normally distributed (in either source or + binary form) with the major components (compiler, kernel, and so + on) of the operating system on which the executable runs, unless + that component itself accompanies the executable. + + It may happen that this requirement contradicts the license + restrictions of other proprietary libraries that do not normally + accompany the operating system. Such a contradiction means you + cannot use both them and the Library together in an executable + that you distribute. + + 7. You may place library facilities that are a work based on + the Library side-by-side in a single library together with other + library facilities not covered by this License, and distribute + such a combined library, provided that the separate distribution + of the work based on the Library and of the other library + facilities is otherwise permitted, and provided that you do these + two things: + +
+ a) Accompany the combined library with a copy of the same + work based on the Library, uncombined with any other library + facilities. This must be distributed under the terms of the + Sections above. + + b) Give prominent notice with the combined library of the + fact that part of it is a work based on the Library, and + explaining where to find the accompanying uncombined form of the + same work. +
+ + 8. You may not copy, modify, sublicense, link with, or + distribute the Library except as expressly provided under this + License. Any attempt otherwise to copy, modify, sublicense, link + with, or distribute the Library is void, and will automatically + terminate your rights under this License. However, parties who + have received copies, or rights, from you under this License will + not have their licenses terminated so long as such parties remain + in full compliance. + + 9. You are not required to accept this License, since you + have not signed it. However, nothing else grants you permission + to modify or distribute the Library or its derivative works. + These actions are prohibited by law if you do not accept this + License. Therefore, by modifying or distributing the Library (or + any work based on the Library), you indicate your acceptance of + this License to do so, and all its terms and conditions for + copying, distributing or modifying the Library or works based on + it. + + 10. Each time you redistribute the Library (or any work + based on the Library), the recipient automatically receives a + license from the original licensor to copy, distribute, link with + or modify the Library subject to these terms and conditions. You + may not impose any further restrictions on the recipients’ + exercise of the rights granted herein. You are not responsible + for enforcing compliance by third parties with this + License. + + 11. If, as a consequence of a court judgment or allegation + of patent infringement or for any other reason (not limited to + patent issues), conditions are imposed on you (whether by court + order, agreement or otherwise) that contradict the conditions of + this License, they do not excuse you from the conditions of this + License. If you cannot distribute so as to satisfy simultaneously + your obligations under this License and any other pertinent + obligations, then as a consequence you may not distribute the + Library at all. For example, if a patent license would not permit + royalty-free redistribution of the Library by all those who + receive copies directly or indirectly through you, then the only + way you could satisfy both it and this License would be to refrain + entirely from distribution of the Library. + + If any portion of this section is held invalid or + unenforceable under any particular circumstance, the balance of + the section is intended to apply, and the section as a whole is + intended to apply in other circumstances. + + It is not the purpose of this section to induce you to + infringe any patents or other property right claims or to contest + validity of any such claims; this section has the sole purpose of + protecting the integrity of the free software distribution system + which is implemented by public license practices. Many people + have made generous contributions to the wide range of software + distributed through that system in reliance on consistent + application of that system; it is up to the author/donor to decide + if he or she is willing to distribute software through any other + system and a licensee cannot impose that choice. + + This section is intended to make thoroughly clear what is + believed to be a consequence of the rest of this License. + + 12. If the distribution and/or use of the Library is + restricted in certain countries either by patents or by + copyrighted interfaces, the original copyright holder who places + the Library under this License may add an explicit geographical + distribution limitation excluding those countries, so that + distribution is permitted only in or among countries not thus + excluded. In such case, this License incorporates the limitation + as if written in the body of this License. + + 13. The Free Software Foundation may publish revised and/or + new versions of the Lesser General Public License from time to + time. Such new versions will be similar in spirit to the present + version, but may differ in detail to address new problems or + concerns. + + Each version is given a distinguishing version number. If + the Library specifies a version number of this License which + applies to it and “any later version”, you have the + option of following the terms and conditions either of that + version or of any later version published by the Free Software + Foundation. If the Library does not specify a license version + number, you may choose any version ever published by the Free + Software Foundation. + + 14. If you wish to incorporate parts of the Library into + other free programs whose distribution conditions are incompatible + with these, write to the author to ask for permission. For + software which is copyrighted by the Free Software Foundation, + write to the Free Software Foundation; we sometimes make + exceptions for this. Our decision will be guided by the two goals + of preserving the free status of all derivatives of our free + software and of promoting the sharing and reuse of software + generally. + + NO WARRANTY + + 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS + NO WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE + LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT + HOLDERS AND/OR OTHER PARTIES PROVIDE THE LIBRARY “AS + IS” WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR + IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE + RISK AS TO THE QUALITY AND PERFORMANCE OF THE LIBRARY IS WITH YOU. + SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL + NECESSARY SERVICING, REPAIR OR CORRECTION. + + 16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED + TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO + MAY MODIFY AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE + LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, + INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR + INABILITY TO USE THE LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF + DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU + OR THIRD PARTIES OR A FAILURE OF THE LIBRARY TO OPERATE WITH ANY + OTHER SOFTWARE), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN + ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. + + END OF TERMS AND CONDITIONS +
+ + + + How to Apply These Terms to Your New Libraries + + If you develop a new library, and you want it to be of the + greatest possible use to the public, we recommend making it free + software that everyone can redistribute and change. You can do so + by permitting redistribution under these terms (or, alternatively, + under the terms of the ordinary General Public License). + + To apply these terms, attach the following notices to the + library. It is safest to attach them to the start of each source + file to most effectively convey the exclusion of warranty; and + each file should have at least the “copyright” line + and a pointer to where the full notice is found. + +
+ <one line to give the library’s name and a brief + idea of what it does.> + + Copyright © <year> <name of + author> + + This library is free software; you can redistribute it + and/or modify it under the terms of the GNU Lesser General + Public License as published by the Free Software Foundation; + either version 2.1 of the License, or (at your option) any later + version. + + This library is distributed in the hope that it will be + useful, but WITHOUT ANY WARRANTY; without even the implied + warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + See the GNU Lesser General Public License for more + details. + + You should have received a copy of the GNU Lesser General + Public License along with this library; if not, write to the + Free Software Foundation, Inc., 59 Temple Place, Suite 330, + Boston, MA 02111-1307 USA +
+ + Also add information on how to contact you by electronic and + paper mail. + + You should also get your employer (if you work as a + programmer) or your school, if any, to sign a “copyright + disclaimer” for the library, if necessary. Here is a + sample; alter the names: + +
+ Yoyodyne, Inc., hereby disclaims all copyright interest in + the library `Frob' (a library for tweaking knobs) written by + James Random Hacker. + + <signature of Ty Coon>, 1 April 1990 + + Ty Coon, President of Vice +
+ + That’s all there is to it! +
+
+ + + + + MySQL++ User Manual License + + + I. COPYRIGHT + + The copyright to the MySQL++ User Manual is owned by its + authors. + + + + II. LICENSE + + The MySQL++ User Manual may be reproduced and distributed in + whole or in part, in any medium physical or electronic, provided + that this license notice is displayed in the reproduction. + Commercial redistribution is permitted and encouraged. Thirty days + advance notice via email to the authors of redistribution is + appreciated, to give the authors time to provide updated + documents. + + + A. REQUIREMENTS OF MODIFIED WORKS + + All modified documents, including translations, + anthologies, and partial documents, must meet the following + requirements: + + + The modified version must be labeled as + such. + + The person making the modifications must be + identified. + + Acknowledgement of the original author must be + retained. + + The location of the original unmodified + document be identified. + + The original authors’ names may not be + used to assert or imply endorsement of the resulting document + without the original authors’ + permission. + + + In addition it is requested that: + + + The modifications (including deletions) be + noted. + + The authors be notified by email of the + modification in advance of redistribution, if an email address + is provided in the document. + + + Mere aggregation of the MySQL++ User Manual with other + documents or programs on the same media shall not cause this + license to apply to those other works. + + All translations, derivative documents, or modified + documents that incorporate the MySQL++ User Manual may not have + more restrictive license terms than these, except that you may + require distributors to make the resulting document available in + source format. + + + +
Index: doc/userman/mktxt ================================================================== --- doc/userman/mktxt +++ doc/userman/mktxt @@ -2,13 +2,18 @@ # Script to convert C++ source files to a text format, with 4 spaces for # every tab, and with the leading block comment removed. Used to # reformat the example programs so they can be xincluded directly into # the DocBook during XSLT processing. -SRCFILE=`echo ../../examples/$1 | sed -e s/txt/cpp/` +TXTFILE=$1 +SRCFILE=`echo ../../examples/$TXTFILE | sed -e s/\\\\.txt/.cpp/` +if [ ! -e $SRCFILE ] +then + SRCFILE=`echo ../../examples/$TXTFILE | sed -e s/\\\\.txt/.h/` +fi CLINE=`grep -n '\*\*/' $SRCFILE |cut -f1 -d:` -LINE=`echo $CLINE + 1 |bc` +LINE=`echo $CLINE + 2 |bc` -#echo Converting $SRCFILE to $1, starting at line $LINE... +#echo Converting $SRCFILE to $TXTFILE, starting at line $LINE... -expand -t4 $SRCFILE | tail -n +$LINE > $1 +expand -t4 $SRCFILE | tail -n +$LINE > $TXTFILE ADDED doc/userman/overview.dbx Index: doc/userman/overview.dbx ================================================================== --- /dev/null +++ doc/userman/overview.dbx @@ -0,0 +1,211 @@ + + + + + Overview + + MySQL++ has a lot of complexity and power to cope with the + variety of ways people use databases, but at bottom it doesn’t + work all that differently than other database access APIs. The usage + pattern looks like this: + + + Open the connection + + Form and execute the query + + If successful, iterate through the result + set + + Else, deal with errors + + + Each of these steps corresponds to a MySQL++ class or class + hierarchy. An overview of each follows. + + + + The Connection Object + + A object manages the + connection to the MySQL server. You need at least one of these + objects to do anything. Because the other MySQL++ objects your + program will use often depend (at least indirectly) on the + Connection instance, the + Connection object needs to live at least as + long as all other MySQL++ objects in your program. + + MySQL supports many different types of data connection between + the client and the server: TCP/IP, Unix domain sockets, and Windows + named pipes. The generic Connection class + supports all of these, figuring out which one you mean based on the + parameters you pass to + Connection::connect(). But if you know in + advance that your program only needs one particular connection type, + there are subclasses with simpler interfaces. For example, + there’s if you + know your program will always use a networked database + server. + + + + + The Query Object + + Most often, you create SQL queries using a object created by the + Connection object. + + Query acts as a standard C++ output + stream, so you can write data to it like you would to + std::cout or + std::ostringstream. This is the most C++ish + way MySQL++ provides for building up a query string. The library + includes stream + manipulators that are type-aware so it’s easy to build + up syntactically-correct SQL. + + Query also has a feature called which work something like C’s + printf() function: you set up a fixed query + string with tags inside that indicate where to insert the variable + parts. If you have multiple queries that are structurally similar, + you simply set up one template query, and use that in the various + locations of your program. + + A third method for building queries is to use + Query with SSQLS. This feature lets you create C++ + structures that mirror your database schemas. These in turn give + Query the information it needs to build many + common SQL queries for you. It can INSERT, + REPLACE and UPDATE rows in a + table given the data in SSQLS form. It can also generate + SELECT * FROM SomeTable queries and store the + results as an STL collection of SSQLSes. + + + + + Result Sets + + The field data in a result set are stored in a special + std::string-like class called . This class has conversion operators + that let you automatically convert these objects to any of the basic + C data types. Additionally, MySQL++ defines classes like , which you can initialize from a + MySQL DATETIME string. These automatic + conversions are protected against bad conversions, and can either + set a warning flag or throw an exception, depending on how you set + the library up. + + As for the result sets as a whole, MySQL++ has a number of + different ways of representing them: + + + Queries That Do Not Return Data + + Not all SQL queries return data. An example is + CREATE TABLE. For these types of queries, there + is a special result type () that simply reports the state resulting from + the query: whether the query was successful, how many rows it + impacted (if any), etc. + + + + Queries That Return Data: MySQL++ Data Structures + + The most direct way to retrieve a result set is to use + Query::store(). This returns a object, which derives + from std::vector<mysqlpp::Row>, + making it a random-access container of s. In turn, each Row object is + like a std::vector of + String objects, one for each field in the + result set. Therefore, you can treat + StoreQueryResult as a two-dimensional + array: you can get the 5th field on the 2nd row by simply saying + result[1][4]. You can also access row + elements by field name, like this: + result[2]["price"]. + + A less direct way of working with query results is to use + Query::use(), which returns a object. This class acts + like an STL input iterator rather than a + std::vector: you walk through your result + set processing one row at a time, always going forward. You + can’t seek around in the result set, and you can’t + know how many results are in the set until you find the end. In + payment for that inconvenience, you get better memory efficiency, + because the entire result set doesn’t need to be stored in + RAM. This is very useful when you need large result sets. + + + + Queries That Return Data: Specialized SQL + Structures + + Accessing results through MySQL++’s data structures is + a pretty low level of abstraction. It’s better than using + the MySQL C API, but not by much. You can elevate things a little + closer to the level of the problem space by using the SSQLS feature. This lets you define C++ + structures that match the table structures in your database + schema. In addition, it’s easy to use SSQLSes with regular + STL containers (and thus, algorithms) so you don’t have to + deal with the quirks of MySQL++’s data structures. + + The advantage of this method is that your program will + require very little embedded SQL code. You can simply execute a + query, and receive your results as C++ data structures, which can + be accessed just as you would any other structure. The results can + be accessed through the Row object, or you can ask the library to + dump the results into an STL container — sequential or + set-associative, it doesn’t matter — for you. Consider + this: + + +vector<stock> v; +query << "SELECT * FROM stock"; +query.storein(v); +for (vector<stock>::iterator it = v.begin(); it != v.end(); ++it) { + cout << "Price: " << it->price << endl; +} + + Isn’t that slick? + + If you don’t want to create SSQLSes to match your + table structures, as of MySQL++ v3 you can now use + Row here instead: + + +vector<mysqlpp::Row> v; +query << "SELECT * FROM stock"; +query.storein(v); +for (vector<mysqlpp::Row>::iterator it = v.begin(); it != v.end(); ++it) { + cout << "Price: " << it->at("price") << endl; +} + + It lacks a certain syntactic elegance, but it has its + uses. + + + + + + Exceptions + + By default, the library throws + whenever it encounters an error. You can ask the library to set + an error flag instead, if you like, but the exceptions carry more + information. Not only do they include a string member telling you + why the exception was thrown, there are several exception types, + so you can distinguish between different error types within a + single try block. + + ADDED doc/userman/section-template.dbx Index: doc/userman/section-template.dbx ================================================================== --- /dev/null +++ doc/userman/section-template.dbx @@ -0,0 +1,9 @@ + + + + + SECTION TITLE + + FIRST PARAGRAPH + ADDED doc/userman/ssqls.dbx Index: doc/userman/ssqls.dbx ================================================================== --- /dev/null +++ doc/userman/ssqls.dbx @@ -0,0 +1,1048 @@ + + + + + Specialized SQL Structures + + The Specialized SQL Structure (SSQLS) feature lets you easily + define C++ structures that match the form of your SQL tables. At the + most superficial level, an SSQLS has a member variable corresponding + to each field in the SQL table. But, an SSQLS also has several + methods, operators, and data members used by MySQL++’s internals to + provide neat functionality, which we cover in this chapter. + + You define SSQLSes using the macros defined in + ssqls.h. This is the only MySQL++ header not + automatically included for you by mysql++.h. You + have to include it in code modules that use the SSQLS feature. + + + + sql_create + + Let’s say you have the following SQL table: + + +CREATE TABLE stock ( + item CHAR(30) NOT NULL, + num BIGINT NOT NULL, + weight DOUBLE NOT NULL, + price DECIMAL(6,2) NOT NULL, + sdate DATE NOT NULL, + description MEDIUMTEXT NULL) + + You can create a C++ structure corresponding to this table + like so: + + +sql_create_6(stock, 1, 6, + mysqlpp::sql_char, item, + mysqlpp::sql_bigint, num, + mysqlpp::sql_double, weight, + mysqlpp::sql_decimal, price, + mysqlpp::sql_date, sdate, + mysqlpp::Null<mysqlpp::sql_mediumtext>, description) + + This declares the stock structure, + which has a data member for each SQL column, using the same names. + The structure also has a number of member functions, operators and + hidden data members, but we won’t go into that just + now. + + The parameter before each field name in the + sql_create_# call is the C++ data type that + will be used to hold that value in the SSQLS. While you could use + plain old C++ data types for most of these columns (long + int instead of mysqlpp::sql_bigint, for + example) it’s best to use the + MySQL++ typedefs. + + Sometimes you have no choice but to use special MySQL++ + data types to fully express the database schema. Consider + the description field. MySQL++’s + sql_mediumtext type is just an alias for + std::string, since we don’t need anything + fancier to hold a SQL MEDIUMTEXT value. + It’s the SQL NULL attribute that causes trouble: + it has no equivalent in the C++ + type system. MySQL++ offers the template, which bridges this difference between the + two type systems. + + The general format of this macro is: + + +sql_create_#(NAME, COMPCOUNT, SETCOUNT, TYPE1, ITEM1, ... TYPE#, ITEM#) + + where # is the number of member variables, + NAME is the name of the structure you wish to + create, TYPEx is the type of a member + variable, and ITEMx is that variable’s + name. + + The COMPCOUNT and + SETCOUNT arguments are described in the next + section. + + + + + SSQLS Comparison and Initialization + + The sql_create_# macro adds member + functions and operators to each SSQLS that allow you to compare one + SSQLS instance to another. These functions compare the first + COMPCOUNT fields in the structure. In the + example above, COMPCOUNT is 1, so only the + item field will be checked when comparing two + stock structures. + + This feature works best when your table’s + “key” fields are the first ones in the SSQLS and + you set COMPCOUNT equal to the number + of key fields. That way, a check for equality between two SSQLS + structures in your C++ code will give the same results as a check + for equality in SQL. + + COMPCOUNT must be at least 1. The + current implementation of sql_create_# cannot + create an SSQLS without comparison member functions. + + Because our stock structure + is less-than-comparable, you can use it in STL algorithms + and containers that require this, such as STL’s associative + containers: + + +std::set<stock> result; +query.storein(result); +cout << result.lower_bound(stock("Hamburger"))->item << endl; + + This will print the first item in the result set that begins + with “Hamburger.” + + The third parameter to sql_create_# is + SETCOUNT. If this is nonzero, it adds an + initialization constructor and a set() member + function taking the given number of arguments, for setting the first + N fields of the structure. For example, you + could change the above example like so: + + +sql_create_6(stock, 1, 2, + mysqlpp::sql_char, item, + mysqlpp::sql_bigint, num, + mysqlpp::sql_double, weight, + mysqlpp::sql_decimal, price, + mysqlpp::sql_date, sdate, + mysqlpp::Null<mysqlpp::sql_mediumtext>, description) + +stock foo("Hotdog", 52); + + In addition to this 2-parameter constructor, this version + of the stock SSQLS will have a similar + 2-parameter set() member function. + + The COMPCOUNT and + SETCOUNT values cannot be equal. If they + are, the macro will generate two initialization constructors with + identical parameter lists, which is illegal in C++. You might be + asking, why does there need to be a constructor for comparison to + begin with? It’s often convenient to be able to say something + like x == stock("Hotdog"). This requires + that there be a constructor taking COMPCOUNT + arguments to create the temporary stock + instance used in the comparison. + + This limitation is not a problem in practice. If you + want the same number of parameters in the initialization + constructor as the number of fields used in comparisons, + pass 0 for SETCOUNT. This suppresses + the duplicate constructor you’d get if you used the + COMPCOUNT value instead. This is most + useful in very small SSQLSes, since it’s easier for the + number of key fields to equal the number of fields you want to + compare on: + + +sql_create_1(stock_item, 1, 0, mysqlpp::sql_char, item) + + + + + Retrieving data + + Let’s put SSQLS to use. This is + examples/ssqls1.cpp: + + + + Here is the stock.h header used by that example, and by + several others below: + + + + This example produces the same output as + simple1.cpp (see ), + but it uses higher-level data structures paralleling the + database schema instead of MySQL++’s lower-level + generic data structures. It also uses MySQL++’s for error handling instead of doing + everything inline. For small example programs like these, the + overhead of SSQLS and exceptions doesn’t pay off very + well, but in a real program, they end up working much better + than hand-rolled code. + + Notice that we are only pulling a single column from the + stock table, but we are storing the rows in a + std::vector<stock>. It may strike you as + inefficient to have five unused fields per record. It’s + easily remedied by defining a subset SSQLS: + + +sql_create_1(stock_subset, + 1, 0, + string, item) + +vector<stock_subset> res; +query.storein(res); +// ...etc... + + MySQL++ is flexible about populating + SSQLSes.Programs built against versions of MySQL++ + prior to 3.0 would crash at almost any mismatch between the database + schema and the SSQLS definition. It’s no longer necessary to + keep the data design in lock-step between the client and database + server. A mismatch can result in data loss, but not a + crash. It works much like the Web, a design + that’s enabled the development of the largest distributed + system in the world. Just as a browser ignores tags and attributes + it doesn’t understand, you can populate an SSQLS from a query + result set containing columns that don’t exist in the SSQLS. + And as a browser uses sensible defaults when the page doesn’t + give explicit values, you can have an SSQLS with more fields defined + than are in the query result set, and these SSQLS fields will get + default values. (Zero for numeric types, false for + bool, and a type-specific default for anything more + complex, like mysqlpp::DateTime.) + + In more concrete terms, the example above is able to + populate the stock objects using as + much information as it has, and leave the remaining fields at + their defaults. Conversely, you could also stuff the results + of SELECT * FROM stock into + the stock_subset SSQLS declared above; + the extra fields would just be ignored. + + We’re trading run-time efficiency for flexibility + here, usually the right thing in a distributed system. Since MySQL + is a networked database server, many uses of it will qualify as + distributed systems. You can’t count on being able to update + both the server(s) and all the clients at the same time, so you + have to make them flexible enough to cope with differences while + the changes propagate. As long as the new database schema + isn’t too grossly different from the old, your programs + should continue to run until you get around to updating them to + use the new schema. + + There’s a danger that this quiet coping behavior + may mask problems, but considering that the previous behavior + was for the program to crash when the database schema got out + of synch with the SSQLS definition, it’s likely to be + taken as an improvement. + + + + + Adding data + + MySQL++ offers several ways to insert data in SSQLS form + into a database table. + + + Inserting a Single Row + + The simplest option is to insert a single row at a + time. This is examples/ssqls2.cpp: + + + + That’s all there is to it! MySQL++ even takes care + of quoting and escaping the + data when building queries from SSQLS structures. It’s + efficient, too: MySQL++ is smart enough to quote and escape + data only for those data types that actually require it. + + + + Inserting Many Rows + + Inserting a single row is useful, to be sure, + but you might want to be able to insert many SSQLSes or + Row objects at once. MySQL++ knows + how to do that, too, sparing you the necessity of writing + the loop. Plus, MySQL++ uses an optimized implementation of + this algorithm, packing everything into a single SQL query, + eliminating the overhead of multiple calls between the + client and server. It’s just a different overload of + insert(), which accepts a pair of + iterators into an STL container, inserting every row in that + range: + + vector<stock> lots_of_stuff; +...populate the vector somehow... +query.insert(lots_of_stuff.begin(), lots_of_stuff.end()).execute(); + + By the way, notice that you can chain + Query operations like in the last line + above, because its methods return *this where + that makes sense. + + + + Working Around MySQL’s Packet Size Limit + + The two-iterator form of insert() + has an associated risk: MySQL has a limit on the size of the + SQL query it will process. The default limit is 1 MB. You + can raise the limit, but the reason the limit is configurable + is not to allow huge numbers of inserts in a single query. They + made the limit configurable because a single row might be bigger + than 1 MB, so the default would prevent you from inserting + anything at all. If you raise the limit simply to be able to + insert more rows at once, you’re courting disaster with + no compensating benefit: the more data you send at a time, the + greater the chance and cost of something going wrong. Worse, + this is pure risk, because by the time you hit 1 MB, + the per-packet overhead is such a small fraction of the data + being transferred that increasing the packet size buys you + essentially nothing. + + Let’s say you have a vector + containing several megabytes of data; it will get even bigger + when expressed in SQL form, so there’s no way you can + insert it all in a single query without raising the MySQL packet + limit. One way to cope would be to write your own naïve + loop, inserting just one row at a time. This is slow, because + you’re paying the per-query cost for every row in the + container. Then you might realize that you could use the two + iterator form of insert(), passing + iterators expressing sub-ranges of the container instead of + trying to insert the whole container in one go. Now you’ve + just got to figure out how to calculate those sub-ranges to + get efficient operation without exceeding the packet size + limit. + + MySQL++ already knows how to do that, too, with + Query::insertfrom(). We gave + it a different name instead of adding yet another + insert() overload because it + doesn’t merely build the INSERT query, + which you then execute(). It’s + more like storein(), in that it wraps + the entire operation up in a single call. This feature is + demonstrated in examples/ssqls6.cpp: + + + + Most of the complexity in this example goes to + just reading in the data from a file; we have to get + our test data from somewhere. There are only two key + lines of code: create an insertion policy object, and + pass it along with an STL container full of row data to + Query::insertfrom(). + + This policy object is the main thing that differentiates + insertfrom() from the two-iterator + form of insert(). It controls + how insertfrom() builds the query + strings, primarily controlling how large each query gets before + insertfrom() executes it and starts + building a new query. We designed it to use policy objects + because there is no single “right” choice for the + decisions it makes. + + MySQL++ ships with three different insertion policy + classes, which should cover most situations. + + MaxPacketInsertPolicy, demonstrated + in the example above, does things the most obvious way: when + you create it, you pass the maximum packet size, which it uses + to prevent queries from going over the size limit. It builds + up a query string row by row, checking each time through the + loop whether adding another insert statement to the query string + would make the packet size go over the limit. When that happens, + or it gets to the end of the iteration range, it executes the + query and starts over if it’s not yet at the end. This + is robust, but it has a downside: it has to build each insert + query in advance of knowing that it can append it to the larger + query. Any time an insert query would push the packet over the + limit, it has to throw it away, causing the library to do more + work than is strictly necessary. + + Imagine you’ve done some benchmarking and have found + that the point of diminishing returns is at about 20 KB per + query in your environment; beyond that point, the per-query + overhead ceases to be an issue. Let’s also say you + know for a fact that your largest row will always be less than + 1 MB — less 20 KB — when expressed as a SQL + insert statement. In that case, you can use the more efficient + SizeThresholdInsertPolicy. It differs from + MaxPacketInsertPolicy in that it allows + insertfrom() to insert rows blindly into + the query string until the built query exceeds the threshold, + 20 KB in this example. Then it ships the packet off, and if + successful, starts a new query. Thus, each query (except possibly + the last) will be at least 20 KB, exceeding that only by as + much as one row’s worth of data, minus one byte. This is + quite appropriate behavior when your rows are relatively small, + as is typical for tables not containing BLOB data. It is more + efficient than MaxPacketInsertPolicy + because it never has to throw away any SQL fragments. + + The simplest policy object type is + RowCountInsertPolicy. This lets you simply + say how many rows at a time to insert into the database. This + works well when you have a good handle on how big each row + will be, so you can calculate in advance how many rows you + can insert at once without exceeding some given limit. Say + you know your rows can’t be any bigger than about + 1 KB. If we stick with that 20 KB target, passing + RowCountInsertPolicy<>(20) + for the policy object would ensure we never exceed + the size threshold. Or, say that maximum size + value above is still true, but we also know the + average row size is only 200 bytes. You could pass + RowCountInsertPolicy<>(100) for + the policy, knowing that the average packet size will be around + 20 KB, and the worst case packet size 100 KB, still + nowhere near the default 1 MB packet size limit. The code + for this policy is very simple, so it makes your program a little + smaller than if you used either of the above policies. Obviously + it’s a bad choice if you aren’t able to predict + the size of your rows accurately. + + If one of the provided insert policy classes + doesn’t suit your needs, you can easily create + a custom one. Just study the implementation in + lib/insertpolicy.*. + + + + Interaction with Transactions + + These policy classes are all templates, taking a parameter + that defaults to . This + means that, by default, insertfrom() + wraps the entire operation in a SQL transaction, so that if + any of the insertions fail, the database server rolls them all + back. This prevents an error in the middle of the operation + from leaving just part of the container’s data inserted + in the database, which you usually don’t want any more + than you’d want half a single row to be inserted. + + There are good reasons why you might + not want this. Perhaps the best reason is if the + insertfrom() call is to be part + of a larger transaction. MySQL doesn’t support nested + transactions, so the insertfrom() + call will fail if it tries to start one of its own. You can + pass NoTransactions for the insert + policy’s template parameter to make it suppress the + transaction code. + + + + + + Modifying data + + It almost as easy to modify data with SSQLS as to add it. This + is examples/ssqls3.cpp: + + + + Don’t forget to run resetdb after + running the example. + + + + + Storing SSQLSes in Associative Containers + + One of the requirements of STL’s associative + containers on data stored in them is that the data type + has to be less-than comparable. That is, it has to have + an operator < defined. + SSQLS does optionally give you this, as demonstrated in + examples/ssqls4.cpp: + + + + The find() call works because of + the way the SSQLS was declared. It’s properly covered + elsewhere, + but suffice it to say, the “1” in the + declaration of stock above tells it that only the + first field needs to be checked in comparing two SSQLSes. In + database terms, this makes it the primary key. Therefore, when + searching for a match, our exemplar only had to have its first + field populated. + + + + + Changing the Table Name + + Another feature you might find a use for is changing the + table name MySQL++ uses to build queries involving SSQLSes. By + default, the database server table is assumed to have the same name + as the SSQLS structure type. But if this is inconvenient, you can + globally change the table name used in queries like this: + + +stock::table("MyStockData"); + + It’s also possible to change the name of a table on + a per-instance basis: + + +stock s; +s.instance_table("AlternateTable"); + + This is useful when you have an SSQLS definition that is + compatible with multiple tables, so the table name to use for + each instance is different. This feature saves you from having + to define a separate SSQLS for each table. It is also useful for + mapping a class hierarchy onto a set of table definitions. The + common SSQLS definition is the “superclass” for a + given set of tables. + + Strictly speaking, you only need to use this feature in + multithreaded programs. Changing the static table name before + using each instance is safe if all changes happen within a single + thread. That said, it may still be convenient to change the name of + the table for an SSQLS instance in a single-threaded program if it + gets used for many operations over an extended span of code. + + + + + Using an SSQLS in Multiple Modules + + It’s convenient to define an SSQLS in a header file so + you can use it in multiple modules. You run into a bit of a + problem, though, because each SSQLS includes a few static data + members to hold information common to all structures of that + type. (The table name and the list of field names.) When you + #include that header in more than one module, + you get a multiply-defined symbol error at link time. + + The way around this is to define the preprocessor macro + MYSQLPP_SSQLS_NO_STATICS in all but + one of the modules that use the header definining the + SSQLS. When this macro is defined, it suppresses the static data + members in any SSQLS defined thereafter. + + Imagine we have a file my_ssqls.h which + includes a sql_create_N macro call to define an + SSQLS, and that that SSQLS is used in at least two modules. One + we’ll call foo.cpp, and we’ll say + it’s just a user of the SSQLS; it doesn’t + “own” it. Another of the modules, + my_ssqls.cpp uses the SSQLS more heavily, so + we’ve called it the owner of the SSQLS. If there aren’t + very many modules, this works nicely: + + +// File foo.cpp, which just uses the SSQLS, but doesn’t "own" it: +#define MYSQLPP_SSQLS_NO_STATICS +#include "my_ssqls.h" + + +// File my_ssqls.cpp, which owns the SSQLS, so we just #include it directly +#include "my_ssqls.h" + + If there are many modules that need the SSQLS, adding all + those #defines can be a pain. In that case, + it’s easier if you flip the above pattern on its head: + + +// File my_ssqls.h: +#if !defined(EXPAND_MY_SSQLS_STATICS) +# define MYSQLPP_SSQLS_NO_STATICS +#endif +sql_create_X(Y, Z....) // the SSQLS definition + + +// File foo.cpp, a mere user of the SSQLS: +#include "my_ssqls.h" + + +// File my_ssqls.cpp, which owns the SSQLS: +#define EXPAND_MY_SSQLS_STATICS +#include "my_ssqls.h" + + + + + Harnessing SSQLS Internals + + The sql_create macros define several methods + for each SSQLS. These methods are mostly for use within the library, + but some of them are useful enough that you might want to harness + them for your own ends. Here is some pseudocode showing how the most + useful of these methods would be defined for the + stock structure used in all the + ssqls*.cpp examples: + + +// Basic form +template <class Manip> +stock_value_list<Manip> value_list(cchar *d = ",", + Manip m = mysqlpp::quote) const; + +template <class Manip> +stock_field_list<Manip> field_list(cchar *d = ",", + Manip m = mysqlpp::do_nothing) const; + +template <class Manip> +stock_equal_list<Manip> equal_list(cchar *d = ",", + cchar *e = " = ", Manip m = mysqlpp::quote) const; + + +// Boolean argument form +template <class Manip> +stock_cus_value_list<Manip> value_list([cchar *d, [Manip m,] ] + bool i1, bool i2 = false, ... , bool i5 = false) const; + +// List form +template <class Manip> +stock_cus_value_list<Manip> value_list([cchar *d, [Manip m,] ] + stock_enum i1, stock_enum i2 = stock_NULL, ..., + stock_enum i5 = stock_NULL) const; + +// Vector form +template <class Manip> +stock_cus_value_list<Manip> value_list([cchar *d, [Manip m,] ] + vector<bool> *i) const; + +...Plus the obvious equivalents for field_list() and equal_list() + + Rather than try to learn what all of these methods do at + once, let’s ease into the subject. Consider this code: + + +stock s("Dinner Rolls", 75, 0.95, 0.97, sql_date("1998-05-25")); +cout << "Value list: " << s.value_list() << endl; +cout << "Field list: " << s.field_list() << endl; +cout << "Equal list: " << s.equal_list() << endl; + + That would produce something like: + + +Value list: 'Dinner Rolls’,75,0.95,0.97,'1998-05-25' +Field list: item,num,weight,price,sdate +Equal list: item = 'Dinner Rolls’,num = 75,weight = 0.95, price = 0.97,sdate = '1998-05-25' + + That is, a “value list” is a list of data member + values within a particular SSQLS instance, a “field + list” is a list of the fields (columns) within that SSQLS, and + an “equal list” is a list in the form of an SQL equals + clause. + + Just knowing that much, it shouldn’t surprise you to + learn that Query::insert() is implemented + more or less like this: + + +*this << "INSERT INTO " << v.table() << " (" << v.field_list() << + ") VALUES (" << v.value_list() << ")"; + + where ‘v’ is the SSQLS you’re asking the + Query object to insert into the database. + + Now let’s look at a complete example, which uses one of + the more complicated forms of equal_list(). + This example builds a query with fewer hard-coded strings than the + most obvious technique requires, which makes it more robust in the + face of change. Here is + examples/ssqls5.cpp: + + + + This example uses the list form of + equal_list(). The arguments + stock_weight and stock_price + are enum values equal to the position of these columns within the + stock table. sql_create_# + generates this enum for you automatically. + + The boolean argument form of that + equal_list() call would look like + this: + + +query << "select * from stock where " << + res[0].equal_list(" and ", false, false, true, true, false); + + It’s a little more verbose, as you can see. And if you want + to get really complicated, use the vector form: + + +vector<bool> v(5, false); +v[stock_weight] = true; +v[stock_price] = true; +query << "select * from stock where " << + res[0].equal_list(" and ", v); + + This form makes the most sense if you are building many other + queries, and so can re-use that vector object. + + Many of these methods accept manipulators and custom + delimiters. The defaults are suitable for building SQL queries, but + if you’re using these methods in a different context, you may + need to override these defaults. For instance, you could use these + methods to dump data to a text file using different delimiters and + quoting rules than SQL. + + At this point, we’ve seen all the major aspects of the + SSQLS feature. The final sections of this chapter look at some of + the peripheral aspects. + + + + + Having Different Field Names in C++ and SQL + + There’s a more advanced SSQLS creation macro, + which all the others are built on top of. Currently, the only + feature it adds over what’s described above is that it + lets you name your SSQLS fields differently from the names + used by the database server. Perhaps you want to use Hungarian + notation in your C++ program without changing the SQL + database schema: + + +sql_create_complete_5(stock, 1, 5, + mysqlpp::sql_char, m_sItem, "item", + mysqlpp::sql_bigint, m_nNum, "num", + mysqlpp::sql_double, m_fWeight, "weight", + mysqlpp::sql_decimal, m_fPrice, "price", + mysqlpp::sql_date, m_Date, "sdate") + + Note that you don’t have to use this mechanism if the + only difference in your SQL and C++ field names is case. SSQLS + field name lookups are case-insensitive as of MySQL++ 3.1. You can + see this in the examples: some parts of the code deliberately refer + to the stock.sdate sample table field as + stock.sDate to exercise this feature. + + + + + Expanding SSQLS Macros + + If you ever need to see the code that a given + SSQLS declaration expands out to, use the utility + doc/ssqls-pretty, like so: + + +doc/ssqls-pretty < myprog.cpp | less + + This Perl script locates the first SSQLS declaration in that + file, then uses the C++ preprocessor to expand that macro. (The + script assumes that your system’s preprocessor is called + cpp, and that its command line interface + follows Unix conventions.) + + If you run it from the top MySQL++ directory, as shown above, + it will use the header files in the distribution’s + lib subdirectory. Otherwise, it assumes the + MySQL++ headers are in their default location, + /usr/include/mysql++. If you want to use + headers in some other location, you’ll need to change the + directory name in the -I flag at the top of the + script. + + + + + Customizing the SSQLS Mechanism + + The SSQLS header ssqls.h + is automatically generated by the Perl script + ssqls.pl. Although it is possible to + change this script to get additional functionality, most of + the time it’s better to just derive a custom class from + the generated SSQLS to add functionality to it. (See the next section to see how to do + this correctly.) + + That said, ssqls.pl does have a few + configurables you might want to tweak. + + The first configurable value sets the maximum number of + data members allowed in an SSQLS. This is discussed elsewhere, + in . Beware the warnings there about + increasing this value too much. + + The second configurable is the default floating point + precision used for comparison. As described above () SSQLSes can be compared for + equality. The only place this is tricky is with floating-point + numbers, since rounding errors can make two “equal” + values compare as distinct. This property of floating-point numbers + means we almost never want to do exact comparison. MySQL++ lets + you specify the precision you want it to use. If the difference + between two values is under a given threshold, MySQL++ considers + the values equal. The default threshold is 0.00001. This threshold + works well for “human” scale values, but because of the + way floating-point numbers work, it can be wildly inappropriate for + very large or very small quantities like those used in scientific + applications. + + There are actually two ways to change this + threshold. If you need a different system-wide default, + edit ssqls.pl and change the + $fp_min_delta variable at the top of the file, + then rebuild ssqls.h as described below. If + you need different thresholds per file or per project, it’s + better to set the C macro MYSQLPP_FP_MIN_DELTA + instead. The Perl variable sets this macro’s + default; if you give a different value before #including + ssqls.h, it will use that instead. + + To rebuild ssqls.h after changing + ssqls.pl, you’ll need a Perl + interpreter. The only modern Unixy system I’m aware + of where Perl isn’t installed by default is Cygwin, and + it’s just a setup.exe choice away + there. You’ll probably only have to download and install a + Perl interpreter if you’re on Windows and don’t want + to use Cygwin. + + If you’re on a system that uses autoconf, building + MySQL++ automatically updates ssqls.h + any time ssqls.pl changes. Otherwise, + you’ll need to run the Perl interpreter by hand: + + c:\mysql++> cd lib +c:\lib> perl ssqls.pl + + + + + Deriving from an SSQLS + + Specialized SQL Structures make good base + classes. They’re simple, and have few requirements on any + class that derives from them. There are some gotchas to look out + for, however. + + Consider this: + + +sql_create_2( + Base, 1, 2, + mysqlpp::sql_varchar, a, + mysqlpp::sql_int, b +); + +class Derived : public Base +{ +public: + // constructor + Derived(mysqlpp::sql_varchar _a, mysqlpp::sql_int _b) : + Base(_a, _b) + { + } + + // functionality added to the SSQLS through inheritance + bool do_something_interesting(int data); +}; + + We’ve derived a class from an SSQLS in order to add + a method to it. Easy, right? + + Sadly, too easy. The code has a rather large flaw which makes + our derived class unusable as an SSQLS. In C++, if a derived class + has a function of the same name as one in the base class, the + base class versions of that function are all hidden by those in + the derived class. This applies to constructors, too: an SSQLS + defines several constructors, but our derived class defines + only one, causing that one to hide all of the ones in the base + class. Many of the MySQL++ mechanisms that use SSQLSes rely on + having these contructors, so our Derived + above is-not-a Base, and so it isn’t + an SSQLS. If you try to use Derived + as an SSQLS, you’ll get compiler errors wherever MySQL++ + tries to access one of these other constructors. + + There’s another minor flaw, as well. Our lone constructor + above takes its parameters by value, but the corresponding + constructor in the SSQLS takes them by const reference. Our derived + class has technically hidden a fourth base class constructor this + way, but this particular case is more a matter of efficiency than + correctness. Code that needs the full-creation constructor will + still work with our code above, but passing stringish types like + sql_varchar by value instead of by const + reference is inefficient. + + This is the corrected version of the above code: + + +sql_create_2( + Base, 1, 2, + mysqlpp::sql_varchar, a, + mysqlpp::sql_int, b +); + +class Derived : public Base +{ +public: + // default constructorneeded by mechanisms like Query::storein(); anything using an STL container, which usually require default ctors for contained data structures + Derived() : + Base() + { + } + + // for-comparison constructortakes the COMPCOUNT subset of the SSQLS’s data members, used for making comparison exemplars, used with Query::update() and similar mechanisms; see for more on COMPCOUNT + Derived(const mysqlpp::sql_varchar& _a) : + Base(_a) + { + } + + // full creation constructor + Derived(const mysqlpp::sql_varchar& _a, const mysqlpp::sql_int& _b) : + Base(_a, _b) + { + } + + // population constructorused in taking raw row data from a SQL result set and converting it to SSQLS form + Derived(const mysqlpp::Row& row) : + Base(row) + { + } + + // functionality added to the SSQLS through inheritance + bool do_something_interesting(int data); +}; + + Now Derived is-an SSQLS. + + You might wonder if you can use protected inheritance + above to redefine the SSQLS’s public interface. For + instance, OO purists might object to the public data members + in an SSQLS. You could encapsulate these public data members + in the derived class by using protected inheritance, exposing + access to the base class’s data members with public + accessor methods. The problem with this is that each SSQLS has + dozens of public member functions. These are + needed by MySQL++ internals, so unless you re-exposed all of them + as we did with the constructors above, you’d again have an + SSQLS derivative that is-not-an SSQLS. Simply put, only public + inheritance is practical with SSQLSes. + + + + + SSQLS and BLOB Columns + + It takes special care to use SSQLS with BLOB columns. + It’s safest to declare the SSQLS field as of type + mysqlpp::sql_blob. This is currently a + typedef alias for String, which is the form the data is in just + before the SSQLS mechanism populates the structure. Thus, when the + data is copied from the internal MySQL++ data structures into your + SSQLS, you get a direct copy of the String + object’s contents, without interference. + + Because C++ strings handle binary data just fine, you might + think you can use std::string instead of + sql_blob, but the current design of + String converts to + + + std::string via a C string. As a result, the + BLOB data is truncated at the first embedded null character during + population of the SSQLS. There’s no way to fix that without + completely redesigning either String or the + SSQLS mechanism. + + The sql_blob typedef may be changed to + alias a different type in the future, so using it instead of + String ensures that your code tracks these + library changes automatically. Besides, + String is only intended to be an internal + mechanism within MySQL++. The only reason the layering is so thin + here is because it’s the only way to prevent BLOB data from + being corrupted while avoiding that looming redesign effort. + + You can see this technique in action in the + cgi_jpeg example: + + + + + + + SSQLS and Visual C++ 2003 + + SSQLS works on all platforms supported by MySQL++ except for + Visual C++ 2003. (Because the rest of MySQL++ works just fine with + Visual C++ 2003, we haven’t removed this platform from the + supported list entirely.) + + If you do need SSQLS and are currently on Visual C++ 2003, you + have these options: + + + The simplest option is to upgrade to a newer + version of Visual C++. The compiler limitations that break SSQLS + are all fixed in Visual C++ 2005 and newer. Visual C++ + Express is free and is apparently here to stay; coupled + with the free wxWidgets + library, it lacks little compared to Visual C++ Professional. A + bonus of using wxWidgets is that it’s cross-platform and + better-supported than MFC. + + If you can’t upgrade your compiler, you may + be able to downgrade to MySQL++ v2.x. The + SSQLS feature in these older versions worked with Visual C++ 2003, + but didn’t let you use a given SSQLS in more than one module + in a program. If you can live with that limitation and have a Perl + interpreter on your system, you can re-generate + lib/ssqls.h to remove the multiple-module + SSQLS support. To do this, you run the command perl + ssqls.pl -v from within MySQL++’s + lib subdirectory before you build and install + the library. + + There’s a + plan to replace the current SSQLS mechanism with an + entirely new code base. Although this is being done primarily + to get new features that are too difficult to add within the + current design, it also means we’ll have the chance to + test step-by-step along the way that we don’t reintroduce + code that Visual C++ 2003 doesn’t support. This may happen + without you doing anything, but if there’s someone on + the team who cares about this, that will naturally increase + the chances that it does happen. + + + ADDED doc/userman/threads.dbx Index: doc/userman/threads.dbx ================================================================== --- /dev/null +++ doc/userman/threads.dbx @@ -0,0 +1,335 @@ + + + + + Using MySQL++ in a Multithreaded Program + + MySQL++ is not “thread safe” in any + meaningful sense. MySQL++ contains very little code that + actively prevents trouble with threads, and all of it is + optional. We have done some work in MySQL++ to make thread + safety achievable, but it doesn’t come + for free. + + The main reason for this is that MySQL++ is + generally I/O-bound, not processor-bound. That is, if + your program’s bottleneck is MySQL++, the ultimate + cause is usually the I/O overhead of using a client-server + database. Doubling the number of threads will just let your + program get back to waiting for I/O twice as fast. Since threads + are evil and generally can’t help MySQL++, the only + optional thread awareness features we turn on in the shipping + version of MySQL++ are those few that have no practical negative + consequences. Everything else is up to you, the programmer, to + evaluate and enable as and when you need it. + + We’re going to assume that you are reading this chapter + because you find yourself needing to use threads for some other + reason than to speed up MySQL access. Our purpose here is limited + to setting down the rules for avoiding problems with MySQL++ in a + multi-threaded program. We won’t go into the broader issues of + thread safety outside the scope of MySQL++. You will need a grounding + in threads in general to get the full value of this advice. + + + Build Issues + + Before you can safely use MySQL++ with threads, there are + several things you must do to get a thread-aware build: + + + + Build MySQL++ itself with thread awareness + turned on. + + On Linux, Cygwin and Unix (OS X, *BSD, Solaris...), + pass the --enable-thread-check + flag to the configure script. Beware, this + is only a request to the configure script + to look for thread support on your system, not a requirement + to do or die: if the script doesn’t find what it needs + to do threading, MySQL++ will just get built without thread + support. See README-Unix.txt for more + details. + + On Windows, if you use the Visual C++ project files or + the MinGW Makefile that comes with the MySQL++ distribution, + threading is always turned on, due to the nature of + Windows. + + If you build MySQL++ in some other way, such as with + Dev-Cpp (based on MinGW) you’re on your own to enable + thread awareness. + + + + Link your program to a thread-aware build of the + MySQL C API library. + + If you use a binary distribution of MySQL on + Unixy systems (including Cygwin) you usually get + two different versions of the MySQL C API library, + one with thread support and one without. These are + typically called libmysqlclient and + libmysqlclient_r, the latter being the + thread-safe one. (The “_r” + means reentrant.) + + If you’re using the Windows binary distribution + of MySQL, you should have only one version of the C + API library, which should be thread-aware. If you have + two, you probably just have separate debug and optimized + builds. See README-Visual-C++.txt or + README-MinGW.txt for details. + + If you build MySQL from source, you might only get + one version of the MySQL C API library, and it can have + thread awareness or not, depending on your configuration + choices. + + + + Enable threading in your program’s build + options. + + This is different for every platform, but it’s + usually the case that you don’t get thread-aware builds + by default. Depending on the platform, you might need to change + compiler options, linker options, or both. See your development + environment’s documentation, or study how MySQL++ itself + turns on thread-aware build options when requested. + + + + + + + Connection Management + + The MySQL C API underpinning MySQL++ does not allow multiple + concurrent queries on a single connection. You can run into this + problem in a single-threaded program, too, which is why we cover the + details elsewhere, in . + It’s a thornier problem when using threads, though. + + The simple fix is to just create a separarate object for each thread that + needs to make database queries. This works well if you have a small + number of threads that need to make queries, and each thread uses + its connection often enough that the server doesn’t time out waiting for queries. + + If you have lots of threads or the frequency of queries is + low, the connection management overhead will be excessive. To avoid + that, we created the + class. It manages a pool of Connection + objects like library books: a thread checks one out, uses + it, and then returns it to the pool as soon as it’s + done with it. This keeps the number of active connections + low. We suggest that you keep each connection’s + use limited to a single variable scope for RAII reasons; + we created a little helper called to make that easy. + + ConnectionPool has three + methods that you need to override in a subclass to + make it concrete: create(), + destroy(), and + max_idle_time(). These overrides let + the base class delegate operations it can’t successfully do + itself to its subclass. The ConnectionPool + can’t know how to create() + the Connection objects, because that + depends on how your program gets login parameters, server + information, etc. ConnectionPool + also makes the subclass destroy() + the Connection objects it created; it + could assume that they’re simply allocated on the heap + with new, but it can’t be sure, + so the base class delegates destruction, too. Finally, the base + class can’t know which connection idle timeout policy + would make the most sense to the client, so it asks its subclass + via the max_idle_time() method. + + ConnectionPool also allows you to + override release(), if needed. For simple + uses, it’s not necessary to override this. + + In designing your ConnectionPool + derivative, you might consider making it a Singleton, + since there should only be one pool in a program. + + Another thing you might consider doing is passing a + object to + Connection::set_option() in your + create() override before returning the + new Connection pointer. This will cause + the underlying MySQL C API to try to reconnect to the database + server if a query fails because the connection was dropped + by the server. This can happen if the DB server is allowed to + restart out from under your application. In many applications, + this isn’t allowed, or if it does happen, you might want + your code to be able to detect it, so MySQL++ doesn’t set + this option for you automatically. + + Here is an example showing how to use connection pools with + threads: + + + + The example works with both Windows native + threads and with POSIX threads.The file + examples/threads.h contains a few macros and + such to abstract away the differences between the two threading + models. Because thread-enabled builds are only + the default on Windows, it’s quite possible for this program + to do nothing on other platforms. See above for instructions on + enabling a thread-aware build. + + If you write your code without checks for thread support + like you see in the code above and link it to a build of MySQL++ + that isn’t thread-aware, it will still try to run. The + threading mechanisms fall back to a single-threaded mode when + threads aren’t available. A particular danger is that the + mutex lock mechanism used to keep the pool’s internal data + consistent while multiple threads access it will just quietly + become a no-op if MySQL++ is built without thread support. We do + it this way because we don’t want to make thread support + a MySQL++ prerequisite. And, although it would be of limited + value, this lets you use ConnectionPool + in single-threaded programs. + + You might wonder why we don’t just work around + this weakness in the C API transparently in MySQL++ instead of + suggesting design guidelines to avoid it. We’d like to do + just that, but how? + + If you consider just the threaded case, you could argue for + the use of mutexes to protect a connection from trying to execute + two queries at once. The cure is worse than the disease: it turns a + design error into a performance sap, as the second thread is blocked + indefinitely waiting for the connection to free up. Much better to + let the program get the “Commands out of sync” error, + which will guide you to this section of the manual, which tells you + how to avoid the error with a better design. + + Another option would be to bury + ConnectionPool functionality within MySQL++ + itself, so the library could create new connections at need. + That’s no good because the above example is the most complex + in MySQL++, so if it were mandatory to use connection pools, the + whole library would be that much more complex to use. The whole + point of MySQL++ is to make using the database easier. MySQL++ + offers the connection pool mechanism for those that really need it, + but an option it must remain. + + + + + Helper Functions + + Connection has several thread-related + static methods you might care about when using MySQL++ with + threads. + + You can call + Connection::thread_aware() to + determine whether MySQL++ and the underlying C API library were + both built to be thread-aware. I want to stress that thread + awareness is not the same thing as thread + safety: it’s still up to you to make + your code thread-safe. If this method returns true, it just means + it’s possible to achieve thread-safety, + not that you actually have it. + + If your program’s connection-management strategy + allows a thread to use a Connection + object that another thread created, you need to know + about Connection::thread_start(). + This function sets up per-thread resources needed to make MySQL + server calls. You don’t need to call it when you use the + simple Connection-per-thread strategy, + because this function is implicitly called the first time you + create a Connection in a thread. It’s + not harmful to call this function from a thread that previously + created a Connection, just unnecessary. The + only time it’s necessary is when a thread can make calls + to the database server on a Connection + that another thread created and that thread hasn’t already + created a Connection itself. + + If you use ConnectionPool, you should + call thread_start() at the start of each + worker thread because you probably can’t reliably predict + whether your grab() call will create a new + Connection or will return one previously + returned to the pool from another thread. It’s possible + to conceive of situations where you can guarantee that each pool + user always creates a fresh Connection the + first time it calls grab(), but thread + programming is complex enough that it’s best to take the + safe path and always call thread_start() + early in each worker thread. + + Finally, there’s the complementary method, + Connection::thread_end(). Strictly + speaking, it’s not necessary to call + this. The per-thread memory allocated by the C API is small, + it doesn’t grow over time, and a typical thread is going + to need this memory for its entire run time. Memory debuggers + aren’t smart enough to know all this, though, so they will + gripe about a memory leak unless you call this from each thread + that uses MySQL++ before that thread exits. + + Although its name suggests otherwise, + Connection::thread_id() has nothing to + do with anything in this chapter. + + + + + Sharing MySQL++ Data Structures + + We’re in the process of making it safer to share + MySQL++’s data structures across threads. Although things + are getting better, it’s highly doubtful that all problems + with this are now fixed. By way of illustration, allow me explain + one aspect of this problem and how we solved it in MySQL++ + 3.0.0. + + When you issue a database query that returns rows, you + also get information about the columns in each row. Since the + column information is the same for each row in the result set, + older versions of MySQL++ kept this information in the result + set object, and each kept + a pointer back to the result set object that created it so it + could access this common data at need. This was fine as long as + each result set object outlived the Row + objects it returned. It required uncommon usage patterns to run + into trouble in this area in a single-threaded program, but in + a multi-threaded program it was easy. For example, there’s + frequently a desire to let one connection do the queries, and other + threads process the results. You can see how avoiding lifetime + problems here would require a careful locking strategy. + + We got around this in MySQL++ v3.0 by giving these shared data + structures a lifetime independent of the result set object that + intitially creates it. These shared data structures stick around + until the last object needing them gets destroyed. + + Although this is now a solved problem, I bring it up because + there are likely other similar lifetime and sequencing problems + waiting to be discovered inside MySQL++. If you would like to + help us find these, by all means, share data between threads + willy-nilly. We welcome your crash reports on the MySQL++ + mailing list. But if you’d prefer to avoid problems, + it’s better to keep all data about a query within a single + thread. Between this and the advice in prior sections, you should + be able to use threads with MySQL++ without trouble. + + ADDED doc/userman/tquery.dbx Index: doc/userman/tquery.dbx ================================================================== --- /dev/null +++ doc/userman/tquery.dbx @@ -0,0 +1,224 @@ + + + + + Template Queries + + Another powerful feature of MySQL++ is being able to set up + template queries. These are kind of like C’s + printf() facility: you give MySQL++ a string + containing the fixed parts of the query and placeholders for the + variable parts, and you can later substitute in values into those + placeholders. + + The following program demonstrates how to use this feature. This + is examples/tquery1.cpp: + + + + The line just before the call to + query.parse() sets the template, and the + parse call puts it into effect. From that point on, you can re-use + this query by calling any of several Query member functions that + accept query template parameters. In this example, we’re using + Query::execute(). + + Let’s dig into this feature a little deeper. + + + + Setting up Template Queries + + To set up a template query, you simply insert it into the + Query object, using numbered placeholders wherever you want to be + able to change the query. Then, you call the parse() function to + tell the Query object that the query string is a template query, + and it needs to parse it: + + +query << "select (%2:field1, %3:field2) from stock where %1:wheref = %0q:what"; +query.parse(); + + The format of the placeholder is: + + +%###(modifier)(:name)(:) + + Where “###” is a number up to three digits. It is + the order of parameters given to a object, starting from 0. + + “modifier” can be any one of the following: + +
+ + + + + + % + + Print an actual “%” + + + + "" + + Don’t quote or escape no matter what. + + + + q + + This will escape the item using the MySQL C API + function + and add single quotes around it as necessary, depending on + the type of the value you use. + + + + Q + + Quote but don’t escape based on the same rules as + for “q”. This can save a bit of processing time if + you know the strings will never need quoting + + + + +
+ + “:name” is for an optional name which aids in + filling SQLQueryParms. Name can contain any alpha-numeric characters + or the underscore. You can have a trailing colon, which will be + ignored. If you need to represent an actual colon after the name, + follow the name with two colons. The first one will end the name and + the second one won’t be processed. +
+ + + + Setting the Parameters at Execution Time + + To specify the parameters when you want to execute a query + simply use Query::store(const SQLString &parm0, + [..., const SQLString &parm11]). This type of + multiple overload also exists for + Query::storein(), + Query::use() and + Query::execute(). “parm0” + corresponds to the first parameter, etc. You may specify up to 25 + parameters. For example: + + +StoreQueryResult res = query.store("Dinner Rolls", "item", "item", "price") + + with the template query provided above would produce: + + +select (item, price) from stock where item = "Dinner Rolls" + + The reason we didn’t put the template parameters in + numeric order... + + +select (%0:field1, %1:field2) from stock where %2:wheref = %3q:what + + ...will become apparent shortly. + + + + + Default Parameters + + The template query mechanism allows you to set default + parameter values. You simply assign a value for the parameter to the + appropriate position in the + Query::template_defaults array. You can refer to + the parameters either by position or by name: + + +query.template_defaults[1] = "item"; +query.template_defaults["wheref"] = "item"; + + Both do the same thing. + + This mechanism works much like C++’s default function + parameter mechanism: if you set defaults for the parameters at the + end of the list, you can call one of + Query’s query execution methods without + passing all of the values. If the query takes four parameters and + you’ve set defaults for the last three, you can execute the + query using as little as just one explicit parameter. + + Now you can see why we numbered the template query parameters + the way we did a few sections earlier. We ordered them so that the + ones less likely to change have higher numbers, so we don’t + always have to pass them. We can just give them defaults and take + those defaults when applicable. This is most useful when some + parameters in a template query vary less often than other + parameters. For example: + + +query.template_defaults["field1"] = "item"; +query.template_defaults["field2"] = "price"; +StoreQueryResult res1 = query.store("Hamburger Buns", "item"); +StoreQueryResult res2 = query.store(1.25, "price"); + + This stores the result of the following queries in + res1 and res2, + respectively: + + +select (item, price) from stock where item = "Hamburger Buns" +select (item, price) from stock where price = 1.25 + + Default parameters are useful in this example because we have + two queries to issue, and parameters 2 and 3 remain the same for + both, while parameters 0 and 1 vary. + + Some have been tempted into using this mechanism as a way to + set all of the template parameters in a query: + + +query.template_defaults["what"] = "Hamburger Buns"; +query.template_defaults["wheref"] = "item"; +query.template_defaults["field1"] = "item"; +query.template_defaults["field2"] = "price"; +StoreQueryResult res1 = query.store(); + + This can work, but it is not designed to. + In fact, it’s known to fail horribly in one common case. You + will not get sympathy if you complain on the mailing list about it + not working. If your code doesn’t actively reuse at least one + of the parameters in subsequent queries, you’re abusing + MySQL++, and it is likely to take its revenge on you. + + + + + Error Handling + + If for some reason you did not specify all the parameters when + executing the query and the remaining parameters do not have their + values set via Query::template_defaults, the + query object will throw a object. If this happens, you can get an + explanation of what happened by calling + BadParamCount::what(), like so: + + +query.template_defaults["field1"] = "item"; +query.template_defaults["field2"] = "price"; +StoreQueryResult res = query.store(1.25); + + This would throw BadParamCount because + the wheref is not specified. + + In theory, this exception should never be thrown. If the + exception is thrown it probably a logic error in your + program. + +
ADDED doc/userman/tutorial.dbx Index: doc/userman/tutorial.dbx ================================================================== --- /dev/null +++ doc/userman/tutorial.dbx @@ -0,0 +1,1422 @@ + + + + + Tutorial + + The previous chapter introduced + the major top-level mechanisms in MySQL++. Now we’ll dig down a + little deeper and get into real examples. We start off with the basics + that every MySQL++ program will have to deal with, then work up to + more complex topics that are still widely interesting. You can stop + reading the manual after this chapter and still get a lot out of + MySQL++, ignoring the more advanced parts we present in later + chapters. + + + + Running the Examples + + All of the examples are complete running programs. If you + built the library from source, the examples should have been built + as well. If you use RPMs instead, the example programs’ source + code and a simplified Makefile are in the + mysql++-devel package. They are typically + installed in + /usr/share/doc/mysql++-devel-*/examples, but it + can vary on different Linuxes. + + Before you get started, please read through any of the + README*.txt files included with the MySQL++ + distribution that are relevant to your platform. We won’t + repeat all of that here. + + Most of the examples require a test database, created by + resetdb. You can run it like so: + + resetdb [-s server_addr] [-u user] [-p password] + + Actually, there’s a problem with that. It assumes that + the MySQL++ library is already installed in a directory that the + operating system’s dynamic linker can find. (MySQL++ is almost + never built statically.) Unless you’re installing from RPMs, + you’ve had to build the library from source, and you should + run at least a few of the examples before installing the library to + be sure it’s working correctly. Since your operating + system’s dynamic linkage system can’t find the MySQL++ + libraries without help until they’re installed, we’ve + created a few helper scripts to help run the examples. + + MySQL++ comes with the exrun shell script + for Unixy systems, and the exrun.bat batch file + for Windows. You pass the example program and its arguments to the + exrun helper, which sets up the library search + path so that it will use the as-yet uninstalled version of the + MySQL++ library in preference to any other on your system: + + ./exrun resetdb [-s server_addr] [-u user] [-p password] + + That’s the typical form for a Unixy system. You leave + off the ./ bit on Windows. You can leave it + off on a Unixy system, too, if you have . + in your PATH. (Not a recommendation, just + an observation.) + + All of the program arguments are optional. + + If you don’t give , + the underlying MySQL C API (a.k.a. Connector/C) + assumes the server is on the local machine. It chooses + one of several different IPC options based on the platform + configuration. There are many different forms you can give + as server_addr with to + override this default behavior: + + + + localhost — this is the + default; it doesn’t buy you anything + + + + On Windows, a simple period tells the underlying MySQL C + API to use named pipes, if it’s available. + + + + 172.20.0.252:12345 — this would + connect to IP address + 172.20.0.252 on TCP port + 12345. + + + + my.server.name:svc_name — this + would first look up TCP service name + svc_name in your system’s + network services database (/etc/services on + Unixy systems, and something like + c:\windows\system32\drivers\etc\services on + modern Windows variants). If it finds an entry for the service, + it then tries to connect to that port on the domain name + given. + + + + For the TCP forms, you can mix names and numbers for the host + and port/service parts in any combination. If the server name + doesn’t contain a colon, it uses the default port, + 3306. + + If you don’t give , it assumes your + user name on the database server is the same as your login name on + the local machine. + + If you don’t give , it will assume + the MySQL user doesn’t have a password. (One hopes this + isn’t the case...) + + When running resetdb, the user name needs + to be for an account with permission to create the test database. + Once the database is created, you can use any account when running + the other examples that has DELETE, INSERT, SELECT and UPDATE + permissions for the test database. The MySQL root user can do all + this, of course, but you might want to set up a separate user, + having only the permissions necessary to work with the test + database: + + +CREATE USER mysqlpp_test@'%' IDENTIFIED BY ’nunyabinness'; +GRANT ALL PRIVILEGES ON mysql_cpp_data.* TO mysqlpp_test@'%'; + + You could then create the sample database with the following + command: + + ./exrun resetdb -u mysqlpp_test -p nunyabinness + + (Again, leave off the ./ bit on + Windows.) + + You may have to re-run resetdb after + running some of the other examples, as they change the + database. + + See README-examples.txt for more + details on running the examples. + + + + + A Simple Example + + The following example demonstrates how to open a connection, + execute a simple query, and display the results. This is + examples/simple1.cpp: + + + + This example simply gets the entire "item" column from the + example table, and prints those values out. + + Notice that MySQL++’s derives from + std::vector, and provides an interface that makes it a + vector work-alike. This means you can access + elements with subscript notation, walk through them with iterators, + run STL algorithms on them, etc. + + Row provides a little more in this area + than a plain old vector: you can also access + fields by name using subscript notation. + + The only thing that isn’t explicit in the code above is + that we delegate command line argument parsing to + parse_command_line() in the + excommon module. This function exists to give + the examples a consistent interface, not to hide important details. + You can treat it like a black box: it takes argc + and argv as inputs and sends back database + connection parameters. + + + + + A More Complicated Example + + The simple1 example above was pretty + trivial. Let’s get a little deeper. Here is + examples/simple2.cpp: + + + + The main point of this example is that we’re accessing + fields in the row objects by name, instead of index. This is slower, + but obviously clearer. We’re also printing out the entire + table, not just one column. + + + + + Exceptions + + By default, MySQL++ uses exceptions to signal errors. + We’ve been suppressing this in all the examples so far by + passing false to + Connection’s constructor. This kept + these early examples simple at the cost of some flexibility and + power in error handling. In a real program, we recommend that you + leave exceptions enabled. You do this by either using the default + Connection constructor, or by using the + create-and-connect constructor. + + All of MySQL++’s custom exceptions + derive from a common base class, . That in turn derives from Standard C++’s + std::exception class. Since the library + can indirectly cause exceptions to come from the Standard + C++ Library, it’s possible to catch all exceptions from + MySQL++ by just catching std::exception. + However, it’s better to have individual catch blocks + for each of the concrete exception types that you expect, and + add a handler for either Exception + or std::exception to act as a + “catch-all” for unexpected exceptions. + + When exceptions are suppressed, MySQL++ signals errors + by returning either an error code or an object that tests + as false, or by setting an error flag on the object. Classes + that allow you to suppress exceptions derive from the interface. When + an OptionalExceptions derivative + creates another object that also derives from this interface, + it passes on its exception flag. Since everything flows from + the object, disabling + exceptions on it at the start of the program disables all optional + exceptions. This is why passing false for the + Connection constructor’s “throw + exceptions” parameter suppresses all optional exceptions + in the simple[1-3] examples. It keeps them, + well, simple. + + This exception suppression mechanism is quite granular. + It’s possible to leave exceptions enabled most of the time, + but suppress them in sections of the code where they aren’t + helpful. To do this, put the section of code that you want to not + throw exceptions inside a block, and create a object at the top of that block. When created, + it saves the exception flag of the + OptionalExceptions derivative you pass to it, + and then disables exceptions on it. When the + NoExceptions object goes out of scope at the + end of the block, it restores the exceptions flag to its previous + state: + + mysqlpp::Connection con; // default ctor, so exceptions enabled + +{ + mysqlpp::NoExceptions ne(con); + if (!con.select_db("a_db_that_might_not_exist_yet")) { + // Our DB doesn’t exist yet, so create and select it here; no need + // to push handling of this case way off in an exception handler. + } +} + + When one OptionalExceptions derivative + passes its exceptions flag to another such object, it is only + passing a copy; the two objects’ flags operate independently. + There’s no way to globally enable or disable this flag on + existing objects in a single call. If you’re using the + NoExceptions feature and you’re + still seeing optional exceptions thrown, you disabled exceptions + on the wrong object. The exception thrower could be unrelated to + the object you disabled exceptions on, it could be its parent, + or it could be a child created before you disabled optional + exceptions. + + MySQL++ throws some exceptions unconditionally: + + + MySQL++ checks array indices, + always. For instance, if your code said + “row[21]” on a + row containing only 5 fields, you’d get a + BadIndex exception. If you + say “row["fred"]” + on a row without a “fred” field, you get + a BadFieldName exception. In + the past, MySQL++ delegated some of its index checking + to the STL containers underpinning it, so you could get + std::range_error instead. As of MySQL++ + v3.0.7, this should no longer happen, but there may be instances + where it still does. + + will always + throw when you ask it + to do an improper type conversion. For example, you’ll get + an exception if you try to convert “1.25” to + int, but not when you convert “1.00” to + int. In the latter case, MySQL++ knows that it can + safely throw away the fractional part. + + If you use template queries and don’t pass + enough parameters when instantiating the template, + Query will throw a exception. + + If you use a C++ data type in a query + that MySQL++ doesn’t know to convert to SQL, MySQL++ + will throw a + exception. It typically happens with , + especially when using data types other than the ones defined + in lib/sql_types.h. + + + It’s educational to modify the examples to force + exceptions. For instance, misspell a field name, use an out-of-range + index, or change a type to force a String + conversion error. + + + + + Quoting and Escaping + + SQL syntax often requires certain data to be quoted. Consider + this query: + + +SELECT * FROM stock WHERE item = 'Hotdog Buns' + + Because the string “Hotdog Buns” contains a space, + it must be quoted. With MySQL++, you don’t have to add these + quote marks manually: + + +string s = "Hotdog Buns"; +query << "SELECT * FROM stock WHERE item = " << quote_only << s; + + That code produces the same query string as in the previous + example. We used the MySQL++ quote_only manipulator, + which causes single quotes to be added around the next item inserted + into the stream. This works for any type of data that can be + converted to MySQL++’s SQLTypeAdapter type, plus the template. SSQLS also uses these manipulators + internally. + + Quoting is pretty simple, but SQL syntax also often requires + that certain characters be “escaped”. Imagine if the + string in the previous example was “Frank’s Brand Hotdog + Buns” instead. The resulting query would be: + + +SELECT * FROM stock WHERE item = 'Frank's Brand Hotdog Buns' + + That’s not valid SQL syntax. The correct syntax is: + + +SELECT * FROM stock WHERE item = 'Frank''s Brand Hotdog Buns' + + As you might expect, MySQL++ provides that feature, too, + through its escape manipulator. But here, we want both + quoting and escaping. That brings us to the most widely useful + manipulator: + + +string s = "Frank’s Brand Hotdog Buns"; +query << "SELECT * FROM stock WHERE item = " << quote << s; + + The quote manipulator both quotes strings and + escapes any characters that are special in SQL. + + MySQL++ provides other manipulators as well. See the manip.h page in the reference manual. + + It’s important to realize that MySQL++’s quoting + and escaping mechanism is type-aware. Manipulators have no effect + unless you insert the manipulator into a + Query or SQLQueryParms stream. + SQLQueryParms is used as a + stream only as an implementation detail within the library. End user + code simply sees it as a std::vector + derivative. Also, values are only quoted and/or + escaped if they are of a data type that may need it. For example, + Date must be quoted but + never needs to be escaped, and integer types need neither quoting + nor escaping. Manipulators are suggestions to the library, not + commands: MySQL++ will ignore these suggestions if it knows it + won’t result in syntactically-incorrect SQL. + + It’s also important to realize that quoting and escaping + in Query streams and template queries is + never implicit.By contrast, the + Query methods that take an SSQLS do add quotes and + escape strings implicitly. It can do this because SSQLS knows all + the SQL code and data types, so it never has to guess whether + quoting or escaping is appropriate. You must use + manipulators and template query flags as necessary to tell MySQL++ + where quoting and escaping is necessary. It would be nice if MySQL++ + could do quoting and escaping implicitly based on data type, but + this isn’t possible in all cases.Unless you’re smarter than I am, you + don’t immediately see why explicit manipulators are necessary. + We can tell when quoting and escaping is not + appropriate based on type, so doesn’t that mean we know when + it is appropriate? Alas, no. For most data + types, it is possible to know, or at least make an awfully good + guess, but it’s a complete toss-up for C strings, const + char*. A C string could be either a literal string of SQL + code, or it can be a value used in a query. Since there’s no + easy way to know and it would damage the library’s usability + to mandate that C strings only be used for one purpose or the other, + the library requires you to be explicit. Since + MySQL++ can’t reliably guess when quoting and escaping is + appropriate, and the programmer doesn’t need + toOne hopes the programmer + knows., MySQL++ makes you + tell it. + + + + + C++ vs. SQL Data Types + + The C++ and SQL data type systems have several differences + that can cause problems when using MySQL++, or any other SQL + based system, for that matter. + + Most of the data types you can store in a SQL database are + either numbers or text strings. If you’re only looking at + the data going between the database server and your application, + there aren’t even numbers: SQL is a textual language, so + numbers and everything else gets transferred between the client + and the database server in text string form.Yes, + we’re aware that there is a feature in MySQL that lets you + transfer row data in a binary form, but we don’t support + this yet. We may, someday, probably as an extension to SSQLS. The only real reason to do so + is to shave off some of the data translation overhead, which + is typically neglibible in practice, swamped by the far greater + disk and network I/O overheads inherent in use of a client-server + database system like MySQL. Consequently, MySQL++ + has a lot of special support + for text strings, and can translate to several C++ numeric data + types transparently. + + Some people worry that this translation via an intermediate + string form will cause data loss. Obviously the text string data + types are immune from problems in this regard. We’re also + confident that MySQL++ translates BLOB + and integer data types losslessly. + + The biggest worry is with floating-point numbers. (The FLOAT + and DOUBLE SQL data types.) We did have a problem with this in + older versions of MySQL++, but we believe we fixed it completely + in v3.0.2. No one has since proven data loss via this path. There + is still a known problem + + + SQL’s DECIMAL data type is a configurable-precision + fixed-point number format. MySQL++ currently translates these to + double, a floating-point data format, the closest + thing available in the C++ type system. Since the main reason + to use DECIMAL is to get away from the weird roundoff behavior + of floating-point numbers, this could be viewed as a serious + problem. The thing is, though, in all the years MySQL++ has + been around, I don’t remember anyone actually complaining + about it. Apparently there’s either no one using DECIMAL + with MySQL++, or they’re ignoring any roundoff errors + they get as a result. Until this wheel squeaks, it’s not + likely to be greased. To fix this, we’ll have to create + a new custom data type to hold such column values, which will + be a lot of work for apparently little return. + + + with the SQL DECIMAL type, which is somewhat related to the + floating-point issue, but it’s apparently rarely encountered, + which is why it hasn’t been fixed yet. + + The best way to avoid problems with data translation + is to always use the special MySQL++ data types defined in + lib/sql_types.h corresponding to your + SQL schema. These typedefs begin with sql_ and + end with a lowercase version of the standard SQL type name, + with spaces replaced by underscores. There are variants + ending in _null that wrap these base types + so they’re compatible with + SQL null. For instance, the SQL type TINYINT + UNSIGNED NOT NULL is represented in MySQL++ by + mysqlpp::sql_tinyint_unsigned. If you drop + the NOT NULL part, the corresponding C++ type is + mysqlpp::sql_tinyint_unsigned_null. + + MySQL++ doesn’t force you to use these typedefs. It + tries to be flexible with regard to data conversions, + so you could probably use int anywhere you + use mysqlpp::sql_tinyint_unsigned, + for example. That said, the MySQL++ typedefs give several + advantages: + + + Space efficiency: the MySQL++ types are no + larger than necessary to hold the MySQL data. + + Portability: if your program has to run on + multiple different system types (even just 32- and 64-bit + versions of the same operating system and processor type) + using the MySQL++ typedefs insulates your code from platform + changes. + + Clarity: using C++ types named similarly to the + SQL types reduces the risk of confusion when working with code in + both languages at the same time. + + Compatibility: using the MySQL++ types ensures + that data conversions between SQL and C++ forms are compatible. + Naïve use of plain old C++ types can result in data + truncation, + exceptions, and worse. + + Type compatibility is important not just at the time + you write your program, it also helps forward compatibility: + we occasionally change the definitions of the MySQL++ + typedefs to reduce the differences between the C++ + and SQL type systems. We’ll be fixing the DECIMAL issue + brought up above this way, for instance; if your program + uses sql_decimal instead of the + current underlying type, double, your program + will pick up this improvement automatically with just a + recompile. + + + Most of these typedefs use standard C++ data types, but + a few are aliases for a MySQL++ specific type. For instance, + the SQL type DATETIME is mirrored in + MySQL++ by mysqlpp::DateTime. For + consistency, sql_types.h includes a + typedef alias for DateTime called + mysqlpp::sql_datetime. + + MySQL++ doesn’t have typedefs for the most exotic data + types, like those for the geospatial types. Patches to correct + this will be thoughtfully considered. + + + + + Handling SQL Nulls + + Both C++ and SQL have things in them called NULL, but they + differ in several ways. Consequently, MySQL++ has to provide + special support for this, rather than just wrap native C++ + facilities as it can with most data type issues. + + + SQL NULL is a type modifier + + The primary distinction is one of type. In SQL, + “NULL” is a type modifier, which affects whether + you can legally store a null value in that column. There’s + simply nothing like it in C++. + + To emulate SQL NULL, MySQL++ provides the Null template to allow + the creation of distinct “nullable” versions of + existing C++ types. So for example, if you have a TINYINT + UNSIGNED column that can have nulls, the proper + declaration for MySQL++ would be: + + +mysqlpp::Null<mysqlpp::sql_tinyint_unsigned> myfield; + + As of MySQL++ 3.1, we also provide shorter aliases for + such types: + + +mysqlpp::sql_tinyint_unsigned_null myfield; + + These types are declared in + lib/sql_types.h. You might want to scan + through that to see what all is available. + + Template instantiations are first-class types in the C++ + language, so there’s no possible confusion between this + feature of MySQL++ and C++’s native NULL concept. + + + + SQL NULL is a unique value + + There’s a secondary distinction between SQL null and + anything available in the standard C++ type system: SQL null + is a distinct value, equal to nothing else. We can’t + use C++’s NULL for this because it + is ambiguous, being equal to 0 in integer context. MySQL++ + provides the global null object, which you + can assign to a Null template instance + to make it equal to SQL null: + + +myfield = mysqlpp::null; + + If you insert a MySQL++ field holding a SQL null into a + C++ IOstream, you get “(NULL)”, something fairly + unlikely to be in a normal output string, thus reasonably + preserving the uniqueness of the SQL null value. + + MySQL++ also tries to enforce the uniqueness of the + SQL null value at compile time in assignments and data + conversions. If you try to store a SQL null in a field type + that isn’t wrapped by Null + or try to assign a Null-wrapped + field value to a variable of the inner non-wrapped type, + the compiler will emit some ugly error message, yelling about + CannotConvertNullToAnyOtherDataType. (The exact + message is compiler-dependent.) + + If you don’t like these behaviors, you can change + them by passing a different value for the second parameter + to template Null. By default, this + parameter is , + meaning that we should enforce the uniqueness of SQL + null. To relax the distinctions, you can instantiate the + Null template with a different behavior + type: or . Consider this code: + + +mysqlpp::Null<unsigned char, mysqlpp::NullIsZero> myfield(mysqlpp::null); +cout << myfield << endl; +cout << int(myfield) << endl; + + This will print “0” twice. If you had used the + default for the second Null template + parameter, the first output statement would have printed + “(NULL)”, and the second wouldn’t even + compile. + + + + + + MySQL++’s Special String Types + + MySQL++ has two classes that work like + std::string to some degree: and . These classes exist to provide functionality + that std::string doesn’t provide, but + they are neither derivatives of nor complete supersets of + std::string. As a result, end-user code + generally doesn’t deal with these classes directly, because + std::string is a better general-purpose + string type. In fact, MySQL++ itself uses + std::string most of the time, too. But, the + places these specialized stringish types do get used are so + important to the way MySQL++ works that it’s well worth taking + the time to understand them. + + + + SQLTypeAdapter + + The simpler of the two is + SQLTypeAdapter, or + STA for short.In version 2 + of MySQL++ and earlier, SQLTypeAdapter was + called SQLString, but it was confusing + because its name and the fact that it derived from + std::string suggested that it was a + general-purpose string type. MySQL++ even used it this way in a + few places internally. In v3, we made it a simple base class and + renamed it to reflect its proper limited + function. + + As its name suggests, its only purpose is to adapt other + data types to be used with SQL. It has a whole bunch of conversion + constructors, one for all data types we expect to be used with + MySQL++ for values in queries. SQL queries are strings, so + constructors that take stringish types just make a copy of that + string, and all the others “stringize” the value in + the format needed by + SQL.SQLTypeAdapter + doesn’t do itself. That happens + elsewhere, right at the point that the STA + gets used to build a query. The conversion + constructors preserve type information, so this stringization + process doesn’t throw away any essential information. + + STA is used anywhere MySQL++ needs to + be able to accept any of several data types for use in a SQL + query. Major users are Query’s + template query mechanism and the Query + stream quoting and escaping mechanism. You care about + STA because any time you pass a data value + to MySQL++ to be used in building a SQL query, it goes through + STA. STA is one of + the key pieces in MySQL++ that makes it easy to generate + syntactically-correct SQL queries. + + + + + String + + If MySQL++ can be said to have its own generic string type, + it’s String, but it’s not + really functional enough for general use. It’s possible that + in future versions of MySQL++ we’ll expand its interface to + include everything std::string does, so + that’s why it’s called that.If you + used MySQL++ before v3, String used to be + called ColData. It was renamed because + starting in v2.3, we began using it for holding more than just + column data. I considered renaming it + SQLString instead, but that would have + confused old MySQL++ users to no end. Instead, I followed the + example of Set, MySQL++’s specialized + std::set variant. + + The key thing String provides over + std::string is conversion of strings in SQL + value formats to their plain old C++ data types. For example, if you + initialize it with the string “2007-11-19”, you can + assign the String to a Date, not because + Date knows how to initialize itself from + String, but the reverse: + String has a bunch of implicit conversion + operators defined for it, so you can use it in any type context + that makes sense in your application. + + Because Row::operator[] returns + String, you can say things like + this: + + int x = row["x"]; + + In a very real sense, String is the + inverse of STA: + String converts SQL value strings to C++ + data types, and STA converts C++ data types + to SQL value strings.During the development of + MySQL++ v3.0, I tried merging + SQLTypeAdapter and + String into a single class to take + advantage of this. The resulting class gave the C++ compiler the + freedom to tie itself up in knots, because it was then allowed to + convert almost any data type to almost any other. You’d get + a tangle of ambiguous data type conversion errors from the most + innocent code. + + String has two main uses. + + By far the most common use is as the field value type of + Row, as exemplified above. It’s not + just the return type of Row::operator[], + though: it’s actually the value type used within + Row’s internal array. As a result, + any time MySQL++ pulls data from the database, it goes through + String when converting it from the string + form used in SQL result sets to the C++ data type you actually + want the data in. It’s the core of the structure population + mechanism in the SSQLS feature, for + example. + + Because String is the last pristine + form of data in a result set before it gets out of MySQL++’s + internals where end-user code can see it, MySQL++’s + sql_blob and related typedefs are + aliases for String. Using anything else + would require copies; while the whole “networked database + server” thing means most of MySQL++ can be quite inefficient + and still not affect benchmark results meaningfully, BLOBs tend to + be big, so making unnecessary copies can really make a difference. + Which brings us to... + + + + + Reference Counting + + To avoid unnecessary buffer copies, both + STA and String + are implemented in terms of a reference-counted copy-on-write + buffer scheme. Both classes share the same underlying mechanism, + and so are interoperable. This means that if you construct + one of these objects from another, it doesn’t actually + copy the string data, it only copies a pointer to the data + buffer, and increments its reference count. If the object + has new data assigned to it or it’s otherwise modified, + it decrements its reference count and creates its own copy of + the buffer. This has a lot of practical import, such as the + fact that even though Row::operator[] + returns Strings by value, it’s + still efficient. + + + + + + Dealing with Binary Data + + Historically, there was no way to hold arbitrary-sized blocks + of raw binary data in an SQL database. There was resistance to + adding such a feature to SQL for a long time because it’s + better, where possible, to decompose blocks of raw binary data into + a series of numbers and text strings that can + be stored in the database. This lets you query, address and + manipulate elements of the data block individually. + + A classic SQL newbie mistake is trying to treat the database + server as a file system. Some embedded platforms use a database + engine as a file system, but MySQL doesn’t typically live + in that world. When your platform already has a perfectly good + file system, you should use it for big, nondecomposable blocks + of binary data in most cases. + + A common example people use when discussing this is images + in database-backed web applications. If you store the image in the + database, you have to write code to retrieve the image from the + database and send it to the client; there’s more overhead, + and less efficient use of the system’s I/O caching system. If + you store the image in the filesystem, all you have to do is + point the web server to the directory where the images live, + and put a URL for that image in your generated HTML. Because + you’re giving the web server a direct path to a file on + disk, operation is far more efficient. Web servers are very + good at slurping whole files off of disk and sending them out + to the network, and operating systems are very good at caching + file accesses. Plus, you avoid the overhead of pushing the data + through the high-level language your web app is written in, which + is typically an interpreted language, not C++. Some people still + hold out on this, claiming that database engines have superior + security features, but I call bunk on that, too. Operating systems + and web servers are capable of building access control systems + every bit as granular and secure as a database system. + + Occasionally you really do need to store a nondecomposable + block of binary data in the database. For such cases, modern + SQL database servers support BLOB data types, for Binary Large + OBject. This is often just called binary data, though of course + all data in a modern computer is binary at some level. + + The tricky part about dealing with binary data in MySQL++ is + to ensure that you don’t ever treat the data as a C string, + which is really easy to do accidentally. C strings treat zero bytes + as special end-of-string characters, but they’re not special + at all in binary data. We’ve made a lot of improvements + to the way MySQL++ handles string + data to avoid this problem, but it’s still possible + to bypass these features, wrecking your BLOBs. These examples + demonstrate correct techniques. + + + + Loading a binary file into a BLOB column + + Above, I opined that it’s usually incorrect to + store image data in a database, particularly with web apps, + of which CGI is a primitive form. Still, it makes a nice, + simple example. + + Instead of a single example program, we have here a + matched pair. The first example takes the name of a JPEG + file on the command line along with all the other common example program parameters, + loads that file into memory, and stores it in a BLOB column in + the database. + + This example also demonstrates how to retrieve the + value assigned to an auto-increment column in the previous + insertion. This example uses that feature in the typical way, + to create unique IDs for rows as they’re inserted. + + Here is examples/load_jpeg.cpp: + + + + Notice that we used the escape manipulator + when building the INSERT query above. This is because + mysqlpp::sql_blob is just an alias for one of the + special MySQL++ string types, + which don’t do automatic quoting + and escaping. They can’t, because MySQL++ also + uses these data types to hold raw SQL query strings, which + would break due to doubled quoting and/or escaping if it were + automatic. + + + + + Serving images from BLOB column via CGI + + The other example in this pair is rather short, + considering how much it does. It parses a CGI query string + giving the image ID, uses that to retreive data loaded into + the database by load_jpeg, and writes + it out in the form a web server wants when processing a CGI + call, all with adequate real-world error handling. This is + examples/cgi_jpeg.cpp: + + + + While you can run it by hand, it’s + best to install this in a web server’s + CGI program directory, then call it with a URL like + http://my.server.com/cgi-bin/cgi_jpeg?id=1. + That retrieves the JPEG with ID 1 from the database and + returns it to the web server, which will send it on to the + browser. + + We’ve included an image with MySQL++ + that you can use with this example pair, + examples/logo.jpg. + + + + + + Using Transactions + + The class makes it + easier to use SQL transactions in an exception-safe manner. Normally + you create the Transaction object on the + stack before you issue the queries in your transaction set. Then, + when all the queries in the transaction set have been issued, you + call Transaction::commit(), which commits the + transaction set. If the Transaction object + goes out of scope before you call commit(), the + transaction set is rolled back. This ensures that if some code + throws an exception after the transaction is started but before it + is committed, the transaction isn’t left unresolved. + + examples/transaction.cpp illustrates + this: + + + + One of the downsides of transactions is that the locking it + requires in the database server is prone to deadlocks. The classic + case where this happens is when two programs both want access to the + same two rows within a single transaction each, but they modify them + in opposite orders. If the timing is such that the programs + interleave their lock acquisitions, the two come to an impasse: + neither can get access to the other row they want to modify until + the other program commits its transaction and thus release the row + locks, but neither can finish the transaction because they’re + waiting on row locks the database server is holding on behalf of the + other program. + + The MySQL server is smart enough to detect this condition, but + the best it can do is abort the second transaction. This breaks the + impasse, allowing the first program to complete its + transaction. + + The second program now has to deal with the fact that its + transaction just got aborted. There’s a subtlety in detecting + this situation when using MySQL++. By default, MySQL++ signals + errors like these with exceptions. In the exception handler, you + might expect to get ER_LOCK_DEADLOCK from + Query::errnum() (or + Connection::errnum(), same thing), but what + you’ll almost certainly get instead is 0, meaning “no + error.” Why? It’s because you’re probably using a + Transaction object to get automatic + roll-backs in the face of exceptions. In this case, the roll-back + happens before your exception handler is called by issuing a + ROLLBACK query to the database server. Thus, + Query::errnum() returns the error code + associated with this roll-back query, not the deadlocked transaction + that caused the exception. + + To avoid this problem, a few of the exception objects as of + MySQL++ v3.0 include this last error number in the exception object + itself. It’s populated at the point of the exception, so it + can differ from the value you would get from + Query::errnum() later on when the exception + handler runs. + + The example examples/deadlock.cpp + demonstrates the problem: + + + + This example works a little differently than the others. You + run one copy of the example, then when it pauses waiting for you to + press Enter, you run another copy. Then, depending + on which one you press Enter in, one of the two + will abort with the deadlock exception. You can see from the error + message you get that it matters which method you call to get the + error number. What you do about it is up to you as it depends on + your program’s design and system architecture. + + + + + Which Query Type to Use? + + There are three major ways to execute a query in MySQL++: + Query::execute(), + Query::store(), and + Query::use(). Which should you use, and + why? + + execute() is for queries that do not + return data per se. For instance, + CREATE INDEX. You do get back some information + from the MySQL server, which execute() + returns to its caller in a object. In addition to the obvious — a + flag stating whether the query succeeded or not — this object + also contains things like the number of rows that the query + affected. If you only need the success status, it’s a little + more efficient to call Query::exec() + instead, as it simply returns bool. + + If your query does pull data from the database, the simplest + option is store(). (All of the examples up + to this point have used this method.) This returns a object, which contains the + entire result set. It’s especially convenient because + StoreQueryResult derives from + std::vector<mysqlpp::Row>, so it opens + the whole panoply of STL operations for accessing the rows in the + result set. Access rows randomly with subscript notation, iterate + forwards and backwards over the result set, run STL algorithms on + the set...it all works naturally. + + If you like the idea of storing your results in an STL + container but don’t want to use + std::vector, you can call + Query::storein() instead. It lets you store + the results in any standard STL container (yes, both sequential and + set-associative types) instead of using + StoreQueryResult. You do miss out on some of + the additional database information held by + StoreQueryResult’s other base class, + , however. + + store*() queries are convenient, but + the cost of keeping the entire result set in main memory can + sometimes be too high. It can be surprisingly costly, in fact. A + MySQL database server stores data compactly on disk, but it returns + query data to the client in a textual form. This results in a kind + of data bloat that affects numeric and BLOB types the most. MySQL++ + and the underlying C API library also have their own memory + overheads in addition to this. So, if you happen to know that the + database server stores every record of a particular table in 1 KB, + pulling a million records from that table could easily take several + GB of memory with a store() query, + depending on what’s actually stored in that table. + + For these large result sets, the superior option is a + use() query. This returns a object, which is similar to + StoreQueryResult, but without all of the + random-access features. This is because a “use” query + tells the database server to send the results back one row at a + time, to be processed linearly. It’s analogous to a C++ + stream’s input iterator, as opposed to a random-access + iterator that a container like vector offers. By accepting this + limitation, you can process arbitrarily large result sets. This + technique is demonstrated in + examples/simple3.cpp: + + + + This example does the same thing as + simple2, only with a “use” query + instead of a “store” query. + + Valuable as use() queries are, they + should not be the first resort in solving problems of excessive + memory use. It’s better if you can find a way to simply not + pull as much data from the database in the first place. Maybe + you’re saying SELECT * even though you + don’t immedidately need all the columns from the table. Or, + maybe you’re filtering the result set with C++ code after you + get it from the database server. If you can do that filtering with a + more restrictive WHERE clause on the + SELECT, it’ll not only save memory, + it’ll save bandwidth between the database server and client, + and can even save CPU time. If the filtering criteria can’t be + expressed in a WHERE clause, however, read on to + the next section. + + + + + Conditional Result Row Handling + + Sometimes you must pull more data from the database server + than you actually need and filter it in memory. SQL’s + WHERE clause is powerful, but not as powerful as + C++. Instead of storing the full result set and then picking over it + to find the rows you want to keep, use + Query::store_if(). This is + examples/store_if.cpp: + + + + I doubt anyone really needs to select rows from a table that + have a prime number in a given field. This example is meant to be + just barely more complex than SQL can manage, to avoid obscuring the + point. That point being, the + Query::store_if() call here gives you a + container full of results meeting a criterion that you probably + can’t express in SQL. You will no doubt have much more useful + criteria in your own programs. + + If you need a more complex query than the one + store_if() knows how to build when given an + SSQLS examplar, there are two overloads that let you use your own + query string. One overload takes the query string directly, and the + other uses the query string built with + Query’s stream interface. + + + + + Executing Code for Each Row In a Result Set + + SQL is more than just a database query language. Modern + database engines can actually do some calculations on the data on + the server side. But, this isn’t always the best way to get + something done. When you need to mix code and a query, + MySQL++’s Query::for_each() facility + might be just what you need. This is + examples/for_each.cpp: + + + + You only need to read the main() function + to get a good idea of what the program does. The key line of code + passes an SSQLS examplar and a functor to + Query::for_each(). + for_each() uses the SSQLS instance to build + a select * from TABLE query, + stock in this case. It runs that + query internally, calling gather_stock_stats + on each row. This is a pretty contrived example; you could actually + do this in SQL, but we’re trying to prevent the complexity of + the code from getting in the way of the demonstration here. + + Just as with store_if(), described + above, there are two other overloads for + for_each() that let you use your own query + string. + + + + + Connection Options + + MySQL has a large number of options that control how it makes + the connection to the database server, and how that connection + behaves. The defaults are sufficient for most programs, so only one + of the MySQL++ example programs make any connection option changes. + Here is examples/multiquery.cpp: + + + + This is a fairly complex example demonstrating the multi-query + and stored procedure features in newer versions of MySQL. Because + these are new features, and they change the communication between + the client and server, you have to enable these features in a + connection option. The key line is right up at the top of + main(), where it creates a object and passes it + to Connection::set_option(). That method + will take a pointer to any derivative of : you just create such an object on the heap and pass + it in, which gives Connection the data values + it needs to set the option. You don’t need to worry about + releasing the memory used by the Option + objects; it’s done automatically. + + The only tricky thing about setting options is that only a few + of them can be set after the connection is up. Most need to be set + just as shown in the example above: create an unconnected + Connection object, set your connection + options, and only then establish the connection. The option setting + mechanism takes care of applying the options at the correct time in + the connection establishment sequence. + + If you’re familiar with setting connection options in + the MySQL C API, you’ll have to get your head around the fact + that MySQL++’s connection option mechanism is a much simpler, + higher-level design that doesn’t resemble the C API in any + way. The C API has something like half a dozen different mechanisms + for setting options that control the connection. The flexibility of + the C++ type system allows us to wrap all of these up into a single + high-level mechanism while actually getting greater type safety than + the C API allows. + + + + + Dealing with Connection Timeouts + + By default, current MySQL servers have an 8 hour idle + timeout on connections. This is not a problem if your program + never has to run for more than 8 hours or reliably queries the + database more often than that. And, it’s a good thing for + the database server, because even an idle connection takes up + server resources. + + Many programs must run continually, however, and may + experience long idle periods, such as nights and weekends + when no one is around to make the program issue database + queries. It’s therefore common for people writing such + programs to get a bug report from the field complaining that the + program died overnight or over a long weekend, usually with some + error message about the database server going away. They then check + the DB server, find that it’s still running and never did + restart and scratch their heads wondering what happened. What + happened is that the server’s connection idle timeout + expired, so it closed the connection to the client. + + You cannot detect this condition by calling + Connection::connected(). When + that returns true, it just means + that either the connect-on-create constructor or the + connect() call succeeded and that we + haven’t observed the connection to be down since then. + When the database server closes an idle connection, you won’t + know it until after you try to issue a query. This is simply due + to the nature of network programming. + + One way around this problem is to configure + MySQL to have a longer idle timeout. This timeout is + in seconds, so the default of 8 hours is 28,800 seconds. You + would want to figure out the longest possible time that your + program could be left idle, then pick a value somewhat longer + than that. For instance, you might decide that the longest + reasonable idle time is a long 4-day weekend — 345,600 + seconds — which you could round up to 350,000 or 400,000 + to allow for a little bit of additional idle time on either end + of that period. + + Another way around this, on a per-connection basis from + the client side, would be to set the connection + option. This will cause MySQL++ to reconnect to the server + automatically if it drops the connection. Beware that unless + you’re using MySQL 5.1.6 or higher, you have to set this + only after the connection is established, or it won’t take + effect. This means there’s a potential race condition: + it’s possible the connection could drop shortly enough + after being established that you don’t have time to apply + the option, so it won’t come back up automatically. MySQL + 5.1.6+ fixes this by allowing this option to be set before the + connection is established. + + A completely different way to tackle this, if your program + doesn’t block forever waiting on I/O while idle, is to + periodically call Connection::ping(). + + + Don’t ping the server too often! It takes a tiny + amount of processing capability to handle a ping, which can add + up to a significant amount if done often enough by a client, or + even just rarely by enough clients. Also, a lower ping frequency + can let your program ride through some types of network faults + — a switch reboot, for instance — without needing + a reconnect. I like to ping the DB server no more often than + half the connection timeout. With the default of 8 hours, then, + I’d ping between every 4 and 7 hours. + + + This sends the smallest possible amount of data to the + database server, which will reset its idle timer and cause + it to respond, so ping() returns + true. If it returns false + instead, you know you need to reconnect to the server. Periodic + pinging is easiest to do if your program uses asynchronous I/O, + threads, or some kind of event + loop to ensure that you can call something periodically even + while the rest of the program has nothing to do. + + An interesting variant on this strategy is to ping the server + before each query, or, better, before each group of queries within + a larger operation. It has an advantage over pinging during idle + time in that the client is about to use far more server resources + to handle the query than it will take to handle the ping, so the + ping time gets lost in the overhead. On the other hand, if the + client issues queries frequently when not idle, it can result + in a lot more pings than would happen if you just pinged every + N hours while idle. + + Finally, some programmers prefer to wrap the querying + mechanism in an error handler that catches the “server has + gone away” error and tries to reestablish the connection and + reissue the query. This adds some complexity, but it makes your + program more robust without taking up unnecessary resources. If you + did this, you could even change the server to drop idle connections + more often, thus tying up fewer TCP/IP stack resources. + + + + + Concurrent Queries on a Connection + + An important limitation of the MySQL C API library — + which MySQL++ is built atop, so it shares this limitation — + is that you can only have one query in progress on each connection + to the database server. If you try to issue a second query while + one is still in progress, you get an obscure error message about + “Commands out of sync” from the underlying C API + library. (You normally get this message in a MySQL++ exception + unless you have exceptions disabled, in which case you get a + failure code and Connection::error() + returns this message.) + + There are lots of ways to run into this limitation: + + + + The easiest way is to try to use a single object in a multithreaded + program, with more than one thread attempting to use it to + issue queries. Unless you put in a lot of work to synchronize + access, this is almost guaranteed to fail at some point, giving + the dread “Commands out of sync” error. + + + + You might then think to give each thread that issues + queries its own Connection object. + You can still run into trouble if you pass the data you get + from queries around to other threads. What can happen is + that one of these child objects indirectly calls back to the + Connection at a time where it’s + involved with another query. This is properly covered + elsewhere, in .) + + + + One way to run into this problem without using + threads is with “use” queries, discussed above. If you don’t + consume all rows from a query before you issue another on + that connection, you are effectively trying to have multiple + concurrent queries on a single connection. Here’s a + recipie for this particular disaster: + + +UseQueryResult r1 = query.use("select garbage from plink where foobie='tamagotchi'"); +UseQueryResult r2 = query.use("select blah from bonk where bletch='smurf'"); + + The second use() call fails because + the first result set hasn’t been consumed yet. + + + + Still another way to run into this limitation + is if you use MySQL’s multi-query feature. This + lets you give multiple queries in a single call, + separated by semicolons, and get back the results for + each query separately. If you issue three queries using + Query::store(), you only get + back the first query’s results with that call, and + then have to call store_next() + to get the subsequent query results. MySQL++ provides + Query::more_results() so + you know whether you’re done, or need to call + store_next() again. Until you reach + the last result set, you can’t issue another query on + that connection. + + + + Finally, there’s a way to run into this + that surprises almost everyone sooner or later: stored + procedures. MySQL normally returns at least + two result sets for a stored procedure call. The + simple case is that the stored procedure contains a single + SQL query, and it succeeds: you get two results, first the + results of the embedded SQL query, and then the result + of the call itself. If there are multiple SQL queries + within the stored procedure, you get more than two result + sets. Until you consume them all, you can’t start a + new query on the connection. As above, you want to have + a loop calling more_results() + and store_next() to work your + way through all of the result sets produced by the stored + procedure call. + + + + + + + Getting Field Meta-Information + + The following example demonstrates how to get information + about the fields in a result set, such as the name of the field and + the SQL type. This is + examples/fieldinf.cpp: + + + + ADDED doc/userman/unicode.dbx Index: doc/userman/unicode.dbx ================================================================== --- /dev/null +++ doc/userman/unicode.dbx @@ -0,0 +1,202 @@ + + + + + Using Unicode with MySQL++ + + + A Short History of Unicode + ...with a focus on relevance to MySQL++ + + In the old days, computer operating systems only dealt with + 8-bit character sets. That only allows for 256 possible characters, + but the modern Western languages have more characters combined than + that alone. Add in all the other languages of the world plus the + various symbols people use in writing, and you have a real + mess! + + Since no standards body held sway over things like + international character encoding in the early days of computing, + many different character sets were invented. These character sets + weren’t even standardized between operating systems, so heaven + help you if you needed to move localized Greek text on a DOS box to + a Russian Macintosh! The only way we got any international + communication done at all was to build standards on top of the + common 7-bit ASCII subset. Either people used approximations like a + plain “c” instead of the French “ç”, + or they invented things like HTML entities + (“&ccedil;” in this case) to encode these additional + characters using only 7-bit ASCII. + + Unicode solves this problem. It encodes every character used + for writing in the world, using up to 4 bytes per character. The + subset covering the most economically valuable cases takes two bytes + per character, so many Unicode-aware programs only support this + subset, storing characters as 2-byte values, rather than use 4-byte + characters so as to cover all possible cases, however rare. This + subset of Unicode is called the Basic Multilingual Plane, or + BMP. + + Unfortunately, Unicode was invented about two decades + too late for Unix and C. Those decades of legacy created an + immense inertia preventing a widespread move away from 8-bit + characters. MySQL and C++ come out of these older traditions, and + so they share the same practical limitations. MySQL++ currently + doesn't have any code in it for Unicode conversions; it just + passes data along unchanged from the underlying MySQL C API, + so you still need to be aware of these underlying issues. + + During the development of the Plan + 9 operating system (a kind of successor to Unix) Ken + Thompson invented + the UTF-8 + encoding. UTF-8 is a superset of 7-bit ASCII and is + compatible with C strings, since it doesn’t use 0 bytes + anywhere as multi-byte Unicode encodings do. As a result, many + programs that deal in text will cope with UTF-8 data even though + they have no explicit support for UTF-8. (Follow the last link above + to see how the design of UTF-8 allows this.) Thus, when explicit + support for Unicode was added in MySQL v4.1, they chose to make + UTF-8 the native encoding, to preserve backward compatibility with + programs that had no Unicode support. + + + + + Unicode on Unixy Systems + + Linux and Unix have system-wide UTF-8 support these days. If + your operating system is of 2001 or newer vintage, it probably has + such support. + + On such a system, the terminal I/O code understands UTF-8 + encoded data, so your program doesn’t require any special code + to correctly display a UTF-8 string. If you aren’t sure + whether your system supports UTF-8 natively, just run the + simple1 example: if the first item has two + high-ASCII characters in place of the “ü” in + “Nürnberger Brats”, you know it’s not + handling UTF-8. + + If your Unix doesn’t support UTF-8 natively, it likely + doesn’t support any form of Unicode at all, for the historical + reasons I gave above. Therefore, you will have to convert the UTF-8 + data to the local 8-bit character set. The standard Unix function + iconv() can help here. If your system + doesn’t have the iconv() facility, there + is a free + implementation available from the GNU Project. Another + library you might check out is IBM’s ICU. This is rather + heavy-weight, so if you just need basic conversions, + iconv() should suffice. + + + + + Unicode on Windows + + Each Windows API function that takes a string actually comes + in two versions. One version supports only 1-byte + “ANSI” characters (a superset of ASCII), so they end + in 'A'. Windows also supports the 2-byte subset of Unicode called + UCS-2Since + Windows XP, Windows actually uses the UTF-16 encoding, + not UCS-2. This means that if you use characters beyond the 16-bit + “BMP” range, they get encoded as 4-byte characters. But + again, since the most economically valuable subset of Unicode is the + BMP, many programs ignore this distinction and treat modern Windows + as supporting 2-byte characters.. Some call these + “wide” characters, so the other set of functions end + in 'W'. The MessageBox() + API, for instance, is actually a macro, not a real function. If you + define the UNICODE macro when building your + program, the MessageBox() macro evaluates to + MessageBoxW(); otherwise, to + MessageBoxA(). + + Since MySQL uses the UTF-8 Unicode encoding and Windows uses + UCS-2, you must convert data when passing text between MySQL++ and + the Windows API. Since there’s no point in trying for + portability — no other OS I’m aware of uses UCS-2 + — you might as well use platform-specific functions to do this + translation. Since version 2.2.2, MySQL++ ships with two Visual C++ + specific examples showing how to do this in a GUI program. (In + earlier versions of MySQL++, we did Unicode conversion in the + console mode programs, but this was unrealistic.) + + How you handle Unicode data depends on whether you’re + using the native Windows API, or the newer .NET API. First, the + native case: + + +// Convert a C string in UTF-8 format to UCS-2 format. +void ToUCS2(LPTSTR pcOut, int nOutLen, const char* kpcIn) +{ + MultiByteToWideChar(CP_UTF8, 0, kpcIn, -1, pcOut, nOutLen); +} + +// Convert a UCS-2 string to C string in UTF-8 format. +void ToUTF8(char* pcOut, int nOutLen, LPCWSTR kpcIn) +{ + WideCharToMultiByte(CP_UTF8, 0, kpcIn, -1, pcOut, nOutLen, 0, 0); +} + + These functions leave out some important error checking, so + see examples/vstudio/mfc/mfc_dlg.cpp for the + complete version. + + If you’re building a .NET application (such as, perhaps, + because you’re using Windows Forms), it’s better to use + the .NET libraries for this: + + +// Convert a C string in UTF-8 format to a .NET String in UCS-2 format. +String^ ToUCS2(const char* utf8) +{ + return gcnew String(utf8, 0, strlen(utf8), System::Text::Encoding::UTF8); +} + +// Convert a .NET String in UCS-2 format to a C string in UTF-8 format. +System::Void ToUTF8(char* pcOut, int nOutLen, String^ sIn) +{ + array<Byte>^ bytes = System::Text::Encoding::UTF8->GetBytes(sIn); + nOutLen = Math::Min(nOutLen - 1, bytes->Length); + System::Runtime::InteropServices::Marshal::Copy(bytes, 0, + IntPtr(pcOut), nOutLen); + pcOut[nOutLen] = '\0'; +} + + Unlike the native API versions, these examples are complete, + since the .NET platform handles a lot of things behind the scenes + for us. We don’t need any error-checking code for such simple + routines. + + All of this assumes you’re using Windows NT or one of + its direct descendants: Windows 2000, Windows XP, Windows Vista, + Windows 7, or any “Server” variant of Windows. + Windows 95 and its descendants (98, ME, and CE) do not support + Unicode. They still have the 'W' APIs for compatibility, but they + just smash the data down to 8-bit and call the 'A' version for + you. + + + + + For More Information + The Unicode + FAQs page has copious information on this complex + topic. + + When it comes to Unix and UTF-8 specific items, the UTF-8 and + Unicode FAQ for Unix/Linux is a quicker way to find basic + information. + + ADDED doc/userman/userman.dbx Index: doc/userman/userman.dbx ================================================================== --- /dev/null +++ doc/userman/userman.dbx @@ -0,0 +1,55 @@ + + +%xinclude; +]> +
+ + MySQL++ v3.2.3 User Manual + + + + Kevin + Atkinson + + + + Sinisa + Milivojevic + + + + Monty + Widenius + + + + Warren + Young + + + + + 1998-2001, 2005-2015 + Kevin Atkinson (original author) + MySQL AB + Educational Technology Resources + + + + + + + + + + + + + + + + + +
ADDED doc/userman/userman.dbx.in Index: doc/userman/userman.dbx.in ================================================================== --- /dev/null +++ doc/userman/userman.dbx.in @@ -0,0 +1,55 @@ + + +%xinclude; +]> +
+ + MySQL++ v@MYSQLPP_VERSION_MAJOR@.@MYSQLPP_VERSION_MINOR@.@MYSQLPP_VERSION_BUGFIX@ User Manual + + + + Kevin + Atkinson + + + + Sinisa + Milivojevic + + + + Monty + Widenius + + + + Warren + Young + + + + + 1998-2001, 2005-2015 + Kevin Atkinson (original author) + MySQL AB + Educational Technology Resources + + + + + + + + + + + + + + + + + +
DELETED doc/userman/userman.xml Index: doc/userman/userman.xml ================================================================== --- doc/userman/userman.xml +++ /dev/null @@ -1,3291 +0,0 @@ - - - -
- - MySQL++ User Manual - - - - Kevin - Atkinson - - - - Sinisa - Milivojevic - - - - Monty - Widenius - - - - Warren - Young - - - - - 1998-2001, 2005 - Kevin Atkinson (original author) - MySQL AB - Educational Technology Resources - - - $Date: 2005-08-17 13:18:35 -0600 (Wed, 17 Aug 2005) $ - - - - - Introduction - - MySQL++ is a powerful C++ wrapper for MySQL's C API. - Its purpose is to make working with queries as easy as working - with STL containers. - - The latest version of MySQL++ can be found at - the official web - site. - - Support for MySQL++ can be had on the mailing - list. That page hosts the mailing list archives, and - tells you how you can subscribe. - - - - A Brief History of MySQL++ - - MySQL++ was created in 1998 by Kevin Atkinson. It - started out MySQL-specific, but there were early efforts - to try and make it database-independent, and call it - SQL++. This is where the old library name "sqlplus" - came from. This is also why the old versions prefixed - some class names with "Mysql" but not others: the others - were supposed to be the database-independent parts. - - Then in 1999, Sinisa Milivojevic unofficially - took over maintenance of the library, releasing - versions 1.0 and 1.1. (All of Kevin's releases were - pre-1.0 point releases.) Kevin gave over maintenance - to Sinisa officially with 1.2, and ceased to have any - involvement with the library's maintenance. Sinisa went - on to maintain the library through 1.7.9, released - in mid-2001. Since Sinisa is an employee of MySQL AB, it seems to - be during this time that the dream of multiple-database - compatibility died. - - With version 1.7.9, MySQL++ went into a period of - stasis, lasting over three years. During this time, Sinisa - ran the MySQL++ mailing list and supported its users, but - made no new releases. There were many patches submitted - during this period, some of which were ignored, others - which were just put on the MySQL++ web site for people to - try. A lot of these patches were mutually-incompatible, - and not all of them gave a fully-functional copy of - MySQL++. - - In early August of 2004, the current maintainer - (Warren Young) got fed up with this situation and took - over. He released 1.7.10 later that month. - - - - - If You Have Questions... - - If you want to email someone to ask questions about - this library, we greatly prefer that you send mail to - the MySQL++ - mailing list. The mailing list is archived, - so if you have questions, do a search to see if the - question has been asked before. - - You may find people's individual email addresses in - various files within the MySQL++ distribution. Please do - not send mail to them unless you are sending something - that is inherently personal. Not all of the principal - developers of MySQL++ are still active in its development; - those who have dropped out have no wish to be bugged - about MySQL++. Those of us still active in MySQL++ - development monitor the mailing list, so you aren't - getting any extra "coverage" by sending messages to - additional email addresses. - - - - - - Overview - - MySQL++ has developed into a very complex and powerful - library, with many different ways to accomplish the same - task. Unfortunately, this means that figuring out how to perform - a simple task can be frustrating for new users. In this section - we will provide an overview of the most important user-facing - components of the library. - - The overall process for using MySQL++ is similar to that of - most other database access APIs: - - - Open the connection - Form and execute the query - Iterate through the result set - Go to 2 :) - - - There is, however, a lot of extra functionality along each - step of the way. - - - - The Connection Object - - A - object manages the connection to the MySQL server. You - need at least one of these objects to do anything. A - Connection object can either create Query objects for - you, or you can execute queries directly through the - Connection object. The separate Query object is the - recommended way as it gives you far more power. - - - - - The Query Object - - A - object is the recommended way of building - and executing queries. It is subclassed from - std::stringstream - which means you can write to it like any other - C++ stream to form a query. The library includes - stream - manipulators that make it easy to generate - syntactically-correct SQL. - - You can also set up with - this class. Template queries work something like the - C printf() function: - you set up a fixed query string with tags inside that - indicate where to insert the variable parts. If you - have multiple queries that are structurally similar, - you simply set up one template query, and use that in - the various locations of your program. - - A third method for building queries is to - use (SSQLS). This feature - presents your results as a C++ data structure, instead of - making you access the data through MySQL++ intermediary - classes. It also reduces the amount of embedded SQL code - your program needs. - - - - - Result Sets - - The field data in a result set are stored in a - special std::string-like - class called - ColData. - This class has conversion operators - that let you automatically convert these - objects to any of the basic C data types. - Additionally, MySQL++ defines classes like - , - which you can initialize from a MySQL - DATETIME string. These - automatic conversions are protected against bad - conversions, and can either set a warning flag or throw an - exception, depending on how you set the library up. - - As for the result sets as a whole, MySQL++ has a - number of different ways of representing them: - - - Queries That Do Not Return Data - - Not all SQL queries return data. An - example is CREATE - TABLE. For these - types of queries, there is a special result type - () - that simply reports the - state resulting from the query: whether the - query was successful, how many rows it impacted - (if any), etc. - - - - Queries That Return Data: Dynamic Method - - The easiest way to - retrieve data from MySQL uses a - - object, which includes one or more - - objects. Because these classes are - std::vector-like - containers, you can treat the result set as a - two-dimensional array. For example, you can get - the 5th item on the 2nd row by simply saying - result[1][4]. You - can also access row elements - by field name, like this: - result[2].lookup_by_name("price"). - - An alternate way of accessing - your query results is through a - - object. This class acts more like an STL input - iterator than a container: you walk through - your result set one item at a time, always going - forward. You can't seek around in the result set, - and you can't know how many results are in the - set until you find the end. This method is more - efficient when there can be arbitrarily many - results, which could pose a memory allocation - problem with the previous technique. - - - - Queries That Return Data: Static Method - - The (SSQLS) feature - method above defines C++ structures that match the - table structures in your database schema. - - We call it the "static" method because the - table structure is fixed at compile time. Indeed, - some schema changes require that you update your - SSQLS definitions and recompile, or else the - program could crash or throw "bad conversion" - exceptions when MySQL++ tries to stuff the new - data into an outdated data structure. (Not all - changes require a recompile. Adding a column to - a table is safe, for instance, as the program - will ignore the new column until you update the - SSQLS definition.) - - The advantage of this method is that - your program will require very little embedded - SQL code. You can simply execute a query, and - receive your results as C++ data structures, - which can be accessed just as you would any - other structure. The results can be accessed - through the Row object, or you can ask the - library to dump the results into a sequential - or set-associative STL container for you. Consider - this: - - -vector<mystruct> v; -Query q = connection.query(); -q << "SELECT * FROM mytable"; -q.storein(v); -for (vector<mystruct>::iterator it = v.begin(); it != v.end(); ++it) { - cout << "Price: " << it->price << endl; -} - - Isn't that slick? - - - - - - Exceptions - - By default, the library throws whenever it encounters an - error. You can ask the library to set an error flag - instead, if you like, but the exceptions carry more - information. Not only do they include a string - member telling you why the exception was thrown, - there are several exception types, so you can - distinguish between different error types within a - single try - block. - - - - - - Tutorial - - This tutorial is meant to give you a jump start in using - MySQL++. While it is a very complicated and powerful library, - it's possible to make quite functional programs without tapping - but a fraction of its power. This section will introduce you to - the most useful fraction. - - This tutorial assumes you know C++ fairly well, - in particuler the Standard Template Library (STL) and - exceptions. - - - - Running the Examples - - All of the examples are complete running - programs. They may or may not be built for you already, - depending on how you installed the library. - - If you installed MySQL++ from the source - tarball on a Unixy system, the examples should - have been built along with the library. If not, - simply go into the examples directory and type - make. - - If you installed the library via - RPM, the examples are in the mysql++-devel - RPM. After installing that, the examples are in - /usr/src/mysql++/examples. - To build them, go into that directory - and type make -f - Makefile.simple. See the file - /usr/share/doc/mysql++-devel*/README.examples - for more details. - - If you are on a Windows system, the build process - for the library should have built the examples as - well. Where the programs are depends on which compiler - you're using. There should be a README.* file in the - distribution specific to your compiler with further - instructions. - - Once you have the examples building, you need - to initialize the sample database by running the - resetdb example. The - usage of resetdb is as follows: - - resetdb [host [user [password [port]]]] - - If you leave off host, localhost is assumed. If - you leave off user, your current username is assumed. If - you leave of the password, it is assumed that you don't - need one. And if you leave off the port, it will use - the standard MySQL port number. - - The user you give resetdb needs to be an account - with permission to create databases. Once the database is - created you can use any account that has full permission - to the sample database mysql_cpp_data. - - You may also have to re-run resetdb after - running some of the other examples, as they change the - database. - - - - - A Simple Example - - The following example demonstrates how to - open a connection, execute a simple query, and - display the results. This is - examples/simple1.cpp: - - - - - This example simply gets the entire "item" - column from the example table, and prints those - values out. - - Notice that MySQL++ lets you store - result sets in STL containers, such as - std::vector. - We iterate through the result set just as you would - with any other STL container. The only tricky bit is - the it->at(0) idiom. - This dereferences the iterator, which yields a object, on which we call - the at() method to - retrieve the first field. - - The only thing that isn't explicitly - handled in the code block above is that - we delegate connection establishment to - connect_to_db() - in the util module. - We do this only because that function also handles - the command line parsing for the examples, so they - have a consistent interface. - - - - - Examples' Utility Module - - I referred to the - util module - above. Following is the source for that module, - which also contains other functions used by other - examples. It isn't important to understand this module - in detail, but understanding its outlines will make - the following examples more clear. - - - - - This is actually an abridged version of util.cpp, - with the Unicode stuff removed. The interaction - between MySQL, MySQL++ and Unicode is covered in a - later chapter, . - - - - - A More Complicated Example - - The simple1 - example above was pretty trivial. Let's - get a little deeper. Here is - examples/simple2.cpp: - - - - - This example illustrates several new concepts. - - First, notice that we store the result set in - a object. Like - the a std::vector we - used in the simple1 - example, Result - is a container type, so iterating through it - is straightforward. The main difference is that - Result is less - distanced from the way the underlying MySQL C API - works, so it is somewhat more efficient. - - Second, we access each row's data indirectly - through a - object. This affords several nice features, such - as the ability to access a field by name. You can - also access fields by position, as we did in the - simple1 example, - which is more efficient, but makes your code less - flexible. - - - - - Exceptions - - By default, MySQL++ uses exceptions to signal - errors. Most of the examples have a full set of - exception handlers. This is worthy of emulation. - - All of MySQL++'s custom exceptions derive - from a common base class, . That in turn derives from the - Standard C++ exception base class, - std::exception. - Since the library can indirectly cause exceptions - to come from the Standard C++ Library, it's possible - to catch all exceptions from MySQL++ by just catching - std::exception by - reference. However, it's usually better to catch - the all of the concret eexception types that you - expect, and add a handler for - Exception or - std::exception to - act as a "catch-all" for unexpected exceptions. - - Some of these exceptions are optional. - When disabled, the object signals errors in - some other way, typically by returning an - error code or setting an error flag. Classes - that support this feature derive from - . - Moreover, when such an object creates another object - that also derives from this interface, it passes on its - exception flag. Since everything flows from the - - object, disabling exceptions on it at the start of - the program disables all optional exceptions. You can - see this technique at work in the "simple" examples, - which keeps them, well, simple. - - Real-world code typically can't afford to - lose out on the additional information and control - offered by exceptions. But at the same time, it is - still sometimes useful to disable exceptions - temporarily. To do this, put the section of code - that you want to not throw exceptions inside a - block, and create a object at the top of that - block. When created, it saves the exception flag - of the OptionalExceptions - derivative you pass to it, and then disables - exceptions on it. When the - NoExceptions object - goes out of scope at the end of the block, it - restores the exceptions flag to its previous state. - See examples/resetdb.cpp to - see this technique at work. - - When one - OptionalExceptions - derivative creates another such object and passes - on its exception flag, it passes a copy of the - flag. Therefore, the two objects' flags operate - independently after the new one is created. There's - no way to globally enable or disable this flag on - existing objects in a single call. - - There are a few classes of exceptions MySQL++ - can throw that are not optional: - - - The largest set of non-optional - exceptions are those from the Standard C++ - Library. For instance, if your code said - "row[21]" - on a row containing only 5 fields, the - std::vector - underlying the row object will throw an - exception. (It will, that is, if it conforms to - the standard.) You might consider wrapping your - program's main loop in a try block catching - std::exceptions, - just in case you trigger one of these - exceptions. - - ColData - will always throw - when you ask it to do an improper type - conversion. For example, you'll get an - exception if you try to convert "1.25" - to int, - but not when you convert "1.00" to - int. In - the latter case, MySQL++ knows that it - can safely throw away the fractional - part. - - If you use template - queries and don't pass enough parameters - when instantiating the template, - Query - will throw a - exception. - - - It's educational to modify the examples to - force exceptions. For instance, misspell a field - name, use an out-of-range index, or change a type - to force a ColData - conversion error. - - - - - Quoting and Escaping - - SQL syntax often requires certain data to be - quoted. Consider this query: - - -SELECT * FROM stock WHERE item = 'Hotdog Buns' - - Because the string "Hotdog Buns" contains a space, - it must be quoted. With MySQL++, you don't have to add - these quote marks manually: - - -string s = "Hotdog Buns"; -Query q = conn.query(); -q << "SELECT * FROM stock WHERE item = " << quote_only << s; - - That code produces the same query string - as in the previous example. We used the MySQL++ - quote_only - manipulator, which causes single quotes to be - added around the next item inserted into the - stream. This works for various string types, for any - type of data that can be converted to MySQL++'s - ColData - type, and for . (The next section - introduces the SSQLS feature.) - - Quoting is pretty simple, but SQL syntax also often - requires that certain characters be "escaped". Imagine - if the string in the previous example was "Frank's Brand Hotdog - Buns" instead. The resulting query would be: - - -SELECT * FROM stock WHERE item = 'Frank's Brand Hotdog Buns' - - That's not valid SQL syntax. The correct syntax is: - - -SELECT * FROM stock WHERE item = 'Frank''s Brand Hotdog Buns' - - As you might expect, MySQL++ - provides that feature, too, through its - escape - manipulator. But here, we want both quoting and - escaping. That brings us to the most widely useful - manipulator: - - -string s = "Frank's Brand Hotdog Buns"; -Query q = conn.query(); -q << "SELECT * FROM stock WHERE item = " << quote << s; - - The quote - manipulator both quotes strings, and escapes any - characters that are special in SQL. - - - - - Specialized SQL Structures - - - Retrieving data - - The next example introduces one of - the most powerful features of MySQL++: (SSQLS). This is - examples/custom1.cpp: - - - - - As you can see, SSQLS is very powerful. - - - - Adding data - - SSQLS can also be used to add data to a table. This - is examples/custom2.cpp: - - - - - That's all there is to it! - - There is one subtlety: MySQL++ automatically - quotes and escapes the data when building SQL - queries using SSQLS structures. It's efficient, - too: MySQL++ is smart enough to apply quoting - and escaping only for those data types that - actually require it. - - Because this example modifies the sample - database, you may want to run resetdb after - running this program. - - - - Modifying data - - It almost as easy to modify data with - SSQLS. This is - examples/custom3.cpp: - - - - - When you run the example you will notice - that in the WHERE clause only the 'item' field - is checked for. This is because SSQLS also also - less-than-comparable. - - Don't forget to run resetdb after running - the example. - - - - Less-than-comparable - - SSQLS structures can be sorted and - stored in STL associative containers as - demonstrated in the next example. This is - examples/custom4.cpp: - - - - - For more details on the SSQLS feature, see the chapter. - - - - - - Handling SQL Nulls - - There is no equivalent of SQL's null in the standard - C++ type system. - - The primary distinction is one of type: in SQL, - null is a column attribute, which affects whether - that column can hold a SQL null. This effectively - doubles the number of types in SQL. MySQL++ handles - this the same way SQL does: it provides the - Null - template to allow the creation of distinct "nullable" - versions of existing C++ types. For each column type - MySQL understands, the library instantiates this - template for the closest C++ type. (See the top of - lib/type_info.cpp - for the list.) - - Template instantiations are first-class types in - the C++ language, on par with any other type. You can - use nullable MySQL++ types anywhere you'd use the plain - version of that type, you can assign plain values to a - nullable object and vice versa, etc. - - There's a secondary distinction between SQL null and - anything available in the standard C++ type system: SQL - null is a distinct value, equal to nothing else. C++'s - NULL is ambiguous, - being equal to 0 in integer context, so MySQL++ has - a global null object - which which you can assign to any nullable object to - get a SQL null. - - By default, if you try to convert a SQL - null to a plain C++ data type, MySQL++ will throw a - - exception to enforce this distinction. If you insert - a SQL null into a C++ stream, you get "(NULL)". The - - "behavior" type encapsulates these two - rules; it is the default for one of template - Null's - parameters. To relax this distinction, you can - instantiate the Null - template with a different behavior type: - - or . - As you might guess from their names, SQL nulls using - these behaviors get converted to 0 or a blank C string, - respectively. - - - - - Which Query Type to Use? - - There are three major ways to execute a query in MySQL++: - Query::execute(), - Query::store(), and - Query::use(). Which should you - use, and why? - - execute() - is for queries that do not return data per - se. For instance, CREATE - INDEX. You do get back some - information from the MySQL server, which - execute() - returns to its caller in a - - object. In addition to the obvious — a flag stating - whether the query succeeded or not — this object also - contains things like the number of rows that the query - affected. If you only need the success status, there's - Query::exec(), which - just returns bool. - - If your query does pull data from - the database, the simplest option is - store(). - This returns a - object, which contains an in-memory copy of - the result set. The nice thing about this is - that Result - is a sequential container, like - std::vector, so you - can iterate through it forwards and backwards, access - elements with subscript notation, etc. There are also - the storein() methods, - which actually put the result set into an STL container - of your choice. The downside of these methods is that - a sufficiently large result set will give your program - memory problems. - - For these large result sets, the superior - option is a use() - query. This returns a object, which is similar to Result, - but without all of the random-access features. This - is because a "use" query tells the database server - to send the results back one row at a time, to be - processed linearly. It's analogous to a C++ stream's - input iterator, as opposed to a random-access - iterator that a container like vector offers. By - accepting this limitation, you can process arbitrarily - large result sets. This technique is demonstrated - in examples/simple3.cpp: - - - - - This example does the same thing as - simple2, only with a "use" - query instead of a "store" query. If your program - uses exceptions, you should instead look at - examples/usequery.cpp, which - does the same thing as simple, - but with exception-awareness. - - - - - Getting Field Meta-Information - - The following example demonstrates how to get - information about the fields in a result set, such - as the name of the field and the SQL type. This is - examples/fieldinf1.cpp: - - - - - - - - Let's Do Something Useful - - These next few examples demonstrate just how powerful - C++ can be, allowing you to do a lot of work in few lines of - code without losing efficiency. - - Since the code is meant to be re-used as-is, - constants that can differ from one case to another have - been grouped in order to simplify editing. Also, all of - these examples have full error checking code, showing off - the power of MySQL++'s exception handling features. - - - Loading binary file in a BLOB column - - Since MySQL 3.23, BLOB columns have - been available, but their use is sometimes - not straightforward. Besides showing how - easy it can be with MySQL++, this example - demonstrates several features of MySQL++. - The program requires one command line - parameter, which is a full path to the - binary file. This is - examples/load_file.cpp: - - - - - Notice that we used the - escape - manipulator when building the INSERT query - above. This is because we're not using one of - the MySQL++ types that does automatic escaping - and quoting. - - - - Displaying images in HTML from BLOB column - - This example is also a very short - one, considering the function that it - performs. Although all modern versions of - MySQL have a command that dumps data from a BLOB - column to a binary file, this example shows - how to do it in your code instead, without - requiring an temporary file on disk. This is - examples/cgi_image.cpp: - - - - - - - DELETE or UPDATE from SELECT - - MySQL's SELECT statement has more - power to winnow out just the items of - interest from the database than do DELETE - or UPDATE queries. Therefore, many people - have wanted the ability to execute a SELECT - statement that in fact deletes or updates - the rows matched, rather than returning - them. This example implements that feature - in just a few lines of code. It is - examples/updel.cpp: - - - - - Notice that the row values - used in the IN clause aren't escaped or - quoted. This is because row elements are - ColData - types, so they have automatic escaping and - quoting, as appropriate to the type being - inserted. If you want to disable this feature, - it's easily done: click the ColData link for - the details. - - Users of this example should beware that - one more check is required in order to run this - query safely: in some extreme cases, the size - of the query might grow larger than MySQL's - maximum allowed packet size. This check should - be added. - - - - - - - Template Queries - - Another powerful feature of MySQL++ is being able - to set up template queries. These are kind of like C's - printf() facility: you - give MySQL++ a string containing the fixed parts of the - query and placeholders for the variable parts, and you can - later substitute in values into those placeholders. - - The following program demonstrates how to use this - feature. This is examples/resetdb.cpp, - the program you've run a few times now if you've worked - through all the examples: - - - - - The line just before the call to - query.parse() sets the - template, and the parse call puts it into effect. From - that point on, you can re-use this query by calling any - of several Query member functions that accept query - template parameters. In this example, we're using - Query::execute(). - - Let's dig into this feature a little deeper. - - - - Setting up template queries - - To set up a template query, you simply insert it into - the Query object, using numbered placeholders wherever you - want to be able to change the query. Then, you call the - parse() function to tell the Query object that the query - string is a template query, and it needs to parse it: - - -query << "select (%2:field1, %3:field2) from stock where %1:wheref = %0q:what"; -query.parse(); - - The format of the placeholder is: - - -%###(modifier)(:name)(:) - - Where '###' is a number up to three - digits. It is the order of parameters given to a - object, - starting from 0. - - 'modifier' can be any one of the following: - -
- - - - - - % - Print an actual "%" - - - "" - Don't quote or escape no matter what. - - - q - This will quote and escape - the item using the MySQL C API - function if it is a string or char *, - or another MySQL-specific type - that needs to be quoted. - - - Q - Quote but don't escape - based on the same rules as for 'q'. This - can save a bit of processing time if you - know the strings will never need - quoting - - - r - Always quote and escape - even if it is a number. - - - R - Always quote but - don't escape even if it is - a number. - - - - -
- - ":name" is for an optional name which aids - in filling SQLQueryParms. Name can contain any - alpha-numeric characters or the underscore. You can - have a trailing colon, which will be ignored. If - you need to represent an actual colon after the name, - follow the name with two colons. The first one will end - the name and the second one won't be processed. -
- - - - Setting the parameters at execution time - - To specify the parameters when - you want to execute a query simply - use Query::store(const - SQLString &parm0, [..., const SQLString - &parm11]). This - type of multiple overload also exists for - Query::use() and - Query::execute(). - 'parm0' corresponds to the first parameter, - etc. You may specify up to 12 parameters. For - example: - - -Result res = query.store("Dinner Rolls", "item", "item", "price") - - with the template query provided above - would produce: - - -select (item, price) from stock where item = "Dinner Rolls" - - The reason we didn't put the template parameters in - numeric order... - - -select (%0:field1, %1:field2) from stock where %2:wheref = %3q:what - - ...will become apparent shortly. - - - - - Using defaults - - You can also set the parameters one at - a time by means of class Query's public data - member def. To change the values of the def, - simply use the subscript operator. You can - refer to the parameters either by number or by - name. The following two examples have the same effect: - - -query.def[0] = "Dinner Rolls"; -query.def[1] = "item"; -query.def[2] = "item"; -query.def[3] = "price"; - - and - - -query.def["what"] = "Dinner Rolls"; -query.def["wheref"] = "item"; -query.def["field1"] = "item"; -query.def["field2"] = "price"; - - Once all the parameters are set simply - execute as you would have executed the query - before you knew about template queries: - - -Result res = query.store() - - - - - Combining the two - - You can also combine the use of - setting the parameters at execution time and - setting them via the def object by calling - Query::store() - (or use() - or execute()) - without passing the full number of parameters - that the template supports: - - -query.def["field1"] = "item"; -query.def["field2"] = "price"; -Result res1 = query.store("Hamburger Buns", "item"); -Result res2 = query.store(1.25, "price"); - - Would store the query: - - -select (item, price) from stock where item = "Hamburger Buns" - - for res1 and - - -select (item, price) from stock where price = 1.25 - - for res2. - - Now you see why we ordered the placeholders - in the template above as we did: we used positions - 0 and 1 for the ones we want to change frequently, - and used 2 and 3 for the parameters that seldom - change. - - One thing to watch out for, however, - is that Query::store(const - char* q) is also defined for - executing the query q. Therefore, when you call - Query::store() - (or use(), - or execute()) - with only one item and that item is a const - char*, you need to explicitly convert it into - a SQLString to get the right overload: - - -Result res = query.store(SQLString("Hamburger Buns")); - - - - - Error Handling - - If for some reason you did not specify all - the parameters when executing the query and the - remaining parameters do not have their values - set via def, the query object will throw a - - object. If this happens, you - can get an explanation of what - happened by checking the value of - SQLQueryNEParms::string, - like so: - - -query.def["field1"] = "item"; -query.def["field2"] = "price"; -Result res = query.store(1.25); - - This would throw - SQLQueryNEParms - because the wheref is not specified. - - In theory, this exception should never be - thrown. If the exception is thrown it probably - a logic error in your program. - -
- - - - Specialized SQL Structures - - The Specialized SQL Structure (SSQLS) feature lets you - easily define C++ structures that match the form of your SQL - tables. Because of the extra functionality that this feature - builds into these structures, MySQL++ can populate them - automatically when retrieving data from the database; with - queries returning many records, you can ask MySQL++ to populate - an STL container of your SSQLS records with the results. When - updating the database, MySQL++ can use SSQLS structures to match - existing data, and it can insert SSQLS structures directly into - the database. - - You define an SSQLS using one of several macros. (These - are in the file custom.h, and in the file that it includes, - custom-macros.h.) There are a bunch of different macros, for - different purposes. The following sections will discuss each - macro type separately, beginning with the easiest and most - generally useful. - - - - sql_create - - This is the most basic sort of SSQLS declaration: - - -sql_create_5(stock, 0, 0, - string, item, - int, num, - double, weight, - double, price, - mysqlpp::Date, date) - - This creates a C++ structure called 'stock' - containing five member variables, along with some - constructors and other member functions useful with - MySQL++. - - One of the generated constructors takes a reference - to a mysqlpp::Row object, allowing you to easily populate - a vector of stocks like so: - - -vector<stock> result; -query.storein(result); - - That's all there is to it. The only requirements - are that the table structure be compatible with the - SSQLS's member variables, and that the fields are in - the same order. - - The general format of this set of macros is: - - -sql_create_#(NAME, KEYS, INITPARMS, TYPE1, ITEM1, ... TYPE#, ITEM#) - - Where # is the number of member variables, - NAME is the name of the structure you wish to create, - TYPEx is the type name for a - member variable, and ITEMx is that - variable's name. - - The KEYS and INITPARMS arguments can always be zero, - to keep things simple. We will discuss what happens if - you use different values in the next few sections. - - - - - sql_create with Compare - - SSQLS structures can also have member functions that - allow you to compare one structure to another. You simply - change the first 0 in the previous example (KEYS) to a - higher value. If this number is N, then two structures - are considered equal if the first N members of each - are equal. - - For example: - - -sql_create_5(stock, 1, 0, - string, item, - int, num, - double, weight, - double, price, - mysqlpp::Date, date) - - Here we are saying that the 'item' field is a kind - of key field: it is always unique between any two 'stock' - items, so if two stock records have equal item values, - they are the same stock item. - - That change adds the following members to the - SSQLS: - - -struct stock { - ... - stock(const std::string &p1); - set(const std::string &p1); - bool operator ==(const stock &other) const; - bool operator !=(const stock &other) const; - bool operator >(const stock &other) const; - bool operator <(const stock &other) const; - bool operator >=(const stock &other) const; - bool operator <=(const stock &other) const; - int cmp(const stock &other) const; - int compare(const stock &other) const; -} - -int compare(const stock &x, const stock &y); - - The global - compare() - function compares x to y and returns <0 if - x < y, 0 if x = y, and >0 if x > y. - stock::cmp() and - stock::compare() - are the same thing as compare(*this, - other). - - The additional constructor initializes the key - fields of the structure and leaves the other member - variables undefined. This is useful for creating temporary - objects to use for comparisons like x - <= stock("Hotdog"). - - Because stock is now less-than-comparable you - can store the query results in an STL associative - container: - - -std::set<stock> result; -query.storein(result); - - And you can now use it like any other set: - - -cout << result.lower_bound(stock("Hamburger"))->item << endl; - - This will return the first item that begins with - "Hamburger". - - You can also use it will any STL algorithm that - require the values to be less-than-comparable. - - - - - sql_create with Additional Initializers - - If third parameter for this macro (INITPARMS) is - nonzero, the SSQLS will have two additional members - functions that make it easier to initialize the - structure's data members. For example: - - -sql_create_5(stock, 1, 5, - string, item, - int, num, - double, weight, - double, price, - mysqlpp::Date, date) - - will add these functions to the structure relative to - that in the previous example: - - -struct stock { - ... - stock(const string&, const int&, const double&, - const double&, const mysqlpp::Date&); - void set(const string&, const int&, const double&, - const double&, const mysqlpp::Date&); -} - - There is one trick with this: because each SSQLS - has at least one other constructor besides the one - defined by this feature, not every logical value for - INITPARMS results in working code. A simple example is - setting KEYS and INITPARMS to the same value: you get - two identical constructor definitions, so the compiler - refuses to compile the code. If you are getting compiler - errors having to do with duplicate definitions, try - changing this value to zero. - - - - - An Important Limitation of sql_create - - The features described in the two previous sections - work together nicely most of the time. However, if you try - to use the same value for the second and third parameters to - sql_create_N, your - program will fail to compile. - - Why is this? - - The second parameter sets up SSQLS comparisons, - one aspect of which defines a constructor taking just - the table's key fields. The third parameter sets up - an initialization constructor, taking as many fields - as you request. When these two values are equal, - you get two identical constructor definitions, - which is illegal in C++. - - The solution is to use 0 for the third - parameter, indicating that you do not need - a separate full-initialization constructor. - examples/custom6.cpp illustrates - this: - - - - - This example shows one other thing, which - is how to retrieve a subset of a table using - SSQLS. Because we wanted only one column from the - table, we had to pass 0 for the third parameter to - sql_create_N to get - the code to compile. - - (See the simple3 example in the for another way to accomplish - the same thing.) - - - - - Additional Features of Specialized SQL Structures - - Up to this point, we haven't been using - all of the features in the SSQLS structures - we've been generating. We could have used the - sql_create_basic_* - macros instead, which would have worked just as well - for what we've seen so far, and the generated code would - have been smaller. - - Why is it worth ignoring the "basic" variants of - these macros, then? Consider this: - - -query.insert(s); - - This does exactly what you think it does: - it inserts 's' into the database. This is possible - because a standard SSQLS has functions that the - query object can call to get the list of fields - and such, which it uses to build an insert query. - query::update() and - query::replace() also - rely on this SSQLS feature. A basic SSQLS lacks these - functions. - - Another feature of standard SSQLSes you might find - a use for is changing the table name used in queries. By - default, the table in the MySQL database is assumed to - have the same name as the SSQLS structure type. But if - this is inconvenient, you can globally change the table - name used in queries like this: - - -stock::table() = "MyStockData"; - - - - - Harnessing SSQLS Internals - - Continuing the discussion in the - previous section, there is a further set of - methods that the non-"basic" versions of the - sql_create macros - define for each SSQLS. These methods are mostly for - use within the library, but some of them are useful - enough that you might want to harness them for your - own ends. Here is some pseudocode showing how the - most useful of these methods would be defined for the - stock structure used - in all the custom*.cpp - examples: - - -// Basic form -template <class Manip> -stock_value_list<Manip> value_list(cchar *d = ",", - Manip m = mysqlpp::quote) const; - -template <class Manip> -stock_field_list<Manip> field_list(cchar *d = ",", - Manip m = mysqlpp::do_nothing) const; - -template <class Manip> -stock_equal_list<Manip> equal_list(cchar *d = ",", - cchar *e = " = ", Manip m = mysqlpp::quote) const; - - -// Boolean argument form -template <class Manip> -stock_cus_value_list<Manip> value_list([cchar *d, [Manip m,] ] - bool i1, bool i2 = false, ... , bool i5 = false) const; - -// List form -template <class Manip> -stock_cus_value_list<Manip> value_list([cchar *d, [Manip m,] ] - stock_enum i1, stock_enum i2 = stock_NULL, ..., - stock_enum i5 = stock_NULL) const; - -// Vector form -template <class Manip> -stock_cus_value_list<Manip> value_list([cchar *d, [Manip m,] ] - vector<bool> *i) const; - -...Plus the obvious equivalents for field_list() and equal_list() - - Rather than try to learn what all of these methods - do at once, let's ease into the subject. Consider this - code: - - -stock s("Dinner Rolls", 75, 0.95, 0.97, "1998-05-25"); -cout << "Value list: " << s.value_list() << endl; -cout << "Field list: " << s.field_list() << endl; -cout << "Equal list: " << s.equal_list() << endl; - - That would produce something like: - - -Value list: 'Dinner Rolls',75,0.95,0.97,'1998-05-25' -Field list: item,num,weight,price,date -Equal list: item = 'Dinner Rolls',num = 75,weight = 0.95, price = 0.97,date = '1998-05-25' - - That is, a "value list" is a list of data member - values within a particular SSQLS instance, a "field list" - is a list of the fields (columns) within that SSQLS, - and an "equal list" is a list in the form of an SQL - equals clause. - - Just knowing that much, it - shouldn't surprise you to learn that - Query::insert() is - implemented more or less like this: - - -*this << "INSERT INTO " << v.table() << " (" << v.field_list() << - ") VALUES (" << v.value_list() << ")"; - - where 'v' is the SSQLS you're asking the - Query object to insert into the database. - - Now let's look at a complete example, - which uses one of the more complicated forms of - equal_list(). This - example builds a query with fewer hard-coded strings - than the most obvious technique requires, which - makes it more robust in the face of change. Here is - examples/custom5.cpp: - - - - - This example uses the list form of - equal_list(). The - arguments stock_weight - and stock_price - are enum values equal to the position of these columns - within the stock table. - sql_create_x - generates this enum for you automatically. - - The boolean argument form of that - equal_list() call would - look like this: - - -query << "select * from stock where " << - res[0].equal_list(" and ", false, false, true, true, false); - - It's a little more verbose, as you can - see. And if you want to get really complicated, - use the vector form: - - -vector<bool> v(5, false); -v[stock_weight] = true; -v[stock_price] = true; -query << "select * from stock where " << - res[0].equal_list(" and ", v); - - This form makes the most sense if you are - building many other queries, and so can re-use that - vector object. - - Many of these methods accept manipulators and custom - delimiters. The defaults are suitable for building SQL - queries, but if you're using these methods in a different - context, you may need to override these defaults. For - instance, you could use these methods to dump data to a - text file using different delimiters and quoting rules - than SQL. - - At this point, we've seen all the major aspects - of the SSQLS feature. The final sections of this chapter - look at some of the peripheral aspects. - - - - - Alternate Creation Methods - - If for some reason you want your SSQLS data members to - have different names than used in the MySQL database, you can do - so like this: - - -sql_create_c_names_5(stock, 1, 5, - string, item, "item", - int, num, "quantity", - double, weight, "weight", - double, price, "price" - mysqlpp::Date, date, "shipment") - - If you want your SSQLS to have its data members - in a different order from those in the MySQL table, - you can do it like this: - - -sql_create_c_order_5(stock, 2, 5, - mysqlpp::Date, date, 5, - double, price, 4, - string, item, 1, - int, num, 2, - double, weight, 3) - - You can combine the custom names and custom ordering like - this: - - -sql_create_complete_5(stock, 2, 5, - mysqlpp::date, date, "shipment", 5, - double, price, "price", 4, - string, item, "item", 1, - int, num, "quantity", 2, - double, weight, "weight", 3) - - All three of these macro types have "basic" - variants that work the same way. Again, basic SSQLSes - lack the features necessary for automatic insert, update - and replace query creation. - - - - - Expanding SSQLS Macros - - If you ever need to see the code that a given SSQLS - declaration expands out to, use the utility - doc/ssqls-pretty, like so: - - -ssqls-pretty < myprog.cpp |less - - This locates the first SSQLS declaration in that - file and uses the C++ preprocessor to expand that - macro. You may have to change the script to tell it - where your MySQL++ header files are. - - - - - Extending the SSQLS Mechanism - - The SSQLS headers — custom.h and - custom-macros.h — are automatically generated - by the Perl script custom.pl. Although it is possible - to change this script to get additional functionality, - it's usually better to do that through inheritance. - - A regular user may find it helpful to change - the the limit on the maximum number of SSQLS data - members allowed. It's 25 out of the box. A smaller - value may speed up compile time, or you may require - a higher value because you have more complex tables - than that. Simply change the - max_data_members - variable at the top of custom.pl and say 'make'. - The limit for Visual C++ is 31, according to one - report. There doesn't seem to be a practical limit - with GCC 3.3 at least: I set the limit to 100 and - the only thing that happened is that custom-macros.h - went from 1.3 MB to 18 MB and the build time for - examples/custom.* got a lot - longer. - - - - - - Using Unicode with MySQL++ - - - A Short History of Unicode - ...with a focus on relevance to MySQL++ - - In the old days, computer operating systems only - dealt with 8-bit character sets. This only gives you 256 - possible characters, but the modern Western languages have - more characters combined than that by themselves. Add in - all the other lanauges of the world, plus the various - symbols people use, and you have a real mess! Since no - standards body held sway over things like international - character encoding in the early days of computing, many - different character sets were invented. These character - sets weren't even standardized between operating systems, - so heaven help you if you needed to move localized Greek - text on a Windows machine to a Russian Macintosh! The only - way we got any international communication done at all - was to build standards on the common 7-bit ASCII subset. - Either people used approximations like a plain "c" instead - of the French "ç", or they invented things like - HTML entities ("&ccedil;" in this case) to encode - these additional characters using only 7-bit ASCII. - - Unicode solves this problem. It encodes every - character in the world, using up to 4 bytes per - character. The subset covering the most economically - valuable cases takes two bytes per character, so most - Unicode-aware programs deal in 2-byte characters, - for efficiency. - - Unfortunately, Unicode came about two - decades too late for Unix and C. Converting the - Unix system call interface to use multi-byte - Unicode characters would break all existing - programs. The ISO lashed a wide character sidecar - onto C in 1995, but in common practice C is still - tied to 8-bit characters. - - As Unicode began to take off in the early 1990s, - it became clear that some sort of accommodation - with Unicode was needed in legacy systems like - Unix and C. During the development of the Plan - 9 operating system (a kind - of successor to Unix) Ken Thompson invented - the UTF-8 - encoding. UTF-8 is a superset of 7-bit ASCII - and is compatible with C strings, since it doesn't use 0 - bytes anywhere as multi-byte Unicode encodings do. As a - result, many programs that deal in text will cope with - UTF-8 data even though they have no explicit support - for UTF-8. (Follow the last link above to see how the - design of UTF-8 allows this.) - - The MySQL database server comes out of the - Unix/C tradition, so it only supports 8-bit characters - natively. All versions of MySQL could store UTF-8 data, - but sometimes the server actually needs to understand - the data; when sorting, for instance. To support this, - explicit UTF-8 support was added to MySQL in version - 4.1. - - Because MySQL++ does not need to - understand the text flowing through it, it - neither has nor needs explicit UTF-8 support. - C++'s std::string - stores UTF-8 data just fine. But, your program probably - does care about the text it gets - from the database via MySQL++. The remainder of this - chapter covers the choices you have for dealing with - UTF-8 encoded Unicode data in your program. - - - - - Unicode and Unix - - Modern Unices support UTF-8 natively. Red Hat Linux, - for instance, has had system-wide UTF-8 support since - version 8. This continues in the Enterprise and Fedora - forks of Red Hat Linux, of course. - - On such a Unix, the terminal I/O code understands - UTF-8 encoded data, so your program doesn't require any - special code to correctly display a UTF-8 string. If you - aren't sure whether your system supports UTF-8 natively, - just run the simple1 example: if the first item has - two high-ASCII characters in place of the "ü" in - "Nürnberger Brats", you know it's not handling - UTF-8. - - If your Unix doesn't support UTF-8 natively, - it likely doesn't support any form of Unicode at all, - for the historical reasons I gave above. Therefore, - you will have to convert the UTF-8 data to the - local 8-bit character set. The standard Unix - function iconv() - can help here. If your system doesn't have the - iconv() facility, there - is a - free implementation available from the GNU - Project. Another library you might check out is IBM's - ICU. This - is rather heavy-weight, so if you just need basic - conversions, iconv() - should suffice. - - - - - Unicode and Win32 - - Each Win32 API function that takes - a string actually has two two versions. One - version supports only 1-byte "ANSI" characters (a - superset of ASCII), so they end in 'A'. Win32 also - supports the 2-byte subset of Unicode called UCS-2. - Some call these "wide" characters, so the other - set of functions end in 'W'. The MessageBox() - API, for instance, is actually a macro, - not a real function. If you define the - UNICODE - macro when building your program, the - MessageBox() - macro evaluates to - MessageBoxW(); otherwise, - to MessageBoxA(). - - Since MySQL uses UTF-8 and Win32 uses UCS-2, - you must convert data going between the Win32 - API and MySQL++. Since there's no point in trying - for portability — no other OS I'm aware of - uses UCS-2 — you might as well use native - Win32 functions for doing this translation. The following code - is distilled from utf8_to_win32_ansi() - in examples/util.cpp: - - -void utf8_to_win32_ansi(const char* utf8_str, char* ansi_str, int ansi_len) -{ - wchar_t ucs2_buf[100]; - static const int ub_chars = sizeof(ucs2_buf) / sizeof(ucs2_buf[0]); - - MultiByteToWideChar(CP_UTF8, 0, utf8_str, -1, ucs2_buf, ub_chars); - CPINFOEX cpi; - GetCPInfoEx(CP_OEMCP, 0, &cpi); - WideCharToMultiByte(cpi.CodePage, 0, ucs2_buf, -1, - ansi_str, ansi_len, 0, 0); -} - - The examples use this function automatically on - Windows systems. To see it in action, run simple1 in - a console window (a.k.a. "DOS box"). The first item - should be "Nürnberger Brats". If not, see the - last paragraph in this section. - - utf8_to_win32_ansi() - converts utf8_str - from UTF-8 to UCS-2, and from there to the local code - page. "Waitaminnit," you shout! "I thought we - were trying to get away from the problem of local code - pages!" The console is one of the few Win32 facilities - that doesn't support UCS-2 by default. It can be put - into UCS-2 mode, but that seems like more - work than we'd like to go to in a portable example - program. Since the default code page in most versions - of Windows includes the "ü" character used in the - sample database, this conversion works out fine for our - purposes. - - If your program is using the GUI to display - text, you don't need the second conversion. Prove - this to yourself by adding the following to - utf8_to_win32_ansi() - after the - MultiByteToWideChar() - call: - - -MessageBox(0, ucs2_buf, "UCS-2 version of Item", MB_OK); - - All of this assumes you're using Windows NT or one - of its direct descendants: Windows 2000, Windows XP, - Windows 2003 Server, and someday "Longhorn". Windows - 95/98/ME and Windows CE do not support UCS-2. They - still have the 'W' APIs for compatibility, but they - just smash the data down to 8-bit and call the 'A' - version for you. - - - - - For More Information - The Unicode - FAQs page has copious information on - this complex topic. - - When it comes to Unix - and UTF-8 specific items, the UTF-8 - and Unicode FAQ for Unix/Linux is a - quicker way to find basic information. - - - - - - Incompatible Library Changes - - This chapter documents those library changes since - the epochal 1.7.9 release that break end-user programs. You - can dig this stuff out of the ChangeLog, but the ChangeLog - focuses more on explaining and justifying the facets of each - change, while this section focuses on how to migrate your - code between these library versions. - - Since pure additions do not break programs, those - changes are still documented only in the ChangeLog. - - - - API Changes - - This section documents files, functions, - methods and classes that were removed or changed - in an incompatible way. If your program uses the - changed item, you will have to change something in - your program to get it to compile after upgrading to - each of these versions. - - - v1.7.10 - - Removed - Row::operator[]() - overloads except the one for - size_type, - and added - Row::lookup_by_name() - to provide the "subscript by - string" functionality. In practical - terms, this change means that the - row["field"] - syntax no longer works; you must use the new - lookup_by_name - method instead. - - Renamed the generated - library on POSIX systems from - libsqlplus to - libmysqlpp. - - - - - v1.7.19 - - Removed - SQLQuery::operator=(), - and the same for its - Query - subclass. Use the copy constructor instead, if you need to copy - one query to another query object. - - - - - v1.7.20 - - The library used to have two names for - many core classes: a short one, such as - Row - and a longer one, - MysqlRow. The - library now uses the shorter names - exclusively. - - All symbols within MySQL++ are in the - mysqlpp - namespace now if you use the new - mysql++.h - header. If you use the older - sqlplus.hh - or mysql++.hh - headers, these symbols are hoist up into the - global namespace. The older headers cause the - compiler to emit warnings if you use them, - and they will go away someday. - - - - - v2.0.0 - - - Library-wide changes - - Where possible, all distributed - Makefiles only build dynamic - libraries. (Shared objects on most - Unices, DLLs on Windows, etc.) Unless - your program is licensed under the GPL - or LGPL, you shouldn't have been using - the static libraries from previous - versions anyway. - - - - - Connection class changes - - - Connection::create_db() - and - drop_db() - return - true - on success. They returned - false - in v1.7.x! - This change will only - affect your code if - you have exceptions - disabled. - - Renamed - Connection::real_connect() - to - connect(), - made several more - of its parameters - default, and removed the old - connect() - method, as it's now a strict - subset of the new one. The - only practical consequence is - that if your program was using - real_connect(), - you will have to change it to - connect(). - - Replaced - Connection::read_option() - with new - set_option() - mechanism. In addition - to changing the name, - programs using this function - will have to use the new - Connection::Option - enumerated values, accept a - true - return value as meaning - success instead of 0, and - use the proper argument - type. Regarding the latter, - read_option() - took a const - char* - argument, but because it was - just a thin wrapper over - the MySQL C API function - , the actual - value being pointed to could - be any of several types. This - new mechanism is properly - type-safe. - - - - - - Exception-related changes - - - Classes - Connection, - Query, - Result, - ResUse, - and - Row - now derive from - - which gives these classes a - common interface for disabling - exceptions. In addition, - almost all of the per-method - exception-disabling flags were - removed. The preferred method - for disabling exceptions on - these objects is to create - an instance of the new - - class on the stack, which - disables exceptions on an - OptionalExceptions - subclass as long as the - NoExceptions - instance is in - scope. You can instead call - disable_exceptions() - on any of these objects, - but if you only want them - disabled temporarily, it's - easy to forget to re-enable - them later. - - In the - previous version of MySQL++, - those classes that supported - optional exceptions that - could create instances of - other such classes were - supposed to pass this flag - on to their children. That - is, if you created a - Connection - object with exceptions enabled, - and then asked it to create a - Query - object, the - Query - object also had exceptions - disabled. The problem is, this - didn't happen in all cases - where it should have in v1.7. - This bug is fixed in v2.0. If - your program begins crashing - due to uncaught exceptions - after upgrading to v2.0, this - is the most likely cause. The - most expeditious fix in this - situation is to use the new - NoExceptions - feature to return these - code paths to the v1.7 - behavior. A better fix is - to rework your program to - avoid or deal with the new - exceptions. - - All - custom MySQL++ exceptions - now derive from the new - - interface. The practical - upshot of this is that the - variability between the - various exception types has - been eliminated. For instance, - to get the error string, the - BadQuery - exception had a - string member called - error - plus a method called - what(). - Both did the - same thing, and the - what() - method is more common, so the - error string was dropped from - the interface. None of the - example programs had to be - changed to work with the new - exceptions, so if your program - handles MySQL++ exceptions - the same way they do, your - program won't need to change, - either. - - Renamed - SQLQueryNEParams - exception to - BadParamCount - to match style of other - exception names. - - Added - , - , - , - , - , - , and - - exception types, - to fix overuse of - BadQuery. - Now the latter is used - only for errors on query - execution. If your program has - a "catch-all" block taking a - std::exception - for each try block containing - MySQL++ statements, you - probably won't need to change - your program. Otherwise, - the new exceptions will - likely show up as program - crashes due to unhandled - exceptions. - - - - - - Query class changes - - - In - previous versions, - Connection - had a querying - interface similar to class - Query's. - These methods - were intended only for - Query's - use; no example ever used - this interface directly, - so no end-user code is - likely to be affected by - this change. - - A more likely - problem arising from the above - change is code that tests for - query success by calling the - Connection - object's - success() - method or by casting it to - bool. - This will now give misleading - results, because queries - no longer go through the - Connection - object. Class - Query - has the same success-testing - interface, so use it - instead. - - Query - now derives from - std::ostream - instead of - std::stringstream. - - - - - - Result/ResUse class changes - - - Renamed - ResUse::mysql_result() - to - raw_result() - so it's database server - neutral. - - Removed - ResUse::eof(), - as it wrapped the deprecated - and unnecessary MySQL C API - function . See the - simple2 - and - usequery - examples to see the proper - way to test for the end of - a result set. - - - - - - Row class changes - - - Removed - "field name" form of - Row::field_list(). - It was - pointless. - - Row - subscripting works more like - v1.7.9: one can subscript a - Row - with a string (e.g. - row["myfield"]), - or with an integer (e.g. - row[5]). - lookup_by_name() - was removed. Because - row[0] - is ambiguous (0 could mean - the first field, or be a null - pointer to const - char*), - there is now - Row::at(), - which can look up any field by - index. - - - - - - Miscellaneous changes - - - Removed the - backwards-compatibility headers - sqlplus.hh - and - mysql++.hh. - If you were still using these, - you will have to change to - mysql++.h, - which will put all symbols - in namespace - mysqlpp. - - Can no - longer use arrow operator - (->) - on the iterators into the - Fields, - Result - and - Row - containers. - - - - - - - - ABI Changes - - This section documents those library changes - that require you to rebuild your program so that it - will link with the new library. Most of the items - in the previous section are also ABI changes, but - this section is only for those items that shouldn't - require any code changes in your program. - - If you were going to rebuild your program after - installing the new library anyway, you can probably - ignore this section. - - - - v1.7.18 - - The - Query - classes now subclass from - stringstream - instead of the deprecated - strstream. - - - - - v1.7.19 - - Fixed several - const-incorrectnesses - in the Query - classes. - - - - - v1.7.22 - - Removed "reset query" parameters from - several Query - class members. This is not an API change, - because the parameters were given default - values, and the library would ignore any value - other than the default. So, any program that - tried to make them take another value wouldn't - have worked anyway. - - - - - v1.7.24 - - Some freestanding functions didn't - get moved into namespace - mysqlpp when that namespace - was created. This release fixed that. It - doesn't affect the API if your program's - C++ source files say using - namespace mysqlpp within - them. - - - - - v2.0.0 - - Removed - Connection::infoo(). - (I'd call this an API change if I thought - there were any programs out there actually - using this...) - - Collapsed the - Connection - constructor taking a bool (for setting - the throw_exceptions flag) and the default - constructor into a single constructor using - a default for the parameter. - - Classes - Connection - and Query - are now derived from the - Lockable - interface, instead of implementing their own - lock/unlock functions. - - In several instances, functions that - took objects by value now take them by const - reference, for efficiency. - - Merged - SQLQuery - class's members into class - Query. - - Merged - RowTemplate - class's members into class - Row. - - Reordered member variable declarations - in some classes. The most common instance is - when the private section was declared before - the public section; it is now the opposite - way. This can change the object's layout in - memory, so a program linking to the library - must be rebuilt. - - Simplified the date - and time class hierarchy. - - used to derive from - mysql_date, - - used to derive from - mysql_time, - and - used to derive from both of those. All - three of these classes used to derive from - mysql_dt_base. - All of the - mysql_* - classes' functionality and data has - been folded into the leaf classes, - and now the only thing shared between - them is their dependence on the - - template. Since the leaf classes' interface has - not changed and end-user code shouldn't have - been using the other classes, this shouldn't - affect the API in any practical way. - - mysql_type_info - now always initializes its private - num member. - Previously, this would go uninitialized if - you used the default constructor. Now there - is no default ctor, but the ctor taking one - argument (which sets - num) has - a default. - - - - - - - Licensing - - The primary copyright holders on the MySQL++ library and - its documentation are Kevin Atkinson (1998), MySQL AB (1999 - through 2001) and Educational Technology Resources, Inc. (2004 - through the date of this writing). There are other contributors, - who also retain copyrights on their additions; see the ChangeLog - file in the MySQL++ distribution tarball for details. - - The MySQL++ library and its Reference Manual are released - under the GNU Lesser General Public License (LGPL), reproduced - below. - - The MySQL++ User Manual — excepting some example - code from the library reproduced within it — is offered - under a license closely based on the Linux Documentation Project - License (LDPL) v2.0, included below. (The MySQL++ documentation - isn't actually part of the Linux Documentation Project, so - the main changes are to LDP-related language. Also, generic - language such as "author's (or authors')" has been replaced - with specific language, because the license applies to only - this one document.) - - These licenses basically state that you are free to use, - distribute and modify these works, whether for personal or - commercial purposes, as long as you grant the same rights to - those you distribute the works to, whether you changed them or - not. See the licenses below for full details. - - - - - GNU Lesser General Public License - Version 2.1, February 1999 - - Copyright (C) 1991, 1999 Free Software Foundation, Inc. - 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Everyone - is permitted to copy and distribute verbatim copies of this - license document, but changing it is not allowed. - - [This is the first released version of the Lesser GPL. - It also counts as the successor of the GNU Library Public License, - version 2, hence the version number 2.1.] - - - Preamble - - The licenses for most software are designed to take - away your freedom to share and change it. By contrast, - the GNU General Public Licenses are intended to guarantee - your freedom to share and change free software--to make - sure the software is free for all its users. - - This license, the Lesser General Public License, - applies to some specially designated software - packages--typically libraries--of the Free Software - Foundation and other authors who decide to use it. You - can use it too, but we suggest you first think carefully - about whether this license or the ordinary General Public - License is the better strategy to use in any particular - case, based on the explanations below. - - When we speak of free software, we are referring to - freedom of use, not price. Our General Public Licenses - are designed to make sure that you have the freedom to - distribute copies of free software (and charge for this - service if you wish); that you receive source code or can - get it if you want it; that you can change the software - and use pieces of it in new free programs; and that you - are informed that you can do these things. - - To protect your rights, we need to make restrictions - that forbid distributors to deny you these rights or to - ask you to surrender these rights. These restrictions - translate to certain responsibilities for you if you - distribute copies of the library or if you modify - it. - - For example, if you distribute copies of the - library, whether gratis or for a fee, you must give the - recipients all the rights that we gave you. You must make - sure that they, too, receive or can get the source code. - If you link other code with the library, you must provide - complete object files to the recipients, so that they - can relink them with the library after making changes - to the library and recompiling it. And you must show - them these terms so they know their rights. - - We protect your rights with a two-step method: - (1) we copyright the library, and (2) we offer you - this license, which gives you legal permission to copy, - distribute and/or modify the library. - - To protect each distributor, we want to make it very - clear that there is no warranty for the free library. - Also, if the library is modified by someone else and - passed on, the recipients should know that what they - have is not the original version, so that the original - author's reputation will not be affected by problems - that might be introduced by others. - - Finally, software patents pose a constant threat to - the existence of any free program. We wish to make sure - that a company cannot effectively restrict the users of - a free program by obtaining a restrictive license from - a patent holder. Therefore, we insist that any patent - license obtained for a version of the library must be - consistent with the full freedom of use specified in - this license. - - Most GNU software, including some libraries, - is covered by the ordinary GNU General Public License. - This license, the GNU Lesser General Public License, - applies to certain designated libraries, and is quite - different from the ordinary General Public License. We - use this license for certain libraries in order to permit - linking those libraries into non-free programs. - - When a program is linked with a library, whether - statically or using a shared library, the combination of - the two is legally speaking a combined work, a derivative - of the original library. The ordinary General Public - License therefore permits such linking only if the entire - combination fits its criteria of freedom. The Lesser - General Public License permits more lax criteria for - linking other code with the library. - - We call this license the "Lesser" General Public - License because it does Less to protect the user's - freedom than the ordinary General Public License. - It also provides other free software developers Less - of an advantage over competing non-free programs. - These disadvantages are the reason we use the ordinary - General Public License for many libraries. However, - the Lesser license provides advantages in certain special - circumstances. - - For example, on rare occasions, there may be a - special need to encourage the widest possible use of a - certain library, so that it becomes a de-facto standard. - To achieve this, non-free programs must be allowed to use - the library. A more frequent case is that a free library - does the same job as widely used non-free libraries. - In this case, there is little to gain by limiting the - free library to free software only, so we use the Lesser - General Public License. - - In other cases, permission to use a particular - library in non-free programs enables a greater number of - people to use a large body of free software. For example, - permission to use the GNU C Library in non-free programs - enables many more people to use the whole GNU operating - system, as well as its variant, the GNU/Linux operating - system. - - Although the Lesser General Public License is Less - protective of the users' freedom, it does ensure that - the user of a program that is linked with the Library - has the freedom and the wherewithal to run that program - using a modified version of the Library. - - The precise terms and conditions for copying, - distribution and modification follow. Pay close attention - to the difference between a "work based on the library" - and a "work that uses the library". The former contains - code derived from the library, whereas the latter must - be combined with the library in order to run. - - - - - GNU LESSER GENERAL PUBLIC LICENSE - TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND - MODIFICATION - - 0. This License Agreement applies to any software - library or other program which contains a notice placed - by the copyright holder or other authorized party saying - it may be distributed under the terms of this Lesser - General Public License (also called "this License"). - Each licensee is addressed as "you". - - A "library" means a collection of software functions - and/or data prepared so as to be conveniently linked with - application programs (which use some of those functions - and data) to form executables. - - The "Library", below, refers to any such software - library or work which has been distributed under these - terms. A "work based on the Library" means either the - Library or any derivative work under copyright law: that - is to say, a work containing the Library or a portion - of it, either verbatim or with modifications and/or - translated straightforwardly into another language. - (Hereinafter, translation is included without limitation - in the term "modification".) - - "Source code" for a work means the preferred form of - the work for making modifications to it. For a library, - complete source code means all the source code for all - modules it contains, plus any associated interface - definition files, plus the scripts used to control - compilation and installation of the library. - - Activities other than copying, distribution and - modification are not covered by this License; they are - outside its scope. The act of running a program using - the Library is not restricted, and output from such a - program is covered only if its contents constitute a - work based on the Library (independent of the use of - the Library in a tool for writing it). Whether that - is true depends on what the Library does and what the - program that uses the Library does. - - 1. You may copy and distribute verbatim copies - of the Library's complete source code as you receive - it, in any medium, provided that you conspicuously - and appropriately publish on each copy an appropriate - copyright notice and disclaimer of warranty; keep intact - all the notices that refer to this License and to the - absence of any warranty; and distribute a copy of this - License along with the Library. - - You may charge a fee for the physical act of - transferring a copy, and you may at your option offer - warranty protection in exchange for a fee. - - 2. You may modify your copy or copies of the Library - or any portion of it, thus forming a work based on the - Library, and copy and distribute such modifications or - work under the terms of Section 1 above, provided that - you also meet all of these conditions: - -
- a) The modified work must itself be a - software library. - - b) You must cause the files modified to - carry prominent notices stating that you changed - the files and the date of any change. - - c) You must cause the whole of the work - to be licensed at no charge to all third parties - under the terms of this License. - - d) If a facility in the modified Library - refers to a function or a table of data to - be supplied by an application program that - uses the facility, other than as an argument - passed when the facility is invoked, then you - must make a good faith effort to ensure that, - in the event an application does not supply such - function or table, the facility still operates, - and performs whatever part of its purpose remains - meaningful. - - (For example, a function in a library - to compute square roots has a purpose that - is entirely well-defined independent of the - application. Therefore, Subsection 2d requires - that any application-supplied function or table - used by this function must be optional: if the - application does not supply it, the square root - function must still compute square roots.) -
- - These requirements apply to the modified work as - a whole. If identifiable sections of that work are not - derived from the Library, and can be reasonably considered - independent and separate works in themselves, then this - License, and its terms, do not apply to those sections - when you distribute them as separate works. But when you - distribute the same sections as part of a whole which is a - work based on the Library, the distribution of the whole - must be on the terms of this License, whose permissions - for other licensees extend to the entire whole, and thus - to each and every part regardless of who wrote it. - - Thus, it is not the intent of this section to claim - rights or contest your rights to work written entirely - by you; rather, the intent is to exercise the right to - control the distribution of derivative or collective - works based on the Library. - - In addition, mere aggregation of another work - not based on the Library with the Library (or with a - work based on the Library) on a volume of a storage or - distribution medium does not bring the other work under - the scope of this License. - - 3. You may opt to apply the terms of the ordinary - GNU General Public License instead of this License to a - given copy of the Library. To do this, you must alter - all the notices that refer to this License, so that - they refer to the ordinary GNU General Public License, - version 2, instead of to this License. (If a newer - version than version 2 of the ordinary GNU General Public - License has appeared, then you can specify that version - instead if you wish.) Do not make any other change in - these notices. - - Once this change is made in a given copy, it is - irreversible for that copy, so the ordinary GNU General - Public License applies to all subsequent copies and - derivative works made from that copy. - - This option is useful when you wish to copy part - of the code of the Library into a program that is not - a library. - - 4. You may copy and distribute the Library (or a - portion or derivative of it, under Section 2) in object - code or executable form under the terms of Sections 1 and - 2 above provided that you accompany it with the complete - corresponding machine-readable source code, which must be - distributed under the terms of Sections 1 and 2 above on - a medium customarily used for software interchange. - - If distribution of object code is made by offering - access to copy from a designated place, then offering - equivalent access to copy the source code from the same - place satisfies the requirement to distribute the source - code, even though third parties are not compelled to - copy the source along with the object code. - - 5. A program that contains no derivative of any - portion of the Library, but is designed to work with the - Library by being compiled or linked with it, is called a - "work that uses the Library". Such a work, in isolation, - is not a derivative work of the Library, and therefore - falls outside the scope of this License. - - However, linking a "work that uses the Library" with - the Library creates an executable that is a derivative - of the Library (because it contains portions of the - Library), rather than a "work that uses the library". - The executable is therefore covered by this License. - Section 6 states terms for distribution of such - executables. - - When a "work that uses the Library" uses material - from a header file that is part of the Library, the - object code for the work may be a derivative work - of the Library even though the source code is not. - Whether this is true is especially significant if the - work can be linked without the Library, or if the work - is itself a library. The threshold for this to be true - is not precisely defined by law. - - If such an object file uses only numerical - parameters, data structure layouts and accessors, and - small macros and small inline functions (ten lines or - less in length), then the use of the object file is - unrestricted, regardless of whether it is legally a - derivative work. (Executables containing this object - code plus portions of the Library will still fall under - Section 6.) - - Otherwise, if the work is a derivative of the - Library, you may distribute the object code for the work - under the terms of Section 6. Any executables containing - that work also fall under Section 6, whether or not they - are linked directly with the Library itself. - - 6. As an exception to the Sections above, you - may also combine or link a "work that uses the Library" - with the Library to produce a work containing portions - of the Library, and distribute that work under terms of - your choice, provided that the terms permit modification - of the work for the customer's own use and reverse - engineering for debugging such modifications. - - You must give prominent notice with each copy of the - work that the Library is used in it and that the Library - and its use are covered by this License. You must supply - a copy of this License. If the work during execution - displays copyright notices, you must include the copyright - notice for the Library among them, as well as a reference - directing the user to the copy of this License. Also, - you must do one of these things: - -
- a) Accompany the work with the complete - corresponding machine-readable source code for - the Library including whatever changes were - used in the work (which must be distributed - under Sections 1 and 2 above); and, if the work - is an executable linked with the Library, with - the complete machine-readable "work that uses - the Library", as object code and/or source code, - so that the user can modify the Library and then - relink to produce a modified executable containing - the modified Library. (It is understood that - the user who changes the contents of definitions - files in the Library will not necessarily be - able to recompile the application to use the - modified definitions.) - - b) Use a suitable shared library mechanism - for linking with the Library. A suitable - mechanism is one that (1) uses at run time - a copy of the library already present on the - user's computer system, rather than copying - library functions into the executable, and (2) - will operate properly with a modified version of - the library, if the user installs one, as long as - the modified version is interface-compatible with - the version that the work was made with. - - c) Accompany the work with a written offer, - valid for at least three years, to give the same - user the materials specified in Subsection 6a, - above, for a charge no more than the cost of - performing this distribution. - - d) If distribution of the work is made - by offering access to copy from a designated - place, offer equivalent access to copy the above - specified materials from the same place. - - e) Verify that the user has already - received a copy of these materials or that you - have already sent this user a copy. -
- - For an executable, the required form of the "work - that uses the Library" must include any data and utility - programs needed for reproducing the executable from it. - However, as a special exception, the materials to be - distributed need not include anything that is normally - distributed (in either source or binary form) with the - major components (compiler, kernel, and so on) of the - operating system on which the executable runs, unless - that component itself accompanies the executable. - - It may happen that this requirement contradicts - the license restrictions of other proprietary libraries - that do not normally accompany the operating system. - Such a contradiction means you cannot use both them - and the Library together in an executable that you - distribute. - - 7. You may place library facilities that are a work - based on the Library side-by-side in a single library - together with other library facilities not covered by - this License, and distribute such a combined library, - provided that the separate distribution of the work - based on the Library and of the other library facilities - is otherwise permitted, and provided that you do these - two things: - -
- a) Accompany the combined library with - a copy of the same work based on the Library, - uncombined with any other library facilities. - This must be distributed under the terms of the - Sections above. - - b) Give prominent notice with the combined - library of the fact that part of it is a work - based on the Library, and explaining where to - find the accompanying uncombined form of the - same work. -
- - 8. You may not copy, modify, sublicense, link with, - or distribute the Library except as expressly provided - under this License. Any attempt otherwise to copy, - modify, sublicense, link with, or distribute the Library - is void, and will automatically terminate your rights - under this License. However, parties who have received - copies, or rights, from you under this License will not - have their licenses terminated so long as such parties - remain in full compliance. - - 9. You are not required to accept this License, - since you have not signed it. However, nothing else - grants you permission to modify or distribute the Library - or its derivative works. These actions are prohibited - by law if you do not accept this License. Therefore, - by modifying or distributing the Library (or any work - based on the Library), you indicate your acceptance of - this License to do so, and all its terms and conditions - for copying, distributing or modifying the Library or - works based on it. - - 10. Each time you redistribute the Library (or any - work based on the Library), the recipient automatically - receives a license from the original licensor to copy, - distribute, link with or modify the Library subject to - these terms and conditions. You may not impose any - further restrictions on the recipients' exercise of - the rights granted herein. You are not responsible - for enforcing compliance by third parties with this - License. - - 11. If, as a consequence of a court judgment or - allegation of patent infringement or for any other reason - (not limited to patent issues), conditions are imposed on - you (whether by court order, agreement or otherwise) that - contradict the conditions of this License, they do not - excuse you from the conditions of this License. If you - cannot distribute so as to satisfy simultaneously your - obligations under this License and any other pertinent - obligations, then as a consequence you may not distribute - the Library at all. For example, if a patent license - would not permit royalty-free redistribution of the - Library by all those who receive copies directly or - indirectly through you, then the only way you could - satisfy both it and this License would be to refrain - entirely from distribution of the Library. - - If any portion of this section is held invalid - or unenforceable under any particular circumstance, - the balance of the section is intended to apply, and - the section as a whole is intended to apply in other - circumstances. - - It is not the purpose of this section to induce - you to infringe any patents or other property right - claims or to contest validity of any such claims; - this section has the sole purpose of protecting the - integrity of the free software distribution system - which is implemented by public license practices. - Many people have made generous contributions to the - wide range of software distributed through that system - in reliance on consistent application of that system; - it is up to the author/donor to decide if he or she is - willing to distribute software through any other system - and a licensee cannot impose that choice. - - This section is intended to make thoroughly clear - what is believed to be a consequence of the rest of - this License. - - 12. If the distribution and/or use of the Library - is restricted in certain countries either by patents or - by copyrighted interfaces, the original copyright holder - who places the Library under this License may add an - explicit geographical distribution limitation excluding - those countries, so that distribution is permitted only - in or among countries not thus excluded. In such case, - this License incorporates the limitation as if written - in the body of this License. - - 13. The Free Software Foundation may publish revised - and/or new versions of the Lesser General Public License - from time to time. Such new versions will be similar in - spirit to the present version, but may differ in detail - to address new problems or concerns. - - Each version is given a distinguishing version - number. If the Library specifies a version number - of this License which applies to it and "any later - version", you have the option of following the terms - and conditions either of that version or of any later - version published by the Free Software Foundation. - If the Library does not specify a license version number, - you may choose any version ever published by the Free - Software Foundation. - - 14. If you wish to incorporate parts of the - Library into other free programs whose distribution - conditions are incompatible with these, write to the - author to ask for permission. For software which is - copyrighted by the Free Software Foundation, write to the - Free Software Foundation; we sometimes make exceptions - for this. Our decision will be guided by the two goals - of preserving the free status of all derivatives of our - free software and of promoting the sharing and reuse of - software generally. - - NO WARRANTY - - 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, - THERE IS NO WARRANTY FOR THE LIBRARY, TO THE EXTENT - PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE - STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER - PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF - ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT - LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND - FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO - THE QUALITY AND PERFORMANCE OF THE LIBRARY IS WITH YOU. - SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME THE COST - OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. - - 16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE - LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, - OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE - THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU FOR - DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR - CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY - TO USE THE LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF - DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED - BY YOU OR THIRD PARTIES OR A FAILURE OF THE LIBRARY TO - OPERATE WITH ANY OTHER SOFTWARE), EVEN IF SUCH HOLDER - OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF - SUCH DAMAGES. - - END OF TERMS AND CONDITIONS -
- - - - How to Apply These Terms to Your New - Libraries - - If you develop a new library, and you want it to be - of the greatest possible use to the public, we recommend - making it free software that everyone can redistribute - and change. You can do so by permitting redistribution - under these terms (or, alternatively, under the terms - of the ordinary General Public License). - - To apply these terms, attach the following notices - to the library. It is safest to attach them to the - start of each source file to most effectively convey - the exclusion of warranty; and each file should have at - least the "copyright" line and a pointer to where the - full notice is found. - -
- <one line to give the library's name - and a brief idea of what it does.> - - Copyright © <year> <name - of author> - - This library is free software; you can - redistribute it and/or modify it under the - terms of the GNU Lesser General Public License - as published by the Free Software Foundation; - either version 2.1 of the License, or (at your - option) any later version. - - This library is distributed in the - hope that it will be useful, but WITHOUT ANY - WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR - PURPOSE. See the GNU Lesser General Public - License for more details. - - You should have received a copy of the GNU - Lesser General Public License along with this - library; if not, write to the Free Software - Foundation, Inc., 59 Temple Place, Suite 330, - Boston, MA 02111-1307 USA -
- - Also add information on how to contact you by - electronic and paper mail. - - You should also get your employer (if you work - as a programmer) or your school, if any, to sign a - "copyright disclaimer" for the library, if necessary. - Here is a sample; alter the names: - -
- Yoyodyne, Inc., hereby disclaims all - copyright interest in the library `Frob' (a - library for tweaking knobs) written by James - Random Hacker. - - <signature of Ty Coon>, 1 April - 1990 - - Ty Coon, President of Vice -
- - That's all there is to it! -
-
- - - - - MySQL++ User Manual License - - - I. COPYRIGHT - - The copyright to the MySQL++ User Manual is owned - by its authors. - - - - II. LICENSE - - The MySQL++ User Manual may be reproduced and - distributed in whole or in part, in any medium physical or - electronic, provided that this license notice is displayed - in the reproduction. Commercial redistribution is - permitted and encouraged. Thirty days advance notice via - email to the authors of redistribution is appreciated, to - give the authors time to provide updated documents. - - - A. REQUIREMENTS OF MODIFIED WORKS - - All modified documents, including - translations, anthologies, and partial documents, - must meet the following requirements: - - - The modified version - must be labeled as such. - - The person - making the modifications must be - identified. - - Acknowledgement - of the original author must be - retained. - - The location of - the original unmodified document be - identified. - - The original authors' - names may not be used to assert or - imply endorsement of the resulting - document without the original authors' - permission. - - - In addition it is requested that: - - - The modifications - (including deletions) be - noted. - - The authors be - notified by email of the modification - in advance of redistribution, if - an email address is provided in the - document. - - - Mere aggregation of the MySQL++ User Manual - with other documents or programs on the same - media shall not cause this license to apply to - those other works. - - All translations, derivative documents, or - modified documents that incorporate the MySQL++ - User Manual may not have more restrictive license - terms than these, except that you may require - distributors to make the resulting document - available in source format. - - - -
-
- ADDED doc/userman/xinclude.mod Index: doc/userman/xinclude.mod ================================================================== --- /dev/null +++ doc/userman/xinclude.mod @@ -0,0 +1,17 @@ + + + + + + + + + ADDED dtest Index: dtest ================================================================== --- /dev/null +++ dtest @@ -0,0 +1,105 @@ +#!/bin/bash + +TMP=`mktemp bmXXXXXX` + +# Run simple unit tests first. +typeset -i count=0 +echo -n 'Running unit tests:' +for t in test_* +do + if [ -x "$t" ] + then + errmsg=`./exrun "$t" 2>&1` + errno=$? + if [ "$errno" = 0 ] + then + count=count+1 + else + rm -f $TMP + echo " $t FAILED ($errno)" + echo + echo "$errmsg" + exit $? + fi + fi +done +echo " $count tests succeeded" +echo 'All unit tests passed' >> $TMP + +# Assume AUTO_INCREMENT id column in images table will get 1 in +# load_jpeg call below, since we reset the DB before doing it. +export QUERY_STRING=id=1 + +# Now run examples to test high-level behavior. The repeated use of +# resetdb is intentional! It's run after each example that changes +# the database in a way that will cause a subsequent example to fail +# because data it expects isn't present. +echo -n 'Running examples:' +for t in \ + resetdb simple[0-9] store_if for_each multiquery tquery1 \ + resetdb tquery[2-9] \ + resetdb ssqls[0-9] \ + load_jpeg cgi_jpeg +do + if [ -x $t ] + then + if [ "$t" = "resetdb" ] + then + echo + echo -n " " + fi + + echo -n "$t " + echo "---------------- BEGIN $t OUTPUT ----------------" >> $TMP + if ! ./exrun $t -D $* >> $TMP + then + echo + echo 'TESTING ABORTED.' + rm -f $TMP + exit $? + fi + echo "================ END $t OUTPUT ================" >> $TMP + echo >> $TMP + fi +done +echo + +# Test ssqlsxlat -o. Note that it suppresses stdout but keeps stderr +# so warnings about directives and line elements it doesn't understand +# aren't suppressed. We run the first pass's output back through +# ssqlsxlat to deal with comments, whitespace differences, line element +# ordering, boolean value and type canonicalization, and other niggly +# differences we really don't care about. diff -w isn't enough. +for f in {examples,test}/*.ssqls +do + echo -n "Testing ssqlsxlat -i $f -o..." + echo "--- BEGIN ssqlsxlat -i $f -o ERROR OUTPUT ---" >> $TMP + pass1=/tmp/dtest-ssxgv2-pass1-$bnf + pass2=/tmp/dtest-ssxgv2-pass2-$bnf + echo -n "pass 1" + ./exrun ssqlsxlat -i $f -o $pass1 > /dev/null 2>> $TMP + echo -n ", pass 2" + ./exrun ssqlsxlat -i $pass1 -o $pass2 > /dev/null 2>> $TMP + echo -n ", diff" + diff $pass1 $pass2 > /dev/null >> $TMP + echo "==== END ssqlsxlat -i $f -o ERROR OUTPUT ====" >> $TMP + echo +done + +# Check for any changes +BFILE=bmark.txt +if [ -f $BFILE ] +then + if diff -u -w $BFILE $TMP + then + echo + echo 'All tests passed.' + fi + rm -f $TMP +else + mv $TMP $BFILE + chmod -w $BFILE + echo + echo 'BENCHMARK FILE REGENERATED.' + echo +fi DELETED examples/Makefile.am Index: examples/Makefile.am ================================================================== --- examples/Makefile.am +++ /dev/null @@ -1,90 +0,0 @@ -# This file is free software; you can redistribute it and/or modify it -# under the terms of the GNU Lesser General Public License as published -# by the Free Software Foundation; either version 2.1 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, but -# WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -# Lesser General Public License for more details. -# -# You should have received a copy of the GNU Lesser General Public -# License along with MySQL++; if not, write to the Free Software -# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 -# USA - -include $(top_srcdir)/common.am - -AM_CXXFLAGS = @PTHREAD_CFLAGS@ -LDADD = $(MYSQLPP_LIB) @PTHREAD_LIBS@ - -EXTRA_DIST = \ - Makefile.base \ - Makefile.bc \ - Makefile.gcc \ - Makefile.mingw \ - Makefile.simple \ - Makefile.vc - -noinst_PROGRAMS = resetdb simple1 simple2 simple3 usequery multiquery \ - custom1 custom2 custom3 custom4 custom5 custom6 fieldinf1 \ - dbinfo updel load_file cgi_image - -noinst_HEADERS = util.h - -simple1_SOURCES = simple1.cpp util.cpp -simple1_DEPENDENCIES = $(MYSQLPP_LIB) - -simple2_SOURCES = simple2.cpp util.cpp -simple2_DEPENDENCIES = $(MYSQLPP_LIB) - -simple3_SOURCES = simple3.cpp util.cpp -simple3_DEPENDENCIES = $(MYSQLPP_LIB) - -usequery_SOURCES = usequery.cpp util.cpp -usequery_DEPENDENCIES = $(MYSQLPP_LIB) - -dbinfo_SOURCES = dbinfo.cpp util.cpp -dbinfo_DEPENDENCIES = $(MYSQLPP_LIB) - -cgi_image_SOURCES = cgi_image.cpp -cgi_image_DEPENDENCIES = $(MYSQLPP_LIB) - -resetdb_SOURCES = resetdb.cpp util.cpp -resetdb_DEPENDENCIES = $(MYSQLPP_LIB) - -custom1_SOURCES = custom1.cpp util.cpp -custom1_DEPENDENCIES = $(MYSQLPP_LIB) - -custom2_SOURCES = custom2.cpp util.cpp -custom2_DEPENDENCIES = $(MYSQLPP_LIB) - -custom3_SOURCES = custom3.cpp util.cpp -custom3_DEPENDENCIES = $(MYSQLPP_LIB) - -custom4_SOURCES = custom4.cpp util.cpp -custom4_DEPENDENCIES = $(MYSQLPP_LIB) - -custom5_SOURCES = custom5.cpp util.cpp -custom5_DEPENDENCIES = $(MYSQLPP_LIB) - -custom6_SOURCES = custom6.cpp util.cpp -custom6_DEPENDENCIES = $(MYSQLPP_LIB) - -fieldinf1_SOURCES = fieldinf1.cpp util.cpp -fieldinf1_DEPENDENCIES = $(MYSQLPP_LIB) - -updel_SOURCES = updel.cpp -updel_DEPENDENCIES = $(MYSQLPP_LIB) - -load_file_SOURCES = load_file.cpp -load_file_DEPENDENCIES = $(MYSQLPP_LIB) - -multiquery_SOURCES = multiquery.cpp util.cpp -multiquery_DEPENDENCIES = $(MYSQLPP_LIB) - -tags: ctags - -ctags: - ( cd .. && make ctags ) - DELETED examples/Makefile.base Index: examples/Makefile.base ================================================================== --- examples/Makefile.base +++ /dev/null @@ -1,126 +0,0 @@ -## This is the base Makefile for compiling the MySQL++ examples on -## systems that do not use automake. The ../makemake.* script appends -## this to one of the compiler-specific Makefile.* files in this -## directory to create a complete Makefile. - - -# This file is free software; you can redistribute it and/or modify it -# under the terms of the GNU Lesser General Public License as published -# by the Free Software Foundation; either version 2.1 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, but -# WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -# Lesser General Public License for more details. -# -# You should have received a copy of the GNU Lesser General Public -# License along with MySQL++; if not, write to the Free Software -# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 -# USA - - -# --- No user-serviceable parts below :) - -BINARIES=resetdb$(EXE) simple1$(EXE) simple2$(EXE) simple3$(EXE) \ - usequery$(EXE) fieldinf1$(EXE) dbinfo$(EXE) cgi_image$(EXE) \ - load_file$(EXE) updel$(EXE) multiquery$(EXE) custom1$(EXE) \ - custom2$(EXE) custom3$(EXE) custom4$(EXE) custom5$(EXE) \ - custom6$(EXE) - -RESETDB_OBJS=resetdb.$(OBJ) util.$(OBJ) -SIMPLE1_OBJS=simple1.$(OBJ) util.$(OBJ) -SIMPLE2_OBJS=simple2.$(OBJ) util.$(OBJ) -SIMPLE3_OBJS=simple3.$(OBJ) util.$(OBJ) -USEQUERY_OBJS=usequery.$(OBJ) util.$(OBJ) -CUSTOM1_OBJS=custom1.$(OBJ) util.$(OBJ) -CUSTOM2_OBJS=custom2.$(OBJ) util.$(OBJ) -CUSTOM3_OBJS=custom3.$(OBJ) util.$(OBJ) -CUSTOM4_OBJS=custom4.$(OBJ) util.$(OBJ) -CUSTOM5_OBJS=custom5.$(OBJ) util.$(OBJ) -CUSTOM6_OBJS=custom6.$(OBJ) util.$(OBJ) -FIELDINF1_OBJS=fieldinf1.$(OBJ) util.$(OBJ) -DBINFO_OBJS=dbinfo.$(OBJ) util.$(OBJ) -CGI_IMAGE_OBJS=cgi_image.$(OBJ) -LOAD_FILE_OBJS=load_file.$(OBJ) -UPDEL_OBJS=updel.$(OBJ) -MULTIQUERY_OBJS=multiquery.$(OBJ) util.$(OBJ) - - -all: $(BINARIES) - -clean: - $(DEL) *.$(OBJ) $(BINARIES) $(EXTRA_CLEAN) - - -resetdb$(EXE): $(RESETDB_OBJS) - $(LD) $(LDFLAGS) $(LDSTARTUP) $(RESETDB_OBJS) $(LDEXEFLAG)$@ $(LIBS) - -simple1$(EXE): $(SIMPLE1_OBJS) - $(LD) $(LDFLAGS) $(LDSTARTUP) $(SIMPLE1_OBJS) $(LDEXEFLAG)$@ $(LIBS) - -simple2$(EXE): $(SIMPLE2_OBJS) - $(LD) $(LDFLAGS) $(LDSTARTUP) $(SIMPLE2_OBJS) $(LDEXEFLAG)$@ $(LIBS) - -simple3$(EXE): $(SIMPLE3_OBJS) - $(LD) $(LDFLAGS) $(LDSTARTUP) $(SIMPLE3_OBJS) $(LDEXEFLAG)$@ $(LIBS) - -usequery$(EXE): $(USEQUERY_OBJS) - $(LD) $(LDFLAGS) $(LDSTARTUP) $(USEQUERY_OBJS) $(LDEXEFLAG)$@ $(LIBS) - -custom1$(EXE): $(CUSTOM1_OBJS) - $(LD) $(LDFLAGS) $(LDSTARTUP) $(CUSTOM1_OBJS) $(LDEXEFLAG)$@ $(LIBS) - -custom2$(EXE): $(CUSTOM2_OBJS) - $(LD) $(LDFLAGS) $(LDSTARTUP) $(CUSTOM2_OBJS) $(LDEXEFLAG)$@ $(LIBS) - -custom3$(EXE): $(CUSTOM3_OBJS) - $(LD) $(LDFLAGS) $(LDSTARTUP) $(CUSTOM3_OBJS) $(LDEXEFLAG)$@ $(LIBS) - -custom4$(EXE): $(CUSTOM4_OBJS) - $(LD) $(LDFLAGS) $(LDSTARTUP) $(CUSTOM4_OBJS) $(LDEXEFLAG)$@ $(LIBS) - -custom5$(EXE): $(CUSTOM5_OBJS) - $(LD) $(LDFLAGS) $(LDSTARTUP) $(CUSTOM5_OBJS) $(LDEXEFLAG)$@ $(LIBS) - -custom6$(EXE): $(CUSTOM6_OBJS) - $(LD) $(LDFLAGS) $(LDSTARTUP) $(CUSTOM6_OBJS) $(LDEXEFLAG)$@ $(LIBS) - -fieldinf1$(EXE): $(FIELDINF1_OBJS) - $(LD) $(LDFLAGS) $(LDSTARTUP) $(FIELDINF1_OBJS) $(LDEXEFLAG)$@ $(LIBS) - -dbinfo$(EXE): $(DBINFO_OBJS) - $(LD) $(LDFLAGS) $(LDSTARTUP) $(DBINFO_OBJS) $(LDEXEFLAG)$@ $(LIBS) - -cgi_image$(EXE): $(CGI_IMAGE_OBJS) - $(LD) $(LDFLAGS) $(LDSTARTUP) $(CGI_IMAGE_OBJS) $(LDEXEFLAG)$@ $(LIBS) - -load_file$(EXE): $(LOAD_FILE_OBJS) - $(LD) $(LDFLAGS) $(LDSTARTUP) $(LOAD_FILE_OBJS) $(LDEXEFLAG)$@ $(LIBS) - -updel$(EXE): $(UPDEL_OBJS) - $(LD) $(LDFLAGS) $(LDSTARTUP) $(UPDEL_OBJS) $(LDEXEFLAG)$@ $(LIBS) - -multiquery$(EXE): $(MULTIQUERY_OBJS) - $(LD) $(LDFLAGS) $(LDSTARTUP) $(MULTIQUERY_OBJS) $(LDEXEFLAG)$@ $(LIBS) - - -resetdb.$(OBJ): resetdb.cpp util.h -simple1.$(OBJ): simple1.cpp util.h -simple2.$(OBJ): simple2.cpp util.h -simple3.$(OBJ): simple3.cpp util.h -usequery.$(OBJ): usequery.cpp util.h -custom1.$(OBJ): custom1.cpp util.h -custom2.$(OBJ): custom2.cpp util.h -custom3.$(OBJ): custom3.cpp util.h -custom4.$(OBJ): custom4.cpp util.h -custom5.$(OBJ): custom5.cpp util.h -custom6.$(OBJ): custom6.cpp util.h -fieldinf1.$(OBJ): fieldinf1.cpp util.h -dbinfo.$(OBJ): dbinfo.cpp util.h -cgi_image.$(OBJ): cgi_image.cpp -load_file.$(OBJ): load_file.cpp -updel.$(OBJ): updel.cpp -util.$(OBJ): util.cpp util.h -multiquery.$(OBJ): multiquery.cpp util.h - DELETED examples/Makefile.bc Index: examples/Makefile.bc ================================================================== --- examples/Makefile.bc +++ /dev/null @@ -1,42 +0,0 @@ -## This file contains the 'make' rules specific to Borland C++. The -## ../makemake.bat script prepends this to Makefile.base to create a -## complete Makefile. - -# This file is free software; you can redistribute it and/or modify it -# under the terms of the GNU Lesser General Public License as published -# by the Free Software Foundation; either version 2.1 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, but -# WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -# Lesser General Public License for more details. -# -# You should have received a copy of the GNU Lesser General Public -# License along with MySQL++; if not, write to the Free Software -# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 -# USA - -CXX=bcc32 -INCLUDES=-Ic:\bcc55\include -Ic:\mysql\include -I..\lib -CXXFLAGS=$(INCLUDES) -Od -5 -xp -tWC -DNO_LONG_LONGS -w-8027 -w-8026 -c - -LD=ilink32 -LDFLAGS=-Tpe -Lc:\mysql\lib\bc -Lc:\bcc55\lib -L..\lib -LDSTARTUP=c0x32.obj -LIBS=,,libmysql.lib mysqlpp.lib import32.lib cw32mti.lib -LDEXEFLAG=, - -EXTRA_CLEAN=*.ilc *.ild *.ilf *.ils *.map *.tds *.dll - -OBJ=obj -EXE=.exe -DEL=del /q - - -.SUFFIXES: .cpp .obj -.cpp.obj: - $(CXX) $(CXXFLAGS) $< - - -bc: all DELETED examples/Makefile.gcc Index: examples/Makefile.gcc ================================================================== --- examples/Makefile.gcc +++ /dev/null @@ -1,41 +0,0 @@ -## This file contains the 'make' rules specific to GNU g++. The -## ../makemake.sh script prepends this to Makefile.base to create a -## complete Makefile. - -# This file is free software; you can redistribute it and/or modify it -# under the terms of the GNU Lesser General Public License as published -# by the Free Software Foundation; either version 2.1 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, but -# WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -# Lesser General Public License for more details. -# -# You should have received a copy of the GNU Lesser General Public -# License along with MySQL++; if not, write to the Free Software -# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 -# USA - -CXX=g++ -INCLUDES=-I/usr/include/mysql -I../lib -CXXFLAGS=$(INCLUDES) -O0 -c - -LD=$(CXX) -LDFLAGS=-L../lib -LDEXEFLAG=-o -LIBS=-lmysqlclient -lmysqlpp - -EXTRA_CLEAN= - -OBJ=o -EXE= -DEL=rm -f - - -.SUFFIXES: .cpp .o -.cpp.o: - $(CXX) $(CXXFLAGS) $< - - -gcc: all DELETED examples/Makefile.mingw Index: examples/Makefile.mingw ================================================================== --- examples/Makefile.mingw +++ /dev/null @@ -1,40 +0,0 @@ -## This file contains the 'make' rules specific to MinGW GCC. The -## ../makemake.bat script prepends this to Makefile.base to create a -## complete Makefile. - -# This file is free software; you can redistribute it and/or modify it -# under the terms of the GNU Lesser General Public License as published -# by the Free Software Foundation; either version 2.1 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, but -# WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -# Lesser General Public License for more details. -# -# You should have received a copy of the GNU Lesser General Public -# License along with MySQL++; if not, write to the Free Software -# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 -# USA - -CXX=g++ -INCLUDES=-Ic:\mysql\include -I..\lib -CXXFLAGS=$(INCLUDES) -O0 -c -DMYSQLPP_NO_DLL - -LD=$(CXX) -LDFLAGS=-L..\lib -Lc:\mysql\lib\gcc -LDEXEFLAG=-o -LIBS=-lmysqlpp -lmysqlclient -EXTRA_CLEAN= - -OBJ=o -EXE=.exe -DEL=rm -f - - -.SUFFIXES: .cpp .o -.cpp.o: - $(CXX) $(CXXFLAGS) $< - - -mingw: all DELETED examples/Makefile.simple Index: examples/Makefile.simple ================================================================== --- examples/Makefile.simple +++ /dev/null @@ -1,115 +0,0 @@ - -CXX=g++ -INCLUDES=-I/usr/include/mysql -I../lib -CXXFLAGS=$(INCLUDES) -O0 -c - -LD=$(CXX) -LDFLAGS=-L../lib -LDEXEFLAG=-o -LIBS=-lmysqlclient -lmysqlpp - -DEL=rm -f - -.SUFFIXES: .cpp .o -.cpp.o: - $(CXX) $(CXXFLAGS) $< - -BINARIES=resetdb simple1 simple2 simple3 \ - usequery fieldinf1 dbinfo cgi_image \ - load_file updel multiquery custom1 \ - custom2 custom3 custom4 custom5 \ - custom6 - -RESETDB_OBJS=resetdb.o util.o -SIMPLE1_OBJS=simple1.o util.o -SIMPLE2_OBJS=simple2.o util.o -SIMPLE3_OBJS=simple3.o util.o -USEQUERY_OBJS=usequery.o util.o -CUSTOM1_OBJS=custom1.o util.o -CUSTOM2_OBJS=custom2.o util.o -CUSTOM3_OBJS=custom3.o util.o -CUSTOM4_OBJS=custom4.o util.o -CUSTOM5_OBJS=custom5.o util.o -CUSTOM6_OBJS=custom6.o util.o -FIELDINF1_OBJS=fieldinf1.o util.o -DBINFO_OBJS=dbinfo.o util.o -CGI_IMAGE_OBJS=cgi_image.o -LOAD_FILE_OBJS=load_file.o -UPDEL_OBJS=updel.o -MULTIQUERY_OBJS=multiquery.o util.o - -all: $(BINARIES) - -clean: - $(DEL) *.o $(BINARIES) $(EXTRA_CLEAN) - -resetdb: $(RESETDB_OBJS) - $(LD) $(LDFLAGS) $(RESETDB_OBJS) $(LDEXEFLAG)$@ $(LIBS) - -simple1: $(SIMPLE1_OBJS) - $(LD) $(LDFLAGS) $(SIMPLE1_OBJS) $(LDEXEFLAG)$@ $(LIBS) - -simple2: $(SIMPLE2_OBJS) - $(LD) $(LDFLAGS) $(SIMPLE2_OBJS) $(LDEXEFLAG)$@ $(LIBS) - -simple3: $(SIMPLE3_OBJS) - $(LD) $(LDFLAGS) $(SIMPLE3_OBJS) $(LDEXEFLAG)$@ $(LIBS) - -usequery: $(USEQUERY_OBJS) - $(LD) $(LDFLAGS) $(USEQUERY_OBJS) $(LDEXEFLAG)$@ $(LIBS) - -custom1: $(CUSTOM1_OBJS) - $(LD) $(LDFLAGS) $(CUSTOM1_OBJS) $(LDEXEFLAG)$@ $(LIBS) - -custom2: $(CUSTOM2_OBJS) - $(LD) $(LDFLAGS) $(CUSTOM2_OBJS) $(LDEXEFLAG)$@ $(LIBS) - -custom3: $(CUSTOM3_OBJS) - $(LD) $(LDFLAGS) $(CUSTOM3_OBJS) $(LDEXEFLAG)$@ $(LIBS) - -custom4: $(CUSTOM4_OBJS) - $(LD) $(LDFLAGS) $(CUSTOM4_OBJS) $(LDEXEFLAG)$@ $(LIBS) - -custom5: $(CUSTOM5_OBJS) - $(LD) $(LDFLAGS) $(CUSTOM5_OBJS) $(LDEXEFLAG)$@ $(LIBS) - -custom6: $(CUSTOM6_OBJS) - $(LD) $(LDFLAGS) $(CUSTOM6_OBJS) $(LDEXEFLAG)$@ $(LIBS) - -fieldinf1: $(FIELDINF1_OBJS) - $(LD) $(LDFLAGS) $(FIELDINF1_OBJS) $(LDEXEFLAG)$@ $(LIBS) - -dbinfo: $(DBINFO_OBJS) - $(LD) $(LDFLAGS) $(DBINFO_OBJS) $(LDEXEFLAG)$@ $(LIBS) - -cgi_image: $(CGI_IMAGE_OBJS) - $(LD) $(LDFLAGS) $(CGI_IMAGE_OBJS) $(LDEXEFLAG)$@ $(LIBS) - -load_file: $(LOAD_FILE_OBJS) - $(LD) $(LDFLAGS) $(LOAD_FILE_OBJS) $(LDEXEFLAG)$@ $(LIBS) - -updel: $(UPDEL_OBJS) - $(LD) $(LDFLAGS) $(UPDEL_OBJS) $(LDEXEFLAG)$@ $(LIBS) - -multiquery: $(MULTIQUERY_OBJS) - $(LD) $(LDFLAGS) $(MULTIQUERY_OBJS) $(LDEXEFLAG)$@ $(LIBS) - -resetdb.o: resetdb.cpp util.h -simple1.o: simple1.cpp util.h -simple2.o: simple2.cpp util.h -simple3.o: simple3.cpp util.h -usequery.o: usequery.cpp util.h -custom1.o: custom1.cpp util.h -custom2.o: custom2.cpp util.h -custom3.o: custom3.cpp util.h -custom4.o: custom4.cpp util.h -custom5.o: custom5.cpp util.h -custom6.o: custom6.cpp util.h -fieldinf1.o: fieldinf1.cpp util.h -dbinfo.o: dbinfo.cpp util.h -cgi_image.o: cgi_image.cpp -load_file.o: load_file.cpp -updel.o: updel.cpp -util.o: util.cpp util.h -multiquery.o: multiquery.cpp util.h - DELETED examples/Makefile.vc Index: examples/Makefile.vc ================================================================== --- examples/Makefile.vc +++ /dev/null @@ -1,41 +0,0 @@ -## This file contains the 'make' rules specific to Visual C++. The -## ../makemake.bat script prepends this to Makefile.base to create a -## complete Makefile. - -# This file is free software; you can redistribute it and/or modify it -# under the terms of the GNU Lesser General Public License as published -# by the Free Software Foundation; either version 2.1 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, but -# WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -# Lesser General Public License for more details. -# -# You should have received a copy of the GNU Lesser General Public -# License along with MySQL++; if not, write to the Free Software -# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 -# USA - -CXX=cl -INCLUDES=/Ic:\mysql\include -I..\lib -CXXFLAGS=$(INCLUDES) /Od /G5 /EHsc /nologo /MDd /Zi /c - -LD=$(CXX) -LDFLAGS=/nologo -LDEXEFLAG=/link /LIBPATH:c:\mysql\lib\opt libmysql.lib \ - /LIBPATH:..\lib mysqlpp.lib /OUT: - -EXTRA_CLEAN=*.dll *.pdb - -OBJ=obj -EXE=.exe -DEL=del /q - - -.SUFFIXES: .cpp .obj -.cpp.obj: - $(CXX) $(CXXFLAGS) $< - - -vc: all DELETED examples/README Index: examples/README ================================================================== --- examples/README +++ /dev/null @@ -1,64 +0,0 @@ -Building the Examples -~~~~~~~~~~~~~~~~~~~~~ - If you are seeing these examples in a subdirectory of the MySQL++ - source tarball, the example programs should have been built when - you built the library. If you change any example code, just say - 'make' to rebuild the program. - - The examples are built against the headers and library in ../lib. - - If these example files were installed on your system as part - of the -devel RPM, copy all the files to a directory you can - write to, then say 'make' in that directory. This uses a - simplified Makefile, which builds the examples against the - headers and libraries installed in the system directories. - - -General Instructions -~~~~~~~~~~~~~~~~~~~~ - - Start with resetdb: - - $ ./resetdb [host] [user] [password] [port] - - This sets up the mysql_cpp_data database used by most of the - other examples. - - You can give as few of the parameters as you want, but they must - be in that order. That is, if you want to give a user name, - you must give the host first. It defaults to localhost with - your user name, no password, and the default MySQL port (3306). - - - The following examples use the database set up by resetdb, - and have the same command line format as resetdb: - - simple1: Gets all records in the table resetdb set up and - displays them. Try this one if you do nothing else. - - simple2: Same as simple1, except that it retrieves - the data with a "use" query instead of a - "store" query. See the user manual for the - difference between these. - - fieldinf1: Shows how to get information about the fields in - a result set. (Types, etc.) - - custom1-6: Demonstrates the SQLSS features. (See the user - manual.) - - dbinfo: Dumps a bunch of information about the database - server and the tables in its 'mysql' database. - - - The following are kind of oddballs. You will have to change - the source code to get them to run, since they use hard-coded - table and database names which aren't the same as those set up - by resetdb. - - load_file, cgi_image: Shows how to use a BLOB field to store - a file, and how to retrieve the file from the DB. - - updel: Shows how to use the power of the matching syntax - available in MySQL's SELECT statement to do fine-grained - UPDATE or DELETE queries. DELETED examples/cgi_image.cpp Index: examples/cgi_image.cpp ================================================================== --- examples/cgi_image.cpp +++ /dev/null @@ -1,78 +0,0 @@ -/*********************************************************************** - cgi_image.cpp - Example code showing how to fetch BLOB data from a - MySQL table and build a reply suitable for making this a CGI - handler. Something very much like this could pull dynamic images - from a database to populate web pages, for instance. - - See load_file.cpp for BLOB data insert example. - - Copyright (c) 1998 by Kevin Atkinson, (c) 1999, 2000 and 2001 by - MySQL AB, and (c) 2004, 2005 by Educational Technology Resources, Inc. - Others may also hold copyrights on code in this file. See the CREDITS - file in the top directory of the distribution for details. - - This file is part of MySQL++. - - MySQL++ is free software; you can redistribute it and/or modify it - under the terms of the GNU Lesser General Public License as published - by the Free Software Foundation; either version 2.1 of the License, or - (at your option) any later version. - - MySQL++ is distributed in the hope that it will be useful, but WITHOUT - ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public - License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with MySQL++; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 - USA -***********************************************************************/ - -#include - -using namespace std; -using namespace mysqlpp; - -#define MY_DATABASE "telcent" -#define MY_TABLE "fax" -#define MY_HOST "localhost" -#define MY_USER "root" -#define MY_PASSWORD "" -#define MY_FIELD "fax" // BLOB field -#define MY_KEY "datet" // PRIMARY KEY - -int -main(int argc, char *argv[]) -{ - if (argc < 2) { - cerr << "Usage : cgi_image primary_key_value" << endl << endl; - return -1; - } - - cout << "Content-type: image/jpeg" << endl; - Connection con(use_exceptions); - try { - con.connect(MY_DATABASE, MY_HOST, MY_USER, MY_PASSWORD); - Query query = con.query(); - query << "SELECT " << MY_FIELD << " FROM " << MY_TABLE << " WHERE " - << MY_KEY << " = " << argv[1]; - ResUse res = query.use(); - Row row = res.fetch_row(); - long unsigned int *jj = res.fetch_lengths(); - cout << "Content-length: " << *jj << endl << endl; - fwrite(row.raw_data(0), 1, *jj, stdout); - } - catch (const BadQuery& er) { - // Handle any query errors - cerr << "Query error: " << er.what() << endl; - return -1; - } - catch (const Exception& er) { - // Catch-all for any other MySQL++ exceptions - cerr << "Error: " << er.what() << endl; - return -1; - } - - return 0; -} ADDED examples/cgi_jpeg.cpp Index: examples/cgi_jpeg.cpp ================================================================== --- /dev/null +++ examples/cgi_jpeg.cpp @@ -0,0 +1,117 @@ +/*********************************************************************** + cgi_jpeg.cpp - Example code showing how to fetch JPEG data from a BLOB + column and send it back to a browser that requested it by ID. + + Use load_jpeg.cpp to load JPEG files into the database we query. + + Copyright (c) 1998 by Kevin Atkinson, (c) 1999-2001 by MySQL AB, and + (c) 2004-2009 by Educational Technology Resources, Inc. Others may + also hold copyrights on code in this file. See the CREDITS.txt file + in the top directory of the distribution for details. + + This file is part of MySQL++. + + MySQL++ is free software; you can redistribute it and/or modify it + under the terms of the GNU Lesser General Public License as published + by the Free Software Foundation; either version 2.1 of the License, or + (at your option) any later version. + + MySQL++ is distributed in the hope that it will be useful, but WITHOUT + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public + License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with MySQL++; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 + USA +***********************************************************************/ + +#include "cmdline.h" +#include "images.h" + +#define CRLF "\r\n" +#define CRLF2 "\r\n\r\n" + +int +main(int argc, char* argv[]) +{ + // Get database access parameters from command line if present, else + // use hard-coded values for true CGI case. + mysqlpp::examples::CommandLine cmdline(argc, argv, "root", + "nunyabinness"); + if (!cmdline) { + return 1; + } + + // Parse CGI query string environment variable to get image ID + unsigned int img_id = 0; + char* cgi_query = getenv("QUERY_STRING"); + if (cgi_query) { + if ((strlen(cgi_query) < 4) || memcmp(cgi_query, "id=", 3)) { + std::cout << "Content-type: text/plain" << std::endl << std::endl; + std::cout << "ERROR: Bad query string" << std::endl; + return 1; + } + else { + img_id = atoi(cgi_query + 3); + } + } + else { + std::cerr << "Put this program into a web server's cgi-bin " + "directory, then" << std::endl; + std::cerr << "invoke it with a URL like this:" << std::endl; + std::cerr << std::endl; + std::cerr << " http://server.name.com/cgi-bin/cgi_jpeg?id=2" << + std::endl; + std::cerr << std::endl; + std::cerr << "This will retrieve the image with ID 2." << std::endl; + std::cerr << std::endl; + std::cerr << "You will probably have to change some of the #defines " + "at the top of" << std::endl; + std::cerr << "examples/cgi_jpeg.cpp to allow the lookup to work." << + std::endl; + return 1; + } + + // Retrieve image from DB by ID + try { + mysqlpp::Connection con(mysqlpp::examples::db_name, + cmdline.server(), cmdline.user(), cmdline.pass()); + mysqlpp::Query query = con.query(); + query << "SELECT * FROM images WHERE id = " << img_id; + mysqlpp::StoreQueryResult res = query.store(); + if (res && res.num_rows()) { + images img = res[0]; + if (img.data.is_null) { + std::cout << "Content-type: text/plain" << CRLF2; + std::cout << "No image content!" << CRLF; + } + else { + std::cout << "X-Image-Id: " << img_id << CRLF; // for debugging + std::cout << "Content-type: image/jpeg" << CRLF; + std::cout << "Content-length: " << + img.data.data.length() << CRLF2; + std::cout << img.data; + } + } + else { + std::cout << "Content-type: text/plain" << CRLF2; + std::cout << "ERROR: No image with ID " << img_id << CRLF; + } + } + catch (const mysqlpp::BadQuery& er) { + // Handle any query errors + std::cout << "Content-type: text/plain" << CRLF2; + std::cout << "QUERY ERROR: " << er.what() << CRLF; + return 1; + } + catch (const mysqlpp::Exception& er) { + // Catch-all for any other MySQL++ exceptions + std::cout << "Content-type: text/plain" << CRLF2; + std::cout << "GENERAL ERROR: " << er.what() << CRLF; + return 1; + } + + return 0; +} ADDED examples/cpool.cpp Index: examples/cpool.cpp ================================================================== --- /dev/null +++ examples/cpool.cpp @@ -0,0 +1,249 @@ +/*********************************************************************** + cpool.cpp - ConnectionPool example. Works with both Windows native + threads and POSIX threads. Shows how to create and use a concrete + ConnectionPool derivative. + + Copyright (c) 2008-2010 by Educational Technology Resources, Inc. + Others may also hold copyrights on code in this file. See the + CREDITS.txt file in the top directory of the distribution for details. + + This file is part of MySQL++. + + MySQL++ is free software; you can redistribute it and/or modify it + under the terms of the GNU Lesser General Public License as published + by the Free Software Foundation; either version 2.1 of the License, or + (at your option) any later version. + + MySQL++ is distributed in the hope that it will be useful, but WITHOUT + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public + License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with MySQL++; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 + USA +***********************************************************************/ + +#include "cmdline.h" +#include "threads.h" + +#include + +using namespace std; + + +#if defined(HAVE_THREADS) +// Define a concrete ConnectionPool derivative. Takes connection +// parameters as inputs to its ctor, which it uses to create the +// connections we're called upon to make. Note that we also declare +// a global pointer to an object of this type, which we create soon +// after startup; this should be a common usage pattern, as what use +// are multiple pools? +class SimpleConnectionPool : public mysqlpp::ConnectionPool +{ +public: + // The object's only constructor + SimpleConnectionPool(mysqlpp::examples::CommandLine& cl) : + conns_in_use_(0), + db_(mysqlpp::examples::db_name), + server_(cl.server()), + user_(cl.user()), + password_(cl.pass()) + { + } + + // The destructor. We _must_ call ConnectionPool::clear() here, + // because our superclass can't do it for us. + ~SimpleConnectionPool() + { + clear(); + } + + // Do a simple form of in-use connection limiting: wait to return + // a connection until there are a reasonably low number in use + // already. Can't do this in create() because we're interested in + // connections actually in use, not those created. Also note that + // we keep our own count; ConnectionPool::size() isn't the same! + mysqlpp::Connection* grab() + { + while (conns_in_use_ > 8) { + cout.put('R'); cout.flush(); // indicate waiting for release + sleep(1); + } + + ++conns_in_use_; + return mysqlpp::ConnectionPool::grab(); + } + + // Other half of in-use conn count limit + void release(const mysqlpp::Connection* pc) + { + mysqlpp::ConnectionPool::release(pc); + --conns_in_use_; + } + +protected: + // Superclass overrides + mysqlpp::Connection* create() + { + // Create connection using the parameters we were passed upon + // creation. This could be something much more complex, but for + // the purposes of the example, this suffices. + cout.put('C'); cout.flush(); // indicate connection creation + return new mysqlpp::Connection( + db_.empty() ? 0 : db_.c_str(), + server_.empty() ? 0 : server_.c_str(), + user_.empty() ? 0 : user_.c_str(), + password_.empty() ? "" : password_.c_str()); + } + + void destroy(mysqlpp::Connection* cp) + { + // Our superclass can't know how we created the Connection, so + // it delegates destruction to us, to be safe. + cout.put('D'); cout.flush(); // indicate connection destruction + delete cp; + } + + unsigned int max_idle_time() + { + // Set our idle time at an example-friendly 3 seconds. A real + // pool would return some fraction of the server's connection + // idle timeout instead. + return 3; + } + +private: + // Number of connections currently in use + unsigned int conns_in_use_; + + // Our connection parameters + std::string db_, server_, user_, password_; +}; +SimpleConnectionPool* poolptr = 0; + + +static thread_return_t CALLBACK_SPECIFIER +worker_thread(thread_arg_t running_flag) +{ + // Ask the underlying C API to allocate any per-thread resources it + // needs, in case it hasn't happened already. In this particular + // program, it's almost guaranteed that the safe_grab() call below + // will create a new connection the first time through, and thus + // allocate these resources implicitly, but there's a nonzero chance + // that this won't happen. Anyway, this is an example program, + // meant to show good style, so we take the high road and ensure the + // resources are allocated before we do any queries. + mysqlpp::Connection::thread_start(); + cout.put('S'); cout.flush(); // indicate thread started + + // Pull data from the sample table a bunch of times, releasing the + // connection we use each time. + for (size_t i = 0; i < 6; ++i) { + // Go get a free connection from the pool, or create a new one + // if there are no free conns yet. Uses safe_grab() to get a + // connection from the pool that will be automatically returned + // to the pool when this loop iteration finishes. + mysqlpp::ScopedConnection cp(*poolptr, true); + if (!cp) { + cerr << "Failed to get a connection from the pool!" << endl; + break; + } + + // Pull a copy of the sample stock table and print a dot for + // each row in the result set. + mysqlpp::Query query(cp->query("select * from stock")); + mysqlpp::StoreQueryResult res = query.store(); + for (size_t j = 0; j < res.num_rows(); ++j) { + cout.put('.'); + } + + // Delay 1-4 seconds before doing it again. Because this can + // delay longer than the idle timeout, we'll occasionally force + // the creation of a new connection on the next loop. + sleep(rand() % 4 + 1); + } + + // Tell main() that this thread is no longer running + *reinterpret_cast(running_flag) = false; + cout.put('E'); cout.flush(); // indicate thread ended + + // Release the per-thread resources before we exit + mysqlpp::Connection::thread_end(); + + return 0; +} +#endif + + +int +main(int argc, char *argv[]) +{ +#if defined(HAVE_THREADS) + // Get database access parameters from command line + mysqlpp::examples::CommandLine cmdline(argc, argv); + if (!cmdline) { + return 1; + } + + // Create the pool and grab a connection. We do it partly to test + // that the parameters are good before we start doing real work, and + // partly because we need a Connection object to call thread_aware() + // on to check that it's okay to start doing that real work. This + // latter check should never fail on Windows, but will fail on most + // other systems unless you take positive steps to build with thread + // awareness turned on. See README-*.txt for your platform. + poolptr = new SimpleConnectionPool(cmdline); + try { + mysqlpp::ScopedConnection cp(*poolptr, true); + if (!cp->thread_aware()) { + cerr << "MySQL++ wasn't built with thread awareness! " << + argv[0] << " can't run without it." << endl; + return 1; + } + } + catch (mysqlpp::Exception& e) { + cerr << "Failed to set up initial pooled connection: " << + e.what() << endl; + return 1; + } + + // Setup complete. Now let's spin some threads... + cout << endl << "Pool created and working correctly. Now to do " + "some real work..." << endl; + srand((unsigned int)time(0)); + bool running[] = { + true, true, true, true, true, true, true, + true, true, true, true, true, true, true }; + const size_t num_threads = sizeof(running) / sizeof(running[0]); + size_t i; + for (i = 0; i < num_threads; ++i) { + if (int err = create_thread(worker_thread, running + i)) { + cerr << "Failed to create thread " << i << + ": error code " << err << endl; + return 1; + } + } + + // Test the 'running' flags every second until we find that they're + // all turned off, indicating that all threads are stopped. + cout.put('W'); cout.flush(); // indicate waiting for completion + do { + sleep(1); + i = 0; + while (i < num_threads && !running[i]) ++i; + } + while (i < num_threads); + cout << endl << "All threads stopped!" << endl; + + // Shut it all down... + delete poolptr; + cout << endl; +#else + (void)argc; // warning squisher + cout << argv[0] << " requires that threads be enabled!" << endl; +#endif + + return 0; +} DELETED examples/custom1.cpp Index: examples/custom1.cpp ================================================================== --- examples/custom1.cpp +++ /dev/null @@ -1,104 +0,0 @@ -/*********************************************************************** - custom1.cpp - Example that produces the same results as simple1, but it - uses a Specialized SQL Structure to store the results instead of a - MySQL++ Result object. - - Copyright (c) 1998 by Kevin Atkinson, (c) 1999, 2000 and 2001 by - MySQL AB, and (c) 2004, 2005 by Educational Technology Resources, Inc. - Others may also hold copyrights on code in this file. See the CREDITS - file in the top directory of the distribution for details. - - This file is part of MySQL++. - - MySQL++ is free software; you can redistribute it and/or modify it - under the terms of the GNU Lesser General Public License as published - by the Free Software Foundation; either version 2.1 of the License, or - (at your option) any later version. - - MySQL++ is distributed in the hope that it will be useful, but WITHOUT - ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public - License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with MySQL++; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 - USA -***********************************************************************/ - -#include "util.h" - -#include -#include - -#include -#include -#include - -using namespace std; -using namespace mysqlpp; - -// The following is calling a very complex macro which will create -// "struct stock", which has the member variables: -// -// string item -// ... -// Date sdate -// -// plus methods to help populate the class from a MySQL row -// among other things that I'll get to in a later example. -sql_create_5(stock, - 1, 5, // explained in the user manual - string, item, - longlong, num, - double, weight, - double, price, - Date, sdate) - -int -main(int argc, char *argv[]) -{ - // Wrap all MySQL++ interactions in one big try block, so any - // errors are handled gracefully. - try { - // Establish the connection to the database server. - Connection con(use_exceptions); - if (!connect_to_db(argc, argv, con)) { - return 1; - } - - // Retrieve the entire contents of the stock table, and store - // the data in a vector of 'stock' SSQLS structures. - Query query = con.query(); - query << "select * from stock"; - vector res; - query.storein(res); - - // Display the result set - print_stock_header(res.size()); - vector::iterator it; - for (it = res.begin(); it != res.end(); ++it) { - print_stock_row(it->item, it->num, it->weight, it->price, - it->sdate); - } - } - catch (const BadQuery& er) { - // Handle any query errors - cerr << "Query error: " << er.what() << endl; - return -1; - } - catch (const BadConversion& er) { - // Handle bad conversions; e.g. type mismatch populating 'stock' - cerr << "Conversion error: " << er.what() << endl << - "\tretrieved data size: " << er.retrieved << - ", actual size: " << er.actual_size << endl; - return -1; - } - catch (const Exception& er) { - // Catch-all for any other MySQL++ exceptions - cerr << "Error: " << er.what() << endl; - return -1; - } - - return 0; -} DELETED examples/custom2.cpp Index: examples/custom2.cpp ================================================================== --- examples/custom2.cpp +++ /dev/null @@ -1,98 +0,0 @@ -/*********************************************************************** - custom2.cpp - Example showing how to insert a row using the Specialized - SQL Structures feature of MySQL++. - - Copyright (c) 1998 by Kevin Atkinson, (c) 1999, 2000 and 2001 by - MySQL AB, and (c) 2004, 2005 by Educational Technology Resources, Inc. - Others may also hold copyrights on code in this file. See the CREDITS - file in the top directory of the distribution for details. - - This file is part of MySQL++. - - MySQL++ is free software; you can redistribute it and/or modify it - under the terms of the GNU Lesser General Public License as published - by the Free Software Foundation; either version 2.1 of the License, or - (at your option) any later version. - - MySQL++ is distributed in the hope that it will be useful, but WITHOUT - ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public - License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with MySQL++; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 - USA -***********************************************************************/ - -#include "util.h" - -#include -#include - -#include -#include -#include - -using namespace std; -using namespace mysqlpp; - -sql_create_5(stock, - 1, 5, - string, item, - longlong, num, - double, weight, - double, price, - Date, sdate) - -int -main(int argc, char *argv[]) -{ - try { - // Establish the connection to the database server. - Connection con(use_exceptions); - if (!connect_to_db(argc, argv, con)) { - return 1; - } - - // Create and populate a stock object. We could also have used - // the set() member, which takes the same parameters as this - // constructor. - stock row("Hot Dogs", 100, 1.5, 1.75, "1998-09-25"); - - // Form the query to insert the row into the stock table. - Query query = con.query(); - query.insert(row); - - // Show the query about to be executed. - cout << "Query: " << query.preview() << endl; - - // Execute the query. We use execute() because INSERT doesn't - // return a result set. - query.execute(); - - // Print the new table. - Result res; - get_stock_table(query, res); - print_stock_rows(res); - } - catch (const BadQuery& er) { - // Handle any query errors - cerr << "Query error: " << er.what() << endl; - return -1; - } - catch (const BadConversion& er) { - // Handle bad conversions - cerr << "Conversion error: " << er.what() << endl << - "\tretrieved data size: " << er.retrieved << - ", actual size: " << er.actual_size << endl; - return -1; - } - catch (const Exception& er) { - // Catch-all for any other MySQL++ exceptions - cerr << "Error: " << er.what() << endl; - return -1; - } - - return 0; -} DELETED examples/custom3.cpp Index: examples/custom3.cpp ================================================================== --- examples/custom3.cpp +++ /dev/null @@ -1,118 +0,0 @@ -/*********************************************************************** - custom3.cpp - Example showing how to update an SQL row using the - Specialized SQL Structures feature of MySQL++. - - Copyright (c) 1998 by Kevin Atkinson, (c) 1999, 2000 and 2001 by - MySQL AB, and (c) 2004, 2005 by Educational Technology Resources, Inc. - Others may also hold copyrights on code in this file. See the CREDITS - file in the top directory of the distribution for details. - - This file is part of MySQL++. - - MySQL++ is free software; you can redistribute it and/or modify it - under the terms of the GNU Lesser General Public License as published - by the Free Software Foundation; either version 2.1 of the License, or - (at your option) any later version. - - MySQL++ is distributed in the hope that it will be useful, but WITHOUT - ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public - License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with MySQL++; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 - USA -***********************************************************************/ - -#include "util.h" - -#include -#include - -#include -#include -#include - -using namespace std; -using namespace mysqlpp; - -sql_create_5(stock, - 1, 5, - string, item, - longlong, num, - double, weight, - double, price, - Date, sdate) - -int -main(int argc, char *argv[]) -{ - try { - // Establish the connection to the database server. - Connection con(use_exceptions); - if (!connect_to_db(argc, argv, con)) { - return 1; - } - - // Build a query to retrieve the stock item that has Unicode - // characters encoded in UTF-8 form. - Query query = con.query(); - query << "select * from stock where item = \"Nürnberger Brats\""; - - // Retrieve the row, throwing an exception if it fails. - Result res = query.store(); - if (res.empty()) { - throw BadQuery("UTF-8 bratwurst item not found in " - "table, run resetdb"); - } - - // Because there should only be one row in the result set, - // there's no point in storing the result in an STL container. - // We can store the first row directly into a stock structure - // because one of an SSQLS's constructors takes a Row object. - stock row = res.at(0); - - // Create a copy so that the replace query knows what the - // original values are. - stock orig_row = row; - - // Change the stock object's item to use only 7-bit ASCII, and - // to deliberately be wider than normal column widths printed - // by print_stock_table(). - row.item = "Nuerenberger Bratwurst"; - - // Form the query to replace the row in the stock table. - query.update(orig_row, row); - - // Show the query about to be executed. - cout << "Query: " << query.preview() << endl; - - // Run the query with execute(), since UPDATE doesn't return a - // result set. - query.execute(); - - // Print the new table contents. - get_stock_table(query, res); - print_stock_rows(res); - } - catch (const BadQuery& er) { - // Handle any query errors - cerr << "Query error: " << er.what() << endl; - return -1; - } - catch (const BadConversion& er) { - // Handle bad conversions - cerr << "Conversion error: " << er.what() << endl << - "\tretrieved data size: " << er.retrieved << - ", actual size: " << er.actual_size << endl; - return -1; - } - catch (const Exception& er) { - // Catch-all for any other MySQL++ exceptions - cerr << "Error: " << er.what() << endl; - return -1; - } - - return 0; -} DELETED examples/custom4.cpp Index: examples/custom4.cpp ================================================================== --- examples/custom4.cpp +++ /dev/null @@ -1,130 +0,0 @@ -/*********************************************************************** - custom4.cpp - Example very similar to custom1.cpp, except that it - stores its result set in an STL set container. This demonstrates - how one can manipulate MySQL++ result sets in a very natural C++ - style. - - Copyright (c) 1998 by Kevin Atkinson, (c) 1999, 2000 and 2001 by - MySQL AB, and (c) 2004, 2005 by Educational Technology Resources, Inc. - Others may also hold copyrights on code in this file. See the CREDITS - file in the top directory of the distribution for details. - - This file is part of MySQL++. - - MySQL++ is free software; you can redistribute it and/or modify it - under the terms of the GNU Lesser General Public License as published - by the Free Software Foundation; either version 2.1 of the License, or - (at your option) any later version. - - MySQL++ is distributed in the hope that it will be useful, but WITHOUT - ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public - License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with MySQL++; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 - USA -***********************************************************************/ - -#include "util.h" - -#include -#include - -#include -#include -#include -#include - -using namespace std; -using namespace mysqlpp; - -sql_create_5(stock, - 1, // This number is used to make a SSQLS less-than-comparable. - // When comparing two SSQLS structures, the first N elements are - // compared. In this instance, we are saying that we only want - // the first element ('item') to be used when comparing two - // stock structures. - - 5, // Each SSQLS structure includes a number of constructors. Some - // of these are fixed in nature, but one of these will have this - // number of arguments, one for each of the first N elements in - // the structure; it is an initialization ctor. Since N is the - // same as the number of structure elements in this instance, - // that ctor will be able to fully initialize the structure. This - // behavior is not always wanted, however, so the macro allows - // you make the constructor take fewer parameters, leaving the - // remaining elements uninitialized. An example of when this is - // necessary is when you have a structure containing only two - // integer elements: one of the other ctors defined for SSQLS - // structures takes two ints, so the compiler barfs if you pass - // 2 for this argument. You would need to pass 0 here to get - // that SSQLS structure to compile. - string, item, - longlong, num, - double, weight, - double, price, - Date, sdate) - -int -main(int argc, char *argv[]) -{ - try { - // Establish the connection to the database server. - Connection con(use_exceptions); - if (!connect_to_db(argc, argv, con)) { - return 1; - } - - // Retrieve all rows from the stock table and put them in an - // STL set. Notice that this works just as well as storing them - // in a vector, which we did in custom1.cpp. It works because - // SSQLS objects are less-than comparable. - Query query = con.query(); - query << "select * from stock"; - set res; - query.storein(res); - - // Display the result set. Since it is an STL set and we set up - // the SSQLS to compare based on the item column, the rows will - // be sorted by item. - print_stock_header(res.size()); - set::iterator it; - cout.precision(3); - for (it = res.begin(); it != res.end(); ++it) { - print_stock_row(it->item.c_str(), it->num, it->weight, - it->price, it->sdate); - } - - // Use set's find method to look up a stock item by item name. - // This also uses the SSQLS comparison setup. - it = res.find(stock("Hotdog Buns")); - if (it != res.end()) { - cout << endl << "Currently " << it->num << - " hotdog buns in stock." << endl; - } - else { - cout << endl << "Sorry, no hotdog buns in stock." << endl; - } - } - catch (const BadQuery& er) { - // Handle any query errors - cerr << "Query error: " << er.what() << endl; - return -1; - } - catch (const BadConversion& er) { - // Handle bad conversions - cerr << "Conversion error: " << er.what() << endl << - "\tretrieved data size: " << er.retrieved << - ", actual size: " << er.actual_size << endl; - return -1; - } - catch (const Exception& er) { - // Catch-all for any other MySQL++ exceptions - cerr << "Error: " << er.what() << endl; - return -1; - } - - return 0; -} DELETED examples/custom5.cpp Index: examples/custom5.cpp ================================================================== --- examples/custom5.cpp +++ /dev/null @@ -1,94 +0,0 @@ -/*********************************************************************** - custom5.cpp - Example showing how to use the equal_list() member of - some SSQLS types to build SELECT queries with custom WHERE clauses. - - Copyright (c) 1998 by Kevin Atkinson, (c) 1999, 2000 and 2001 by - MySQL AB, (c) 2004, 2005 by Educational Technology Resources, Inc., and - (c) 2005 by Chris Frey. Others may also hold copyrights on code in - this file. See the CREDITS file in the top directory of the - distribution for details. - - This file is part of MySQL++. - - MySQL++ is free software; you can redistribute it and/or modify it - under the terms of the GNU Lesser General Public License as published - by the Free Software Foundation; either version 2.1 of the License, or - (at your option) any later version. - - MySQL++ is distributed in the hope that it will be useful, but WITHOUT - ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public - License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with MySQL++; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 - USA -***********************************************************************/ - -#include "util.h" - -#include -#include - -#include -#include -#include - -using namespace std; -using namespace mysqlpp; - -sql_create_5(stock, - 1, 5, - string, item, - longlong, num, - double, weight, - double, price, - Date, sdate) - -int -main(int argc, char *argv[]) -{ - try { - Connection con(use_exceptions); - if (!connect_to_db(argc, argv, con)) { - return 1; - } - - // Get all the rows in the stock table. - Query query = con.query(); - query << "select * from stock"; - vector res; - query.storein(res); - - if (res.size() > 0) { - // Build a select query using the data from the first row - // returned by our previous query. - query.reset(); - query << "select * from stock where " << - res[0].equal_list(" and ", stock_weight, stock_price); - - // Display the finished query. - cout << "Custom query:\n" << query.preview() << endl; - } - } - catch (const BadQuery& er) { - // Handle any query errors - cerr << "Query error: " << er.what() << endl; - return -1; - } - catch (const BadConversion& er) { - // Handle bad conversions - cerr << "Conversion error: " << er.what() << endl << - "\tretrieved data size: " << er.retrieved << - ", actual size: " << er.actual_size << endl; - return -1; - } - catch (const Exception& er) { - // Catch-all for any other MySQL++ exceptions - cerr << "Error: " << er.what() << endl; - return -1; - } - - return 0; -} DELETED examples/custom6.cpp Index: examples/custom6.cpp ================================================================== --- examples/custom6.cpp +++ /dev/null @@ -1,91 +0,0 @@ -/*********************************************************************** - custom6.cpp - Same as custom1, except that it requests only a subset of - the stock table. See also simple1, for another way to accomplish - the same thing, without using SSQLS. - - Copyright (c) 1998 by Kevin Atkinson, (c) 1999, 2000 and 2001 by - MySQL AB, and (c) 2004, 2005 by Educational Technology Resources, Inc. - Others may also hold copyrights on code in this file. See the CREDITS - file in the top directory of the distribution for details. - - This file is part of MySQL++. - - MySQL++ is free software; you can redistribute it and/or modify it - under the terms of the GNU Lesser General Public License as published - by the Free Software Foundation; either version 2.1 of the License, or - (at your option) any later version. - - MySQL++ is distributed in the hope that it will be useful, but WITHOUT - ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public - License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with MySQL++; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 - USA -***********************************************************************/ - -#include "util.h" - -#include -#include - -#include -#include -#include - -using namespace std; -using namespace mysqlpp; - -// To store a subset of a row, we define an SSQLS containing just the -// fields that we will store. There are complications here that are -// covered in the user manual. -sql_create_1(stock_subset, - 1, 0, - string, item) - -int -main(int argc, char *argv[]) -{ - try { - // Establish the connection to the database server. - Connection con(use_exceptions); - if (!connect_to_db(argc, argv, con)) { - return 1; - } - - // Retrieve a subset of the stock table, and store the data in - // a vector of 'stock_subset' SSQLS structures. - Query query = con.query(); - query << "select item from stock"; - vector res; - query.storein(res); - - // Display the result set - cout << "We have:" << endl; - vector::iterator it; - for (it = res.begin(); it != res.end(); ++it) { - cout << '\t' << it->item << endl; - } - } - catch (const BadQuery& er) { - // Handle any query errors - cerr << "Query error: " << er.what() << endl; - return -1; - } - catch (const BadConversion& er) { - // Handle bad conversions; e.g. type mismatch populating 'stock' - cerr << "Conversion error: " << er.what() << endl << - "\tretrieved data size: " << er.retrieved << - ", actual size: " << er.actual_size << endl; - return -1; - } - catch (const Exception& er) { - // Catch-all for any other MySQL++ exceptions - cerr << "Error: " << er.what() << endl; - return -1; - } - - return 0; -} Index: examples/dbinfo.cpp ================================================================== --- examples/dbinfo.cpp +++ examples/dbinfo.cpp @@ -1,13 +1,13 @@ /*********************************************************************** dbinfo.cpp - Example showing how to request information about the database schema, such as table names, column types, etc. - Copyright (c) 1998 by Kevin Atkinson, (c) 1999, 2000 and 2001 by - MySQL AB, and (c) 2004, 2005 by Educational Technology Resources, Inc. - Others may also hold copyrights on code in this file. See the CREDITS - file in the top directory of the distribution for details. + Copyright (c) 1998 by Kevin Atkinson, (c) 1999-2001 by MySQL AB, and + (c) 2004-2009 by Educational Technology Resources, Inc. Others may + also hold copyrights on code in this file. See the CREDITS.txt file + in the top directory of the distribution for details. This file is part of MySQL++. MySQL++ is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published @@ -23,162 +23,170 @@ License along with MySQL++; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA ***********************************************************************/ -#include "util.h" +#include "cmdline.h" +#include "printdata.h" #include #include #include #include #include using namespace std; -using namespace mysqlpp; - -vector yy; - -static ostream& -separator(ostream& os) -{ - os << endl << "---------------------------" << endl << endl; - return os; -} - -int -main(int argc, char* argv[]) -{ - Connection con(use_exceptions); - try { - connect_to_db(argc, argv, con, ""); - - // Show MySQL version - cout << "MySQL version: " << con.client_info() << separator; - Query query = con.query(); - - // Show all the databases we can see - query << "show databases"; - cout << "Query: " << query.preview() << endl; - - Result res = query.store(); - cout << "Databases found: " << res.size(); - - Row row; - cout.setf(ios::left); - Result::iterator i; - for (i = res.begin(); i != res.end(); ++i) { - row = *i; - cout << endl << '\t' << setw(17) << row.at(0); - } - cout << separator; - - // Show the tables in the mysql database - con.select_db("mysql"); - - query.reset(); - query << "show tables"; - cout << "Query: " << query.preview() << endl; - - res = query.store(); - cout << "Tables found: " << res.size(); - - cout.setf(ios::left); - for (i = res.begin(); i != res.end(); ++i) { - row = *i; - string xx(row.at(0)); - cout << endl << '\t' << setw(17) << row.at(0); - yy.push_back(xx); - } - cout << separator; - - // Show information about each of the tables we found - for (unsigned int j = 0; j < yy.size(); ++j) { - query.reset(); - query << "describe " << yy[j] << ""; - cout << "Query: " << query.preview() << endl; - res = query.store(); - unsigned int columns = res.num_fields(), counter; - vector widths; - for (counter = 0; counter < columns; counter++) { - string s = res.names(counter); - if (s.compare("field") == 0) { - widths.push_back(22); - } - else if (s.compare("type") == 0) { - widths.push_back(20); - } - else if (s.compare("null") == 0) { - widths.push_back(4); - } - else if (s.compare("key") == 0) { - widths.push_back(3); - } - else if (s.compare("extra") == 0) { - widths.push_back(0); - } - else { - widths.push_back(15); - } - - if (widths[counter]) { - cout << '|' << setw(widths[counter]) << - res.names(counter) << '|'; - } - } - cout << endl; - - for (i = res.begin(); i != res.end(); ++i) { - row = *i; - for (counter = 0; counter < columns; counter++) { - if (widths[counter]) { - cout << ' ' << setw(widths[counter]) << - row.at(counter) << ' '; - } - } - cout << endl; - } - - cout << separator; - } - - // Show the user table contents - query.reset(); - query << "select * from user"; - cout << "Query: " << query.preview() << endl << endl; - - res = query.store(); - int columns = res.num_fields(); - cout << "fields = " << res.num_fields() << ", rows = " << - res.size() << endl; - volatile MYSQL_RES* ress = res.raw_result(); - if (!ress) - return -1; - for (i = res.begin(); i != res.end(); ++i) { - row = *i; - for (int counter = 0; counter < columns; counter++) { - cout << row.at(counter) << " "; - } - cout << endl; - } - } - catch (const BadQuery& er) { + + +// Insert a bar into the stream with the given query string centered +static void +separator(ostream& os, string qstr) +{ + string sep("========================================" + "========================================"); + if (qstr.size()) { + string::size_type start = (sep.size() - qstr.size()) / 2; + sep.replace(start - 1, 1, 1, ' '); + sep.replace(start, qstr.size(), qstr); + sep.replace(start + qstr.size(), 1, 1, ' '); + os << "\n\n"; + } + os << sep << endl; +} + + +// Print out the MySQL server version +static void +show_mysql_version(mysqlpp::Connection& con) +{ + separator(cout, ""); + cout << "MySQL version: " << con.client_version(); +} + + +// Print out the names of all the databases managed by the server +static void +show_databases(mysqlpp::Connection& con) +{ + mysqlpp::Query query = con.query("show databases"); + separator(cout, query.str()); + mysqlpp::StoreQueryResult res = query.store(); + + cout << "Databases found: " << res.size(); + cout.setf(ios::left); + mysqlpp::StoreQueryResult::iterator rit; + for (rit = res.begin(); rit != res.end(); ++rit) { + cout << "\n\t" << (*rit)[0]; + } +} + + +// Print information about each of the tables we found +static void +show_table_info(mysqlpp::Connection& con, const vector& tables) +{ + vector::const_iterator it; + for (it = tables.begin(); it != tables.end(); ++it) { + mysqlpp::Query query = con.query(); + query << "describe " << *it; + separator(cout, query.str()); + mysqlpp::StoreQueryResult res = query.store(); + + size_t columns = res.num_fields(); + vector widths; + for (size_t i = 0; i < columns; ++i) { + string s = res.field_name(int(i)); + if (s.compare("field") == 0) { + widths.push_back(22); + } + else if (s.compare("type") == 0) { + widths.push_back(20); + } + else if (s.compare("null") == 0) { + widths.push_back(4); + } + else if (s.compare("key") == 0) { + widths.push_back(3); + } + else if (s.compare("extra") == 0) { + widths.push_back(0); + } + else { + widths.push_back(15); + } + + if (widths[i]) { + cout << '|' << setw(widths[i]) << + res.field_name(int(i)) << '|'; + } + } + cout << endl; + + mysqlpp::StoreQueryResult::iterator rit; + for (rit = res.begin(); rit != res.end(); ++rit) { + for (unsigned int i = 0; i < columns; ++i) { + if (widths[i]) { + cout << ' ' << setw(widths[i]) << + (*rit)[i].c_str() << ' '; + } + } + cout << endl; + } + } +} + + +// Print out the names of all tables in the sample database, and +// return the list of tables. +static void +show_tables(mysqlpp::Connection& con) +{ + mysqlpp::Query query = con.query("show tables"); + separator(cout, query.str()); + mysqlpp::StoreQueryResult res = query.store(); + + cout << "Tables found: " << res.size(); + cout.setf(ios::left); + vector tables; + mysqlpp::StoreQueryResult::iterator rit; + for (rit = res.begin(); rit != res.end(); ++rit) { + string tbl((*rit)[0]); + cout << "\n\t" << tbl; + tables.push_back(tbl); + } + + show_table_info(con, tables); +} + + +// Call all the above functions in sequence +int +main(int argc, char* argv[]) +{ + // Get database access parameters from command line + mysqlpp::examples::CommandLine cmdline(argc, argv); + if (!cmdline) { + return 1; + } + + try { + // Connect to server, then dump a bunch of stuff we find on it + mysqlpp::Connection con(mysqlpp::examples::db_name, + cmdline.server(), cmdline.user(), cmdline.pass()); + show_mysql_version(con); + show_databases(con); + show_tables(con); + } + catch (const mysqlpp::BadQuery& er) { // Handle any query errors cerr << "Query error: " << er.what() << endl; return -1; } - catch (const BadConversion& er) { - // Handle bad conversions - cerr << "Conversion error: " << er.what() << endl << - "\tretrieved data size: " << er.retrieved << - ", actual size: " << er.actual_size << endl; - return -1; - } - catch (const Exception& er) { + catch (const mysqlpp::Exception& er) { // Catch-all for any other MySQL++ exceptions cerr << "Error: " << er.what() << endl; return -1; } return 0; } ADDED examples/deadlock.cpp Index: examples/deadlock.cpp ================================================================== --- /dev/null +++ examples/deadlock.cpp @@ -0,0 +1,117 @@ +/*********************************************************************** + deadlock.cpp - Demonstrates how MySQL's deadlock detection interacts + with MySQL++'s Transaction class an exception handling mechanism. + Run one copy of this program with the -m1 command line switch, then + while it's waiting for you to press Enter, run another copy with -m2 + instead. + + Copyright (c) 2007 by Jim Wallace and (c) 2007-2009 by Educational + Technology Resources, Inc. Others may also hold copyrights on code + in this file. See the CREDITS.txt file in the top directory of the + distribution for details. + + This file is part of MySQL++. + + MySQL++ is free software; you can redistribute it and/or modify it + under the terms of the GNU Lesser General Public License as published + by the Free Software Foundation; either version 2.1 of the License, or + (at your option) any later version. + + MySQL++ is distributed in the hope that it will be useful, but WITHOUT + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public + License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with MySQL++; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 + USA +***********************************************************************/ + +#include "cmdline.h" + +#include +#include + +#include + +using namespace std; + +// Bring in global holding the value given to the -m switch +extern int run_mode; + + +int +main(int argc, char *argv[]) +{ + // Get database access parameters from command line + mysqlpp::examples::CommandLine cmdline(argc, argv); + if (!cmdline) { + return 1; + } + + // Check that the mode parameter was also given and it makes sense + const int run_mode = cmdline.run_mode(); + if ((run_mode != 1) && (run_mode != 2)) { + cerr << argv[0] << " must be run with -m1 or -m2 as one of " + "its command-line arguments." << endl; + return 1; + } + + mysqlpp::Connection con; + try { + // Establish the connection to the database server + mysqlpp::Connection con(mysqlpp::examples::db_name, + cmdline.server(), cmdline.user(), cmdline.pass()); + + // Start a transaction set. Transactions create mutex locks on + // modified rows, so if two programs both touch the same pair of + // rows but in opposite orders at the wrong time, one of the two + // programs will deadlock. The MySQL server knows how to detect + // this situation, and its error return causes MySQL++ to throw + // a BadQuery exception. The point of this example is that if + // you want to detect this problem, you would check the value of + // BadQuery::errnum(), not Connection::errnum(), because the + // transaction rollback process executes a query which succeeds, + // setting the MySQL C API's "last error number" value to 0. + // The exception object carries its own copy of the error number + // at the point the exception was thrown for this very reason. + mysqlpp::Query query = con.query(); + mysqlpp::Transaction trans(con); + + // Build and run the queries, with the order depending on the -m + // flag, so that a second copy of the program will deadlock if + // run while the first is waiting for Enter. + char dummy[100]; + for (int i = 0; i < 2; ++i) { + int lock = run_mode + (run_mode == 1 ? i : -i); + cout << "Trying lock " << lock << "..." << endl; + + query << "select * from deadlock_test" << lock << + " where x = " << lock << " for update"; + query.store(); + + cout << "Acquired lock " << lock << ". Press Enter to "; + cout << (i == 0 ? "try next lock" : "exit"); + cout << ": " << flush; + cin.getline(dummy, sizeof(dummy)); + } + } + catch (mysqlpp::BadQuery e) { + if (e.errnum() == ER_LOCK_DEADLOCK) { + cerr << "Transaction deadlock detected!" << endl; + cerr << "Connection::errnum = " << con.errnum() << + ", BadQuery::errnum = " << e.errnum() << endl; + } + else { + cerr << "Unexpected query error: " << e.what() << endl; + } + return 1; + } + catch (mysqlpp::Exception e) { + cerr << "General error: " << e.what() << endl; + return 1; + } + + return 0; +} ADDED examples/fieldinf.cpp Index: examples/fieldinf.cpp ================================================================== --- /dev/null +++ examples/fieldinf.cpp @@ -0,0 +1,115 @@ +/*********************************************************************** + fieldinf.cpp - Shows how to request information about the fields in a + table, such as their SQL and C++-equivalent types. + + Copyright (c) 1998 by Kevin Atkinson, (c) 1999-2001 by MySQL AB, and + (c) 2004-2009 by Educational Technology Resources, Inc. Others may + also hold copyrights on code in this file. See the CREDITS.txt file + in the top directory of the distribution for details. + + This file is part of MySQL++. + + MySQL++ is free software; you can redistribute it and/or modify it + under the terms of the GNU Lesser General Public License as published + by the Free Software Foundation; either version 2.1 of the License, or + (at your option) any later version. + + MySQL++ is distributed in the hope that it will be useful, but WITHOUT + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public + License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with MySQL++; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 + USA +***********************************************************************/ + +#include "cmdline.h" +#include "printdata.h" + +#include +#include + +using namespace std; + + +int +main(int argc, char *argv[]) +{ + // Get database access parameters from command line + mysqlpp::examples::CommandLine cmdline(argc, argv); + if (!cmdline) { + return 1; + } + + try { + // Establish the connection to the database server. + mysqlpp::Connection con(mysqlpp::examples::db_name, + cmdline.server(), cmdline.user(), cmdline.pass()); + + // Get contents of main example table + mysqlpp::Query query = con.query("select * from stock"); + mysqlpp::StoreQueryResult res = query.store(); + + // Show info about each field in that table + char widths[] = { 12, 22, 46 }; + cout.setf(ios::left); + cout << setw(widths[0]) << "Field" << + setw(widths[1]) << "SQL Type" << + setw(widths[2]) << "Equivalent C++ Type" << + endl; + for (size_t i = 0; i < sizeof(widths) / sizeof(widths[0]); ++i) { + cout << string(widths[i] - 1, '=') << ' '; + } + cout << endl; + + for (size_t i = 0; i < res.field_names()->size(); i++) { + // Suppress C++ type name outputs when run under dtest, + // as they're system-specific. + const char* cname = res.field_type(int(i)).name(); + mysqlpp::FieldTypes::value_type ft = res.field_type(int(i)); + ostringstream os; + os << ft.sql_name() << " (" << ft.id() << ')'; + cout << setw(widths[0]) << res.field_name(int(i)).c_str() << + setw(widths[1]) << os.str() << + setw(widths[2]) << cname << + endl; + } + cout << endl; + + // Simple type check + if (res.field_type(0) == typeid(string)) { + cout << "SQL type of 'item' field most closely resembles " + "the C++ string type." << endl; + } + + // Tricky type check: the 'if' path shouldn't happen because the + // description field has the NULL attribute. We need to dig a + // little deeper if we want to ignore this in our type checks. + if (res.field_type(5) == typeid(string)) { + cout << "Should not happen! Type check failure." << endl; + } + else if (res.field_type(5) == typeid(mysqlpp::sql_blob_null)) { + cout << "SQL type of 'description' field resembles " + "a nullable variant of the C++ string type." << endl; + } + else { + cout << "Weird: fifth field's type is now " << + res.field_type(5).name() << endl; + cout << "Did something recently change in resetdb?" << endl; + } + } + catch (const mysqlpp::BadQuery& er) { + // Handle any query errors + cerr << "Query error: " << er.what() << endl; + return -1; + } + catch (const mysqlpp::Exception& er) { + // Catch-all for any other MySQL++ exceptions + cerr << "Error: " << er.what() << endl; + return -1; + } + + return 0; +} DELETED examples/fieldinf1.cpp Index: examples/fieldinf1.cpp ================================================================== --- examples/fieldinf1.cpp +++ /dev/null @@ -1,115 +0,0 @@ -/*********************************************************************** - fieldinf1.cpp - Example showing how to request information about the - fields in a table, such as their SQL and C++-equivalent types, as - MySQL++ sees it. - - Copyright (c) 1998 by Kevin Atkinson, (c) 1999, 2000 and 2001 by - MySQL AB, and (c) 2004, 2005 by Educational Technology Resources, Inc. - Others may also hold copyrights on code in this file. See the CREDITS - file in the top directory of the distribution for details. - - This file is part of MySQL++. - - MySQL++ is free software; you can redistribute it and/or modify it - under the terms of the GNU Lesser General Public License as published - by the Free Software Foundation; either version 2.1 of the License, or - (at your option) any later version. - - MySQL++ is distributed in the hope that it will be useful, but WITHOUT - ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public - License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with MySQL++; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 - USA -***********************************************************************/ - -#include "util.h" - -#include - -#include -#include - -using namespace std; -using namespace mysqlpp; - -int -main(int argc, char *argv[]) -{ - try { - Connection con(use_exceptions); - if (!connect_to_db(argc, argv, con)) { - return 1; - } - - Query query = con.query(); - query << "select * from stock"; - cout << "Query: " << query.preview() << endl; - - Result res = query.store(); - cout << "Records Found: " << res.size() << endl << endl; - - cout << "Query Info:\n"; - cout.setf(ios::left); - - for (unsigned int i = 0; i < res.names().size(); i++) { - cout << setw(2) << i - // this is the name of the field - << setw(15) << res.names(i).c_str() - // this is the SQL identifier name - // Result::types(unsigned int) returns a mysql_type_info which in many - // ways is like type_info except that it has additional sql type - // information in it. (with one of the methods being sql_name()) - << setw(15) << res.types(i).sql_name() - // this is the C++ identifier name which most closely resembles - // the sql name (its is implementation defined and often not very readable) - << setw(20) << res.types(i).name() - << endl; - } - - cout << endl; - - if (res.types(0) == typeid(string)) { - // this is demonstrating how a mysql_type_info can be - // compared with a C++ type_info. - cout << "Field 'item' is of an SQL type which most " - "closely resembles\nthe C++ string type\n"; - } - - if (res.types(1) == typeid(longlong)) { - cout << "Field 'num' is of an SQL type which most " - "closely resembles\nC++ long long int type\n"; - } - else if (res.types(1).base_type() == typeid(longlong)) { - // you have to be careful as if it can be null the actual - // type is Null not TYPE. So you should always use - // the base_type method to get at the underlying type. - // If the type is not null than this base type would be - // the same as its type. - cout << "Field 'num' base type is of an SQL type which " - "most closely\nresembles the C++ long long int type\n"; - } - } - catch (const BadQuery& er) { - // Handle any query errors - cerr << "Query error: " << er.what() << endl; - return -1; - } - catch (const BadConversion& er) { - // Handle bad conversions - cerr << "Conversion error: " << er.what() << endl << - "\tretrieved data size: " << er.retrieved << - ", actual size: " << er.actual_size << endl; - return -1; - } - catch (const Exception& er) { - // Catch-all for any other MySQL++ exceptions - cerr << "Error: " << er.what() << endl; - return -1; - } - - return 0; -} ADDED examples/for_each.cpp Index: examples/for_each.cpp ================================================================== --- /dev/null +++ examples/for_each.cpp @@ -0,0 +1,109 @@ +/*********************************************************************** + for_each.cpp - Demonstrates Query::for_each(), showing how to perform + an arbitrary action on each row in a result set. + + Copyright (c) 2005-2009 by Educational Technology Resources, Inc. and + (c) 2007 by Switchplane, Ltd. Others may also hold copyrights on + code in this file. See the CREDITS.txt file in the top directory + of the distribution for details. + + This file is part of MySQL++. + + MySQL++ is free software; you can redistribute it and/or modify it + under the terms of the GNU Lesser General Public License as published + by the Free Software Foundation; either version 2.1 of the License, or + (at your option) any later version. + + MySQL++ is distributed in the hope that it will be useful, but WITHOUT + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public + License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with MySQL++; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 + USA +***********************************************************************/ + +#include "cmdline.h" +#include "printdata.h" +#include "stock.h" + +#include + +#include + +#include + + +// Define a functor to collect statistics about the stock table +class gather_stock_stats +{ +public: + gather_stock_stats() : + items_(0), + weight_(0), + cost_(0) + { + } + + void operator()(const stock& s) + { + items_ += s.num; + weight_ += (s.num * s.weight); + cost_ += (s.num * s.price.data); + } + +private: + mysqlpp::sql_bigint items_; + mysqlpp::sql_double weight_, cost_; + + friend std::ostream& operator<<(std::ostream& os, + const gather_stock_stats& ss); +}; + + +// Dump the contents of gather_stock_stats to a stream in human-readable +// form. +std::ostream& +operator<<(std::ostream& os, const gather_stock_stats& ss) +{ + os << ss.items_ << " items " << + "weighing " << ss.weight_ << " stone and " << + "costing " << ss.cost_ << " cowrie shells"; + return os; +} + + +int +main(int argc, char *argv[]) +{ + // Get database access parameters from command line + mysqlpp::examples::CommandLine cmdline(argc, argv); + if (!cmdline) { + return 1; + } + + try { + // Establish the connection to the database server. + mysqlpp::Connection con(mysqlpp::examples::db_name, + cmdline.server(), cmdline.user(), cmdline.pass()); + + // Gather and display the stats for the entire stock table + mysqlpp::Query query = con.query(); + std::cout << "There are " << query.for_each(stock(), + gather_stock_stats()) << '.' << std::endl; + } + catch (const mysqlpp::BadQuery& e) { + // Something went wrong with the SQL query. + std::cerr << "Query failed: " << e.what() << std::endl; + return 1; + } + catch (const mysqlpp::Exception& er) { + // Catch-all for any other MySQL++ exceptions + std::cerr << "Error: " << er.what() << std::endl; + return 1; + } + + return 0; +} ADDED examples/images.h Index: examples/images.h ================================================================== --- /dev/null +++ examples/images.h @@ -0,0 +1,32 @@ +/*********************************************************************** + images.h - Declares the images table SSQLS. + + Copyright (c) 2008-2010 by Educational Technology Resources, Inc. + Others may also hold copyrights on code in this file. See the + CREDITS.txt file in the top directory of the distribution for details. + + This file is part of MySQL++. + + MySQL++ is free software; you can redistribute it and/or modify it + under the terms of the GNU Lesser General Public License as published + by the Free Software Foundation; either version 2.1 of the License, or + (at your option) any later version. + + MySQL++ is distributed in the hope that it will be useful, but WITHOUT + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public + License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with MySQL++; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 + USA +***********************************************************************/ + +#include +#include + +sql_create_2(images, + 1, 2, + mysqlpp::sql_int_unsigned_null, id, + mysqlpp::sql_blob_null, data) DELETED examples/load_file.cpp Index: examples/load_file.cpp ================================================================== --- examples/load_file.cpp +++ /dev/null @@ -1,98 +0,0 @@ -/*********************************************************************** - load_file.cpp - Example showing how to insert BLOB data into the - database from a file. - - Copyright (c) 1998 by Kevin Atkinson, (c) 1999, 2000 and 2001 by - MySQL AB, and (c) 2004, 2005 by Educational Technology Resources, Inc. - Others may also hold copyrights on code in this file. See the CREDITS - file in the top directory of the distribution for details. - - This file is part of MySQL++. - - MySQL++ is free software; you can redistribute it and/or modify it - under the terms of the GNU Lesser General Public License as published - by the Free Software Foundation; either version 2.1 of the License, or - (at your option) any later version. - - MySQL++ is distributed in the hope that it will be useful, but WITHOUT - ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public - License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with MySQL++; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 - USA -***********************************************************************/ - -#include - -#include - -#include - -#include - -using namespace std; -using namespace mysqlpp; - -const char MY_DATABASE[] = "telcent"; -const char MY_TABLE[] = "fax"; -const char MY_HOST[] = "localhost"; -const char MY_USER[] = "root"; -const char MY_PASSWORD[] = ""; -const char MY_FIELD[] = "fax"; // BLOB field - -int -main(int argc, char *argv[]) -{ - if (argc < 2) { - cerr << "Usage : load_file full_file_path" << endl << endl; - return -1; - } - - Connection con(use_exceptions); - try { - con.connect(MY_DATABASE, MY_HOST, MY_USER, MY_PASSWORD); - Query query = con.query(); - ostringstream strbuf; - ifstream In(argv[1], ios::in | ios::binary); - struct stat for_len; - if ((In.rdbuf())->is_open()) { - if (stat(argv[1], &for_len) == -1) - return -1; - unsigned int blen = for_len.st_size; - if (!blen) - return -1; - char *read_buffer = new char[blen]; - In.read(read_buffer, blen); - string fill(read_buffer, blen); - strbuf << "INSERT INTO " << MY_TABLE << " (" << MY_FIELD << - ") VALUES(\"" << mysqlpp::escape << fill << "\")" << ends; - query.exec(strbuf.str()); - delete[]read_buffer; - } - else - cerr << "Failed to open " << argv[1] << - '.' << endl; - } - catch (const BadQuery& er) { - // Handle any query errors - cerr << "Query error: " << er.what() << endl; - return -1; - } - catch (const BadConversion& er) { - // Handle bad conversions - cerr << "Conversion error: " << er.what() << endl << - "\tretrieved data size: " << er.retrieved << - ", actual size: " << er.actual_size << endl; - return -1; - } - catch (const Exception& er) { - // Catch-all for any other MySQL++ exceptions - cerr << "Error: " << er.what() << endl; - return -1; - } - - return 0; -} ADDED examples/load_jpeg.cpp Index: examples/load_jpeg.cpp ================================================================== --- /dev/null +++ examples/load_jpeg.cpp @@ -0,0 +1,163 @@ +/*********************************************************************** + load_jpeg.cpp - Example showing how to insert BLOB data into the + database from a file. + + Copyright (c) 1998 by Kevin Atkinson, (c) 1999-2001 by MySQL AB, and + (c) 2004-2009 by Educational Technology Resources, Inc. Others may + also hold copyrights on code in this file. See the CREDITS.txt file + in the top directory of the distribution for details. + + This file is part of MySQL++. + + MySQL++ is free software; you can redistribute it and/or modify it + under the terms of the GNU Lesser General Public License as published + by the Free Software Foundation; either version 2.1 of the License, or + (at your option) any later version. + + MySQL++ is distributed in the hope that it will be useful, but WITHOUT + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public + License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with MySQL++; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 + USA +***********************************************************************/ + +#include "cmdline.h" +#include "images.h" +#include "printdata.h" + +#include + +using namespace std; +using namespace mysqlpp; + + +// This is just an implementation detail for the example. Skip down to +// main() for the concept this example is trying to demonstrate. You +// can simply assume that, given a BLOB containing a valid JPEG, it +// returns true. +static bool +is_jpeg(const mysqlpp::sql_blob& img, const char** whynot) +{ + // See http://stackoverflow.com/questions/2253404/ for + // justification for the various tests. + const unsigned char* idp = + reinterpret_cast(img.data()); + if (img.size() < 125) { + *whynot = "a valid JPEG must be at least 125 bytes"; + } + else if ((idp[0] != 0xFF) || (idp[1] != 0xD8)) { + *whynot = "file does not begin with JPEG sigil bytes"; + } + else if ((memcmp(idp + 6, "JFIF", 4) != 0) && + (memcmp(idp + 6, "Exif", 4) != 0)) { + *whynot = "file does not contain JPEG type word"; + } + else { + *whynot = 0; + return true; + } + + return false; +} + + +// Skip to main() before studying this. This is a little too +// low-level to bother with on your first pass thru the code. +static bool +load_jpeg_file(const mysqlpp::examples::CommandLine& cmdline, + images& img, string& img_name) +{ + if (cmdline.extra_args().size() == 0) { + // Nothing for us to do here. Caller will insert NULL BLOB. + return true; + } + + // Got a file's name on the command line, so open it. + img_name = cmdline.extra_args()[0]; + ifstream img_file(img_name.c_str(), ios::binary); + if (img_file) { + // Slurp file contents into RAM with minimum copying. (Idiom + // explained here: http://stackoverflow.com/questions/116038/) + // + // By loading the file into a C++ string (stringstream::str()) + // and assigning that directly to a mysqlpp::sql_blob, we avoid + // truncating the binary data at the first null character. + img.data.data = static_cast( + &(stringstream() << img_file.rdbuf()))->str(); + + // Check JPEG data for sanity. + const char* error; + if (is_jpeg(img.data.data, &error)) { + return true; + } + else { + cerr << '"' << img_name << "\" isn't a JPEG: " << + error << '!' << endl; + } + } + + cmdline.print_usage("[jpeg_file]"); + return false; +} + + +int +main(int argc, char *argv[]) +{ + // Get database access parameters from command line + mysqlpp::examples::CommandLine cmdline(argc, argv); + if (!cmdline) { + return 1; + } + + try { + // Establish the connection to the database server. + mysqlpp::Connection con(mysqlpp::examples::db_name, + cmdline.server(), cmdline.user(), cmdline.pass()); + + // Load the file named on the command line + images img(mysqlpp::null, mysqlpp::null); + string img_name("NULL"); + if (load_jpeg_file(cmdline, img, img_name)) { + // Insert image data or SQL NULL into the images.data BLOB + // column. The key here is that we're holding the raw + // binary data in a mysqlpp::sql_blob, which avoids data + // conversion problems that can lead to treating BLOB data + // as C strings, thus causing null-truncation. The fact + // that we're using SSQLS here is a side issue, simply + // demonstrating that mysqlpp::Null is + // now legal in SSQLS, as of MySQL++ 3.0.7. + Query query = con.query(); + query.insert(img); + SimpleResult res = query.execute(); + + // Report successful insertion + cout << "Inserted \"" << img_name << + "\" into images table, " << img.data.data.size() << + " bytes, ID " << res.insert_id() << endl; + } + } + catch (const BadQuery& er) { + // Handle any query errors + cerr << "Query error: " << er.what() << endl; + return -1; + } + catch (const BadConversion& er) { + // Handle bad conversions + cerr << "Conversion error: " << er.what() << endl << + "\tretrieved data size: " << er.retrieved << + ", actual size: " << er.actual_size << endl; + return -1; + } + catch (const Exception& er) { + // Catch-all for any other MySQL++ exceptions + cerr << "Error: " << er.what() << endl; + return -1; + } + + return 0; +} ADDED examples/logo.jpg Index: examples/logo.jpg ================================================================== --- /dev/null +++ examples/logo.jpg cannot compute difference between binary files Index: examples/multiquery.cpp ================================================================== --- examples/multiquery.cpp +++ examples/multiquery.cpp @@ -1,17 +1,17 @@ /*********************************************************************** multiquery.cpp - Example showing how to iterate over result sets upon - execution of a query that returns more than one result set. You can + execution of a query that returns more than one result set. You can get multiple result sets when executing multiple separate SQL statments in a single query, or when dealing with the results of calling a stored procedure. - Copyright (c) 1998 by Kevin Atkinson, (c) 1999, 2000 and 2001 by - MySQL AB, (c) 2004, 2005 by Educational Technology Resources, Inc., - and (c) 2005 by Arnon Jalon. Others may also hold copyrights on - code in this file. See the CREDITS file in the top directory of - the distribution for details. + Copyright (c) 1998 by Kevin Atkinson, (c) 1999-2001 by MySQL AB, + (c) 2004-2009 by Educational Technology Resources, Inc., and (c) + 2005 by Arnon Jalon. Others may also hold copyrights on code in + this file. See the CREDITS.txt file in the top directory of the + distribution for details. This file is part of MySQL++. MySQL++ is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published @@ -27,42 +27,44 @@ License along with MySQL++; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA ***********************************************************************/ -#include "util.h" +#include "cmdline.h" +#include "printdata.h" #include +#include #include #include #include using namespace std; using namespace mysqlpp; -typedef vector IntVectorType; +typedef vector IntVectorType; static void -print_header(IntVectorType& widths, Result& res) +print_header(IntVectorType& widths, StoreQueryResult& res) { cout << " |" << setfill(' '); - for (size_t i = 0; i < res.names().size(); i++) { - cout << " " << setw(widths.at(i)) << res.names(i) << " |"; + for (size_t i = 0; i < res.field_names()->size(); i++) { + cout << " " << setw(widths.at(i)) << res.field_name(int(i)) << " |"; } cout << endl; } static void print_row(IntVectorType& widths, Row& row) { cout << " |" << setfill(' '); - for (size_t i = 0; i < row.size(); i++) { - cout << " " << setw(widths.at(i)) << row.raw_data(i) << " |"; + for (size_t i = 0; i < row.size(); ++i) { + cout << " " << setw(widths.at(i)) << row[int(i)] << " |"; } cout << endl; } @@ -76,14 +78,14 @@ cout << endl; } static void -print_result(Result& res, int index) +print_result(StoreQueryResult& res, int index) { // Show how many rows are in result, if any - int num_results = res.size(); + StoreQueryResult::size_type num_results = res.size(); if (res && (num_results > 0)) { cout << "Result set " << index << " has " << num_results << " row" << (num_results == 1 ? "" : "s") << ':' << endl; } else { @@ -91,26 +93,25 @@ return; } // Figure out the widths of the result set's columns IntVectorType widths; - int size = res.columns(); - for (int i = 0; i < size; i++) { - mysql_type_info mti(res.fields(i)); - widths.push_back((res.names(i).size() > mti.max_length()) ? - res.names(i).size() : mti.max_length()); + size_t size = res.num_fields(); + for (size_t i = 0; i < size; i++) { + widths.push_back(max( + res.field(i).max_length(), + res.field_name(i).size())); } // Print result set header print_row_separator(widths); print_header(widths, res); print_row_separator(widths); // Display the result set contents - for (int i = 0; i < num_results; ++i) { - Row row = res.fetch_row(); - print_row(widths, row); + for (StoreQueryResult::size_type i = 0; i < num_results; ++i) { + print_row(widths, res[i]); } // Print result set footer print_row_separator(widths); } @@ -117,55 +118,84 @@ static void print_multiple_results(Query& query) { - try { - // Execute query and print all result sets - Result res = query.store(); - print_result(res, 0); - for (int i = 1; query.more_results(); ++i) { - res = query.store_next(); - print_result(res, i); - } - } - catch (Exception& err) { - // Something bad happened.... - cerr << "Multi-query failure: " << err.what() << endl; - exit(1); + // Execute query and print all result sets + StoreQueryResult res = query.store(); + print_result(res, 0); + for (int i = 1; query.more_results(); ++i) { + res = query.store_next(); + print_result(res, i); } } int main(int argc, char *argv[]) { - Connection con; + // Get connection parameters from command line + mysqlpp::examples::CommandLine cmdline(argc, argv); + if (!cmdline) { + return 1; + } + try { - // Enable multi-queries. Notice that we can set connection - // options before the connection is established, which the - // underlying MySQL C API does not allow. In this particular - // case, this is not a mere nicety: the multi-query option has - // a side effect of setting one of the flags used when - // establishing the database server connection. We could set it - // directly, but then we couldn't use connect_to_db(). - con.set_option(Connection::opt_multi_statements, true); - - // Connect to database - if (!connect_to_db(argc, argv, con)) { + // Enable multi-queries. Notice that you almost always set + // MySQL++ connection options before establishing the server + // connection, and options are always set using this one + // interface. If you're familiar with the underlying C API, + // you know that there is poor consistency on these matters; + // MySQL++ abstracts these differences away. + Connection con; + con.set_option(new MultiStatementsOption(true)); + + // Connect to the database + if (!con.connect(mysqlpp::examples::db_name, cmdline.server(), + cmdline.user(), cmdline.pass())) { return 1; } + + // Set up query with multiple queries. + Query query = con.query(); + query << "DROP TABLE IF EXISTS test_table; " << + "CREATE TABLE test_table(id INT); " << + "INSERT INTO test_table VALUES(10); " << + "UPDATE test_table SET id=20 WHERE id=10; " << + "SELECT * FROM test_table; " << + "DROP TABLE test_table"; + cout << "Multi-query: " << endl << query << endl; + + // Execute statement and display all result sets. + print_multiple_results(query); + +#if MYSQL_VERSION_ID >= 50000 + // If it's MySQL v5.0 or higher, also test stored procedures, which + // return their results the same way multi-queries do. + query << "DROP PROCEDURE IF EXISTS get_stock; " << + "CREATE PROCEDURE get_stock" << + "( i_item varchar(20) ) " << + "BEGIN " << + "SET i_item = concat('%', i_item, '%'); " << + "SELECT * FROM stock WHERE lower(item) like lower(i_item); " << + "END;"; + cout << "Stored procedure query: " << endl << query << endl; + + // Create the stored procedure. + print_multiple_results(query); + + // Call the stored procedure and display its results. + query << "CALL get_stock('relish')"; + cout << "Query: " << query << endl; + print_multiple_results(query); +#endif + + return 0; } catch (const BadOption& err) { - if (err.what_option() == Connection::opt_multi_statements) { - cerr << "This example only works when MySQL++ is built " - "against MySQL C API" << endl; - cerr << "version 4.1.01 or later." << endl; - } - else { - cerr << "Unexpected option failure: " << err.what() << endl; - } + cerr << err.what() << endl; + cerr << "This example requires MySQL 4.1.1 or later." << endl; return 1; } catch (const ConnectionFailed& err) { cerr << "Failed to connect to database server: " << err.what() << endl; @@ -174,45 +204,6 @@ catch (const Exception& er) { // Catch-all for any other MySQL++ exceptions cerr << "Error: " << er.what() << endl; return 1; } - - // Set up query with multiple queries. - Query query = con.query(); - query << "DROP TABLE IF EXISTS test_table;" << endl << - "CREATE TABLE test_table(id INT);" << endl << - "INSERT INTO test_table VALUES(10);" << endl << - "UPDATE test_table SET id=20 WHERE id=10;" << endl << - "SELECT * FROM test_table;" << endl << - "DROP TABLE test_table" << endl; - cout << "Multi-query: " << endl << query.preview() << endl; - - // Execute statement and display all result sets. - print_multiple_results(query); - -#if MYSQL_VERSION_ID >= 50000 - // If it's MySQL v5.0 or higher, also test stored procedures, which - // return their results the same way multi-queries do. - query.reset(); - query << "DROP PROCEDURE IF EXISTS get_stock;" << endl << - "CREATE PROCEDURE get_stock" << endl << - "( i_item varchar(20) )" << endl << - "BEGIN" << endl << - "SET i_item = concat('%', i_item, '%');" << endl << - "SELECT * FROM stock WHERE lower(item) like lower(i_item);" << endl << - "END" << endl << - ";"; - cout << "Stored procedure query: " << endl << query.preview() << endl; - - // Create the stored procedure. - print_multiple_results(query); - - // Call the stored procedure and display its results. - query.reset(); - query << "CALL get_stock('relish')"; - cout << "Query: " << query.preview() << endl; - print_multiple_results(query); -#endif - - return 0; } ADDED examples/printdata.cpp Index: examples/printdata.cpp ================================================================== --- /dev/null +++ examples/printdata.cpp @@ -0,0 +1,116 @@ +/*********************************************************************** + printdata.cpp - Utility functions for printing out data in common + formats, required by most of the example programs. + + Copyright (c) 1998 by Kevin Atkinson, (c) 1999-2001 by MySQL AB, and + (c) 2004-2009 by Educational Technology Resources, Inc. Others may + also hold copyrights on code in this file. See the CREDITS.txt file + in the top directory of the distribution for details. + + This file is part of MySQL++. + + MySQL++ is free software; you can redistribute it and/or modify it + under the terms of the GNU Lesser General Public License as published + by the Free Software Foundation; either version 2.1 of the License, or + (at your option) any later version. + + MySQL++ is distributed in the hope that it will be useful, but WITHOUT + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public + License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with MySQL++; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 + USA +***********************************************************************/ + +#include "printdata.h" + +#include +#include + +using namespace std; + + +//// print_stock_header //////////////////////////////////////////////// +// Display a header suitable for use with print_stock_rows(). + +void +print_stock_header(size_t rows) +{ + cout << "Records found: " << rows << endl << endl; + cout.setf(ios::left); + cout << setw(31) << "Item" << + setw(10) << "Num" << + setw(10) << "Weight" << + setw(10) << "Price" << + "Date" << endl << endl; +} + + +//// print_stock_row /////////////////////////////////////////////////// +// Print out a row of data from the stock table, in a format compatible +// with the header printed out in the previous function. + +void +print_stock_row(const mysqlpp::sql_char& item, mysqlpp::sql_bigint num, + mysqlpp::sql_double weight, mysqlpp::sql_decimal_null price, + const mysqlpp::sql_date& date) +{ + cout << setw(30) << item << ' ' << + setw(9) << num << ' ' << + setw(9) << weight << ' ' << + setw(9) << price << ' ' << + date << endl; +} + + +//// print_stock_row /////////////////////////////////////////////////// +// Take a Row from the example 'stock' table, break it up into fields, +// and call the above version of this function. + +void +print_stock_row(const mysqlpp::Row& row) +{ + print_stock_row(string(row[0]), row[1], row[2], row[3], row[4]); +} + + +//// print_stock_rows ////////////////////////////////////////////////// +// Print out a number of rows from the example 'stock' table. + +void +print_stock_rows(mysqlpp::StoreQueryResult& res) +{ + print_stock_header(res.size()); + + // Use the StoreQueryResult class's read-only random access iterator to walk + // through the query results. + mysqlpp::StoreQueryResult::iterator i; + for (i = res.begin(); i != res.end(); ++i) { + // Notice that a dereferenced result iterator can be converted + // to a Row object, which makes for easier element access. + print_stock_row(*i); + } +} + + +//// print_stock_table ///////////////////////////////////////////////// +// Simply retrieve and print the entire contents of the stock table. + +void +print_stock_table(mysqlpp::Query& query) +{ + // Reset query object to its pristine state in case it's been used + // before by our caller for template queries. + query.reset(); + + // Build the query itself, and show it to the user + query << "select * from stock"; + cout << "Query: " << query << endl; + + // Execute it, and display the results + mysqlpp::StoreQueryResult res = query.store(); + print_stock_rows(res); +} ADDED examples/printdata.h Index: examples/printdata.h ================================================================== --- /dev/null +++ examples/printdata.h @@ -0,0 +1,42 @@ +/*********************************************************************** + printdata.h - Declares utility routines for printing out data in + common forms, used by most of the example programs. + + Copyright (c) 1998 by Kevin Atkinson, (c) 1999-2001 by MySQL AB, and + (c) 2004-2009 by Educational Technology Resources, Inc. Others may + also hold copyrights on code in this file. See the CREDITS.txt file + in the top directory of the distribution for details. + + This file is part of MySQL++. + + MySQL++ is free software; you can redistribute it and/or modify it + under the terms of the GNU Lesser General Public License as published + by the Free Software Foundation; either version 2.1 of the License, or + (at your option) any later version. + + MySQL++ is distributed in the hope that it will be useful, but WITHOUT + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public + License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with MySQL++; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 + USA +***********************************************************************/ + +#if !defined(MYSQLPP_PRINTDATA_H) +#define MYSQLPP_PRINTDATA_H + +#include + +void print_stock_header(size_t rows); +void print_stock_row(const mysqlpp::Row& r); +void print_stock_row(const mysqlpp::sql_char& item, + mysqlpp::sql_bigint num, mysqlpp::sql_double weight, + mysqlpp::sql_decimal_null price, const mysqlpp::sql_date& date); +void print_stock_rows(mysqlpp::StoreQueryResult& res); +void print_stock_table(mysqlpp::Query& query); + +#endif // !defined(MYSQLPP_PRINTDATA_H) + Index: examples/resetdb.cpp ================================================================== --- examples/resetdb.cpp +++ examples/resetdb.cpp @@ -1,15 +1,15 @@ /*********************************************************************** resetdb.cpp - (Re)initializes the example database, mysql_cpp_data. - You must run this at least once before running most of the other + You must run this at least once before running most of the other examples, and it is helpful sometimes to run it again, as some of the examples modify the table in this database. - Copyright (c) 1998 by Kevin Atkinson, (c) 1999, 2000 and 2001 by - MySQL AB, and (c) 2004, 2005 by Educational Technology Resources, Inc. - Others may also hold copyrights on code in this file. See the CREDITS - file in the top directory of the distribution for details. + Copyright (c) 1998 by Kevin Atkinson, (c) 1999-2001 by MySQL AB, and + (c) 2004-2009 by Educational Technology Resources, Inc. Others may + also hold copyrights on code in this file. See the CREDITS file in + the top directory of the distribution for details. This file is part of MySQL++. MySQL++ is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published @@ -25,26 +25,76 @@ License along with MySQL++; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA ***********************************************************************/ -#include "util.h" +#include "cmdline.h" +#include "printdata.h" #include #include +#include using namespace std; + + +// Pull in the sample database name from the cmdline module. +extern const char* kpcSampleDatabase; + + +// Convert a packed version number in the format used within MySQL++ +// to a printable string. +static string +version_str(int packed) +{ + char buf[9]; + snprintf(buf, sizeof(buf), "%d.%d.%d", + (packed & 0xFF0000) >> 16, + (packed & 0x00FF00) >> 8, + (packed & 0x0000FF)); + return buf; +} + int main(int argc, char *argv[]) { + // Ensure that we're not mixing library and header file versions. + // This is really easy to do if you have MySQL++ on your system and + // are trying to build a new version, and run the examples directly + // instead of through exrun. + if (mysqlpp::get_library_version() != MYSQLPP_HEADER_VERSION) { + cerr << "Version mismatch: library is v" << + version_str(mysqlpp::get_library_version()) << + ", headers are v" << + version_str(MYSQLPP_HEADER_VERSION) << + ". Are you running this" << endl << + "with exrun? See README.examples." << endl; + return 1; + } + + // Get connection parameters from command line + mysqlpp::examples::CommandLine cmdline(argc, argv); + if (!cmdline) { + return 1; + } + // Connect to database server mysqlpp::Connection con; try { - cout << "Connecting to database server..." << endl; - connect_to_db(argc, argv, con, ""); + if (cmdline.dtest_mode()) { + cout << "Connecting to database server..." << endl; + } + else { + const char* u = cmdline.user() ? cmdline.user() : ""; + const char* s = cmdline.server() ? cmdline.server() : "localhost"; + cout << "Connecting to '" << u << "'@'" << s << "', with" << + (cmdline.pass() && cmdline.pass()[0] ? "" : "out") << + " password..." << endl; + } + con.connect(0, cmdline.server(), cmdline.user(), cmdline.pass()); } catch (exception& er) { cerr << "Connection failed: " << er.what() << endl; return 1; } @@ -53,20 +103,23 @@ // exceptions, because it's not an error if DB doesn't yet exist. bool new_db = false; { mysqlpp::NoExceptions ne(con); mysqlpp::Query query = con.query(); - if (con.select_db(kpcSampleDatabase)) { - // Toss old table, if it exists. If it doesn't, we don't - // really care, as it'll get created next. - cout << "Dropping existing stock table..." << endl; - query.execute("drop table stock"); + if (con.select_db(mysqlpp::examples::db_name)) { + // Toss old tables, ignoring errors because it would just + // mean the table doesn't exist, which doesn't matter. + cout << "Dropping existing sample data tables..." << endl; + query.exec("drop table stock"); + query.exec("drop table images"); + query.exec("drop table deadlock_test1"); + query.exec("drop table deadlock_test2"); } else { // Database doesn't exist yet, so create and select it. - if (con.create_db(kpcSampleDatabase) && - con.select_db(kpcSampleDatabase)) { + if (con.create_db(mysqlpp::examples::db_name) && + con.select_db(mysqlpp::examples::db_name)) { new_db = true; } else { cerr << "Error creating DB: " << con.error() << endl; return 1; @@ -73,56 +126,90 @@ } } } // Create sample data table within sample database. - cout << "Creating new stock table..." << endl; try { - // Send the query to create the table and execute it. + // Send the query to create the stock table and execute it. + cout << "Creating stock table..." << endl; mysqlpp::Query query = con.query(); - query << "create table stock (item char(20) not null, " - "num bigint, weight double, price double, sdate date)"; + query << + "CREATE TABLE stock (" << + " item CHAR(30) NOT NULL, " << + " num BIGINT NOT NULL, " << + " weight DOUBLE NOT NULL, " << + " price DECIMAL(6,2) NULL, " << // NaN & inf. == NULL + " sdate DATE NOT NULL, " << + " description MEDIUMTEXT NULL) " << + "ENGINE = InnoDB " << + "CHARACTER SET utf8 COLLATE utf8_general_ci"; query.execute(); // Set up the template query to insert the data. The parse() // call tells the query object that this is a template and // not a literal query string. - query << "insert into %5:table values (%0q, %1q, %2, %3, %4q)"; + query << "insert into %6:table values " << + "(%0q, %1q, %2, %3, %4q, %5q:desc)"; query.parse(); - // Set the template query parameter "table" to "stock". - query.def["table"] = "stock"; + // Set a default for template query parameters "table" and "desc". + query.template_defaults["table"] = "stock"; + query.template_defaults["desc"] = mysqlpp::null; // Notice that we don't give a sixth parameter in these calls, // so the default value of "stock" is used. Also notice that // the first row is a UTF-8 encoded Unicode string! All you // have to do to store Unicode data in recent versions of MySQL // is use UTF-8 encoding. - cout << "Populating stock table..." << endl; - query.execute("Nürnberger Brats", 92, 1.5, 8.79, "2005-03-10"); + cout << "Populating stock table..." << flush; + query.execute("Nürnberger Brats", 97, 1.5, 8.79, "2005-03-10"); query.execute("Pickle Relish", 87, 1.5, 1.75, "1998-09-04"); - query.execute("Hot Mustard", 75, .95, .97, "1998-05-25"); + query.execute("Hot Mustard", 73, .95, .97, "1998-05-25", + "good American yellow mustard, not that European stuff"); query.execute("Hotdog Buns", 65, 1.1, 1.1, "1998-04-23"); + // Test that above did what we wanted. + cout << "inserted " << con.count_rows("stock") << " rows." << endl; + + // Now create empty images table, for testing BLOB and auto- + // increment column features. + cout << "Creating empty images table..." << endl; + query.reset(); // forget template query info + query << + "CREATE TABLE images (" << + " id INT UNSIGNED AUTO_INCREMENT, " << + " data BLOB, " << + " PRIMARY KEY (id)" << + ")"; + query.execute(); + + // Create the tables used by examples/deadlock.cpp + cout << "Creating deadlock testing tables..." << endl; + query.execute("CREATE TABLE deadlock_test1 (x INT) ENGINE=innodb"); + query.execute("CREATE TABLE deadlock_test2 (x INT) ENGINE=innodb"); + query.execute("INSERT INTO deadlock_test1 VALUES (1);"); + query.execute("INSERT INTO deadlock_test2 VALUES (2);"); + + // Report success cout << (new_db ? "Created" : "Reinitialized") << " sample database successfully." << endl; } catch (const mysqlpp::BadQuery& er) { // Handle any query errors - cerr << "Query error: " << er.what() << endl; + cerr << endl << "Query error: " << er.what() << endl; return 1; } catch (const mysqlpp::BadConversion& er) { // Handle bad conversions - cerr << "Conversion error: " << er.what() << endl << + cerr << endl << "Conversion error: " << er.what() << endl << "\tretrieved data size: " << er.retrieved << ", actual size: " << er.actual_size << endl; return 1; } catch (const mysqlpp::Exception& er) { // Catch-all for any other MySQL++ exceptions - cerr << "Error: " << er.what() << endl; + cerr << endl << "Error: " << er.what() << endl; return 1; } return 0; } Index: examples/simple1.cpp ================================================================== --- examples/simple1.cpp +++ examples/simple1.cpp @@ -1,13 +1,13 @@ /*********************************************************************** simple1.cpp - Example showing the simplest way to get data from a MySQL - table with MySQL++. + table with MySQL++. - Copyright (c) 1998 by Kevin Atkinson, (c) 1999, 2000 and 2001 by - MySQL AB, and (c) 2004, 2005 by Educational Technology Resources, Inc. - Others may also hold copyrights on code in this file. See the CREDITS - file in the top directory of the distribution for details. + Copyright (c) 1998 by Kevin Atkinson, (c) 1999-2001 by MySQL AB, and + (c) 2004-2009 by Educational Technology Resources, Inc. Others may + also hold copyrights on code in this file. See the CREDITS.txt file + in the top directory of the distribution for details. This file is part of MySQL++. MySQL++ is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published @@ -23,11 +23,12 @@ License along with MySQL++; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA ***********************************************************************/ -#include "util.h" +#include "cmdline.h" +#include "printdata.h" #include #include #include @@ -35,26 +36,38 @@ using namespace std; int main(int argc, char *argv[]) { + // Get database access parameters from command line + mysqlpp::examples::CommandLine cmdline(argc, argv); + if (!cmdline) { + return 1; + } + // Connect to the sample database. - mysqlpp::Connection con(false); - if (!connect_to_db(argc, argv, con)) { + mysqlpp::Connection conn(false); + if (conn.connect(mysqlpp::examples::db_name, cmdline.server(), + cmdline.user(), cmdline.pass())) { + // Retrieve a subset of the sample stock table set up by resetdb + // and display it. + mysqlpp::Query query = conn.query("select item from stock"); + if (mysqlpp::StoreQueryResult res = query.store()) { + cout << "We have:" << endl; + mysqlpp::StoreQueryResult::const_iterator it; + for (it = res.begin(); it != res.end(); ++it) { + mysqlpp::Row row = *it; + cout << '\t' << row[0] << endl; + } + } + else { + cerr << "Failed to get item list: " << query.error() << endl; + return 1; + } + + return 0; + } + else { + cerr << "DB connection failed: " << conn.error() << endl; return 1; } - - // Retrieve a subset of the sample stock table set up by resetdb - mysqlpp::Query query = con.query(); - query << "select item from stock"; - vector res; - query.storein(res); - - // Display the result set - cout << "We have:" << endl; - vector::iterator it; - for (it = res.begin(); it != res.end(); ++it) { - cout << '\t' << it->at(0) << endl; - } - - return 0; } Index: examples/simple2.cpp ================================================================== --- examples/simple2.cpp +++ examples/simple2.cpp @@ -1,13 +1,13 @@ /*********************************************************************** simple2.cpp - Retrieves the entire contents of the sample stock table - using a "store" query, and prints it out. + using a "store" query, and prints it out. - Copyright (c) 1998 by Kevin Atkinson, (c) 1999, 2000 and 2001 by - MySQL AB, and (c) 2004, 2005 by Educational Technology Resources, Inc. - Others may also hold copyrights on code in this file. See the CREDITS - file in the top directory of the distribution for details. + Copyright (c) 1998 by Kevin Atkinson, (c) 1999-2001 by MySQL AB, and + (c) 2004-2009 by Educational Technology Resources, Inc. Others may + also hold copyrights on code in this file. See the CREDITS.txt file + in the top directory of the distribution for details. This file is part of MySQL++. MySQL++ is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published @@ -23,11 +23,12 @@ License along with MySQL++; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA ***********************************************************************/ -#include "util.h" +#include "cmdline.h" +#include "printdata.h" #include #include #include @@ -35,45 +36,51 @@ using namespace std; int main(int argc, char *argv[]) { - // Connect to the sample database. - mysqlpp::Connection con(false); - if (!connect_to_db(argc, argv, con)) { + // Get database access parameters from command line + mysqlpp::examples::CommandLine cmdline(argc, argv); + if (!cmdline) { return 1; } - // Retrieve the sample stock table set up by resetdb - mysqlpp::Query query = con.query(); - query << "select * from stock"; - mysqlpp::Result res = query.store(); - - // Display results - if (res) { - // Display header - cout.setf(ios::left); - cout << setw(21) << "Item" << - setw(10) << "Num" << - setw(10) << "Weight" << - setw(10) << "Price" << - "Date" << endl << endl; - - // Get each row in result set, and print its contents - mysqlpp::Row row; - mysqlpp::Row::size_type i; - for (i = 0; row = res.at(i); ++i) { - cout << setw(20) << row["item"] << ' ' << - setw(9) << row["num"] << ' ' << - setw(9) << row["weight"] << ' ' << - setw(9) << row["price"] << ' ' << - setw(9) << row["sdate"] << - endl; - } + // Connect to the sample database. + mysqlpp::Connection conn(false); + if (conn.connect(mysqlpp::examples::db_name, cmdline.server(), + cmdline.user(), cmdline.pass())) { + // Retrieve the sample stock table set up by resetdb + mysqlpp::Query query = conn.query("select * from stock"); + mysqlpp::StoreQueryResult res = query.store(); + + // Display results + if (res) { + // Display header + cout.setf(ios::left); + cout << setw(31) << "Item" << + setw(10) << "Num" << + setw(10) << "Weight" << + setw(10) << "Price" << + "Date" << endl << endl; + + // Get each row in result set, and print its contents + for (size_t i = 0; i < res.num_rows(); ++i) { + cout << setw(30) << res[i]["item"] << ' ' << + setw(9) << res[i]["num"] << ' ' << + setw(9) << res[i]["weight"] << ' ' << + setw(9) << res[i]["price"] << ' ' << + setw(9) << res[i]["sdate"] << + endl; + } + } + else { + cerr << "Failed to get stock table: " << query.error() << endl; + return 1; + } + + return 0; } else { - cerr << "Failed to get stock item: " << query.error() << endl; + cerr << "DB connection failed: " << conn.error() << endl; return 1; } - - return 0; } Index: examples/simple3.cpp ================================================================== --- examples/simple3.cpp +++ examples/simple3.cpp @@ -1,11 +1,11 @@ /*********************************************************************** simple3.cpp - Example showing how to use the 'use' method of retrieving a table, as opposed to the more common 'store' method illustrated by the simple2 example. - Copyright (c) 2005 by Educational Technology Resources, Inc. + Copyright (c) 2005-2009 by Educational Technology Resources, Inc. Others may also hold copyrights on code in this file. See the CREDITS file in the top directory of the distribution for details. This file is part of MySQL++. @@ -23,11 +23,12 @@ License along with MySQL++; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA ***********************************************************************/ -#include "util.h" +#include "cmdline.h" +#include "printdata.h" #include #include #include @@ -35,45 +36,58 @@ using namespace std; int main(int argc, char *argv[]) { - // Connect to the sample database. - mysqlpp::Connection con(false); - if (!connect_to_db(argc, argv, con)) { + // Get database access parameters from command line + mysqlpp::examples::CommandLine cmdline(argc, argv); + if (!cmdline) { return 1; } - // Ask for all rows from the sample stock table set up by resetdb. - // Unlike simple2 example, we don't store result set in memory. - mysqlpp::Query query = con.query(); - query << "select * from stock"; - mysqlpp::ResUse res = query.use(); - - // Retreive result rows one by one, and display them. - if (res) { - // Display header - cout.setf(ios::left); - cout << setw(21) << "Item" << - setw(10) << "Num" << - setw(10) << "Weight" << - setw(10) << "Price" << - "Date" << endl << endl; - - // Get each row in result set, and print its contents - mysqlpp::Row row; - while (row = res.fetch_row()) { - cout << setw(20) << row["item"] << ' ' << - setw(9) << row["num"] << ' ' << - setw(9) << row["weight"] << ' ' << - setw(9) << row["price"] << ' ' << - setw(9) << row["sdate"] << - endl; - } - - return 0; + // Connect to the sample database. + mysqlpp::Connection conn(false); + if (conn.connect(mysqlpp::examples::db_name, cmdline.server(), + cmdline.user(), cmdline.pass())) { + // Ask for all rows from the sample stock table and display + // them. Unlike simple2 example, we retreive each row one at + // a time instead of storing the entire result set in memory + // and then iterating over it. + mysqlpp::Query query = conn.query("select * from stock"); + if (mysqlpp::UseQueryResult res = query.use()) { + // Display header + cout.setf(ios::left); + cout << setw(31) << "Item" << + setw(10) << "Num" << + setw(10) << "Weight" << + setw(10) << "Price" << + "Date" << endl << endl; + + // Get each row in result set, and print its contents + while (mysqlpp::Row row = res.fetch_row()) { + cout << setw(30) << row["item"] << ' ' << + setw(9) << row["num"] << ' ' << + setw(9) << row["weight"] << ' ' << + setw(9) << row["price"] << ' ' << + setw(9) << row["sdate"] << + endl; + } + + // Check for error: can't distinguish "end of results" and + // error cases in return from fetch_row() otherwise. + if (conn.errnum()) { + cerr << "Error received in fetching a row: " << + conn.error() << endl; + return 1; + } + return 0; + } + else { + cerr << "Failed to get stock item: " << query.error() << endl; + return 1; + } } else { - cerr << "Failed to get stock item: " << query.error() << endl; + cerr << "DB connection failed: " << conn.error() << endl; return 1; } } ADDED examples/ssqls1.cpp Index: examples/ssqls1.cpp ================================================================== --- /dev/null +++ examples/ssqls1.cpp @@ -0,0 +1,90 @@ +/*********************************************************************** + ssqls1.cpp - Example that produces the same results as simple1, but it + uses a Specialized SQL Structure to store the results instead of a + MySQL++ Result object. + + Copyright (c) 1998 by Kevin Atkinson, (c) 1999-2001 by MySQL AB, and + (c) 2004-2009 by Educational Technology Resources, Inc. Others may + also hold copyrights on code in this file. See the CREDITS.txt file + in the top directory of the distribution for details. + + This file is part of MySQL++. + + MySQL++ is free software; you can redistribute it and/or modify it + under the terms of the GNU Lesser General Public License as published + by the Free Software Foundation; either version 2.1 of the License, or + (at your option) any later version. + + MySQL++ is distributed in the hope that it will be useful, but WITHOUT + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public + License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with MySQL++; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 + USA +***********************************************************************/ + +#include "cmdline.h" +#include "printdata.h" +#include "stock.h" + +#include +#include + +using namespace std; + +int +main(int argc, char *argv[]) +{ + // Get database access parameters from command line + mysqlpp::examples::CommandLine cmdline(argc, argv); + if (!cmdline) { + return 1; + } + + try { + // Establish the connection to the database server. + mysqlpp::Connection con(mysqlpp::examples::db_name, + cmdline.server(), cmdline.user(), cmdline.pass()); + + // Retrieve a subset of the stock table's columns, and store + // the data in a vector of 'stock' SSQLS structures. See the + // user manual for the consequences arising from this quiet + // ability to store a subset of the table in the stock SSQLS. + mysqlpp::Query query = con.query("select item,description from stock"); + vector res; + query.storein(res); + + // Display the items + cout << "We have:" << endl; + vector::iterator it; + for (it = res.begin(); it != res.end(); ++it) { + cout << '\t' << it->item; + if (it->description != mysqlpp::null) { + cout << " (" << it->description << ")"; + } + cout << endl; + } + } + catch (const mysqlpp::BadQuery& er) { + // Handle any query errors + cerr << "Query error: " << er.what() << endl; + return -1; + } + catch (const mysqlpp::BadConversion& er) { + // Handle bad conversions; e.g. type mismatch populating 'stock' + cerr << "Conversion error: " << er.what() << endl << + "\tretrieved data size: " << er.retrieved << + ", actual size: " << er.actual_size << endl; + return -1; + } + catch (const mysqlpp::Exception& er) { + // Catch-all for any other MySQL++ exceptions + cerr << "Error: " << er.what() << endl; + return -1; + } + + return 0; +} ADDED examples/ssqls2.cpp Index: examples/ssqls2.cpp ================================================================== --- /dev/null +++ examples/ssqls2.cpp @@ -0,0 +1,91 @@ +/*********************************************************************** + ssqls2.cpp - Example showing how to insert a row using the Specialized + SQL Structures feature of MySQL++. + + Copyright (c) 1998 by Kevin Atkinson, (c) 1999-2001 by MySQL AB, and + (c) 2004-2009 by Educational Technology Resources, Inc. Others may + also hold copyrights on code in this file. See the CREDITS.txt file + in the top directory of the distribution for details. + + This file is part of MySQL++. + + MySQL++ is free software; you can redistribute it and/or modify it + under the terms of the GNU Lesser General Public License as published + by the Free Software Foundation; either version 2.1 of the License, or + (at your option) any later version. + + MySQL++ is distributed in the hope that it will be useful, but WITHOUT + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public + License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with MySQL++; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 + USA +***********************************************************************/ + +#include "cmdline.h" +#include "printdata.h" +#include "stock.h" + +#include +#include + +using namespace std; + +int +main(int argc, char *argv[]) +{ + // Get database access parameters from command line + mysqlpp::examples::CommandLine cmdline(argc, argv); + if (!cmdline) { + return 1; + } + + try { + // Establish the connection to the database server. + mysqlpp::Connection con(mysqlpp::examples::db_name, + cmdline.server(), cmdline.user(), cmdline.pass()); + + // Create and populate a stock object. We could also have used + // the set() member, which takes the same parameters as this + // constructor. + stock row("Hot Dogs", 100, 1.5, + numeric_limits::infinity(), // "priceless," ha! + mysqlpp::sql_date("1998-09-25"), mysqlpp::null); + + // Form the query to insert the row into the stock table. + mysqlpp::Query query = con.query(); + query.insert(row); + + // Show the query about to be executed. + cout << "Query: " << query << endl; + + // Execute the query. We use execute() because INSERT doesn't + // return a result set. + query.execute(); + + // Retrieve and print out the new table contents. + print_stock_table(query); + } + catch (const mysqlpp::BadQuery& er) { + // Handle any query errors + cerr << "Query error: " << er.what() << endl; + return -1; + } + catch (const mysqlpp::BadConversion& er) { + // Handle bad conversions + cerr << "Conversion error: " << er.what() << endl << + "\tretrieved data size: " << er.retrieved << + ", actual size: " << er.actual_size << endl; + return -1; + } + catch (const mysqlpp::Exception& er) { + // Catch-all for any other MySQL++ exceptions + cerr << "Error: " << er.what() << endl; + return -1; + } + + return 0; +} ADDED examples/ssqls3.cpp Index: examples/ssqls3.cpp ================================================================== --- /dev/null +++ examples/ssqls3.cpp @@ -0,0 +1,109 @@ +/*********************************************************************** + ssqls3.cpp - Example showing how to update an SQL row using the + Specialized SQL Structures feature of MySQL++. + + Copyright (c) 1998 by Kevin Atkinson, (c) 1999-2001 by MySQL AB, and + (c) 2004-2009 by Educational Technology Resources, Inc. Others may + also hold copyrights on code in this file. See the CREDITS.txt file + in the top directory of the distribution for details. + + This file is part of MySQL++. + + MySQL++ is free software; you can redistribute it and/or modify it + under the terms of the GNU Lesser General Public License as published + by the Free Software Foundation; either version 2.1 of the License, or + (at your option) any later version. + + MySQL++ is distributed in the hope that it will be useful, but WITHOUT + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public + License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with MySQL++; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 + USA +***********************************************************************/ + +#include "cmdline.h" +#include "printdata.h" +#include "stock.h" + +#include + +using namespace std; + +int +main(int argc, char *argv[]) +{ + // Get database access parameters from command line + mysqlpp::examples::CommandLine cmdline(argc, argv); + if (!cmdline) { + return 1; + } + + try { + // Establish the connection to the database server. + mysqlpp::Connection con(mysqlpp::examples::db_name, + cmdline.server(), cmdline.user(), cmdline.pass()); + + // Build a query to retrieve the stock item that has Unicode + // characters encoded in UTF-8 form. + mysqlpp::Query query = con.query("select * from stock "); + query << "where item = " << mysqlpp::quote << "Nürnberger Brats"; + + // Retrieve the row, throwing an exception if it fails. + mysqlpp::StoreQueryResult res = query.store(); + if (res.empty()) { + throw mysqlpp::BadQuery("UTF-8 bratwurst item not found in " + "table, run resetdb"); + } + + // Because there should only be one row in the result set, + // there's no point in storing the result in an STL container. + // We can store the first row directly into a stock structure + // because one of an SSQLS's constructors takes a Row object. + stock row = res[0]; + + // Create a copy so that the replace query knows what the + // original values are. + stock orig_row = row; + + // Change the stock object's item to use only 7-bit ASCII, and + // to deliberately be wider than normal column widths printed + // by print_stock_table(). + row.item = "Nuerenberger Bratwurst"; + + // Form the query to replace the row in the stock table. + query.update(orig_row, row); + + // Show the query about to be executed. + cout << "Query: " << query << endl; + + // Run the query with execute(), since UPDATE doesn't return a + // result set. + query.execute(); + + // Retrieve and print out the new table contents. + print_stock_table(query); + } + catch (const mysqlpp::BadQuery& er) { + // Handle any query errors + cerr << "Query error: " << er.what() << endl; + return -1; + } + catch (const mysqlpp::BadConversion& er) { + // Handle bad conversions + cerr << "Conversion error: " << er.what() << endl << + "\tretrieved data size: " << er.retrieved << + ", actual size: " << er.actual_size << endl; + return -1; + } + catch (const mysqlpp::Exception& er) { + // Catch-all for any other MySQL++ exceptions + cerr << "Error: " << er.what() << endl; + return -1; + } + + return 0; +} ADDED examples/ssqls4.cpp Index: examples/ssqls4.cpp ================================================================== --- /dev/null +++ examples/ssqls4.cpp @@ -0,0 +1,101 @@ +/*********************************************************************** + ssqls4.cpp - Example very similar to ssqls1.cpp, except that it + stores its result set in an STL set container. This demonstrates + how one can manipulate MySQL++ result sets in a very natural C++ + style. + + Copyright (c) 1998 by Kevin Atkinson, (c) 1999-2001 by MySQL AB, and + (c) 2004-2010 by Educational Technology Resources, Inc. Others may + also hold copyrights on code in this file. See the CREDITS.txt file + in the top directory of the distribution for details. + + This file is part of MySQL++. + + MySQL++ is free software; you can redistribute it and/or modify it + under the terms of the GNU Lesser General Public License as published + by the Free Software Foundation; either version 2.1 of the License, or + (at your option) any later version. + + MySQL++ is distributed in the hope that it will be useful, but WITHOUT + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public + License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with MySQL++; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 + USA +***********************************************************************/ + +#include "cmdline.h" +#include "printdata.h" +#include "stock.h" + +#include + +using namespace std; + +int +main(int argc, char *argv[]) +{ + // Get database access parameters from command line + mysqlpp::examples::CommandLine cmdline(argc, argv); + if (!cmdline) { + return 1; + } + + try { + // Establish the connection to the database server. + mysqlpp::Connection con(mysqlpp::examples::db_name, + cmdline.server(), cmdline.user(), cmdline.pass()); + + // Retrieve all rows from the stock table and put them in an + // STL set. Notice that this works just as well as storing them + // in a vector, which we did in ssqls1.cpp. It works because + // SSQLS objects are less-than comparable. + mysqlpp::Query query = con.query("select * from stock"); + set res; + query.storein(res); + + // Display the result set. Since it is an STL set and we set up + // the SSQLS to compare based on the item column, the rows will + // be sorted by item. + print_stock_header(res.size()); + set::iterator it; + cout.precision(3); + for (it = res.begin(); it != res.end(); ++it) { + print_stock_row(it->item.c_str(), it->num, it->weight, + it->price, it->sDate); + } + + // Use set's find method to look up a stock item by item name. + // This also uses the SSQLS comparison setup. + it = res.find(stock("Hotdog Buns")); + if (it != res.end()) { + cout << endl << "Currently " << it->num << + " hotdog buns in stock." << endl; + } + else { + cout << endl << "Sorry, no hotdog buns in stock." << endl; + } + } + catch (const mysqlpp::BadQuery& er) { + // Handle any query errors + cerr << "Query error: " << er.what() << endl; + return -1; + } + catch (const mysqlpp::BadConversion& er) { + // Handle bad conversions + cerr << "Conversion error: " << er.what() << endl << + "\tretrieved data size: " << er.retrieved << + ", actual size: " << er.actual_size << endl; + return -1; + } + catch (const mysqlpp::Exception& er) { + // Catch-all for any other MySQL++ exceptions + cerr << "Error: " << er.what() << endl; + return -1; + } + + return 0; +} ADDED examples/ssqls5.cpp Index: examples/ssqls5.cpp ================================================================== --- /dev/null +++ examples/ssqls5.cpp @@ -0,0 +1,86 @@ +/*********************************************************************** + ssqls5.cpp - Example showing how to use the equal_list() member of + some SSQLS types to build SELECT queries with custom WHERE clauses. + + Copyright (c) 1998 by Kevin Atkinson, (c) 1999-2001 by MySQL AB, (c) + 2004-2009 by Educational Technology Resources, Inc., and (c) 2005 by + Chris Frey. Others may also hold copyrights on code in this file. + See the CREDITS.txt file in the top directory of the distribution + for details. + + This file is part of MySQL++. + + MySQL++ is free software; you can redistribute it and/or modify it + under the terms of the GNU Lesser General Public License as published + by the Free Software Foundation; either version 2.1 of the License, or + (at your option) any later version. + + MySQL++ is distributed in the hope that it will be useful, but WITHOUT + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public + License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with MySQL++; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 + USA +***********************************************************************/ + +#include "cmdline.h" +#include "printdata.h" +#include "stock.h" + +#include +#include + +using namespace std; + +int +main(int argc, char *argv[]) +{ + // Get database access parameters from command line + mysqlpp::examples::CommandLine cmdline(argc, argv); + if (!cmdline) { + return 1; + } + + try { + // Establish the connection to the database server. + mysqlpp::Connection con(mysqlpp::examples::db_name, + cmdline.server(), cmdline.user(), cmdline.pass()); + + // Get all the rows in the stock table. + mysqlpp::Query query = con.query("select * from stock"); + vector res; + query.storein(res); + + if (res.size() > 0) { + // Build a select query using the data from the first row + // returned by our previous query. + query << "select * from stock where " << + res[0].equal_list(" and ", stock_weight, stock_price); + + // Display the finished query. + cout << "Custom query:\n" << query << endl; + } + } + catch (const mysqlpp::BadQuery& er) { + // Handle any query errors + cerr << "Query error: " << er.what() << endl; + return -1; + } + catch (const mysqlpp::BadConversion& er) { + // Handle bad conversions + cerr << "Conversion error: " << er.what() << endl << + "\tretrieved data size: " << er.retrieved << + ", actual size: " << er.actual_size << endl; + return -1; + } + catch (const mysqlpp::Exception& er) { + // Catch-all for any other MySQL++ exceptions + cerr << "Error: " << er.what() << endl; + return -1; + } + + return 0; +} ADDED examples/ssqls6.cpp Index: examples/ssqls6.cpp ================================================================== --- /dev/null +++ examples/ssqls6.cpp @@ -0,0 +1,144 @@ +/*********************************************************************** + ssqls6.cpp - Example showing how to insert a collection row using the + Specialized SQL Structures feature of MySQL++ and Query::insertfrom(). + + Copyright (c) 1998 by Kevin Atkinson, (c) 1999-2001 by MySQL AB, + (c) 2004-2009 by Educational Technology Resources, Inc., (c) 2008 by + AboveNet, Inc. Others may also hold copyrights on code in this file. + See the CREDITS file in the top directory of the distribution for details. + + This file is part of MySQL++. + + MySQL++ is free software; you can redistribute it and/or modify it + under the terms of the GNU Lesser General Public License as published + by the Free Software Foundation; either version 2.1 of the License, or + (at your option) any later version. + + MySQL++ is distributed in the hope that it will be useful, but WITHOUT + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public + License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with MySQL++; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 + USA +***********************************************************************/ + +#include "cmdline.h" +#include "printdata.h" +#include "stock.h" + +#include + +using namespace std; + + +// Breaks a given text line of tab-separated fields up into a list of +// strings. +static size_t +tokenize_line(const string& line, vector& strings) +{ + string field; + strings.clear(); + + istringstream iss(line); + while (getline(iss, field, '\t')) { + strings.push_back(mysqlpp::String(field)); + } + + return strings.size(); +} + + +// Reads a tab-delimited text file, returning the data found therein +// as a vector of stock SSQLS objects. +static bool +read_stock_items(const char* filename, vector& stock_vector) +{ + ifstream input(filename); + if (!input) { + cerr << "Error opening input file '" << filename << "'" << endl; + return false; + } + + string line; + vector strings; + while (getline(input, line)) { + if (tokenize_line(line, strings) == 6) { + stock_vector.push_back(stock(string(strings[0]), strings[1], + strings[2], strings[3], strings[4], strings[5])); + } + else { + cerr << "Error parsing input line (doesn't have 6 fields) " << + "in file '" << filename << "'" << endl; + cerr << "invalid line: '" << line << "'" << endl; + } + } + + return true; +} + + +int +main(int argc, char *argv[]) +{ + // Get database access parameters from command line + mysqlpp::examples::CommandLine cmdline(argc, argv); + if (!cmdline) { + return 1; + } + + // Read in a tab-delimited file of stock data + vector stock_vector; + if (!read_stock_items("examples/stock.txt", stock_vector)) { + return 1; + } + + try { + // Establish the connection to the database server. + mysqlpp::Connection con(mysqlpp::examples::db_name, + cmdline.server(), cmdline.user(), cmdline.pass()); + + // Clear all existing rows from stock table, as we're about to + // insert a bunch of new ones, and we want a clean slate. + mysqlpp::Query query = con.query(); + query.exec("DELETE FROM stock"); + + // Insert data read from the CSV file, allowing up to 1000 + // characters per packet. We're using a small size in this + // example just to force multiple inserts. In a real program, + // you'd want to use larger packets, for greater efficiency. + mysqlpp::Query::MaxPacketInsertPolicy<> insert_policy(1000); + query.insertfrom(stock_vector.begin(), stock_vector.end(), + insert_policy); + + // Retrieve and print out the new table contents. + print_stock_table(query); + } + catch (const mysqlpp::BadQuery& er) { + // Handle any query errors + cerr << "Query error: " << er.what() << endl; + return -1; + } + catch (const mysqlpp::BadConversion& er) { + // Handle bad conversions + cerr << "Conversion error: " << er.what() << endl << + "\tretrieved data size: " << er.retrieved << + ", actual size: " << er.actual_size << endl; + return -1; + } + catch (const mysqlpp::BadInsertPolicy& er) { + // Handle bad conversions + cerr << "InsertPolicy error: " << er.what() << endl; + return -1; + } + catch (const mysqlpp::Exception& er) { + // Catch-all for any other MySQL++ exceptions + cerr << "Error: " << er.what() << endl; + return -1; + } + + return 0; +} + ADDED examples/stock.h Index: examples/stock.h ================================================================== --- /dev/null +++ examples/stock.h @@ -0,0 +1,47 @@ +/*********************************************************************** + stock.h - Declares the stock SSQLS used by several of the examples. + + Copyright (c) 1998 by Kevin Atkinson, (c) 1999-2001 by MySQL AB, and + (c) 2004-2010 by Educational Technology Resources, Inc. Others may + also hold copyrights on code in this file. See the CREDITS.txt file + in the top directory of the distribution for details. + + This file is part of MySQL++. + + MySQL++ is free software; you can redistribute it and/or modify it + under the terms of the GNU Lesser General Public License as published + by the Free Software Foundation; either version 2.1 of the License, or + (at your option) any later version. + + MySQL++ is distributed in the hope that it will be useful, but WITHOUT + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public + License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with MySQL++; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 + USA +***********************************************************************/ + +#include +#include + +// The following is calling a very complex macro which will create +// "struct stock", which has the member variables: +// +// sql_char item; +// ... +// sql_mediumtext_null description; +// +// plus methods to help populate the class from a MySQL row. See the +// SSQLS sections in the user manual for further details. +sql_create_6(stock, + 1, 6, // The meaning of these values is covered in the user manual + mysqlpp::sql_char, item, + mysqlpp::sql_bigint, num, + mysqlpp::sql_double, weight, + mysqlpp::sql_double_null, price, + mysqlpp::sql_date, sDate, // SSQLS isn't case-sensitive! + mysqlpp::sql_mediumtext_null, description) + ADDED examples/stock.txt Index: examples/stock.txt ================================================================== --- /dev/null +++ examples/stock.txt @@ -0,0 +1,26 @@ +Tiny Screws 1000 0.01 0.05 2008-11-11 All those tiny, indistinguishable, but slighly different screws like the ones it the bottom of your computer desk drawer. +Needle-nose Pliers 50 0.5 5.95 2008-11-12 Drop-forged steel, rubberized grip +Small Soldering Iron 40 0.5 15.95 2008-09-01 20-watt model, assorted tips, UL approved +Large Soldering Iron 35 0.75 24.95 2008-08-01 40-watt model, assorted tips, UL approved, stand included +Solder Wick 100 0.1 2.95 2008-04-01 25 feet, braided copper +Mini Screwdrivers, 3 pc. 30 0.4 8.95 2008-03-25 3-piece mini-screwdriver set in plastic case, 2 Phillips, 1 standard slot +Mini Screwdrivers, 6 pc. 40 0.6 12.95 2008-04-01 6-piece mini-screwdriver set in plastic case, 3 Phillips, 3 standard slot +Wire-wrapping Tool 25 0.2 4.95 2008-04-23 wire-wrapping tool with rubberied grip +Red LED, 5mm, 3000mcd 300 0.01 0.29 2008-10-02 Max forward current 20mA continuous. Max Forward Drop: 2.1V. Max reverse Voltage:5VDC. +Orange LED, 5mm, 2500mcd 250 0.01 0.29 2008-07-31 Max forward current 20mA continuous, 5VDC Max reverse Voltage. 2VDC (typ) Forward voltage drop. 30 Deg. view angle. 1" leads. +Yellow LED, 5mm, 3000mcd 400 0.01 0.25 2008-09-30 Max forward current 20mA continuous, 5VDC Max reverse Voltage. 2.2VDC (typ) Forward voltage drop. 30 Deg. view angle. 1" leads. +Green LED, 5mm, 1000mcd 350 0.01 0.45 2008-09-27 Max forward current 20mA continuous, 5VDC Max reverse Voltage. 2VDC (typ) Forward voltage drop. 30 Deg. view angle. 1" leads. +Blue LED, 5mm, 3900mcd 500 0.01 0.34 2007-12-01 Max forward current 20mA continuous, 5VDC Max reverse Voltage. 2.2VDC (typ) Forward voltage drop. 30 Deg. view angle. 1" leads. +White LED, 5mm, 15000mcd 750 0.01 0.43 2008-02-01 Max forward current 30mA continuous, 20mA recommended. 5VDC Max reverse Voltage. 3.8VDC typ. 4.5V max. Forward voltage drop. 15deg. View angle. 1" leads. +AA Battery, single 220 0.05 0.50 2007-09-19 1.5 v, alkaline +AA Battery, 4-pack 60 0.20 1.79 2007-08-03 1.5 v, alkaline +AA Battery, 24-pack 8 1.2 9.99 2007-04-25 1.5 v, alkaline, includes tester +C Battery, single 100 0.075 0.65 2007-11-14 1.5 v, alkaline +C Battery, 4-pack 25 0.3 2.29 2007-06-05 1.5 v, alkaline +C Battery, 24-pack 5 1.8 10.99 2007-06-13 1.5 v, alkaline, includes tester +D Battery, single 180 0.08 0.70 2007-12-03 1.5 v, alkaline +D Battery, 4-pack 45 0.3 2.59 2007-04-01 1.5 v, alkaline +D Battery, 24-pack 12 1.9 11.99 2007-05-15 1.5 v, alkaline, includes tester +9-volt Battery, single 90 0.06 0.75 2008-01-02 alkaline +9-volt Battery, 3-pack 17 0.2 1.99 2008-02-28 alkaline +9-volt Batter, 20-pack 12 1.2 12.99 2007-12-28 alkaline, no tester needed (just use your tongue) ADDED examples/store_if.cpp Index: examples/store_if.cpp ================================================================== --- /dev/null +++ examples/store_if.cpp @@ -0,0 +1,104 @@ +/*********************************************************************** + store_if.cpp - Demonstrates Query::store_if(), showing only the rows + from the sample table with prime quantities. This isn't intended + to be useful, only to show how you can do result set filtering that + outstrips the power of SQL. + + Copyright (c) 2005-2010 by Educational Technology Resources, Inc. + Others may also hold copyrights on code in this file. See the CREDITS + file in the top directory of the distribution for details. + + This file is part of MySQL++. + + MySQL++ is free software; you can redistribute it and/or modify it + under the terms of the GNU Lesser General Public License as published + by the Free Software Foundation; either version 2.1 of the License, or + (at your option) any later version. + + MySQL++ is distributed in the hope that it will be useful, but WITHOUT + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public + License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with MySQL++; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 + USA +***********************************************************************/ + +#include "cmdline.h" +#include "printdata.h" +#include "stock.h" + +#include + +#include + +#include + + +// Define a functor for testing primality. +struct is_prime +{ + bool operator()(const stock& s) + { + if ((s.num == 2) || (s.num == 3)) { + return true; // 2 and 3 are trivial cases + } + else if ((s.num < 2) || ((s.num % 2) == 0)) { + return false; // can't be prime if < 2 or even + } + else { + // The only possibility left is that it's divisible by an + // odd number that's less than or equal to its square root. + for (int i = 3; i <= sqrt(double(s.num)); i += 2) { + if ((s.num % i) == 0) { + return false; + } + } + return true; + } + } +}; + + +int +main(int argc, char *argv[]) +{ + // Get database access parameters from command line + mysqlpp::examples::CommandLine cmdline(argc, argv); + if (!cmdline) { + return 1; + } + + try { + // Establish the connection to the database server. + mysqlpp::Connection con(mysqlpp::examples::db_name, + cmdline.server(), cmdline.user(), cmdline.pass()); + + // Collect the stock items with prime quantities + std::vector results; + mysqlpp::Query query = con.query(); + query.store_if(results, stock(), is_prime()); + + // Show the results + print_stock_header(results.size()); + std::vector::const_iterator it; + for (it = results.begin(); it != results.end(); ++it) { + print_stock_row(it->item.c_str(), it->num, it->weight, + it->price, it->sDate); + } + } + catch (const mysqlpp::BadQuery& e) { + // Something went wrong with the SQL query. + std::cerr << "Query failed: " << e.what() << std::endl; + return 1; + } + catch (const mysqlpp::Exception& er) { + // Catch-all for any other MySQL++ exceptions + std::cerr << "Error: " << er.what() << std::endl; + return 1; + } + + return 0; +} ADDED examples/threads.h Index: examples/threads.h ================================================================== --- /dev/null +++ examples/threads.h @@ -0,0 +1,63 @@ +/*********************************************************************** + threads.h - Abstracts away the differences between POSIX threads and + Windows native threads. Used by the cpool example only; we could + keep this code inline there, but it's really just unimportant + details. + + Copyright (c) 2008 by Educational Technology Resources, Inc. + Others may also hold copyrights on code in this file. See the + CREDITS.txt file in the top directory of the distribution for details. + + This file is part of MySQL++. + + MySQL++ is free software; you can redistribute it and/or modify it + under the terms of the GNU Lesser General Public License as published + by the Free Software Foundation; either version 2.1 of the License, or + (at your option) any later version. + + MySQL++ is distributed in the hope that it will be useful, but WITHOUT + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public + License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with MySQL++; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 + USA +***********************************************************************/ + +#if !defined(MYSQLPP_THREADS_H) +#define MYSQLPP_THREADS_H + +#include + +#if defined(MYSQLPP_PLATFORM_WINDOWS) +# define HAVE_THREADS +# define CALLBACK_SPECIFIER WINAPI + typedef DWORD thread_return_t; + typedef LPVOID thread_arg_t; + static int create_thread(LPTHREAD_START_ROUTINE worker, thread_arg_t arg) + { + return CreateThread(0, 0, worker, arg, 0, 0) ? 0 : GetLastError(); + } + static void sleep(int s) { Sleep(s * 1000); } +#else +# include "../config.h" +# if defined(HAVE_UNISTD_H) +# include +# endif +# if defined(HAVE_PTHREAD) +# define HAVE_THREADS +# define CALLBACK_SPECIFIER + typedef void* thread_return_t; + typedef void* thread_arg_t; + static int create_thread(thread_return_t(*worker)(thread_arg_t), + thread_arg_t arg) + { + pthread_t pt; + return pthread_create(&pt, 0, worker, arg); + } +# endif +#endif + +#endif // !defined(MYSQLPP_THREADS_H) ADDED examples/tquery1.cpp Index: examples/tquery1.cpp ================================================================== --- /dev/null +++ examples/tquery1.cpp @@ -0,0 +1,93 @@ +/*********************************************************************** + tquery1.cpp - Example similar to ssqls3.cpp, except that it uses + template queries instead of SSQLS. + + Copyright (c) 1998 by Kevin Atkinson, (c) 1999-2001 by MySQL AB, and + (c) 2004-2009 by Educational Technology Resources, Inc. Others may + also hold copyrights on code in this file. See the CREDITS.txt file + in the top directory of the distribution for details. + + This file is part of MySQL++. + + MySQL++ is free software; you can redistribute it and/or modify it + under the terms of the GNU Lesser General Public License as published + by the Free Software Foundation; either version 2.1 of the License, or + (at your option) any later version. + + MySQL++ is distributed in the hope that it will be useful, but WITHOUT + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public + License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with MySQL++; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 + USA +***********************************************************************/ + +#include "cmdline.h" +#include "printdata.h" + +#include + +using namespace std; + +int +main(int argc, char *argv[]) +{ + // Get database access parameters from command line + mysqlpp::examples::CommandLine cmdline(argc, argv); + if (!cmdline) { + return 1; + } + + try { + // Establish the connection to the database server. + mysqlpp::Connection con(mysqlpp::examples::db_name, + cmdline.server(), cmdline.user(), cmdline.pass()); + + // Build a template query to retrieve a stock item given by + // item name. + mysqlpp::Query query = con.query( + "select * from stock where item = %0q"); + query.parse(); + + // Retrieve an item added by resetdb; it won't be there if + // tquery* or ssqls3 is run since resetdb. + mysqlpp::StoreQueryResult res1 = query.store("Nürnberger Brats"); + if (res1.empty()) { + throw mysqlpp::BadQuery("UTF-8 bratwurst item not found in " + "table, run resetdb"); + } + + // Replace the proper German name with a 7-bit ASCII + // approximation using a different template query. + query.reset(); // forget previous template query data + query << "update stock set item = %0q where item = %1q"; + query.parse(); + mysqlpp::SimpleResult res2 = query.execute("Nuerenberger Bratwurst", + res1[0][0].c_str()); + + // Print the new table contents. + print_stock_table(query); + } + catch (const mysqlpp::BadQuery& er) { + // Handle any query errors + cerr << "Query error: " << er.what() << endl; + return -1; + } + catch (const mysqlpp::BadConversion& er) { + // Handle bad conversions + cerr << "Conversion error: " << er.what() << endl << + "\tretrieved data size: " << er.retrieved << + ", actual size: " << er.actual_size << endl; + return -1; + } + catch (const mysqlpp::Exception& er) { + // Catch-all for any other MySQL++ exceptions + cerr << "Error: " << er.what() << endl; + return -1; + } + + return 0; +} ADDED examples/tquery2.cpp Index: examples/tquery2.cpp ================================================================== --- /dev/null +++ examples/tquery2.cpp @@ -0,0 +1,99 @@ +/*********************************************************************** + tquery2.cpp - Same as tquery1.cpp, except that it passes the template + query parameters in a SQLQueryParms object, instead of separately. + This is useful when the calling code doesn't know in advance how + many parameters there will be. This is most likely because the + templates are coming from somewhere else, or being generated. + + Copyright (c) 1998 by Kevin Atkinson, (c) 1999-2001 by MySQL AB, and + (c) 2004-2009 by Educational Technology Resources, Inc. Others may + also hold copyrights on code in this file. See the CREDITS.txt file + in the top directory of the distribution for details. + + This file is part of MySQL++. + + MySQL++ is free software; you can redistribute it and/or modify it + under the terms of the GNU Lesser General Public License as published + by the Free Software Foundation; either version 2.1 of the License, or + (at your option) any later version. + + MySQL++ is distributed in the hope that it will be useful, but WITHOUT + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public + License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with MySQL++; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 + USA +***********************************************************************/ + +#include "cmdline.h" +#include "printdata.h" + +#include + +using namespace std; + +int +main(int argc, char *argv[]) +{ + // Get database access parameters from command line + mysqlpp::examples::CommandLine cmdline(argc, argv); + if (!cmdline) { + return 1; + } + + try { + // Establish the connection to the database server. + mysqlpp::Connection con(mysqlpp::examples::db_name, + cmdline.server(), cmdline.user(), cmdline.pass()); + + // Build a template query to retrieve a stock item given by + // item name. + mysqlpp::Query query = con.query( + "select * from stock where item = %0q"); + query.parse(); + + // Retrieve an item added by resetdb; it won't be there if + // tquery* or ssqls3 is run since resetdb. + mysqlpp::SQLQueryParms sqp; + sqp << "Nürnberger Brats"; + mysqlpp::StoreQueryResult res1 = query.store(sqp); + if (res1.empty()) { + throw mysqlpp::BadQuery("UTF-8 bratwurst item not found in " + "table, run resetdb"); + } + + // Replace the proper German name with a 7-bit ASCII + // approximation using a different template query. + query.reset(); // forget previous template query info + query << "update stock set item = %0q where item = %1q"; + query.parse(); + sqp.clear(); + sqp << "Nuerenberger Bratwurst" << res1[0][0].c_str(); + mysqlpp::SimpleResult res2 = query.execute(sqp); + + // Print the new table contents. + print_stock_table(query); + } + catch (const mysqlpp::BadQuery& er) { + // Handle any query errors + cerr << "Query error: " << er.what() << endl; + return -1; + } + catch (const mysqlpp::BadConversion& er) { + // Handle bad conversions + cerr << "Conversion error: " << er.what() << endl << + "\tretrieved data size: " << er.retrieved << + ", actual size: " << er.actual_size << endl; + return -1; + } + catch (const mysqlpp::Exception& er) { + // Catch-all for any other MySQL++ exceptions + cerr << "Error: " << er.what() << endl; + return -1; + } + + return 0; +} ADDED examples/tquery3.cpp Index: examples/tquery3.cpp ================================================================== --- /dev/null +++ examples/tquery3.cpp @@ -0,0 +1,83 @@ +/*********************************************************************** + tquery3.cpp - Similar to tquery1.cpp but uses unquoted parameters. + It's here more for code test coverage than because it shows + something interesting. We've historically had a problem with + tqueries with just one parameter; we cover the quoted case in + resetdb and the other tquery examples, so we get the unquoted + one here. + + Copyright (c) 1998 by Kevin Atkinson, (c) 1999-2001 by MySQL AB, and + (c) 2004-2009 by Educational Technology Resources, Inc. Others may + also hold copyrights on code in this file. See the CREDITS.txt file + in the top directory of the distribution for details. + + This file is part of MySQL++. + + MySQL++ is free software; you can redistribute it and/or modify it + under the terms of the GNU Lesser General Public License as published + by the Free Software Foundation; either version 2.1 of the License, or + (at your option) any later version. + + MySQL++ is distributed in the hope that it will be useful, but WITHOUT + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public + License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with MySQL++; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 + USA +***********************************************************************/ + +#include "cmdline.h" +#include "printdata.h" + +#include + +using namespace std; + +int +main(int argc, char *argv[]) +{ + // Get database access parameters from command line + mysqlpp::examples::CommandLine cmdline(argc, argv); + if (!cmdline) { + return 1; + } + + try { + // Establish the connection to the database server. + mysqlpp::Connection con(mysqlpp::examples::db_name, + cmdline.server(), cmdline.user(), cmdline.pass()); + + // Build a template query to retrieve item names for stock + // entries with a quantity over some threshold. + mysqlpp::Query query = con.query( + "select item from stock where num > %0"); + query.parse(); + + // Get a list of things we have lots of in stock + if (mysqlpp::StoreQueryResult res = query.store(80)) { + cout << "Stuff we have a lot of in stock:" << endl; + for (size_t i = 0; i < res.num_rows(); ++i) { + cout << '\t' << res[i]["item"] << endl; + } + } + else { + cerr << "Failed to get item list: " << query.error() << endl; + return 1; + } + } + catch (const mysqlpp::BadQuery& er) { + // Handle any query errors + cerr << "Query error: " << er.what() << endl; + return 2; + } + catch (const mysqlpp::Exception& er) { + // Catch-all for any other MySQL++ exceptions + cerr << "Error: " << er.what() << endl; + return 2; + } + + return 0; +} ADDED examples/tquery4.cpp Index: examples/tquery4.cpp ================================================================== --- /dev/null +++ examples/tquery4.cpp @@ -0,0 +1,94 @@ +/*********************************************************************** + tquery4.cpp - Tests other details about template queries, like unquoted + parameters, multiple parameters, and preventing problems with LIKE + patterns. This exists more for code coverage than to demonstrate + the library. + + Copyright (c) 2009 by Martin Gallwey and (c) 2009 by Educational + Technology Resources, Inc. Others may also hold copyrights on code + in this file. See the CREDITS.txt file in the top directory of the + distribution for details. + + This file is part of MySQL++. + + MySQL++ is free software; you can redistribute it and/or modify it + under the terms of the GNU Lesser General Public License as published + by the Free Software Foundation; either version 2.1 of the License, or + (at your option) any later version. + + MySQL++ is distributed in the hope that it will be useful, but WITHOUT + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public + License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with MySQL++; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 + USA +***********************************************************************/ + +#include "cmdline.h" +#include "printdata.h" + +#include + +using namespace std; + +int +main(int argc, char *argv[]) +{ + // Get database access parameters from command line + mysqlpp::examples::CommandLine cmdline(argc, argv); + if (!cmdline) { + return 1; + } + + try { + // Establish the connection to the database server. + mysqlpp::Connection con(mysqlpp::examples::db_name, + cmdline.server(), cmdline.user(), cmdline.pass()); + + // Modify an item using two named template query parameters + mysqlpp::Query query = con.query("update stock " + "set num = %0:quantity where num < %0:quantity"); + query.parse(); + query.template_defaults["quantity"] = 70; + cout << "Query: " << query << endl; + mysqlpp::SimpleResult result = query.execute(); + + // Print the new table contents. + print_stock_table(query); + + // Now let's check multiple dissimilar parameter types, and show + // how to avoid conflicts between '%' as used in tqueries vs in + // LIKE patterns. + query.reset(); + query << "select * from stock where weight > %0q or " + "description like '%%%1%%'"; + query.parse(); + cout << "\nQuery: " << query.str(1.2, "Mustard") << endl; + mysqlpp::StoreQueryResult res = query.store(1.2, "Mustard"); + + // Show what second tquery found + print_stock_rows(res); + } + catch (const mysqlpp::BadQuery& er) { + // Handle any query errors + cerr << "Query error: " << er.what() << endl; + return -1; + } + catch (const mysqlpp::BadConversion& er) { + // Handle bad conversions + cerr << "Conversion error: " << er.what() << endl << + "\tretrieved data size: " << er.retrieved << + ", actual size: " << er.actual_size << endl; + return -1; + } + catch (const mysqlpp::Exception& er) { + // Catch-all for any other MySQL++ exceptions + cerr << "Error: " << er.what() << endl; + return -1; + } + + return 0; +} ADDED examples/transaction.cpp Index: examples/transaction.cpp ================================================================== --- /dev/null +++ examples/transaction.cpp @@ -0,0 +1,119 @@ +/*********************************************************************** + transaction.cpp - Example showing how to use MySQL++'s transaction + features. + + Copyright (c) 1998 by Kevin Atkinson, (c) 1999-2001 by MySQL AB, and + (c) 2004-2009 by Educational Technology Resources, Inc. Others may + also hold copyrights on code in this file. See the CREDITS.txt file + in the top directory of the distribution for details. + + This file is part of MySQL++. + + MySQL++ is free software; you can redistribute it and/or modify it + under the terms of the GNU Lesser General Public License as published + by the Free Software Foundation; either version 2.1 of the License, or + (at your option) any later version. + + MySQL++ is distributed in the hope that it will be useful, but WITHOUT + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public + License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with MySQL++; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 + USA +***********************************************************************/ + +#include "cmdline.h" +#include "printdata.h" +#include "stock.h" + +#include +#include + +using namespace std; + +int +main(int argc, char *argv[]) +{ + // Get database access parameters from command line + mysqlpp::examples::CommandLine cmdline(argc, argv); + if (!cmdline) { + return 1; + } + + try { + // Establish the connection to the database server. + mysqlpp::Connection con(mysqlpp::examples::db_name, + cmdline.server(), cmdline.user(), cmdline.pass()); + + // Show initial state + mysqlpp::Query query = con.query(); + cout << "Initial state of stock table:" << endl; + print_stock_table(query); + + // Insert a few rows in a single transaction set + { + // Use a higher level of transaction isolation than MySQL + // offers by default. This trades some speed for more + // predictable behavior. We've set it to affect all + // transactions started through this DB server connection, + // so it affects the next block, too, even if we don't + // commit this one. + mysqlpp::Transaction trans(con, + mysqlpp::Transaction::serializable, + mysqlpp::Transaction::session); + + stock row("Sauerkraut", 42, 1.2, 0.75, + mysqlpp::sql_date("2006-03-06"), mysqlpp::null); + query.insert(row); + query.execute(); + + cout << "\nRow inserted, but not committed." << endl; + cout << "Verify this with another program (e.g. simple1), " + "then hit Enter." << endl; + getchar(); + + cout << "\nCommitting transaction gives us:" << endl; + trans.commit(); + print_stock_table(query); + } + + // Now let's test auto-rollback + { + // Start a new transaction, keeping the same isolation level + // we set above, since it was set to affect the session. + mysqlpp::Transaction trans(con); + cout << "\nNow adding catsup to the database..." << endl; + + stock row("Catsup", 3, 3.9, 2.99, + mysqlpp::sql_date("2006-03-06"), mysqlpp::null); + query.insert(row); + query.execute(); + } + cout << "\nNo, yuck! We don't like catsup. Rolling it back:" << + endl; + print_stock_table(query); + + } + catch (const mysqlpp::BadQuery& er) { + // Handle any query errors + cerr << "Query error: " << er.what() << endl; + return -1; + } + catch (const mysqlpp::BadConversion& er) { + // Handle bad conversions + cerr << "Conversion error: " << er.what() << endl << + "\tretrieved data size: " << er.retrieved << + ", actual size: " << er.actual_size << endl; + return -1; + } + catch (const mysqlpp::Exception& er) { + // Catch-all for any other MySQL++ exceptions + cerr << "Error: " << er.what() << endl; + return -1; + } + + return 0; +} DELETED examples/updel.cpp Index: examples/updel.cpp ================================================================== --- examples/updel.cpp +++ /dev/null @@ -1,87 +0,0 @@ -/*********************************************************************** - updel.cpp - Example showing how to UPDATE or DELETE rows in a database - while using the power of MySQL's SELECT filtering ability. - - Copyright (c) 1998 by Kevin Atkinson, (c) 1999, 2000 and 2001 by - MySQL AB, and (c) 2004, 2005 by Educational Technology Resources, Inc. - Others may also hold copyrights on code in this file. See the CREDITS - file in the top directory of the distribution for details. - - This file is part of MySQL++. - - MySQL++ is free software; you can redistribute it and/or modify it - under the terms of the GNU Lesser General Public License as published - by the Free Software Foundation; either version 2.1 of the License, or - (at your option) any later version. - - MySQL++ is distributed in the hope that it will be useful, but WITHOUT - ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public - License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with MySQL++; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 - USA -***********************************************************************/ - -#include - -#include - -using namespace std; -using namespace mysqlpp; - -#define MY_DATABASE "telcent" -#define MY_TABLE "nazivi" -#define MY_HOST "localhost" -#define MY_USER "root" -#define MY_PASSWORD "" -#define MY_FIELD "naziv" -#define MY_QUERY "SELECT URL from my_table as t1, my_table as t2 where t1.field = t2.field" - -int -main() -{ - Connection con(use_exceptions); - try { - ostringstream strbuf; - unsigned int i = 0; - con.connect(MY_DATABASE, MY_HOST, MY_USER, MY_PASSWORD); - Query query = con.query(); - query << MY_QUERY; - ResUse res = query.use(); - Row row; - strbuf << "delete from " << MY_TABLE << " where " << MY_FIELD << - " in ("; - // for UPDATE just replace the above DELETE FROM with UPDATE statement - for (; row = res.fetch_row(); i++) - strbuf << row.at(0) << ","; - if (!i) - return 0; - string output(strbuf.str()); - output.erase(output.size() - 1, 1); - output += ")"; - query.exec(output); - //cout << output << endl; - } - catch (const BadQuery& er) { - // Handle any query errors - cerr << "Query error: " << er.what() << endl; - return -1; - } - catch (const BadConversion& er) { - // Handle bad conversions - cerr << "Conversion error: " << er.what() << endl << - "\tretrieved data size: " << er.retrieved << - ", actual size: " << er.actual_size << endl; - return -1; - } - catch (const Exception& er) { - // Catch-all for any other MySQL++ exceptions - cerr << "Error: " << er.what() << endl; - return -1; - } - - return 0; -} DELETED examples/usequery.cpp Index: examples/usequery.cpp ================================================================== --- examples/usequery.cpp +++ /dev/null @@ -1,79 +0,0 @@ -/*********************************************************************** - usequery.cpp - Same as simple2 example, only with exceptions enabled. - The end of the result set is signalled differently in this case. - - Copyright (c) 2005 by Educational Technology Resources, Inc. - Others may also hold copyrights on code in this file. See the CREDITS - file in the top directory of the distribution for details. - - This file is part of MySQL++. - - MySQL++ is free software; you can redistribute it and/or modify it - under the terms of the GNU Lesser General Public License as published - by the Free Software Foundation; either version 2.1 of the License, or - (at your option) any later version. - - MySQL++ is distributed in the hope that it will be useful, but WITHOUT - ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public - License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with MySQL++; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 - USA -***********************************************************************/ - -#include "util.h" - -#include - -#include - -int -main(int argc, char *argv[]) -{ - try { - // Connect to the sample database - mysqlpp::Connection con; - if (!connect_to_db(argc, argv, con)) { - return 1; - } - - // Build query to retrieve the entire stock table - mysqlpp::Query query = con.query(); - query << "select * from stock"; - - // Execute the query, but don't save results in memory - mysqlpp::ResUse res = query.use(); - if (!res) { - std::cerr << "Result set is empty!" << std::endl; - return 1; - } - - // Iterate through result set, printing each row. - mysqlpp::Row r; - while (r = res.fetch_row()) { - print_stock_row(r); - } - } - catch (const mysqlpp::BadQuery& e) { - // Something went wrong with the SQL query. - std::cerr << "Query failed: " << e.what() << std::endl; - return 1; - } - catch (const mysqlpp::EndOfResults&) { - // Last query result received. Exit normally. - return 0; - } - catch (const mysqlpp::Exception& er) { - // Catch-all for any other MySQL++ exceptions - std::cerr << "Error: " << er.what() << std::endl; - return 1; - } - - // Shouldn't happen! Program should either error out through one of - // the "return 1" cases above, or successfully walk off the end of - // the result set and go through the EndOfResults path above. - return 2; -} DELETED examples/util.cpp Index: examples/util.cpp ================================================================== --- examples/util.cpp +++ /dev/null @@ -1,260 +0,0 @@ -/*********************************************************************** - util.cpp - Utility functions required by several of the example - programs. - - Copyright (c) 1998 by Kevin Atkinson, (c) 1999, 2000 and 2001 by - MySQL AB, and (c) 2004, 2005 by Educational Technology Resources, Inc. - Others may also hold copyrights on code in this file. See the CREDITS - file in the top directory of the distribution for details. - - This file is part of MySQL++. - - MySQL++ is free software; you can redistribute it and/or modify it - under the terms of the GNU Lesser General Public License as published - by the Free Software Foundation; either version 2.1 of the License, or - (at your option) any later version. - - MySQL++ is distributed in the hope that it will be useful, but WITHOUT - ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public - License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with MySQL++; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 - USA -***********************************************************************/ - -#include "util.h" - -#include -#include -#include - -using namespace std; - -const char* kpcSampleDatabase = "mysql_cpp_data"; - - -//// utf8_to_win32_ansi //////////////////////////////////////////////// -// Converts a Unicode string encoded in UTF-8 form (which the MySQL -// database uses) to Win32's ANSI character encoding using the current -// code page. A small modification to this function will turn it into -// a UTF-8 to UCS-2 function, since that's an intermediate form within -// this function. The Unicode chapter in the user manual explains why -// that double conversion is necessary. - -#ifdef MYSQLPP_PLATFORM_WINDOWS -static bool -utf8_to_win32_ansi(const char* utf8_str, char* ansi_str, - int ansi_len) -{ - wchar_t ucs2_buf[100]; - static const int ub_chars = sizeof(ucs2_buf) / sizeof(ucs2_buf[0]); - - int err = MultiByteToWideChar(CP_UTF8, 0, utf8_str, -1, - ucs2_buf, ub_chars); - if (err == 0) { - cerr << "Unknown error in Unicode translation: " << - GetLastError() << endl; - return false; - } - else if (err == ERROR_NO_UNICODE_TRANSLATION) { - cerr << "Bad data in UTF-8 string" << endl; - return false; - } - else { - CPINFOEX cpi; - GetCPInfoEx(CP_OEMCP, 0, &cpi); - WideCharToMultiByte(cpi.CodePage, 0, ucs2_buf, -1, - ansi_str, ansi_len, 0, 0); - return true; - } -} -#endif - - -//// print_stock_header //////////////////////////////////////////////// -// Display a header suitable for use with print_stock_rows(). - -void -print_stock_header(int rows) -{ - cout << "Records found: " << rows << endl << endl; - cout.setf(ios::left); - cout << setw(21) << "Item" << - setw(10) << "Num" << - setw(10) << "Weight" << - setw(10) << "Price" << - "Date" << endl << endl; -} - - -//// print_stock_row /////////////////////////////////////////////////// -// Print out a row of data from the stock table, in a format compatible -// with the header printed out in the previous function. - -void -print_stock_row(const std::string& item, mysqlpp::longlong num, - double weight, double price, const mysqlpp::Date& date) -{ - // Output item field. We treat it separately because there is - // Unicode data in this field in the sample database. -#ifdef MYSQLPP_PLATFORM_WINDOWS - // We're running on Windows, so convert the first column from UTF-8 - // to UCS-2, and then to the local ANSI code page. The user manual - // explains why this double conversion is required. - char item_ansi[100]; - if (utf8_to_win32_ansi(item.c_str(), item_ansi, sizeof(item_ansi))) { - cout << setw(20) << item_ansi << ' '; - } -#else - // Just send string to console. On modern Unices, the terminal code - // interprets UTF-8 directly, so no special handling is required. - cout << setw(20) << item << ' '; -#endif - - // Output remaining columns - cout << setw(9) << num << ' ' << - setw(9) << weight << ' ' << - setw(9) << price << ' ' << - date << endl; -} - - -//// print_stock_row /////////////////////////////////////////////////// -// Take a Row from the example 'stock' table, break it up into fields, -// and call the above version of this function. - -void -print_stock_row(const mysqlpp::Row& row) -{ - // The brief code below illustrates several aspects of the library - // worth noting: - // - // 1. You can subscript a row by integer (position of the field in - // the row) or by string (name of field in the row). The former is - // more efficient, while the latter trades some efficiency for - // robustness in the face of schema changes. (Consider using SSQLS - // if you need a tradeoff in between these two positions.) - // - // 2. You can also get at a row's field's with Row::at(), which is - // much like Row::operator[](int). Besides the syntax difference, - // the only practical difference is that only at() can access field - // 0: this is because '0' can be converted to both int and to const - // char*, so the compiler rightly complains that it can't decide - // which overload to call. - // - // 3. Notice that we make an explicit temporary copy of the first - // field, which is the only string field. We must tolerate the - // inefficiency of this copy, because Row::operator[] returns a - // ColData object, which goes away after it is converted to some - // other form. So, while we could have made print_stock_row() - // take a const char* argument (as past versions mistakenly did!) - // this would result in a dangling pointer, since it points into the - // ColData object, which is dead by the time the pointer is - // evaluated in print_stock_row(). It will probably even work this - // way, but like any memory bug, it can wreak subtle havoc. - std::string item(row.at(0)); - print_stock_row(item, row["num"], row[2], row[3], row[4]); -} - - -//// print_stock_rows ////////////////////////////////////////////////// -// Print out a number of rows from the example 'stock' table. - -void -print_stock_rows(mysqlpp::Result& res) -{ - print_stock_header(res.size()); - - // Use the Result class's read-only random access iterator to walk - // through the query results. - mysqlpp::Result::iterator i; - for (i = res.begin(); i != res.end(); ++i) { - // Notice that a dereferenced result iterator can be converted - // to a Row object, which makes for easier element access. - print_stock_row(*i); - } -} - - -//// get_stock_table /////////////////////////////////////////////////// -// Retreive the entire contents of the example 'stock' table. - -void -get_stock_table(mysqlpp::Query& query, mysqlpp::Result& res) -{ - // Reset the query object, in case we're re-using it. - query.reset(); - - // You can write to the query object like you would any ostream. - query << "select * from stock"; - - // Show the query string. If you call preview(), it must be before - // you call execute() or store() or use(). - cout << "Query: " << query.preview() << endl; - - // Execute the query, storing the results in memory. - res = query.store(); -} - - -//// connect_to_db ///////////////////////////////////////////////////// -// Establishes a connection to a MySQL database server, optionally -// attaching to database kdb. This is basically a command-line parser -// for the examples, since the example programs' arguments give us the -// information we need to establish the server connection. - -bool -connect_to_db(int argc, char *argv[], mysqlpp::Connection& con, - const char *kdb) -{ - if (argc < 1) { - cerr << "Bad argument count: " << argc << '!' << endl; - return false; - } - - if (!kdb) { - kdb = kpcSampleDatabase; - } - - if ((argc > 1) && (argv[1][0] == '-')) { - cout << "usage: " << argv[0] << - " [host] [user] [password] [port]" << endl; - cout << endl << "\tConnects to database "; - if (strlen(kdb) > 0) { - cout << '"' << kdb << '"'; - } - else { - cout << "server"; - } - cout << " on localhost using your user" << endl; - cout << "\tname and no password by default." << endl << endl; - return false; - } - - if (argc == 1) { - con.connect(kdb); - } - else if (argc == 2) { - con.connect(kdb, argv[1]); - } - else if (argc == 3) { - con.connect(kdb, argv[1], argv[2]); - } - else if (argc == 4) { - con.connect(kdb, argv[1], argv[2], argv[3]); - } - else if (argc >= 5) { - con.connect(kdb, argv[1], argv[2], argv[3], atoi(argv[4])); - } - - if (con) { - return true; - } - else { - cerr << "Database connection failed: " << con.error() << endl; - return false; - } -} DELETED examples/util.h Index: examples/util.h ================================================================== --- examples/util.h +++ /dev/null @@ -1,44 +0,0 @@ -/*********************************************************************** - util.h - Declares functions and such required by several of the - example programs. - - Copyright (c) 1998 by Kevin Atkinson, (c) 1999, 2000 and 2001 by - MySQL AB, and (c) 2004, 2005 by Educational Technology Resources, Inc. - Others may also hold copyrights on code in this file. See the CREDITS - file in the top directory of the distribution for details. - - This file is part of MySQL++. - - MySQL++ is free software; you can redistribute it and/or modify it - under the terms of the GNU Lesser General Public License as published - by the Free Software Foundation; either version 2.1 of the License, or - (at your option) any later version. - - MySQL++ is distributed in the hope that it will be useful, but WITHOUT - ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public - License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with MySQL++; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 - USA -***********************************************************************/ - -#ifndef _util_hh_ -#define _util_hh_ - -#include - -extern const char* kpcSampleDatabase; - -void print_stock_header(int rows); -void print_stock_row(const mysqlpp::Row& r); -void print_stock_row(const std::string& item, mysqlpp::longlong num, - double weight, double price, const mysqlpp::Date& date); -void print_stock_rows(mysqlpp::Result& res); -void get_stock_table(mysqlpp::Query& query, mysqlpp::Result& res); -bool connect_to_db(int argc, char *argv[], mysqlpp::Connection& con, - const char* kdb = 0); - -#endif ADDED examples/vstudio/mfc/mfc.cpp Index: examples/vstudio/mfc/mfc.cpp ================================================================== --- /dev/null +++ examples/vstudio/mfc/mfc.cpp @@ -0,0 +1,54 @@ +/*********************************************************************** + mfc.cpp - Skeletal main module of the MySQL++ MFC example program. + Nothing interesting to see here. Move along to mfc_dlg.cpp, folks. + + Copyright (c) 2007 by Educational Technology Resources, Inc. Others + may also hold copyrights on code in this file. See the CREDITS.txt + file in the top directory of the distribution for details. + + This file is part of MySQL++. + + MySQL++ is free software; you can redistribute it and/or modify it + under the terms of the GNU Lesser General Public License as published + by the Free Software Foundation; either version 2.1 of the License, or + (at your option) any later version. + + MySQL++ is distributed in the hope that it will be useful, but WITHOUT + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public + License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with MySQL++; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 + USA +***********************************************************************/ + +#include "stdafx.h" +#include "mfc.h" +#include "mfc_dlg.h" + +CApp gApplication; + +BOOL CApp::InitInstance() +{ + // Set up Windows commomn controls + INITCOMMONCONTROLSEX InitCtrls; + InitCtrls.dwSize = sizeof(InitCtrls); + InitCtrls.dwICC = ICC_WIN95_CLASSES; + InitCommonControlsEx(&InitCtrls); + + CWinApp::InitInstance(); + + // Initialize Winsock for MySQL communication, start GUI + if (AfxSocketInit()) { + CExampleDlg dlg; + m_pMainWnd = &dlg; + dlg.DoModal(); + } + else { + AfxMessageBox(IDP_SOCKETS_INIT_FAILED); + } + + return FALSE; +} ADDED examples/vstudio/mfc/mfc.h Index: examples/vstudio/mfc/mfc.h ================================================================== --- /dev/null +++ examples/vstudio/mfc/mfc.h @@ -0,0 +1,34 @@ +/*********************************************************************** + mfc.cpp - Declares the MFC application object. Nothing interesting to + see here. Move along to mfc_dlg.cpp, folks. + + Copyright (c) 2007 by Educational Technology Resources, Inc. Others + may also hold copyrights on code in this file. See the CREDITS.txt + file in the top directory of the distribution for details. + + This file is part of MySQL++. + + MySQL++ is free software; you can redistribute it and/or modify it + under the terms of the GNU Lesser General Public License as published + by the Free Software Foundation; either version 2.1 of the License, or + (at your option) any later version. + + MySQL++ is distributed in the hope that it will be useful, but WITHOUT + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public + License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with MySQL++; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 + USA +***********************************************************************/ + +#pragma once + +class CApp : public CWinApp +{ +public: + CApp() { } + virtual BOOL InitInstance(); +}; ADDED examples/vstudio/mfc/mfc.rc Index: examples/vstudio/mfc/mfc.rc ================================================================== --- /dev/null +++ examples/vstudio/mfc/mfc.rc @@ -0,0 +1,135 @@ +// Microsoft Visual C++ generated resource script. +// +#include "resource.h" + +#define APSTUDIO_READONLY_SYMBOLS +///////////////////////////////////////////////////////////////////////////// +// +// Generated from the TEXTINCLUDE 2 resource. +// +#include "afxres.h" + +///////////////////////////////////////////////////////////////////////////// +#undef APSTUDIO_READONLY_SYMBOLS + +///////////////////////////////////////////////////////////////////////////// +// English (U.S.) resources + +#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU) +#ifdef _WIN32 +LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US +#pragma code_page(1252) +#endif //_WIN32 + +#ifdef APSTUDIO_INVOKED +///////////////////////////////////////////////////////////////////////////// +// +// TEXTINCLUDE +// + +1 TEXTINCLUDE +BEGIN + "resource.h\0" +END + +2 TEXTINCLUDE +BEGIN + "#include ""afxres.h""\r\n" + "\0" +END + +3 TEXTINCLUDE +BEGIN + "#define _AFX_NO_SPLITTER_RESOURCES\r\n" + "#define _AFX_NO_OLE_RESOURCES\r\n" + "#define _AFX_NO_TRACKER_RESOURCES\r\n" + "#define _AFX_NO_PROPERTY_RESOURCES\r\n" + "\r\n" + "#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)\r\n" + "LANGUAGE 9, 1\r\n" + "#pragma code_page(1252)\r\n" + "#include ""afxres.rc"" // Standard components\r\n" + "#endif\r\n" + "\0" +END + +#endif // APSTUDIO_INVOKED + + +///////////////////////////////////////////////////////////////////////////// +// +// Dialog +// + +IDD_MFC_DIALOG DIALOGEX 0, 0, 210, 105 +STYLE DS_SETFONT | DS_MODALFRAME | DS_FIXEDSYS | WS_POPUP | WS_VISIBLE | WS_CAPTION +EXSTYLE WS_EX_APPWINDOW +CAPTION "MySQL++ MFC Example" +FONT 8, "MS Shell Dlg", 0, 0, 0x1 +BEGIN + EDITTEXT IDC_SERVER_EDIT,51,7,94,14,ES_AUTOHSCROLL + EDITTEXT IDC_USER_EDIT,51,24,94,14,ES_AUTOHSCROLL + EDITTEXT IDC_PASSWORD_EDIT,51,41,94,14,ES_PASSWORD | ES_AUTOHSCROLL + DEFPUSHBUTTON "Connect!",IDC_CONNECT_BUTTON,153,7,50,14 + PUSHBUTTON "Close",IDCANCEL,153,25,50,16 + LISTBOX IDC_RESULTS_LIST,51,58,94,40,LBS_SORT | LBS_NOINTEGRALHEIGHT | WS_DISABLED | WS_VSCROLL + RTEXT "Server:",IDC_STATIC,7,7,40,8 + RTEXT "User name:",IDC_STATIC,7,24,40,8 + RTEXT "Password:",IDC_STATIC,7,41,40,8 + RTEXT "Results:",IDC_STATIC,7,58,40,8 +END + + +///////////////////////////////////////////////////////////////////////////// +// +// DESIGNINFO +// + +#ifdef APSTUDIO_INVOKED +GUIDELINES DESIGNINFO +BEGIN + IDD_MFC_DIALOG, DIALOG + BEGIN + LEFTMARGIN, 7 + RIGHTMARGIN, 203 + TOPMARGIN, 7 + BOTTOMMARGIN, 98 + END +END +#endif // APSTUDIO_INVOKED + + +///////////////////////////////////////////////////////////////////////////// +// +// String Table +// + +STRINGTABLE +BEGIN + IDP_SOCKETS_INIT_FAILED "Windows sockets initialization failed." +END + +#endif // English (U.S.) resources +///////////////////////////////////////////////////////////////////////////// + + + +#ifndef APSTUDIO_INVOKED +///////////////////////////////////////////////////////////////////////////// +// +// Generated from the TEXTINCLUDE 3 resource. +// +#define _AFX_NO_SPLITTER_RESOURCES +#define _AFX_NO_OLE_RESOURCES +#define _AFX_NO_TRACKER_RESOURCES +#define _AFX_NO_PROPERTY_RESOURCES + +#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU) +LANGUAGE 9, 1 +#pragma code_page(1252) +#include "afxres.rc" // Standard components +#endif + +///////////////////////////////////////////////////////////////////////////// +#endif // not APSTUDIO_INVOKED + ADDED examples/vstudio/mfc/mfc_dlg.cpp Index: examples/vstudio/mfc/mfc_dlg.cpp ================================================================== --- /dev/null +++ examples/vstudio/mfc/mfc_dlg.cpp @@ -0,0 +1,274 @@ +/*********************************************************************** + mfc_dlg.cpp - Defines the dialog box behavior for the MySQL++ MFC + example. + + Copyright (c) 2007 by Educational Technology Resources, Inc. Others + may also hold copyrights on code in this file. See the CREDITS.txt + file in the top directory of the distribution for details. + + This file is part of MySQL++. + + MySQL++ is free software; you can redistribute it and/or modify it + under the terms of the GNU Lesser General Public License as published + by the Free Software Foundation; either version 2.1 of the License, or + (at your option) any later version. + + MySQL++ is distributed in the hope that it will be useful, but WITHOUT + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public + License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with MySQL++; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 + USA +***********************************************************************/ + +#include "stdafx.h" +#include "mfc_dlg.h" + +#include + +BEGIN_MESSAGE_MAP(CExampleDlg, CDialog) + ON_BN_CLICKED(IDC_CONNECT_BUTTON, &CExampleDlg::OnBnClickedConnectButton) +END_MESSAGE_MAP() + + +//// ctor ////////////////////////////////////////////////////////////// + +CExampleDlg::CExampleDlg(CWnd* pParent) : +CDialog(IDD_MFC_DIALOG, pParent) +{ + LoadDefaults(); +} + + +//// AddMessage //////////////////////////////////////////////////////// +// Inserts the given string at the end of the list box we're using for +// output to the user. + +void +CExampleDlg::AddMessage(LPCTSTR pcMessage) +{ + ResultsList.InsertString(-1, pcMessage); +} + + +//// DoDataExchange //////////////////////////////////////////////////// +// Transfer data from the controls into our member variables + +void +CExampleDlg::DoDataExchange(CDataExchange* pDX) +{ + CDialog::DoDataExchange(pDX); + DDX_Text(pDX, IDC_SERVER_EDIT, sServerAddress); + DDX_Text(pDX, IDC_USER_EDIT, sUserName); + DDX_Text(pDX, IDC_PASSWORD_EDIT, sPassword); + DDX_Control(pDX, IDC_RESULTS_LIST, ResultsList); +} + + +//// LoadDefaults ////////////////////////////////////////////////////// +// Load default input values from registry, if they exist. + +void +CExampleDlg::LoadDefaults() +{ + HKEY key = OpenSettingsRegistryKey(); + if (key) { + TCHAR acSetting[100]; + if (LoadSetting(key, _T("user"), acSetting, sizeof(acSetting))) { + sUserName = acSetting; + } + if (LoadSetting(key, _T("server"), acSetting, sizeof(acSetting))) { + sServerAddress = acSetting; + } + RegCloseKey(key); + } + + if (sUserName.IsEmpty()) { + TCHAR acUserName[100]; + DWORD nBufferSize = sizeof(acUserName); + if (GetUserName(acUserName, &nBufferSize)) { + sUserName = acUserName; + } + } + if (sServerAddress.IsEmpty()) { + sServerAddress = _T("localhost"); + } +} + + +//// LoadSetting /////////////////////////////////////////////////////// +// Loads up the value of the named registry value underneath the given +// key and returns it in pcValue. + +bool +CExampleDlg::LoadSetting(HKEY key, LPCTSTR pcName, LPTSTR pcValue, + DWORD nValueSize) +{ + return RegQueryValueEx(key, pcName, 0, 0, LPBYTE(pcValue), + &nValueSize) == ERROR_SUCCESS; +} + + +//// OnBnClickedConnectButton ////////////////////////////////////////// +// This is essentially the same thing as examples/simple1.cpp + +void +CExampleDlg::OnBnClickedConnectButton() +{ + WCHAR awcTempBuf[100]; + const int kTempBufSize = sizeof(awcTempBuf) / sizeof(awcTempBuf[0]); + + // Pull user input into our member variables + UpdateData(TRUE); + + // Clear out the results list, in case this isn't the first time + // we've come in here. + ResultsList.ResetContent(); + + // Translate the Unicode text we get from the UI into the UTF-8 form + // that MySQL wants. + const int kInputBufSize = 100; + char acServerAddress[kInputBufSize]; + char acUserName[kInputBufSize]; + char acPassword[kInputBufSize]; + ToUTF8(acServerAddress, kInputBufSize, sServerAddress); + ToUTF8(acUserName, kInputBufSize, sUserName); + ToUTF8(acPassword, kInputBufSize, sPassword); + + // Connect to the sample database. + mysqlpp::Connection con(false); + if (!con.connect("mysql_cpp_data", acServerAddress, acUserName, + acPassword)) { + AddMessage(_T("Failed to connect to server:")); + if (ToUCS2(awcTempBuf, kTempBufSize, con.error())) { + AddMessage(awcTempBuf); + } + return; + } + + // Retrieve a subset of the sample stock table set up by resetdb + mysqlpp::Query query = con.query(); + query << "select item from stock"; + mysqlpp::StoreQueryResult res = query.store(); + + if (res) { + // Display the result set + for (size_t i = 0; i < res.num_rows(); ++i) { + if (ToUCS2(awcTempBuf, kTempBufSize, res[i][0])) { + AddMessage(awcTempBuf); + } + } + + // Retreive was successful, so save user inputs now + SaveInputs(); + } + else { + // Retreive failed + AddMessage(_T("Failed to get item list:")); + if (ToUCS2(awcTempBuf, kTempBufSize, query.error())) { + AddMessage(awcTempBuf); + } + } +} + + +//// OpenSettingsRegistryKey /////////////////////////////////////////// + +HKEY +CExampleDlg::OpenSettingsRegistryKey() +{ + HKEY key1, key2; + if ((RegOpenKey(HKEY_CURRENT_USER, _T("Software"), &key1) == + ERROR_SUCCESS) && (RegCreateKey(key1, + _T("MySQL++ Examples"), &key2) == ERROR_SUCCESS)) { + RegCloseKey(key1); + return key2; + } + else { + return 0; + } +} + + +//// SaveInputs //////////////////////////////////////////////////////// +// Saves the input fields' values to the registry, except for the +// password field. + +bool +CExampleDlg::SaveInputs() +{ + HKEY key = OpenSettingsRegistryKey(); + if (key) { + SaveSetting(key, _T("user"), sUserName); + SaveSetting(key, _T("server"), sServerAddress); + RegCloseKey(key); + return true; + } + else { + return false; + } +} + + +//// SaveSetting /////////////////////////////////////////////////////// +// Saves the given value as a named entry under the given registry key. + +bool +CExampleDlg::SaveSetting(HKEY key, LPCTSTR pcName, LPCTSTR pcValue) +{ + DWORD nBytes = DWORD(sizeof(TCHAR) * (_tcslen(pcValue) + 1)); + return RegSetValueEx(key, pcName, 0, REG_SZ, LPBYTE(pcValue), + nBytes) == ERROR_SUCCESS; +} + + +//// ToUCS2 //////////////////////////////////////////////////////////// +// Convert a C string in UTF-8 format to UCS-2 format. + +bool +CExampleDlg::ToUCS2(LPTSTR pcOut, int nOutLen, const char* kpcIn) +{ + if (strlen(kpcIn) > 0) { + // Do the conversion normally + return MultiByteToWideChar(CP_UTF8, 0, kpcIn, -1, pcOut, + nOutLen) > 0; + } + else if (nOutLen > 1) { + // Can't distinguish no bytes copied from an error, so handle + // an empty input string as a special case. + _tccpy(pcOut, _T("")); + return true; + } + else { + // Not enough room to do anything! + return false; + } +} + + +//// ToUTF8 //////////////////////////////////////////////////////////// +// Convert a UCS-2 multibyte string to the UTF-8 format required by +// MySQL, and thus MySQL++. + +bool +CExampleDlg::ToUTF8(char* pcOut, int nOutLen, LPCWSTR kpcIn) +{ + if (_tcslen(kpcIn) > 0) { + // Do the conversion normally + return WideCharToMultiByte(CP_UTF8, 0, kpcIn, -1, pcOut, + nOutLen, 0, 0) > 0; + } + else if (nOutLen > 0) { + // Can't distinguish no bytes copied from an error, so handle + // an empty input string as a special case. + *pcOut = '\0'; + return true; + } + else { + // Not enough room to do anything! + return false; + } +} ADDED examples/vstudio/mfc/mfc_dlg.h Index: examples/vstudio/mfc/mfc_dlg.h ================================================================== --- /dev/null +++ examples/vstudio/mfc/mfc_dlg.h @@ -0,0 +1,58 @@ +/*********************************************************************** + mfc_dlg.h - Declares the dialog class for the MySQL++ MFC example. + + Copyright (c) 2007 by Educational Technology Resources, Inc. Others + may also hold copyrights on code in this file. See the CREDITS.txt + file in the top directory of the distribution for details. + + This file is part of MySQL++. + + MySQL++ is free software; you can redistribute it and/or modify it + under the terms of the GNU Lesser General Public License as published + by the Free Software Foundation; either version 2.1 of the License, or + (at your option) any later version. + + MySQL++ is distributed in the hope that it will be useful, but WITHOUT + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public + License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with MySQL++; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 + USA +***********************************************************************/ + +#pragma once +#include "afxwin.h" +#include "resource.h" + +class CExampleDlg : public CDialog +{ +public: + //// Public interface + CExampleDlg(CWnd* pParent = 0); + + //// Public data + CString sServerAddress; + CString sUserName; + CString sPassword; + CListBox ResultsList; + +protected: + //// Internal support functions + void AddMessage(LPCTSTR pcMessage); + void DoDataExchange(CDataExchange* pDX); + void LoadDefaults(); + bool LoadSetting(HKEY key, LPCTSTR pcName, LPTSTR pcValue, + DWORD nValueSize); + HKEY OpenSettingsRegistryKey(); + bool SaveInputs(); + bool SaveSetting(HKEY key, LPCTSTR pcName, LPCTSTR pcValue); + bool ToUCS2(LPTSTR pcOut, int nOutLen, const char* kpcIn); + bool ToUTF8(char* pcOut, int nOutLen, LPCWSTR kpcIn); + + //// Message map + afx_msg void OnBnClickedConnectButton(); + DECLARE_MESSAGE_MAP() +}; ADDED examples/vstudio/mfc/resource.h Index: examples/vstudio/mfc/resource.h ================================================================== --- /dev/null +++ examples/vstudio/mfc/resource.h @@ -0,0 +1,22 @@ +//{{NO_DEPENDENCIES}} +// Microsoft Visual C++ generated include file. +// Used by mfc.rc +// +#define IDD_MFC_DIALOG 102 +#define IDP_SOCKETS_INIT_FAILED 103 +#define IDC_SERVER_EDIT 1000 +#define IDC_PASSWORD_EDIT 1001 +#define IDC_USER_EDIT 1002 +#define IDC_RESULTS_LIST 1003 +#define IDC_CONNECT_BUTTON 1004 + +// Next default values for new objects +// +#ifdef APSTUDIO_INVOKED +#ifndef APSTUDIO_READONLY_SYMBOLS +#define _APS_NEXT_RESOURCE_VALUE 129 +#define _APS_NEXT_COMMAND_VALUE 32771 +#define _APS_NEXT_CONTROL_VALUE 1005 +#define _APS_NEXT_SYMED_VALUE 101 +#endif +#endif ADDED examples/vstudio/mfc/stdafx.h Index: examples/vstudio/mfc/stdafx.h ================================================================== --- /dev/null +++ examples/vstudio/mfc/stdafx.h @@ -0,0 +1,54 @@ +/*********************************************************************** + stdafx.h - Common include file to bring in MFC support and other + basics. + + Copyright (c) 2007 by Educational Technology Resources, Inc. Others + may also hold copyrights on code in this file. See the CREDITS.txt + file in the top directory of the distribution for details. + + This file is part of MySQL++. + + MySQL++ is free software; you can redistribute it and/or modify it + under the terms of the GNU Lesser General Public License as published + by the Free Software Foundation; either version 2.1 of the License, or + (at your option) any later version. + + MySQL++ is distributed in the hope that it will be useful, but WITHOUT + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public + License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with MySQL++; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 + USA +***********************************************************************/ + +#pragma once + +#ifndef VC_EXTRALEAN +#define VC_EXTRALEAN // Exclude rarely-used stuff from Windows headers +#endif + +// Modify the following defines if you have to target a platform prior to the ones specified below. +// Refer to MSDN for the latest info on corresponding values for different platforms. +#ifndef WINVER // Allow use of features specific to Windows XP or later. +#define WINVER 0x0501 // Change this to the appropriate value to target other versions of Windows. +#endif + +#ifndef _WIN32_WINNT // Allow use of features specific to Windows XP or later. +#define _WIN32_WINNT 0x0501 // Change this to the appropriate value to target other versions of Windows. +#endif + +#ifndef _WIN32_WINDOWS // Allow use of features specific to Windows 98 or later. +#define _WIN32_WINDOWS 0x0410 // Change this to the appropriate value to target Windows Me or later. +#endif + +// turns off MFC's hiding of some common and often safely ignored warning messages +#define _AFX_ALL_WARNINGS + +#include // MFC core and standard components +#include // MFC extensions +#include // MFC support for Windows Common Controls +#include // MFC socket extensions + ADDED examples/vstudio/wforms/AssemblyInfo.cpp Index: examples/vstudio/wforms/AssemblyInfo.cpp ================================================================== --- /dev/null +++ examples/vstudio/wforms/AssemblyInfo.cpp @@ -0,0 +1,18 @@ +using namespace System; +using namespace System::Reflection; +using namespace System::Runtime::CompilerServices; +using namespace System::Runtime::InteropServices; +using namespace System::Security::Permissions; + +[assembly:AssemblyTitleAttribute("wforms")]; +[assembly:AssemblyDescriptionAttribute("")]; +[assembly:AssemblyConfigurationAttribute("")]; +[assembly:AssemblyCompanyAttribute("the MySQL++ project")]; +[assembly:AssemblyProductAttribute("MySQL++ Windows Forms Example")]; +[assembly:AssemblyCopyrightAttribute("Copyright © 2007 by ETR, Inc.")]; +[assembly:AssemblyTrademarkAttribute("")]; +[assembly:AssemblyCultureAttribute("")]; +[assembly:AssemblyVersionAttribute("1.0.*")]; +[assembly:ComVisible(false)]; +[assembly:CLSCompliantAttribute(true)]; +[assembly:SecurityPermission(SecurityAction::RequestMinimum, UnmanagedCode = true)]; ADDED examples/vstudio/wforms/MainForm.h Index: examples/vstudio/wforms/MainForm.h ================================================================== --- /dev/null +++ examples/vstudio/wforms/MainForm.h @@ -0,0 +1,345 @@ +/*********************************************************************** + MainForm.cpp - Defines the dialog box behavior for the MySQL++ C++/CLI + Windows Forms example. + + Copyright (c) 2007 by Educational Technology Resources, Inc. Others + may also hold copyrights on code in this file. See the CREDITS.txt + file in the top directory of the distribution for details. + + This file is part of MySQL++. + + MySQL++ is free software; you can redistribute it and/or modify it + under the terms of the GNU Lesser General Public License as published + by the Free Software Foundation; either version 2.1 of the License, or + (at your option) any later version. + + MySQL++ is distributed in the hope that it will be useful, but WITHOUT + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public + License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with MySQL++; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 + USA +***********************************************************************/ + +#pragma once + +#include + +namespace wforms { + + using namespace Microsoft::Win32; + using namespace System; + using namespace System::ComponentModel; + using namespace System::Collections; + using namespace System::Windows::Forms; + using namespace System::Data; + using namespace System::Drawing; + + public ref class MainForm : public System::Windows::Forms::Form + { + public: + MainForm() + { + InitializeComponent(); + LoadDefaults(); + } + + protected: + ~MainForm() + { + if (components) { + delete components; + } + } + + private: + // Insert a text string into the output list control + Void AddMessage(String^ msg) + { + resultsList_->Items->Add(msg); + } + + // Handle Close button click by shutting down application + Void CloseButton_Click(Object^ sender, EventArgs^ e) + { + Application::Exit(); + } + + // Handle Connect button click. The body of this function is + // essentially the same as the simple2 command line example, with + // some GUI overhead. + Void ConnectButton_Click(Object^ sender, EventArgs^ e) + { + // Clear out the results list, in case this isn't the first time + // we've come in here. + resultsList_->Items->Clear(); + + // Translate the Unicode text we get from the UI into the UTF-8 + // form that MySQL wants. + const int kInputBufSize = 100; + char acServerAddress[kInputBufSize]; + char acUserName[kInputBufSize]; + char acPassword[kInputBufSize]; + ToUTF8(acServerAddress, kInputBufSize, serverAddress_->Text); + ToUTF8(acUserName, kInputBufSize, userName_->Text); + ToUTF8(acPassword, kInputBufSize, password_->Text); + + // Connect to the sample database. + mysqlpp::Connection con(false); + if (!con.connect("mysql_cpp_data", acServerAddress, acUserName, + acPassword)) { + AddMessage("Failed to connect to server:"); + AddMessage(gcnew String(con.error())); + return; + } + + // Retrieve a subset of the sample stock table set up by resetdb + mysqlpp::Query query = con.query(); + query << "select item from stock"; + mysqlpp::StoreQueryResult res = query.store(); + + if (res) { + // Display the result set + for (size_t i = 0; i < res.num_rows(); ++i) { + AddMessage(ToUCS2(res[i][0])); + } + + // Retreive was successful, so save user inputs now + SaveInputs(); + } + else { + // Retreive failed + AddMessage("Failed to get item list:"); + AddMessage(ToUCS2(query.error())); + } + } + + // Load the default input field values, if there are any + Void LoadDefaults() + { + RegistryKey^ settings = OpenSettingsRegistryKey(); + if (settings) { + userName_->Text = LoadSetting(settings, L"user"); + serverAddress_->Text = LoadSetting(settings, L"server"); + } + + if (String::IsNullOrEmpty(userName_->Text)) { + userName_->Text = Environment::UserName; + } + if (String::IsNullOrEmpty(serverAddress_->Text)) { + serverAddress_->Text = L"localhost"; + } + } + + // Returns a setting from underneath the given registry key. + // Assumes that it's a string value under the MySQL++ examples' + // settings area. + String^ LoadSetting(RegistryKey^ key, String^ name) + { + return (String^)key->GetValue(name); + } + + // Returns a reference to the MySQL++ examples' settings area in the + // registry. + RegistryKey^ OpenSettingsRegistryKey() + { + RegistryKey^ key = Registry::CurrentUser->OpenSubKey(L"Software", + true); + return key ? key->CreateSubKey(L"MySQL++ Examples") : nullptr; + } + + // Saves the input fields' values to the registry, except for the + // password field. + Void SaveInputs() + { + RegistryKey^ settings = OpenSettingsRegistryKey(); + if (settings) { + SaveSetting(settings, "user", userName_->Text); + SaveSetting(settings, "server", serverAddress_->Text); + } + } + + // Saves the given value as a named entry under the given registry + // key. + Void SaveSetting(RegistryKey^ key, String^ name, String^ value) + { + key->SetValue(name, value); + } + + // Takes a string in the .NET platform's native Unicode format and + // copies it to the given C string buffer in UTF-8 encoding. + Void ToUTF8(char* pcOut, int nOutLen, String^ sIn) + { + array^ bytes = System::Text::Encoding::UTF8->GetBytes(sIn); + nOutLen = Math::Min(nOutLen - 1, bytes->Length); + System::Runtime::InteropServices::Marshal::Copy(bytes, 0, + IntPtr(pcOut), nOutLen); + pcOut[nOutLen] = '\0'; + } + + // Takes the given C string encoded in UTF-8 and converts it to a + // Unicode string in the .NET platform's native Unicode encoding. + String^ ToUCS2(const char* utf8) + { + return gcnew String(utf8, 0, strlen(utf8), + System::Text::Encoding::UTF8); + } + + private: System::Windows::Forms::TextBox^ serverAddress_; + private: System::Windows::Forms::TextBox^ password_; + private: System::Windows::Forms::TextBox^ userName_; + private: System::Windows::Forms::ListBox^ resultsList_; + private: System::Windows::Forms::Button^ connectButton_; + private: System::Windows::Forms::Button^ closeButton_; + private: System::ComponentModel::Container^ components; + +#pragma region Windows Form Designer generated code + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + void InitializeComponent(void) + { + System::Windows::Forms::Label^ label1; + System::Windows::Forms::Label^ label2; + System::Windows::Forms::Label^ label3; + System::Windows::Forms::Label^ label4; + this->serverAddress_ = (gcnew System::Windows::Forms::TextBox()); + this->password_ = (gcnew System::Windows::Forms::TextBox()); + this->userName_ = (gcnew System::Windows::Forms::TextBox()); + this->resultsList_ = (gcnew System::Windows::Forms::ListBox()); + this->connectButton_ = (gcnew System::Windows::Forms::Button()); + this->closeButton_ = (gcnew System::Windows::Forms::Button()); + label1 = (gcnew System::Windows::Forms::Label()); + label2 = (gcnew System::Windows::Forms::Label()); + label3 = (gcnew System::Windows::Forms::Label()); + label4 = (gcnew System::Windows::Forms::Label()); + this->SuspendLayout(); + // + // label1 + // + label1->AutoSize = true; + label1->Location = System::Drawing::Point(29, 13); + label1->Name = L"label1"; + label1->Size = System::Drawing::Size(41, 13); + label1->TabIndex = 6; + label1->Text = L"Server:"; + label1->TextAlign = System::Drawing::ContentAlignment::TopRight; + // + // label2 + // + label2->AutoSize = true; + label2->Location = System::Drawing::Point(9, 39); + label2->Name = L"label2"; + label2->Size = System::Drawing::Size(61, 13); + label2->TabIndex = 7; + label2->Text = L"User name:"; + label2->TextAlign = System::Drawing::ContentAlignment::TopRight; + // + // label3 + // + label3->AutoSize = true; + label3->Location = System::Drawing::Point(14, 65); + label3->Name = L"label3"; + label3->Size = System::Drawing::Size(56, 13); + label3->TabIndex = 8; + label3->Text = L"Password:"; + label3->TextAlign = System::Drawing::ContentAlignment::TopRight; + // + // label4 + // + label4->AutoSize = true; + label4->Location = System::Drawing::Point(25, 92); + label4->Name = L"label4"; + label4->Size = System::Drawing::Size(45, 13); + label4->TabIndex = 9; + label4->Text = L"Results:"; + label4->TextAlign = System::Drawing::ContentAlignment::TopRight; + // + // serverAddress_ + // + this->serverAddress_->Location = System::Drawing::Point(70, 9); + this->serverAddress_->Name = L"serverAddress_"; + this->serverAddress_->Size = System::Drawing::Size(139, 20); + this->serverAddress_->TabIndex = 0; + // + // password_ + // + this->password_->Location = System::Drawing::Point(70, 61); + this->password_->Name = L"password_"; + this->password_->Size = System::Drawing::Size(139, 20); + this->password_->TabIndex = 2; + this->password_->UseSystemPasswordChar = true; + // + // userName_ + // + this->userName_->Location = System::Drawing::Point(70, 35); + this->userName_->Name = L"userName_"; + this->userName_->Size = System::Drawing::Size(139, 20); + this->userName_->TabIndex = 1; + // + // resultsList_ + // + this->resultsList_->Enabled = false; + this->resultsList_->FormattingEnabled = true; + this->resultsList_->Location = System::Drawing::Point(70, 88); + this->resultsList_->Name = L"resultsList_"; + this->resultsList_->Size = System::Drawing::Size(228, 95); + this->resultsList_->TabIndex = 3; + this->resultsList_->TabStop = false; + // + // connectButton_ + // + this->connectButton_->Location = System::Drawing::Point(224, 9); + this->connectButton_->Name = L"connectButton_"; + this->connectButton_->Size = System::Drawing::Size(75, 23); + this->connectButton_->TabIndex = 3; + this->connectButton_->Text = L"Connect!"; + this->connectButton_->UseVisualStyleBackColor = true; + this->connectButton_->Click += gcnew System::EventHandler(this, &MainForm::ConnectButton_Click); + // + // closeButton_ + // + this->closeButton_->DialogResult = System::Windows::Forms::DialogResult::Cancel; + this->closeButton_->Location = System::Drawing::Point(224, 38); + this->closeButton_->Name = L"closeButton_"; + this->closeButton_->Size = System::Drawing::Size(75, 23); + this->closeButton_->TabIndex = 4; + this->closeButton_->Text = L"Close"; + this->closeButton_->UseVisualStyleBackColor = true; + this->closeButton_->Click += gcnew System::EventHandler(this, &MainForm::CloseButton_Click); + // + // MainForm + // + this->AcceptButton = this->connectButton_; + this->AutoScaleDimensions = System::Drawing::SizeF(6, 13); + this->AutoScaleMode = System::Windows::Forms::AutoScaleMode::Font; + this->CancelButton = this->closeButton_; + this->ClientSize = System::Drawing::Size(310, 192); + this->ControlBox = false; + this->Controls->Add(label4); + this->Controls->Add(label3); + this->Controls->Add(label2); + this->Controls->Add(label1); + this->Controls->Add(this->closeButton_); + this->Controls->Add(this->connectButton_); + this->Controls->Add(this->resultsList_); + this->Controls->Add(this->userName_); + this->Controls->Add(this->password_); + this->Controls->Add(this->serverAddress_); + this->FormBorderStyle = System::Windows::Forms::FormBorderStyle::FixedDialog; + this->MaximizeBox = false; + this->MinimizeBox = false; + this->Name = L"MainForm"; + this->ShowIcon = false; + this->Text = L"MySQL++ Windows Forms Examples"; + this->ResumeLayout(false); + this->PerformLayout(); + + } +#pragma endregion +}; +} ADDED examples/vstudio/wforms/MainForm.resX Index: examples/vstudio/wforms/MainForm.resX ================================================================== --- /dev/null +++ examples/vstudio/wforms/MainForm.resX @@ -0,0 +1,132 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + False + + + False + + + False + + + False + + ADDED examples/vstudio/wforms/resource.h Index: examples/vstudio/wforms/resource.h ================================================================== --- /dev/null +++ examples/vstudio/wforms/resource.h @@ -0,0 +1,3 @@ +//{{NO_DEPENDENCIES}} +// Microsoft Visual C++ generated include file. +// Used by app.rc ADDED examples/vstudio/wforms/wforms.cpp Index: examples/vstudio/wforms/wforms.cpp ================================================================== --- /dev/null +++ examples/vstudio/wforms/wforms.cpp @@ -0,0 +1,17 @@ +// wforms.cpp : main project file. + +#include "MainForm.h" + +using namespace wforms; + +[STAThreadAttribute] +int main(array ^args) +{ + // Enabling Windows XP visual effects before any controls are created + Application::EnableVisualStyles(); + Application::SetCompatibleTextRenderingDefault(false); + + // Create the main window and run it + Application::Run(gcnew MainForm()); + return 0; +} ADDED exrun Index: exrun ================================================================== --- /dev/null +++ exrun @@ -0,0 +1,66 @@ +#!/bin/sh +if [ -z "$1" ] +then + echo "usage: $0 [TOOL] [args...]" + echo + echo " Runs the given example, using the library in the current directory" + echo " instead of using the system library search mechanism. Accepts an " + echo " arbitrary number of arguments." + echo + echo " TOOL can be 'valgrind', 'gdb', or 'ldd', which causes exrun to" + echo " run the example program under the given tool." + echo + exit 1 +fi + +TOOL= +PROG=$1 +if [ "$PROG" = 'valgrind' ] +then + TOOL='valgrind' + shift + PROG=$1 +elif [ "$PROG" = 'gdb' ] +then + TOOL='gdb --args' + shift + PROG=$1 +elif [ "$PROG" = 'ldd' ] +then + TOOL='ldd' + shift + PROG=$1 +fi + +shift +if [ -e "$PROG" ] +then + if [ `uname -s` = 'Darwin' ] + then + DYLD_LIBRARY_PATH=. $TOOL ./$PROG $* + elif [ `uname -o` = 'Cygwin' ] + then + # Cygwin build case; see below for bash-as-DOS-shell case + PATH=. $TOOL ./$PROG $* + elif [ -e /usr/bin/ldd ] + then + if [ `uname -s` = 'SunOS' ] + then + LD_LIBRARY_PATH=.:/usr/mysql/lib/mysql $TOOL ./$PROG $* + else + LD_LIBRARY_PATH=. $TOOL ./$PROG $* + fi + else + echo "ERROR: I don't grok this system's dynamic linkage system." + fi +elif [ `uname -o` = 'Cygwin' ] +then + # VC++ build, but using Cygwin's bash as shell to run programs + cmd.exe /c exrun.bat $PROG $* +else + echo "usage: $0 [TOOL] [args...]" + echo + echo " Run $0 without arguments for more detailed usage info." + echo + exit 1 +fi ADDED exrun.bat Index: exrun.bat ================================================================== --- /dev/null +++ exrun.bat @@ -0,0 +1,14 @@ +@echo off +set PROG=%1 +if not exist %PROG% set PROG=%1.exe +if not exist %PROG% set PROG=Debug\%1 +if not exist %PROG% set PROG=vc2008\x64\Debug\%1.exe +if not exist %PROG% set PROG=vc2008\Debug\%1.exe +if not exist %PROG% set PROG=vc2005\Debug\%1.exe +if not exist %PROG% set PROG=vc2003\Debug\%1.exe +if not exist %PROG% exit +shift + +set PATH=Debug;vc2008\x64\Debug;vc2008\Debug;vc2005\Debug;vc2003\Debug;%PATH% +echo Running %PROG%... +%PROG% %1 %2 %3 %4 %5 %6 %7 %8 %9 ADDED install.hta.in Index: install.hta.in ================================================================== --- /dev/null +++ install.hta.in @@ -0,0 +1,372 @@ + + + + + + Install MySQL++ Development Files + + + + + + + + + + + +

+ Where would you like to install the MySQL++ development + files?
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Drives: + +
Folders: + +
  + + Install + in versioned folder? +
  + + Segregate + native C++ library builds from C++/CLI (CLR) + builds? +
  + + Segregate + libraries by platform? +
Target: + +
+ +   + +
+

+ + Index: lib/Doxyfile.in ================================================================== --- lib/Doxyfile.in +++ lib/Doxyfile.in @@ -1,985 +1,2283 @@ -# Doxyfile 1.3.9.1 +# Doxyfile 1.8.5 # This file describes the settings to be used by the documentation system -# doxygen (www.doxygen.org) for a project +# doxygen (www.doxygen.org) for a project. +# +# All text after a double hash (##) is considered a comment and is placed in +# front of the TAG it is preceding. # -# All text after a hash (#) is considered a comment and will be ignored +# All text after a single hash (#) is considered a comment and will be ignored. # The format is: -# TAG = value [value, ...] -# For lists items can also be appended using: -# TAG += value [value, ...] -# Values that contain spaces should be placed between quotes (" ") +# TAG = value [value, ...] +# For lists, items can also be appended using: +# TAG += value [value, ...] +# Values that contain spaces should be placed between quotes (\" \"). #--------------------------------------------------------------------------- # Project related configuration options #--------------------------------------------------------------------------- -# The PROJECT_NAME tag is a single word (or a sequence of words surrounded -# by quotes) that should identify the project. +# This tag specifies the encoding used for all characters in the config file +# that follow. The default is UTF-8 which is also the encoding used for all text +# before the first occurrence of this tag. Doxygen uses libiconv (or the iconv +# built into libc) for the transcoding. See http://www.gnu.org/software/libiconv +# for the list of possible encodings. +# The default value is: UTF-8. + +DOXYFILE_ENCODING = UTF-8 + +# The PROJECT_NAME tag is a single word (or a sequence of words surrounded by +# double-quotes, unless you are using Doxywizard) that should identify the +# project for which the documentation is generated. This name is used in the +# title of most generated pages and in a few other places. +# The default value is: My Project. PROJECT_NAME = MySQL++ -# The PROJECT_NUMBER tag can be used to enter a project or revision number. -# This could be handy for archiving the generated documentation or -# if some version control system is used. +# The PROJECT_NUMBER tag can be used to enter a project or revision number. This +# could be handy for archiving the generated documentation or if some version +# control system is used. PROJECT_NUMBER = @PACKAGE_VERSION@ -# The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute) -# base path where the generated documentation will be put. -# If a relative path is entered, it will be relative to the location -# where doxygen was started. If left blank the current directory will be used. - -OUTPUT_DIRECTORY = ../doc/refman - -# The OUTPUT_LANGUAGE tag is used to specify the language in which all -# documentation generated by doxygen is written. Doxygen will use this -# information to generate all constant output in the proper language. -# The default language is English, other supported languages are: -# Brazilian, Catalan, Chinese, Chinese-Traditional, Croatian, Czech, Danish, -# Dutch, Finnish, French, German, Greek, Hungarian, Italian, Japanese, -# Japanese-en (Japanese with English messages), Korean, Korean-en, Norwegian, -# Polish, Portuguese, Romanian, Russian, Serbian, Slovak, Slovene, Spanish, -# Swedish, and Ukrainian. +# Using the PROJECT_BRIEF tag one can provide an optional one line description +# for a project that appears at the top of each page and should give viewer a +# quick idea about the purpose of the project. Keep the description short. + +PROJECT_BRIEF = + +# With the PROJECT_LOGO tag one can specify an logo or icon that is included in +# the documentation. The maximum height of the logo should not exceed 55 pixels +# and the maximum width should not exceed 200 pixels. Doxygen will copy the logo +# to the output directory. + +PROJECT_LOGO = + +# The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute) path +# into which the generated documentation will be written. If a relative path is +# entered, it will be relative to the location where doxygen was started. If +# left blank the current directory will be used. + +OUTPUT_DIRECTORY = ../doc + +# If the CREATE_SUBDIRS tag is set to YES, then doxygen will create 4096 sub- +# directories (in 2 levels) under the output directory of each output format and +# will distribute the generated files over these directories. Enabling this +# option can be useful when feeding doxygen a huge amount of source files, where +# putting all generated files in the same directory would otherwise causes +# performance problems for the file system. +# The default value is: NO. + +CREATE_SUBDIRS = NO + +# The OUTPUT_LANGUAGE tag is used to specify the language in which all +# documentation generated by doxygen is written. Doxygen will use this +# information to generate all constant output in the proper language. +# Possible values are: Afrikaans, Arabic, Brazilian, Catalan, Chinese, Chinese- +# Traditional, Croatian, Czech, Danish, Dutch, English, Esperanto, Farsi, +# Finnish, French, German, Greek, Hungarian, Italian, Japanese, Japanese-en, +# Korean, Korean-en, Latvian, Norwegian, Macedonian, Persian, Polish, +# Portuguese, Romanian, Russian, Serbian, Slovak, Slovene, Spanish, Swedish, +# Turkish, Ukrainian and Vietnamese. +# The default value is: English. OUTPUT_LANGUAGE = English -# If the BRIEF_MEMBER_DESC tag is set to YES (the default) Doxygen will -# include brief member descriptions after the members that are listed in -# the file and class documentation (similar to JavaDoc). -# Set to NO to disable this. +# If the BRIEF_MEMBER_DESC tag is set to YES doxygen will include brief member +# descriptions after the members that are listed in the file and class +# documentation (similar to Javadoc). Set to NO to disable this. +# The default value is: YES. BRIEF_MEMBER_DESC = YES -# If the REPEAT_BRIEF tag is set to YES (the default) Doxygen will prepend -# the brief description of a member or function before the detailed description. -# Note: if both HIDE_UNDOC_MEMBERS and BRIEF_MEMBER_DESC are set to NO, the +# If the REPEAT_BRIEF tag is set to YES doxygen will prepend the brief +# description of a member or function before the detailed description +# +# Note: If both HIDE_UNDOC_MEMBERS and BRIEF_MEMBER_DESC are set to NO, the # brief descriptions will be completely suppressed. +# The default value is: YES. REPEAT_BRIEF = YES -# If the ALWAYS_DETAILED_SEC and REPEAT_BRIEF tags are both set to YES then -# Doxygen will generate a detailed section even if there is only a brief +# This tag implements a quasi-intelligent brief description abbreviator that is +# used to form the text in various listings. Each string in this list, if found +# as the leading text of the brief description, will be stripped from the text +# and the result, after processing the whole list, is used as the annotated +# text. Otherwise, the brief description is used as-is. If left blank, the +# following values are used ($name is automatically replaced with the name of +# the entity):The $name class, The $name widget, The $name file, is, provides, +# specifies, contains, represents, a, an and the. + +ABBREVIATE_BRIEF = + +# If the ALWAYS_DETAILED_SEC and REPEAT_BRIEF tags are both set to YES then +# doxygen will generate a detailed section even if there is only a brief # description. +# The default value is: NO. ALWAYS_DETAILED_SEC = NO -# If the INLINE_INHERITED_MEMB tag is set to YES, doxygen will show all inherited -# members of a class in the documentation of that class as if those members were -# ordinary class members. Constructors, destructors and assignment operators of -# the base classes will not be shown. +# If the INLINE_INHERITED_MEMB tag is set to YES, doxygen will show all +# inherited members of a class in the documentation of that class as if those +# members were ordinary class members. Constructors, destructors and assignment +# operators of the base classes will not be shown. +# The default value is: NO. INLINE_INHERITED_MEMB = NO -# If the FULL_PATH_NAMES tag is set to YES then Doxygen will prepend the full -# path before files name in the file list and in the header files. If set -# to NO the shortest path that makes the file name unique will be used. +# If the FULL_PATH_NAMES tag is set to YES doxygen will prepend the full path +# before files name in the file list and in the header files. If set to NO the +# shortest path that makes the file name unique will be used +# The default value is: YES. FULL_PATH_NAMES = NO -# If the FULL_PATH_NAMES tag is set to YES then the STRIP_FROM_PATH tag -# can be used to strip a user-defined part of the path. Stripping is -# only done if one of the specified strings matches the left-hand part of -# the path. The tag can be used to show relative paths in the file list. -# If left blank the directory from which doxygen is run is used as the -# path to strip. - -STRIP_FROM_PATH = - -# If the SHORT_NAMES tag is set to YES, doxygen will generate much shorter -# (but less readable) file names. This can be useful is your file systems -# doesn't support long names like on DOS, Mac, or CD-ROM. +# The STRIP_FROM_PATH tag can be used to strip a user-defined part of the path. +# Stripping is only done if one of the specified strings matches the left-hand +# part of the path. The tag can be used to show relative paths in the file list. +# If left blank the directory from which doxygen is run is used as the path to +# strip. +# +# Note that you can specify absolute paths here, but also relative paths, which +# will be relative from the directory where doxygen is started. +# This tag requires that the tag FULL_PATH_NAMES is set to YES. + +STRIP_FROM_PATH = + +# The STRIP_FROM_INC_PATH tag can be used to strip a user-defined part of the +# path mentioned in the documentation of a class, which tells the reader which +# header file to include in order to use a class. If left blank only the name of +# the header file containing the class definition is used. Otherwise one should +# specify the list of include paths that are normally passed to the compiler +# using the -I flag. + +STRIP_FROM_INC_PATH = + +# If the SHORT_NAMES tag is set to YES, doxygen will generate much shorter (but +# less readable) file names. This can be useful is your file systems doesn't +# support long names like on DOS, Mac, or CD-ROM. +# The default value is: NO. SHORT_NAMES = NO -# If the JAVADOC_AUTOBRIEF tag is set to YES then Doxygen -# will interpret the first line (until the first dot) of a JavaDoc-style -# comment as the brief description. If set to NO, the JavaDoc -# comments will behave just like the Qt-style comments (thus requiring an -# explicit @brief command for a brief description. +# If the JAVADOC_AUTOBRIEF tag is set to YES then doxygen will interpret the +# first line (until the first dot) of a Javadoc-style comment as the brief +# description. If set to NO, the Javadoc-style will behave just like regular Qt- +# style comments (thus requiring an explicit @brief command for a brief +# description.) +# The default value is: NO. JAVADOC_AUTOBRIEF = NO -# The MULTILINE_CPP_IS_BRIEF tag can be set to YES to make Doxygen -# treat a multi-line C++ special comment block (i.e. a block of //! or /// -# comments) as a brief description. This used to be the default behaviour. -# The new default is to treat a multi-line C++ comment block as a detailed -# description. Set this tag to YES if you prefer the old behaviour instead. +# If the QT_AUTOBRIEF tag is set to YES then doxygen will interpret the first +# line (until the first dot) of a Qt-style comment as the brief description. If +# set to NO, the Qt-style will behave just like regular Qt-style comments (thus +# requiring an explicit \brief command for a brief description.) +# The default value is: NO. + +QT_AUTOBRIEF = NO + +# The MULTILINE_CPP_IS_BRIEF tag can be set to YES to make doxygen treat a +# multi-line C++ special comment block (i.e. a block of //! or /// comments) as +# a brief description. This used to be the default behavior. The new default is +# to treat a multi-line C++ comment block as a detailed description. Set this +# tag to YES if you prefer the old behavior instead. +# +# Note that setting this tag to YES also means that rational rose comments are +# not recognized any more. +# The default value is: NO. MULTILINE_CPP_IS_BRIEF = NO -# If the DETAILS_AT_TOP tag is set to YES then Doxygen -# will output the detailed description near the top, like JavaDoc. -# If set to NO, the detailed description appears after the member -# documentation. - -DETAILS_AT_TOP = NO - -# If the INHERIT_DOCS tag is set to YES (the default) then an undocumented -# member inherits the documentation from any documented member that it -# re-implements. +# If the INHERIT_DOCS tag is set to YES then an undocumented member inherits the +# documentation from any documented member that it re-implements. +# The default value is: YES. INHERIT_DOCS = YES -# If member grouping is used in the documentation and the DISTRIBUTE_GROUP_DOC -# tag is set to YES, then doxygen will reuse the documentation of the first -# member in the group (if any) for the other members of the group. By default -# all members of a group must be documented explicitly. - -DISTRIBUTE_GROUP_DOC = NO - -# The TAB_SIZE tag can be used to set the number of spaces in a tab. -# Doxygen uses this value to replace tabs by spaces in code fragments. +# If the SEPARATE_MEMBER_PAGES tag is set to YES, then doxygen will produce a +# new page for each member. If set to NO, the documentation of a member will be +# part of the file/class/namespace that contains it. +# The default value is: NO. + +SEPARATE_MEMBER_PAGES = NO + +# The TAB_SIZE tag can be used to set the number of spaces in a tab. Doxygen +# uses this value to replace tabs by spaces in code fragments. +# Minimum value: 1, maximum value: 16, default value: 4. TAB_SIZE = 8 -# This tag can be used to specify a number of aliases that acts -# as commands in the documentation. An alias has the form "name=value". -# For example adding "sideeffect=\par Side Effects:\n" will allow you to -# put the command \sideeffect (or @sideeffect) in the documentation, which -# will result in a user-defined paragraph with heading "Side Effects:". -# You can put \n's in the value part of an alias to insert newlines. - -ALIASES = - -# Set the OPTIMIZE_OUTPUT_FOR_C tag to YES if your project consists of C sources -# only. Doxygen will then generate output that is more tailored for C. -# For instance, some of the names that are used will be different. The list -# of all members will be omitted, etc. +# This tag can be used to specify a number of aliases that act as commands in +# the documentation. An alias has the form: +# name=value +# For example adding +# "sideeffect=@par Side Effects:\n" +# will allow you to put the command \sideeffect (or @sideeffect) in the +# documentation, which will result in a user-defined paragraph with heading +# "Side Effects:". You can put \n's in the value part of an alias to insert +# newlines. + +ALIASES = + +# This tag can be used to specify a number of word-keyword mappings (TCL only). +# A mapping has the form "name=value". For example adding "class=itcl::class" +# will allow you to use the command class in the itcl::class meaning. + +TCL_SUBST = + +# Set the OPTIMIZE_OUTPUT_FOR_C tag to YES if your project consists of C sources +# only. Doxygen will then generate output that is more tailored for C. For +# instance, some of the names that are used will be different. The list of all +# members will be omitted, etc. +# The default value is: NO. OPTIMIZE_OUTPUT_FOR_C = NO -# Set the OPTIMIZE_OUTPUT_JAVA tag to YES if your project consists of Java sources -# only. Doxygen will then generate output that is more tailored for Java. -# For instance, namespaces will be presented as packages, qualified scopes -# will look different, etc. +# Set the OPTIMIZE_OUTPUT_JAVA tag to YES if your project consists of Java or +# Python sources only. Doxygen will then generate output that is more tailored +# for that language. For instance, namespaces will be presented as packages, +# qualified scopes will look different, etc. +# The default value is: NO. OPTIMIZE_OUTPUT_JAVA = NO + +# Set the OPTIMIZE_FOR_FORTRAN tag to YES if your project consists of Fortran +# sources. Doxygen will then generate output that is tailored for Fortran. +# The default value is: NO. + +OPTIMIZE_FOR_FORTRAN = NO + +# Set the OPTIMIZE_OUTPUT_VHDL tag to YES if your project consists of VHDL +# sources. Doxygen will then generate output that is tailored for VHDL. +# The default value is: NO. + +OPTIMIZE_OUTPUT_VHDL = NO + +# Doxygen selects the parser to use depending on the extension of the files it +# parses. With this tag you can assign which parser to use for a given +# extension. Doxygen has a built-in mapping, but you can override or extend it +# using this tag. The format is ext=language, where ext is a file extension, and +# language is one of the parsers supported by doxygen: IDL, Java, Javascript, +# C#, C, C++, D, PHP, Objective-C, Python, Fortran, VHDL. For instance to make +# doxygen treat .inc files as Fortran files (default is PHP), and .f files as C +# (default is Fortran), use: inc=Fortran f=C. +# +# Note For files without extension you can use no_extension as a placeholder. +# +# Note that for custom extensions you also need to set FILE_PATTERNS otherwise +# the files are not read by doxygen. + +EXTENSION_MAPPING = + +# If the MARKDOWN_SUPPORT tag is enabled then doxygen pre-processes all comments +# according to the Markdown format, which allows for more readable +# documentation. See http://daringfireball.net/projects/markdown/ for details. +# The output of markdown processing is further processed by doxygen, so you can +# mix doxygen, HTML, and XML commands with Markdown formatting. Disable only in +# case of backward compatibilities issues. +# The default value is: YES. + +MARKDOWN_SUPPORT = YES + +# When enabled doxygen tries to link words that correspond to documented +# classes, or namespaces to their corresponding documentation. Such a link can +# be prevented in individual cases by by putting a % sign in front of the word +# or globally by setting AUTOLINK_SUPPORT to NO. +# The default value is: YES. + +AUTOLINK_SUPPORT = YES + +# If you use STL classes (i.e. std::string, std::vector, etc.) but do not want +# to include (a tag file for) the STL sources as input, then you should set this +# tag to YES in order to let doxygen match functions declarations and +# definitions whose arguments contain STL classes (e.g. func(std::string); +# versus func(std::string) {}). This also make the inheritance and collaboration +# diagrams that involve STL classes more complete and accurate. +# The default value is: NO. + +BUILTIN_STL_SUPPORT = NO + +# If you use Microsoft's C++/CLI language, you should set this option to YES to +# enable parsing support. +# The default value is: NO. + +CPP_CLI_SUPPORT = NO + +# Set the SIP_SUPPORT tag to YES if your project consists of sip (see: +# http://www.riverbankcomputing.co.uk/software/sip/intro) sources only. Doxygen +# will parse them like normal C++ but will assume all classes use public instead +# of private inheritance when no explicit protection keyword is present. +# The default value is: NO. + +SIP_SUPPORT = NO + +# For Microsoft's IDL there are propget and propput attributes to indicate +# getter and setter methods for a property. Setting this option to YES will make +# doxygen to replace the get and set methods by a property in the documentation. +# This will only work if the methods are indeed getting or setting a simple +# type. If this is not the case, or you want to show the methods anyway, you +# should set this option to NO. +# The default value is: YES. + +IDL_PROPERTY_SUPPORT = YES + +# If member grouping is used in the documentation and the DISTRIBUTE_GROUP_DOC +# tag is set to YES, then doxygen will reuse the documentation of the first +# member in the group (if any) for the other members of the group. By default +# all members of a group must be documented explicitly. +# The default value is: NO. + +DISTRIBUTE_GROUP_DOC = NO + +# Set the SUBGROUPING tag to YES to allow class member groups of the same type +# (for instance a group of public functions) to be put as a subgroup of that +# type (e.g. under the Public Functions section). Set it to NO to prevent +# subgrouping. Alternatively, this can be done per class using the +# \nosubgrouping command. +# The default value is: YES. + +SUBGROUPING = YES + +# When the INLINE_GROUPED_CLASSES tag is set to YES, classes, structs and unions +# are shown inside the group in which they are included (e.g. using \ingroup) +# instead of on a separate page (for HTML and Man pages) or section (for LaTeX +# and RTF). +# +# Note that this feature does not work in combination with +# SEPARATE_MEMBER_PAGES. +# The default value is: NO. + +INLINE_GROUPED_CLASSES = NO + +# When the INLINE_SIMPLE_STRUCTS tag is set to YES, structs, classes, and unions +# with only public data fields or simple typedef fields will be shown inline in +# the documentation of the scope in which they are defined (i.e. file, +# namespace, or group documentation), provided this scope is documented. If set +# to NO, structs, classes, and unions are shown on a separate page (for HTML and +# Man pages) or section (for LaTeX and RTF). +# The default value is: NO. + +INLINE_SIMPLE_STRUCTS = NO + +# When TYPEDEF_HIDES_STRUCT tag is enabled, a typedef of a struct, union, or +# enum is documented as struct, union, or enum with the name of the typedef. So +# typedef struct TypeS {} TypeT, will appear in the documentation as a struct +# with name TypeT. When disabled the typedef will appear as a member of a file, +# namespace, or class. And the struct will be named TypeS. This can typically be +# useful for C code in case the coding convention dictates that all compound +# types are typedef'ed and only the typedef is referenced, never the tag name. +# The default value is: NO. + +TYPEDEF_HIDES_STRUCT = NO + +# The size of the symbol lookup cache can be set using LOOKUP_CACHE_SIZE. This +# cache is used to resolve symbols given their name and scope. Since this can be +# an expensive process and often the same symbol appears multiple times in the +# code, doxygen keeps a cache of pre-resolved symbols. If the cache is too small +# doxygen will become slower. If the cache is too large, memory is wasted. The +# cache size is given by this formula: 2^(16+LOOKUP_CACHE_SIZE). The valid range +# is 0..9, the default is 0, corresponding to a cache size of 2^16=65536 +# symbols. At the end of a run doxygen will report the cache usage and suggest +# the optimal cache size from a speed point of view. +# Minimum value: 0, maximum value: 9, default value: 0. + +LOOKUP_CACHE_SIZE = 0 #--------------------------------------------------------------------------- # Build related configuration options #--------------------------------------------------------------------------- -# If the EXTRACT_ALL tag is set to YES doxygen will assume all entities in -# documentation are documented, even if no documentation was available. -# Private class members and static file members will be hidden unless -# the EXTRACT_PRIVATE and EXTRACT_STATIC tags are set to YES +# If the EXTRACT_ALL tag is set to YES doxygen will assume all entities in +# documentation are documented, even if no documentation was available. Private +# class members and static file members will be hidden unless the +# EXTRACT_PRIVATE respectively EXTRACT_STATIC tags are set to YES. +# Note: This will also disable the warnings about undocumented members that are +# normally produced when WARNINGS is set to YES. +# The default value is: NO. EXTRACT_ALL = NO -# If the EXTRACT_PRIVATE tag is set to YES all private members of a class -# will be included in the documentation. +# If the EXTRACT_PRIVATE tag is set to YES all private members of a class will +# be included in the documentation. +# The default value is: NO. EXTRACT_PRIVATE = NO -# If the EXTRACT_STATIC tag is set to YES all static members of a file -# will be included in the documentation. +# If the EXTRACT_PACKAGE tag is set to YES all members with package or internal +# scope will be included in the documentation. +# The default value is: NO. + +EXTRACT_PACKAGE = NO + +# If the EXTRACT_STATIC tag is set to YES all static members of a file will be +# included in the documentation. +# The default value is: NO. EXTRACT_STATIC = NO -# If the EXTRACT_LOCAL_CLASSES tag is set to YES classes (and structs) -# defined locally in source files will be included in the documentation. -# If set to NO only classes defined in header files are included. +# If the EXTRACT_LOCAL_CLASSES tag is set to YES classes (and structs) defined +# locally in source files will be included in the documentation. If set to NO +# only classes defined in header files are included. Does not have any effect +# for Java sources. +# The default value is: YES. EXTRACT_LOCAL_CLASSES = YES -# If the HIDE_UNDOC_MEMBERS tag is set to YES, Doxygen will hide all -# undocumented members of documented classes, files or namespaces. -# If set to NO (the default) these members will be included in the -# various overviews, but no documentation section is generated. -# This option has no effect if EXTRACT_ALL is enabled. +# This flag is only useful for Objective-C code. When set to YES local methods, +# which are defined in the implementation section but not in the interface are +# included in the documentation. If set to NO only methods in the interface are +# included. +# The default value is: NO. + +EXTRACT_LOCAL_METHODS = NO + +# If this flag is set to YES, the members of anonymous namespaces will be +# extracted and appear in the documentation as a namespace called +# 'anonymous_namespace{file}', where file will be replaced with the base name of +# the file that contains the anonymous namespace. By default anonymous namespace +# are hidden. +# The default value is: NO. + +EXTRACT_ANON_NSPACES = NO + +# If the HIDE_UNDOC_MEMBERS tag is set to YES, doxygen will hide all +# undocumented members inside documented classes or files. If set to NO these +# members will be included in the various overviews, but no documentation +# section is generated. This option has no effect if EXTRACT_ALL is enabled. +# The default value is: NO. HIDE_UNDOC_MEMBERS = NO -# If the HIDE_UNDOC_CLASSES tag is set to YES, Doxygen will hide all -# undocumented classes that are normally visible in the class hierarchy. -# If set to NO (the default) these classes will be included in the various -# overviews. This option has no effect if EXTRACT_ALL is enabled. +# If the HIDE_UNDOC_CLASSES tag is set to YES, doxygen will hide all +# undocumented classes that are normally visible in the class hierarchy. If set +# to NO these classes will be included in the various overviews. This option has +# no effect if EXTRACT_ALL is enabled. +# The default value is: NO. HIDE_UNDOC_CLASSES = NO -# If the HIDE_FRIEND_COMPOUNDS tag is set to YES, Doxygen will hide all -# friend (class|struct|union) declarations. -# If set to NO (the default) these declarations will be included in the -# documentation. +# If the HIDE_FRIEND_COMPOUNDS tag is set to YES, doxygen will hide all friend +# (class|struct|union) declarations. If set to NO these declarations will be +# included in the documentation. +# The default value is: NO. HIDE_FRIEND_COMPOUNDS = NO -# The INTERNAL_DOCS tag determines if documentation -# that is typed after a \internal command is included. If the tag is set -# to NO (the default) then the documentation will be excluded. -# Set it to YES to include the internal documentation. +# If the HIDE_IN_BODY_DOCS tag is set to YES, doxygen will hide any +# documentation blocks found inside the body of a function. If set to NO these +# blocks will be appended to the function's detailed documentation block. +# The default value is: NO. + +HIDE_IN_BODY_DOCS = NO + +# The INTERNAL_DOCS tag determines if documentation that is typed after a +# \internal command is included. If the tag is set to NO then the documentation +# will be excluded. Set it to YES to include the internal documentation. +# The default value is: NO. INTERNAL_DOCS = NO -# If the CASE_SENSE_NAMES tag is set to NO then Doxygen will only generate -# file names in lower-case letters. If set to YES upper-case letters are also -# allowed. This is useful if you have classes or files whose names only differ -# in case and if your file system supports case sensitive file names. Windows +# If the CASE_SENSE_NAMES tag is set to NO then doxygen will only generate file +# names in lower-case letters. If set to YES upper-case letters are also +# allowed. This is useful if you have classes or files whose names only differ +# in case and if your file system supports case sensitive file names. Windows # and Mac users are advised to set this option to NO. +# The default value is: system dependent. CASE_SENSE_NAMES = YES -# If the HIDE_SCOPE_NAMES tag is set to NO (the default) then Doxygen -# will show members with their full class and namespace scopes in the -# documentation. If set to YES the scope will be hidden. +# If the HIDE_SCOPE_NAMES tag is set to NO then doxygen will show members with +# their full class and namespace scopes in the documentation. If set to YES the +# scope will be hidden. +# The default value is: NO. HIDE_SCOPE_NAMES = NO -# If the SHOW_INCLUDE_FILES tag is set to YES (the default) then Doxygen -# will put a list of the files that are included by a file in the documentation -# of that file. +# If the SHOW_INCLUDE_FILES tag is set to YES then doxygen will put a list of +# the files that are included by a file in the documentation of that file. +# The default value is: YES. SHOW_INCLUDE_FILES = YES -# If the INLINE_INFO tag is set to YES (the default) then a tag [inline] -# is inserted in the documentation for inline members. +# If the FORCE_LOCAL_INCLUDES tag is set to YES then doxygen will list include +# files with double quotes in the documentation rather than with sharp brackets. +# The default value is: NO. + +FORCE_LOCAL_INCLUDES = NO + +# If the INLINE_INFO tag is set to YES then a tag [inline] is inserted in the +# documentation for inline members. +# The default value is: YES. INLINE_INFO = YES -# If the SORT_MEMBER_DOCS tag is set to YES (the default) then doxygen -# will sort the (detailed) documentation of file and class members -# alphabetically by member name. If set to NO the members will appear in -# declaration order. +# If the SORT_MEMBER_DOCS tag is set to YES then doxygen will sort the +# (detailed) documentation of file and class members alphabetically by member +# name. If set to NO the members will appear in declaration order. +# The default value is: YES. SORT_MEMBER_DOCS = YES -# The GENERATE_TODOLIST tag can be used to enable (YES) or -# disable (NO) the todo list. This list is created by putting \todo -# commands in the documentation. +# If the SORT_BRIEF_DOCS tag is set to YES then doxygen will sort the brief +# descriptions of file, namespace and class members alphabetically by member +# name. If set to NO the members will appear in declaration order. +# The default value is: NO. + +SORT_BRIEF_DOCS = NO + +# If the SORT_MEMBERS_CTORS_1ST tag is set to YES then doxygen will sort the +# (brief and detailed) documentation of class members so that constructors and +# destructors are listed first. If set to NO the constructors will appear in the +# respective orders defined by SORT_BRIEF_DOCS and SORT_MEMBER_DOCS. +# Note: If SORT_BRIEF_DOCS is set to NO this option is ignored for sorting brief +# member documentation. +# Note: If SORT_MEMBER_DOCS is set to NO this option is ignored for sorting +# detailed member documentation. +# The default value is: NO. + +SORT_MEMBERS_CTORS_1ST = NO + +# If the SORT_GROUP_NAMES tag is set to YES then doxygen will sort the hierarchy +# of group names into alphabetical order. If set to NO the group names will +# appear in their defined order. +# The default value is: NO. + +SORT_GROUP_NAMES = NO + +# If the SORT_BY_SCOPE_NAME tag is set to YES, the class list will be sorted by +# fully-qualified names, including namespaces. If set to NO, the class list will +# be sorted only by class name, not including the namespace part. +# Note: This option is not very useful if HIDE_SCOPE_NAMES is set to YES. +# Note: This option applies only to the class list, not to the alphabetical +# list. +# The default value is: NO. + +SORT_BY_SCOPE_NAME = NO + +# If the STRICT_PROTO_MATCHING option is enabled and doxygen fails to do proper +# type resolution of all parameters of a function it will reject a match between +# the prototype and the implementation of a member function even if there is +# only one candidate or it is obvious which candidate to choose by doing a +# simple string match. By disabling STRICT_PROTO_MATCHING doxygen will still +# accept a match between prototype and implementation in such cases. +# The default value is: NO. + +STRICT_PROTO_MATCHING = NO + +# The GENERATE_TODOLIST tag can be used to enable ( YES) or disable ( NO) the +# todo list. This list is created by putting \todo commands in the +# documentation. +# The default value is: YES. GENERATE_TODOLIST = YES -# The GENERATE_TESTLIST tag can be used to enable (YES) or -# disable (NO) the test list. This list is created by putting \test -# commands in the documentation. +# The GENERATE_TESTLIST tag can be used to enable ( YES) or disable ( NO) the +# test list. This list is created by putting \test commands in the +# documentation. +# The default value is: YES. GENERATE_TESTLIST = YES -# The GENERATE_BUGLIST tag can be used to enable (YES) or -# disable (NO) the bug list. This list is created by putting \bug -# commands in the documentation. +# The GENERATE_BUGLIST tag can be used to enable ( YES) or disable ( NO) the bug +# list. This list is created by putting \bug commands in the documentation. +# The default value is: YES. GENERATE_BUGLIST = YES -# The GENERATE_DEPRECATEDLIST tag can be used to enable (YES) or -# disable (NO) the deprecated list. This list is created by putting -# \deprecated commands in the documentation. +# The GENERATE_DEPRECATEDLIST tag can be used to enable ( YES) or disable ( NO) +# the deprecated list. This list is created by putting \deprecated commands in +# the documentation. +# The default value is: YES. GENERATE_DEPRECATEDLIST= YES -# The ENABLED_SECTIONS tag can be used to enable conditional -# documentation sections, marked by \if sectionname ... \endif. - -ENABLED_SECTIONS = - -# The MAX_INITIALIZER_LINES tag determines the maximum number of lines -# the initial value of a variable or define consists of for it to appear in -# the documentation. If the initializer consists of more lines than specified -# here it will be hidden. Use a value of 0 to hide initializers completely. -# The appearance of the initializer of individual variables and defines in the -# documentation can be controlled using \showinitializer or \hideinitializer -# command in the documentation regardless of this setting. +# The ENABLED_SECTIONS tag can be used to enable conditional documentation +# sections, marked by \if ... \endif and \cond +# ... \endcond blocks. + +ENABLED_SECTIONS = + +# The MAX_INITIALIZER_LINES tag determines the maximum number of lines that the +# initial value of a variable or macro / define can have for it to appear in the +# documentation. If the initializer consists of more lines than specified here +# it will be hidden. Use a value of 0 to hide initializers completely. The +# appearance of the value of individual variables and macros / defines can be +# controlled using \showinitializer or \hideinitializer command in the +# documentation regardless of this setting. +# Minimum value: 0, maximum value: 10000, default value: 30. MAX_INITIALIZER_LINES = 30 -# Set the SHOW_USED_FILES tag to NO to disable the list of files generated -# at the bottom of the documentation of classes and structs. If set to YES the -# list will mention the files that were used to generate the documentation. +# Set the SHOW_USED_FILES tag to NO to disable the list of files generated at +# the bottom of the documentation of classes and structs. If set to YES the list +# will mention the files that were used to generate the documentation. +# The default value is: YES. SHOW_USED_FILES = YES + +# Set the SHOW_FILES tag to NO to disable the generation of the Files page. This +# will remove the Files entry from the Quick Index and from the Folder Tree View +# (if specified). +# The default value is: YES. + +SHOW_FILES = YES + +# Set the SHOW_NAMESPACES tag to NO to disable the generation of the Namespaces +# page. This will remove the Namespaces entry from the Quick Index and from the +# Folder Tree View (if specified). +# The default value is: YES. + +SHOW_NAMESPACES = YES + +# The FILE_VERSION_FILTER tag can be used to specify a program or script that +# doxygen should invoke to get the current version for each file (typically from +# the version control system). Doxygen will invoke the program by executing (via +# popen()) the command command input-file, where command is the value of the +# FILE_VERSION_FILTER tag, and input-file is the name of an input file provided +# by doxygen. Whatever the program writes to standard output is used as the file +# version. For an example see the documentation. + +FILE_VERSION_FILTER = + +# The LAYOUT_FILE tag can be used to specify a layout file which will be parsed +# by doxygen. The layout file controls the global structure of the generated +# output files in an output format independent way. To create the layout file +# that represents doxygen's defaults, run doxygen with the -l option. You can +# optionally specify a file name after the option, if omitted DoxygenLayout.xml +# will be used as the name of the layout file. +# +# Note that if you run doxygen from a directory containing a file called +# DoxygenLayout.xml, doxygen will parse it automatically even if the LAYOUT_FILE +# tag is left empty. + +LAYOUT_FILE = + +# The CITE_BIB_FILES tag can be used to specify one or more bib files containing +# the reference definitions. This must be a list of .bib files. The .bib +# extension is automatically appended if omitted. This requires the bibtex tool +# to be installed. See also http://en.wikipedia.org/wiki/BibTeX for more info. +# For LaTeX the style of the bibliography can be controlled using +# LATEX_BIB_STYLE. To use this feature you need bibtex and perl available in the +# search path. Do not use file names with spaces, bibtex cannot handle them. See +# also \cite for info how to create references. + +CITE_BIB_FILES = #--------------------------------------------------------------------------- -# configuration options related to warning and progress messages +# Configuration options related to warning and progress messages #--------------------------------------------------------------------------- -# The QUIET tag can be used to turn on/off the messages that are generated -# by doxygen. Possible values are YES and NO. If left blank NO is used. +# The QUIET tag can be used to turn on/off the messages that are generated to +# standard output by doxygen. If QUIET is set to YES this implies that the +# messages are off. +# The default value is: NO. QUIET = NO -# The WARNINGS tag can be used to turn on/off the warning messages that are -# generated by doxygen. Possible values are YES and NO. If left blank -# NO is used. +# The WARNINGS tag can be used to turn on/off the warning messages that are +# generated to standard error ( stderr) by doxygen. If WARNINGS is set to YES +# this implies that the warnings are on. +# +# Tip: Turn warnings on while writing the documentation. +# The default value is: YES. WARNINGS = YES -# If WARN_IF_UNDOCUMENTED is set to YES, then doxygen will generate warnings -# for undocumented members. If EXTRACT_ALL is set to YES then this flag will -# automatically be disabled. +# If the WARN_IF_UNDOCUMENTED tag is set to YES, then doxygen will generate +# warnings for undocumented members. If EXTRACT_ALL is set to YES then this flag +# will automatically be disabled. +# The default value is: YES. WARN_IF_UNDOCUMENTED = YES -# The WARN_FORMAT tag determines the format of the warning messages that -# doxygen can produce. The string should contain the $file, $line, and $text -# tags, which will be replaced by the file and line number from which the -# warning originated and the warning text. +# If the WARN_IF_DOC_ERROR tag is set to YES, doxygen will generate warnings for +# potential errors in the documentation, such as not documenting some parameters +# in a documented function, or documenting parameters that don't exist or using +# markup commands wrongly. +# The default value is: YES. + +WARN_IF_DOC_ERROR = YES + +# This WARN_NO_PARAMDOC option can be enabled to get warnings for functions that +# are documented, but have no documentation for their parameters or return +# value. If set to NO doxygen will only warn about wrong or incomplete parameter +# documentation, but not about the absence of documentation. +# The default value is: NO. + +WARN_NO_PARAMDOC = NO + +# The WARN_FORMAT tag determines the format of the warning messages that doxygen +# can produce. The string should contain the $file, $line, and $text tags, which +# will be replaced by the file and line number from which the warning originated +# and the warning text. Optionally the format may contain $version, which will +# be replaced by the version of the file (if it could be obtained via +# FILE_VERSION_FILTER) +# The default value is: $file:$line: $text. WARN_FORMAT = "$file:$line: $text" -# The WARN_LOGFILE tag can be used to specify a file to which warning -# and error messages should be written. If left blank the output is written -# to stderr. - -WARN_LOGFILE = - -#--------------------------------------------------------------------------- -# configuration options related to the input files -#--------------------------------------------------------------------------- - -# The INPUT tag can be used to specify the files and/or directories that contain -# documented source files. You may enter file names like "myfile.cpp" or -# directories like "/usr/src/myproject". Separate the files or directories -# with spaces. - -INPUT = - -# If the value of the INPUT tag contains directories, you can use the -# FILE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp -# and *.h) to filter out the source-files in the directories. If left -# blank the following patterns are tested: -# *.c *.cc *.cxx *.cpp *.c++ *.java *.ii *.ixx *.ipp *.i++ *.inl *.h *.hh *.hxx *.hpp -# *.h++ *.idl *.odl *.cs *.php *.php3 *.inc *.m *.mm - -FILE_PATTERNS = - -# The RECURSIVE tag can be used to turn specify whether or not subdirectories -# should be searched for input files as well. Possible values are YES and NO. -# If left blank NO is used. +# The WARN_LOGFILE tag can be used to specify a file to which warning and error +# messages should be written. If left blank the output is written to standard +# error (stderr). + +WARN_LOGFILE = + +#--------------------------------------------------------------------------- +# Configuration options related to the input files +#--------------------------------------------------------------------------- + +# The INPUT tag is used to specify the files and/or directories that contain +# documented source files. You may enter file names like myfile.cpp or +# directories like /usr/src/myproject. Separate the files or directories with +# spaces. +# Note: If this tag is empty the current directory is searched. + +INPUT = + +# This tag can be used to specify the character encoding of the source files +# that doxygen parses. Internally doxygen uses the UTF-8 encoding. Doxygen uses +# libiconv (or the iconv built into libc) for the transcoding. See the libiconv +# documentation (see: http://www.gnu.org/software/libiconv) for the list of +# possible encodings. +# The default value is: UTF-8. + +INPUT_ENCODING = UTF-8 + +# If the value of the INPUT tag contains directories, you can use the +# FILE_PATTERNS tag to specify one or more wildcard patterns (like *.cpp and +# *.h) to filter out the source-files in the directories. If left blank the +# following patterns are tested:*.c, *.cc, *.cxx, *.cpp, *.c++, *.java, *.ii, +# *.ixx, *.ipp, *.i++, *.inl, *.idl, *.ddl, *.odl, *.h, *.hh, *.hxx, *.hpp, +# *.h++, *.cs, *.d, *.php, *.php4, *.php5, *.phtml, *.inc, *.m, *.markdown, +# *.md, *.mm, *.dox, *.py, *.f90, *.f, *.for, *.tcl, *.vhd, *.vhdl, *.ucf, +# *.qsf, *.as and *.js. + +FILE_PATTERNS = + +# The RECURSIVE tag can be used to specify whether or not subdirectories should +# be searched for input files as well. +# The default value is: NO. RECURSIVE = NO -# The EXCLUDE tag can be used to specify files and/or directories that should -# excluded from the INPUT source files. This way you can easily exclude a +# The EXCLUDE tag can be used to specify files and/or directories that should be +# excluded from the INPUT source files. This way you can easily exclude a # subdirectory from a directory tree whose root is specified with the INPUT tag. +# +# Note that relative paths are relative to the directory from which doxygen is +# run. -EXCLUDE = custom.h \ - custom-macros.h +EXCLUDE = querydef.h \ + ssqls.h \ + ssqls2.cpp \ + ssqls2.h -# The EXCLUDE_SYMLINKS tag can be used select whether or not files or directories -# that are symbolic links (a Unix filesystem feature) are excluded from the input. +# The EXCLUDE_SYMLINKS tag can be used to select whether or not files or +# directories that are symbolic links (a Unix file system feature) are excluded +# from the input. +# The default value is: NO. EXCLUDE_SYMLINKS = NO -# If the value of the INPUT tag contains directories, you can use the -# EXCLUDE_PATTERNS tag to specify one or more wildcard patterns to exclude +# If the value of the INPUT tag contains directories, you can use the +# EXCLUDE_PATTERNS tag to specify one or more wildcard patterns to exclude # certain files from those directories. - -EXCLUDE_PATTERNS = - -# The EXAMPLE_PATH tag can be used to specify one or more files or -# directories that contain example code fragments that are included (see -# the \include command). - -EXAMPLE_PATH = - -# If the value of the EXAMPLE_PATH tag contains directories, you can use the -# EXAMPLE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp -# and *.h) to filter out the source-files in the directories. If left -# blank all files are included. - -EXAMPLE_PATTERNS = - -# If the EXAMPLE_RECURSIVE tag is set to YES then subdirectories will be -# searched for input files to be used with the \include or \dontinclude -# commands irrespective of the value of the RECURSIVE tag. -# Possible values are YES and NO. If left blank NO is used. +# +# Note that the wildcards are matched against the file with absolute path, so to +# exclude all test directories for example use the pattern */test/* + +EXCLUDE_PATTERNS = + +# The EXCLUDE_SYMBOLS tag can be used to specify one or more symbol names +# (namespaces, classes, functions, etc.) that should be excluded from the +# output. The symbol name can be a fully qualified name, a word, or if the +# wildcard * is used, a substring. Examples: ANamespace, AClass, +# AClass::ANamespace, ANamespace::*Test +# +# Note that the wildcards are matched against the file with absolute path, so to +# exclude all test directories use the pattern */test/* + +EXCLUDE_SYMBOLS = + +# The EXAMPLE_PATH tag can be used to specify one or more files or directories +# that contain example code fragments that are included (see the \include +# command). + +EXAMPLE_PATH = + +# If the value of the EXAMPLE_PATH tag contains directories, you can use the +# EXAMPLE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp and +# *.h) to filter out the source-files in the directories. If left blank all +# files are included. + +EXAMPLE_PATTERNS = + +# If the EXAMPLE_RECURSIVE tag is set to YES then subdirectories will be +# searched for input files to be used with the \include or \dontinclude commands +# irrespective of the value of the RECURSIVE tag. +# The default value is: NO. EXAMPLE_RECURSIVE = NO -# The IMAGE_PATH tag can be used to specify one or more files or -# directories that contain image that are included in the documentation (see -# the \image command). - -IMAGE_PATH = - -# The INPUT_FILTER tag can be used to specify a program that doxygen should -# invoke to filter for each input file. Doxygen will invoke the filter program -# by executing (via popen()) the command , where -# is the value of the INPUT_FILTER tag, and is the name of an -# input file. Doxygen will then use the output that the filter program writes -# to standard output. If FILTER_PATTERNS is specified, this tag will be -# ignored. - -INPUT_FILTER = - -# If the FILTER_SOURCE_FILES tag is set to YES, the input filter (if set using -# INPUT_FILTER) will be used to filter the input files when producing source -# files to browse (i.e. when SOURCE_BROWSER is set to YES). +# The IMAGE_PATH tag can be used to specify one or more files or directories +# that contain images that are to be included in the documentation (see the +# \image command). + +IMAGE_PATH = + +# The INPUT_FILTER tag can be used to specify a program that doxygen should +# invoke to filter for each input file. Doxygen will invoke the filter program +# by executing (via popen()) the command: +# +# +# +# where is the value of the INPUT_FILTER tag, and is the +# name of an input file. Doxygen will then use the output that the filter +# program writes to standard output. If FILTER_PATTERNS is specified, this tag +# will be ignored. +# +# Note that the filter must not add or remove lines; it is applied before the +# code is scanned, but not when the output code is generated. If lines are added +# or removed, the anchors will not be placed correctly. + +INPUT_FILTER = + +# The FILTER_PATTERNS tag can be used to specify filters on a per file pattern +# basis. Doxygen will compare the file name with each pattern and apply the +# filter if there is a match. The filters are a list of the form: pattern=filter +# (like *.cpp=my_cpp_filter). See INPUT_FILTER for further information on how +# filters are used. If the FILTER_PATTERNS tag is empty or if none of the +# patterns match the file name, INPUT_FILTER is applied. + +FILTER_PATTERNS = + +# If the FILTER_SOURCE_FILES tag is set to YES, the input filter (if set using +# INPUT_FILTER ) will also be used to filter the input files that are used for +# producing the source files to browse (i.e. when SOURCE_BROWSER is set to YES). +# The default value is: NO. FILTER_SOURCE_FILES = NO + +# The FILTER_SOURCE_PATTERNS tag can be used to specify source filters per file +# pattern. A pattern will override the setting for FILTER_PATTERN (if any) and +# it is also possible to disable source filtering for a specific pattern using +# *.ext= (so without naming a filter). +# This tag requires that the tag FILTER_SOURCE_FILES is set to YES. + +FILTER_SOURCE_PATTERNS = + +# If the USE_MDFILE_AS_MAINPAGE tag refers to the name of a markdown file that +# is part of the input, its contents will be placed on the main page +# (index.html). This can be useful if you have a project on for instance GitHub +# and want to reuse the introduction page also for the doxygen output. + +USE_MDFILE_AS_MAINPAGE = #--------------------------------------------------------------------------- -# configuration options related to source browsing +# Configuration options related to source browsing #--------------------------------------------------------------------------- -# If the SOURCE_BROWSER tag is set to YES then a list of source files will -# be generated. Documented entities will be cross-referenced with these sources. -# Note: To get rid of all source code in the generated output, make sure also -# VERBATIM_HEADERS is set to NO. +# If the SOURCE_BROWSER tag is set to YES then a list of source files will be +# generated. Documented entities will be cross-referenced with these sources. +# +# Note: To get rid of all source code in the generated output, make sure that +# also VERBATIM_HEADERS is set to NO. +# The default value is: NO. SOURCE_BROWSER = NO -# Setting the INLINE_SOURCES tag to YES will include the body -# of functions and classes directly in the documentation. +# Setting the INLINE_SOURCES tag to YES will include the body of functions, +# classes and enums directly into the documentation. +# The default value is: NO. INLINE_SOURCES = NO -# Setting the STRIP_CODE_COMMENTS tag to YES (the default) will instruct -# doxygen to hide any special comment blocks from generated source code -# fragments. Normal C and C++ comments will always remain visible. +# Setting the STRIP_CODE_COMMENTS tag to YES will instruct doxygen to hide any +# special comment blocks from generated source code fragments. Normal C, C++ and +# Fortran comments will always remain visible. +# The default value is: YES. STRIP_CODE_COMMENTS = YES -# If the REFERENCED_BY_RELATION tag is set to YES (the default) -# then for each documented function all documented -# functions referencing it will be listed. +# If the REFERENCED_BY_RELATION tag is set to YES then for each documented +# function all documented functions referencing it will be listed. +# The default value is: NO. REFERENCED_BY_RELATION = YES -# If the REFERENCES_RELATION tag is set to YES (the default) -# then for each documented function all documented entities -# called/used by that function will be listed. +# If the REFERENCES_RELATION tag is set to YES then for each documented function +# all documented entities called/used by that function will be listed. +# The default value is: NO. REFERENCES_RELATION = YES -# If the VERBATIM_HEADERS tag is set to YES (the default) then Doxygen -# will generate a verbatim copy of the header file for each class for -# which an include is specified. Set to NO to disable this. +# If the REFERENCES_LINK_SOURCE tag is set to YES and SOURCE_BROWSER tag is set +# to YES, then the hyperlinks from functions in REFERENCES_RELATION and +# REFERENCED_BY_RELATION lists will link to the source code. Otherwise they will +# link to the documentation. +# The default value is: YES. + +REFERENCES_LINK_SOURCE = YES + +# If SOURCE_TOOLTIPS is enabled (the default) then hovering a hyperlink in the +# source code will show a tooltip with additional information such as prototype, +# brief description and links to the definition and documentation. Since this +# will make the HTML file larger and loading of large files a bit slower, you +# can opt to disable this feature. +# The default value is: YES. +# This tag requires that the tag SOURCE_BROWSER is set to YES. + +SOURCE_TOOLTIPS = YES + +# If the USE_HTAGS tag is set to YES then the references to source code will +# point to the HTML generated by the htags(1) tool instead of doxygen built-in +# source browser. The htags tool is part of GNU's global source tagging system +# (see http://www.gnu.org/software/global/global.html). You will need version +# 4.8.6 or higher. +# +# To use it do the following: +# - Install the latest version of global +# - Enable SOURCE_BROWSER and USE_HTAGS in the config file +# - Make sure the INPUT points to the root of the source tree +# - Run doxygen as normal +# +# Doxygen will invoke htags (and that will in turn invoke gtags), so these +# tools must be available from the command line (i.e. in the search path). +# +# The result: instead of the source browser generated by doxygen, the links to +# source code will now point to the output of htags. +# The default value is: NO. +# This tag requires that the tag SOURCE_BROWSER is set to YES. + +USE_HTAGS = NO + +# If the VERBATIM_HEADERS tag is set the YES then doxygen will generate a +# verbatim copy of the header file for each class for which an include is +# specified. Set to NO to disable this. +# See also: Section \class. +# The default value is: YES. VERBATIM_HEADERS = YES #--------------------------------------------------------------------------- -# configuration options related to the alphabetical class index +# Configuration options related to the alphabetical class index #--------------------------------------------------------------------------- -# If the ALPHABETICAL_INDEX tag is set to YES, an alphabetical index -# of all compounds will be generated. Enable this if the project -# contains a lot of classes, structs, unions or interfaces. +# If the ALPHABETICAL_INDEX tag is set to YES, an alphabetical index of all +# compounds will be generated. Enable this if the project contains a lot of +# classes, structs, unions or interfaces. +# The default value is: YES. ALPHABETICAL_INDEX = NO -# If the alphabetical index is enabled (see ALPHABETICAL_INDEX) then -# the COLS_IN_ALPHA_INDEX tag can be used to specify the number of columns -# in which this list will be split (can be a number in the range [1..20]) +# The COLS_IN_ALPHA_INDEX tag can be used to specify the number of columns in +# which the alphabetical index list will be split. +# Minimum value: 1, maximum value: 20, default value: 5. +# This tag requires that the tag ALPHABETICAL_INDEX is set to YES. COLS_IN_ALPHA_INDEX = 5 -# In case all classes in a project start with a common prefix, all -# classes will be put under the same header in the alphabetical index. -# The IGNORE_PREFIX tag can be used to specify one or more prefixes that -# should be ignored while generating the index headers. +# In case all classes in a project start with a common prefix, all classes will +# be put under the same header in the alphabetical index. The IGNORE_PREFIX tag +# can be used to specify a prefix (or a list of prefixes) that should be ignored +# while generating the index headers. +# This tag requires that the tag ALPHABETICAL_INDEX is set to YES. -IGNORE_PREFIX = +IGNORE_PREFIX = #--------------------------------------------------------------------------- -# configuration options related to the HTML output +# Configuration options related to the HTML output #--------------------------------------------------------------------------- -# If the GENERATE_HTML tag is set to YES (the default) Doxygen will -# generate HTML output. +# If the GENERATE_HTML tag is set to YES doxygen will generate HTML output +# The default value is: YES. GENERATE_HTML = YES -# The HTML_OUTPUT tag is used to specify where the HTML docs will be put. -# If a relative path is entered the value of OUTPUT_DIRECTORY will be -# put in front of it. If left blank `html' will be used as the default path. - -HTML_OUTPUT = html - -# The HTML_FILE_EXTENSION tag can be used to specify the file extension for -# each generated HTML page (for example: .htm,.php,.asp). If it is left blank -# doxygen will generate files with .html extension. +# The HTML_OUTPUT tag is used to specify where the HTML docs will be put. If a +# relative path is entered the value of OUTPUT_DIRECTORY will be put in front of +# it. +# The default directory is: html. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_OUTPUT = html/refman + +# The HTML_FILE_EXTENSION tag can be used to specify the file extension for each +# generated HTML page (for example: .htm, .php, .asp). +# The default value is: .html. +# This tag requires that the tag GENERATE_HTML is set to YES. HTML_FILE_EXTENSION = .html -# The HTML_HEADER tag can be used to specify a personal HTML header for -# each generated HTML page. If it is left blank doxygen will generate a +# The HTML_HEADER tag can be used to specify a user-defined HTML header file for +# each generated HTML page. If the tag is left blank doxygen will generate a # standard header. - -HTML_HEADER = ../doc/refman/html/_header.html - -# The HTML_FOOTER tag can be used to specify a personal HTML footer for -# each generated HTML page. If it is left blank doxygen will generate a -# standard footer. - -HTML_FOOTER = - -# The HTML_STYLESHEET tag can be used to specify a user-defined cascading -# style sheet that is used by each HTML page. It can be used to -# fine-tune the look of the HTML output. If the tag is left blank doxygen -# will generate a default style sheet. Note that doxygen will try to copy -# the style sheet file to the HTML output directory, so don't put your own -# stylesheet in the HTML output directory as well, or it will be erased! - -HTML_STYLESHEET = - -# If the HTML_ALIGN_MEMBERS tag is set to YES, the members of classes, -# files or namespaces will be aligned in HTML using tables. If set to -# NO a bullet list will be used. - -HTML_ALIGN_MEMBERS = YES - -# If the GENERATE_HTMLHELP tag is set to YES, additional index files -# will be generated that can be used as input for tools like the -# Microsoft HTML help workshop to generate a compressed HTML help file (.chm) -# of the generated HTML documentation. +# +# To get valid HTML the header file that includes any scripts and style sheets +# that doxygen needs, which is dependent on the configuration options used (e.g. +# the setting GENERATE_TREEVIEW). It is highly recommended to start with a +# default header using +# doxygen -w html new_header.html new_footer.html new_stylesheet.css +# YourConfigFile +# and then modify the file new_header.html. See also section "Doxygen usage" +# for information on how to generate the default header that doxygen normally +# uses. +# Note: The header is subject to change so you typically have to regenerate the +# default header when upgrading to a newer version of doxygen. For a description +# of the possible markers and block names see the documentation. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_HEADER = ../doc/html/refman/_header.html + +# The HTML_FOOTER tag can be used to specify a user-defined HTML footer for each +# generated HTML page. If the tag is left blank doxygen will generate a standard +# footer. See HTML_HEADER for more information on how to generate a default +# footer and what special commands can be used inside the footer. See also +# section "Doxygen usage" for information on how to generate the default footer +# that doxygen normally uses. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_FOOTER = + +# The HTML_STYLESHEET tag can be used to specify a user-defined cascading style +# sheet that is used by each HTML page. It can be used to fine-tune the look of +# the HTML output. If left blank doxygen will generate a default style sheet. +# See also section "Doxygen usage" for information on how to generate the style +# sheet that doxygen normally uses. +# Note: It is recommended to use HTML_EXTRA_STYLESHEET instead of this tag, as +# it is more robust and this tag (HTML_STYLESHEET) will in the future become +# obsolete. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_STYLESHEET = + +# The HTML_EXTRA_STYLESHEET tag can be used to specify an additional user- +# defined cascading style sheet that is included after the standard style sheets +# created by doxygen. Using this option one can overrule certain style aspects. +# This is preferred over using HTML_STYLESHEET since it does not replace the +# standard style sheet and is therefor more robust against future updates. +# Doxygen will copy the style sheet file to the output directory. For an example +# see the documentation. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_EXTRA_STYLESHEET = + +# The HTML_EXTRA_FILES tag can be used to specify one or more extra images or +# other source files which should be copied to the HTML output directory. Note +# that these files will be copied to the base HTML output directory. Use the +# $relpath^ marker in the HTML_HEADER and/or HTML_FOOTER files to load these +# files. In the HTML_STYLESHEET file, use the file name only. Also note that the +# files will be copied as-is; there are no commands or markers available. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_EXTRA_FILES = + +# The HTML_COLORSTYLE_HUE tag controls the color of the HTML output. Doxygen +# will adjust the colors in the stylesheet and background images according to +# this color. Hue is specified as an angle on a colorwheel, see +# http://en.wikipedia.org/wiki/Hue for more information. For instance the value +# 0 represents red, 60 is yellow, 120 is green, 180 is cyan, 240 is blue, 300 +# purple, and 360 is red again. +# Minimum value: 0, maximum value: 359, default value: 220. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_COLORSTYLE_HUE = 220 + +# The HTML_COLORSTYLE_SAT tag controls the purity (or saturation) of the colors +# in the HTML output. For a value of 0 the output will use grayscales only. A +# value of 255 will produce the most vivid colors. +# Minimum value: 0, maximum value: 255, default value: 100. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_COLORSTYLE_SAT = 100 + +# The HTML_COLORSTYLE_GAMMA tag controls the gamma correction applied to the +# luminance component of the colors in the HTML output. Values below 100 +# gradually make the output lighter, whereas values above 100 make the output +# darker. The value divided by 100 is the actual gamma applied, so 80 represents +# a gamma of 0.8, The value 220 represents a gamma of 2.2, and 100 does not +# change the gamma. +# Minimum value: 40, maximum value: 240, default value: 80. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_COLORSTYLE_GAMMA = 80 + +# If the HTML_TIMESTAMP tag is set to YES then the footer of each generated HTML +# page will contain the date and time when the page was generated. Setting this +# to NO can help when comparing the output of multiple runs. +# The default value is: YES. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_TIMESTAMP = YES + +# If the HTML_DYNAMIC_SECTIONS tag is set to YES then the generated HTML +# documentation will contain sections that can be hidden and shown after the +# page has loaded. +# The default value is: NO. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_DYNAMIC_SECTIONS = NO + +# With HTML_INDEX_NUM_ENTRIES one can control the preferred number of entries +# shown in the various tree structured indices initially; the user can expand +# and collapse entries dynamically later on. Doxygen will expand the tree to +# such a level that at most the specified number of entries are visible (unless +# a fully collapsed tree already exceeds this amount). So setting the number of +# entries 1 will produce a full collapsed tree by default. 0 is a special value +# representing an infinite number of entries and will result in a full expanded +# tree by default. +# Minimum value: 0, maximum value: 9999, default value: 100. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_INDEX_NUM_ENTRIES = 100 + +# If the GENERATE_DOCSET tag is set to YES, additional index files will be +# generated that can be used as input for Apple's Xcode 3 integrated development +# environment (see: http://developer.apple.com/tools/xcode/), introduced with +# OSX 10.5 (Leopard). To create a documentation set, doxygen will generate a +# Makefile in the HTML output directory. Running make will produce the docset in +# that directory and running make install will install the docset in +# ~/Library/Developer/Shared/Documentation/DocSets so that Xcode will find it at +# startup. See http://developer.apple.com/tools/creatingdocsetswithdoxygen.html +# for more information. +# The default value is: NO. +# This tag requires that the tag GENERATE_HTML is set to YES. + +GENERATE_DOCSET = NO + +# This tag determines the name of the docset feed. A documentation feed provides +# an umbrella under which multiple documentation sets from a single provider +# (such as a company or product suite) can be grouped. +# The default value is: Doxygen generated docs. +# This tag requires that the tag GENERATE_DOCSET is set to YES. + +DOCSET_FEEDNAME = "Doxygen generated docs" + +# This tag specifies a string that should uniquely identify the documentation +# set bundle. This should be a reverse domain-name style string, e.g. +# com.mycompany.MyDocSet. Doxygen will append .docset to the name. +# The default value is: org.doxygen.Project. +# This tag requires that the tag GENERATE_DOCSET is set to YES. + +DOCSET_BUNDLE_ID = org.doxygen.Project + +# The DOCSET_PUBLISHER_ID tag specifies a string that should uniquely identify +# the documentation publisher. This should be a reverse domain-name style +# string, e.g. com.mycompany.MyDocSet.documentation. +# The default value is: org.doxygen.Publisher. +# This tag requires that the tag GENERATE_DOCSET is set to YES. + +DOCSET_PUBLISHER_ID = org.doxygen.Publisher + +# The DOCSET_PUBLISHER_NAME tag identifies the documentation publisher. +# The default value is: Publisher. +# This tag requires that the tag GENERATE_DOCSET is set to YES. + +DOCSET_PUBLISHER_NAME = Publisher + +# If the GENERATE_HTMLHELP tag is set to YES then doxygen generates three +# additional HTML index files: index.hhp, index.hhc, and index.hhk. The +# index.hhp is a project file that can be read by Microsoft's HTML Help Workshop +# (see: http://www.microsoft.com/en-us/download/details.aspx?id=21138) on +# Windows. +# +# The HTML Help Workshop contains a compiler that can convert all HTML output +# generated by doxygen into a single compiled HTML file (.chm). Compiled HTML +# files are now used as the Windows 98 help format, and will replace the old +# Windows help format (.hlp) on all Windows platforms in the future. Compressed +# HTML files also contain an index, a table of contents, and you can search for +# words in the documentation. The HTML workshop also contains a viewer for +# compressed HTML files. +# The default value is: NO. +# This tag requires that the tag GENERATE_HTML is set to YES. GENERATE_HTMLHELP = NO -# If the GENERATE_HTMLHELP tag is set to YES, the CHM_FILE tag can -# be used to specify the file name of the resulting .chm file. You -# can add a path in front of the file if the result should not be +# The CHM_FILE tag can be used to specify the file name of the resulting .chm +# file. You can add a path in front of the file if the result should not be # written to the html output directory. - -CHM_FILE = - -# If the GENERATE_HTMLHELP tag is set to YES, the HHC_LOCATION tag can -# be used to specify the location (absolute path including file name) of -# the HTML help compiler (hhc.exe). If non-empty doxygen will try to run -# the HTML help compiler on the generated index.hhp. - -HHC_LOCATION = - -# If the GENERATE_HTMLHELP tag is set to YES, the GENERATE_CHI flag -# controls if a separate .chi index file is generated (YES) or that -# it should be included in the master .chm file (NO). +# This tag requires that the tag GENERATE_HTMLHELP is set to YES. + +CHM_FILE = + +# The HHC_LOCATION tag can be used to specify the location (absolute path +# including file name) of the HTML help compiler ( hhc.exe). If non-empty +# doxygen will try to run the HTML help compiler on the generated index.hhp. +# The file has to be specified with full path. +# This tag requires that the tag GENERATE_HTMLHELP is set to YES. + +HHC_LOCATION = + +# The GENERATE_CHI flag controls if a separate .chi index file is generated ( +# YES) or that it should be included in the master .chm file ( NO). +# The default value is: NO. +# This tag requires that the tag GENERATE_HTMLHELP is set to YES. GENERATE_CHI = NO -# If the GENERATE_HTMLHELP tag is set to YES, the BINARY_TOC flag -# controls whether a binary table of contents is generated (YES) or a -# normal table of contents (NO) in the .chm file. +# The CHM_INDEX_ENCODING is used to encode HtmlHelp index ( hhk), content ( hhc) +# and project file content. +# This tag requires that the tag GENERATE_HTMLHELP is set to YES. + +CHM_INDEX_ENCODING = + +# The BINARY_TOC flag controls whether a binary table of contents is generated ( +# YES) or a normal table of contents ( NO) in the .chm file. +# The default value is: NO. +# This tag requires that the tag GENERATE_HTMLHELP is set to YES. BINARY_TOC = NO -# The TOC_EXPAND flag can be set to YES to add extra items for group members -# to the contents of the HTML help documentation and to the tree view. +# The TOC_EXPAND flag can be set to YES to add extra items for group members to +# the table of contents of the HTML help documentation and to the tree view. +# The default value is: NO. +# This tag requires that the tag GENERATE_HTMLHELP is set to YES. TOC_EXPAND = NO -# The DISABLE_INDEX tag can be used to turn on/off the condensed index at -# top of each HTML page. The value NO (the default) enables the index and -# the value YES disables it. +# If the GENERATE_QHP tag is set to YES and both QHP_NAMESPACE and +# QHP_VIRTUAL_FOLDER are set, an additional index file will be generated that +# can be used as input for Qt's qhelpgenerator to generate a Qt Compressed Help +# (.qch) of the generated HTML documentation. +# The default value is: NO. +# This tag requires that the tag GENERATE_HTML is set to YES. + +GENERATE_QHP = NO + +# If the QHG_LOCATION tag is specified, the QCH_FILE tag can be used to specify +# the file name of the resulting .qch file. The path specified is relative to +# the HTML output folder. +# This tag requires that the tag GENERATE_QHP is set to YES. + +QCH_FILE = + +# The QHP_NAMESPACE tag specifies the namespace to use when generating Qt Help +# Project output. For more information please see Qt Help Project / Namespace +# (see: http://qt-project.org/doc/qt-4.8/qthelpproject.html#namespace). +# The default value is: org.doxygen.Project. +# This tag requires that the tag GENERATE_QHP is set to YES. + +QHP_NAMESPACE = org.doxygen.Project + +# The QHP_VIRTUAL_FOLDER tag specifies the namespace to use when generating Qt +# Help Project output. For more information please see Qt Help Project / Virtual +# Folders (see: http://qt-project.org/doc/qt-4.8/qthelpproject.html#virtual- +# folders). +# The default value is: doc. +# This tag requires that the tag GENERATE_QHP is set to YES. + +QHP_VIRTUAL_FOLDER = doc + +# If the QHP_CUST_FILTER_NAME tag is set, it specifies the name of a custom +# filter to add. For more information please see Qt Help Project / Custom +# Filters (see: http://qt-project.org/doc/qt-4.8/qthelpproject.html#custom- +# filters). +# This tag requires that the tag GENERATE_QHP is set to YES. + +QHP_CUST_FILTER_NAME = + +# The QHP_CUST_FILTER_ATTRS tag specifies the list of the attributes of the +# custom filter to add. For more information please see Qt Help Project / Custom +# Filters (see: http://qt-project.org/doc/qt-4.8/qthelpproject.html#custom- +# filters). +# This tag requires that the tag GENERATE_QHP is set to YES. + +QHP_CUST_FILTER_ATTRS = + +# The QHP_SECT_FILTER_ATTRS tag specifies the list of the attributes this +# project's filter section matches. Qt Help Project / Filter Attributes (see: +# http://qt-project.org/doc/qt-4.8/qthelpproject.html#filter-attributes). +# This tag requires that the tag GENERATE_QHP is set to YES. + +QHP_SECT_FILTER_ATTRS = + +# The QHG_LOCATION tag can be used to specify the location of Qt's +# qhelpgenerator. If non-empty doxygen will try to run qhelpgenerator on the +# generated .qhp file. +# This tag requires that the tag GENERATE_QHP is set to YES. + +QHG_LOCATION = + +# If the GENERATE_ECLIPSEHELP tag is set to YES, additional index files will be +# generated, together with the HTML files, they form an Eclipse help plugin. To +# install this plugin and make it available under the help contents menu in +# Eclipse, the contents of the directory containing the HTML and XML files needs +# to be copied into the plugins directory of eclipse. The name of the directory +# within the plugins directory should be the same as the ECLIPSE_DOC_ID value. +# After copying Eclipse needs to be restarted before the help appears. +# The default value is: NO. +# This tag requires that the tag GENERATE_HTML is set to YES. + +GENERATE_ECLIPSEHELP = NO + +# A unique identifier for the Eclipse help plugin. When installing the plugin +# the directory name containing the HTML and XML files should also have this +# name. Each documentation set should have its own identifier. +# The default value is: org.doxygen.Project. +# This tag requires that the tag GENERATE_ECLIPSEHELP is set to YES. + +ECLIPSE_DOC_ID = org.doxygen.Project + +# If you want full control over the layout of the generated HTML pages it might +# be necessary to disable the index and replace it with your own. The +# DISABLE_INDEX tag can be used to turn on/off the condensed index (tabs) at top +# of each HTML page. A value of NO enables the index and the value YES disables +# it. Since the tabs in the index contain the same information as the navigation +# tree, you can set this option to YES if you also set GENERATE_TREEVIEW to YES. +# The default value is: NO. +# This tag requires that the tag GENERATE_HTML is set to YES. DISABLE_INDEX = NO -# This tag can be used to set the number of enum values (range [1..20]) -# that doxygen will group on one line in the generated HTML documentation. - -ENUM_VALUES_PER_LINE = 4 - -# If the GENERATE_TREEVIEW tag is set to YES, a side panel will be -# generated containing a tree-like index structure (just like the one that -# is generated for HTML Help). For this to work a browser that supports -# JavaScript, DHTML, CSS and frames is required (for instance Mozilla 1.0+, -# Netscape 6.0+, Internet explorer 5.0+, or Konqueror). Windows users are -# probably better off using the HTML help feature. +# The GENERATE_TREEVIEW tag is used to specify whether a tree-like index +# structure should be generated to display hierarchical information. If the tag +# value is set to YES, a side panel will be generated containing a tree-like +# index structure (just like the one that is generated for HTML Help). For this +# to work a browser that supports JavaScript, DHTML, CSS and frames is required +# (i.e. any modern browser). Windows users are probably better off using the +# HTML help feature. Via custom stylesheets (see HTML_EXTRA_STYLESHEET) one can +# further fine-tune the look of the index. As an example, the default style +# sheet generated by doxygen has an example that shows how to put an image at +# the root of the tree instead of the PROJECT_NAME. Since the tree basically has +# the same information as the tab index, you could consider setting +# DISABLE_INDEX to YES when enabling this option. +# The default value is: NO. +# This tag requires that the tag GENERATE_HTML is set to YES. GENERATE_TREEVIEW = NO -# If the treeview is enabled (see GENERATE_TREEVIEW) then this tag can be -# used to set the initial width (in pixels) of the frame in which the tree -# is shown. +# The ENUM_VALUES_PER_LINE tag can be used to set the number of enum values that +# doxygen will group on one line in the generated HTML documentation. +# +# Note that a value of 0 will completely suppress the enum values from appearing +# in the overview section. +# Minimum value: 0, maximum value: 20, default value: 4. +# This tag requires that the tag GENERATE_HTML is set to YES. + +ENUM_VALUES_PER_LINE = 4 + +# If the treeview is enabled (see GENERATE_TREEVIEW) then this tag can be used +# to set the initial width (in pixels) of the frame in which the tree is shown. +# Minimum value: 0, maximum value: 1500, default value: 250. +# This tag requires that the tag GENERATE_HTML is set to YES. TREEVIEW_WIDTH = 250 + +# When the EXT_LINKS_IN_WINDOW option is set to YES doxygen will open links to +# external symbols imported via tag files in a separate window. +# The default value is: NO. +# This tag requires that the tag GENERATE_HTML is set to YES. + +EXT_LINKS_IN_WINDOW = NO + +# Use this tag to change the font size of LaTeX formulas included as images in +# the HTML documentation. When you change the font size after a successful +# doxygen run you need to manually remove any form_*.png images from the HTML +# output directory to force them to be regenerated. +# Minimum value: 8, maximum value: 50, default value: 10. +# This tag requires that the tag GENERATE_HTML is set to YES. + +FORMULA_FONTSIZE = 10 + +# Use the FORMULA_TRANPARENT tag to determine whether or not the images +# generated for formulas are transparent PNGs. Transparent PNGs are not +# supported properly for IE 6.0, but are supported on all modern browsers. +# +# Note that when changing this option you need to delete any form_*.png files in +# the HTML output directory before the changes have effect. +# The default value is: YES. +# This tag requires that the tag GENERATE_HTML is set to YES. + +FORMULA_TRANSPARENT = YES + +# Enable the USE_MATHJAX option to render LaTeX formulas using MathJax (see +# http://www.mathjax.org) which uses client side Javascript for the rendering +# instead of using prerendered bitmaps. Use this if you do not have LaTeX +# installed or if you want to formulas look prettier in the HTML output. When +# enabled you may also need to install MathJax separately and configure the path +# to it using the MATHJAX_RELPATH option. +# The default value is: NO. +# This tag requires that the tag GENERATE_HTML is set to YES. + +USE_MATHJAX = NO + +# When MathJax is enabled you can set the default output format to be used for +# the MathJax output. See the MathJax site (see: +# http://docs.mathjax.org/en/latest/output.html) for more details. +# Possible values are: HTML-CSS (which is slower, but has the best +# compatibility), NativeMML (i.e. MathML) and SVG. +# The default value is: HTML-CSS. +# This tag requires that the tag USE_MATHJAX is set to YES. + +MATHJAX_FORMAT = HTML-CSS + +# When MathJax is enabled you need to specify the location relative to the HTML +# output directory using the MATHJAX_RELPATH option. The destination directory +# should contain the MathJax.js script. For instance, if the mathjax directory +# is located at the same level as the HTML output directory, then +# MATHJAX_RELPATH should be ../mathjax. The default value points to the MathJax +# Content Delivery Network so you can quickly see the result without installing +# MathJax. However, it is strongly recommended to install a local copy of +# MathJax from http://www.mathjax.org before deployment. +# The default value is: http://cdn.mathjax.org/mathjax/latest. +# This tag requires that the tag USE_MATHJAX is set to YES. + +MATHJAX_RELPATH = http://cdn.mathjax.org/mathjax/latest + +# The MATHJAX_EXTENSIONS tag can be used to specify one or more MathJax +# extension names that should be enabled during MathJax rendering. For example +# MATHJAX_EXTENSIONS = TeX/AMSmath TeX/AMSsymbols +# This tag requires that the tag USE_MATHJAX is set to YES. + +MATHJAX_EXTENSIONS = + +# The MATHJAX_CODEFILE tag can be used to specify a file with javascript pieces +# of code that will be used on startup of the MathJax code. See the MathJax site +# (see: http://docs.mathjax.org/en/latest/output.html) for more details. For an +# example see the documentation. +# This tag requires that the tag USE_MATHJAX is set to YES. + +MATHJAX_CODEFILE = + +# When the SEARCHENGINE tag is enabled doxygen will generate a search box for +# the HTML output. The underlying search engine uses javascript and DHTML and +# should work on any modern browser. Note that when using HTML help +# (GENERATE_HTMLHELP), Qt help (GENERATE_QHP), or docsets (GENERATE_DOCSET) +# there is already a search function so this one should typically be disabled. +# For large projects the javascript based search engine can be slow, then +# enabling SERVER_BASED_SEARCH may provide a better solution. It is possible to +# search using the keyboard; to jump to the search box use + S +# (what the is depends on the OS and browser, but it is typically +# , /chapter + /// on threads details two major strategies for dealing with + /// connections in the face of threads. The Connection-per-thread + /// option frees you from ever having to call this method. The + /// other documented strategy is to use ConnectionPool, which opens + /// the possibility for one thread to create a connection that + /// another uses, so you do need to call this method in that case, + /// or with any other similar strategy. + /// + /// \retval True if there was no problem + static bool thread_start(); protected: - /// \brief Drop the connection to the database server - /// - /// This method is protected because it should only be used within - /// the library. Unless you use the default constructor, this - /// object should always be connected. - MYSQLPP_EXPORT void disconnect(); - - /// \brief Returns true if the given option is to be set once - /// connection comes up. - /// - /// \param option option to check for in queue - /// \param arg argument to match against - bool option_pending(Option option, bool arg) const; - - /// \brief For each option in pending option queue, call - /// set_option() - /// - /// Called within connect() method after connection is established. - /// Despools options in the order given to set_option(). - void apply_pending_options(); - - /// \brief Generic wrapper for bad_option_*() - bool bad_option(Option option, OptionArgType type); - - /// \brief Handles call of incorrect set_option() overload - bool bad_option_type(Option option); - - /// \brief Handles bad option values sent to set_option() - bool bad_option_value(Option option); - - /// \brief Given option value, return its proper argument type - OptionArgType option_arg_type(Option option); - - /// \brief Set MySQL C API connection option - /// - /// Wraps \c mysql_options() in C API. This is an internal - /// implementation detail, to be used only by the public overloads - /// above. - bool set_option_impl(mysql_option moption, const void* arg = 0); - -#if MYSQL_VERSION_ID >= 40101 - /// \brief Set MySQL C API connection option - /// - /// Wraps \c mysql_set_server_option() in C API. This is an - /// internal implementation detail, to be used only by the public - /// overloads above. - bool set_option_impl(enum_mysql_set_option msoption); -#endif + /// \brief Build an error message in the standard form used whenever + /// one of the methods can't succeed because we're not connected to + /// the database server. + void build_error_message(const char* core); + + /// \brief Establish a new connection as a copy of an existing one + /// + /// \param other the connection to copy + void copy(const Connection& other); + + /// \brief Extract elements from the server parameter in formats + /// suitable for passing to DBDriver::connect(). + bool parse_ipc_method(const char* server, std::string& host, + unsigned int& port, std::string& socket_name); + + //// Subclass data + mutable std::string error_message_; ///< MySQL++ specific error, if any private: - friend class ResNSel; - friend class ResUse; - friend class Query; - - struct OptionInfo { - Option option; - OptionArgType arg_type; - std::string str_arg; - unsigned int int_arg; - bool bool_arg; - - OptionInfo(Option o) : - option(o), - arg_type(opt_type_none), - int_arg(0), - bool_arg(false) - { - } - - OptionInfo(Option o, const char* a) : - option(o), - arg_type(opt_type_string), - str_arg(a), - int_arg(0), - bool_arg(false) - { - } - - OptionInfo(Option o, unsigned int a) : - option(o), - arg_type(opt_type_integer), - int_arg(a), - bool_arg(false) - { - } - - OptionInfo(Option o, bool a) : - option(o), - arg_type(opt_type_boolean), - int_arg(0), - bool_arg(a) - { - } - }; - - MYSQL mysql_; - bool is_connected_; - bool connecting_; - bool success_; - std::deque pending_options_; - static OptionArgType legal_opt_arg_types_[]; + DBDriver* driver_; + bool copacetic_; }; } // end namespace mysqlpp -#endif +// Not strictly required, but bring in our specialization subclasses +#include "tcp_connection.h" +#include "uds_connection.h" +#include "wnp_connection.h" + +#endif // !defined(MYSQLPP_CONNECTION_H) DELETED lib/const_string.h Index: lib/const_string.h ================================================================== --- lib/const_string.h +++ /dev/null @@ -1,241 +0,0 @@ -/// \file const_string.h -/// \brief Declares a wrapper for const char* which behaves -/// in a way more useful to MySQL++. - -/*********************************************************************** - Copyright (c) 1998 by Kevin Atkinson, (c) 1999, 2000 and 2001 by - MySQL AB, and (c) 2004, 2005 by Educational Technology Resources, Inc. - Others may also hold copyrights on code in this file. See the CREDITS - file in the top directory of the distribution for details. - - This file is part of MySQL++. - - MySQL++ is free software; you can redistribute it and/or modify it - under the terms of the GNU Lesser General Public License as published - by the Free Software Foundation; either version 2.1 of the License, or - (at your option) any later version. - - MySQL++ is distributed in the hope that it will be useful, but WITHOUT - ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public - License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with MySQL++; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 - USA -***********************************************************************/ - -#ifndef MYSQLPP_CONST_STRING_H -#define MYSQLPP_CONST_STRING_H - -#include "defs.h" - -#include -#include -#include - -namespace mysqlpp { - -/// \brief Wrapper for const char* to make it behave in a -/// way more useful to MySQL++. -/// -/// This class implements a small subset of the standard string class. -/// -/// Objects are created from an existing const char* variable -/// by copying the pointer only. Therefore, the object pointed to by -/// that pointer needs to exist for at least as long as the const_string -/// object that wraps it. -class const_string -{ -public: - /// \brief Type of the data stored in this object, when it is not - /// equal to SQL null. - typedef const char value_type; - - /// \brief Type of "size" integers - typedef unsigned int size_type; - - /// \brief Type used when returning a reference to a character in - /// the string. - typedef const char& const_reference; - - /// \brief Type of iterators - typedef const char* const_iterator; - - /// \brief Same as const_iterator because the data cannot be - /// changed. - typedef const_iterator iterator; - -#if !defined(DOXYGEN_IGNORE) -// Doxygen will not generate documentation for this section. - typedef int difference_type; - typedef const_reference reference; - typedef const char* const_pointer; - typedef const_pointer pointer; -#endif // !defined(DOXYGEN_IGNORE) - - /// \brief Create empty string - const_string() : - str_data_("") - { - } - - /// \brief Initialize string from existing C string - const_string(const char* str) : - str_data_(str) - { - } - - /// \brief Assignment operator - const_string& operator=(const char* str) - { - str_data_ = str; - return *this; - } - - /// \brief Return number of characters in string - size_type size() const - { - register int i = 0; - while (str_data_[i]) - i++; - return i; - } - - /// \brief Return iterator pointing to the first character of - /// the string - const_iterator begin() const - { - return str_data_; - } - - /// \brief Return iterator pointing to one past the last character - /// of the string. - const_iterator end() const - { - return str_data_ + size(); - } - - /// \brief Return number of characters in the string - size_type length() const - { - return size(); - } - - /// \brief Return the maximum number of characters in the string. - /// - /// Because this is a \c const string, this is just an alias for - /// size(); its size is always equal to the amount of data currently - /// stored. - size_type max_size() const - { - return size(); - } - - /// \brief Return a reference to a character within the string. - const_reference operator [](size_type pos) const - { - return str_data_[pos]; - } - - /// \brief Return a reference to a character within the string. - /// - /// Unlike \c operator[](), this function throws an - /// \c std::out_of_range exception if the index isn't within range. - const_reference at(size_type pos) const - { - if (pos >= size()) - throw std::out_of_range(""); - else - return str_data_[pos]; - } - - /// \brief Return a const pointer to the string data, - /// null-terminated. - const char* c_str() const - { - return str_data_; - } - - /// \brief Alias for c_str() - const char* data() const - { - return str_data_; - } - - /// \brief Lexically compare this string to another. - /// - /// \param str string to compare against this one - /// - /// \retval <0 if str1 is lexically "less than" str2 - /// \retval 0 if str1 is equal to str2 - /// \retval >0 if str1 is lexically "greater than" str2 - int compare(const const_string& str) const - { - const char* str1 = str_data_; - const char* str2 = str.str_data_; - while (*str1 == *str2 && (*str1 && *str2)) { - str1++; - str2++; - } - return *str1 - *str2; - } - -private: - const char* str_data_; -}; - - -/// \brief Inserts a const_string into a C++ stream -inline std::ostream& operator <<(std::ostream& o, - const const_string& str) -{ - return o << str.c_str(); -} - -/// \brief Calls lhs.compare(), passing rhs -inline int compare(const const_string& lhs, const const_string& rhs) -{ - return lhs.compare(rhs); -} - -/// \brief Returns true if lhs is the same as rhs -inline bool operator ==(const_string& lhs, const_string& rhs) -{ - return compare(lhs, rhs) == 0; -} - -/// \brief Returns true if lhs is not the same as rhs -inline bool operator !=(const_string& lhs, const_string& rhs) -{ - return compare(lhs, rhs) != 0; -} - -/// \brief Returns true if lhs is lexically less than rhs -inline bool operator <(const_string& lhs, const_string& rhs) -{ - return compare(lhs, rhs) < 0; -} - -/// \brief Returns true if lhs is lexically less or equal to rhs -inline bool operator <=(const_string& lhs, const_string& rhs) -{ - return compare(lhs, rhs) <= 0; -} - -/// \brief Returns true if lhs is lexically greater than rhs -inline bool operator >(const_string& lhs, const_string& rhs) -{ - return compare(lhs, rhs) > 0; -} - -/// \brief Returns true if lhs is lexically greater than or equal to rhs -inline bool operator >=(const_string& lhs, const_string& rhs) -{ - return compare(lhs, rhs) >= 0; -} - -} // end namespace mysqlpp - -#endif DELETED lib/convert.h Index: lib/convert.h ================================================================== --- lib/convert.h +++ /dev/null @@ -1,117 +0,0 @@ -/// \file convert.h -/// \brief Declares various string-to-integer type conversion templates. -/// -/// These templates are the mechanism used within mysqlpp::ColData_Tmpl -/// for its string-to-\e something conversions. - -/*********************************************************************** - Copyright (c) 1998 by Kevin Atkinson, (c) 1999, 2000 and 2001 by - MySQL AB, and (c) 2004, 2005 by Educational Technology Resources, Inc. - Others may also hold copyrights on code in this file. See the CREDITS - file in the top directory of the distribution for details. - - This file is part of MySQL++. - - MySQL++ is free software; you can redistribute it and/or modify it - under the terms of the GNU Lesser General Public License as published - by the Free Software Foundation; either version 2.1 of the License, or - (at your option) any later version. - - MySQL++ is distributed in the hope that it will be useful, but WITHOUT - ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public - License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with MySQL++; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 - USA -***********************************************************************/ - -#ifndef MYSQLPP_CONVERT_H -#define MYSQLPP_CONVERT_H - -#include "platform.h" - -#include "defs.h" - -#include - -namespace mysqlpp { - -#if !defined(DOXYGEN_IGNORE) -// Doxygen will not generate documentation for this section. - -template class mysql_convert; - -#define mysql__convert(TYPE, FUNC) \ - template <> \ - class mysql_convert {\ - public:\ - mysql_convert(const char* str, const char *& end) { \ - num_ = FUNC(str, const_cast(&end));}\ - operator TYPE () {return num_;}\ - private:\ - TYPE num_;\ - };\ - -#if defined(_MSC_VER) -# pragma warning(disable: 4244) -#endif - - mysql__convert(float, strtod) - mysql__convert(double, strtod) - -#if defined(_MSC_VER) -# pragma warning(default: 4244) -#endif - -#undef mysql__convert -#define mysql__convert(TYPE, FUNC) \ - template <> \ - class mysql_convert {\ - public:\ - mysql_convert(const char* str, const char *& end) { \ - num_ = FUNC(str, const_cast(&end),10);}\ - operator TYPE () {return num_;}\ - private:\ - TYPE num_;\ - };\ - -#if defined(_MSC_VER) -# pragma warning(disable: 4244) -#endif - - mysql__convert(char, strtol) - mysql__convert(signed char, strtol) - mysql__convert(int, strtol) - mysql__convert(short int, strtol) - mysql__convert(long int, strtol) - - mysql__convert(unsigned char, strtoul) - mysql__convert(unsigned int, strtoul) - mysql__convert(unsigned short int, strtoul) - mysql__convert(unsigned long int, strtoul) - -#if defined(_MSC_VER) -# pragma warning(default: 4244) -#endif - -#if !defined(NO_LONG_LONGS) -#if defined(__GNUC__) -mysql__convert(longlong, strtoll) -mysql__convert(ulonglong, strtoull) -#elif defined(_MSC_VER) -mysql__convert(longlong, _strtoi64) -mysql__convert(ulonglong, _strtoui64) -#else -#error Fix me! I need the "string to 64-bit int" function for your platform! -#endif -#endif // !defined(NO_LONG_LONGS) - -#endif // !defined(DOXYGEN_IGNORE) - -} // end namespace mysqlpp - -#endif - ADDED lib/cpool.cpp Index: lib/cpool.cpp ================================================================== --- /dev/null +++ lib/cpool.cpp @@ -0,0 +1,222 @@ +/*********************************************************************** + cpool.cpp - Implements the ConnectionPool class. + + Copyright (c) 2007-2009 by Educational Technology Resources, Inc. and + (c) 2007 by Jonathan Wakely. Others may also hold copyrights on + code in this file. See the CREDITS.txt file in the top directory + of the distribution for details. + + This file is part of MySQL++. + + MySQL++ is free software; you can redistribute it and/or modify it + under the terms of the GNU Lesser General Public License as published + by the Free Software Foundation; either version 2.1 of the License, or + (at your option) any later version. + + MySQL++ is distributed in the hope that it will be useful, but WITHOUT + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public + License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with MySQL++; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 + USA +***********************************************************************/ + +#include "cpool.h" + +#include "connection.h" + +#include +#include + +namespace mysqlpp { + + +/// \brief Functor to test whether a given ConnectionInfo object is +/// "too old". +/// +/// \internal This is a template only because ConnectionInfo is private. +/// Making it a template means the private type is only used at the point +/// of instantiation, where it is accessible. + +template +class TooOld : std::unary_function +{ +public: +#if !defined(DOXYGEN_IGNORE) + TooOld(unsigned int tmax) : + min_age_(time(0) - tmax) + { + } + + bool operator()(const ConnInfoT& conn_info) const + { + return !conn_info.in_use && conn_info.last_used <= min_age_; + } + +#endif +private: + time_t min_age_; +}; + + + +//// clear ///////////////////////////////////////////////////////////// +// Destroy connections in the pool, either all of them (completely +// draining the pool) or just those not currently in use. The public +// method shrink() is an alias for clear(false). + +void +ConnectionPool::clear(bool all) +{ + ScopedLock lock(mutex_); // ensure we're not interfered with + + PoolIt it = pool_.begin(); + while (it != pool_.end()) { + if (all || !it->in_use) { + remove(it++); + } + else { + ++it; + } + } +} + + +//// exchange ////////////////////////////////////////////////////////// +// Passed connection is defective, so remove it from the pool and return +// a new one. + +Connection* +ConnectionPool::exchange(const Connection* pc) +{ + // Don't grab the mutex first. remove() and grab() both do. + // Inefficient, but we'd have to hoist their contents up into this + // method or extract a mutex-free version of each mechanism for + // each, both of which are also inefficient. + remove(pc); + return grab(); +} + + +//// find_mru ////////////////////////////////////////////////////////// +// Find most recently used available connection. Uses operator< for +// ConnectionInfo to order pool with MRU connection last. Returns 0 if +// there are no connections not in use. + +Connection* +ConnectionPool::find_mru() +{ + PoolIt mru = std::max_element(pool_.begin(), pool_.end()); + if (mru != pool_.end() && !mru->in_use) { + mru->in_use = true; + return mru->conn; + } + else { + return 0; + } +} + + +//// grab ////////////////////////////////////////////////////////////// + +Connection* +ConnectionPool::grab() +{ + ScopedLock lock(mutex_); // ensure we're not interfered with + remove_old_connections(); + if (Connection* mru = find_mru()) { + return mru; + } + else { + // No free connections, so create and return a new one. + pool_.push_back(ConnectionInfo(create())); + return pool_.back().conn; + } +} + + +//// release /////////////////////////////////////////////////////////// + +void +ConnectionPool::release(const Connection* pc) +{ + ScopedLock lock(mutex_); // ensure we're not interfered with + + for (PoolIt it = pool_.begin(); it != pool_.end(); ++it) { + if (it->conn == pc) { + it->in_use = false; + it->last_used = time(0); + break; + } + } +} + + +//// remove //////////////////////////////////////////////////////////// +// 2 versions: +// +// First takes a Connection pointer, finds it in the pool, and calls +// the second. It's public, because Connection pointers are all +// outsiders see of the pool. +// +// Second takes an iterator into the pool, destroys the referenced +// connection and removes it from the pool. This is only a utility +// function for use by other class internals. + +void +ConnectionPool::remove(const Connection* pc) +{ + ScopedLock lock(mutex_); // ensure we're not interfered with + + for (PoolIt it = pool_.begin(); it != pool_.end(); ++it) { + if (it->conn == pc) { + remove(it); + return; + } + } +} + +void +ConnectionPool::remove(const PoolIt& it) +{ + // Don't grab the mutex. Only called from other functions that do + // grab it. + destroy(it->conn); + pool_.erase(it); +} + + +//// remove_old_connections //////////////////////////////////////////// +// Remove connections that were last used too long ago. + +void +ConnectionPool::remove_old_connections() +{ + TooOld too_old(max_idle_time()); + + PoolIt it = pool_.begin(); + while ((it = std::find_if(it, pool_.end(), too_old)) != pool_.end()) { + remove(it++); + } +} + + +//// safe_grab ///////////////////////////////////////////////////////// + +Connection* +ConnectionPool::safe_grab() +{ + Connection* pc; + while (!(pc = grab())->ping()) { + remove(pc); + pc = 0; + } + return pc; +} + + +} // end namespace mysqlpp + ADDED lib/cpool.h Index: lib/cpool.h ================================================================== --- /dev/null +++ lib/cpool.h @@ -0,0 +1,255 @@ +/// \file cpool.h +/// \brief Declares the ConnectionPool class. + +/*********************************************************************** + Copyright (c) 2007-2008 by Educational Technology Resources, Inc. and + (c) 2007 by Jonathan Wakely. Others may also hold copyrights on + code in this file. See the CREDITS.txt file in the top directory + of the distribution for details. + + This file is part of MySQL++. + + MySQL++ is free software; you can redistribute it and/or modify it + under the terms of the GNU Lesser General Public License as published + by the Free Software Foundation; either version 2.1 of the License, or + (at your option) any later version. + + MySQL++ is distributed in the hope that it will be useful, but WITHOUT + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public + License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with MySQL++; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 + USA +***********************************************************************/ + +#if !defined(MYSQLPP_CPOOL_H) +#define MYSQLPP_CPOOL_H + +#include "beemutex.h" + +#include + +#include +#include + +namespace mysqlpp { + +#if !defined(DOXYGEN_IGNORE) +// Make Doxygen ignore this +class MYSQLPP_EXPORT Connection; +#endif + +/// \brief Manages a pool of connections for programs that need more +/// than one Connection object at a time, but can't predict how many +/// they need in advance. +/// +/// This class is useful in programs that need to make multiple +/// simultaneous queries on the database; this requires multiple +/// Connection objects due to a hard limitation of the underlying +/// C API. Connection pools are most useful in multithreaded programs, +/// but it can be helpful to have one in a single-threaded program as +/// well. Sometimes it's necessary to get more data from the server +/// while in the middle of processing data from an earlier query; this +/// requires multiple connections. Whether you use a pool or manage +/// connections yourself is up to you, but realize that this class +/// takes care of a lot of subtle details for you that aren't obvious. +/// +/// The pool's policy for connection reuse is to always return the +/// \em most recently used connection that's not being used right now. +/// This ensures that excess connections don't hang around any longer +/// than they must. If the pool were to return the \em least recently +/// used connection, it would be likely to result in a large pool of +/// sparsely used connections because we'd keep resetting the last-used +/// time of whichever connection is least recently used at that moment. + +class MYSQLPP_EXPORT ConnectionPool +{ +public: + /// \brief Create empty pool + ConnectionPool() { } + + /// \brief Destroy object + /// + /// If the pool raises an assertion on destruction, it means our + /// subclass isn't calling clear() in its dtor as it should. + virtual ~ConnectionPool() { assert(empty()); } + + /// \brief Returns true if pool is empty + bool empty() const { return pool_.empty(); } + + /// \brief Return a defective connection to the pool and get a new + /// one back. + /// + /// Call this on receiving a BadQuery exception, with errnum() + /// equal to CR_SERVER_GONE_ERROR. It means the server was + /// restarted or otherwise dropped your connection to it, so the + /// Connection object is no longer usable. You can avoid the + /// need to use this by setting the ReconnectOption in your grab() + /// override, but perhaps there are other reasons to need to + /// exchange a bad connection for a good one. + /// + /// This function wraps grab(), not safe_grab(), even though that + /// could return another dead connection. The assumption is that if + /// your code is smart enough to detect one bad connection, it should + /// be smart enough to detect a whole string of them. Worst case, + /// the whole pool is bad -- remote server went away -- and we have + /// to empty the pool and start re-filling it. + /// + /// \param pc pointer to a Connection object to be returned to the + /// pool and marked as unused. + /// + /// \retval a pointer to a different Connection object; not + /// guaranteed to still be connected! + virtual Connection* exchange(const Connection* pc); + + /// \brief Grab a free connection from the pool. + /// + /// This method creates a new connection if an unused one doesn't + /// exist, and destroys any that have remained unused for too long. + /// If there is more than one free connection, we return the most + /// recently used one; this allows older connections to die off over + /// time when the caller's need for connections decreases. + /// + /// Do not delete the returned pointer. This object manages the + /// lifetime of connection objects it creates. + /// + /// \retval a pointer to the connection + virtual Connection* grab(); + + /// \brief Return a connection to the pool + /// + /// Marks the connection as no longer in use. + /// + /// The pool updates the last-used time of a connection only on + /// release, on the assumption that it was used just prior. There's + /// nothing forcing you to do it this way: your code is free to + /// delay releasing idle connections as long as it likes. You + /// want to avoid this because it will make the pool perform poorly; + /// if it doesn't know approximately how long a connection has + /// really been idle, it can't make good judgements about when to + /// remove it from the pool. + /// + /// \param pc pointer to a Connection object to be returned to the + /// pool and marked as unused. + virtual void release(const Connection* pc); + + /// \brief Removes the given connection from the pool + /// + /// If you mean to simply return a connection to the pool after + /// you're finished using it, call release() instead. This method + /// is primarily for error handling: you somehow have figured out + /// that the connection is defective, so want it destroyed and + /// removed from the pool. If you also want a different connection + /// to retry your operation on, call exchange() instead. + /// + /// \param pc pointer to a Connection object to be removed from + /// the pool and destroyed + void remove(const Connection* pc); + + /// \brief Grab a free connection from the pool, testing that it's + /// connected before returning it. + /// + /// This is just a wrapper around grab(), Connection::ping() and + /// release(), and is thus less efficient than grab(). Use it only + /// when it's possible for MySQL server connections to go away + /// unexpectedly, such as when the DB server can be restarted out + /// from under your application. + /// + /// \retval a pointer to the connection + virtual Connection* safe_grab(); + + /// \brief Remove all unused connections from the pool + void shrink() { clear(false); } + +protected: + /// \brief Drains the pool, freeing all allocated memory. + /// + /// A derived class must call this in its dtor to avoid leaking all + /// Connection objects still in existence. We can't do it up at + /// this level because this class's dtor can't call our subclass's + /// destroy() method. + /// + /// \param all if true, remove all connections, even those in use + void clear(bool all = true); + + /// \brief Create a new connection + /// + /// Subclasses must override this. + /// + /// Essentially, this method lets your code tell ConnectionPool + /// what server to connect to, what login parameters to use, what + /// connection options to enable, etc. ConnectionPool can't know + /// any of this without your help. + /// + /// \retval A connected Connection object + virtual Connection* create() = 0; + + /// \brief Destroy a connection + /// + /// Subclasses must override this. + /// + /// This is for destroying the objects returned by create(). + /// Because we can't know what the derived class did to create the + /// connection we can't reliably know how to destroy it. + virtual void destroy(Connection*) = 0; + + /// \brief Returns the maximum number of seconds a connection is + /// able to remain idle before it is dropped. + /// + /// Subclasses must override this as it encodes a policy issue, + /// something that MySQL++ can't declare by fiat. + /// + /// \retval number of seconds before an idle connection is destroyed + /// due to lack of use + virtual unsigned int max_idle_time() = 0; + + /// \brief Returns the current size of the internal connection pool. + size_t size() const { return pool_.size(); } + +private: + //// Internal types + struct ConnectionInfo { + Connection* conn; + time_t last_used; + bool in_use; + + ConnectionInfo(Connection* c) : + conn(c), + last_used(time(0)), + in_use(true) + { + } + + // Strict weak ordering for ConnectionInfo objects. + // + // This ordering defines all in-use connections to be "less + // than" those not in use. Within each group, connections + // less recently touched are less than those more recent. + bool operator<(const ConnectionInfo& rhs) const + { + const ConnectionInfo& lhs = *this; + return lhs.in_use == rhs.in_use ? + lhs.last_used < rhs.last_used : + lhs.in_use; + } + }; + typedef std::list PoolT; + typedef PoolT::iterator PoolIt; + + //// Internal support functions + Connection* find_mru(); + void remove(const PoolIt& it); + void remove_old_connections(); + + //// Internal data + PoolT pool_; + BeecryptMutex mutex_; +}; + +} // end namespace mysqlpp + +#endif // !defined(MYSQLPP_CPOOL_H) + DELETED lib/custom-macros.h Index: lib/custom-macros.h ================================================================== --- lib/custom-macros.h +++ /dev/null @@ -1,29488 +0,0 @@ - -// !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -// This file is generated by the Perl script custom.pl. Please do -// not modify this file directly. Change the script instead. -// !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! - -// --------------------------------------------------- -// Begin Mandatory Compare -// --------------------------------------------------- - -#define sql_compare_define(NAME) \ - bool operator == (const NAME &other) const \ - {return sql_compare_##NAME(*this,other) == 0;} \ - bool operator != (const NAME &other) const \ - {return sql_compare_##NAME(*this,other) != 0;} \ - bool operator > (const NAME &other) const \ - {return sql_compare_##NAME(*this,other) > 0;} \ - bool operator < (const NAME &other) const \ - {return sql_compare_##NAME(*this,other) < 0;} \ - bool operator >= (const NAME &other) const \ - {return sql_compare_##NAME(*this,other) >= 0;} \ - bool operator <= (const NAME &other) const \ - {return sql_compare_##NAME(*this,other) <= 0;} \ - int cmp (const NAME &other) const \ - {return sql_compare_##NAME(*this,other);} \ - int compare (const NAME &other) const \ - {return sql_compare_##NAME(*this,other);} - -#define sql_compare_define_0(NAME, T1, C1, T2, C2, T3, C3, T4, C4, T5, C5, T6, C6, T7, C7, T8, C8, T9, C9, T10, C10, T11, C11, T12, C12, T13, C13, T14, C14, T15, C15, T16, C16, T17, C17, T18, C18, T19, C19, T20, C20, T21, C21, T22, C22, T23, C23, T24, C24, T25, C25) - -#define sql_construct_define_0(NAME, T1, C1, T2, C2, T3, C3, T4, C4, T5, C5, T6, C6, T7, C7, T8, C8, T9, C9, T10, C10, T11, C11, T12, C12, T13, C13, T14, C14, T15, C15, T16, C16, T17, C17, T18, C18, T19, C19, T20, C20, T21, C21, T22, C22, T23, C23, T24, C24, T25, C25) - -#define sql_COMPARE__0(NAME, C1, C2, C3, C4, C5, C6, C7, C8, C9, C10, C11, C12, C13, C14, C15, C16, C17, C18, C19, C20, C21, C22, C23, C24, C25) - -#define sql_compare_type_def_0(NAME, WHAT, NUM) \ - sql_compare_type_def_##NUM (NAME, WHAT, NUM) - -#define sql_compare_type_defe_0(NAME, WHAT, NUM) \ - sql_compare_type_defe_##NUM (NAME, WHAT, NUM) - -// --------------------------------------------------- -// End Mandatory Compare -// --------------------------------------------------- - -// --------------------------------------------------- -// Begin Compare 1 -// --------------------------------------------------- - -#define sql_compare_define_1(NAME, T1, C1, T2, C2, T3, C3, T4, C4, T5, C5, T6, C6, T7, C7, T8, C8, T9, C9, T10, C10, T11, C11, T12, C12, T13, C13, T14, C14, T15, C15, T16, C16, T17, C17, T18, C18, T19, C19, T20, C20, T21, C21, T22, C22, T23, C23, T24, C24, T25, C25) \ - NAME (const T1 &p1) : C1 (p1) {} \ - void set (const T1 &p1) { \ - C1 = p1;\ - \ - } \ - sql_compare_define(NAME) - -#define sql_construct_define_1(NAME, T1, C1, T2, C2, T3, C3, T4, C4, T5, C5, T6, C6, T7, C7, T8, C8, T9, C9, T10, C10, T11, C11, T12, C12, T13, C13, T14, C14, T15, C15, T16, C16, T17, C17, T18, C18, T19, C19, T20, C20, T21, C21, T22, C22, T23, C23, T24, C24, T25, C25) \ - void set (const T1 &p1) { \ - C1 = p1;\ - \ - } \ - NAME (const T1 &p1) : C1 (p1) {} - -#define sql_compare_type_def_1(NAME, WHAT, NUM) \ - return WHAT##_list(d, m, true) - -#define sql_compare_type_defe_1(NAME, WHAT, NUM) \ - return WHAT##_list(d, c, m, true) - -#define sql_COMPARE__1(NAME, C1, C2, C3, C4, C5, C6, C7, C8, C9, C10, C11, C12, C13, C14, C15, C16, C17, C18, C19, C20, C21, C22, C23, C24, C25) \ - template \ - int sql_compare_##NAME (const NAME &x, const NAME &y) { \ - return sql_cmp(x.C1 , y.C1 ); \ - } \ - template \ - int compare (const NAME &x, const NAME &y) { \ - return sql_cmp(x.C1 , y.C1 ); \ - } - -// --------------------------------------------------- -// End Compare 1 -// --------------------------------------------------- - - -// --------------------------------------------------- -// Begin Compare 2 -// --------------------------------------------------- - -#define sql_compare_define_2(NAME, T1, C1, T2, C2, T3, C3, T4, C4, T5, C5, T6, C6, T7, C7, T8, C8, T9, C9, T10, C10, T11, C11, T12, C12, T13, C13, T14, C14, T15, C15, T16, C16, T17, C17, T18, C18, T19, C19, T20, C20, T21, C21, T22, C22, T23, C23, T24, C24, T25, C25) \ - NAME (const T1 &p1, const T2 &p2) : C1 (p1), C2 (p2) {} \ - void set (const T1 &p1, const T2 &p2) { \ - C1 = p1;\ - C1 = p1;\ - C2 = p2;\ - \ - } \ - sql_compare_define(NAME) - -#define sql_construct_define_2(NAME, T1, C1, T2, C2, T3, C3, T4, C4, T5, C5, T6, C6, T7, C7, T8, C8, T9, C9, T10, C10, T11, C11, T12, C12, T13, C13, T14, C14, T15, C15, T16, C16, T17, C17, T18, C18, T19, C19, T20, C20, T21, C21, T22, C22, T23, C23, T24, C24, T25, C25) \ - void set (const T1 &p1, const T2 &p2) { \ - C1 = p1;\ - C1 = p1;\ - C2 = p2;\ - \ - } \ - NAME (const T1 &p1, const T2 &p2) : C1 (p1), C2 (p2) {} - -#define sql_compare_type_def_2(NAME, WHAT, NUM) \ - return WHAT##_list(d, m, true, true) - -#define sql_compare_type_defe_2(NAME, WHAT, NUM) \ - return WHAT##_list(d, c, m, true, true) - -#define sql_COMPARE__2(NAME, C1, C2, C3, C4, C5, C6, C7, C8, C9, C10, C11, C12, C13, C14, C15, C16, C17, C18, C19, C20, C21, C22, C23, C24, C25) \ - template \ - int sql_compare_##NAME (const NAME &x, const NAME &y) { \ - int cmp; \ - if (cmp = sql_cmp(x.C1 , y.C1 )) return cmp; \ - return sql_cmp(x.C2 , y.C2 ); \ - } \ - template \ - int compare (const NAME &x, const NAME &y) { \ - int cmp; \ - if (cmp = sql_cmp(x.C1 , y.C1 )) return cmp; \ - return sql_cmp(x.C2 , y.C2 ); \ - } - -// --------------------------------------------------- -// End Compare 2 -// --------------------------------------------------- - - -// --------------------------------------------------- -// Begin Compare 3 -// --------------------------------------------------- - -#define sql_compare_define_3(NAME, T1, C1, T2, C2, T3, C3, T4, C4, T5, C5, T6, C6, T7, C7, T8, C8, T9, C9, T10, C10, T11, C11, T12, C12, T13, C13, T14, C14, T15, C15, T16, C16, T17, C17, T18, C18, T19, C19, T20, C20, T21, C21, T22, C22, T23, C23, T24, C24, T25, C25) \ - NAME (const T1 &p1, const T2 &p2, const T3 &p3) : C1 (p1), C2 (p2), C3 (p3) {} \ - void set (const T1 &p1, const T2 &p2, const T3 &p3) { \ - C1 = p1;\ - C1 = p1;\ - C2 = p2;\ - C1 = p1;\ - C2 = p2;\ - C3 = p3;\ - \ - } \ - sql_compare_define(NAME) - -#define sql_construct_define_3(NAME, T1, C1, T2, C2, T3, C3, T4, C4, T5, C5, T6, C6, T7, C7, T8, C8, T9, C9, T10, C10, T11, C11, T12, C12, T13, C13, T14, C14, T15, C15, T16, C16, T17, C17, T18, C18, T19, C19, T20, C20, T21, C21, T22, C22, T23, C23, T24, C24, T25, C25) \ - void set (const T1 &p1, const T2 &p2, const T3 &p3) { \ - C1 = p1;\ - C1 = p1;\ - C2 = p2;\ - C1 = p1;\ - C2 = p2;\ - C3 = p3;\ - \ - } \ - NAME (const T1 &p1, const T2 &p2, const T3 &p3) : C1 (p1), C2 (p2), C3 (p3) {} - -#define sql_compare_type_def_3(NAME, WHAT, NUM) \ - return WHAT##_list(d, m, true, true, true) - -#define sql_compare_type_defe_3(NAME, WHAT, NUM) \ - return WHAT##_list(d, c, m, true, true, true) - -#define sql_COMPARE__3(NAME, C1, C2, C3, C4, C5, C6, C7, C8, C9, C10, C11, C12, C13, C14, C15, C16, C17, C18, C19, C20, C21, C22, C23, C24, C25) \ - template \ - int sql_compare_##NAME (const NAME &x, const NAME &y) { \ - int cmp; \ - if (cmp = sql_cmp(x.C1 , y.C1 )) return cmp; \ - if (cmp = sql_cmp(x.C2 , y.C2 )) return cmp; \ - return sql_cmp(x.C3 , y.C3 ); \ - } \ - template \ - int compare (const NAME &x, const NAME &y) { \ - int cmp; \ - if (cmp = sql_cmp(x.C1 , y.C1 )) return cmp; \ - if (cmp = sql_cmp(x.C2 , y.C2 )) return cmp; \ - return sql_cmp(x.C3 , y.C3 ); \ - } - -// --------------------------------------------------- -// End Compare 3 -// --------------------------------------------------- - - -// --------------------------------------------------- -// Begin Compare 4 -// --------------------------------------------------- - -#define sql_compare_define_4(NAME, T1, C1, T2, C2, T3, C3, T4, C4, T5, C5, T6, C6, T7, C7, T8, C8, T9, C9, T10, C10, T11, C11, T12, C12, T13, C13, T14, C14, T15, C15, T16, C16, T17, C17, T18, C18, T19, C19, T20, C20, T21, C21, T22, C22, T23, C23, T24, C24, T25, C25) \ - NAME (const T1 &p1, const T2 &p2, const T3 &p3, const T4 &p4) : C1 (p1), C2 (p2), C3 (p3), C4 (p4) {} \ - void set (const T1 &p1, const T2 &p2, const T3 &p3, const T4 &p4) { \ - C1 = p1;\ - C1 = p1;\ - C2 = p2;\ - C1 = p1;\ - C2 = p2;\ - C3 = p3;\ - C1 = p1;\ - C2 = p2;\ - C3 = p3;\ - C4 = p4;\ - \ - } \ - sql_compare_define(NAME) - -#define sql_construct_define_4(NAME, T1, C1, T2, C2, T3, C3, T4, C4, T5, C5, T6, C6, T7, C7, T8, C8, T9, C9, T10, C10, T11, C11, T12, C12, T13, C13, T14, C14, T15, C15, T16, C16, T17, C17, T18, C18, T19, C19, T20, C20, T21, C21, T22, C22, T23, C23, T24, C24, T25, C25) \ - void set (const T1 &p1, const T2 &p2, const T3 &p3, const T4 &p4) { \ - C1 = p1;\ - C1 = p1;\ - C2 = p2;\ - C1 = p1;\ - C2 = p2;\ - C3 = p3;\ - C1 = p1;\ - C2 = p2;\ - C3 = p3;\ - C4 = p4;\ - \ - } \ - NAME (const T1 &p1, const T2 &p2, const T3 &p3, const T4 &p4) : C1 (p1), C2 (p2), C3 (p3), C4 (p4) {} - -#define sql_compare_type_def_4(NAME, WHAT, NUM) \ - return WHAT##_list(d, m, true, true, true, true) - -#define sql_compare_type_defe_4(NAME, WHAT, NUM) \ - return WHAT##_list(d, c, m, true, true, true, true) - -#define sql_COMPARE__4(NAME, C1, C2, C3, C4, C5, C6, C7, C8, C9, C10, C11, C12, C13, C14, C15, C16, C17, C18, C19, C20, C21, C22, C23, C24, C25) \ - template \ - int sql_compare_##NAME (const NAME &x, const NAME &y) { \ - int cmp; \ - if (cmp = sql_cmp(x.C1 , y.C1 )) return cmp; \ - if (cmp = sql_cmp(x.C2 , y.C2 )) return cmp; \ - if (cmp = sql_cmp(x.C3 , y.C3 )) return cmp; \ - return sql_cmp(x.C4 , y.C4 ); \ - } \ - template \ - int compare (const NAME &x, const NAME &y) { \ - int cmp; \ - if (cmp = sql_cmp(x.C1 , y.C1 )) return cmp; \ - if (cmp = sql_cmp(x.C2 , y.C2 )) return cmp; \ - if (cmp = sql_cmp(x.C3 , y.C3 )) return cmp; \ - return sql_cmp(x.C4 , y.C4 ); \ - } - -// --------------------------------------------------- -// End Compare 4 -// --------------------------------------------------- - - -// --------------------------------------------------- -// Begin Compare 5 -// --------------------------------------------------- - -#define sql_compare_define_5(NAME, T1, C1, T2, C2, T3, C3, T4, C4, T5, C5, T6, C6, T7, C7, T8, C8, T9, C9, T10, C10, T11, C11, T12, C12, T13, C13, T14, C14, T15, C15, T16, C16, T17, C17, T18, C18, T19, C19, T20, C20, T21, C21, T22, C22, T23, C23, T24, C24, T25, C25) \ - NAME (const T1 &p1, const T2 &p2, const T3 &p3, const T4 &p4, const T5 &p5) : C1 (p1), C2 (p2), C3 (p3), C4 (p4), C5 (p5) {} \ - void set (const T1 &p1, const T2 &p2, const T3 &p3, const T4 &p4, const T5 &p5) { \ - C1 = p1;\ - C1 = p1;\ - C2 = p2;\ - C1 = p1;\ - C2 = p2;\ - C3 = p3;\ - C1 = p1;\ - C2 = p2;\ - C3 = p3;\ - C4 = p4;\ - C1 = p1;\ - C2 = p2;\ - C3 = p3;\ - C4 = p4;\ - C5 = p5;\ - \ - } \ - sql_compare_define(NAME) - -#define sql_construct_define_5(NAME, T1, C1, T2, C2, T3, C3, T4, C4, T5, C5, T6, C6, T7, C7, T8, C8, T9, C9, T10, C10, T11, C11, T12, C12, T13, C13, T14, C14, T15, C15, T16, C16, T17, C17, T18, C18, T19, C19, T20, C20, T21, C21, T22, C22, T23, C23, T24, C24, T25, C25) \ - void set (const T1 &p1, const T2 &p2, const T3 &p3, const T4 &p4, const T5 &p5) { \ - C1 = p1;\ - C1 = p1;\ - C2 = p2;\ - C1 = p1;\ - C2 = p2;\ - C3 = p3;\ - C1 = p1;\ - C2 = p2;\ - C3 = p3;\ - C4 = p4;\ - C1 = p1;\ - C2 = p2;\ - C3 = p3;\ - C4 = p4;\ - C5 = p5;\ - \ - } \ - NAME (const T1 &p1, const T2 &p2, const T3 &p3, const T4 &p4, const T5 &p5) : C1 (p1), C2 (p2), C3 (p3), C4 (p4), C5 (p5) {} - -#define sql_compare_type_def_5(NAME, WHAT, NUM) \ - return WHAT##_list(d, m, true, true, true, true, true) - -#define sql_compare_type_defe_5(NAME, WHAT, NUM) \ - return WHAT##_list(d, c, m, true, true, true, true, true) - -#define sql_COMPARE__5(NAME, C1, C2, C3, C4, C5, C6, C7, C8, C9, C10, C11, C12, C13, C14, C15, C16, C17, C18, C19, C20, C21, C22, C23, C24, C25) \ - template \ - int sql_compare_##NAME (const NAME &x, const NAME &y) { \ - int cmp; \ - if (cmp = sql_cmp(x.C1 , y.C1 )) return cmp; \ - if (cmp = sql_cmp(x.C2 , y.C2 )) return cmp; \ - if (cmp = sql_cmp(x.C3 , y.C3 )) return cmp; \ - if (cmp = sql_cmp(x.C4 , y.C4 )) return cmp; \ - return sql_cmp(x.C5 , y.C5 ); \ - } \ - template \ - int compare (const NAME &x, const NAME &y) { \ - int cmp; \ - if (cmp = sql_cmp(x.C1 , y.C1 )) return cmp; \ - if (cmp = sql_cmp(x.C2 , y.C2 )) return cmp; \ - if (cmp = sql_cmp(x.C3 , y.C3 )) return cmp; \ - if (cmp = sql_cmp(x.C4 , y.C4 )) return cmp; \ - return sql_cmp(x.C5 , y.C5 ); \ - } - -// --------------------------------------------------- -// End Compare 5 -// --------------------------------------------------- - - -// --------------------------------------------------- -// Begin Compare 6 -// --------------------------------------------------- - -#define sql_compare_define_6(NAME, T1, C1, T2, C2, T3, C3, T4, C4, T5, C5, T6, C6, T7, C7, T8, C8, T9, C9, T10, C10, T11, C11, T12, C12, T13, C13, T14, C14, T15, C15, T16, C16, T17, C17, T18, C18, T19, C19, T20, C20, T21, C21, T22, C22, T23, C23, T24, C24, T25, C25) \ - NAME (const T1 &p1, const T2 &p2, const T3 &p3, const T4 &p4, const T5 &p5, const T6 &p6) : C1 (p1), C2 (p2), C3 (p3), C4 (p4), C5 (p5), C6 (p6) {} \ - void set (const T1 &p1, const T2 &p2, const T3 &p3, const T4 &p4, const T5 &p5, const T6 &p6) { \ - C1 = p1;\ - C1 = p1;\ - C2 = p2;\ - C1 = p1;\ - C2 = p2;\ - C3 = p3;\ - C1 = p1;\ - C2 = p2;\ - C3 = p3;\ - C4 = p4;\ - C1 = p1;\ - C2 = p2;\ - C3 = p3;\ - C4 = p4;\ - C5 = p5;\ - C1 = p1;\ - C2 = p2;\ - C3 = p3;\ - C4 = p4;\ - C5 = p5;\ - C6 = p6;\ - \ - } \ - sql_compare_define(NAME) - -#define sql_construct_define_6(NAME, T1, C1, T2, C2, T3, C3, T4, C4, T5, C5, T6, C6, T7, C7, T8, C8, T9, C9, T10, C10, T11, C11, T12, C12, T13, C13, T14, C14, T15, C15, T16, C16, T17, C17, T18, C18, T19, C19, T20, C20, T21, C21, T22, C22, T23, C23, T24, C24, T25, C25) \ - void set (const T1 &p1, const T2 &p2, const T3 &p3, const T4 &p4, const T5 &p5, const T6 &p6) { \ - C1 = p1;\ - C1 = p1;\ - C2 = p2;\ - C1 = p1;\ - C2 = p2;\ - C3 = p3;\ - C1 = p1;\ - C2 = p2;\ - C3 = p3;\ - C4 = p4;\ - C1 = p1;\ - C2 = p2;\ - C3 = p3;\ - C4 = p4;\ - C5 = p5;\ - C1 = p1;\ - C2 = p2;\ - C3 = p3;\ - C4 = p4;\ - C5 = p5;\ - C6 = p6;\ - \ - } \ - NAME (const T1 &p1, const T2 &p2, const T3 &p3, const T4 &p4, const T5 &p5, const T6 &p6) : C1 (p1), C2 (p2), C3 (p3), C4 (p4), C5 (p5), C6 (p6) {} - -#define sql_compare_type_def_6(NAME, WHAT, NUM) \ - return WHAT##_list(d, m, true, true, true, true, true, true) - -#define sql_compare_type_defe_6(NAME, WHAT, NUM) \ - return WHAT##_list(d, c, m, true, true, true, true, true, true) - -#define sql_COMPARE__6(NAME, C1, C2, C3, C4, C5, C6, C7, C8, C9, C10, C11, C12, C13, C14, C15, C16, C17, C18, C19, C20, C21, C22, C23, C24, C25) \ - template \ - int sql_compare_##NAME (const NAME &x, const NAME &y) { \ - int cmp; \ - if (cmp = sql_cmp(x.C1 , y.C1 )) return cmp; \ - if (cmp = sql_cmp(x.C2 , y.C2 )) return cmp; \ - if (cmp = sql_cmp(x.C3 , y.C3 )) return cmp; \ - if (cmp = sql_cmp(x.C4 , y.C4 )) return cmp; \ - if (cmp = sql_cmp(x.C5 , y.C5 )) return cmp; \ - return sql_cmp(x.C6 , y.C6 ); \ - } \ - template \ - int compare (const NAME &x, const NAME &y) { \ - int cmp; \ - if (cmp = sql_cmp(x.C1 , y.C1 )) return cmp; \ - if (cmp = sql_cmp(x.C2 , y.C2 )) return cmp; \ - if (cmp = sql_cmp(x.C3 , y.C3 )) return cmp; \ - if (cmp = sql_cmp(x.C4 , y.C4 )) return cmp; \ - if (cmp = sql_cmp(x.C5 , y.C5 )) return cmp; \ - return sql_cmp(x.C6 , y.C6 ); \ - } - -// --------------------------------------------------- -// End Compare 6 -// --------------------------------------------------- - - -// --------------------------------------------------- -// Begin Compare 7 -// --------------------------------------------------- - -#define sql_compare_define_7(NAME, T1, C1, T2, C2, T3, C3, T4, C4, T5, C5, T6, C6, T7, C7, T8, C8, T9, C9, T10, C10, T11, C11, T12, C12, T13, C13, T14, C14, T15, C15, T16, C16, T17, C17, T18, C18, T19, C19, T20, C20, T21, C21, T22, C22, T23, C23, T24, C24, T25, C25) \ - NAME (const T1 &p1, const T2 &p2, const T3 &p3, const T4 &p4, const T5 &p5, const T6 &p6, const T7 &p7) : C1 (p1), C2 (p2), C3 (p3), C4 (p4), C5 (p5), C6 (p6), C7 (p7) {} \ - void set (const T1 &p1, const T2 &p2, const T3 &p3, const T4 &p4, const T5 &p5, const T6 &p6, const T7 &p7) { \ - C1 = p1;\ - C1 = p1;\ - C2 = p2;\ - C1 = p1;\ - C2 = p2;\ - C3 = p3;\ - C1 = p1;\ - C2 = p2;\ - C3 = p3;\ - C4 = p4;\ - C1 = p1;\ - C2 = p2;\ - C3 = p3;\ - C4 = p4;\ - C5 = p5;\ - C1 = p1;\ - C2 = p2;\ - C3 = p3;\ - C4 = p4;\ - C5 = p5;\ - C6 = p6;\ - C1 = p1;\ - C2 = p2;\ - C3 = p3;\ - C4 = p4;\ - C5 = p5;\ - C6 = p6;\ - C7 = p7;\ - \ - } \ - sql_compare_define(NAME) - -#define sql_construct_define_7(NAME, T1, C1, T2, C2, T3, C3, T4, C4, T5, C5, T6, C6, T7, C7, T8, C8, T9, C9, T10, C10, T11, C11, T12, C12, T13, C13, T14, C14, T15, C15, T16, C16, T17, C17, T18, C18, T19, C19, T20, C20, T21, C21, T22, C22, T23, C23, T24, C24, T25, C25) \ - void set (const T1 &p1, const T2 &p2, const T3 &p3, const T4 &p4, const T5 &p5, const T6 &p6, const T7 &p7) { \ - C1 = p1;\ - C1 = p1;\ - C2 = p2;\ - C1 = p1;\ - C2 = p2;\ - C3 = p3;\ - C1 = p1;\ - C2 = p2;\ - C3 = p3;\ - C4 = p4;\ - C1 = p1;\ - C2 = p2;\ - C3 = p3;\ - C4 = p4;\ - C5 = p5;\ - C1 = p1;\ - C2 = p2;\ - C3 = p3;\ - C4 = p4;\ - C5 = p5;\ - C6 = p6;\ - C1 = p1;\ - C2 = p2;\ - C3 = p3;\ - C4 = p4;\ - C5 = p5;\ - C6 = p6;\ - C7 = p7;\ - \ - } \ - NAME (const T1 &p1, const T2 &p2, const T3 &p3, const T4 &p4, const T5 &p5, const T6 &p6, const T7 &p7) : C1 (p1), C2 (p2), C3 (p3), C4 (p4), C5 (p5), C6 (p6), C7 (p7) {} - -#define sql_compare_type_def_7(NAME, WHAT, NUM) \ - return WHAT##_list(d, m, true, true, true, true, true, true, true) - -#define sql_compare_type_defe_7(NAME, WHAT, NUM) \ - return WHAT##_list(d, c, m, true, true, true, true, true, true, true) - -#define sql_COMPARE__7(NAME, C1, C2, C3, C4, C5, C6, C7, C8, C9, C10, C11, C12, C13, C14, C15, C16, C17, C18, C19, C20, C21, C22, C23, C24, C25) \ - template \ - int sql_compare_##NAME (const NAME &x, const NAME &y) { \ - int cmp; \ - if (cmp = sql_cmp(x.C1 , y.C1 )) return cmp; \ - if (cmp = sql_cmp(x.C2 , y.C2 )) return cmp; \ - if (cmp = sql_cmp(x.C3 , y.C3 )) return cmp; \ - if (cmp = sql_cmp(x.C4 , y.C4 )) return cmp; \ - if (cmp = sql_cmp(x.C5 , y.C5 )) return cmp; \ - if (cmp = sql_cmp(x.C6 , y.C6 )) return cmp; \ - return sql_cmp(x.C7 , y.C7 ); \ - } \ - template \ - int compare (const NAME &x, const NAME &y) { \ - int cmp; \ - if (cmp = sql_cmp(x.C1 , y.C1 )) return cmp; \ - if (cmp = sql_cmp(x.C2 , y.C2 )) return cmp; \ - if (cmp = sql_cmp(x.C3 , y.C3 )) return cmp; \ - if (cmp = sql_cmp(x.C4 , y.C4 )) return cmp; \ - if (cmp = sql_cmp(x.C5 , y.C5 )) return cmp; \ - if (cmp = sql_cmp(x.C6 , y.C6 )) return cmp; \ - return sql_cmp(x.C7 , y.C7 ); \ - } - -// --------------------------------------------------- -// End Compare 7 -// --------------------------------------------------- - - -// --------------------------------------------------- -// Begin Compare 8 -// --------------------------------------------------- - -#define sql_compare_define_8(NAME, T1, C1, T2, C2, T3, C3, T4, C4, T5, C5, T6, C6, T7, C7, T8, C8, T9, C9, T10, C10, T11, C11, T12, C12, T13, C13, T14, C14, T15, C15, T16, C16, T17, C17, T18, C18, T19, C19, T20, C20, T21, C21, T22, C22, T23, C23, T24, C24, T25, C25) \ - NAME (const T1 &p1, const T2 &p2, const T3 &p3, const T4 &p4, const T5 &p5, const T6 &p6, const T7 &p7, const T8 &p8) : C1 (p1), C2 (p2), C3 (p3), C4 (p4), C5 (p5), C6 (p6), C7 (p7), C8 (p8) {} \ - void set (const T1 &p1, const T2 &p2, const T3 &p3, const T4 &p4, const T5 &p5, const T6 &p6, const T7 &p7, const T8 &p8) { \ - C1 = p1;\ - C1 = p1;\ - C2 = p2;\ - C1 = p1;\ - C2 = p2;\ - C3 = p3;\ - C1 = p1;\ - C2 = p2;\ - C3 = p3;\ - C4 = p4;\ - C1 = p1;\ - C2 = p2;\ - C3 = p3;\ - C4 = p4;\ - C5 = p5;\ - C1 = p1;\ - C2 = p2;\ - C3 = p3;\ - C4 = p4;\ - C5 = p5;\ - C6 = p6;\ - C1 = p1;\ - C2 = p2;\ - C3 = p3;\ - C4 = p4;\ - C5 = p5;\ - C6 = p6;\ - C7 = p7;\ - C1 = p1;\ - C2 = p2;\ - C3 = p3;\ - C4 = p4;\ - C5 = p5;\ - C6 = p6;\ - C7 = p7;\ - C8 = p8;\ - \ - } \ - sql_compare_define(NAME) - -#define sql_construct_define_8(NAME, T1, C1, T2, C2, T3, C3, T4, C4, T5, C5, T6, C6, T7, C7, T8, C8, T9, C9, T10, C10, T11, C11, T12, C12, T13, C13, T14, C14, T15, C15, T16, C16, T17, C17, T18, C18, T19, C19, T20, C20, T21, C21, T22, C22, T23, C23, T24, C24, T25, C25) \ - void set (const T1 &p1, const T2 &p2, const T3 &p3, const T4 &p4, const T5 &p5, const T6 &p6, const T7 &p7, const T8 &p8) { \ - C1 = p1;\ - C1 = p1;\ - C2 = p2;\ - C1 = p1;\ - C2 = p2;\ - C3 = p3;\ - C1 = p1;\ - C2 = p2;\ - C3 = p3;\ - C4 = p4;\ - C1 = p1;\ - C2 = p2;\ - C3 = p3;\ - C4 = p4;\ - C5 = p5;\ - C1 = p1;\ - C2 = p2;\ - C3 = p3;\ - C4 = p4;\ - C5 = p5;\ - C6 = p6;\ - C1 = p1;\ - C2 = p2;\ - C3 = p3;\ - C4 = p4;\ - C5 = p5;\ - C6 = p6;\ - C7 = p7;\ - C1 = p1;\ - C2 = p2;\ - C3 = p3;\ - C4 = p4;\ - C5 = p5;\ - C6 = p6;\ - C7 = p7;\ - C8 = p8;\ - \ - } \ - NAME (const T1 &p1, const T2 &p2, const T3 &p3, const T4 &p4, const T5 &p5, const T6 &p6, const T7 &p7, const T8 &p8) : C1 (p1), C2 (p2), C3 (p3), C4 (p4), C5 (p5), C6 (p6), C7 (p7), C8 (p8) {} - -#define sql_compare_type_def_8(NAME, WHAT, NUM) \ - return WHAT##_list(d, m, true, true, true, true, true, true, true, true) - -#define sql_compare_type_defe_8(NAME, WHAT, NUM) \ - return WHAT##_list(d, c, m, true, true, true, true, true, true, true, true) - -#define sql_COMPARE__8(NAME, C1, C2, C3, C4, C5, C6, C7, C8, C9, C10, C11, C12, C13, C14, C15, C16, C17, C18, C19, C20, C21, C22, C23, C24, C25) \ - template \ - int sql_compare_##NAME (const NAME &x, const NAME &y) { \ - int cmp; \ - if (cmp = sql_cmp(x.C1 , y.C1 )) return cmp; \ - if (cmp = sql_cmp(x.C2 , y.C2 )) return cmp; \ - if (cmp = sql_cmp(x.C3 , y.C3 )) return cmp; \ - if (cmp = sql_cmp(x.C4 , y.C4 )) return cmp; \ - if (cmp = sql_cmp(x.C5 , y.C5 )) return cmp; \ - if (cmp = sql_cmp(x.C6 , y.C6 )) return cmp; \ - if (cmp = sql_cmp(x.C7 , y.C7 )) return cmp; \ - return sql_cmp(x.C8 , y.C8 ); \ - } \ - template \ - int compare (const NAME &x, const NAME &y) { \ - int cmp; \ - if (cmp = sql_cmp(x.C1 , y.C1 )) return cmp; \ - if (cmp = sql_cmp(x.C2 , y.C2 )) return cmp; \ - if (cmp = sql_cmp(x.C3 , y.C3 )) return cmp; \ - if (cmp = sql_cmp(x.C4 , y.C4 )) return cmp; \ - if (cmp = sql_cmp(x.C5 , y.C5 )) return cmp; \ - if (cmp = sql_cmp(x.C6 , y.C6 )) return cmp; \ - if (cmp = sql_cmp(x.C7 , y.C7 )) return cmp; \ - return sql_cmp(x.C8 , y.C8 ); \ - } - -// --------------------------------------------------- -// End Compare 8 -// --------------------------------------------------- - - -// --------------------------------------------------- -// Begin Compare 9 -// --------------------------------------------------- - -#define sql_compare_define_9(NAME, T1, C1, T2, C2, T3, C3, T4, C4, T5, C5, T6, C6, T7, C7, T8, C8, T9, C9, T10, C10, T11, C11, T12, C12, T13, C13, T14, C14, T15, C15, T16, C16, T17, C17, T18, C18, T19, C19, T20, C20, T21, C21, T22, C22, T23, C23, T24, C24, T25, C25) \ - NAME (const T1 &p1, const T2 &p2, const T3 &p3, const T4 &p4, const T5 &p5, const T6 &p6, const T7 &p7, const T8 &p8, const T9 &p9) : C1 (p1), C2 (p2), C3 (p3), C4 (p4), C5 (p5), C6 (p6), C7 (p7), C8 (p8), C9 (p9) {} \ - void set (const T1 &p1, const T2 &p2, const T3 &p3, const T4 &p4, const T5 &p5, const T6 &p6, const T7 &p7, const T8 &p8, const T9 &p9) { \ - C1 = p1;\ - C1 = p1;\ - C2 = p2;\ - C1 = p1;\ - C2 = p2;\ - C3 = p3;\ - C1 = p1;\ - C2 = p2;\ - C3 = p3;\ - C4 = p4;\ - C1 = p1;\ - C2 = p2;\ - C3 = p3;\ - C4 = p4;\ - C5 = p5;\ - C1 = p1;\ - C2 = p2;\ - C3 = p3;\ - C4 = p4;\ - C5 = p5;\ - C6 = p6;\ - C1 = p1;\ - C2 = p2;\ - C3 = p3;\ - C4 = p4;\ - C5 = p5;\ - C6 = p6;\ - C7 = p7;\ - C1 = p1;\ - C2 = p2;\ - C3 = p3;\ - C4 = p4;\ - C5 = p5;\ - C6 = p6;\ - C7 = p7;\ - C8 = p8;\ - C1 = p1;\ - C2 = p2;\ - C3 = p3;\ - C4 = p4;\ - C5 = p5;\ - C6 = p6;\ - C7 = p7;\ - C8 = p8;\ - C9 = p9;\ - \ - } \ - sql_compare_define(NAME) - -#define sql_construct_define_9(NAME, T1, C1, T2, C2, T3, C3, T4, C4, T5, C5, T6, C6, T7, C7, T8, C8, T9, C9, T10, C10, T11, C11, T12, C12, T13, C13, T14, C14, T15, C15, T16, C16, T17, C17, T18, C18, T19, C19, T20, C20, T21, C21, T22, C22, T23, C23, T24, C24, T25, C25) \ - void set (const T1 &p1, const T2 &p2, const T3 &p3, const T4 &p4, const T5 &p5, const T6 &p6, const T7 &p7, const T8 &p8, const T9 &p9) { \ - C1 = p1;\ - C1 = p1;\ - C2 = p2;\ - C1 = p1;\ - C2 = p2;\ - C3 = p3;\ - C1 = p1;\ - C2 = p2;\ - C3 = p3;\ - C4 = p4;\ - C1 = p1;\ - C2 = p2;\ - C3 = p3;\ - C4 = p4;\ - C5 = p5;\ - C1 = p1;\ - C2 = p2;\ - C3 = p3;\ - C4 = p4;\ - C5 = p5;\ - C6 = p6;\ - C1 = p1;\ - C2 = p2;\ - C3 = p3;\ - C4 = p4;\ - C5 = p5;\ - C6 = p6;\ - C7 = p7;\ - C1 = p1;\ - C2 = p2;\ - C3 = p3;\ - C4 = p4;\ - C5 = p5;\ - C6 = p6;\ - C7 = p7;\ - C8 = p8;\ - C1 = p1;\ - C2 = p2;\ - C3 = p3;\ - C4 = p4;\ - C5 = p5;\ - C6 = p6;\ - C7 = p7;\ - C8 = p8;\ - C9 = p9;\ - \ - } \ - NAME (const T1 &p1, const T2 &p2, const T3 &p3, const T4 &p4, const T5 &p5, const T6 &p6, const T7 &p7, const T8 &p8, const T9 &p9) : C1 (p1), C2 (p2), C3 (p3), C4 (p4), C5 (p5), C6 (p6), C7 (p7), C8 (p8), C9 (p9) {} - -#define sql_compare_type_def_9(NAME, WHAT, NUM) \ - return WHAT##_list(d, m, true, true, true, true, true, true, true, true, true) - -#define sql_compare_type_defe_9(NAME, WHAT, NUM) \ - return WHAT##_list(d, c, m, true, true, true, true, true, true, true, true, true) - -#define sql_COMPARE__9(NAME, C1, C2, C3, C4, C5, C6, C7, C8, C9, C10, C11, C12, C13, C14, C15, C16, C17, C18, C19, C20, C21, C22, C23, C24, C25) \ - template \ - int sql_compare_##NAME (const NAME &x, const NAME &y) { \ - int cmp; \ - if (cmp = sql_cmp(x.C1 , y.C1 )) return cmp; \ - if (cmp = sql_cmp(x.C2 , y.C2 )) return cmp; \ - if (cmp = sql_cmp(x.C3 , y.C3 )) return cmp; \ - if (cmp = sql_cmp(x.C4 , y.C4 )) return cmp; \ - if (cmp = sql_cmp(x.C5 , y.C5 )) return cmp; \ - if (cmp = sql_cmp(x.C6 , y.C6 )) return cmp; \ - if (cmp = sql_cmp(x.C7 , y.C7 )) return cmp; \ - if (cmp = sql_cmp(x.C8 , y.C8 )) return cmp; \ - return sql_cmp(x.C9 , y.C9 ); \ - } \ - template \ - int compare (const NAME &x, const NAME &y) { \ - int cmp; \ - if (cmp = sql_cmp(x.C1 , y.C1 )) return cmp; \ - if (cmp = sql_cmp(x.C2 , y.C2 )) return cmp; \ - if (cmp = sql_cmp(x.C3 , y.C3 )) return cmp; \ - if (cmp = sql_cmp(x.C4 , y.C4 )) return cmp; \ - if (cmp = sql_cmp(x.C5 , y.C5 )) return cmp; \ - if (cmp = sql_cmp(x.C6 , y.C6 )) return cmp; \ - if (cmp = sql_cmp(x.C7 , y.C7 )) return cmp; \ - if (cmp = sql_cmp(x.C8 , y.C8 )) return cmp; \ - return sql_cmp(x.C9 , y.C9 ); \ - } - -// --------------------------------------------------- -// End Compare 9 -// --------------------------------------------------- - - -// --------------------------------------------------- -// Begin Compare 10 -// --------------------------------------------------- - -#define sql_compare_define_10(NAME, T1, C1, T2, C2, T3, C3, T4, C4, T5, C5, T6, C6, T7, C7, T8, C8, T9, C9, T10, C10, T11, C11, T12, C12, T13, C13, T14, C14, T15, C15, T16, C16, T17, C17, T18, C18, T19, C19, T20, C20, T21, C21, T22, C22, T23, C23, T24, C24, T25, C25) \ - NAME (const T1 &p1, const T2 &p2, const T3 &p3, const T4 &p4, const T5 &p5, const T6 &p6, const T7 &p7, const T8 &p8, const T9 &p9, const T10 &p10) : C1 (p1), C2 (p2), C3 (p3), C4 (p4), C5 (p5), C6 (p6), C7 (p7), C8 (p8), C9 (p9), C10 (p10) {} \ - void set (const T1 &p1, const T2 &p2, const T3 &p3, const T4 &p4, const T5 &p5, const T6 &p6, const T7 &p7, const T8 &p8, const T9 &p9, const T10 &p10) { \ - C1 = p1;\ - C1 = p1;\ - C2 = p2;\ - C1 = p1;\ - C2 = p2;\ - C3 = p3;\ - C1 = p1;\ - C2 = p2;\ - C3 = p3;\ - C4 = p4;\ - C1 = p1;\ - C2 = p2;\ - C3 = p3;\ - C4 = p4;\ - C5 = p5;\ - C1 = p1;\ - C2 = p2;\ - C3 = p3;\ - C4 = p4;\ - C5 = p5;\ - C6 = p6;\ - C1 = p1;\ - C2 = p2;\ - C3 = p3;\ - C4 = p4;\ - C5 = p5;\ - C6 = p6;\ - C7 = p7;\ - C1 = p1;\ - C2 = p2;\ - C3 = p3;\ - C4 = p4;\ - C5 = p5;\ - C6 = p6;\ - C7 = p7;\ - C8 = p8;\ - C1 = p1;\ - C2 = p2;\ - C3 = p3;\ - C4 = p4;\ - C5 = p5;\ - C6 = p6;\ - C7 = p7;\ - C8 = p8;\ - C9 = p9;\ - C1 = p1;\ - C2 = p2;\ - C3 = p3;\ - C4 = p4;\ - C5 = p5;\ - C6 = p6;\ - C7 = p7;\ - C8 = p8;\ - C9 = p9;\ - C10 = p10;\ - \ - } \ - sql_compare_define(NAME) - -#define sql_construct_define_10(NAME, T1, C1, T2, C2, T3, C3, T4, C4, T5, C5, T6, C6, T7, C7, T8, C8, T9, C9, T10, C10, T11, C11, T12, C12, T13, C13, T14, C14, T15, C15, T16, C16, T17, C17, T18, C18, T19, C19, T20, C20, T21, C21, T22, C22, T23, C23, T24, C24, T25, C25) \ - void set (const T1 &p1, const T2 &p2, const T3 &p3, const T4 &p4, const T5 &p5, const T6 &p6, const T7 &p7, const T8 &p8, const T9 &p9, const T10 &p10) { \ - C1 = p1;\ - C1 = p1;\ - C2 = p2;\ - C1 = p1;\ - C2 = p2;\ - C3 = p3;\ - C1 = p1;\ - C2 = p2;\ - C3 = p3;\ - C4 = p4;\ - C1 = p1;\ - C2 = p2;\ - C3 = p3;\ - C4 = p4;\ - C5 = p5;\ - C1 = p1;\ - C2 = p2;\ - C3 = p3;\ - C4 = p4;\ - C5 = p5;\ - C6 = p6;\ - C1 = p1;\ - C2 = p2;\ - C3 = p3;\ - C4 = p4;\ - C5 = p5;\ - C6 = p6;\ - C7 = p7;\ - C1 = p1;\ - C2 = p2;\ - C3 = p3;\ - C4 = p4;\ - C5 = p5;\ - C6 = p6;\ - C7 = p7;\ - C8 = p8;\ - C1 = p1;\ - C2 = p2;\ - C3 = p3;\ - C4 = p4;\ - C5 = p5;\ - C6 = p6;\ - C7 = p7;\ - C8 = p8;\ - C9 = p9;\ - C1 = p1;\ - C2 = p2;\ - C3 = p3;\ - C4 = p4;\ - C5 = p5;\ - C6 = p6;\ - C7 = p7;\ - C8 = p8;\ - C9 = p9;\ - C10 = p10;\ - \ - } \ - NAME (const T1 &p1, const T2 &p2, const T3 &p3, const T4 &p4, const T5 &p5, const T6 &p6, const T7 &p7, const T8 &p8, const T9 &p9, const T10 &p10) : C1 (p1), C2 (p2), C3 (p3), C4 (p4), C5 (p5), C6 (p6), C7 (p7), C8 (p8), C9 (p9), C10 (p10) {} - -#define sql_compare_type_def_10(NAME, WHAT, NUM) \ - return WHAT##_list(d, m, true, true, true, true, true, true, true, true, true, true) - -#define sql_compare_type_defe_10(NAME, WHAT, NUM) \ - return WHAT##_list(d, c, m, true, true, true, true, true, true, true, true, true, true) - -#define sql_COMPARE__10(NAME, C1, C2, C3, C4, C5, C6, C7, C8, C9, C10, C11, C12, C13, C14, C15, C16, C17, C18, C19, C20, C21, C22, C23, C24, C25) \ - template \ - int sql_compare_##NAME (const NAME &x, const NAME &y) { \ - int cmp; \ - if (cmp = sql_cmp(x.C1 , y.C1 )) return cmp; \ - if (cmp = sql_cmp(x.C2 , y.C2 )) return cmp; \ - if (cmp = sql_cmp(x.C3 , y.C3 )) return cmp; \ - if (cmp = sql_cmp(x.C4 , y.C4 )) return cmp; \ - if (cmp = sql_cmp(x.C5 , y.C5 )) return cmp; \ - if (cmp = sql_cmp(x.C6 , y.C6 )) return cmp; \ - if (cmp = sql_cmp(x.C7 , y.C7 )) return cmp; \ - if (cmp = sql_cmp(x.C8 , y.C8 )) return cmp; \ - if (cmp = sql_cmp(x.C9 , y.C9 )) return cmp; \ - return sql_cmp(x.C10 , y.C10 ); \ - } \ - template \ - int compare (const NAME &x, const NAME &y) { \ - int cmp; \ - if (cmp = sql_cmp(x.C1 , y.C1 )) return cmp; \ - if (cmp = sql_cmp(x.C2 , y.C2 )) return cmp; \ - if (cmp = sql_cmp(x.C3 , y.C3 )) return cmp; \ - if (cmp = sql_cmp(x.C4 , y.C4 )) return cmp; \ - if (cmp = sql_cmp(x.C5 , y.C5 )) return cmp; \ - if (cmp = sql_cmp(x.C6 , y.C6 )) return cmp; \ - if (cmp = sql_cmp(x.C7 , y.C7 )) return cmp; \ - if (cmp = sql_cmp(x.C8 , y.C8 )) return cmp; \ - if (cmp = sql_cmp(x.C9 , y.C9 )) return cmp; \ - return sql_cmp(x.C10 , y.C10 ); \ - } - -// --------------------------------------------------- -// End Compare 10 -// --------------------------------------------------- - - -// --------------------------------------------------- -// Begin Compare 11 -// --------------------------------------------------- - -#define sql_compare_define_11(NAME, T1, C1, T2, C2, T3, C3, T4, C4, T5, C5, T6, C6, T7, C7, T8, C8, T9, C9, T10, C10, T11, C11, T12, C12, T13, C13, T14, C14, T15, C15, T16, C16, T17, C17, T18, C18, T19, C19, T20, C20, T21, C21, T22, C22, T23, C23, T24, C24, T25, C25) \ - NAME (const T1 &p1, const T2 &p2, const T3 &p3, const T4 &p4, const T5 &p5, const T6 &p6, const T7 &p7, const T8 &p8, const T9 &p9, const T10 &p10, const T11 &p11) : C1 (p1), C2 (p2), C3 (p3), C4 (p4), C5 (p5), C6 (p6), C7 (p7), C8 (p8), C9 (p9), C10 (p10), C11 (p11) {} \ - void set (const T1 &p1, const T2 &p2, const T3 &p3, const T4 &p4, const T5 &p5, const T6 &p6, const T7 &p7, const T8 &p8, const T9 &p9, const T10 &p10, const T11 &p11) { \ - C1 = p1;\ - C1 = p1;\ - C2 = p2;\ - C1 = p1;\ - C2 = p2;\ - C3 = p3;\ - C1 = p1;\ - C2 = p2;\ - C3 = p3;\ - C4 = p4;\ - C1 = p1;\ - C2 = p2;\ - C3 = p3;\ - C4 = p4;\ - C5 = p5;\ - C1 = p1;\ - C2 = p2;\ - C3 = p3;\ - C4 = p4;\ - C5 = p5;\ - C6 = p6;\ - C1 = p1;\ - C2 = p2;\ - C3 = p3;\ - C4 = p4;\ - C5 = p5;\ - C6 = p6;\ - C7 = p7;\ - C1 = p1;\ - C2 = p2;\ - C3 = p3;\ - C4 = p4;\ - C5 = p5;\ - C6 = p6;\ - C7 = p7;\ - C8 = p8;\ - C1 = p1;\ - C2 = p2;\ - C3 = p3;\ - C4 = p4;\ - C5 = p5;\ - C6 = p6;\ - C7 = p7;\ - C8 = p8;\ - C9 = p9;\ - C1 = p1;\ - C2 = p2;\ - C3 = p3;\ - C4 = p4;\ - C5 = p5;\ - C6 = p6;\ - C7 = p7;\ - C8 = p8;\ - C9 = p9;\ - C10 = p10;\ - C1 = p1;\ - C2 = p2;\ - C3 = p3;\ - C4 = p4;\ - C5 = p5;\ - C6 = p6;\ - C7 = p7;\ - C8 = p8;\ - C9 = p9;\ - C10 = p10;\ - C11 = p11;\ - \ - } \ - sql_compare_define(NAME) - -#define sql_construct_define_11(NAME, T1, C1, T2, C2, T3, C3, T4, C4, T5, C5, T6, C6, T7, C7, T8, C8, T9, C9, T10, C10, T11, C11, T12, C12, T13, C13, T14, C14, T15, C15, T16, C16, T17, C17, T18, C18, T19, C19, T20, C20, T21, C21, T22, C22, T23, C23, T24, C24, T25, C25) \ - void set (const T1 &p1, const T2 &p2, const T3 &p3, const T4 &p4, const T5 &p5, const T6 &p6, const T7 &p7, const T8 &p8, const T9 &p9, const T10 &p10, const T11 &p11) { \ - C1 = p1;\ - C1 = p1;\ - C2 = p2;\ - C1 = p1;\ - C2 = p2;\ - C3 = p3;\ - C1 = p1;\ - C2 = p2;\ - C3 = p3;\ - C4 = p4;\ - C1 = p1;\ - C2 = p2;\ - C3 = p3;\ - C4 = p4;\ - C5 = p5;\ - C1 = p1;\ - C2 = p2;\ - C3 = p3;\ - C4 = p4;\ - C5 = p5;\ - C6 = p6;\ - C1 = p1;\ - C2 = p2;\ - C3 = p3;\ - C4 = p4;\ - C5 = p5;\ - C6 = p6;\ - C7 = p7;\ - C1 = p1;\ - C2 = p2;\ - C3 = p3;\ - C4 = p4;\ - C5 = p5;\ - C6 = p6;\ - C7 = p7;\ - C8 = p8;\ - C1 = p1;\ - C2 = p2;\ - C3 = p3;\ - C4 = p4;\ - C5 = p5;\ - C6 = p6;\ - C7 = p7;\ - C8 = p8;\ - C9 = p9;\ - C1 = p1;\ - C2 = p2;\ - C3 = p3;\ - C4 = p4;\ - C5 = p5;\ - C6 = p6;\ - C7 = p7;\ - C8 = p8;\ - C9 = p9;\ - C10 = p10;\ - C1 = p1;\ - C2 = p2;\ - C3 = p3;\ - C4 = p4;\ - C5 = p5;\ - C6 = p6;\ - C7 = p7;\ - C8 = p8;\ - C9 = p9;\ - C10 = p10;\ - C11 = p11;\ - \ - } \ - NAME (const T1 &p1, const T2 &p2, const T3 &p3, const T4 &p4, const T5 &p5, const T6 &p6, const T7 &p7, const T8 &p8, const T9 &p9, const T10 &p10, const T11 &p11) : C1 (p1), C2 (p2), C3 (p3), C4 (p4), C5 (p5), C6 (p6), C7 (p7), C8 (p8), C9 (p9), C10 (p10), C11 (p11) {} - -#define sql_compare_type_def_11(NAME, WHAT, NUM) \ - return WHAT##_list(d, m, true, true, true, true, true, true, true, true, true, true, true) - -#define sql_compare_type_defe_11(NAME, WHAT, NUM) \ - return WHAT##_list(d, c, m, true, true, true, true, true, true, true, true, true, true, true) - -#define sql_COMPARE__11(NAME, C1, C2, C3, C4, C5, C6, C7, C8, C9, C10, C11, C12, C13, C14, C15, C16, C17, C18, C19, C20, C21, C22, C23, C24, C25) \ - template \ - int sql_compare_##NAME (const NAME &x, const NAME &y) { \ - int cmp; \ - if (cmp = sql_cmp(x.C1 , y.C1 )) return cmp; \ - if (cmp = sql_cmp(x.C2 , y.C2 )) return cmp; \ - if (cmp = sql_cmp(x.C3 , y.C3 )) return cmp; \ - if (cmp = sql_cmp(x.C4 , y.C4 )) return cmp; \ - if (cmp = sql_cmp(x.C5 , y.C5 )) return cmp; \ - if (cmp = sql_cmp(x.C6 , y.C6 )) return cmp; \ - if (cmp = sql_cmp(x.C7 , y.C7 )) return cmp; \ - if (cmp = sql_cmp(x.C8 , y.C8 )) return cmp; \ - if (cmp = sql_cmp(x.C9 , y.C9 )) return cmp; \ - if (cmp = sql_cmp(x.C10 , y.C10 )) return cmp; \ - return sql_cmp(x.C11 , y.C11 ); \ - } \ - template \ - int compare (const NAME &x, const NAME &y) { \ - int cmp; \ - if (cmp = sql_cmp(x.C1 , y.C1 )) return cmp; \ - if (cmp = sql_cmp(x.C2 , y.C2 )) return cmp; \ - if (cmp = sql_cmp(x.C3 , y.C3 )) return cmp; \ - if (cmp = sql_cmp(x.C4 , y.C4 )) return cmp; \ - if (cmp = sql_cmp(x.C5 , y.C5 )) return cmp; \ - if (cmp = sql_cmp(x.C6 , y.C6 )) return cmp; \ - if (cmp = sql_cmp(x.C7 , y.C7 )) return cmp; \ - if (cmp = sql_cmp(x.C8 , y.C8 )) return cmp; \ - if (cmp = sql_cmp(x.C9 , y.C9 )) return cmp; \ - if (cmp = sql_cmp(x.C10 , y.C10 )) return cmp; \ - return sql_cmp(x.C11 , y.C11 ); \ - } - -// --------------------------------------------------- -// End Compare 11 -// --------------------------------------------------- - - -// --------------------------------------------------- -// Begin Compare 12 -// --------------------------------------------------- - -#define sql_compare_define_12(NAME, T1, C1, T2, C2, T3, C3, T4, C4, T5, C5, T6, C6, T7, C7, T8, C8, T9, C9, T10, C10, T11, C11, T12, C12, T13, C13, T14, C14, T15, C15, T16, C16, T17, C17, T18, C18, T19, C19, T20, C20, T21, C21, T22, C22, T23, C23, T24, C24, T25, C25) \ - NAME (const T1 &p1, const T2 &p2, const T3 &p3, const T4 &p4, const T5 &p5, const T6 &p6, const T7 &p7, const T8 &p8, const T9 &p9, const T10 &p10, const T11 &p11, const T12 &p12) : C1 (p1), C2 (p2), C3 (p3), C4 (p4), C5 (p5), C6 (p6), C7 (p7), C8 (p8), C9 (p9), C10 (p10), C11 (p11), C12 (p12) {} \ - void set (const T1 &p1, const T2 &p2, const T3 &p3, const T4 &p4, const T5 &p5, const T6 &p6, const T7 &p7, const T8 &p8, const T9 &p9, const T10 &p10, const T11 &p11, const T12 &p12) { \ - C1 = p1;\ - C1 = p1;\ - C2 = p2;\ - C1 = p1;\ - C2 = p2;\ - C3 = p3;\ - C1 = p1;\ - C2 = p2;\ - C3 = p3;\ - C4 = p4;\ - C1 = p1;\ - C2 = p2;\ - C3 = p3;\ - C4 = p4;\ - C5 = p5;\ - C1 = p1;\ - C2 = p2;\ - C3 = p3;\ - C4 = p4;\ - C5 = p5;\ - C6 = p6;\ - C1 = p1;\ - C2 = p2;\ - C3 = p3;\ - C4 = p4;\ - C5 = p5;\ - C6 = p6;\ - C7 = p7;\ - C1 = p1;\ - C2 = p2;\ - C3 = p3;\ - C4 = p4;\ - C5 = p5;\ - C6 = p6;\ - C7 = p7;\ - C8 = p8;\ - C1 = p1;\ - C2 = p2;\ - C3 = p3;\ - C4 = p4;\ - C5 = p5;\ - C6 = p6;\ - C7 = p7;\ - C8 = p8;\ - C9 = p9;\ - C1 = p1;\ - C2 = p2;\ - C3 = p3;\ - C4 = p4;\ - C5 = p5;\ - C6 = p6;\ - C7 = p7;\ - C8 = p8;\ - C9 = p9;\ - C10 = p10;\ - C1 = p1;\ - C2 = p2;\ - C3 = p3;\ - C4 = p4;\ - C5 = p5;\ - C6 = p6;\ - C7 = p7;\ - C8 = p8;\ - C9 = p9;\ - C10 = p10;\ - C11 = p11;\ - C1 = p1;\ - C2 = p2;\ - C3 = p3;\ - C4 = p4;\ - C5 = p5;\ - C6 = p6;\ - C7 = p7;\ - C8 = p8;\ - C9 = p9;\ - C10 = p10;\ - C11 = p11;\ - C12 = p12;\ - \ - } \ - sql_compare_define(NAME) - -#define sql_construct_define_12(NAME, T1, C1, T2, C2, T3, C3, T4, C4, T5, C5, T6, C6, T7, C7, T8, C8, T9, C9, T10, C10, T11, C11, T12, C12, T13, C13, T14, C14, T15, C15, T16, C16, T17, C17, T18, C18, T19, C19, T20, C20, T21, C21, T22, C22, T23, C23, T24, C24, T25, C25) \ - void set (const T1 &p1, const T2 &p2, const T3 &p3, const T4 &p4, const T5 &p5, const T6 &p6, const T7 &p7, const T8 &p8, const T9 &p9, const T10 &p10, const T11 &p11, const T12 &p12) { \ - C1 = p1;\ - C1 = p1;\ - C2 = p2;\ - C1 = p1;\ - C2 = p2;\ - C3 = p3;\ - C1 = p1;\ - C2 = p2;\ - C3 = p3;\ - C4 = p4;\ - C1 = p1;\ - C2 = p2;\ - C3 = p3;\ - C4 = p4;\ - C5 = p5;\ - C1 = p1;\ - C2 = p2;\ - C3 = p3;\ - C4 = p4;\ - C5 = p5;\ - C6 = p6;\ - C1 = p1;\ - C2 = p2;\ - C3 = p3;\ - C4 = p4;\ - C5 = p5;\ - C6 = p6;\ - C7 = p7;\ - C1 = p1;\ - C2 = p2;\ - C3 = p3;\ - C4 = p4;\ - C5 = p5;\ - C6 = p6;\ - C7 = p7;\ - C8 = p8;\ - C1 = p1;\ - C2 = p2;\ - C3 = p3;\ - C4 = p4;\ - C5 = p5;\ - C6 = p6;\ - C7 = p7;\ - C8 = p8;\ - C9 = p9;\ - C1 = p1;\ - C2 = p2;\ - C3 = p3;\ - C4 = p4;\ - C5 = p5;\ - C6 = p6;\ - C7 = p7;\ - C8 = p8;\ - C9 = p9;\ - C10 = p10;\ - C1 = p1;\ - C2 = p2;\ - C3 = p3;\ - C4 = p4;\ - C5 = p5;\ - C6 = p6;\ - C7 = p7;\ - C8 = p8;\ - C9 = p9;\ - C10 = p10;\ - C11 = p11;\ - C1 = p1;\ - C2 = p2;\ - C3 = p3;\ - C4 = p4;\ - C5 = p5;\ - C6 = p6;\ - C7 = p7;\ - C8 = p8;\ - C9 = p9;\ - C10 = p10;\ - C11 = p11;\ - C12 = p12;\ - \ - } \ - NAME (const T1 &p1, const T2 &p2, const T3 &p3, const T4 &p4, const T5 &p5, const T6 &p6, const T7 &p7, const T8 &p8, const T9 &p9, const T10 &p10, const T11 &p11, const T12 &p12) : C1 (p1), C2 (p2), C3 (p3), C4 (p4), C5 (p5), C6 (p6), C7 (p7), C8 (p8), C9 (p9), C10 (p10), C11 (p11), C12 (p12) {} - -#define sql_compare_type_def_12(NAME, WHAT, NUM) \ - return WHAT##_list(d, m, true, true, true, true, true, true, true, true, true, true, true, true) - -#define sql_compare_type_defe_12(NAME, WHAT, NUM) \ - return WHAT##_list(d, c, m, true, true, true, true, true, true, true, true, true, true, true, true) - -#define sql_COMPARE__12(NAME, C1, C2, C3, C4, C5, C6, C7, C8, C9, C10, C11, C12, C13, C14, C15, C16, C17, C18, C19, C20, C21, C22, C23, C24, C25) \ - template \ - int sql_compare_##NAME (const NAME &x, const NAME &y) { \ - int cmp; \ - if (cmp = sql_cmp(x.C1 , y.C1 )) return cmp; \ - if (cmp = sql_cmp(x.C2 , y.C2 )) return cmp; \ - if (cmp = sql_cmp(x.C3 , y.C3 )) return cmp; \ - if (cmp = sql_cmp(x.C4 , y.C4 )) return cmp; \ - if (cmp = sql_cmp(x.C5 , y.C5 )) return cmp; \ - if (cmp = sql_cmp(x.C6 , y.C6 )) return cmp; \ - if (cmp = sql_cmp(x.C7 , y.C7 )) return cmp; \ - if (cmp = sql_cmp(x.C8 , y.C8 )) return cmp; \ - if (cmp = sql_cmp(x.C9 , y.C9 )) return cmp; \ - if (cmp = sql_cmp(x.C10 , y.C10 )) return cmp; \ - if (cmp = sql_cmp(x.C11 , y.C11 )) return cmp; \ - return sql_cmp(x.C12 , y.C12 ); \ - } \ - template \ - int compare (const NAME &x, const NAME &y) { \ - int cmp; \ - if (cmp = sql_cmp(x.C1 , y.C1 )) return cmp; \ - if (cmp = sql_cmp(x.C2 , y.C2 )) return cmp; \ - if (cmp = sql_cmp(x.C3 , y.C3 )) return cmp; \ - if (cmp = sql_cmp(x.C4 , y.C4 )) return cmp; \ - if (cmp = sql_cmp(x.C5 , y.C5 )) return cmp; \ - if (cmp = sql_cmp(x.C6 , y.C6 )) return cmp; \ - if (cmp = sql_cmp(x.C7 , y.C7 )) return cmp; \ - if (cmp = sql_cmp(x.C8 , y.C8 )) return cmp; \ - if (cmp = sql_cmp(x.C9 , y.C9 )) return cmp; \ - if (cmp = sql_cmp(x.C10 , y.C10 )) return cmp; \ - if (cmp = sql_cmp(x.C11 , y.C11 )) return cmp; \ - return sql_cmp(x.C12 , y.C12 ); \ - } - -// --------------------------------------------------- -// End Compare 12 -// --------------------------------------------------- - - -// --------------------------------------------------- -// Begin Compare 13 -// --------------------------------------------------- - -#define sql_compare_define_13(NAME, T1, C1, T2, C2, T3, C3, T4, C4, T5, C5, T6, C6, T7, C7, T8, C8, T9, C9, T10, C10, T11, C11, T12, C12, T13, C13, T14, C14, T15, C15, T16, C16, T17, C17, T18, C18, T19, C19, T20, C20, T21, C21, T22, C22, T23, C23, T24, C24, T25, C25) \ - NAME (const T1 &p1, const T2 &p2, const T3 &p3, const T4 &p4, const T5 &p5, const T6 &p6, const T7 &p7, const T8 &p8, const T9 &p9, const T10 &p10, const T11 &p11, const T12 &p12, const T13 &p13) : C1 (p1), C2 (p2), C3 (p3), C4 (p4), C5 (p5), C6 (p6), C7 (p7), C8 (p8), C9 (p9), C10 (p10), C11 (p11), C12 (p12), C13 (p13) {} \ - void set (const T1 &p1, const T2 &p2, const T3 &p3, const T4 &p4, const T5 &p5, const T6 &p6, const T7 &p7, const T8 &p8, const T9 &p9, const T10 &p10, const T11 &p11, const T12 &p12, const T13 &p13) { \ - C1 = p1;\ - C1 = p1;\ - C2 = p2;\ - C1 = p1;\ - C2 = p2;\ - C3 = p3;\ - C1 = p1;\ - C2 = p2;\ - C3 = p3;\ - C4 = p4;\ - C1 = p1;\ - C2 = p2;\ - C3 = p3;\ - C4 = p4;\ - C5 = p5;\ - C1 = p1;\ - C2 = p2;\ - C3 = p3;\ - C4 = p4;\ - C5 = p5;\ - C6 = p6;\ - C1 = p1;\ - C2 = p2;\ - C3 = p3;\ - C4 = p4;\ - C5 = p5;\ - C6 = p6;\ - C7 = p7;\ - C1 = p1;\ - C2 = p2;\ - C3 = p3;\ - C4 = p4;\ - C5 = p5;\ - C6 = p6;\ - C7 = p7;\ - C8 = p8;\ - C1 = p1;\ - C2 = p2;\ - C3 = p3;\ - C4 = p4;\ - C5 = p5;\ - C6 = p6;\ - C7 = p7;\ - C8 = p8;\ - C9 = p9;\ - C1 = p1;\ - C2 = p2;\ - C3 = p3;\ - C4 = p4;\ - C5 = p5;\ - C6 = p6;\ - C7 = p7;\ - C8 = p8;\ - C9 = p9;\ - C10 = p10;\ - C1 = p1;\ - C2 = p2;\ - C3 = p3;\ - C4 = p4;\ - C5 = p5;\ - C6 = p6;\ - C7 = p7;\ - C8 = p8;\ - C9 = p9;\ - C10 = p10;\ - C11 = p11;\ - C1 = p1;\ - C2 = p2;\ - C3 = p3;\ - C4 = p4;\ - C5 = p5;\ - C6 = p6;\ - C7 = p7;\ - C8 = p8;\ - C9 = p9;\ - C10 = p10;\ - C11 = p11;\ - C12 = p12;\ - C1 = p1;\ - C2 = p2;\ - C3 = p3;\ - C4 = p4;\ - C5 = p5;\ - C6 = p6;\ - C7 = p7;\ - C8 = p8;\ - C9 = p9;\ - C10 = p10;\ - C11 = p11;\ - C12 = p12;\ - C13 = p13;\ - \ - } \ - sql_compare_define(NAME) - -#define sql_construct_define_13(NAME, T1, C1, T2, C2, T3, C3, T4, C4, T5, C5, T6, C6, T7, C7, T8, C8, T9, C9, T10, C10, T11, C11, T12, C12, T13, C13, T14, C14, T15, C15, T16, C16, T17, C17, T18, C18, T19, C19, T20, C20, T21, C21, T22, C22, T23, C23, T24, C24, T25, C25) \ - void set (const T1 &p1, const T2 &p2, const T3 &p3, const T4 &p4, const T5 &p5, const T6 &p6, const T7 &p7, const T8 &p8, const T9 &p9, const T10 &p10, const T11 &p11, const T12 &p12, const T13 &p13) { \ - C1 = p1;\ - C1 = p1;\ - C2 = p2;\ - C1 = p1;\ - C2 = p2;\ - C3 = p3;\ - C1 = p1;\ - C2 = p2;\ - C3 = p3;\ - C4 = p4;\ - C1 = p1;\ - C2 = p2;\ - C3 = p3;\ - C4 = p4;\ - C5 = p5;\ - C1 = p1;\ - C2 = p2;\ - C3 = p3;\ - C4 = p4;\ - C5 = p5;\ - C6 = p6;\ - C1 = p1;\ - C2 = p2;\ - C3 = p3;\ - C4 = p4;\ - C5 = p5;\ - C6 = p6;\ - C7 = p7;\ - C1 = p1;\ - C2 = p2;\ - C3 = p3;\ - C4 = p4;\ - C5 = p5;\ - C6 = p6;\ - C7 = p7;\ - C8 = p8;\ - C1 = p1;\ - C2 = p2;\ - C3 = p3;\ - C4 = p4;\ - C5 = p5;\ - C6 = p6;\ - C7 = p7;\ - C8 = p8;\ - C9 = p9;\ - C1 = p1;\ - C2 = p2;\ - C3 = p3;\ - C4 = p4;\ - C5 = p5;\ - C6 = p6;\ - C7 = p7;\ - C8 = p8;\ - C9 = p9;\ - C10 = p10;\ - C1 = p1;\ - C2 = p2;\ - C3 = p3;\ - C4 = p4;\ - C5 = p5;\ - C6 = p6;\ - C7 = p7;\ - C8 = p8;\ - C9 = p9;\ - C10 = p10;\ - C11 = p11;\ - C1 = p1;\ - C2 = p2;\ - C3 = p3;\ - C4 = p4;\ - C5 = p5;\ - C6 = p6;\ - C7 = p7;\ - C8 = p8;\ - C9 = p9;\ - C10 = p10;\ - C11 = p11;\ - C12 = p12;\ - C1 = p1;\ - C2 = p2;\ - C3 = p3;\ - C4 = p4;\ - C5 = p5;\ - C6 = p6;\ - C7 = p7;\ - C8 = p8;\ - C9 = p9;\ - C10 = p10;\ - C11 = p11;\ - C12 = p12;\ - C13 = p13;\ - \ - } \ - NAME (const T1 &p1, const T2 &p2, const T3 &p3, const T4 &p4, const T5 &p5, const T6 &p6, const T7 &p7, const T8 &p8, const T9 &p9, const T10 &p10, const T11 &p11, const T12 &p12, const T13 &p13) : C1 (p1), C2 (p2), C3 (p3), C4 (p4), C5 (p5), C6 (p6), C7 (p7), C8 (p8), C9 (p9), C10 (p10), C11 (p11), C12 (p12), C13 (p13) {} - -#define sql_compare_type_def_13(NAME, WHAT, NUM) \ - return WHAT##_list(d, m, true, true, true, true, true, true, true, true, true, true, true, true, true) - -#define sql_compare_type_defe_13(NAME, WHAT, NUM) \ - return WHAT##_list(d, c, m, true, true, true, true, true, true, true, true, true, true, true, true, true) - -#define sql_COMPARE__13(NAME, C1, C2, C3, C4, C5, C6, C7, C8, C9, C10, C11, C12, C13, C14, C15, C16, C17, C18, C19, C20, C21, C22, C23, C24, C25) \ - template \ - int sql_compare_##NAME (const NAME &x, const NAME &y) { \ - int cmp; \ - if (cmp = sql_cmp(x.C1 , y.C1 )) return cmp; \ - if (cmp = sql_cmp(x.C2 , y.C2 )) return cmp; \ - if (cmp = sql_cmp(x.C3 , y.C3 )) return cmp; \ - if (cmp = sql_cmp(x.C4 , y.C4 )) return cmp; \ - if (cmp = sql_cmp(x.C5 , y.C5 )) return cmp; \ - if (cmp = sql_cmp(x.C6 , y.C6 )) return cmp; \ - if (cmp = sql_cmp(x.C7 , y.C7 )) return cmp; \ - if (cmp = sql_cmp(x.C8 , y.C8 )) return cmp; \ - if (cmp = sql_cmp(x.C9 , y.C9 )) return cmp; \ - if (cmp = sql_cmp(x.C10 , y.C10 )) return cmp; \ - if (cmp = sql_cmp(x.C11 , y.C11 )) return cmp; \ - if (cmp = sql_cmp(x.C12 , y.C12 )) return cmp; \ - return sql_cmp(x.C13 , y.C13 ); \ - } \ - template \ - int compare (const NAME &x, const NAME &y) { \ - int cmp; \ - if (cmp = sql_cmp(x.C1 , y.C1 )) return cmp; \ - if (cmp = sql_cmp(x.C2 , y.C2 )) return cmp; \ - if (cmp = sql_cmp(x.C3 , y.C3 )) return cmp; \ - if (cmp = sql_cmp(x.C4 , y.C4 )) return cmp; \ - if (cmp = sql_cmp(x.C5 , y.C5 )) return cmp; \ - if (cmp = sql_cmp(x.C6 , y.C6 )) return cmp; \ - if (cmp = sql_cmp(x.C7 , y.C7 )) return cmp; \ - if (cmp = sql_cmp(x.C8 , y.C8 )) return cmp; \ - if (cmp = sql_cmp(x.C9 , y.C9 )) return cmp; \ - if (cmp = sql_cmp(x.C10 , y.C10 )) return cmp; \ - if (cmp = sql_cmp(x.C11 , y.C11 )) return cmp; \ - if (cmp = sql_cmp(x.C12 , y.C12 )) return cmp; \ - return sql_cmp(x.C13 , y.C13 ); \ - } - -// --------------------------------------------------- -// End Compare 13 -// --------------------------------------------------- - - -// --------------------------------------------------- -// Begin Compare 14 -// --------------------------------------------------- - -#define sql_compare_define_14(NAME, T1, C1, T2, C2, T3, C3, T4, C4, T5, C5, T6, C6, T7, C7, T8, C8, T9, C9, T10, C10, T11, C11, T12, C12, T13, C13, T14, C14, T15, C15, T16, C16, T17, C17, T18, C18, T19, C19, T20, C20, T21, C21, T22, C22, T23, C23, T24, C24, T25, C25) \ - NAME (const T1 &p1, const T2 &p2, const T3 &p3, const T4 &p4, const T5 &p5, const T6 &p6, const T7 &p7, const T8 &p8, const T9 &p9, const T10 &p10, const T11 &p11, const T12 &p12, const T13 &p13, const T14 &p14) : C1 (p1), C2 (p2), C3 (p3), C4 (p4), C5 (p5), C6 (p6), C7 (p7), C8 (p8), C9 (p9), C10 (p10), C11 (p11), C12 (p12), C13 (p13), C14 (p14) {} \ - void set (const T1 &p1, const T2 &p2, const T3 &p3, const T4 &p4, const T5 &p5, const T6 &p6, const T7 &p7, const T8 &p8, const T9 &p9, const T10 &p10, const T11 &p11, const T12 &p12, const T13 &p13, const T14 &p14) { \ - C1 = p1;\ - C1 = p1;\ - C2 = p2;\ - C1 = p1;\ - C2 = p2;\ - C3 = p3;\ - C1 = p1;\ - C2 = p2;\ - C3 = p3;\ - C4 = p4;\ - C1 = p1;\ - C2 = p2;\ - C3 = p3;\ - C4 = p4;\ - C5 = p5;\ - C1 = p1;\ - C2 = p2;\ - C3 = p3;\ - C4 = p4;\ - C5 = p5;\ - C6 = p6;\ - C1 = p1;\ - C2 = p2;\ - C3 = p3;\ - C4 = p4;\ - C5 = p5;\ - C6 = p6;\ - C7 = p7;\ - C1 = p1;\ - C2 = p2;\ - C3 = p3;\ - C4 = p4;\ - C5 = p5;\ - C6 = p6;\ - C7 = p7;\ - C8 = p8;\ - C1 = p1;\ - C2 = p2;\ - C3 = p3;\ - C4 = p4;\ - C5 = p5;\ - C6 = p6;\ - C7 = p7;\ - C8 = p8;\ - C9 = p9;\ - C1 = p1;\ - C2 = p2;\ - C3 = p3;\ - C4 = p4;\ - C5 = p5;\ - C6 = p6;\ - C7 = p7;\ - C8 = p8;\ - C9 = p9;\ - C10 = p10;\ - C1 = p1;\ - C2 = p2;\ - C3 = p3;\ - C4 = p4;\ - C5 = p5;\ - C6 = p6;\ - C7 = p7;\ - C8 = p8;\ - C9 = p9;\ - C10 = p10;\ - C11 = p11;\ - C1 = p1;\ - C2 = p2;\ - C3 = p3;\ - C4 = p4;\ - C5 = p5;\ - C6 = p6;\ - C7 = p7;\ - C8 = p8;\ - C9 = p9;\ - C10 = p10;\ - C11 = p11;\ - C12 = p12;\ - C1 = p1;\ - C2 = p2;\ - C3 = p3;\ - C4 = p4;\ - C5 = p5;\ - C6 = p6;\ - C7 = p7;\ - C8 = p8;\ - C9 = p9;\ - C10 = p10;\ - C11 = p11;\ - C12 = p12;\ - C13 = p13;\ - C1 = p1;\ - C2 = p2;\ - C3 = p3;\ - C4 = p4;\ - C5 = p5;\ - C6 = p6;\ - C7 = p7;\ - C8 = p8;\ - C9 = p9;\ - C10 = p10;\ - C11 = p11;\ - C12 = p12;\ - C13 = p13;\ - C14 = p14;\ - \ - } \ - sql_compare_define(NAME) - -#define sql_construct_define_14(NAME, T1, C1, T2, C2, T3, C3, T4, C4, T5, C5, T6, C6, T7, C7, T8, C8, T9, C9, T10, C10, T11, C11, T12, C12, T13, C13, T14, C14, T15, C15, T16, C16, T17, C17, T18, C18, T19, C19, T20, C20, T21, C21, T22, C22, T23, C23, T24, C24, T25, C25) \ - void set (const T1 &p1, const T2 &p2, const T3 &p3, const T4 &p4, const T5 &p5, const T6 &p6, const T7 &p7, const T8 &p8, const T9 &p9, const T10 &p10, const T11 &p11, const T12 &p12, const T13 &p13, const T14 &p14) { \ - C1 = p1;\ - C1 = p1;\ - C2 = p2;\ - C1 = p1;\ - C2 = p2;\ - C3 = p3;\ - C1 = p1;\ - C2 = p2;\ - C3 = p3;\ - C4 = p4;\ - C1 = p1;\ - C2 = p2;\ - C3 = p3;\ - C4 = p4;\ - C5 = p5;\ - C1 = p1;\ - C2 = p2;\ - C3 = p3;\ - C4 = p4;\ - C5 = p5;\ - C6 = p6;\ - C1 = p1;\ - C2 = p2;\ - C3 = p3;\ - C4 = p4;\ - C5 = p5;\ - C6 = p6;\ - C7 = p7;\ - C1 = p1;\ - C2 = p2;\ - C3 = p3;\ - C4 = p4;\ - C5 = p5;\ - C6 = p6;\ - C7 = p7;\ - C8 = p8;\ - C1 = p1;\ - C2 = p2;\ - C3 = p3;\ - C4 = p4;\ - C5 = p5;\ - C6 = p6;\ - C7 = p7;\ - C8 = p8;\ - C9 = p9;\ - C1 = p1;\ - C2 = p2;\ - C3 = p3;\ - C4 = p4;\ - C5 = p5;\ - C6 = p6;\ - C7 = p7;\ - C8 = p8;\ - C9 = p9;\ - C10 = p10;\ - C1 = p1;\ - C2 = p2;\ - C3 = p3;\ - C4 = p4;\ - C5 = p5;\ - C6 = p6;\ - C7 = p7;\ - C8 = p8;\ - C9 = p9;\ - C10 = p10;\ - C11 = p11;\ - C1 = p1;\ - C2 = p2;\ - C3 = p3;\ - C4 = p4;\ - C5 = p5;\ - C6 = p6;\ - C7 = p7;\ - C8 = p8;\ - C9 = p9;\ - C10 = p10;\ - C11 = p11;\ - C12 = p12;\ - C1 = p1;\ - C2 = p2;\ - C3 = p3;\ - C4 = p4;\ - C5 = p5;\ - C6 = p6;\ - C7 = p7;\ - C8 = p8;\ - C9 = p9;\ - C10 = p10;\ - C11 = p11;\ - C12 = p12;\ - C13 = p13;\ - C1 = p1;\ - C2 = p2;\ - C3 = p3;\ - C4 = p4;\ - C5 = p5;\ - C6 = p6;\ - C7 = p7;\ - C8 = p8;\ - C9 = p9;\ - C10 = p10;\ - C11 = p11;\ - C12 = p12;\ - C13 = p13;\ - C14 = p14;\ - \ - } \ - NAME (const T1 &p1, const T2 &p2, const T3 &p3, const T4 &p4, const T5 &p5, const T6 &p6, const T7 &p7, const T8 &p8, const T9 &p9, const T10 &p10, const T11 &p11, const T12 &p12, const T13 &p13, const T14 &p14) : C1 (p1), C2 (p2), C3 (p3), C4 (p4), C5 (p5), C6 (p6), C7 (p7), C8 (p8), C9 (p9), C10 (p10), C11 (p11), C12 (p12), C13 (p13), C14 (p14) {} - -#define sql_compare_type_def_14(NAME, WHAT, NUM) \ - return WHAT##_list(d, m, true, true, true, true, true, true, true, true, true, true, true, true, true, true) - -#define sql_compare_type_defe_14(NAME, WHAT, NUM) \ - return WHAT##_list(d, c, m, true, true, true, true, true, true, true, true, true, true, true, true, true, true) - -#define sql_COMPARE__14(NAME, C1, C2, C3, C4, C5, C6, C7, C8, C9, C10, C11, C12, C13, C14, C15, C16, C17, C18, C19, C20, C21, C22, C23, C24, C25) \ - template \ - int sql_compare_##NAME (const NAME &x, const NAME &y) { \ - int cmp; \ - if (cmp = sql_cmp(x.C1 , y.C1 )) return cmp; \ - if (cmp = sql_cmp(x.C2 , y.C2 )) return cmp; \ - if (cmp = sql_cmp(x.C3 , y.C3 )) return cmp; \ - if (cmp = sql_cmp(x.C4 , y.C4 )) return cmp; \ - if (cmp = sql_cmp(x.C5 , y.C5 )) return cmp; \ - if (cmp = sql_cmp(x.C6 , y.C6 )) return cmp; \ - if (cmp = sql_cmp(x.C7 , y.C7 )) return cmp; \ - if (cmp = sql_cmp(x.C8 , y.C8 )) return cmp; \ - if (cmp = sql_cmp(x.C9 , y.C9 )) return cmp; \ - if (cmp = sql_cmp(x.C10 , y.C10 )) return cmp; \ - if (cmp = sql_cmp(x.C11 , y.C11 )) return cmp; \ - if (cmp = sql_cmp(x.C12 , y.C12 )) return cmp; \ - if (cmp = sql_cmp(x.C13 , y.C13 )) return cmp; \ - return sql_cmp(x.C14 , y.C14 ); \ - } \ - template \ - int compare (const NAME &x, const NAME &y) { \ - int cmp; \ - if (cmp = sql_cmp(x.C1 , y.C1 )) return cmp; \ - if (cmp = sql_cmp(x.C2 , y.C2 )) return cmp; \ - if (cmp = sql_cmp(x.C3 , y.C3 )) return cmp; \ - if (cmp = sql_cmp(x.C4 , y.C4 )) return cmp; \ - if (cmp = sql_cmp(x.C5 , y.C5 )) return cmp; \ - if (cmp = sql_cmp(x.C6 , y.C6 )) return cmp; \ - if (cmp = sql_cmp(x.C7 , y.C7 )) return cmp; \ - if (cmp = sql_cmp(x.C8 , y.C8 )) return cmp; \ - if (cmp = sql_cmp(x.C9 , y.C9 )) return cmp; \ - if (cmp = sql_cmp(x.C10 , y.C10 )) return cmp; \ - if (cmp = sql_cmp(x.C11 , y.C11 )) return cmp; \ - if (cmp = sql_cmp(x.C12 , y.C12 )) return cmp; \ - if (cmp = sql_cmp(x.C13 , y.C13 )) return cmp; \ - return sql_cmp(x.C14 , y.C14 ); \ - } - -// --------------------------------------------------- -// End Compare 14 -// --------------------------------------------------- - - -// --------------------------------------------------- -// Begin Compare 15 -// --------------------------------------------------- - -#define sql_compare_define_15(NAME, T1, C1, T2, C2, T3, C3, T4, C4, T5, C5, T6, C6, T7, C7, T8, C8, T9, C9, T10, C10, T11, C11, T12, C12, T13, C13, T14, C14, T15, C15, T16, C16, T17, C17, T18, C18, T19, C19, T20, C20, T21, C21, T22, C22, T23, C23, T24, C24, T25, C25) \ - NAME (const T1 &p1, const T2 &p2, const T3 &p3, const T4 &p4, const T5 &p5, const T6 &p6, const T7 &p7, const T8 &p8, const T9 &p9, const T10 &p10, const T11 &p11, const T12 &p12, const T13 &p13, const T14 &p14, const T15 &p15) : C1 (p1), C2 (p2), C3 (p3), C4 (p4), C5 (p5), C6 (p6), C7 (p7), C8 (p8), C9 (p9), C10 (p10), C11 (p11), C12 (p12), C13 (p13), C14 (p14), C15 (p15) {} \ - void set (const T1 &p1, const T2 &p2, const T3 &p3, const T4 &p4, const T5 &p5, const T6 &p6, const T7 &p7, const T8 &p8, const T9 &p9, const T10 &p10, const T11 &p11, const T12 &p12, const T13 &p13, const T14 &p14, const T15 &p15) { \ - C1 = p1;\ - C1 = p1;\ - C2 = p2;\ - C1 = p1;\ - C2 = p2;\ - C3 = p3;\ - C1 = p1;\ - C2 = p2;\ - C3 = p3;\ - C4 = p4;\ - C1 = p1;\ - C2 = p2;\ - C3 = p3;\ - C4 = p4;\ - C5 = p5;\ - C1 = p1;\ - C2 = p2;\ - C3 = p3;\ - C4 = p4;\ - C5 = p5;\ - C6 = p6;\ - C1 = p1;\ - C2 = p2;\ - C3 = p3;\ - C4 = p4;\ - C5 = p5;\ - C6 = p6;\ - C7 = p7;\ - C1 = p1;\ - C2 = p2;\ - C3 = p3;\ - C4 = p4;\ - C5 = p5;\ - C6 = p6;\ - C7 = p7;\ - C8 = p8;\ - C1 = p1;\ - C2 = p2;\ - C3 = p3;\ - C4 = p4;\ - C5 = p5;\ - C6 = p6;\ - C7 = p7;\ - C8 = p8;\ - C9 = p9;\ - C1 = p1;\ - C2 = p2;\ - C3 = p3;\ - C4 = p4;\ - C5 = p5;\ - C6 = p6;\ - C7 = p7;\ - C8 = p8;\ - C9 = p9;\ - C10 = p10;\ - C1 = p1;\ - C2 = p2;\ - C3 = p3;\ - C4 = p4;\ - C5 = p5;\ - C6 = p6;\ - C7 = p7;\ - C8 = p8;\ - C9 = p9;\ - C10 = p10;\ - C11 = p11;\ - C1 = p1;\ - C2 = p2;\ - C3 = p3;\ - C4 = p4;\ - C5 = p5;\ - C6 = p6;\ - C7 = p7;\ - C8 = p8;\ - C9 = p9;\ - C10 = p10;\ - C11 = p11;\ - C12 = p12;\ - C1 = p1;\ - C2 = p2;\ - C3 = p3;\ - C4 = p4;\ - C5 = p5;\ - C6 = p6;\ - C7 = p7;\ - C8 = p8;\ - C9 = p9;\ - C10 = p10;\ - C11 = p11;\ - C12 = p12;\ - C13 = p13;\ - C1 = p1;\ - C2 = p2;\ - C3 = p3;\ - C4 = p4;\ - C5 = p5;\ - C6 = p6;\ - C7 = p7;\ - C8 = p8;\ - C9 = p9;\ - C10 = p10;\ - C11 = p11;\ - C12 = p12;\ - C13 = p13;\ - C14 = p14;\ - C1 = p1;\ - C2 = p2;\ - C3 = p3;\ - C4 = p4;\ - C5 = p5;\ - C6 = p6;\ - C7 = p7;\ - C8 = p8;\ - C9 = p9;\ - C10 = p10;\ - C11 = p11;\ - C12 = p12;\ - C13 = p13;\ - C14 = p14;\ - C15 = p15;\ - \ - } \ - sql_compare_define(NAME) - -#define sql_construct_define_15(NAME, T1, C1, T2, C2, T3, C3, T4, C4, T5, C5, T6, C6, T7, C7, T8, C8, T9, C9, T10, C10, T11, C11, T12, C12, T13, C13, T14, C14, T15, C15, T16, C16, T17, C17, T18, C18, T19, C19, T20, C20, T21, C21, T22, C22, T23, C23, T24, C24, T25, C25) \ - void set (const T1 &p1, const T2 &p2, const T3 &p3, const T4 &p4, const T5 &p5, const T6 &p6, const T7 &p7, const T8 &p8, const T9 &p9, const T10 &p10, const T11 &p11, const T12 &p12, const T13 &p13, const T14 &p14, const T15 &p15) { \ - C1 = p1;\ - C1 = p1;\ - C2 = p2;\ - C1 = p1;\ - C2 = p2;\ - C3 = p3;\ - C1 = p1;\ - C2 = p2;\ - C3 = p3;\ - C4 = p4;\ - C1 = p1;\ - C2 = p2;\ - C3 = p3;\ - C4 = p4;\ - C5 = p5;\ - C1 = p1;\ - C2 = p2;\ - C3 = p3;\ - C4 = p4;\ - C5 = p5;\ - C6 = p6;\ - C1 = p1;\ - C2 = p2;\ - C3 = p3;\ - C4 = p4;\ - C5 = p5;\ - C6 = p6;\ - C7 = p7;\ - C1 = p1;\ - C2 = p2;\ - C3 = p3;\ - C4 = p4;\ - C5 = p5;\ - C6 = p6;\ - C7 = p7;\ - C8 = p8;\ - C1 = p1;\ - C2 = p2;\ - C3 = p3;\ - C4 = p4;\ - C5 = p5;\ - C6 = p6;\ - C7 = p7;\ - C8 = p8;\ - C9 = p9;\ - C1 = p1;\ - C2 = p2;\ - C3 = p3;\ - C4 = p4;\ - C5 = p5;\ - C6 = p6;\ - C7 = p7;\ - C8 = p8;\ - C9 = p9;\ - C10 = p10;\ - C1 = p1;\ - C2 = p2;\ - C3 = p3;\ - C4 = p4;\ - C5 = p5;\ - C6 = p6;\ - C7 = p7;\ - C8 = p8;\ - C9 = p9;\ - C10 = p10;\ - C11 = p11;\ - C1 = p1;\ - C2 = p2;\ - C3 = p3;\ - C4 = p4;\ - C5 = p5;\ - C6 = p6;\ - C7 = p7;\ - C8 = p8;\ - C9 = p9;\ - C10 = p10;\ - C11 = p11;\ - C12 = p12;\ - C1 = p1;\ - C2 = p2;\ - C3 = p3;\ - C4 = p4;\ - C5 = p5;\ - C6 = p6;\ - C7 = p7;\ - C8 = p8;\ - C9 = p9;\ - C10 = p10;\ - C11 = p11;\ - C12 = p12;\ - C13 = p13;\ - C1 = p1;\ - C2 = p2;\ - C3 = p3;\ - C4 = p4;\ - C5 = p5;\ - C6 = p6;\ - C7 = p7;\ - C8 = p8;\ - C9 = p9;\ - C10 = p10;\ - C11 = p11;\ - C12 = p12;\ - C13 = p13;\ - C14 = p14;\ - C1 = p1;\ - C2 = p2;\ - C3 = p3;\ - C4 = p4;\ - C5 = p5;\ - C6 = p6;\ - C7 = p7;\ - C8 = p8;\ - C9 = p9;\ - C10 = p10;\ - C11 = p11;\ - C12 = p12;\ - C13 = p13;\ - C14 = p14;\ - C15 = p15;\ - \ - } \ - NAME (const T1 &p1, const T2 &p2, const T3 &p3, const T4 &p4, const T5 &p5, const T6 &p6, const T7 &p7, const T8 &p8, const T9 &p9, const T10 &p10, const T11 &p11, const T12 &p12, const T13 &p13, const T14 &p14, const T15 &p15) : C1 (p1), C2 (p2), C3 (p3), C4 (p4), C5 (p5), C6 (p6), C7 (p7), C8 (p8), C9 (p9), C10 (p10), C11 (p11), C12 (p12), C13 (p13), C14 (p14), C15 (p15) {} - -#define sql_compare_type_def_15(NAME, WHAT, NUM) \ - return WHAT##_list(d, m, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true) - -#define sql_compare_type_defe_15(NAME, WHAT, NUM) \ - return WHAT##_list(d, c, m, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true) - -#define sql_COMPARE__15(NAME, C1, C2, C3, C4, C5, C6, C7, C8, C9, C10, C11, C12, C13, C14, C15, C16, C17, C18, C19, C20, C21, C22, C23, C24, C25) \ - template \ - int sql_compare_##NAME (const NAME &x, const NAME &y) { \ - int cmp; \ - if (cmp = sql_cmp(x.C1 , y.C1 )) return cmp; \ - if (cmp = sql_cmp(x.C2 , y.C2 )) return cmp; \ - if (cmp = sql_cmp(x.C3 , y.C3 )) return cmp; \ - if (cmp = sql_cmp(x.C4 , y.C4 )) return cmp; \ - if (cmp = sql_cmp(x.C5 , y.C5 )) return cmp; \ - if (cmp = sql_cmp(x.C6 , y.C6 )) return cmp; \ - if (cmp = sql_cmp(x.C7 , y.C7 )) return cmp; \ - if (cmp = sql_cmp(x.C8 , y.C8 )) return cmp; \ - if (cmp = sql_cmp(x.C9 , y.C9 )) return cmp; \ - if (cmp = sql_cmp(x.C10 , y.C10 )) return cmp; \ - if (cmp = sql_cmp(x.C11 , y.C11 )) return cmp; \ - if (cmp = sql_cmp(x.C12 , y.C12 )) return cmp; \ - if (cmp = sql_cmp(x.C13 , y.C13 )) return cmp; \ - if (cmp = sql_cmp(x.C14 , y.C14 )) return cmp; \ - return sql_cmp(x.C15 , y.C15 ); \ - } \ - template \ - int compare (const NAME &x, const NAME &y) { \ - int cmp; \ - if (cmp = sql_cmp(x.C1 , y.C1 )) return cmp; \ - if (cmp = sql_cmp(x.C2 , y.C2 )) return cmp; \ - if (cmp = sql_cmp(x.C3 , y.C3 )) return cmp; \ - if (cmp = sql_cmp(x.C4 , y.C4 )) return cmp; \ - if (cmp = sql_cmp(x.C5 , y.C5 )) return cmp; \ - if (cmp = sql_cmp(x.C6 , y.C6 )) return cmp; \ - if (cmp = sql_cmp(x.C7 , y.C7 )) return cmp; \ - if (cmp = sql_cmp(x.C8 , y.C8 )) return cmp; \ - if (cmp = sql_cmp(x.C9 , y.C9 )) return cmp; \ - if (cmp = sql_cmp(x.C10 , y.C10 )) return cmp; \ - if (cmp = sql_cmp(x.C11 , y.C11 )) return cmp; \ - if (cmp = sql_cmp(x.C12 , y.C12 )) return cmp; \ - if (cmp = sql_cmp(x.C13 , y.C13 )) return cmp; \ - if (cmp = sql_cmp(x.C14 , y.C14 )) return cmp; \ - return sql_cmp(x.C15 , y.C15 ); \ - } - -// --------------------------------------------------- -// End Compare 15 -// --------------------------------------------------- - - -// --------------------------------------------------- -// Begin Compare 16 -// --------------------------------------------------- - -#define sql_compare_define_16(NAME, T1, C1, T2, C2, T3, C3, T4, C4, T5, C5, T6, C6, T7, C7, T8, C8, T9, C9, T10, C10, T11, C11, T12, C12, T13, C13, T14, C14, T15, C15, T16, C16, T17, C17, T18, C18, T19, C19, T20, C20, T21, C21, T22, C22, T23, C23, T24, C24, T25, C25) \ - NAME (const T1 &p1, const T2 &p2, const T3 &p3, const T4 &p4, const T5 &p5, const T6 &p6, const T7 &p7, const T8 &p8, const T9 &p9, const T10 &p10, const T11 &p11, const T12 &p12, const T13 &p13, const T14 &p14, const T15 &p15, const T16 &p16) : C1 (p1), C2 (p2), C3 (p3), C4 (p4), C5 (p5), C6 (p6), C7 (p7), C8 (p8), C9 (p9), C10 (p10), C11 (p11), C12 (p12), C13 (p13), C14 (p14), C15 (p15), C16 (p16) {} \ - void set (const T1 &p1, const T2 &p2, const T3 &p3, const T4 &p4, const T5 &p5, const T6 &p6, const T7 &p7, const T8 &p8, const T9 &p9, const T10 &p10, const T11 &p11, const T12 &p12, const T13 &p13, const T14 &p14, const T15 &p15, const T16 &p16) { \ - C1 = p1;\ - C1 = p1;\ - C2 = p2;\ - C1 = p1;\ - C2 = p2;\ - C3 = p3;\ - C1 = p1;\ - C2 = p2;\ - C3 = p3;\ - C4 = p4;\ - C1 = p1;\ - C2 = p2;\ - C3 = p3;\ - C4 = p4;\ - C5 = p5;\ - C1 = p1;\ - C2 = p2;\ - C3 = p3;\ - C4 = p4;\ - C5 = p5;\ - C6 = p6;\ - C1 = p1;\ - C2 = p2;\ - C3 = p3;\ - C4 = p4;\ - C5 = p5;\ - C6 = p6;\ - C7 = p7;\ - C1 = p1;\ - C2 = p2;\ - C3 = p3;\ - C4 = p4;\ - C5 = p5;\ - C6 = p6;\ - C7 = p7;\ - C8 = p8;\ - C1 = p1;\ - C2 = p2;\ - C3 = p3;\ - C4 = p4;\ - C5 = p5;\ - C6 = p6;\ - C7 = p7;\ - C8 = p8;\ - C9 = p9;\ - C1 = p1;\ - C2 = p2;\ - C3 = p3;\ - C4 = p4;\ - C5 = p5;\ - C6 = p6;\ - C7 = p7;\ - C8 = p8;\ - C9 = p9;\ - C10 = p10;\ - C1 = p1;\ - C2 = p2;\ - C3 = p3;\ - C4 = p4;\ - C5 = p5;\ - C6 = p6;\ - C7 = p7;\ - C8 = p8;\ - C9 = p9;\ - C10 = p10;\ - C11 = p11;\ - C1 = p1;\ - C2 = p2;\ - C3 = p3;\ - C4 = p4;\ - C5 = p5;\ - C6 = p6;\ - C7 = p7;\ - C8 = p8;\ - C9 = p9;\ - C10 = p10;\ - C11 = p11;\ - C12 = p12;\ - C1 = p1;\ - C2 = p2;\ - C3 = p3;\ - C4 = p4;\ - C5 = p5;\ - C6 = p6;\ - C7 = p7;\ - C8 = p8;\ - C9 = p9;\ - C10 = p10;\ - C11 = p11;\ - C12 = p12;\ - C13 = p13;\ - C1 = p1;\ - C2 = p2;\ - C3 = p3;\ - C4 = p4;\ - C5 = p5;\ - C6 = p6;\ - C7 = p7;\ - C8 = p8;\ - C9 = p9;\ - C10 = p10;\ - C11 = p11;\ - C12 = p12;\ - C13 = p13;\ - C14 = p14;\ - C1 = p1;\ - C2 = p2;\ - C3 = p3;\ - C4 = p4;\ - C5 = p5;\ - C6 = p6;\ - C7 = p7;\ - C8 = p8;\ - C9 = p9;\ - C10 = p10;\ - C11 = p11;\ - C12 = p12;\ - C13 = p13;\ - C14 = p14;\ - C15 = p15;\ - C1 = p1;\ - C2 = p2;\ - C3 = p3;\ - C4 = p4;\ - C5 = p5;\ - C6 = p6;\ - C7 = p7;\ - C8 = p8;\ - C9 = p9;\ - C10 = p10;\ - C11 = p11;\ - C12 = p12;\ - C13 = p13;\ - C14 = p14;\ - C15 = p15;\ - C16 = p16;\ - \ - } \ - sql_compare_define(NAME) - -#define sql_construct_define_16(NAME, T1, C1, T2, C2, T3, C3, T4, C4, T5, C5, T6, C6, T7, C7, T8, C8, T9, C9, T10, C10, T11, C11, T12, C12, T13, C13, T14, C14, T15, C15, T16, C16, T17, C17, T18, C18, T19, C19, T20, C20, T21, C21, T22, C22, T23, C23, T24, C24, T25, C25) \ - void set (const T1 &p1, const T2 &p2, const T3 &p3, const T4 &p4, const T5 &p5, const T6 &p6, const T7 &p7, const T8 &p8, const T9 &p9, const T10 &p10, const T11 &p11, const T12 &p12, const T13 &p13, const T14 &p14, const T15 &p15, const T16 &p16) { \ - C1 = p1;\ - C1 = p1;\ - C2 = p2;\ - C1 = p1;\ - C2 = p2;\ - C3 = p3;\ - C1 = p1;\ - C2 = p2;\ - C3 = p3;\ - C4 = p4;\ - C1 = p1;\ - C2 = p2;\ - C3 = p3;\ - C4 = p4;\ - C5 = p5;\ - C1 = p1;\ - C2 = p2;\ - C3 = p3;\ - C4 = p4;\ - C5 = p5;\ - C6 = p6;\ - C1 = p1;\ - C2 = p2;\ - C3 = p3;\ - C4 = p4;\ - C5 = p5;\ - C6 = p6;\ - C7 = p7;\ - C1 = p1;\ - C2 = p2;\ - C3 = p3;\ - C4 = p4;\ - C5 = p5;\ - C6 = p6;\ - C7 = p7;\ - C8 = p8;\ - C1 = p1;\ - C2 = p2;\ - C3 = p3;\ - C4 = p4;\ - C5 = p5;\ - C6 = p6;\ - C7 = p7;\ - C8 = p8;\ - C9 = p9;\ - C1 = p1;\ - C2 = p2;\ - C3 = p3;\ - C4 = p4;\ - C5 = p5;\ - C6 = p6;\ - C7 = p7;\ - C8 = p8;\ - C9 = p9;\ - C10 = p10;\ - C1 = p1;\ - C2 = p2;\ - C3 = p3;\ - C4 = p4;\ - C5 = p5;\ - C6 = p6;\ - C7 = p7;\ - C8 = p8;\ - C9 = p9;\ - C10 = p10;\ - C11 = p11;\ - C1 = p1;\ - C2 = p2;\ - C3 = p3;\ - C4 = p4;\ - C5 = p5;\ - C6 = p6;\ - C7 = p7;\ - C8 = p8;\ - C9 = p9;\ - C10 = p10;\ - C11 = p11;\ - C12 = p12;\ - C1 = p1;\ - C2 = p2;\ - C3 = p3;\ - C4 = p4;\ - C5 = p5;\ - C6 = p6;\ - C7 = p7;\ - C8 = p8;\ - C9 = p9;\ - C10 = p10;\ - C11 = p11;\ - C12 = p12;\ - C13 = p13;\ - C1 = p1;\ - C2 = p2;\ - C3 = p3;\ - C4 = p4;\ - C5 = p5;\ - C6 = p6;\ - C7 = p7;\ - C8 = p8;\ - C9 = p9;\ - C10 = p10;\ - C11 = p11;\ - C12 = p12;\ - C13 = p13;\ - C14 = p14;\ - C1 = p1;\ - C2 = p2;\ - C3 = p3;\ - C4 = p4;\ - C5 = p5;\ - C6 = p6;\ - C7 = p7;\ - C8 = p8;\ - C9 = p9;\ - C10 = p10;\ - C11 = p11;\ - C12 = p12;\ - C13 = p13;\ - C14 = p14;\ - C15 = p15;\ - C1 = p1;\ - C2 = p2;\ - C3 = p3;\ - C4 = p4;\ - C5 = p5;\ - C6 = p6;\ - C7 = p7;\ - C8 = p8;\ - C9 = p9;\ - C10 = p10;\ - C11 = p11;\ - C12 = p12;\ - C13 = p13;\ - C14 = p14;\ - C15 = p15;\ - C16 = p16;\ - \ - } \ - NAME (const T1 &p1, const T2 &p2, const T3 &p3, const T4 &p4, const T5 &p5, const T6 &p6, const T7 &p7, const T8 &p8, const T9 &p9, const T10 &p10, const T11 &p11, const T12 &p12, const T13 &p13, const T14 &p14, const T15 &p15, const T16 &p16) : C1 (p1), C2 (p2), C3 (p3), C4 (p4), C5 (p5), C6 (p6), C7 (p7), C8 (p8), C9 (p9), C10 (p10), C11 (p11), C12 (p12), C13 (p13), C14 (p14), C15 (p15), C16 (p16) {} - -#define sql_compare_type_def_16(NAME, WHAT, NUM) \ - return WHAT##_list(d, m, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true) - -#define sql_compare_type_defe_16(NAME, WHAT, NUM) \ - return WHAT##_list(d, c, m, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true) - -#define sql_COMPARE__16(NAME, C1, C2, C3, C4, C5, C6, C7, C8, C9, C10, C11, C12, C13, C14, C15, C16, C17, C18, C19, C20, C21, C22, C23, C24, C25) \ - template \ - int sql_compare_##NAME (const NAME &x, const NAME &y) { \ - int cmp; \ - if (cmp = sql_cmp(x.C1 , y.C1 )) return cmp; \ - if (cmp = sql_cmp(x.C2 , y.C2 )) return cmp; \ - if (cmp = sql_cmp(x.C3 , y.C3 )) return cmp; \ - if (cmp = sql_cmp(x.C4 , y.C4 )) return cmp; \ - if (cmp = sql_cmp(x.C5 , y.C5 )) return cmp; \ - if (cmp = sql_cmp(x.C6 , y.C6 )) return cmp; \ - if (cmp = sql_cmp(x.C7 , y.C7 )) return cmp; \ - if (cmp = sql_cmp(x.C8 , y.C8 )) return cmp; \ - if (cmp = sql_cmp(x.C9 , y.C9 )) return cmp; \ - if (cmp = sql_cmp(x.C10 , y.C10 )) return cmp; \ - if (cmp = sql_cmp(x.C11 , y.C11 )) return cmp; \ - if (cmp = sql_cmp(x.C12 , y.C12 )) return cmp; \ - if (cmp = sql_cmp(x.C13 , y.C13 )) return cmp; \ - if (cmp = sql_cmp(x.C14 , y.C14 )) return cmp; \ - if (cmp = sql_cmp(x.C15 , y.C15 )) return cmp; \ - return sql_cmp(x.C16 , y.C16 ); \ - } \ - template \ - int compare (const NAME &x, const NAME &y) { \ - int cmp; \ - if (cmp = sql_cmp(x.C1 , y.C1 )) return cmp; \ - if (cmp = sql_cmp(x.C2 , y.C2 )) return cmp; \ - if (cmp = sql_cmp(x.C3 , y.C3 )) return cmp; \ - if (cmp = sql_cmp(x.C4 , y.C4 )) return cmp; \ - if (cmp = sql_cmp(x.C5 , y.C5 )) return cmp; \ - if (cmp = sql_cmp(x.C6 , y.C6 )) return cmp; \ - if (cmp = sql_cmp(x.C7 , y.C7 )) return cmp; \ - if (cmp = sql_cmp(x.C8 , y.C8 )) return cmp; \ - if (cmp = sql_cmp(x.C9 , y.C9 )) return cmp; \ - if (cmp = sql_cmp(x.C10 , y.C10 )) return cmp; \ - if (cmp = sql_cmp(x.C11 , y.C11 )) return cmp; \ - if (cmp = sql_cmp(x.C12 , y.C12 )) return cmp; \ - if (cmp = sql_cmp(x.C13 , y.C13 )) return cmp; \ - if (cmp = sql_cmp(x.C14 , y.C14 )) return cmp; \ - if (cmp = sql_cmp(x.C15 , y.C15 )) return cmp; \ - return sql_cmp(x.C16 , y.C16 ); \ - } - -// --------------------------------------------------- -// End Compare 16 -// --------------------------------------------------- - - -// --------------------------------------------------- -// Begin Compare 17 -// --------------------------------------------------- - -#define sql_compare_define_17(NAME, T1, C1, T2, C2, T3, C3, T4, C4, T5, C5, T6, C6, T7, C7, T8, C8, T9, C9, T10, C10, T11, C11, T12, C12, T13, C13, T14, C14, T15, C15, T16, C16, T17, C17, T18, C18, T19, C19, T20, C20, T21, C21, T22, C22, T23, C23, T24, C24, T25, C25) \ - NAME (const T1 &p1, const T2 &p2, const T3 &p3, const T4 &p4, const T5 &p5, const T6 &p6, const T7 &p7, const T8 &p8, const T9 &p9, const T10 &p10, const T11 &p11, const T12 &p12, const T13 &p13, const T14 &p14, const T15 &p15, const T16 &p16, const T17 &p17) : C1 (p1), C2 (p2), C3 (p3), C4 (p4), C5 (p5), C6 (p6), C7 (p7), C8 (p8), C9 (p9), C10 (p10), C11 (p11), C12 (p12), C13 (p13), C14 (p14), C15 (p15), C16 (p16), C17 (p17) {} \ - void set (const T1 &p1, const T2 &p2, const T3 &p3, const T4 &p4, const T5 &p5, const T6 &p6, const T7 &p7, const T8 &p8, const T9 &p9, const T10 &p10, const T11 &p11, const T12 &p12, const T13 &p13, const T14 &p14, const T15 &p15, const T16 &p16, const T17 &p17) { \ - C1 = p1;\ - C1 = p1;\ - C2 = p2;\ - C1 = p1;\ - C2 = p2;\ - C3 = p3;\ - C1 = p1;\ - C2 = p2;\ - C3 = p3;\ - C4 = p4;\ - C1 = p1;\ - C2 = p2;\ - C3 = p3;\ - C4 = p4;\ - C5 = p5;\ - C1 = p1;\ - C2 = p2;\ - C3 = p3;\ - C4 = p4;\ - C5 = p5;\ - C6 = p6;\ - C1 = p1;\ - C2 = p2;\ - C3 = p3;\ - C4 = p4;\ - C5 = p5;\ - C6 = p6;\ - C7 = p7;\ - C1 = p1;\ - C2 = p2;\ - C3 = p3;\ - C4 = p4;\ - C5 = p5;\ - C6 = p6;\ - C7 = p7;\ - C8 = p8;\ - C1 = p1;\ - C2 = p2;\ - C3 = p3;\ - C4 = p4;\ - C5 = p5;\ - C6 = p6;\ - C7 = p7;\ - C8 = p8;\ - C9 = p9;\ - C1 = p1;\ - C2 = p2;\ - C3 = p3;\ - C4 = p4;\ - C5 = p5;\ - C6 = p6;\ - C7 = p7;\ - C8 = p8;\ - C9 = p9;\ - C10 = p10;\ - C1 = p1;\ - C2 = p2;\ - C3 = p3;\ - C4 = p4;\ - C5 = p5;\ - C6 = p6;\ - C7 = p7;\ - C8 = p8;\ - C9 = p9;\ - C10 = p10;\ - C11 = p11;\ - C1 = p1;\ - C2 = p2;\ - C3 = p3;\ - C4 = p4;\ - C5 = p5;\ - C6 = p6;\ - C7 = p7;\ - C8 = p8;\ - C9 = p9;\ - C10 = p10;\ - C11 = p11;\ - C12 = p12;\ - C1 = p1;\ - C2 = p2;\ - C3 = p3;\ - C4 = p4;\ - C5 = p5;\ - C6 = p6;\ - C7 = p7;\ - C8 = p8;\ - C9 = p9;\ - C10 = p10;\ - C11 = p11;\ - C12 = p12;\ - C13 = p13;\ - C1 = p1;\ - C2 = p2;\ - C3 = p3;\ - C4 = p4;\ - C5 = p5;\ - C6 = p6;\ - C7 = p7;\ - C8 = p8;\ - C9 = p9;\ - C10 = p10;\ - C11 = p11;\ - C12 = p12;\ - C13 = p13;\ - C14 = p14;\ - C1 = p1;\ - C2 = p2;\ - C3 = p3;\ - C4 = p4;\ - C5 = p5;\ - C6 = p6;\ - C7 = p7;\ - C8 = p8;\ - C9 = p9;\ - C10 = p10;\ - C11 = p11;\ - C12 = p12;\ - C13 = p13;\ - C14 = p14;\ - C15 = p15;\ - C1 = p1;\ - C2 = p2;\ - C3 = p3;\ - C4 = p4;\ - C5 = p5;\ - C6 = p6;\ - C7 = p7;\ - C8 = p8;\ - C9 = p9;\ - C10 = p10;\ - C11 = p11;\ - C12 = p12;\ - C13 = p13;\ - C14 = p14;\ - C15 = p15;\ - C16 = p16;\ - C1 = p1;\ - C2 = p2;\ - C3 = p3;\ - C4 = p4;\ - C5 = p5;\ - C6 = p6;\ - C7 = p7;\ - C8 = p8;\ - C9 = p9;\ - C10 = p10;\ - C11 = p11;\ - C12 = p12;\ - C13 = p13;\ - C14 = p14;\ - C15 = p15;\ - C16 = p16;\ - C17 = p17;\ - \ - } \ - sql_compare_define(NAME) - -#define sql_construct_define_17(NAME, T1, C1, T2, C2, T3, C3, T4, C4, T5, C5, T6, C6, T7, C7, T8, C8, T9, C9, T10, C10, T11, C11, T12, C12, T13, C13, T14, C14, T15, C15, T16, C16, T17, C17, T18, C18, T19, C19, T20, C20, T21, C21, T22, C22, T23, C23, T24, C24, T25, C25) \ - void set (const T1 &p1, const T2 &p2, const T3 &p3, const T4 &p4, const T5 &p5, const T6 &p6, const T7 &p7, const T8 &p8, const T9 &p9, const T10 &p10, const T11 &p11, const T12 &p12, const T13 &p13, const T14 &p14, const T15 &p15, const T16 &p16, const T17 &p17) { \ - C1 = p1;\ - C1 = p1;\ - C2 = p2;\ - C1 = p1;\ - C2 = p2;\ - C3 = p3;\ - C1 = p1;\ - C2 = p2;\ - C3 = p3;\ - C4 = p4;\ - C1 = p1;\ - C2 = p2;\ - C3 = p3;\ - C4 = p4;\ - C5 = p5;\ - C1 = p1;\ - C2 = p2;\ - C3 = p3;\ - C4 = p4;\ - C5 = p5;\ - C6 = p6;\ - C1 = p1;\ - C2 = p2;\ - C3 = p3;\ - C4 = p4;\ - C5 = p5;\ - C6 = p6;\ - C7 = p7;\ - C1 = p1;\ - C2 = p2;\ - C3 = p3;\ - C4 = p4;\ - C5 = p5;\ - C6 = p6;\ - C7 = p7;\ - C8 = p8;\ - C1 = p1;\ - C2 = p2;\ - C3 = p3;\ - C4 = p4;\ - C5 = p5;\ - C6 = p6;\ - C7 = p7;\ - C8 = p8;\ - C9 = p9;\ - C1 = p1;\ - C2 = p2;\ - C3 = p3;\ - C4 = p4;\ - C5 = p5;\ - C6 = p6;\ - C7 = p7;\ - C8 = p8;\ - C9 = p9;\ - C10 = p10;\ - C1 = p1;\ - C2 = p2;\ - C3 = p3;\ - C4 = p4;\ - C5 = p5;\ - C6 = p6;\ - C7 = p7;\ - C8 = p8;\ - C9 = p9;\ - C10 = p10;\ - C11 = p11;\ - C1 = p1;\ - C2 = p2;\ - C3 = p3;\ - C4 = p4;\ - C5 = p5;\ - C6 = p6;\ - C7 = p7;\ - C8 = p8;\ - C9 = p9;\ - C10 = p10;\ - C11 = p11;\ - C12 = p12;\ - C1 = p1;\ - C2 = p2;\ - C3 = p3;\ - C4 = p4;\ - C5 = p5;\ - C6 = p6;\ - C7 = p7;\ - C8 = p8;\ - C9 = p9;\ - C10 = p10;\ - C11 = p11;\ - C12 = p12;\ - C13 = p13;\ - C1 = p1;\ - C2 = p2;\ - C3 = p3;\ - C4 = p4;\ - C5 = p5;\ - C6 = p6;\ - C7 = p7;\ - C8 = p8;\ - C9 = p9;\ - C10 = p10;\ - C11 = p11;\ - C12 = p12;\ - C13 = p13;\ - C14 = p14;\ - C1 = p1;\ - C2 = p2;\ - C3 = p3;\ - C4 = p4;\ - C5 = p5;\ - C6 = p6;\ - C7 = p7;\ - C8 = p8;\ - C9 = p9;\ - C10 = p10;\ - C11 = p11;\ - C12 = p12;\ - C13 = p13;\ - C14 = p14;\ - C15 = p15;\ - C1 = p1;\ - C2 = p2;\ - C3 = p3;\ - C4 = p4;\ - C5 = p5;\ - C6 = p6;\ - C7 = p7;\ - C8 = p8;\ - C9 = p9;\ - C10 = p10;\ - C11 = p11;\ - C12 = p12;\ - C13 = p13;\ - C14 = p14;\ - C15 = p15;\ - C16 = p16;\ - C1 = p1;\ - C2 = p2;\ - C3 = p3;\ - C4 = p4;\ - C5 = p5;\ - C6 = p6;\ - C7 = p7;\ - C8 = p8;\ - C9 = p9;\ - C10 = p10;\ - C11 = p11;\ - C12 = p12;\ - C13 = p13;\ - C14 = p14;\ - C15 = p15;\ - C16 = p16;\ - C17 = p17;\ - \ - } \ - NAME (const T1 &p1, const T2 &p2, const T3 &p3, const T4 &p4, const T5 &p5, const T6 &p6, const T7 &p7, const T8 &p8, const T9 &p9, const T10 &p10, const T11 &p11, const T12 &p12, const T13 &p13, const T14 &p14, const T15 &p15, const T16 &p16, const T17 &p17) : C1 (p1), C2 (p2), C3 (p3), C4 (p4), C5 (p5), C6 (p6), C7 (p7), C8 (p8), C9 (p9), C10 (p10), C11 (p11), C12 (p12), C13 (p13), C14 (p14), C15 (p15), C16 (p16), C17 (p17) {} - -#define sql_compare_type_def_17(NAME, WHAT, NUM) \ - return WHAT##_list(d, m, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true) - -#define sql_compare_type_defe_17(NAME, WHAT, NUM) \ - return WHAT##_list(d, c, m, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true) - -#define sql_COMPARE__17(NAME, C1, C2, C3, C4, C5, C6, C7, C8, C9, C10, C11, C12, C13, C14, C15, C16, C17, C18, C19, C20, C21, C22, C23, C24, C25) \ - template \ - int sql_compare_##NAME (const NAME &x, const NAME &y) { \ - int cmp; \ - if (cmp = sql_cmp(x.C1 , y.C1 )) return cmp; \ - if (cmp = sql_cmp(x.C2 , y.C2 )) return cmp; \ - if (cmp = sql_cmp(x.C3 , y.C3 )) return cmp; \ - if (cmp = sql_cmp(x.C4 , y.C4 )) return cmp; \ - if (cmp = sql_cmp(x.C5 , y.C5 )) return cmp; \ - if (cmp = sql_cmp(x.C6 , y.C6 )) return cmp; \ - if (cmp = sql_cmp(x.C7 , y.C7 )) return cmp; \ - if (cmp = sql_cmp(x.C8 , y.C8 )) return cmp; \ - if (cmp = sql_cmp(x.C9 , y.C9 )) return cmp; \ - if (cmp = sql_cmp(x.C10 , y.C10 )) return cmp; \ - if (cmp = sql_cmp(x.C11 , y.C11 )) return cmp; \ - if (cmp = sql_cmp(x.C12 , y.C12 )) return cmp; \ - if (cmp = sql_cmp(x.C13 , y.C13 )) return cmp; \ - if (cmp = sql_cmp(x.C14 , y.C14 )) return cmp; \ - if (cmp = sql_cmp(x.C15 , y.C15 )) return cmp; \ - if (cmp = sql_cmp(x.C16 , y.C16 )) return cmp; \ - return sql_cmp(x.C17 , y.C17 ); \ - } \ - template \ - int compare (const NAME &x, const NAME &y) { \ - int cmp; \ - if (cmp = sql_cmp(x.C1 , y.C1 )) return cmp; \ - if (cmp = sql_cmp(x.C2 , y.C2 )) return cmp; \ - if (cmp = sql_cmp(x.C3 , y.C3 )) return cmp; \ - if (cmp = sql_cmp(x.C4 , y.C4 )) return cmp; \ - if (cmp = sql_cmp(x.C5 , y.C5 )) return cmp; \ - if (cmp = sql_cmp(x.C6 , y.C6 )) return cmp; \ - if (cmp = sql_cmp(x.C7 , y.C7 )) return cmp; \ - if (cmp = sql_cmp(x.C8 , y.C8 )) return cmp; \ - if (cmp = sql_cmp(x.C9 , y.C9 )) return cmp; \ - if (cmp = sql_cmp(x.C10 , y.C10 )) return cmp; \ - if (cmp = sql_cmp(x.C11 , y.C11 )) return cmp; \ - if (cmp = sql_cmp(x.C12 , y.C12 )) return cmp; \ - if (cmp = sql_cmp(x.C13 , y.C13 )) return cmp; \ - if (cmp = sql_cmp(x.C14 , y.C14 )) return cmp; \ - if (cmp = sql_cmp(x.C15 , y.C15 )) return cmp; \ - if (cmp = sql_cmp(x.C16 , y.C16 )) return cmp; \ - return sql_cmp(x.C17 , y.C17 ); \ - } - -// --------------------------------------------------- -// End Compare 17 -// --------------------------------------------------- - - -// --------------------------------------------------- -// Begin Compare 18 -// --------------------------------------------------- - -#define sql_compare_define_18(NAME, T1, C1, T2, C2, T3, C3, T4, C4, T5, C5, T6, C6, T7, C7, T8, C8, T9, C9, T10, C10, T11, C11, T12, C12, T13, C13, T14, C14, T15, C15, T16, C16, T17, C17, T18, C18, T19, C19, T20, C20, T21, C21, T22, C22, T23, C23, T24, C24, T25, C25) \ - NAME (const T1 &p1, const T2 &p2, const T3 &p3, const T4 &p4, const T5 &p5, const T6 &p6, const T7 &p7, const T8 &p8, const T9 &p9, const T10 &p10, const T11 &p11, const T12 &p12, const T13 &p13, const T14 &p14, const T15 &p15, const T16 &p16, const T17 &p17, const T18 &p18) : C1 (p1), C2 (p2), C3 (p3), C4 (p4), C5 (p5), C6 (p6), C7 (p7), C8 (p8), C9 (p9), C10 (p10), C11 (p11), C12 (p12), C13 (p13), C14 (p14), C15 (p15), C16 (p16), C17 (p17), C18 (p18) {} \ - void set (const T1 &p1, const T2 &p2, const T3 &p3, const T4 &p4, const T5 &p5, const T6 &p6, const T7 &p7, const T8 &p8, const T9 &p9, const T10 &p10, const T11 &p11, const T12 &p12, const T13 &p13, const T14 &p14, const T15 &p15, const T16 &p16, const T17 &p17, const T18 &p18) { \ - C1 = p1;\ - C1 = p1;\ - C2 = p2;\ - C1 = p1;\ - C2 = p2;\ - C3 = p3;\ - C1 = p1;\ - C2 = p2;\ - C3 = p3;\ - C4 = p4;\ - C1 = p1;\ - C2 = p2;\ - C3 = p3;\ - C4 = p4;\ - C5 = p5;\ - C1 = p1;\ - C2 = p2;\ - C3 = p3;\ - C4 = p4;\ - C5 = p5;\ - C6 = p6;\ - C1 = p1;\ - C2 = p2;\ - C3 = p3;\ - C4 = p4;\ - C5 = p5;\ - C6 = p6;\ - C7 = p7;\ - C1 = p1;\ - C2 = p2;\ - C3 = p3;\ - C4 = p4;\ - C5 = p5;\ - C6 = p6;\ - C7 = p7;\ - C8 = p8;\ - C1 = p1;\ - C2 = p2;\ - C3 = p3;\ - C4 = p4;\ - C5 = p5;\ - C6 = p6;\ - C7 = p7;\ - C8 = p8;\ - C9 = p9;\ - C1 = p1;\ - C2 = p2;\ - C3 = p3;\ - C4 = p4;\ - C5 = p5;\ - C6 = p6;\ - C7 = p7;\ - C8 = p8;\ - C9 = p9;\ - C10 = p10;\ - C1 = p1;\ - C2 = p2;\ - C3 = p3;\ - C4 = p4;\ - C5 = p5;\ - C6 = p6;\ - C7 = p7;\ - C8 = p8;\ - C9 = p9;\ - C10 = p10;\ - C11 = p11;\ - C1 = p1;\ - C2 = p2;\ - C3 = p3;\ - C4 = p4;\ - C5 = p5;\ - C6 = p6;\ - C7 = p7;\ - C8 = p8;\ - C9 = p9;\ - C10 = p10;\ - C11 = p11;\ - C12 = p12;\ - C1 = p1;\ - C2 = p2;\ - C3 = p3;\ - C4 = p4;\ - C5 = p5;\ - C6 = p6;\ - C7 = p7;\ - C8 = p8;\ - C9 = p9;\ - C10 = p10;\ - C11 = p11;\ - C12 = p12;\ - C13 = p13;\ - C1 = p1;\ - C2 = p2;\ - C3 = p3;\ - C4 = p4;\ - C5 = p5;\ - C6 = p6;\ - C7 = p7;\ - C8 = p8;\ - C9 = p9;\ - C10 = p10;\ - C11 = p11;\ - C12 = p12;\ - C13 = p13;\ - C14 = p14;\ - C1 = p1;\ - C2 = p2;\ - C3 = p3;\ - C4 = p4;\ - C5 = p5;\ - C6 = p6;\ - C7 = p7;\ - C8 = p8;\ - C9 = p9;\ - C10 = p10;\ - C11 = p11;\ - C12 = p12;\ - C13 = p13;\ - C14 = p14;\ - C15 = p15;\ - C1 = p1;\ - C2 = p2;\ - C3 = p3;\ - C4 = p4;\ - C5 = p5;\ - C6 = p6;\ - C7 = p7;\ - C8 = p8;\ - C9 = p9;\ - C10 = p10;\ - C11 = p11;\ - C12 = p12;\ - C13 = p13;\ - C14 = p14;\ - C15 = p15;\ - C16 = p16;\ - C1 = p1;\ - C2 = p2;\ - C3 = p3;\ - C4 = p4;\ - C5 = p5;\ - C6 = p6;\ - C7 = p7;\ - C8 = p8;\ - C9 = p9;\ - C10 = p10;\ - C11 = p11;\ - C12 = p12;\ - C13 = p13;\ - C14 = p14;\ - C15 = p15;\ - C16 = p16;\ - C17 = p17;\ - C1 = p1;\ - C2 = p2;\ - C3 = p3;\ - C4 = p4;\ - C5 = p5;\ - C6 = p6;\ - C7 = p7;\ - C8 = p8;\ - C9 = p9;\ - C10 = p10;\ - C11 = p11;\ - C12 = p12;\ - C13 = p13;\ - C14 = p14;\ - C15 = p15;\ - C16 = p16;\ - C17 = p17;\ - C18 = p18;\ - \ - } \ - sql_compare_define(NAME) - -#define sql_construct_define_18(NAME, T1, C1, T2, C2, T3, C3, T4, C4, T5, C5, T6, C6, T7, C7, T8, C8, T9, C9, T10, C10, T11, C11, T12, C12, T13, C13, T14, C14, T15, C15, T16, C16, T17, C17, T18, C18, T19, C19, T20, C20, T21, C21, T22, C22, T23, C23, T24, C24, T25, C25) \ - void set (const T1 &p1, const T2 &p2, const T3 &p3, const T4 &p4, const T5 &p5, const T6 &p6, const T7 &p7, const T8 &p8, const T9 &p9, const T10 &p10, const T11 &p11, const T12 &p12, const T13 &p13, const T14 &p14, const T15 &p15, const T16 &p16, const T17 &p17, const T18 &p18) { \ - C1 = p1;\ - C1 = p1;\ - C2 = p2;\ - C1 = p1;\ - C2 = p2;\ - C3 = p3;\ - C1 = p1;\ - C2 = p2;\ - C3 = p3;\ - C4 = p4;\ - C1 = p1;\ - C2 = p2;\ - C3 = p3;\ - C4 = p4;\ - C5 = p5;\ - C1 = p1;\ - C2 = p2;\ - C3 = p3;\ - C4 = p4;\ - C5 = p5;\ - C6 = p6;\ - C1 = p1;\ - C2 = p2;\ - C3 = p3;\ - C4 = p4;\ - C5 = p5;\ - C6 = p6;\ - C7 = p7;\ - C1 = p1;\ - C2 = p2;\ - C3 = p3;\ - C4 = p4;\ - C5 = p5;\ - C6 = p6;\ - C7 = p7;\ - C8 = p8;\ - C1 = p1;\ - C2 = p2;\ - C3 = p3;\ - C4 = p4;\ - C5 = p5;\ - C6 = p6;\ - C7 = p7;\ - C8 = p8;\ - C9 = p9;\ - C1 = p1;\ - C2 = p2;\ - C3 = p3;\ - C4 = p4;\ - C5 = p5;\ - C6 = p6;\ - C7 = p7;\ - C8 = p8;\ - C9 = p9;\ - C10 = p10;\ - C1 = p1;\ - C2 = p2;\ - C3 = p3;\ - C4 = p4;\ - C5 = p5;\ - C6 = p6;\ - C7 = p7;\ - C8 = p8;\ - C9 = p9;\ - C10 = p10;\ - C11 = p11;\ - C1 = p1;\ - C2 = p2;\ - C3 = p3;\ - C4 = p4;\ - C5 = p5;\ - C6 = p6;\ - C7 = p7;\ - C8 = p8;\ - C9 = p9;\ - C10 = p10;\ - C11 = p11;\ - C12 = p12;\ - C1 = p1;\ - C2 = p2;\ - C3 = p3;\ - C4 = p4;\ - C5 = p5;\ - C6 = p6;\ - C7 = p7;\ - C8 = p8;\ - C9 = p9;\ - C10 = p10;\ - C11 = p11;\ - C12 = p12;\ - C13 = p13;\ - C1 = p1;\ - C2 = p2;\ - C3 = p3;\ - C4 = p4;\ - C5 = p5;\ - C6 = p6;\ - C7 = p7;\ - C8 = p8;\ - C9 = p9;\ - C10 = p10;\ - C11 = p11;\ - C12 = p12;\ - C13 = p13;\ - C14 = p14;\ - C1 = p1;\ - C2 = p2;\ - C3 = p3;\ - C4 = p4;\ - C5 = p5;\ - C6 = p6;\ - C7 = p7;\ - C8 = p8;\ - C9 = p9;\ - C10 = p10;\ - C11 = p11;\ - C12 = p12;\ - C13 = p13;\ - C14 = p14;\ - C15 = p15;\ - C1 = p1;\ - C2 = p2;\ - C3 = p3;\ - C4 = p4;\ - C5 = p5;\ - C6 = p6;\ - C7 = p7;\ - C8 = p8;\ - C9 = p9;\ - C10 = p10;\ - C11 = p11;\ - C12 = p12;\ - C13 = p13;\ - C14 = p14;\ - C15 = p15;\ - C16 = p16;\ - C1 = p1;\ - C2 = p2;\ - C3 = p3;\ - C4 = p4;\ - C5 = p5;\ - C6 = p6;\ - C7 = p7;\ - C8 = p8;\ - C9 = p9;\ - C10 = p10;\ - C11 = p11;\ - C12 = p12;\ - C13 = p13;\ - C14 = p14;\ - C15 = p15;\ - C16 = p16;\ - C17 = p17;\ - C1 = p1;\ - C2 = p2;\ - C3 = p3;\ - C4 = p4;\ - C5 = p5;\ - C6 = p6;\ - C7 = p7;\ - C8 = p8;\ - C9 = p9;\ - C10 = p10;\ - C11 = p11;\ - C12 = p12;\ - C13 = p13;\ - C14 = p14;\ - C15 = p15;\ - C16 = p16;\ - C17 = p17;\ - C18 = p18;\ - \ - } \ - NAME (const T1 &p1, const T2 &p2, const T3 &p3, const T4 &p4, const T5 &p5, const T6 &p6, const T7 &p7, const T8 &p8, const T9 &p9, const T10 &p10, const T11 &p11, const T12 &p12, const T13 &p13, const T14 &p14, const T15 &p15, const T16 &p16, const T17 &p17, const T18 &p18) : C1 (p1), C2 (p2), C3 (p3), C4 (p4), C5 (p5), C6 (p6), C7 (p7), C8 (p8), C9 (p9), C10 (p10), C11 (p11), C12 (p12), C13 (p13), C14 (p14), C15 (p15), C16 (p16), C17 (p17), C18 (p18) {} - -#define sql_compare_type_def_18(NAME, WHAT, NUM) \ - return WHAT##_list(d, m, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true) - -#define sql_compare_type_defe_18(NAME, WHAT, NUM) \ - return WHAT##_list(d, c, m, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true) - -#define sql_COMPARE__18(NAME, C1, C2, C3, C4, C5, C6, C7, C8, C9, C10, C11, C12, C13, C14, C15, C16, C17, C18, C19, C20, C21, C22, C23, C24, C25) \ - template \ - int sql_compare_##NAME (const NAME &x, const NAME &y) { \ - int cmp; \ - if (cmp = sql_cmp(x.C1 , y.C1 )) return cmp; \ - if (cmp = sql_cmp(x.C2 , y.C2 )) return cmp; \ - if (cmp = sql_cmp(x.C3 , y.C3 )) return cmp; \ - if (cmp = sql_cmp(x.C4 , y.C4 )) return cmp; \ - if (cmp = sql_cmp(x.C5 , y.C5 )) return cmp; \ - if (cmp = sql_cmp(x.C6 , y.C6 )) return cmp; \ - if (cmp = sql_cmp(x.C7 , y.C7 )) return cmp; \ - if (cmp = sql_cmp(x.C8 , y.C8 )) return cmp; \ - if (cmp = sql_cmp(x.C9 , y.C9 )) return cmp; \ - if (cmp = sql_cmp(x.C10 , y.C10 )) return cmp; \ - if (cmp = sql_cmp(x.C11 , y.C11 )) return cmp; \ - if (cmp = sql_cmp(x.C12 , y.C12 )) return cmp; \ - if (cmp = sql_cmp(x.C13 , y.C13 )) return cmp; \ - if (cmp = sql_cmp(x.C14 , y.C14 )) return cmp; \ - if (cmp = sql_cmp(x.C15 , y.C15 )) return cmp; \ - if (cmp = sql_cmp(x.C16 , y.C16 )) return cmp; \ - if (cmp = sql_cmp(x.C17 , y.C17 )) return cmp; \ - return sql_cmp(x.C18 , y.C18 ); \ - } \ - template \ - int compare (const NAME &x, const NAME &y) { \ - int cmp; \ - if (cmp = sql_cmp(x.C1 , y.C1 )) return cmp; \ - if (cmp = sql_cmp(x.C2 , y.C2 )) return cmp; \ - if (cmp = sql_cmp(x.C3 , y.C3 )) return cmp; \ - if (cmp = sql_cmp(x.C4 , y.C4 )) return cmp; \ - if (cmp = sql_cmp(x.C5 , y.C5 )) return cmp; \ - if (cmp = sql_cmp(x.C6 , y.C6 )) return cmp; \ - if (cmp = sql_cmp(x.C7 , y.C7 )) return cmp; \ - if (cmp = sql_cmp(x.C8 , y.C8 )) return cmp; \ - if (cmp = sql_cmp(x.C9 , y.C9 )) return cmp; \ - if (cmp = sql_cmp(x.C10 , y.C10 )) return cmp; \ - if (cmp = sql_cmp(x.C11 , y.C11 )) return cmp; \ - if (cmp = sql_cmp(x.C12 , y.C12 )) return cmp; \ - if (cmp = sql_cmp(x.C13 , y.C13 )) return cmp; \ - if (cmp = sql_cmp(x.C14 , y.C14 )) return cmp; \ - if (cmp = sql_cmp(x.C15 , y.C15 )) return cmp; \ - if (cmp = sql_cmp(x.C16 , y.C16 )) return cmp; \ - if (cmp = sql_cmp(x.C17 , y.C17 )) return cmp; \ - return sql_cmp(x.C18 , y.C18 ); \ - } - -// --------------------------------------------------- -// End Compare 18 -// --------------------------------------------------- - - -// --------------------------------------------------- -// Begin Compare 19 -// --------------------------------------------------- - -#define sql_compare_define_19(NAME, T1, C1, T2, C2, T3, C3, T4, C4, T5, C5, T6, C6, T7, C7, T8, C8, T9, C9, T10, C10, T11, C11, T12, C12, T13, C13, T14, C14, T15, C15, T16, C16, T17, C17, T18, C18, T19, C19, T20, C20, T21, C21, T22, C22, T23, C23, T24, C24, T25, C25) \ - NAME (const T1 &p1, const T2 &p2, const T3 &p3, const T4 &p4, const T5 &p5, const T6 &p6, const T7 &p7, const T8 &p8, const T9 &p9, const T10 &p10, const T11 &p11, const T12 &p12, const T13 &p13, const T14 &p14, const T15 &p15, const T16 &p16, const T17 &p17, const T18 &p18, const T19 &p19) : C1 (p1), C2 (p2), C3 (p3), C4 (p4), C5 (p5), C6 (p6), C7 (p7), C8 (p8), C9 (p9), C10 (p10), C11 (p11), C12 (p12), C13 (p13), C14 (p14), C15 (p15), C16 (p16), C17 (p17), C18 (p18), C19 (p19) {} \ - void set (const T1 &p1, const T2 &p2, const T3 &p3, const T4 &p4, const T5 &p5, const T6 &p6, const T7 &p7, const T8 &p8, const T9 &p9, const T10 &p10, const T11 &p11, const T12 &p12, const T13 &p13, const T14 &p14, const T15 &p15, const T16 &p16, const T17 &p17, const T18 &p18, const T19 &p19) { \ - C1 = p1;\ - C1 = p1;\ - C2 = p2;\ - C1 = p1;\ - C2 = p2;\ - C3 = p3;\ - C1 = p1;\ - C2 = p2;\ - C3 = p3;\ - C4 = p4;\ - C1 = p1;\ - C2 = p2;\ - C3 = p3;\ - C4 = p4;\ - C5 = p5;\ - C1 = p1;\ - C2 = p2;\ - C3 = p3;\ - C4 = p4;\ - C5 = p5;\ - C6 = p6;\ - C1 = p1;\ - C2 = p2;\ - C3 = p3;\ - C4 = p4;\ - C5 = p5;\ - C6 = p6;\ - C7 = p7;\ - C1 = p1;\ - C2 = p2;\ - C3 = p3;\ - C4 = p4;\ - C5 = p5;\ - C6 = p6;\ - C7 = p7;\ - C8 = p8;\ - C1 = p1;\ - C2 = p2;\ - C3 = p3;\ - C4 = p4;\ - C5 = p5;\ - C6 = p6;\ - C7 = p7;\ - C8 = p8;\ - C9 = p9;\ - C1 = p1;\ - C2 = p2;\ - C3 = p3;\ - C4 = p4;\ - C5 = p5;\ - C6 = p6;\ - C7 = p7;\ - C8 = p8;\ - C9 = p9;\ - C10 = p10;\ - C1 = p1;\ - C2 = p2;\ - C3 = p3;\ - C4 = p4;\ - C5 = p5;\ - C6 = p6;\ - C7 = p7;\ - C8 = p8;\ - C9 = p9;\ - C10 = p10;\ - C11 = p11;\ - C1 = p1;\ - C2 = p2;\ - C3 = p3;\ - C4 = p4;\ - C5 = p5;\ - C6 = p6;\ - C7 = p7;\ - C8 = p8;\ - C9 = p9;\ - C10 = p10;\ - C11 = p11;\ - C12 = p12;\ - C1 = p1;\ - C2 = p2;\ - C3 = p3;\ - C4 = p4;\ - C5 = p5;\ - C6 = p6;\ - C7 = p7;\ - C8 = p8;\ - C9 = p9;\ - C10 = p10;\ - C11 = p11;\ - C12 = p12;\ - C13 = p13;\ - C1 = p1;\ - C2 = p2;\ - C3 = p3;\ - C4 = p4;\ - C5 = p5;\ - C6 = p6;\ - C7 = p7;\ - C8 = p8;\ - C9 = p9;\ - C10 = p10;\ - C11 = p11;\ - C12 = p12;\ - C13 = p13;\ - C14 = p14;\ - C1 = p1;\ - C2 = p2;\ - C3 = p3;\ - C4 = p4;\ - C5 = p5;\ - C6 = p6;\ - C7 = p7;\ - C8 = p8;\ - C9 = p9;\ - C10 = p10;\ - C11 = p11;\ - C12 = p12;\ - C13 = p13;\ - C14 = p14;\ - C15 = p15;\ - C1 = p1;\ - C2 = p2;\ - C3 = p3;\ - C4 = p4;\ - C5 = p5;\ - C6 = p6;\ - C7 = p7;\ - C8 = p8;\ - C9 = p9;\ - C10 = p10;\ - C11 = p11;\ - C12 = p12;\ - C13 = p13;\ - C14 = p14;\ - C15 = p15;\ - C16 = p16;\ - C1 = p1;\ - C2 = p2;\ - C3 = p3;\ - C4 = p4;\ - C5 = p5;\ - C6 = p6;\ - C7 = p7;\ - C8 = p8;\ - C9 = p9;\ - C10 = p10;\ - C11 = p11;\ - C12 = p12;\ - C13 = p13;\ - C14 = p14;\ - C15 = p15;\ - C16 = p16;\ - C17 = p17;\ - C1 = p1;\ - C2 = p2;\ - C3 = p3;\ - C4 = p4;\ - C5 = p5;\ - C6 = p6;\ - C7 = p7;\ - C8 = p8;\ - C9 = p9;\ - C10 = p10;\ - C11 = p11;\ - C12 = p12;\ - C13 = p13;\ - C14 = p14;\ - C15 = p15;\ - C16 = p16;\ - C17 = p17;\ - C18 = p18;\ - C1 = p1;\ - C2 = p2;\ - C3 = p3;\ - C4 = p4;\ - C5 = p5;\ - C6 = p6;\ - C7 = p7;\ - C8 = p8;\ - C9 = p9;\ - C10 = p10;\ - C11 = p11;\ - C12 = p12;\ - C13 = p13;\ - C14 = p14;\ - C15 = p15;\ - C16 = p16;\ - C17 = p17;\ - C18 = p18;\ - C19 = p19;\ - \ - } \ - sql_compare_define(NAME) - -#define sql_construct_define_19(NAME, T1, C1, T2, C2, T3, C3, T4, C4, T5, C5, T6, C6, T7, C7, T8, C8, T9, C9, T10, C10, T11, C11, T12, C12, T13, C13, T14, C14, T15, C15, T16, C16, T17, C17, T18, C18, T19, C19, T20, C20, T21, C21, T22, C22, T23, C23, T24, C24, T25, C25) \ - void set (const T1 &p1, const T2 &p2, const T3 &p3, const T4 &p4, const T5 &p5, const T6 &p6, const T7 &p7, const T8 &p8, const T9 &p9, const T10 &p10, const T11 &p11, const T12 &p12, const T13 &p13, const T14 &p14, const T15 &p15, const T16 &p16, const T17 &p17, const T18 &p18, const T19 &p19) { \ - C1 = p1;\ - C1 = p1;\ - C2 = p2;\ - C1 = p1;\ - C2 = p2;\ - C3 = p3;\ - C1 = p1;\ - C2 = p2;\ - C3 = p3;\ - C4 = p4;\ - C1 = p1;\ - C2 = p2;\ - C3 = p3;\ - C4 = p4;\ - C5 = p5;\ - C1 = p1;\ - C2 = p2;\ - C3 = p3;\ - C4 = p4;\ - C5 = p5;\ - C6 = p6;\ - C1 = p1;\ - C2 = p2;\ - C3 = p3;\ - C4 = p4;\ - C5 = p5;\ - C6 = p6;\ - C7 = p7;\ - C1 = p1;\ - C2 = p2;\ - C3 = p3;\ - C4 = p4;\ - C5 = p5;\ - C6 = p6;\ - C7 = p7;\ - C8 = p8;\ - C1 = p1;\ - C2 = p2;\ - C3 = p3;\ - C4 = p4;\ - C5 = p5;\ - C6 = p6;\ - C7 = p7;\ - C8 = p8;\ - C9 = p9;\ - C1 = p1;\ - C2 = p2;\ - C3 = p3;\ - C4 = p4;\ - C5 = p5;\ - C6 = p6;\ - C7 = p7;\ - C8 = p8;\ - C9 = p9;\ - C10 = p10;\ - C1 = p1;\ - C2 = p2;\ - C3 = p3;\ - C4 = p4;\ - C5 = p5;\ - C6 = p6;\ - C7 = p7;\ - C8 = p8;\ - C9 = p9;\ - C10 = p10;\ - C11 = p11;\ - C1 = p1;\ - C2 = p2;\ - C3 = p3;\ - C4 = p4;\ - C5 = p5;\ - C6 = p6;\ - C7 = p7;\ - C8 = p8;\ - C9 = p9;\ - C10 = p10;\ - C11 = p11;\ - C12 = p12;\ - C1 = p1;\ - C2 = p2;\ - C3 = p3;\ - C4 = p4;\ - C5 = p5;\ - C6 = p6;\ - C7 = p7;\ - C8 = p8;\ - C9 = p9;\ - C10 = p10;\ - C11 = p11;\ - C12 = p12;\ - C13 = p13;\ - C1 = p1;\ - C2 = p2;\ - C3 = p3;\ - C4 = p4;\ - C5 = p5;\ - C6 = p6;\ - C7 = p7;\ - C8 = p8;\ - C9 = p9;\ - C10 = p10;\ - C11 = p11;\ - C12 = p12;\ - C13 = p13;\ - C14 = p14;\ - C1 = p1;\ - C2 = p2;\ - C3 = p3;\ - C4 = p4;\ - C5 = p5;\ - C6 = p6;\ - C7 = p7;\ - C8 = p8;\ - C9 = p9;\ - C10 = p10;\ - C11 = p11;\ - C12 = p12;\ - C13 = p13;\ - C14 = p14;\ - C15 = p15;\ - C1 = p1;\ - C2 = p2;\ - C3 = p3;\ - C4 = p4;\ - C5 = p5;\ - C6 = p6;\ - C7 = p7;\ - C8 = p8;\ - C9 = p9;\ - C10 = p10;\ - C11 = p11;\ - C12 = p12;\ - C13 = p13;\ - C14 = p14;\ - C15 = p15;\ - C16 = p16;\ - C1 = p1;\ - C2 = p2;\ - C3 = p3;\ - C4 = p4;\ - C5 = p5;\ - C6 = p6;\ - C7 = p7;\ - C8 = p8;\ - C9 = p9;\ - C10 = p10;\ - C11 = p11;\ - C12 = p12;\ - C13 = p13;\ - C14 = p14;\ - C15 = p15;\ - C16 = p16;\ - C17 = p17;\ - C1 = p1;\ - C2 = p2;\ - C3 = p3;\ - C4 = p4;\ - C5 = p5;\ - C6 = p6;\ - C7 = p7;\ - C8 = p8;\ - C9 = p9;\ - C10 = p10;\ - C11 = p11;\ - C12 = p12;\ - C13 = p13;\ - C14 = p14;\ - C15 = p15;\ - C16 = p16;\ - C17 = p17;\ - C18 = p18;\ - C1 = p1;\ - C2 = p2;\ - C3 = p3;\ - C4 = p4;\ - C5 = p5;\ - C6 = p6;\ - C7 = p7;\ - C8 = p8;\ - C9 = p9;\ - C10 = p10;\ - C11 = p11;\ - C12 = p12;\ - C13 = p13;\ - C14 = p14;\ - C15 = p15;\ - C16 = p16;\ - C17 = p17;\ - C18 = p18;\ - C19 = p19;\ - \ - } \ - NAME (const T1 &p1, const T2 &p2, const T3 &p3, const T4 &p4, const T5 &p5, const T6 &p6, const T7 &p7, const T8 &p8, const T9 &p9, const T10 &p10, const T11 &p11, const T12 &p12, const T13 &p13, const T14 &p14, const T15 &p15, const T16 &p16, const T17 &p17, const T18 &p18, const T19 &p19) : C1 (p1), C2 (p2), C3 (p3), C4 (p4), C5 (p5), C6 (p6), C7 (p7), C8 (p8), C9 (p9), C10 (p10), C11 (p11), C12 (p12), C13 (p13), C14 (p14), C15 (p15), C16 (p16), C17 (p17), C18 (p18), C19 (p19) {} - -#define sql_compare_type_def_19(NAME, WHAT, NUM) \ - return WHAT##_list(d, m, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true) - -#define sql_compare_type_defe_19(NAME, WHAT, NUM) \ - return WHAT##_list(d, c, m, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true) - -#define sql_COMPARE__19(NAME, C1, C2, C3, C4, C5, C6, C7, C8, C9, C10, C11, C12, C13, C14, C15, C16, C17, C18, C19, C20, C21, C22, C23, C24, C25) \ - template \ - int sql_compare_##NAME (const NAME &x, const NAME &y) { \ - int cmp; \ - if (cmp = sql_cmp(x.C1 , y.C1 )) return cmp; \ - if (cmp = sql_cmp(x.C2 , y.C2 )) return cmp; \ - if (cmp = sql_cmp(x.C3 , y.C3 )) return cmp; \ - if (cmp = sql_cmp(x.C4 , y.C4 )) return cmp; \ - if (cmp = sql_cmp(x.C5 , y.C5 )) return cmp; \ - if (cmp = sql_cmp(x.C6 , y.C6 )) return cmp; \ - if (cmp = sql_cmp(x.C7 , y.C7 )) return cmp; \ - if (cmp = sql_cmp(x.C8 , y.C8 )) return cmp; \ - if (cmp = sql_cmp(x.C9 , y.C9 )) return cmp; \ - if (cmp = sql_cmp(x.C10 , y.C10 )) return cmp; \ - if (cmp = sql_cmp(x.C11 , y.C11 )) return cmp; \ - if (cmp = sql_cmp(x.C12 , y.C12 )) return cmp; \ - if (cmp = sql_cmp(x.C13 , y.C13 )) return cmp; \ - if (cmp = sql_cmp(x.C14 , y.C14 )) return cmp; \ - if (cmp = sql_cmp(x.C15 , y.C15 )) return cmp; \ - if (cmp = sql_cmp(x.C16 , y.C16 )) return cmp; \ - if (cmp = sql_cmp(x.C17 , y.C17 )) return cmp; \ - if (cmp = sql_cmp(x.C18 , y.C18 )) return cmp; \ - return sql_cmp(x.C19 , y.C19 ); \ - } \ - template \ - int compare (const NAME &x, const NAME &y) { \ - int cmp; \ - if (cmp = sql_cmp(x.C1 , y.C1 )) return cmp; \ - if (cmp = sql_cmp(x.C2 , y.C2 )) return cmp; \ - if (cmp = sql_cmp(x.C3 , y.C3 )) return cmp; \ - if (cmp = sql_cmp(x.C4 , y.C4 )) return cmp; \ - if (cmp = sql_cmp(x.C5 , y.C5 )) return cmp; \ - if (cmp = sql_cmp(x.C6 , y.C6 )) return cmp; \ - if (cmp = sql_cmp(x.C7 , y.C7 )) return cmp; \ - if (cmp = sql_cmp(x.C8 , y.C8 )) return cmp; \ - if (cmp = sql_cmp(x.C9 , y.C9 )) return cmp; \ - if (cmp = sql_cmp(x.C10 , y.C10 )) return cmp; \ - if (cmp = sql_cmp(x.C11 , y.C11 )) return cmp; \ - if (cmp = sql_cmp(x.C12 , y.C12 )) return cmp; \ - if (cmp = sql_cmp(x.C13 , y.C13 )) return cmp; \ - if (cmp = sql_cmp(x.C14 , y.C14 )) return cmp; \ - if (cmp = sql_cmp(x.C15 , y.C15 )) return cmp; \ - if (cmp = sql_cmp(x.C16 , y.C16 )) return cmp; \ - if (cmp = sql_cmp(x.C17 , y.C17 )) return cmp; \ - if (cmp = sql_cmp(x.C18 , y.C18 )) return cmp; \ - return sql_cmp(x.C19 , y.C19 ); \ - } - -// --------------------------------------------------- -// End Compare 19 -// --------------------------------------------------- - - -// --------------------------------------------------- -// Begin Compare 20 -// --------------------------------------------------- - -#define sql_compare_define_20(NAME, T1, C1, T2, C2, T3, C3, T4, C4, T5, C5, T6, C6, T7, C7, T8, C8, T9, C9, T10, C10, T11, C11, T12, C12, T13, C13, T14, C14, T15, C15, T16, C16, T17, C17, T18, C18, T19, C19, T20, C20, T21, C21, T22, C22, T23, C23, T24, C24, T25, C25) \ - NAME (const T1 &p1, const T2 &p2, const T3 &p3, const T4 &p4, const T5 &p5, const T6 &p6, const T7 &p7, const T8 &p8, const T9 &p9, const T10 &p10, const T11 &p11, const T12 &p12, const T13 &p13, const T14 &p14, const T15 &p15, const T16 &p16, const T17 &p17, const T18 &p18, const T19 &p19, const T20 &p20) : C1 (p1), C2 (p2), C3 (p3), C4 (p4), C5 (p5), C6 (p6), C7 (p7), C8 (p8), C9 (p9), C10 (p10), C11 (p11), C12 (p12), C13 (p13), C14 (p14), C15 (p15), C16 (p16), C17 (p17), C18 (p18), C19 (p19), C20 (p20) {} \ - void set (const T1 &p1, const T2 &p2, const T3 &p3, const T4 &p4, const T5 &p5, const T6 &p6, const T7 &p7, const T8 &p8, const T9 &p9, const T10 &p10, const T11 &p11, const T12 &p12, const T13 &p13, const T14 &p14, const T15 &p15, const T16 &p16, const T17 &p17, const T18 &p18, const T19 &p19, const T20 &p20) { \ - C1 = p1;\ - C1 = p1;\ - C2 = p2;\ - C1 = p1;\ - C2 = p2;\ - C3 = p3;\ - C1 = p1;\ - C2 = p2;\ - C3 = p3;\ - C4 = p4;\ - C1 = p1;\ - C2 = p2;\ - C3 = p3;\ - C4 = p4;\ - C5 = p5;\ - C1 = p1;\ - C2 = p2;\ - C3 = p3;\ - C4 = p4;\ - C5 = p5;\ - C6 = p6;\ - C1 = p1;\ - C2 = p2;\ - C3 = p3;\ - C4 = p4;\ - C5 = p5;\ - C6 = p6;\ - C7 = p7;\ - C1 = p1;\ - C2 = p2;\ - C3 = p3;\ - C4 = p4;\ - C5 = p5;\ - C6 = p6;\ - C7 = p7;\ - C8 = p8;\ - C1 = p1;\ - C2 = p2;\ - C3 = p3;\ - C4 = p4;\ - C5 = p5;\ - C6 = p6;\ - C7 = p7;\ - C8 = p8;\ - C9 = p9;\ - C1 = p1;\ - C2 = p2;\ - C3 = p3;\ - C4 = p4;\ - C5 = p5;\ - C6 = p6;\ - C7 = p7;\ - C8 = p8;\ - C9 = p9;\ - C10 = p10;\ - C1 = p1;\ - C2 = p2;\ - C3 = p3;\ - C4 = p4;\ - C5 = p5;\ - C6 = p6;\ - C7 = p7;\ - C8 = p8;\ - C9 = p9;\ - C10 = p10;\ - C11 = p11;\ - C1 = p1;\ - C2 = p2;\ - C3 = p3;\ - C4 = p4;\ - C5 = p5;\ - C6 = p6;\ - C7 = p7;\ - C8 = p8;\ - C9 = p9;\ - C10 = p10;\ - C11 = p11;\ - C12 = p12;\ - C1 = p1;\ - C2 = p2;\ - C3 = p3;\ - C4 = p4;\ - C5 = p5;\ - C6 = p6;\ - C7 = p7;\ - C8 = p8;\ - C9 = p9;\ - C10 = p10;\ - C11 = p11;\ - C12 = p12;\ - C13 = p13;\ - C1 = p1;\ - C2 = p2;\ - C3 = p3;\ - C4 = p4;\ - C5 = p5;\ - C6 = p6;\ - C7 = p7;\ - C8 = p8;\ - C9 = p9;\ - C10 = p10;\ - C11 = p11;\ - C12 = p12;\ - C13 = p13;\ - C14 = p14;\ - C1 = p1;\ - C2 = p2;\ - C3 = p3;\ - C4 = p4;\ - C5 = p5;\ - C6 = p6;\ - C7 = p7;\ - C8 = p8;\ - C9 = p9;\ - C10 = p10;\ - C11 = p11;\ - C12 = p12;\ - C13 = p13;\ - C14 = p14;\ - C15 = p15;\ - C1 = p1;\ - C2 = p2;\ - C3 = p3;\ - C4 = p4;\ - C5 = p5;\ - C6 = p6;\ - C7 = p7;\ - C8 = p8;\ - C9 = p9;\ - C10 = p10;\ - C11 = p11;\ - C12 = p12;\ - C13 = p13;\ - C14 = p14;\ - C15 = p15;\ - C16 = p16;\ - C1 = p1;\ - C2 = p2;\ - C3 = p3;\ - C4 = p4;\ - C5 = p5;\ - C6 = p6;\ - C7 = p7;\ - C8 = p8;\ - C9 = p9;\ - C10 = p10;\ - C11 = p11;\ - C12 = p12;\ - C13 = p13;\ - C14 = p14;\ - C15 = p15;\ - C16 = p16;\ - C17 = p17;\ - C1 = p1;\ - C2 = p2;\ - C3 = p3;\ - C4 = p4;\ - C5 = p5;\ - C6 = p6;\ - C7 = p7;\ - C8 = p8;\ - C9 = p9;\ - C10 = p10;\ - C11 = p11;\ - C12 = p12;\ - C13 = p13;\ - C14 = p14;\ - C15 = p15;\ - C16 = p16;\ - C17 = p17;\ - C18 = p18;\ - C1 = p1;\ - C2 = p2;\ - C3 = p3;\ - C4 = p4;\ - C5 = p5;\ - C6 = p6;\ - C7 = p7;\ - C8 = p8;\ - C9 = p9;\ - C10 = p10;\ - C11 = p11;\ - C12 = p12;\ - C13 = p13;\ - C14 = p14;\ - C15 = p15;\ - C16 = p16;\ - C17 = p17;\ - C18 = p18;\ - C19 = p19;\ - C1 = p1;\ - C2 = p2;\ - C3 = p3;\ - C4 = p4;\ - C5 = p5;\ - C6 = p6;\ - C7 = p7;\ - C8 = p8;\ - C9 = p9;\ - C10 = p10;\ - C11 = p11;\ - C12 = p12;\ - C13 = p13;\ - C14 = p14;\ - C15 = p15;\ - C16 = p16;\ - C17 = p17;\ - C18 = p18;\ - C19 = p19;\ - C20 = p20;\ - \ - } \ - sql_compare_define(NAME) - -#define sql_construct_define_20(NAME, T1, C1, T2, C2, T3, C3, T4, C4, T5, C5, T6, C6, T7, C7, T8, C8, T9, C9, T10, C10, T11, C11, T12, C12, T13, C13, T14, C14, T15, C15, T16, C16, T17, C17, T18, C18, T19, C19, T20, C20, T21, C21, T22, C22, T23, C23, T24, C24, T25, C25) \ - void set (const T1 &p1, const T2 &p2, const T3 &p3, const T4 &p4, const T5 &p5, const T6 &p6, const T7 &p7, const T8 &p8, const T9 &p9, const T10 &p10, const T11 &p11, const T12 &p12, const T13 &p13, const T14 &p14, const T15 &p15, const T16 &p16, const T17 &p17, const T18 &p18, const T19 &p19, const T20 &p20) { \ - C1 = p1;\ - C1 = p1;\ - C2 = p2;\ - C1 = p1;\ - C2 = p2;\ - C3 = p3;\ - C1 = p1;\ - C2 = p2;\ - C3 = p3;\ - C4 = p4;\ - C1 = p1;\ - C2 = p2;\ - C3 = p3;\ - C4 = p4;\ - C5 = p5;\ - C1 = p1;\ - C2 = p2;\ - C3 = p3;\ - C4 = p4;\ - C5 = p5;\ - C6 = p6;\ - C1 = p1;\ - C2 = p2;\ - C3 = p3;\ - C4 = p4;\ - C5 = p5;\ - C6 = p6;\ - C7 = p7;\ - C1 = p1;\ - C2 = p2;\ - C3 = p3;\ - C4 = p4;\ - C5 = p5;\ - C6 = p6;\ - C7 = p7;\ - C8 = p8;\ - C1 = p1;\ - C2 = p2;\ - C3 = p3;\ - C4 = p4;\ - C5 = p5;\ - C6 = p6;\ - C7 = p7;\ - C8 = p8;\ - C9 = p9;\ - C1 = p1;\ - C2 = p2;\ - C3 = p3;\ - C4 = p4;\ - C5 = p5;\ - C6 = p6;\ - C7 = p7;\ - C8 = p8;\ - C9 = p9;\ - C10 = p10;\ - C1 = p1;\ - C2 = p2;\ - C3 = p3;\ - C4 = p4;\ - C5 = p5;\ - C6 = p6;\ - C7 = p7;\ - C8 = p8;\ - C9 = p9;\ - C10 = p10;\ - C11 = p11;\ - C1 = p1;\ - C2 = p2;\ - C3 = p3;\ - C4 = p4;\ - C5 = p5;\ - C6 = p6;\ - C7 = p7;\ - C8 = p8;\ - C9 = p9;\ - C10 = p10;\ - C11 = p11;\ - C12 = p12;\ - C1 = p1;\ - C2 = p2;\ - C3 = p3;\ - C4 = p4;\ - C5 = p5;\ - C6 = p6;\ - C7 = p7;\ - C8 = p8;\ - C9 = p9;\ - C10 = p10;\ - C11 = p11;\ - C12 = p12;\ - C13 = p13;\ - C1 = p1;\ - C2 = p2;\ - C3 = p3;\ - C4 = p4;\ - C5 = p5;\ - C6 = p6;\ - C7 = p7;\ - C8 = p8;\ - C9 = p9;\ - C10 = p10;\ - C11 = p11;\ - C12 = p12;\ - C13 = p13;\ - C14 = p14;\ - C1 = p1;\ - C2 = p2;\ - C3 = p3;\ - C4 = p4;\ - C5 = p5;\ - C6 = p6;\ - C7 = p7;\ - C8 = p8;\ - C9 = p9;\ - C10 = p10;\ - C11 = p11;\ - C12 = p12;\ - C13 = p13;\ - C14 = p14;\ - C15 = p15;\ - C1 = p1;\ - C2 = p2;\ - C3 = p3;\ - C4 = p4;\ - C5 = p5;\ - C6 = p6;\ - C7 = p7;\ - C8 = p8;\ - C9 = p9;\ - C10 = p10;\ - C11 = p11;\ - C12 = p12;\ - C13 = p13;\ - C14 = p14;\ - C15 = p15;\ - C16 = p16;\ - C1 = p1;\ - C2 = p2;\ - C3 = p3;\ - C4 = p4;\ - C5 = p5;\ - C6 = p6;\ - C7 = p7;\ - C8 = p8;\ - C9 = p9;\ - C10 = p10;\ - C11 = p11;\ - C12 = p12;\ - C13 = p13;\ - C14 = p14;\ - C15 = p15;\ - C16 = p16;\ - C17 = p17;\ - C1 = p1;\ - C2 = p2;\ - C3 = p3;\ - C4 = p4;\ - C5 = p5;\ - C6 = p6;\ - C7 = p7;\ - C8 = p8;\ - C9 = p9;\ - C10 = p10;\ - C11 = p11;\ - C12 = p12;\ - C13 = p13;\ - C14 = p14;\ - C15 = p15;\ - C16 = p16;\ - C17 = p17;\ - C18 = p18;\ - C1 = p1;\ - C2 = p2;\ - C3 = p3;\ - C4 = p4;\ - C5 = p5;\ - C6 = p6;\ - C7 = p7;\ - C8 = p8;\ - C9 = p9;\ - C10 = p10;\ - C11 = p11;\ - C12 = p12;\ - C13 = p13;\ - C14 = p14;\ - C15 = p15;\ - C16 = p16;\ - C17 = p17;\ - C18 = p18;\ - C19 = p19;\ - C1 = p1;\ - C2 = p2;\ - C3 = p3;\ - C4 = p4;\ - C5 = p5;\ - C6 = p6;\ - C7 = p7;\ - C8 = p8;\ - C9 = p9;\ - C10 = p10;\ - C11 = p11;\ - C12 = p12;\ - C13 = p13;\ - C14 = p14;\ - C15 = p15;\ - C16 = p16;\ - C17 = p17;\ - C18 = p18;\ - C19 = p19;\ - C20 = p20;\ - \ - } \ - NAME (const T1 &p1, const T2 &p2, const T3 &p3, const T4 &p4, const T5 &p5, const T6 &p6, const T7 &p7, const T8 &p8, const T9 &p9, const T10 &p10, const T11 &p11, const T12 &p12, const T13 &p13, const T14 &p14, const T15 &p15, const T16 &p16, const T17 &p17, const T18 &p18, const T19 &p19, const T20 &p20) : C1 (p1), C2 (p2), C3 (p3), C4 (p4), C5 (p5), C6 (p6), C7 (p7), C8 (p8), C9 (p9), C10 (p10), C11 (p11), C12 (p12), C13 (p13), C14 (p14), C15 (p15), C16 (p16), C17 (p17), C18 (p18), C19 (p19), C20 (p20) {} - -#define sql_compare_type_def_20(NAME, WHAT, NUM) \ - return WHAT##_list(d, m, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true) - -#define sql_compare_type_defe_20(NAME, WHAT, NUM) \ - return WHAT##_list(d, c, m, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true) - -#define sql_COMPARE__20(NAME, C1, C2, C3, C4, C5, C6, C7, C8, C9, C10, C11, C12, C13, C14, C15, C16, C17, C18, C19, C20, C21, C22, C23, C24, C25) \ - template \ - int sql_compare_##NAME (const NAME &x, const NAME &y) { \ - int cmp; \ - if (cmp = sql_cmp(x.C1 , y.C1 )) return cmp; \ - if (cmp = sql_cmp(x.C2 , y.C2 )) return cmp; \ - if (cmp = sql_cmp(x.C3 , y.C3 )) return cmp; \ - if (cmp = sql_cmp(x.C4 , y.C4 )) return cmp; \ - if (cmp = sql_cmp(x.C5 , y.C5 )) return cmp; \ - if (cmp = sql_cmp(x.C6 , y.C6 )) return cmp; \ - if (cmp = sql_cmp(x.C7 , y.C7 )) return cmp; \ - if (cmp = sql_cmp(x.C8 , y.C8 )) return cmp; \ - if (cmp = sql_cmp(x.C9 , y.C9 )) return cmp; \ - if (cmp = sql_cmp(x.C10 , y.C10 )) return cmp; \ - if (cmp = sql_cmp(x.C11 , y.C11 )) return cmp; \ - if (cmp = sql_cmp(x.C12 , y.C12 )) return cmp; \ - if (cmp = sql_cmp(x.C13 , y.C13 )) return cmp; \ - if (cmp = sql_cmp(x.C14 , y.C14 )) return cmp; \ - if (cmp = sql_cmp(x.C15 , y.C15 )) return cmp; \ - if (cmp = sql_cmp(x.C16 , y.C16 )) return cmp; \ - if (cmp = sql_cmp(x.C17 , y.C17 )) return cmp; \ - if (cmp = sql_cmp(x.C18 , y.C18 )) return cmp; \ - if (cmp = sql_cmp(x.C19 , y.C19 )) return cmp; \ - return sql_cmp(x.C20 , y.C20 ); \ - } \ - template \ - int compare (const NAME &x, const NAME &y) { \ - int cmp; \ - if (cmp = sql_cmp(x.C1 , y.C1 )) return cmp; \ - if (cmp = sql_cmp(x.C2 , y.C2 )) return cmp; \ - if (cmp = sql_cmp(x.C3 , y.C3 )) return cmp; \ - if (cmp = sql_cmp(x.C4 , y.C4 )) return cmp; \ - if (cmp = sql_cmp(x.C5 , y.C5 )) return cmp; \ - if (cmp = sql_cmp(x.C6 , y.C6 )) return cmp; \ - if (cmp = sql_cmp(x.C7 , y.C7 )) return cmp; \ - if (cmp = sql_cmp(x.C8 , y.C8 )) return cmp; \ - if (cmp = sql_cmp(x.C9 , y.C9 )) return cmp; \ - if (cmp = sql_cmp(x.C10 , y.C10 )) return cmp; \ - if (cmp = sql_cmp(x.C11 , y.C11 )) return cmp; \ - if (cmp = sql_cmp(x.C12 , y.C12 )) return cmp; \ - if (cmp = sql_cmp(x.C13 , y.C13 )) return cmp; \ - if (cmp = sql_cmp(x.C14 , y.C14 )) return cmp; \ - if (cmp = sql_cmp(x.C15 , y.C15 )) return cmp; \ - if (cmp = sql_cmp(x.C16 , y.C16 )) return cmp; \ - if (cmp = sql_cmp(x.C17 , y.C17 )) return cmp; \ - if (cmp = sql_cmp(x.C18 , y.C18 )) return cmp; \ - if (cmp = sql_cmp(x.C19 , y.C19 )) return cmp; \ - return sql_cmp(x.C20 , y.C20 ); \ - } - -// --------------------------------------------------- -// End Compare 20 -// --------------------------------------------------- - - -// --------------------------------------------------- -// Begin Compare 21 -// --------------------------------------------------- - -#define sql_compare_define_21(NAME, T1, C1, T2, C2, T3, C3, T4, C4, T5, C5, T6, C6, T7, C7, T8, C8, T9, C9, T10, C10, T11, C11, T12, C12, T13, C13, T14, C14, T15, C15, T16, C16, T17, C17, T18, C18, T19, C19, T20, C20, T21, C21, T22, C22, T23, C23, T24, C24, T25, C25) \ - NAME (const T1 &p1, const T2 &p2, const T3 &p3, const T4 &p4, const T5 &p5, const T6 &p6, const T7 &p7, const T8 &p8, const T9 &p9, const T10 &p10, const T11 &p11, const T12 &p12, const T13 &p13, const T14 &p14, const T15 &p15, const T16 &p16, const T17 &p17, const T18 &p18, const T19 &p19, const T20 &p20, const T21 &p21) : C1 (p1), C2 (p2), C3 (p3), C4 (p4), C5 (p5), C6 (p6), C7 (p7), C8 (p8), C9 (p9), C10 (p10), C11 (p11), C12 (p12), C13 (p13), C14 (p14), C15 (p15), C16 (p16), C17 (p17), C18 (p18), C19 (p19), C20 (p20), C21 (p21) {} \ - void set (const T1 &p1, const T2 &p2, const T3 &p3, const T4 &p4, const T5 &p5, const T6 &p6, const T7 &p7, const T8 &p8, const T9 &p9, const T10 &p10, const T11 &p11, const T12 &p12, const T13 &p13, const T14 &p14, const T15 &p15, const T16 &p16, const T17 &p17, const T18 &p18, const T19 &p19, const T20 &p20, const T21 &p21) { \ - C1 = p1;\ - C1 = p1;\ - C2 = p2;\ - C1 = p1;\ - C2 = p2;\ - C3 = p3;\ - C1 = p1;\ - C2 = p2;\ - C3 = p3;\ - C4 = p4;\ - C1 = p1;\ - C2 = p2;\ - C3 = p3;\ - C4 = p4;\ - C5 = p5;\ - C1 = p1;\ - C2 = p2;\ - C3 = p3;\ - C4 = p4;\ - C5 = p5;\ - C6 = p6;\ - C1 = p1;\ - C2 = p2;\ - C3 = p3;\ - C4 = p4;\ - C5 = p5;\ - C6 = p6;\ - C7 = p7;\ - C1 = p1;\ - C2 = p2;\ - C3 = p3;\ - C4 = p4;\ - C5 = p5;\ - C6 = p6;\ - C7 = p7;\ - C8 = p8;\ - C1 = p1;\ - C2 = p2;\ - C3 = p3;\ - C4 = p4;\ - C5 = p5;\ - C6 = p6;\ - C7 = p7;\ - C8 = p8;\ - C9 = p9;\ - C1 = p1;\ - C2 = p2;\ - C3 = p3;\ - C4 = p4;\ - C5 = p5;\ - C6 = p6;\ - C7 = p7;\ - C8 = p8;\ - C9 = p9;\ - C10 = p10;\ - C1 = p1;\ - C2 = p2;\ - C3 = p3;\ - C4 = p4;\ - C5 = p5;\ - C6 = p6;\ - C7 = p7;\ - C8 = p8;\ - C9 = p9;\ - C10 = p10;\ - C11 = p11;\ - C1 = p1;\ - C2 = p2;\ - C3 = p3;\ - C4 = p4;\ - C5 = p5;\ - C6 = p6;\ - C7 = p7;\ - C8 = p8;\ - C9 = p9;\ - C10 = p10;\ - C11 = p11;\ - C12 = p12;\ - C1 = p1;\ - C2 = p2;\ - C3 = p3;\ - C4 = p4;\ - C5 = p5;\ - C6 = p6;\ - C7 = p7;\ - C8 = p8;\ - C9 = p9;\ - C10 = p10;\ - C11 = p11;\ - C12 = p12;\ - C13 = p13;\ - C1 = p1;\ - C2 = p2;\ - C3 = p3;\ - C4 = p4;\ - C5 = p5;\ - C6 = p6;\ - C7 = p7;\ - C8 = p8;\ - C9 = p9;\ - C10 = p10;\ - C11 = p11;\ - C12 = p12;\ - C13 = p13;\ - C14 = p14;\ - C1 = p1;\ - C2 = p2;\ - C3 = p3;\ - C4 = p4;\ - C5 = p5;\ - C6 = p6;\ - C7 = p7;\ - C8 = p8;\ - C9 = p9;\ - C10 = p10;\ - C11 = p11;\ - C12 = p12;\ - C13 = p13;\ - C14 = p14;\ - C15 = p15;\ - C1 = p1;\ - C2 = p2;\ - C3 = p3;\ - C4 = p4;\ - C5 = p5;\ - C6 = p6;\ - C7 = p7;\ - C8 = p8;\ - C9 = p9;\ - C10 = p10;\ - C11 = p11;\ - C12 = p12;\ - C13 = p13;\ - C14 = p14;\ - C15 = p15;\ - C16 = p16;\ - C1 = p1;\ - C2 = p2;\ - C3 = p3;\ - C4 = p4;\ - C5 = p5;\ - C6 = p6;\ - C7 = p7;\ - C8 = p8;\ - C9 = p9;\ - C10 = p10;\ - C11 = p11;\ - C12 = p12;\ - C13 = p13;\ - C14 = p14;\ - C15 = p15;\ - C16 = p16;\ - C17 = p17;\ - C1 = p1;\ - C2 = p2;\ - C3 = p3;\ - C4 = p4;\ - C5 = p5;\ - C6 = p6;\ - C7 = p7;\ - C8 = p8;\ - C9 = p9;\ - C10 = p10;\ - C11 = p11;\ - C12 = p12;\ - C13 = p13;\ - C14 = p14;\ - C15 = p15;\ - C16 = p16;\ - C17 = p17;\ - C18 = p18;\ - C1 = p1;\ - C2 = p2;\ - C3 = p3;\ - C4 = p4;\ - C5 = p5;\ - C6 = p6;\ - C7 = p7;\ - C8 = p8;\ - C9 = p9;\ - C10 = p10;\ - C11 = p11;\ - C12 = p12;\ - C13 = p13;\ - C14 = p14;\ - C15 = p15;\ - C16 = p16;\ - C17 = p17;\ - C18 = p18;\ - C19 = p19;\ - C1 = p1;\ - C2 = p2;\ - C3 = p3;\ - C4 = p4;\ - C5 = p5;\ - C6 = p6;\ - C7 = p7;\ - C8 = p8;\ - C9 = p9;\ - C10 = p10;\ - C11 = p11;\ - C12 = p12;\ - C13 = p13;\ - C14 = p14;\ - C15 = p15;\ - C16 = p16;\ - C17 = p17;\ - C18 = p18;\ - C19 = p19;\ - C20 = p20;\ - C1 = p1;\ - C2 = p2;\ - C3 = p3;\ - C4 = p4;\ - C5 = p5;\ - C6 = p6;\ - C7 = p7;\ - C8 = p8;\ - C9 = p9;\ - C10 = p10;\ - C11 = p11;\ - C12 = p12;\ - C13 = p13;\ - C14 = p14;\ - C15 = p15;\ - C16 = p16;\ - C17 = p17;\ - C18 = p18;\ - C19 = p19;\ - C20 = p20;\ - C21 = p21;\ - \ - } \ - sql_compare_define(NAME) - -#define sql_construct_define_21(NAME, T1, C1, T2, C2, T3, C3, T4, C4, T5, C5, T6, C6, T7, C7, T8, C8, T9, C9, T10, C10, T11, C11, T12, C12, T13, C13, T14, C14, T15, C15, T16, C16, T17, C17, T18, C18, T19, C19, T20, C20, T21, C21, T22, C22, T23, C23, T24, C24, T25, C25) \ - void set (const T1 &p1, const T2 &p2, const T3 &p3, const T4 &p4, const T5 &p5, const T6 &p6, const T7 &p7, const T8 &p8, const T9 &p9, const T10 &p10, const T11 &p11, const T12 &p12, const T13 &p13, const T14 &p14, const T15 &p15, const T16 &p16, const T17 &p17, const T18 &p18, const T19 &p19, const T20 &p20, const T21 &p21) { \ - C1 = p1;\ - C1 = p1;\ - C2 = p2;\ - C1 = p1;\ - C2 = p2;\ - C3 = p3;\ - C1 = p1;\ - C2 = p2;\ - C3 = p3;\ - C4 = p4;\ - C1 = p1;\ - C2 = p2;\ - C3 = p3;\ - C4 = p4;\ - C5 = p5;\ - C1 = p1;\ - C2 = p2;\ - C3 = p3;\ - C4 = p4;\ - C5 = p5;\ - C6 = p6;\ - C1 = p1;\ - C2 = p2;\ - C3 = p3;\ - C4 = p4;\ - C5 = p5;\ - C6 = p6;\ - C7 = p7;\ - C1 = p1;\ - C2 = p2;\ - C3 = p3;\ - C4 = p4;\ - C5 = p5;\ - C6 = p6;\ - C7 = p7;\ - C8 = p8;\ - C1 = p1;\ - C2 = p2;\ - C3 = p3;\ - C4 = p4;\ - C5 = p5;\ - C6 = p6;\ - C7 = p7;\ - C8 = p8;\ - C9 = p9;\ - C1 = p1;\ - C2 = p2;\ - C3 = p3;\ - C4 = p4;\ - C5 = p5;\ - C6 = p6;\ - C7 = p7;\ - C8 = p8;\ - C9 = p9;\ - C10 = p10;\ - C1 = p1;\ - C2 = p2;\ - C3 = p3;\ - C4 = p4;\ - C5 = p5;\ - C6 = p6;\ - C7 = p7;\ - C8 = p8;\ - C9 = p9;\ - C10 = p10;\ - C11 = p11;\ - C1 = p1;\ - C2 = p2;\ - C3 = p3;\ - C4 = p4;\ - C5 = p5;\ - C6 = p6;\ - C7 = p7;\ - C8 = p8;\ - C9 = p9;\ - C10 = p10;\ - C11 = p11;\ - C12 = p12;\ - C1 = p1;\ - C2 = p2;\ - C3 = p3;\ - C4 = p4;\ - C5 = p5;\ - C6 = p6;\ - C7 = p7;\ - C8 = p8;\ - C9 = p9;\ - C10 = p10;\ - C11 = p11;\ - C12 = p12;\ - C13 = p13;\ - C1 = p1;\ - C2 = p2;\ - C3 = p3;\ - C4 = p4;\ - C5 = p5;\ - C6 = p6;\ - C7 = p7;\ - C8 = p8;\ - C9 = p9;\ - C10 = p10;\ - C11 = p11;\ - C12 = p12;\ - C13 = p13;\ - C14 = p14;\ - C1 = p1;\ - C2 = p2;\ - C3 = p3;\ - C4 = p4;\ - C5 = p5;\ - C6 = p6;\ - C7 = p7;\ - C8 = p8;\ - C9 = p9;\ - C10 = p10;\ - C11 = p11;\ - C12 = p12;\ - C13 = p13;\ - C14 = p14;\ - C15 = p15;\ - C1 = p1;\ - C2 = p2;\ - C3 = p3;\ - C4 = p4;\ - C5 = p5;\ - C6 = p6;\ - C7 = p7;\ - C8 = p8;\ - C9 = p9;\ - C10 = p10;\ - C11 = p11;\ - C12 = p12;\ - C13 = p13;\ - C14 = p14;\ - C15 = p15;\ - C16 = p16;\ - C1 = p1;\ - C2 = p2;\ - C3 = p3;\ - C4 = p4;\ - C5 = p5;\ - C6 = p6;\ - C7 = p7;\ - C8 = p8;\ - C9 = p9;\ - C10 = p10;\ - C11 = p11;\ - C12 = p12;\ - C13 = p13;\ - C14 = p14;\ - C15 = p15;\ - C16 = p16;\ - C17 = p17;\ - C1 = p1;\ - C2 = p2;\ - C3 = p3;\ - C4 = p4;\ - C5 = p5;\ - C6 = p6;\ - C7 = p7;\ - C8 = p8;\ - C9 = p9;\ - C10 = p10;\ - C11 = p11;\ - C12 = p12;\ - C13 = p13;\ - C14 = p14;\ - C15 = p15;\ - C16 = p16;\ - C17 = p17;\ - C18 = p18;\ - C1 = p1;\ - C2 = p2;\ - C3 = p3;\ - C4 = p4;\ - C5 = p5;\ - C6 = p6;\ - C7 = p7;\ - C8 = p8;\ - C9 = p9;\ - C10 = p10;\ - C11 = p11;\ - C12 = p12;\ - C13 = p13;\ - C14 = p14;\ - C15 = p15;\ - C16 = p16;\ - C17 = p17;\ - C18 = p18;\ - C19 = p19;\ - C1 = p1;\ - C2 = p2;\ - C3 = p3;\ - C4 = p4;\ - C5 = p5;\ - C6 = p6;\ - C7 = p7;\ - C8 = p8;\ - C9 = p9;\ - C10 = p10;\ - C11 = p11;\ - C12 = p12;\ - C13 = p13;\ - C14 = p14;\ - C15 = p15;\ - C16 = p16;\ - C17 = p17;\ - C18 = p18;\ - C19 = p19;\ - C20 = p20;\ - C1 = p1;\ - C2 = p2;\ - C3 = p3;\ - C4 = p4;\ - C5 = p5;\ - C6 = p6;\ - C7 = p7;\ - C8 = p8;\ - C9 = p9;\ - C10 = p10;\ - C11 = p11;\ - C12 = p12;\ - C13 = p13;\ - C14 = p14;\ - C15 = p15;\ - C16 = p16;\ - C17 = p17;\ - C18 = p18;\ - C19 = p19;\ - C20 = p20;\ - C21 = p21;\ - \ - } \ - NAME (const T1 &p1, const T2 &p2, const T3 &p3, const T4 &p4, const T5 &p5, const T6 &p6, const T7 &p7, const T8 &p8, const T9 &p9, const T10 &p10, const T11 &p11, const T12 &p12, const T13 &p13, const T14 &p14, const T15 &p15, const T16 &p16, const T17 &p17, const T18 &p18, const T19 &p19, const T20 &p20, const T21 &p21) : C1 (p1), C2 (p2), C3 (p3), C4 (p4), C5 (p5), C6 (p6), C7 (p7), C8 (p8), C9 (p9), C10 (p10), C11 (p11), C12 (p12), C13 (p13), C14 (p14), C15 (p15), C16 (p16), C17 (p17), C18 (p18), C19 (p19), C20 (p20), C21 (p21) {} - -#define sql_compare_type_def_21(NAME, WHAT, NUM) \ - return WHAT##_list(d, m, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true) - -#define sql_compare_type_defe_21(NAME, WHAT, NUM) \ - return WHAT##_list(d, c, m, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true) - -#define sql_COMPARE__21(NAME, C1, C2, C3, C4, C5, C6, C7, C8, C9, C10, C11, C12, C13, C14, C15, C16, C17, C18, C19, C20, C21, C22, C23, C24, C25) \ - template \ - int sql_compare_##NAME (const NAME &x, const NAME &y) { \ - int cmp; \ - if (cmp = sql_cmp(x.C1 , y.C1 )) return cmp; \ - if (cmp = sql_cmp(x.C2 , y.C2 )) return cmp; \ - if (cmp = sql_cmp(x.C3 , y.C3 )) return cmp; \ - if (cmp = sql_cmp(x.C4 , y.C4 )) return cmp; \ - if (cmp = sql_cmp(x.C5 , y.C5 )) return cmp; \ - if (cmp = sql_cmp(x.C6 , y.C6 )) return cmp; \ - if (cmp = sql_cmp(x.C7 , y.C7 )) return cmp; \ - if (cmp = sql_cmp(x.C8 , y.C8 )) return cmp; \ - if (cmp = sql_cmp(x.C9 , y.C9 )) return cmp; \ - if (cmp = sql_cmp(x.C10 , y.C10 )) return cmp; \ - if (cmp = sql_cmp(x.C11 , y.C11 )) return cmp; \ - if (cmp = sql_cmp(x.C12 , y.C12 )) return cmp; \ - if (cmp = sql_cmp(x.C13 , y.C13 )) return cmp; \ - if (cmp = sql_cmp(x.C14 , y.C14 )) return cmp; \ - if (cmp = sql_cmp(x.C15 , y.C15 )) return cmp; \ - if (cmp = sql_cmp(x.C16 , y.C16 )) return cmp; \ - if (cmp = sql_cmp(x.C17 , y.C17 )) return cmp; \ - if (cmp = sql_cmp(x.C18 , y.C18 )) return cmp; \ - if (cmp = sql_cmp(x.C19 , y.C19 )) return cmp; \ - if (cmp = sql_cmp(x.C20 , y.C20 )) return cmp; \ - return sql_cmp(x.C21 , y.C21 ); \ - } \ - template \ - int compare (const NAME &x, const NAME &y) { \ - int cmp; \ - if (cmp = sql_cmp(x.C1 , y.C1 )) return cmp; \ - if (cmp = sql_cmp(x.C2 , y.C2 )) return cmp; \ - if (cmp = sql_cmp(x.C3 , y.C3 )) return cmp; \ - if (cmp = sql_cmp(x.C4 , y.C4 )) return cmp; \ - if (cmp = sql_cmp(x.C5 , y.C5 )) return cmp; \ - if (cmp = sql_cmp(x.C6 , y.C6 )) return cmp; \ - if (cmp = sql_cmp(x.C7 , y.C7 )) return cmp; \ - if (cmp = sql_cmp(x.C8 , y.C8 )) return cmp; \ - if (cmp = sql_cmp(x.C9 , y.C9 )) return cmp; \ - if (cmp = sql_cmp(x.C10 , y.C10 )) return cmp; \ - if (cmp = sql_cmp(x.C11 , y.C11 )) return cmp; \ - if (cmp = sql_cmp(x.C12 , y.C12 )) return cmp; \ - if (cmp = sql_cmp(x.C13 , y.C13 )) return cmp; \ - if (cmp = sql_cmp(x.C14 , y.C14 )) return cmp; \ - if (cmp = sql_cmp(x.C15 , y.C15 )) return cmp; \ - if (cmp = sql_cmp(x.C16 , y.C16 )) return cmp; \ - if (cmp = sql_cmp(x.C17 , y.C17 )) return cmp; \ - if (cmp = sql_cmp(x.C18 , y.C18 )) return cmp; \ - if (cmp = sql_cmp(x.C19 , y.C19 )) return cmp; \ - if (cmp = sql_cmp(x.C20 , y.C20 )) return cmp; \ - return sql_cmp(x.C21 , y.C21 ); \ - } - -// --------------------------------------------------- -// End Compare 21 -// --------------------------------------------------- - - -// --------------------------------------------------- -// Begin Compare 22 -// --------------------------------------------------- - -#define sql_compare_define_22(NAME, T1, C1, T2, C2, T3, C3, T4, C4, T5, C5, T6, C6, T7, C7, T8, C8, T9, C9, T10, C10, T11, C11, T12, C12, T13, C13, T14, C14, T15, C15, T16, C16, T17, C17, T18, C18, T19, C19, T20, C20, T21, C21, T22, C22, T23, C23, T24, C24, T25, C25) \ - NAME (const T1 &p1, const T2 &p2, const T3 &p3, const T4 &p4, const T5 &p5, const T6 &p6, const T7 &p7, const T8 &p8, const T9 &p9, const T10 &p10, const T11 &p11, const T12 &p12, const T13 &p13, const T14 &p14, const T15 &p15, const T16 &p16, const T17 &p17, const T18 &p18, const T19 &p19, const T20 &p20, const T21 &p21, const T22 &p22) : C1 (p1), C2 (p2), C3 (p3), C4 (p4), C5 (p5), C6 (p6), C7 (p7), C8 (p8), C9 (p9), C10 (p10), C11 (p11), C12 (p12), C13 (p13), C14 (p14), C15 (p15), C16 (p16), C17 (p17), C18 (p18), C19 (p19), C20 (p20), C21 (p21), C22 (p22) {} \ - void set (const T1 &p1, const T2 &p2, const T3 &p3, const T4 &p4, const T5 &p5, const T6 &p6, const T7 &p7, const T8 &p8, const T9 &p9, const T10 &p10, const T11 &p11, const T12 &p12, const T13 &p13, const T14 &p14, const T15 &p15, const T16 &p16, const T17 &p17, const T18 &p18, const T19 &p19, const T20 &p20, const T21 &p21, const T22 &p22) { \ - C1 = p1;\ - C1 = p1;\ - C2 = p2;\ - C1 = p1;\ - C2 = p2;\ - C3 = p3;\ - C1 = p1;\ - C2 = p2;\ - C3 = p3;\ - C4 = p4;\ - C1 = p1;\ - C2 = p2;\ - C3 = p3;\ - C4 = p4;\ - C5 = p5;\ - C1 = p1;\ - C2 = p2;\ - C3 = p3;\ - C4 = p4;\ - C5 = p5;\ - C6 = p6;\ - C1 = p1;\ - C2 = p2;\ - C3 = p3;\ - C4 = p4;\ - C5 = p5;\ - C6 = p6;\ - C7 = p7;\ - C1 = p1;\ - C2 = p2;\ - C3 = p3;\ - C4 = p4;\ - C5 = p5;\ - C6 = p6;\ - C7 = p7;\ - C8 = p8;\ - C1 = p1;\ - C2 = p2;\ - C3 = p3;\ - C4 = p4;\ - C5 = p5;\ - C6 = p6;\ - C7 = p7;\ - C8 = p8;\ - C9 = p9;\ - C1 = p1;\ - C2 = p2;\ - C3 = p3;\ - C4 = p4;\ - C5 = p5;\ - C6 = p6;\ - C7 = p7;\ - C8 = p8;\ - C9 = p9;\ - C10 = p10;\ - C1 = p1;\ - C2 = p2;\ - C3 = p3;\ - C4 = p4;\ - C5 = p5;\ - C6 = p6;\ - C7 = p7;\ - C8 = p8;\ - C9 = p9;\ - C10 = p10;\ - C11 = p11;\ - C1 = p1;\ - C2 = p2;\ - C3 = p3;\ - C4 = p4;\ - C5 = p5;\ - C6 = p6;\ - C7 = p7;\ - C8 = p8;\ - C9 = p9;\ - C10 = p10;\ - C11 = p11;\ - C12 = p12;\ - C1 = p1;\ - C2 = p2;\ - C3 = p3;\ - C4 = p4;\ - C5 = p5;\ - C6 = p6;\ - C7 = p7;\ - C8 = p8;\ - C9 = p9;\ - C10 = p10;\ - C11 = p11;\ - C12 = p12;\ - C13 = p13;\ - C1 = p1;\ - C2 = p2;\ - C3 = p3;\ - C4 = p4;\ - C5 = p5;\ - C6 = p6;\ - C7 = p7;\ - C8 = p8;\ - C9 = p9;\ - C10 = p10;\ - C11 = p11;\ - C12 = p12;\ - C13 = p13;\ - C14 = p14;\ - C1 = p1;\ - C2 = p2;\ - C3 = p3;\ - C4 = p4;\ - C5 = p5;\ - C6 = p6;\ - C7 = p7;\ - C8 = p8;\ - C9 = p9;\ - C10 = p10;\ - C11 = p11;\ - C12 = p12;\ - C13 = p13;\ - C14 = p14;\ - C15 = p15;\ - C1 = p1;\ - C2 = p2;\ - C3 = p3;\ - C4 = p4;\ - C5 = p5;\ - C6 = p6;\ - C7 = p7;\ - C8 = p8;\ - C9 = p9;\ - C10 = p10;\ - C11 = p11;\ - C12 = p12;\ - C13 = p13;\ - C14 = p14;\ - C15 = p15;\ - C16 = p16;\ - C1 = p1;\ - C2 = p2;\ - C3 = p3;\ - C4 = p4;\ - C5 = p5;\ - C6 = p6;\ - C7 = p7;\ - C8 = p8;\ - C9 = p9;\ - C10 = p10;\ - C11 = p11;\ - C12 = p12;\ - C13 = p13;\ - C14 = p14;\ - C15 = p15;\ - C16 = p16;\ - C17 = p17;\ - C1 = p1;\ - C2 = p2;\ - C3 = p3;\ - C4 = p4;\ - C5 = p5;\ - C6 = p6;\ - C7 = p7;\ - C8 = p8;\ - C9 = p9;\ - C10 = p10;\ - C11 = p11;\ - C12 = p12;\ - C13 = p13;\ - C14 = p14;\ - C15 = p15;\ - C16 = p16;\ - C17 = p17;\ - C18 = p18;\ - C1 = p1;\ - C2 = p2;\ - C3 = p3;\ - C4 = p4;\ - C5 = p5;\ - C6 = p6;\ - C7 = p7;\ - C8 = p8;\ - C9 = p9;\ - C10 = p10;\ - C11 = p11;\ - C12 = p12;\ - C13 = p13;\ - C14 = p14;\ - C15 = p15;\ - C16 = p16;\ - C17 = p17;\ - C18 = p18;\ - C19 = p19;\ - C1 = p1;\ - C2 = p2;\ - C3 = p3;\ - C4 = p4;\ - C5 = p5;\ - C6 = p6;\ - C7 = p7;\ - C8 = p8;\ - C9 = p9;\ - C10 = p10;\ - C11 = p11;\ - C12 = p12;\ - C13 = p13;\ - C14 = p14;\ - C15 = p15;\ - C16 = p16;\ - C17 = p17;\ - C18 = p18;\ - C19 = p19;\ - C20 = p20;\ - C1 = p1;\ - C2 = p2;\ - C3 = p3;\ - C4 = p4;\ - C5 = p5;\ - C6 = p6;\ - C7 = p7;\ - C8 = p8;\ - C9 = p9;\ - C10 = p10;\ - C11 = p11;\ - C12 = p12;\ - C13 = p13;\ - C14 = p14;\ - C15 = p15;\ - C16 = p16;\ - C17 = p17;\ - C18 = p18;\ - C19 = p19;\ - C20 = p20;\ - C21 = p21;\ - C1 = p1;\ - C2 = p2;\ - C3 = p3;\ - C4 = p4;\ - C5 = p5;\ - C6 = p6;\ - C7 = p7;\ - C8 = p8;\ - C9 = p9;\ - C10 = p10;\ - C11 = p11;\ - C12 = p12;\ - C13 = p13;\ - C14 = p14;\ - C15 = p15;\ - C16 = p16;\ - C17 = p17;\ - C18 = p18;\ - C19 = p19;\ - C20 = p20;\ - C21 = p21;\ - C22 = p22;\ - \ - } \ - sql_compare_define(NAME) - -#define sql_construct_define_22(NAME, T1, C1, T2, C2, T3, C3, T4, C4, T5, C5, T6, C6, T7, C7, T8, C8, T9, C9, T10, C10, T11, C11, T12, C12, T13, C13, T14, C14, T15, C15, T16, C16, T17, C17, T18, C18, T19, C19, T20, C20, T21, C21, T22, C22, T23, C23, T24, C24, T25, C25) \ - void set (const T1 &p1, const T2 &p2, const T3 &p3, const T4 &p4, const T5 &p5, const T6 &p6, const T7 &p7, const T8 &p8, const T9 &p9, const T10 &p10, const T11 &p11, const T12 &p12, const T13 &p13, const T14 &p14, const T15 &p15, const T16 &p16, const T17 &p17, const T18 &p18, const T19 &p19, const T20 &p20, const T21 &p21, const T22 &p22) { \ - C1 = p1;\ - C1 = p1;\ - C2 = p2;\ - C1 = p1;\ - C2 = p2;\ - C3 = p3;\ - C1 = p1;\ - C2 = p2;\ - C3 = p3;\ - C4 = p4;\ - C1 = p1;\ - C2 = p2;\ - C3 = p3;\ - C4 = p4;\ - C5 = p5;\ - C1 = p1;\ - C2 = p2;\ - C3 = p3;\ - C4 = p4;\ - C5 = p5;\ - C6 = p6;\ - C1 = p1;\ - C2 = p2;\ - C3 = p3;\ - C4 = p4;\ - C5 = p5;\ - C6 = p6;\ - C7 = p7;\ - C1 = p1;\ - C2 = p2;\ - C3 = p3;\ - C4 = p4;\ - C5 = p5;\ - C6 = p6;\ - C7 = p7;\ - C8 = p8;\ - C1 = p1;\ - C2 = p2;\ - C3 = p3;\ - C4 = p4;\ - C5 = p5;\ - C6 = p6;\ - C7 = p7;\ - C8 = p8;\ - C9 = p9;\ - C1 = p1;\ - C2 = p2;\ - C3 = p3;\ - C4 = p4;\ - C5 = p5;\ - C6 = p6;\ - C7 = p7;\ - C8 = p8;\ - C9 = p9;\ - C10 = p10;\ - C1 = p1;\ - C2 = p2;\ - C3 = p3;\ - C4 = p4;\ - C5 = p5;\ - C6 = p6;\ - C7 = p7;\ - C8 = p8;\ - C9 = p9;\ - C10 = p10;\ - C11 = p11;\ - C1 = p1;\ - C2 = p2;\ - C3 = p3;\ - C4 = p4;\ - C5 = p5;\ - C6 = p6;\ - C7 = p7;\ - C8 = p8;\ - C9 = p9;\ - C10 = p10;\ - C11 = p11;\ - C12 = p12;\ - C1 = p1;\ - C2 = p2;\ - C3 = p3;\ - C4 = p4;\ - C5 = p5;\ - C6 = p6;\ - C7 = p7;\ - C8 = p8;\ - C9 = p9;\ - C10 = p10;\ - C11 = p11;\ - C12 = p12;\ - C13 = p13;\ - C1 = p1;\ - C2 = p2;\ - C3 = p3;\ - C4 = p4;\ - C5 = p5;\ - C6 = p6;\ - C7 = p7;\ - C8 = p8;\ - C9 = p9;\ - C10 = p10;\ - C11 = p11;\ - C12 = p12;\ - C13 = p13;\ - C14 = p14;\ - C1 = p1;\ - C2 = p2;\ - C3 = p3;\ - C4 = p4;\ - C5 = p5;\ - C6 = p6;\ - C7 = p7;\ - C8 = p8;\ - C9 = p9;\ - C10 = p10;\ - C11 = p11;\ - C12 = p12;\ - C13 = p13;\ - C14 = p14;\ - C15 = p15;\ - C1 = p1;\ - C2 = p2;\ - C3 = p3;\ - C4 = p4;\ - C5 = p5;\ - C6 = p6;\ - C7 = p7;\ - C8 = p8;\ - C9 = p9;\ - C10 = p10;\ - C11 = p11;\ - C12 = p12;\ - C13 = p13;\ - C14 = p14;\ - C15 = p15;\ - C16 = p16;\ - C1 = p1;\ - C2 = p2;\ - C3 = p3;\ - C4 = p4;\ - C5 = p5;\ - C6 = p6;\ - C7 = p7;\ - C8 = p8;\ - C9 = p9;\ - C10 = p10;\ - C11 = p11;\ - C12 = p12;\ - C13 = p13;\ - C14 = p14;\ - C15 = p15;\ - C16 = p16;\ - C17 = p17;\ - C1 = p1;\ - C2 = p2;\ - C3 = p3;\ - C4 = p4;\ - C5 = p5;\ - C6 = p6;\ - C7 = p7;\ - C8 = p8;\ - C9 = p9;\ - C10 = p10;\ - C11 = p11;\ - C12 = p12;\ - C13 = p13;\ - C14 = p14;\ - C15 = p15;\ - C16 = p16;\ - C17 = p17;\ - C18 = p18;\ - C1 = p1;\ - C2 = p2;\ - C3 = p3;\ - C4 = p4;\ - C5 = p5;\ - C6 = p6;\ - C7 = p7;\ - C8 = p8;\ - C9 = p9;\ - C10 = p10;\ - C11 = p11;\ - C12 = p12;\ - C13 = p13;\ - C14 = p14;\ - C15 = p15;\ - C16 = p16;\ - C17 = p17;\ - C18 = p18;\ - C19 = p19;\ - C1 = p1;\ - C2 = p2;\ - C3 = p3;\ - C4 = p4;\ - C5 = p5;\ - C6 = p6;\ - C7 = p7;\ - C8 = p8;\ - C9 = p9;\ - C10 = p10;\ - C11 = p11;\ - C12 = p12;\ - C13 = p13;\ - C14 = p14;\ - C15 = p15;\ - C16 = p16;\ - C17 = p17;\ - C18 = p18;\ - C19 = p19;\ - C20 = p20;\ - C1 = p1;\ - C2 = p2;\ - C3 = p3;\ - C4 = p4;\ - C5 = p5;\ - C6 = p6;\ - C7 = p7;\ - C8 = p8;\ - C9 = p9;\ - C10 = p10;\ - C11 = p11;\ - C12 = p12;\ - C13 = p13;\ - C14 = p14;\ - C15 = p15;\ - C16 = p16;\ - C17 = p17;\ - C18 = p18;\ - C19 = p19;\ - C20 = p20;\ - C21 = p21;\ - C1 = p1;\ - C2 = p2;\ - C3 = p3;\ - C4 = p4;\ - C5 = p5;\ - C6 = p6;\ - C7 = p7;\ - C8 = p8;\ - C9 = p9;\ - C10 = p10;\ - C11 = p11;\ - C12 = p12;\ - C13 = p13;\ - C14 = p14;\ - C15 = p15;\ - C16 = p16;\ - C17 = p17;\ - C18 = p18;\ - C19 = p19;\ - C20 = p20;\ - C21 = p21;\ - C22 = p22;\ - \ - } \ - NAME (const T1 &p1, const T2 &p2, const T3 &p3, const T4 &p4, const T5 &p5, const T6 &p6, const T7 &p7, const T8 &p8, const T9 &p9, const T10 &p10, const T11 &p11, const T12 &p12, const T13 &p13, const T14 &p14, const T15 &p15, const T16 &p16, const T17 &p17, const T18 &p18, const T19 &p19, const T20 &p20, const T21 &p21, const T22 &p22) : C1 (p1), C2 (p2), C3 (p3), C4 (p4), C5 (p5), C6 (p6), C7 (p7), C8 (p8), C9 (p9), C10 (p10), C11 (p11), C12 (p12), C13 (p13), C14 (p14), C15 (p15), C16 (p16), C17 (p17), C18 (p18), C19 (p19), C20 (p20), C21 (p21), C22 (p22) {} - -#define sql_compare_type_def_22(NAME, WHAT, NUM) \ - return WHAT##_list(d, m, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true) - -#define sql_compare_type_defe_22(NAME, WHAT, NUM) \ - return WHAT##_list(d, c, m, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true) - -#define sql_COMPARE__22(NAME, C1, C2, C3, C4, C5, C6, C7, C8, C9, C10, C11, C12, C13, C14, C15, C16, C17, C18, C19, C20, C21, C22, C23, C24, C25) \ - template \ - int sql_compare_##NAME (const NAME &x, const NAME &y) { \ - int cmp; \ - if (cmp = sql_cmp(x.C1 , y.C1 )) return cmp; \ - if (cmp = sql_cmp(x.C2 , y.C2 )) return cmp; \ - if (cmp = sql_cmp(x.C3 , y.C3 )) return cmp; \ - if (cmp = sql_cmp(x.C4 , y.C4 )) return cmp; \ - if (cmp = sql_cmp(x.C5 , y.C5 )) return cmp; \ - if (cmp = sql_cmp(x.C6 , y.C6 )) return cmp; \ - if (cmp = sql_cmp(x.C7 , y.C7 )) return cmp; \ - if (cmp = sql_cmp(x.C8 , y.C8 )) return cmp; \ - if (cmp = sql_cmp(x.C9 , y.C9 )) return cmp; \ - if (cmp = sql_cmp(x.C10 , y.C10 )) return cmp; \ - if (cmp = sql_cmp(x.C11 , y.C11 )) return cmp; \ - if (cmp = sql_cmp(x.C12 , y.C12 )) return cmp; \ - if (cmp = sql_cmp(x.C13 , y.C13 )) return cmp; \ - if (cmp = sql_cmp(x.C14 , y.C14 )) return cmp; \ - if (cmp = sql_cmp(x.C15 , y.C15 )) return cmp; \ - if (cmp = sql_cmp(x.C16 , y.C16 )) return cmp; \ - if (cmp = sql_cmp(x.C17 , y.C17 )) return cmp; \ - if (cmp = sql_cmp(x.C18 , y.C18 )) return cmp; \ - if (cmp = sql_cmp(x.C19 , y.C19 )) return cmp; \ - if (cmp = sql_cmp(x.C20 , y.C20 )) return cmp; \ - if (cmp = sql_cmp(x.C21 , y.C21 )) return cmp; \ - return sql_cmp(x.C22 , y.C22 ); \ - } \ - template \ - int compare (const NAME &x, const NAME &y) { \ - int cmp; \ - if (cmp = sql_cmp(x.C1 , y.C1 )) return cmp; \ - if (cmp = sql_cmp(x.C2 , y.C2 )) return cmp; \ - if (cmp = sql_cmp(x.C3 , y.C3 )) return cmp; \ - if (cmp = sql_cmp(x.C4 , y.C4 )) return cmp; \ - if (cmp = sql_cmp(x.C5 , y.C5 )) return cmp; \ - if (cmp = sql_cmp(x.C6 , y.C6 )) return cmp; \ - if (cmp = sql_cmp(x.C7 , y.C7 )) return cmp; \ - if (cmp = sql_cmp(x.C8 , y.C8 )) return cmp; \ - if (cmp = sql_cmp(x.C9 , y.C9 )) return cmp; \ - if (cmp = sql_cmp(x.C10 , y.C10 )) return cmp; \ - if (cmp = sql_cmp(x.C11 , y.C11 )) return cmp; \ - if (cmp = sql_cmp(x.C12 , y.C12 )) return cmp; \ - if (cmp = sql_cmp(x.C13 , y.C13 )) return cmp; \ - if (cmp = sql_cmp(x.C14 , y.C14 )) return cmp; \ - if (cmp = sql_cmp(x.C15 , y.C15 )) return cmp; \ - if (cmp = sql_cmp(x.C16 , y.C16 )) return cmp; \ - if (cmp = sql_cmp(x.C17 , y.C17 )) return cmp; \ - if (cmp = sql_cmp(x.C18 , y.C18 )) return cmp; \ - if (cmp = sql_cmp(x.C19 , y.C19 )) return cmp; \ - if (cmp = sql_cmp(x.C20 , y.C20 )) return cmp; \ - if (cmp = sql_cmp(x.C21 , y.C21 )) return cmp; \ - return sql_cmp(x.C22 , y.C22 ); \ - } - -// --------------------------------------------------- -// End Compare 22 -// --------------------------------------------------- - - -// --------------------------------------------------- -// Begin Compare 23 -// --------------------------------------------------- - -#define sql_compare_define_23(NAME, T1, C1, T2, C2, T3, C3, T4, C4, T5, C5, T6, C6, T7, C7, T8, C8, T9, C9, T10, C10, T11, C11, T12, C12, T13, C13, T14, C14, T15, C15, T16, C16, T17, C17, T18, C18, T19, C19, T20, C20, T21, C21, T22, C22, T23, C23, T24, C24, T25, C25) \ - NAME (const T1 &p1, const T2 &p2, const T3 &p3, const T4 &p4, const T5 &p5, const T6 &p6, const T7 &p7, const T8 &p8, const T9 &p9, const T10 &p10, const T11 &p11, const T12 &p12, const T13 &p13, const T14 &p14, const T15 &p15, const T16 &p16, const T17 &p17, const T18 &p18, const T19 &p19, const T20 &p20, const T21 &p21, const T22 &p22, const T23 &p23) : C1 (p1), C2 (p2), C3 (p3), C4 (p4), C5 (p5), C6 (p6), C7 (p7), C8 (p8), C9 (p9), C10 (p10), C11 (p11), C12 (p12), C13 (p13), C14 (p14), C15 (p15), C16 (p16), C17 (p17), C18 (p18), C19 (p19), C20 (p20), C21 (p21), C22 (p22), C23 (p23) {} \ - void set (const T1 &p1, const T2 &p2, const T3 &p3, const T4 &p4, const T5 &p5, const T6 &p6, const T7 &p7, const T8 &p8, const T9 &p9, const T10 &p10, const T11 &p11, const T12 &p12, const T13 &p13, const T14 &p14, const T15 &p15, const T16 &p16, const T17 &p17, const T18 &p18, const T19 &p19, const T20 &p20, const T21 &p21, const T22 &p22, const T23 &p23) { \ - C1 = p1;\ - C1 = p1;\ - C2 = p2;\ - C1 = p1;\ - C2 = p2;\ - C3 = p3;\ - C1 = p1;\ - C2 = p2;\ - C3 = p3;\ - C4 = p4;\ - C1 = p1;\ - C2 = p2;\ - C3 = p3;\ - C4 = p4;\ - C5 = p5;\ - C1 = p1;\ - C2 = p2;\ - C3 = p3;\ - C4 = p4;\ - C5 = p5;\ - C6 = p6;\ - C1 = p1;\ - C2 = p2;\ - C3 = p3;\ - C4 = p4;\ - C5 = p5;\ - C6 = p6;\ - C7 = p7;\ - C1 = p1;\ - C2 = p2;\ - C3 = p3;\ - C4 = p4;\ - C5 = p5;\ - C6 = p6;\ - C7 = p7;\ - C8 = p8;\ - C1 = p1;\ - C2 = p2;\ - C3 = p3;\ - C4 = p4;\ - C5 = p5;\ - C6 = p6;\ - C7 = p7;\ - C8 = p8;\ - C9 = p9;\ - C1 = p1;\ - C2 = p2;\ - C3 = p3;\ - C4 = p4;\ - C5 = p5;\ - C6 = p6;\ - C7 = p7;\ - C8 = p8;\ - C9 = p9;\ - C10 = p10;\ - C1 = p1;\ - C2 = p2;\ - C3 = p3;\ - C4 = p4;\ - C5 = p5;\ - C6 = p6;\ - C7 = p7;\ - C8 = p8;\ - C9 = p9;\ - C10 = p10;\ - C11 = p11;\ - C1 = p1;\ - C2 = p2;\ - C3 = p3;\ - C4 = p4;\ - C5 = p5;\ - C6 = p6;\ - C7 = p7;\ - C8 = p8;\ - C9 = p9;\ - C10 = p10;\ - C11 = p11;\ - C12 = p12;\ - C1 = p1;\ - C2 = p2;\ - C3 = p3;\ - C4 = p4;\ - C5 = p5;\ - C6 = p6;\ - C7 = p7;\ - C8 = p8;\ - C9 = p9;\ - C10 = p10;\ - C11 = p11;\ - C12 = p12;\ - C13 = p13;\ - C1 = p1;\ - C2 = p2;\ - C3 = p3;\ - C4 = p4;\ - C5 = p5;\ - C6 = p6;\ - C7 = p7;\ - C8 = p8;\ - C9 = p9;\ - C10 = p10;\ - C11 = p11;\ - C12 = p12;\ - C13 = p13;\ - C14 = p14;\ - C1 = p1;\ - C2 = p2;\ - C3 = p3;\ - C4 = p4;\ - C5 = p5;\ - C6 = p6;\ - C7 = p7;\ - C8 = p8;\ - C9 = p9;\ - C10 = p10;\ - C11 = p11;\ - C12 = p12;\ - C13 = p13;\ - C14 = p14;\ - C15 = p15;\ - C1 = p1;\ - C2 = p2;\ - C3 = p3;\ - C4 = p4;\ - C5 = p5;\ - C6 = p6;\ - C7 = p7;\ - C8 = p8;\ - C9 = p9;\ - C10 = p10;\ - C11 = p11;\ - C12 = p12;\ - C13 = p13;\ - C14 = p14;\ - C15 = p15;\ - C16 = p16;\ - C1 = p1;\ - C2 = p2;\ - C3 = p3;\ - C4 = p4;\ - C5 = p5;\ - C6 = p6;\ - C7 = p7;\ - C8 = p8;\ - C9 = p9;\ - C10 = p10;\ - C11 = p11;\ - C12 = p12;\ - C13 = p13;\ - C14 = p14;\ - C15 = p15;\ - C16 = p16;\ - C17 = p17;\ - C1 = p1;\ - C2 = p2;\ - C3 = p3;\ - C4 = p4;\ - C5 = p5;\ - C6 = p6;\ - C7 = p7;\ - C8 = p8;\ - C9 = p9;\ - C10 = p10;\ - C11 = p11;\ - C12 = p12;\ - C13 = p13;\ - C14 = p14;\ - C15 = p15;\ - C16 = p16;\ - C17 = p17;\ - C18 = p18;\ - C1 = p1;\ - C2 = p2;\ - C3 = p3;\ - C4 = p4;\ - C5 = p5;\ - C6 = p6;\ - C7 = p7;\ - C8 = p8;\ - C9 = p9;\ - C10 = p10;\ - C11 = p11;\ - C12 = p12;\ - C13 = p13;\ - C14 = p14;\ - C15 = p15;\ - C16 = p16;\ - C17 = p17;\ - C18 = p18;\ - C19 = p19;\ - C1 = p1;\ - C2 = p2;\ - C3 = p3;\ - C4 = p4;\ - C5 = p5;\ - C6 = p6;\ - C7 = p7;\ - C8 = p8;\ - C9 = p9;\ - C10 = p10;\ - C11 = p11;\ - C12 = p12;\ - C13 = p13;\ - C14 = p14;\ - C15 = p15;\ - C16 = p16;\ - C17 = p17;\ - C18 = p18;\ - C19 = p19;\ - C20 = p20;\ - C1 = p1;\ - C2 = p2;\ - C3 = p3;\ - C4 = p4;\ - C5 = p5;\ - C6 = p6;\ - C7 = p7;\ - C8 = p8;\ - C9 = p9;\ - C10 = p10;\ - C11 = p11;\ - C12 = p12;\ - C13 = p13;\ - C14 = p14;\ - C15 = p15;\ - C16 = p16;\ - C17 = p17;\ - C18 = p18;\ - C19 = p19;\ - C20 = p20;\ - C21 = p21;\ - C1 = p1;\ - C2 = p2;\ - C3 = p3;\ - C4 = p4;\ - C5 = p5;\ - C6 = p6;\ - C7 = p7;\ - C8 = p8;\ - C9 = p9;\ - C10 = p10;\ - C11 = p11;\ - C12 = p12;\ - C13 = p13;\ - C14 = p14;\ - C15 = p15;\ - C16 = p16;\ - C17 = p17;\ - C18 = p18;\ - C19 = p19;\ - C20 = p20;\ - C21 = p21;\ - C22 = p22;\ - C1 = p1;\ - C2 = p2;\ - C3 = p3;\ - C4 = p4;\ - C5 = p5;\ - C6 = p6;\ - C7 = p7;\ - C8 = p8;\ - C9 = p9;\ - C10 = p10;\ - C11 = p11;\ - C12 = p12;\ - C13 = p13;\ - C14 = p14;\ - C15 = p15;\ - C16 = p16;\ - C17 = p17;\ - C18 = p18;\ - C19 = p19;\ - C20 = p20;\ - C21 = p21;\ - C22 = p22;\ - C23 = p23;\ - \ - } \ - sql_compare_define(NAME) - -#define sql_construct_define_23(NAME, T1, C1, T2, C2, T3, C3, T4, C4, T5, C5, T6, C6, T7, C7, T8, C8, T9, C9, T10, C10, T11, C11, T12, C12, T13, C13, T14, C14, T15, C15, T16, C16, T17, C17, T18, C18, T19, C19, T20, C20, T21, C21, T22, C22, T23, C23, T24, C24, T25, C25) \ - void set (const T1 &p1, const T2 &p2, const T3 &p3, const T4 &p4, const T5 &p5, const T6 &p6, const T7 &p7, const T8 &p8, const T9 &p9, const T10 &p10, const T11 &p11, const T12 &p12, const T13 &p13, const T14 &p14, const T15 &p15, const T16 &p16, const T17 &p17, const T18 &p18, const T19 &p19, const T20 &p20, const T21 &p21, const T22 &p22, const T23 &p23) { \ - C1 = p1;\ - C1 = p1;\ - C2 = p2;\ - C1 = p1;\ - C2 = p2;\ - C3 = p3;\ - C1 = p1;\ - C2 = p2;\ - C3 = p3;\ - C4 = p4;\ - C1 = p1;\ - C2 = p2;\ - C3 = p3;\ - C4 = p4;\ - C5 = p5;\ - C1 = p1;\ - C2 = p2;\ - C3 = p3;\ - C4 = p4;\ - C5 = p5;\ - C6 = p6;\ - C1 = p1;\ - C2 = p2;\ - C3 = p3;\ - C4 = p4;\ - C5 = p5;\ - C6 = p6;\ - C7 = p7;\ - C1 = p1;\ - C2 = p2;\ - C3 = p3;\ - C4 = p4;\ - C5 = p5;\ - C6 = p6;\ - C7 = p7;\ - C8 = p8;\ - C1 = p1;\ - C2 = p2;\ - C3 = p3;\ - C4 = p4;\ - C5 = p5;\ - C6 = p6;\ - C7 = p7;\ - C8 = p8;\ - C9 = p9;\ - C1 = p1;\ - C2 = p2;\ - C3 = p3;\ - C4 = p4;\ - C5 = p5;\ - C6 = p6;\ - C7 = p7;\ - C8 = p8;\ - C9 = p9;\ - C10 = p10;\ - C1 = p1;\ - C2 = p2;\ - C3 = p3;\ - C4 = p4;\ - C5 = p5;\ - C6 = p6;\ - C7 = p7;\ - C8 = p8;\ - C9 = p9;\ - C10 = p10;\ - C11 = p11;\ - C1 = p1;\ - C2 = p2;\ - C3 = p3;\ - C4 = p4;\ - C5 = p5;\ - C6 = p6;\ - C7 = p7;\ - C8 = p8;\ - C9 = p9;\ - C10 = p10;\ - C11 = p11;\ - C12 = p12;\ - C1 = p1;\ - C2 = p2;\ - C3 = p3;\ - C4 = p4;\ - C5 = p5;\ - C6 = p6;\ - C7 = p7;\ - C8 = p8;\ - C9 = p9;\ - C10 = p10;\ - C11 = p11;\ - C12 = p12;\ - C13 = p13;\ - C1 = p1;\ - C2 = p2;\ - C3 = p3;\ - C4 = p4;\ - C5 = p5;\ - C6 = p6;\ - C7 = p7;\ - C8 = p8;\ - C9 = p9;\ - C10 = p10;\ - C11 = p11;\ - C12 = p12;\ - C13 = p13;\ - C14 = p14;\ - C1 = p1;\ - C2 = p2;\ - C3 = p3;\ - C4 = p4;\ - C5 = p5;\ - C6 = p6;\ - C7 = p7;\ - C8 = p8;\ - C9 = p9;\ - C10 = p10;\ - C11 = p11;\ - C12 = p12;\ - C13 = p13;\ - C14 = p14;\ - C15 = p15;\ - C1 = p1;\ - C2 = p2;\ - C3 = p3;\ - C4 = p4;\ - C5 = p5;\ - C6 = p6;\ - C7 = p7;\ - C8 = p8;\ - C9 = p9;\ - C10 = p10;\ - C11 = p11;\ - C12 = p12;\ - C13 = p13;\ - C14 = p14;\ - C15 = p15;\ - C16 = p16;\ - C1 = p1;\ - C2 = p2;\ - C3 = p3;\ - C4 = p4;\ - C5 = p5;\ - C6 = p6;\ - C7 = p7;\ - C8 = p8;\ - C9 = p9;\ - C10 = p10;\ - C11 = p11;\ - C12 = p12;\ - C13 = p13;\ - C14 = p14;\ - C15 = p15;\ - C16 = p16;\ - C17 = p17;\ - C1 = p1;\ - C2 = p2;\ - C3 = p3;\ - C4 = p4;\ - C5 = p5;\ - C6 = p6;\ - C7 = p7;\ - C8 = p8;\ - C9 = p9;\ - C10 = p10;\ - C11 = p11;\ - C12 = p12;\ - C13 = p13;\ - C14 = p14;\ - C15 = p15;\ - C16 = p16;\ - C17 = p17;\ - C18 = p18;\ - C1 = p1;\ - C2 = p2;\ - C3 = p3;\ - C4 = p4;\ - C5 = p5;\ - C6 = p6;\ - C7 = p7;\ - C8 = p8;\ - C9 = p9;\ - C10 = p10;\ - C11 = p11;\ - C12 = p12;\ - C13 = p13;\ - C14 = p14;\ - C15 = p15;\ - C16 = p16;\ - C17 = p17;\ - C18 = p18;\ - C19 = p19;\ - C1 = p1;\ - C2 = p2;\ - C3 = p3;\ - C4 = p4;\ - C5 = p5;\ - C6 = p6;\ - C7 = p7;\ - C8 = p8;\ - C9 = p9;\ - C10 = p10;\ - C11 = p11;\ - C12 = p12;\ - C13 = p13;\ - C14 = p14;\ - C15 = p15;\ - C16 = p16;\ - C17 = p17;\ - C18 = p18;\ - C19 = p19;\ - C20 = p20;\ - C1 = p1;\ - C2 = p2;\ - C3 = p3;\ - C4 = p4;\ - C5 = p5;\ - C6 = p6;\ - C7 = p7;\ - C8 = p8;\ - C9 = p9;\ - C10 = p10;\ - C11 = p11;\ - C12 = p12;\ - C13 = p13;\ - C14 = p14;\ - C15 = p15;\ - C16 = p16;\ - C17 = p17;\ - C18 = p18;\ - C19 = p19;\ - C20 = p20;\ - C21 = p21;\ - C1 = p1;\ - C2 = p2;\ - C3 = p3;\ - C4 = p4;\ - C5 = p5;\ - C6 = p6;\ - C7 = p7;\ - C8 = p8;\ - C9 = p9;\ - C10 = p10;\ - C11 = p11;\ - C12 = p12;\ - C13 = p13;\ - C14 = p14;\ - C15 = p15;\ - C16 = p16;\ - C17 = p17;\ - C18 = p18;\ - C19 = p19;\ - C20 = p20;\ - C21 = p21;\ - C22 = p22;\ - C1 = p1;\ - C2 = p2;\ - C3 = p3;\ - C4 = p4;\ - C5 = p5;\ - C6 = p6;\ - C7 = p7;\ - C8 = p8;\ - C9 = p9;\ - C10 = p10;\ - C11 = p11;\ - C12 = p12;\ - C13 = p13;\ - C14 = p14;\ - C15 = p15;\ - C16 = p16;\ - C17 = p17;\ - C18 = p18;\ - C19 = p19;\ - C20 = p20;\ - C21 = p21;\ - C22 = p22;\ - C23 = p23;\ - \ - } \ - NAME (const T1 &p1, const T2 &p2, const T3 &p3, const T4 &p4, const T5 &p5, const T6 &p6, const T7 &p7, const T8 &p8, const T9 &p9, const T10 &p10, const T11 &p11, const T12 &p12, const T13 &p13, const T14 &p14, const T15 &p15, const T16 &p16, const T17 &p17, const T18 &p18, const T19 &p19, const T20 &p20, const T21 &p21, const T22 &p22, const T23 &p23) : C1 (p1), C2 (p2), C3 (p3), C4 (p4), C5 (p5), C6 (p6), C7 (p7), C8 (p8), C9 (p9), C10 (p10), C11 (p11), C12 (p12), C13 (p13), C14 (p14), C15 (p15), C16 (p16), C17 (p17), C18 (p18), C19 (p19), C20 (p20), C21 (p21), C22 (p22), C23 (p23) {} - -#define sql_compare_type_def_23(NAME, WHAT, NUM) \ - return WHAT##_list(d, m, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true) - -#define sql_compare_type_defe_23(NAME, WHAT, NUM) \ - return WHAT##_list(d, c, m, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true) - -#define sql_COMPARE__23(NAME, C1, C2, C3, C4, C5, C6, C7, C8, C9, C10, C11, C12, C13, C14, C15, C16, C17, C18, C19, C20, C21, C22, C23, C24, C25) \ - template \ - int sql_compare_##NAME (const NAME &x, const NAME &y) { \ - int cmp; \ - if (cmp = sql_cmp(x.C1 , y.C1 )) return cmp; \ - if (cmp = sql_cmp(x.C2 , y.C2 )) return cmp; \ - if (cmp = sql_cmp(x.C3 , y.C3 )) return cmp; \ - if (cmp = sql_cmp(x.C4 , y.C4 )) return cmp; \ - if (cmp = sql_cmp(x.C5 , y.C5 )) return cmp; \ - if (cmp = sql_cmp(x.C6 , y.C6 )) return cmp; \ - if (cmp = sql_cmp(x.C7 , y.C7 )) return cmp; \ - if (cmp = sql_cmp(x.C8 , y.C8 )) return cmp; \ - if (cmp = sql_cmp(x.C9 , y.C9 )) return cmp; \ - if (cmp = sql_cmp(x.C10 , y.C10 )) return cmp; \ - if (cmp = sql_cmp(x.C11 , y.C11 )) return cmp; \ - if (cmp = sql_cmp(x.C12 , y.C12 )) return cmp; \ - if (cmp = sql_cmp(x.C13 , y.C13 )) return cmp; \ - if (cmp = sql_cmp(x.C14 , y.C14 )) return cmp; \ - if (cmp = sql_cmp(x.C15 , y.C15 )) return cmp; \ - if (cmp = sql_cmp(x.C16 , y.C16 )) return cmp; \ - if (cmp = sql_cmp(x.C17 , y.C17 )) return cmp; \ - if (cmp = sql_cmp(x.C18 , y.C18 )) return cmp; \ - if (cmp = sql_cmp(x.C19 , y.C19 )) return cmp; \ - if (cmp = sql_cmp(x.C20 , y.C20 )) return cmp; \ - if (cmp = sql_cmp(x.C21 , y.C21 )) return cmp; \ - if (cmp = sql_cmp(x.C22 , y.C22 )) return cmp; \ - return sql_cmp(x.C23 , y.C23 ); \ - } \ - template \ - int compare (const NAME &x, const NAME &y) { \ - int cmp; \ - if (cmp = sql_cmp(x.C1 , y.C1 )) return cmp; \ - if (cmp = sql_cmp(x.C2 , y.C2 )) return cmp; \ - if (cmp = sql_cmp(x.C3 , y.C3 )) return cmp; \ - if (cmp = sql_cmp(x.C4 , y.C4 )) return cmp; \ - if (cmp = sql_cmp(x.C5 , y.C5 )) return cmp; \ - if (cmp = sql_cmp(x.C6 , y.C6 )) return cmp; \ - if (cmp = sql_cmp(x.C7 , y.C7 )) return cmp; \ - if (cmp = sql_cmp(x.C8 , y.C8 )) return cmp; \ - if (cmp = sql_cmp(x.C9 , y.C9 )) return cmp; \ - if (cmp = sql_cmp(x.C10 , y.C10 )) return cmp; \ - if (cmp = sql_cmp(x.C11 , y.C11 )) return cmp; \ - if (cmp = sql_cmp(x.C12 , y.C12 )) return cmp; \ - if (cmp = sql_cmp(x.C13 , y.C13 )) return cmp; \ - if (cmp = sql_cmp(x.C14 , y.C14 )) return cmp; \ - if (cmp = sql_cmp(x.C15 , y.C15 )) return cmp; \ - if (cmp = sql_cmp(x.C16 , y.C16 )) return cmp; \ - if (cmp = sql_cmp(x.C17 , y.C17 )) return cmp; \ - if (cmp = sql_cmp(x.C18 , y.C18 )) return cmp; \ - if (cmp = sql_cmp(x.C19 , y.C19 )) return cmp; \ - if (cmp = sql_cmp(x.C20 , y.C20 )) return cmp; \ - if (cmp = sql_cmp(x.C21 , y.C21 )) return cmp; \ - if (cmp = sql_cmp(x.C22 , y.C22 )) return cmp; \ - return sql_cmp(x.C23 , y.C23 ); \ - } - -// --------------------------------------------------- -// End Compare 23 -// --------------------------------------------------- - - -// --------------------------------------------------- -// Begin Compare 24 -// --------------------------------------------------- - -#define sql_compare_define_24(NAME, T1, C1, T2, C2, T3, C3, T4, C4, T5, C5, T6, C6, T7, C7, T8, C8, T9, C9, T10, C10, T11, C11, T12, C12, T13, C13, T14, C14, T15, C15, T16, C16, T17, C17, T18, C18, T19, C19, T20, C20, T21, C21, T22, C22, T23, C23, T24, C24, T25, C25) \ - NAME (const T1 &p1, const T2 &p2, const T3 &p3, const T4 &p4, const T5 &p5, const T6 &p6, const T7 &p7, const T8 &p8, const T9 &p9, const T10 &p10, const T11 &p11, const T12 &p12, const T13 &p13, const T14 &p14, const T15 &p15, const T16 &p16, const T17 &p17, const T18 &p18, const T19 &p19, const T20 &p20, const T21 &p21, const T22 &p22, const T23 &p23, const T24 &p24) : C1 (p1), C2 (p2), C3 (p3), C4 (p4), C5 (p5), C6 (p6), C7 (p7), C8 (p8), C9 (p9), C10 (p10), C11 (p11), C12 (p12), C13 (p13), C14 (p14), C15 (p15), C16 (p16), C17 (p17), C18 (p18), C19 (p19), C20 (p20), C21 (p21), C22 (p22), C23 (p23), C24 (p24) {} \ - void set (const T1 &p1, const T2 &p2, const T3 &p3, const T4 &p4, const T5 &p5, const T6 &p6, const T7 &p7, const T8 &p8, const T9 &p9, const T10 &p10, const T11 &p11, const T12 &p12, const T13 &p13, const T14 &p14, const T15 &p15, const T16 &p16, const T17 &p17, const T18 &p18, const T19 &p19, const T20 &p20, const T21 &p21, const T22 &p22, const T23 &p23, const T24 &p24) { \ - C1 = p1;\ - C1 = p1;\ - C2 = p2;\ - C1 = p1;\ - C2 = p2;\ - C3 = p3;\ - C1 = p1;\ - C2 = p2;\ - C3 = p3;\ - C4 = p4;\ - C1 = p1;\ - C2 = p2;\ - C3 = p3;\ - C4 = p4;\ - C5 = p5;\ - C1 = p1;\ - C2 = p2;\ - C3 = p3;\ - C4 = p4;\ - C5 = p5;\ - C6 = p6;\ - C1 = p1;\ - C2 = p2;\ - C3 = p3;\ - C4 = p4;\ - C5 = p5;\ - C6 = p6;\ - C7 = p7;\ - C1 = p1;\ - C2 = p2;\ - C3 = p3;\ - C4 = p4;\ - C5 = p5;\ - C6 = p6;\ - C7 = p7;\ - C8 = p8;\ - C1 = p1;\ - C2 = p2;\ - C3 = p3;\ - C4 = p4;\ - C5 = p5;\ - C6 = p6;\ - C7 = p7;\ - C8 = p8;\ - C9 = p9;\ - C1 = p1;\ - C2 = p2;\ - C3 = p3;\ - C4 = p4;\ - C5 = p5;\ - C6 = p6;\ - C7 = p7;\ - C8 = p8;\ - C9 = p9;\ - C10 = p10;\ - C1 = p1;\ - C2 = p2;\ - C3 = p3;\ - C4 = p4;\ - C5 = p5;\ - C6 = p6;\ - C7 = p7;\ - C8 = p8;\ - C9 = p9;\ - C10 = p10;\ - C11 = p11;\ - C1 = p1;\ - C2 = p2;\ - C3 = p3;\ - C4 = p4;\ - C5 = p5;\ - C6 = p6;\ - C7 = p7;\ - C8 = p8;\ - C9 = p9;\ - C10 = p10;\ - C11 = p11;\ - C12 = p12;\ - C1 = p1;\ - C2 = p2;\ - C3 = p3;\ - C4 = p4;\ - C5 = p5;\ - C6 = p6;\ - C7 = p7;\ - C8 = p8;\ - C9 = p9;\ - C10 = p10;\ - C11 = p11;\ - C12 = p12;\ - C13 = p13;\ - C1 = p1;\ - C2 = p2;\ - C3 = p3;\ - C4 = p4;\ - C5 = p5;\ - C6 = p6;\ - C7 = p7;\ - C8 = p8;\ - C9 = p9;\ - C10 = p10;\ - C11 = p11;\ - C12 = p12;\ - C13 = p13;\ - C14 = p14;\ - C1 = p1;\ - C2 = p2;\ - C3 = p3;\ - C4 = p4;\ - C5 = p5;\ - C6 = p6;\ - C7 = p7;\ - C8 = p8;\ - C9 = p9;\ - C10 = p10;\ - C11 = p11;\ - C12 = p12;\ - C13 = p13;\ - C14 = p14;\ - C15 = p15;\ - C1 = p1;\ - C2 = p2;\ - C3 = p3;\ - C4 = p4;\ - C5 = p5;\ - C6 = p6;\ - C7 = p7;\ - C8 = p8;\ - C9 = p9;\ - C10 = p10;\ - C11 = p11;\ - C12 = p12;\ - C13 = p13;\ - C14 = p14;\ - C15 = p15;\ - C16 = p16;\ - C1 = p1;\ - C2 = p2;\ - C3 = p3;\ - C4 = p4;\ - C5 = p5;\ - C6 = p6;\ - C7 = p7;\ - C8 = p8;\ - C9 = p9;\ - C10 = p10;\ - C11 = p11;\ - C12 = p12;\ - C13 = p13;\ - C14 = p14;\ - C15 = p15;\ - C16 = p16;\ - C17 = p17;\ - C1 = p1;\ - C2 = p2;\ - C3 = p3;\ - C4 = p4;\ - C5 = p5;\ - C6 = p6;\ - C7 = p7;\ - C8 = p8;\ - C9 = p9;\ - C10 = p10;\ - C11 = p11;\ - C12 = p12;\ - C13 = p13;\ - C14 = p14;\ - C15 = p15;\ - C16 = p16;\ - C17 = p17;\ - C18 = p18;\ - C1 = p1;\ - C2 = p2;\ - C3 = p3;\ - C4 = p4;\ - C5 = p5;\ - C6 = p6;\ - C7 = p7;\ - C8 = p8;\ - C9 = p9;\ - C10 = p10;\ - C11 = p11;\ - C12 = p12;\ - C13 = p13;\ - C14 = p14;\ - C15 = p15;\ - C16 = p16;\ - C17 = p17;\ - C18 = p18;\ - C19 = p19;\ - C1 = p1;\ - C2 = p2;\ - C3 = p3;\ - C4 = p4;\ - C5 = p5;\ - C6 = p6;\ - C7 = p7;\ - C8 = p8;\ - C9 = p9;\ - C10 = p10;\ - C11 = p11;\ - C12 = p12;\ - C13 = p13;\ - C14 = p14;\ - C15 = p15;\ - C16 = p16;\ - C17 = p17;\ - C18 = p18;\ - C19 = p19;\ - C20 = p20;\ - C1 = p1;\ - C2 = p2;\ - C3 = p3;\ - C4 = p4;\ - C5 = p5;\ - C6 = p6;\ - C7 = p7;\ - C8 = p8;\ - C9 = p9;\ - C10 = p10;\ - C11 = p11;\ - C12 = p12;\ - C13 = p13;\ - C14 = p14;\ - C15 = p15;\ - C16 = p16;\ - C17 = p17;\ - C18 = p18;\ - C19 = p19;\ - C20 = p20;\ - C21 = p21;\ - C1 = p1;\ - C2 = p2;\ - C3 = p3;\ - C4 = p4;\ - C5 = p5;\ - C6 = p6;\ - C7 = p7;\ - C8 = p8;\ - C9 = p9;\ - C10 = p10;\ - C11 = p11;\ - C12 = p12;\ - C13 = p13;\ - C14 = p14;\ - C15 = p15;\ - C16 = p16;\ - C17 = p17;\ - C18 = p18;\ - C19 = p19;\ - C20 = p20;\ - C21 = p21;\ - C22 = p22;\ - C1 = p1;\ - C2 = p2;\ - C3 = p3;\ - C4 = p4;\ - C5 = p5;\ - C6 = p6;\ - C7 = p7;\ - C8 = p8;\ - C9 = p9;\ - C10 = p10;\ - C11 = p11;\ - C12 = p12;\ - C13 = p13;\ - C14 = p14;\ - C15 = p15;\ - C16 = p16;\ - C17 = p17;\ - C18 = p18;\ - C19 = p19;\ - C20 = p20;\ - C21 = p21;\ - C22 = p22;\ - C23 = p23;\ - C1 = p1;\ - C2 = p2;\ - C3 = p3;\ - C4 = p4;\ - C5 = p5;\ - C6 = p6;\ - C7 = p7;\ - C8 = p8;\ - C9 = p9;\ - C10 = p10;\ - C11 = p11;\ - C12 = p12;\ - C13 = p13;\ - C14 = p14;\ - C15 = p15;\ - C16 = p16;\ - C17 = p17;\ - C18 = p18;\ - C19 = p19;\ - C20 = p20;\ - C21 = p21;\ - C22 = p22;\ - C23 = p23;\ - C24 = p24;\ - \ - } \ - sql_compare_define(NAME) - -#define sql_construct_define_24(NAME, T1, C1, T2, C2, T3, C3, T4, C4, T5, C5, T6, C6, T7, C7, T8, C8, T9, C9, T10, C10, T11, C11, T12, C12, T13, C13, T14, C14, T15, C15, T16, C16, T17, C17, T18, C18, T19, C19, T20, C20, T21, C21, T22, C22, T23, C23, T24, C24, T25, C25) \ - void set (const T1 &p1, const T2 &p2, const T3 &p3, const T4 &p4, const T5 &p5, const T6 &p6, const T7 &p7, const T8 &p8, const T9 &p9, const T10 &p10, const T11 &p11, const T12 &p12, const T13 &p13, const T14 &p14, const T15 &p15, const T16 &p16, const T17 &p17, const T18 &p18, const T19 &p19, const T20 &p20, const T21 &p21, const T22 &p22, const T23 &p23, const T24 &p24) { \ - C1 = p1;\ - C1 = p1;\ - C2 = p2;\ - C1 = p1;\ - C2 = p2;\ - C3 = p3;\ - C1 = p1;\ - C2 = p2;\ - C3 = p3;\ - C4 = p4;\ - C1 = p1;\ - C2 = p2;\ - C3 = p3;\ - C4 = p4;\ - C5 = p5;\ - C1 = p1;\ - C2 = p2;\ - C3 = p3;\ - C4 = p4;\ - C5 = p5;\ - C6 = p6;\ - C1 = p1;\ - C2 = p2;\ - C3 = p3;\ - C4 = p4;\ - C5 = p5;\ - C6 = p6;\ - C7 = p7;\ - C1 = p1;\ - C2 = p2;\ - C3 = p3;\ - C4 = p4;\ - C5 = p5;\ - C6 = p6;\ - C7 = p7;\ - C8 = p8;\ - C1 = p1;\ - C2 = p2;\ - C3 = p3;\ - C4 = p4;\ - C5 = p5;\ - C6 = p6;\ - C7 = p7;\ - C8 = p8;\ - C9 = p9;\ - C1 = p1;\ - C2 = p2;\ - C3 = p3;\ - C4 = p4;\ - C5 = p5;\ - C6 = p6;\ - C7 = p7;\ - C8 = p8;\ - C9 = p9;\ - C10 = p10;\ - C1 = p1;\ - C2 = p2;\ - C3 = p3;\ - C4 = p4;\ - C5 = p5;\ - C6 = p6;\ - C7 = p7;\ - C8 = p8;\ - C9 = p9;\ - C10 = p10;\ - C11 = p11;\ - C1 = p1;\ - C2 = p2;\ - C3 = p3;\ - C4 = p4;\ - C5 = p5;\ - C6 = p6;\ - C7 = p7;\ - C8 = p8;\ - C9 = p9;\ - C10 = p10;\ - C11 = p11;\ - C12 = p12;\ - C1 = p1;\ - C2 = p2;\ - C3 = p3;\ - C4 = p4;\ - C5 = p5;\ - C6 = p6;\ - C7 = p7;\ - C8 = p8;\ - C9 = p9;\ - C10 = p10;\ - C11 = p11;\ - C12 = p12;\ - C13 = p13;\ - C1 = p1;\ - C2 = p2;\ - C3 = p3;\ - C4 = p4;\ - C5 = p5;\ - C6 = p6;\ - C7 = p7;\ - C8 = p8;\ - C9 = p9;\ - C10 = p10;\ - C11 = p11;\ - C12 = p12;\ - C13 = p13;\ - C14 = p14;\ - C1 = p1;\ - C2 = p2;\ - C3 = p3;\ - C4 = p4;\ - C5 = p5;\ - C6 = p6;\ - C7 = p7;\ - C8 = p8;\ - C9 = p9;\ - C10 = p10;\ - C11 = p11;\ - C12 = p12;\ - C13 = p13;\ - C14 = p14;\ - C15 = p15;\ - C1 = p1;\ - C2 = p2;\ - C3 = p3;\ - C4 = p4;\ - C5 = p5;\ - C6 = p6;\ - C7 = p7;\ - C8 = p8;\ - C9 = p9;\ - C10 = p10;\ - C11 = p11;\ - C12 = p12;\ - C13 = p13;\ - C14 = p14;\ - C15 = p15;\ - C16 = p16;\ - C1 = p1;\ - C2 = p2;\ - C3 = p3;\ - C4 = p4;\ - C5 = p5;\ - C6 = p6;\ - C7 = p7;\ - C8 = p8;\ - C9 = p9;\ - C10 = p10;\ - C11 = p11;\ - C12 = p12;\ - C13 = p13;\ - C14 = p14;\ - C15 = p15;\ - C16 = p16;\ - C17 = p17;\ - C1 = p1;\ - C2 = p2;\ - C3 = p3;\ - C4 = p4;\ - C5 = p5;\ - C6 = p6;\ - C7 = p7;\ - C8 = p8;\ - C9 = p9;\ - C10 = p10;\ - C11 = p11;\ - C12 = p12;\ - C13 = p13;\ - C14 = p14;\ - C15 = p15;\ - C16 = p16;\ - C17 = p17;\ - C18 = p18;\ - C1 = p1;\ - C2 = p2;\ - C3 = p3;\ - C4 = p4;\ - C5 = p5;\ - C6 = p6;\ - C7 = p7;\ - C8 = p8;\ - C9 = p9;\ - C10 = p10;\ - C11 = p11;\ - C12 = p12;\ - C13 = p13;\ - C14 = p14;\ - C15 = p15;\ - C16 = p16;\ - C17 = p17;\ - C18 = p18;\ - C19 = p19;\ - C1 = p1;\ - C2 = p2;\ - C3 = p3;\ - C4 = p4;\ - C5 = p5;\ - C6 = p6;\ - C7 = p7;\ - C8 = p8;\ - C9 = p9;\ - C10 = p10;\ - C11 = p11;\ - C12 = p12;\ - C13 = p13;\ - C14 = p14;\ - C15 = p15;\ - C16 = p16;\ - C17 = p17;\ - C18 = p18;\ - C19 = p19;\ - C20 = p20;\ - C1 = p1;\ - C2 = p2;\ - C3 = p3;\ - C4 = p4;\ - C5 = p5;\ - C6 = p6;\ - C7 = p7;\ - C8 = p8;\ - C9 = p9;\ - C10 = p10;\ - C11 = p11;\ - C12 = p12;\ - C13 = p13;\ - C14 = p14;\ - C15 = p15;\ - C16 = p16;\ - C17 = p17;\ - C18 = p18;\ - C19 = p19;\ - C20 = p20;\ - C21 = p21;\ - C1 = p1;\ - C2 = p2;\ - C3 = p3;\ - C4 = p4;\ - C5 = p5;\ - C6 = p6;\ - C7 = p7;\ - C8 = p8;\ - C9 = p9;\ - C10 = p10;\ - C11 = p11;\ - C12 = p12;\ - C13 = p13;\ - C14 = p14;\ - C15 = p15;\ - C16 = p16;\ - C17 = p17;\ - C18 = p18;\ - C19 = p19;\ - C20 = p20;\ - C21 = p21;\ - C22 = p22;\ - C1 = p1;\ - C2 = p2;\ - C3 = p3;\ - C4 = p4;\ - C5 = p5;\ - C6 = p6;\ - C7 = p7;\ - C8 = p8;\ - C9 = p9;\ - C10 = p10;\ - C11 = p11;\ - C12 = p12;\ - C13 = p13;\ - C14 = p14;\ - C15 = p15;\ - C16 = p16;\ - C17 = p17;\ - C18 = p18;\ - C19 = p19;\ - C20 = p20;\ - C21 = p21;\ - C22 = p22;\ - C23 = p23;\ - C1 = p1;\ - C2 = p2;\ - C3 = p3;\ - C4 = p4;\ - C5 = p5;\ - C6 = p6;\ - C7 = p7;\ - C8 = p8;\ - C9 = p9;\ - C10 = p10;\ - C11 = p11;\ - C12 = p12;\ - C13 = p13;\ - C14 = p14;\ - C15 = p15;\ - C16 = p16;\ - C17 = p17;\ - C18 = p18;\ - C19 = p19;\ - C20 = p20;\ - C21 = p21;\ - C22 = p22;\ - C23 = p23;\ - C24 = p24;\ - \ - } \ - NAME (const T1 &p1, const T2 &p2, const T3 &p3, const T4 &p4, const T5 &p5, const T6 &p6, const T7 &p7, const T8 &p8, const T9 &p9, const T10 &p10, const T11 &p11, const T12 &p12, const T13 &p13, const T14 &p14, const T15 &p15, const T16 &p16, const T17 &p17, const T18 &p18, const T19 &p19, const T20 &p20, const T21 &p21, const T22 &p22, const T23 &p23, const T24 &p24) : C1 (p1), C2 (p2), C3 (p3), C4 (p4), C5 (p5), C6 (p6), C7 (p7), C8 (p8), C9 (p9), C10 (p10), C11 (p11), C12 (p12), C13 (p13), C14 (p14), C15 (p15), C16 (p16), C17 (p17), C18 (p18), C19 (p19), C20 (p20), C21 (p21), C22 (p22), C23 (p23), C24 (p24) {} - -#define sql_compare_type_def_24(NAME, WHAT, NUM) \ - return WHAT##_list(d, m, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true) - -#define sql_compare_type_defe_24(NAME, WHAT, NUM) \ - return WHAT##_list(d, c, m, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true) - -#define sql_COMPARE__24(NAME, C1, C2, C3, C4, C5, C6, C7, C8, C9, C10, C11, C12, C13, C14, C15, C16, C17, C18, C19, C20, C21, C22, C23, C24, C25) \ - template \ - int sql_compare_##NAME (const NAME &x, const NAME &y) { \ - int cmp; \ - if (cmp = sql_cmp(x.C1 , y.C1 )) return cmp; \ - if (cmp = sql_cmp(x.C2 , y.C2 )) return cmp; \ - if (cmp = sql_cmp(x.C3 , y.C3 )) return cmp; \ - if (cmp = sql_cmp(x.C4 , y.C4 )) return cmp; \ - if (cmp = sql_cmp(x.C5 , y.C5 )) return cmp; \ - if (cmp = sql_cmp(x.C6 , y.C6 )) return cmp; \ - if (cmp = sql_cmp(x.C7 , y.C7 )) return cmp; \ - if (cmp = sql_cmp(x.C8 , y.C8 )) return cmp; \ - if (cmp = sql_cmp(x.C9 , y.C9 )) return cmp; \ - if (cmp = sql_cmp(x.C10 , y.C10 )) return cmp; \ - if (cmp = sql_cmp(x.C11 , y.C11 )) return cmp; \ - if (cmp = sql_cmp(x.C12 , y.C12 )) return cmp; \ - if (cmp = sql_cmp(x.C13 , y.C13 )) return cmp; \ - if (cmp = sql_cmp(x.C14 , y.C14 )) return cmp; \ - if (cmp = sql_cmp(x.C15 , y.C15 )) return cmp; \ - if (cmp = sql_cmp(x.C16 , y.C16 )) return cmp; \ - if (cmp = sql_cmp(x.C17 , y.C17 )) return cmp; \ - if (cmp = sql_cmp(x.C18 , y.C18 )) return cmp; \ - if (cmp = sql_cmp(x.C19 , y.C19 )) return cmp; \ - if (cmp = sql_cmp(x.C20 , y.C20 )) return cmp; \ - if (cmp = sql_cmp(x.C21 , y.C21 )) return cmp; \ - if (cmp = sql_cmp(x.C22 , y.C22 )) return cmp; \ - if (cmp = sql_cmp(x.C23 , y.C23 )) return cmp; \ - return sql_cmp(x.C24 , y.C24 ); \ - } \ - template \ - int compare (const NAME &x, const NAME &y) { \ - int cmp; \ - if (cmp = sql_cmp(x.C1 , y.C1 )) return cmp; \ - if (cmp = sql_cmp(x.C2 , y.C2 )) return cmp; \ - if (cmp = sql_cmp(x.C3 , y.C3 )) return cmp; \ - if (cmp = sql_cmp(x.C4 , y.C4 )) return cmp; \ - if (cmp = sql_cmp(x.C5 , y.C5 )) return cmp; \ - if (cmp = sql_cmp(x.C6 , y.C6 )) return cmp; \ - if (cmp = sql_cmp(x.C7 , y.C7 )) return cmp; \ - if (cmp = sql_cmp(x.C8 , y.C8 )) return cmp; \ - if (cmp = sql_cmp(x.C9 , y.C9 )) return cmp; \ - if (cmp = sql_cmp(x.C10 , y.C10 )) return cmp; \ - if (cmp = sql_cmp(x.C11 , y.C11 )) return cmp; \ - if (cmp = sql_cmp(x.C12 , y.C12 )) return cmp; \ - if (cmp = sql_cmp(x.C13 , y.C13 )) return cmp; \ - if (cmp = sql_cmp(x.C14 , y.C14 )) return cmp; \ - if (cmp = sql_cmp(x.C15 , y.C15 )) return cmp; \ - if (cmp = sql_cmp(x.C16 , y.C16 )) return cmp; \ - if (cmp = sql_cmp(x.C17 , y.C17 )) return cmp; \ - if (cmp = sql_cmp(x.C18 , y.C18 )) return cmp; \ - if (cmp = sql_cmp(x.C19 , y.C19 )) return cmp; \ - if (cmp = sql_cmp(x.C20 , y.C20 )) return cmp; \ - if (cmp = sql_cmp(x.C21 , y.C21 )) return cmp; \ - if (cmp = sql_cmp(x.C22 , y.C22 )) return cmp; \ - if (cmp = sql_cmp(x.C23 , y.C23 )) return cmp; \ - return sql_cmp(x.C24 , y.C24 ); \ - } - -// --------------------------------------------------- -// End Compare 24 -// --------------------------------------------------- - - -// --------------------------------------------------- -// Begin Compare 25 -// --------------------------------------------------- - -#define sql_compare_define_25(NAME, T1, C1, T2, C2, T3, C3, T4, C4, T5, C5, T6, C6, T7, C7, T8, C8, T9, C9, T10, C10, T11, C11, T12, C12, T13, C13, T14, C14, T15, C15, T16, C16, T17, C17, T18, C18, T19, C19, T20, C20, T21, C21, T22, C22, T23, C23, T24, C24, T25, C25) \ - NAME (const T1 &p1, const T2 &p2, const T3 &p3, const T4 &p4, const T5 &p5, const T6 &p6, const T7 &p7, const T8 &p8, const T9 &p9, const T10 &p10, const T11 &p11, const T12 &p12, const T13 &p13, const T14 &p14, const T15 &p15, const T16 &p16, const T17 &p17, const T18 &p18, const T19 &p19, const T20 &p20, const T21 &p21, const T22 &p22, const T23 &p23, const T24 &p24, const T25 &p25) : C1 (p1), C2 (p2), C3 (p3), C4 (p4), C5 (p5), C6 (p6), C7 (p7), C8 (p8), C9 (p9), C10 (p10), C11 (p11), C12 (p12), C13 (p13), C14 (p14), C15 (p15), C16 (p16), C17 (p17), C18 (p18), C19 (p19), C20 (p20), C21 (p21), C22 (p22), C23 (p23), C24 (p24), C25 (p25) {} \ - void set (const T1 &p1, const T2 &p2, const T3 &p3, const T4 &p4, const T5 &p5, const T6 &p6, const T7 &p7, const T8 &p8, const T9 &p9, const T10 &p10, const T11 &p11, const T12 &p12, const T13 &p13, const T14 &p14, const T15 &p15, const T16 &p16, const T17 &p17, const T18 &p18, const T19 &p19, const T20 &p20, const T21 &p21, const T22 &p22, const T23 &p23, const T24 &p24, const T25 &p25) { \ - C1 = p1;\ - C1 = p1;\ - C2 = p2;\ - C1 = p1;\ - C2 = p2;\ - C3 = p3;\ - C1 = p1;\ - C2 = p2;\ - C3 = p3;\ - C4 = p4;\ - C1 = p1;\ - C2 = p2;\ - C3 = p3;\ - C4 = p4;\ - C5 = p5;\ - C1 = p1;\ - C2 = p2;\ - C3 = p3;\ - C4 = p4;\ - C5 = p5;\ - C6 = p6;\ - C1 = p1;\ - C2 = p2;\ - C3 = p3;\ - C4 = p4;\ - C5 = p5;\ - C6 = p6;\ - C7 = p7;\ - C1 = p1;\ - C2 = p2;\ - C3 = p3;\ - C4 = p4;\ - C5 = p5;\ - C6 = p6;\ - C7 = p7;\ - C8 = p8;\ - C1 = p1;\ - C2 = p2;\ - C3 = p3;\ - C4 = p4;\ - C5 = p5;\ - C6 = p6;\ - C7 = p7;\ - C8 = p8;\ - C9 = p9;\ - C1 = p1;\ - C2 = p2;\ - C3 = p3;\ - C4 = p4;\ - C5 = p5;\ - C6 = p6;\ - C7 = p7;\ - C8 = p8;\ - C9 = p9;\ - C10 = p10;\ - C1 = p1;\ - C2 = p2;\ - C3 = p3;\ - C4 = p4;\ - C5 = p5;\ - C6 = p6;\ - C7 = p7;\ - C8 = p8;\ - C9 = p9;\ - C10 = p10;\ - C11 = p11;\ - C1 = p1;\ - C2 = p2;\ - C3 = p3;\ - C4 = p4;\ - C5 = p5;\ - C6 = p6;\ - C7 = p7;\ - C8 = p8;\ - C9 = p9;\ - C10 = p10;\ - C11 = p11;\ - C12 = p12;\ - C1 = p1;\ - C2 = p2;\ - C3 = p3;\ - C4 = p4;\ - C5 = p5;\ - C6 = p6;\ - C7 = p7;\ - C8 = p8;\ - C9 = p9;\ - C10 = p10;\ - C11 = p11;\ - C12 = p12;\ - C13 = p13;\ - C1 = p1;\ - C2 = p2;\ - C3 = p3;\ - C4 = p4;\ - C5 = p5;\ - C6 = p6;\ - C7 = p7;\ - C8 = p8;\ - C9 = p9;\ - C10 = p10;\ - C11 = p11;\ - C12 = p12;\ - C13 = p13;\ - C14 = p14;\ - C1 = p1;\ - C2 = p2;\ - C3 = p3;\ - C4 = p4;\ - C5 = p5;\ - C6 = p6;\ - C7 = p7;\ - C8 = p8;\ - C9 = p9;\ - C10 = p10;\ - C11 = p11;\ - C12 = p12;\ - C13 = p13;\ - C14 = p14;\ - C15 = p15;\ - C1 = p1;\ - C2 = p2;\ - C3 = p3;\ - C4 = p4;\ - C5 = p5;\ - C6 = p6;\ - C7 = p7;\ - C8 = p8;\ - C9 = p9;\ - C10 = p10;\ - C11 = p11;\ - C12 = p12;\ - C13 = p13;\ - C14 = p14;\ - C15 = p15;\ - C16 = p16;\ - C1 = p1;\ - C2 = p2;\ - C3 = p3;\ - C4 = p4;\ - C5 = p5;\ - C6 = p6;\ - C7 = p7;\ - C8 = p8;\ - C9 = p9;\ - C10 = p10;\ - C11 = p11;\ - C12 = p12;\ - C13 = p13;\ - C14 = p14;\ - C15 = p15;\ - C16 = p16;\ - C17 = p17;\ - C1 = p1;\ - C2 = p2;\ - C3 = p3;\ - C4 = p4;\ - C5 = p5;\ - C6 = p6;\ - C7 = p7;\ - C8 = p8;\ - C9 = p9;\ - C10 = p10;\ - C11 = p11;\ - C12 = p12;\ - C13 = p13;\ - C14 = p14;\ - C15 = p15;\ - C16 = p16;\ - C17 = p17;\ - C18 = p18;\ - C1 = p1;\ - C2 = p2;\ - C3 = p3;\ - C4 = p4;\ - C5 = p5;\ - C6 = p6;\ - C7 = p7;\ - C8 = p8;\ - C9 = p9;\ - C10 = p10;\ - C11 = p11;\ - C12 = p12;\ - C13 = p13;\ - C14 = p14;\ - C15 = p15;\ - C16 = p16;\ - C17 = p17;\ - C18 = p18;\ - C19 = p19;\ - C1 = p1;\ - C2 = p2;\ - C3 = p3;\ - C4 = p4;\ - C5 = p5;\ - C6 = p6;\ - C7 = p7;\ - C8 = p8;\ - C9 = p9;\ - C10 = p10;\ - C11 = p11;\ - C12 = p12;\ - C13 = p13;\ - C14 = p14;\ - C15 = p15;\ - C16 = p16;\ - C17 = p17;\ - C18 = p18;\ - C19 = p19;\ - C20 = p20;\ - C1 = p1;\ - C2 = p2;\ - C3 = p3;\ - C4 = p4;\ - C5 = p5;\ - C6 = p6;\ - C7 = p7;\ - C8 = p8;\ - C9 = p9;\ - C10 = p10;\ - C11 = p11;\ - C12 = p12;\ - C13 = p13;\ - C14 = p14;\ - C15 = p15;\ - C16 = p16;\ - C17 = p17;\ - C18 = p18;\ - C19 = p19;\ - C20 = p20;\ - C21 = p21;\ - C1 = p1;\ - C2 = p2;\ - C3 = p3;\ - C4 = p4;\ - C5 = p5;\ - C6 = p6;\ - C7 = p7;\ - C8 = p8;\ - C9 = p9;\ - C10 = p10;\ - C11 = p11;\ - C12 = p12;\ - C13 = p13;\ - C14 = p14;\ - C15 = p15;\ - C16 = p16;\ - C17 = p17;\ - C18 = p18;\ - C19 = p19;\ - C20 = p20;\ - C21 = p21;\ - C22 = p22;\ - C1 = p1;\ - C2 = p2;\ - C3 = p3;\ - C4 = p4;\ - C5 = p5;\ - C6 = p6;\ - C7 = p7;\ - C8 = p8;\ - C9 = p9;\ - C10 = p10;\ - C11 = p11;\ - C12 = p12;\ - C13 = p13;\ - C14 = p14;\ - C15 = p15;\ - C16 = p16;\ - C17 = p17;\ - C18 = p18;\ - C19 = p19;\ - C20 = p20;\ - C21 = p21;\ - C22 = p22;\ - C23 = p23;\ - C1 = p1;\ - C2 = p2;\ - C3 = p3;\ - C4 = p4;\ - C5 = p5;\ - C6 = p6;\ - C7 = p7;\ - C8 = p8;\ - C9 = p9;\ - C10 = p10;\ - C11 = p11;\ - C12 = p12;\ - C13 = p13;\ - C14 = p14;\ - C15 = p15;\ - C16 = p16;\ - C17 = p17;\ - C18 = p18;\ - C19 = p19;\ - C20 = p20;\ - C21 = p21;\ - C22 = p22;\ - C23 = p23;\ - C24 = p24;\ - C1 = p1;\ - C2 = p2;\ - C3 = p3;\ - C4 = p4;\ - C5 = p5;\ - C6 = p6;\ - C7 = p7;\ - C8 = p8;\ - C9 = p9;\ - C10 = p10;\ - C11 = p11;\ - C12 = p12;\ - C13 = p13;\ - C14 = p14;\ - C15 = p15;\ - C16 = p16;\ - C17 = p17;\ - C18 = p18;\ - C19 = p19;\ - C20 = p20;\ - C21 = p21;\ - C22 = p22;\ - C23 = p23;\ - C24 = p24;\ - C25 = p25;\ - \ - } \ - sql_compare_define(NAME) - -#define sql_construct_define_25(NAME, T1, C1, T2, C2, T3, C3, T4, C4, T5, C5, T6, C6, T7, C7, T8, C8, T9, C9, T10, C10, T11, C11, T12, C12, T13, C13, T14, C14, T15, C15, T16, C16, T17, C17, T18, C18, T19, C19, T20, C20, T21, C21, T22, C22, T23, C23, T24, C24, T25, C25) \ - void set (const T1 &p1, const T2 &p2, const T3 &p3, const T4 &p4, const T5 &p5, const T6 &p6, const T7 &p7, const T8 &p8, const T9 &p9, const T10 &p10, const T11 &p11, const T12 &p12, const T13 &p13, const T14 &p14, const T15 &p15, const T16 &p16, const T17 &p17, const T18 &p18, const T19 &p19, const T20 &p20, const T21 &p21, const T22 &p22, const T23 &p23, const T24 &p24, const T25 &p25) { \ - C1 = p1;\ - C1 = p1;\ - C2 = p2;\ - C1 = p1;\ - C2 = p2;\ - C3 = p3;\ - C1 = p1;\ - C2 = p2;\ - C3 = p3;\ - C4 = p4;\ - C1 = p1;\ - C2 = p2;\ - C3 = p3;\ - C4 = p4;\ - C5 = p5;\ - C1 = p1;\ - C2 = p2;\ - C3 = p3;\ - C4 = p4;\ - C5 = p5;\ - C6 = p6;\ - C1 = p1;\ - C2 = p2;\ - C3 = p3;\ - C4 = p4;\ - C5 = p5;\ - C6 = p6;\ - C7 = p7;\ - C1 = p1;\ - C2 = p2;\ - C3 = p3;\ - C4 = p4;\ - C5 = p5;\ - C6 = p6;\ - C7 = p7;\ - C8 = p8;\ - C1 = p1;\ - C2 = p2;\ - C3 = p3;\ - C4 = p4;\ - C5 = p5;\ - C6 = p6;\ - C7 = p7;\ - C8 = p8;\ - C9 = p9;\ - C1 = p1;\ - C2 = p2;\ - C3 = p3;\ - C4 = p4;\ - C5 = p5;\ - C6 = p6;\ - C7 = p7;\ - C8 = p8;\ - C9 = p9;\ - C10 = p10;\ - C1 = p1;\ - C2 = p2;\ - C3 = p3;\ - C4 = p4;\ - C5 = p5;\ - C6 = p6;\ - C7 = p7;\ - C8 = p8;\ - C9 = p9;\ - C10 = p10;\ - C11 = p11;\ - C1 = p1;\ - C2 = p2;\ - C3 = p3;\ - C4 = p4;\ - C5 = p5;\ - C6 = p6;\ - C7 = p7;\ - C8 = p8;\ - C9 = p9;\ - C10 = p10;\ - C11 = p11;\ - C12 = p12;\ - C1 = p1;\ - C2 = p2;\ - C3 = p3;\ - C4 = p4;\ - C5 = p5;\ - C6 = p6;\ - C7 = p7;\ - C8 = p8;\ - C9 = p9;\ - C10 = p10;\ - C11 = p11;\ - C12 = p12;\ - C13 = p13;\ - C1 = p1;\ - C2 = p2;\ - C3 = p3;\ - C4 = p4;\ - C5 = p5;\ - C6 = p6;\ - C7 = p7;\ - C8 = p8;\ - C9 = p9;\ - C10 = p10;\ - C11 = p11;\ - C12 = p12;\ - C13 = p13;\ - C14 = p14;\ - C1 = p1;\ - C2 = p2;\ - C3 = p3;\ - C4 = p4;\ - C5 = p5;\ - C6 = p6;\ - C7 = p7;\ - C8 = p8;\ - C9 = p9;\ - C10 = p10;\ - C11 = p11;\ - C12 = p12;\ - C13 = p13;\ - C14 = p14;\ - C15 = p15;\ - C1 = p1;\ - C2 = p2;\ - C3 = p3;\ - C4 = p4;\ - C5 = p5;\ - C6 = p6;\ - C7 = p7;\ - C8 = p8;\ - C9 = p9;\ - C10 = p10;\ - C11 = p11;\ - C12 = p12;\ - C13 = p13;\ - C14 = p14;\ - C15 = p15;\ - C16 = p16;\ - C1 = p1;\ - C2 = p2;\ - C3 = p3;\ - C4 = p4;\ - C5 = p5;\ - C6 = p6;\ - C7 = p7;\ - C8 = p8;\ - C9 = p9;\ - C10 = p10;\ - C11 = p11;\ - C12 = p12;\ - C13 = p13;\ - C14 = p14;\ - C15 = p15;\ - C16 = p16;\ - C17 = p17;\ - C1 = p1;\ - C2 = p2;\ - C3 = p3;\ - C4 = p4;\ - C5 = p5;\ - C6 = p6;\ - C7 = p7;\ - C8 = p8;\ - C9 = p9;\ - C10 = p10;\ - C11 = p11;\ - C12 = p12;\ - C13 = p13;\ - C14 = p14;\ - C15 = p15;\ - C16 = p16;\ - C17 = p17;\ - C18 = p18;\ - C1 = p1;\ - C2 = p2;\ - C3 = p3;\ - C4 = p4;\ - C5 = p5;\ - C6 = p6;\ - C7 = p7;\ - C8 = p8;\ - C9 = p9;\ - C10 = p10;\ - C11 = p11;\ - C12 = p12;\ - C13 = p13;\ - C14 = p14;\ - C15 = p15;\ - C16 = p16;\ - C17 = p17;\ - C18 = p18;\ - C19 = p19;\ - C1 = p1;\ - C2 = p2;\ - C3 = p3;\ - C4 = p4;\ - C5 = p5;\ - C6 = p6;\ - C7 = p7;\ - C8 = p8;\ - C9 = p9;\ - C10 = p10;\ - C11 = p11;\ - C12 = p12;\ - C13 = p13;\ - C14 = p14;\ - C15 = p15;\ - C16 = p16;\ - C17 = p17;\ - C18 = p18;\ - C19 = p19;\ - C20 = p20;\ - C1 = p1;\ - C2 = p2;\ - C3 = p3;\ - C4 = p4;\ - C5 = p5;\ - C6 = p6;\ - C7 = p7;\ - C8 = p8;\ - C9 = p9;\ - C10 = p10;\ - C11 = p11;\ - C12 = p12;\ - C13 = p13;\ - C14 = p14;\ - C15 = p15;\ - C16 = p16;\ - C17 = p17;\ - C18 = p18;\ - C19 = p19;\ - C20 = p20;\ - C21 = p21;\ - C1 = p1;\ - C2 = p2;\ - C3 = p3;\ - C4 = p4;\ - C5 = p5;\ - C6 = p6;\ - C7 = p7;\ - C8 = p8;\ - C9 = p9;\ - C10 = p10;\ - C11 = p11;\ - C12 = p12;\ - C13 = p13;\ - C14 = p14;\ - C15 = p15;\ - C16 = p16;\ - C17 = p17;\ - C18 = p18;\ - C19 = p19;\ - C20 = p20;\ - C21 = p21;\ - C22 = p22;\ - C1 = p1;\ - C2 = p2;\ - C3 = p3;\ - C4 = p4;\ - C5 = p5;\ - C6 = p6;\ - C7 = p7;\ - C8 = p8;\ - C9 = p9;\ - C10 = p10;\ - C11 = p11;\ - C12 = p12;\ - C13 = p13;\ - C14 = p14;\ - C15 = p15;\ - C16 = p16;\ - C17 = p17;\ - C18 = p18;\ - C19 = p19;\ - C20 = p20;\ - C21 = p21;\ - C22 = p22;\ - C23 = p23;\ - C1 = p1;\ - C2 = p2;\ - C3 = p3;\ - C4 = p4;\ - C5 = p5;\ - C6 = p6;\ - C7 = p7;\ - C8 = p8;\ - C9 = p9;\ - C10 = p10;\ - C11 = p11;\ - C12 = p12;\ - C13 = p13;\ - C14 = p14;\ - C15 = p15;\ - C16 = p16;\ - C17 = p17;\ - C18 = p18;\ - C19 = p19;\ - C20 = p20;\ - C21 = p21;\ - C22 = p22;\ - C23 = p23;\ - C24 = p24;\ - C1 = p1;\ - C2 = p2;\ - C3 = p3;\ - C4 = p4;\ - C5 = p5;\ - C6 = p6;\ - C7 = p7;\ - C8 = p8;\ - C9 = p9;\ - C10 = p10;\ - C11 = p11;\ - C12 = p12;\ - C13 = p13;\ - C14 = p14;\ - C15 = p15;\ - C16 = p16;\ - C17 = p17;\ - C18 = p18;\ - C19 = p19;\ - C20 = p20;\ - C21 = p21;\ - C22 = p22;\ - C23 = p23;\ - C24 = p24;\ - C25 = p25;\ - \ - } \ - NAME (const T1 &p1, const T2 &p2, const T3 &p3, const T4 &p4, const T5 &p5, const T6 &p6, const T7 &p7, const T8 &p8, const T9 &p9, const T10 &p10, const T11 &p11, const T12 &p12, const T13 &p13, const T14 &p14, const T15 &p15, const T16 &p16, const T17 &p17, const T18 &p18, const T19 &p19, const T20 &p20, const T21 &p21, const T22 &p22, const T23 &p23, const T24 &p24, const T25 &p25) : C1 (p1), C2 (p2), C3 (p3), C4 (p4), C5 (p5), C6 (p6), C7 (p7), C8 (p8), C9 (p9), C10 (p10), C11 (p11), C12 (p12), C13 (p13), C14 (p14), C15 (p15), C16 (p16), C17 (p17), C18 (p18), C19 (p19), C20 (p20), C21 (p21), C22 (p22), C23 (p23), C24 (p24), C25 (p25) {} - -#define sql_compare_type_def_25(NAME, WHAT, NUM) \ - return WHAT##_list(d, m, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true) - -#define sql_compare_type_defe_25(NAME, WHAT, NUM) \ - return WHAT##_list(d, c, m, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true) - -#define sql_COMPARE__25(NAME, C1, C2, C3, C4, C5, C6, C7, C8, C9, C10, C11, C12, C13, C14, C15, C16, C17, C18, C19, C20, C21, C22, C23, C24, C25) \ - template \ - int sql_compare_##NAME (const NAME &x, const NAME &y) { \ - int cmp; \ - if (cmp = sql_cmp(x.C1 , y.C1 )) return cmp; \ - if (cmp = sql_cmp(x.C2 , y.C2 )) return cmp; \ - if (cmp = sql_cmp(x.C3 , y.C3 )) return cmp; \ - if (cmp = sql_cmp(x.C4 , y.C4 )) return cmp; \ - if (cmp = sql_cmp(x.C5 , y.C5 )) return cmp; \ - if (cmp = sql_cmp(x.C6 , y.C6 )) return cmp; \ - if (cmp = sql_cmp(x.C7 , y.C7 )) return cmp; \ - if (cmp = sql_cmp(x.C8 , y.C8 )) return cmp; \ - if (cmp = sql_cmp(x.C9 , y.C9 )) return cmp; \ - if (cmp = sql_cmp(x.C10 , y.C10 )) return cmp; \ - if (cmp = sql_cmp(x.C11 , y.C11 )) return cmp; \ - if (cmp = sql_cmp(x.C12 , y.C12 )) return cmp; \ - if (cmp = sql_cmp(x.C13 , y.C13 )) return cmp; \ - if (cmp = sql_cmp(x.C14 , y.C14 )) return cmp; \ - if (cmp = sql_cmp(x.C15 , y.C15 )) return cmp; \ - if (cmp = sql_cmp(x.C16 , y.C16 )) return cmp; \ - if (cmp = sql_cmp(x.C17 , y.C17 )) return cmp; \ - if (cmp = sql_cmp(x.C18 , y.C18 )) return cmp; \ - if (cmp = sql_cmp(x.C19 , y.C19 )) return cmp; \ - if (cmp = sql_cmp(x.C20 , y.C20 )) return cmp; \ - if (cmp = sql_cmp(x.C21 , y.C21 )) return cmp; \ - if (cmp = sql_cmp(x.C22 , y.C22 )) return cmp; \ - if (cmp = sql_cmp(x.C23 , y.C23 )) return cmp; \ - if (cmp = sql_cmp(x.C24 , y.C24 )) return cmp; \ - return sql_cmp(x.C25 , y.C25 ); \ - } \ - template \ - int compare (const NAME &x, const NAME &y) { \ - int cmp; \ - if (cmp = sql_cmp(x.C1 , y.C1 )) return cmp; \ - if (cmp = sql_cmp(x.C2 , y.C2 )) return cmp; \ - if (cmp = sql_cmp(x.C3 , y.C3 )) return cmp; \ - if (cmp = sql_cmp(x.C4 , y.C4 )) return cmp; \ - if (cmp = sql_cmp(x.C5 , y.C5 )) return cmp; \ - if (cmp = sql_cmp(x.C6 , y.C6 )) return cmp; \ - if (cmp = sql_cmp(x.C7 , y.C7 )) return cmp; \ - if (cmp = sql_cmp(x.C8 , y.C8 )) return cmp; \ - if (cmp = sql_cmp(x.C9 , y.C9 )) return cmp; \ - if (cmp = sql_cmp(x.C10 , y.C10 )) return cmp; \ - if (cmp = sql_cmp(x.C11 , y.C11 )) return cmp; \ - if (cmp = sql_cmp(x.C12 , y.C12 )) return cmp; \ - if (cmp = sql_cmp(x.C13 , y.C13 )) return cmp; \ - if (cmp = sql_cmp(x.C14 , y.C14 )) return cmp; \ - if (cmp = sql_cmp(x.C15 , y.C15 )) return cmp; \ - if (cmp = sql_cmp(x.C16 , y.C16 )) return cmp; \ - if (cmp = sql_cmp(x.C17 , y.C17 )) return cmp; \ - if (cmp = sql_cmp(x.C18 , y.C18 )) return cmp; \ - if (cmp = sql_cmp(x.C19 , y.C19 )) return cmp; \ - if (cmp = sql_cmp(x.C20 , y.C20 )) return cmp; \ - if (cmp = sql_cmp(x.C21 , y.C21 )) return cmp; \ - if (cmp = sql_cmp(x.C22 , y.C22 )) return cmp; \ - if (cmp = sql_cmp(x.C23 , y.C23 )) return cmp; \ - if (cmp = sql_cmp(x.C24 , y.C24 )) return cmp; \ - return sql_cmp(x.C25 , y.C25 ); \ - } - -// --------------------------------------------------- -// End Compare 25 -// --------------------------------------------------- - -// --------------------------------------------------- -// Begin Create 1 -// --------------------------------------------------- -#define sql_create_basic_c_order_1(NAME, CMP, CONTR, T1, I1, O1)\ - struct NAME; \ - template int sql_compare_##NAME (const NAME &, const NAME &);\ - struct NAME { \ - T1 I1; \ - NAME () {} \ - NAME (const Row &row);\ - sql_compare_define_##CMP(NAME, T1, I1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0)\ - }; \ - template \ - void populate_##NAME (NAME *s, const Row &row) { \ - s->I1 = static_cast(row.at(O1)); \ - } \ - inline NAME::NAME (const Row &row) \ - {populate_##NAME(this, row);} \ - sql_COMPARE__##CMP(NAME, I1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ) - -#define sql_create_complete_1(NAME, CMP, CONTR, T1, I1, N1, O1) \ - struct NAME; \ - enum NAME##_enum { \ - NAME##_##I1 \ - ,NAME##_NULL \ - }; \ - template \ - class NAME##_value_list { \ - /*friend std::ostream& operator << <> (std::ostream&, const NAME##_value_list&); */\ - public: \ - const NAME *obj;\ - cchar *delem;\ - Manip manip;\ - public: \ - NAME##_value_list (const NAME *o, cchar *d, Manip m) \ - : obj(o), delem(d), manip(m) {} \ - };\ - template \ - class NAME##_##field_list {\ - /* friend std::ostream& operator << <> (std::ostream&, const NAME##_field_list&); */\ - public: \ - const NAME *obj; \ - cchar *delem;\ - Manip manip;\ - public: \ - NAME##_field_list (const NAME *o, cchar *d, Manip m) \ - : obj(o), delem(d), manip(m) {} \ - };\ - template \ - class NAME##_equal_list { \ - /* friend std::ostream& operator << <> (std::ostream&, const NAME##_equal_list&); */\ - public: \ - const NAME *obj;\ - cchar *delem;\ - cchar *comp;\ - Manip manip;\ - public: \ - NAME##_equal_list (const NAME *o, cchar *d, cchar *c, Manip m) \ - : obj(o), delem(d), comp(c), manip(m) {}\ - };\ - template \ - class NAME##_cus_value_list {\ - /* friend std::ostream& operator << <> (std::ostream&, \ - const NAME##_cus_value_list&); */\ - public:\ - const NAME *obj;\ - std::vector *include;\ - bool del_vector;\ - cchar *delem;\ - Manip manip;\ - public: \ - ~NAME##_cus_value_list () {if (del_vector) delete include;} \ - NAME##_cus_value_list (const NAME *o, cchar *d, Manip m, bool i1);\ - NAME##_cus_value_list (const NAME *o, cchar *d, Manip m, NAME##_enum i1); \ - NAME##_cus_value_list (const NAME *o, cchar *d, Manip m ,std::vector* i)\ - : obj(o), include(i), del_vector(false), delem(d), manip(m) {}\ - };\ - template \ - class NAME##_cus_field_list { \ - /* friend std::ostream& operator << <> (std::ostream&, \ - const NAME##_cus_field_list&); */\ - public:\ - const NAME *obj; \ - std::vector *include; \ - bool del_vector; \ - cchar *delem;\ - Manip manip;\ - public: \ - ~NAME##_cus_field_list () {if (del_vector) delete include;} \ - NAME##_cus_field_list (const NAME *o, cchar *d, Manip m, bool i1); \ - NAME##_cus_field_list (const NAME *o, cchar *d, Manip m, NAME##_enum i1); \ - NAME##_cus_field_list (const NAME *o, cchar *d, Manip m, std::vector *i) \ - : obj(o), include(i), del_vector(false), delem(d), manip(m) {}\ - };\ - template \ - class NAME##_cus_equal_list {\ - /* friend std::ostream& operator << <> (std::ostream&, \ - const NAME##_cus_equal_list&); */\ - public:\ - const NAME *obj;\ - std::vector *include;\ - bool del_vector;\ - cchar *delem;\ - cchar *comp;\ - Manip manip;\ - public:\ - ~NAME##_##cus_equal_list () {if (del_vector) delete include;}\ - NAME##_##cus_equal_list (const NAME *o, cchar *d, cchar *c, Manip m, bool i1); \ - NAME##_##cus_equal_list (const NAME *o, cchar *d, cchar *c, Manip m, NAME##_enum i1); \ - NAME##_##cus_equal_list (const NAME *o, cchar *d, cchar *c, Manip m, std::vector *i) \ - : obj(o), include(i), del_vector(false), delem(d), comp(c), manip(m) {}\ - };\ - template int sql_compare_##NAME (const NAME &, const NAME &);\ - struct NAME { \ - T1 I1; \ - NAME () {} \ - NAME (const Row &row);\ - void set (const Row &row);\ - sql_compare_define_##CMP(NAME, T1, I1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0)\ - sql_construct_define_##CONTR(NAME, T1, I1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0)\ - static const char *names[];\ - static const char *_table;\ - static const char *& table() {return _table;}\ - NAME##_value_list value_list() const {\ - return value_list(",", quote);}\ - NAME##_value_list value_list(cchar *d) const {\ - return value_list(d, quote);}\ - template \ - NAME##_value_list value_list(cchar *d, Manip m) const; \ - NAME##_field_list field_list() const {\ - return field_list(",", do_nothing);}\ - NAME##_field_list field_list(cchar *d) const {\ - return field_list(d, do_nothing);}\ - template \ - NAME##_field_list field_list(cchar *d, Manip m) const; \ - NAME##_equal_list equal_list(cchar *d = ",", \ - cchar *c = " = ") const{\ - return equal_list(d, c, quote);}\ - template \ - NAME##_equal_list equal_list(cchar *d, cchar *c, Manip m) const; \ - /* cus_data */\ - NAME##_cus_value_list value_list(bool i1) const {\ - return value_list(",", quote, i1);\ - }\ - NAME##_cus_value_list value_list(NAME##_enum i1) const {\ - return value_list(",", quote, i1);\ - }\ - NAME##_cus_value_list value_list(std::vector *i) const {\ - return value_list(",", quote, i);\ - }\ - NAME##_cus_value_list value_list(sql_cmp_type sc) const {\ - return value_list(",", quote, sc);\ - }\ - NAME##_cus_value_list value_list(cchar *d, bool i1) const {\ - return value_list(d, quote, i1);\ - }\ - NAME##_cus_value_list value_list(cchar *d, NAME##_enum i1) const {\ - return value_list(d, quote, i1);\ - }\ - NAME##_cus_value_list value_list(cchar *d, \ - std::vector *i) const {\ - return value_list(d, quote, i);\ - }\ - NAME##_cus_value_list value_list(cchar *d, \ - sql_cmp_type sc) const {\ - return value_list(d, quote, sc);\ - }\ - template \ - NAME##_cus_value_list value_list(cchar *d, Manip m,\ - bool i1) const; \ - template \ - NAME##_cus_value_list value_list(cchar *d, Manip m,\ - NAME##_enum i1) const; \ - template \ - NAME##_cus_value_list value_list(cchar *d, Manip m, \ - std::vector *i) const;\ - template \ - NAME##_cus_value_list value_list(cchar *d, Manip m, \ - sql_cmp_type sc) const;\ - /* cus field */\ - NAME##_cus_field_list field_list(bool i1) const {\ - return field_list(",", do_nothing, i1);\ - }\ - NAME##_cus_field_list field_list(NAME##_enum i1) const {\ - return field_list(",", do_nothing, i1);\ - }\ - NAME##_cus_field_list field_list(std::vector *i) const {\ - return field_list(",", do_nothing, i);\ - }\ - NAME##_cus_field_list field_list(sql_cmp_type sc) const\ - {\ - return field_list(",", do_nothing, sc);\ - }\ - NAME##_cus_field_list field_list(cchar *d, \ - bool i1) const {\ - return field_list(d, do_nothing, i1);\ - }\ - NAME##_cus_field_list field_list(cchar *d,\ - NAME##_enum i1) const {\ - return field_list(d, do_nothing, i1);\ - }\ - NAME##_cus_field_list field_list(cchar *d, \ - std::vector *i) const {\ - return field_list(d, do_nothing, i);\ - }\ - NAME##_cus_field_list field_list(cchar *d, \ - sql_cmp_type sc) const {\ - return field_list(d, do_nothing, sc);\ - }\ - template \ - NAME##_cus_field_list field_list(cchar *d, Manip m,\ - bool i1) const; \ - template \ - NAME##_cus_field_list field_list(cchar *d, Manip m,\ - NAME##_enum i1) const; \ - template \ - NAME##_cus_field_list field_list(cchar *d, Manip m,\ - std::vector *i) const;\ - template \ - NAME##_cus_field_list field_list(cchar *d, Manip m, \ - sql_cmp_type sc) const;\ - /* cus equal */\ - NAME##_cus_equal_list equal_list(bool i1) const {\ - return equal_list(",", " = ", quote, i1);\ - }\ - NAME##_cus_equal_list equal_list(NAME##_enum i1) const {\ - return equal_list(",", " = ", quote, i1);\ - }\ - NAME##_cus_equal_list equal_list(std::vector *i) const {\ - return equal_list(",", " = ", quote, i);\ - }\ - NAME##_cus_equal_list equal_list(sql_cmp_type sc) const {\ - return equal_list(",", " = ", quote, sc);\ - }\ - NAME##_cus_equal_list equal_list(cchar *d, bool i1) const {\ - return equal_list(d, " = ", quote, i1);\ - }\ - NAME##_cus_equal_list equal_list(cchar *d, NAME##_enum i1) const {\ - return equal_list(d, " = ", quote, i1);\ - }\ - NAME##_cus_equal_list equal_list(cchar *d, \ - std::vector *i) const {\ - return equal_list(d, " = ", quote, i);\ - }\ - NAME##_cus_equal_list equal_list(cchar *d, \ - sql_cmp_type sc) const {\ - return equal_list(d, " = ", quote, sc);\ - }\ - NAME##_cus_equal_list equal_list(cchar *d, cchar *c,\ - bool i1) const {\ - return equal_list(d, c, quote, i1);\ - }\ - NAME##_cus_equal_list equal_list(cchar *d, cchar *c,\ - NAME##_enum i1) const {\ - return equal_list(d, c, quote, i1);\ - }\ - NAME##_cus_equal_list equal_list(cchar *d, cchar *c,\ - std::vector *i) const {\ - return equal_list(d, c, quote, i);\ - }\ - NAME##_cus_equal_list equal_list(cchar *d, cchar *c,\ - sql_cmp_type sc) const {\ - return equal_list(d, c, quote, sc);\ - }\ - template \ - NAME##_cus_equal_list equal_list(cchar *d, cchar *c, Manip m, \ - bool i1) const; \ - template \ - NAME##_cus_equal_list equal_list(cchar *d, cchar *c, Manip m, \ - NAME##_enum i1) const; \ - template \ - NAME##_cus_equal_list equal_list(cchar *d, cchar *c, Manip m, \ - std::vector *i) const;\ - template \ - NAME##_cus_equal_list equal_list(cchar *d, cchar *c, Manip m, \ - sql_cmp_type sc) const;\ - }; \ - const char *NAME::names[] = { \ - N1 \ - }; \ - const char *NAME::_table = #NAME ; \ - template \ - NAME##_cus_value_list::NAME##_cus_value_list\ - (const NAME *o, cchar *d, Manip m, bool i1) \ - { \ - delem = d;\ - manip = m;\ - del_vector = true;\ - obj = o; \ - include = new std::vector(1, false);\ - if (i1) (*include)[0]=true;\ - } \ - template \ - NAME##_cus_value_list::NAME##_cus_value_list\ - (const NAME *o, cchar *d, Manip m, NAME##_enum i1) { \ - delem = d;\ - manip = m;\ - del_vector = true; \ - obj = o; \ - include = new std::vector(1, false); \ - (*include)[i1]=true;\ - }\ - template \ - NAME##_cus_field_list::NAME##_cus_field_list\ - (const NAME *o, cchar *d, Manip m, bool i1) {\ - delem = d;\ - manip = m;\ - del_vector = true; \ - obj = o; \ - include = new std::vector(1, false); \ - if (i1) (*include)[0]=true;\ - } \ - template \ - NAME##_cus_field_list::NAME##_cus_field_list\ - (const NAME *o, cchar *d, Manip m, NAME##_enum i1) { \ - delem = d;\ - manip = m;\ - del_vector = true; \ - obj = o; \ - include = new std::vector(1, false); \ - (*include)[i1]=true;\ - }\ - template \ - NAME##_cus_equal_list::NAME##_cus_equal_list\ - (const NAME *o, cchar *d, cchar *c, Manip m, bool i1) { \ - delem = d;\ - comp = c;\ - manip = m;\ - del_vector = true; \ - obj = o; \ - include = new std::vector(1, false); \ - if (i1) (*include)[0]=true;\ - } \ - template \ - NAME##_cus_equal_list::NAME##_cus_equal_list\ - (const NAME *o, cchar *d, cchar *c, Manip m, NAME##_enum i1) { \ - delem = d;\ - comp = c;\ - manip = m;\ - del_vector = true; \ - obj = o; \ - include = new std::vector(1, false); \ - (*include)[i1]=true;\ - }\ - template \ - std::ostream& operator << (std::ostream& s, const NAME##_value_list& obj) { \ - s << obj.manip << obj.obj->I1; \ - return s; \ - } \ - template \ - std::ostream& operator << (std::ostream& s, const NAME##_field_list& obj) { \ - s << obj.manip << obj.obj->names[0]; \ - return s; \ - } \ - template \ - std::ostream& operator << (std::ostream& s, const NAME##_equal_list& obj) { \ - s << obj.obj->names[0] << obj.comp << obj.manip << obj.obj->I1; \ - return s; \ - } \ - template \ - std::ostream& operator << (std::ostream& s, const NAME##_cus_value_list& obj) { \ - bool before = false; \ - if ((*obj.include)[0]) { \ - s << obj.manip << obj.obj->I1;\ - } \ - return s; \ - } \ - template \ - std::ostream& operator << (std::ostream& s, const NAME##_cus_field_list& obj) { \ - bool before = false; \ - if ((*obj.include)[0]) { \ - s << obj.manip << obj.obj->names[0];\ - } \ - return s; \ - } \ - template \ - std::ostream& operator << (std::ostream& s, const NAME##_cus_equal_list& obj) { \ - bool before = false; \ - if ((*obj.include)[0]) { \ - s << obj.obj->names[0] << obj.comp << obj.manip << obj.obj->I1;\ - } \ - return s; \ - } \ - template \ - inline NAME##_value_list NAME::value_list(cchar *d, Manip m) const { \ - return NAME##_value_list (this, d, m); \ - } \ - template \ - inline NAME##_field_list NAME::field_list(cchar *d, Manip m) const { \ - return NAME##_field_list (this, d, m); \ - } \ - template \ - inline NAME##_equal_list NAME::equal_list(cchar *d, cchar *c, Manip m) const { \ - return NAME##_equal_list (this, d, c, m); \ - } \ - template \ - inline NAME##_cus_value_list NAME::value_list(cchar *d, Manip m,\ - bool i1) const {\ - return NAME##_cus_value_list (this, d, m, i1); \ - } \ - template \ - inline NAME##_cus_field_list NAME::field_list(cchar *d, Manip m,\ - bool i1) const { \ - return NAME##_cus_field_list (this, d, m, i1); \ - } \ - template \ - inline NAME##_cus_equal_list NAME::equal_list(cchar *d, cchar *c, Manip m,\ - bool i1) const { \ - return NAME##_cus_equal_list (this, d, c, m, i1); \ - } \ - template \ - inline NAME##_cus_value_list NAME::value_list(cchar *d, Manip m,\ - NAME##_enum i1) const { \ - return NAME##_cus_value_list (this, d, m, i1); \ - } \ - template \ - inline NAME##_cus_field_list NAME::field_list(cchar *d, Manip m,\ - NAME##_enum i1) const {\ - return NAME##_cus_field_list (this, d, m, i1); \ - } \ - template \ - inline NAME##_cus_equal_list NAME::equal_list(cchar *d, cchar *c, Manip m, \ - NAME##_enum i1) const { \ - return NAME##_cus_equal_list (this, d, c, m, i1); \ - } \ - template \ - inline NAME##_cus_value_list NAME::value_list(cchar *d, Manip m,\ - std::vector *i) const {\ - return NAME##_cus_value_list (this, d, m, i);\ - }\ - template \ - inline NAME##_cus_field_list NAME::field_list(cchar *d, Manip m,\ - std::vector *i) const {\ - return NAME##_cus_field_list (this, d, m, i);\ - }\ - template \ - inline NAME##_cus_equal_list NAME::equal_list(cchar *d, cchar *c, Manip m,\ - std::vector *i) const {\ - return NAME##_cus_equal_list (this, d, c, m, i);\ - }\ - template \ - inline NAME##_cus_value_list \ - NAME::value_list(cchar *d, Manip m, sql_cmp_type /*sc*/) const {\ - sql_compare_type_def_##CMP (NAME, value, NUM);\ - }\ - template \ - inline NAME##_cus_field_list \ - NAME::field_list(cchar *d, Manip m, sql_cmp_type /*sc*/) const {\ - sql_compare_type_def_##CMP (NAME, field, NUM);\ - }\ - template \ - inline NAME##_cus_equal_list \ - NAME::equal_list(cchar *d, cchar *c, Manip m, sql_cmp_type /*sc*/) const {\ - sql_compare_type_defe_##CMP (NAME, equal, NUM);\ - }\ - template \ - void populate_##NAME (NAME *s, const Row &row) { \ - s->I1 = static_cast(row.at(O1));\ - } \ - inline NAME::NAME (const Row &row) \ - {populate_##NAME(this, row);}\ - inline void NAME::set (const Row &row)\ - {populate_##NAME(this, row);}\ - sql_COMPARE__##CMP(NAME, I1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ) - -#define sql_create_basic_1(NAME, CMP, CONTR, T1, I1) \ - sql_create_basic_c_order_1(NAME, CMP, CONTR, T1, I1, 0) - -#define sql_create_1(NAME, CMP, CONTR, T1, I1) \ - sql_create_complete_1(NAME, CMP, CONTR, T1, I1, #I1, 0) \ - -#define sql_create_c_order_1(NAME, CMP, CONTR, T1, I1, O1) \ - sql_create_complete_1(NAME, CMP, CONTR, T1, I1, #I1, O1) - -#define sql_create_c_names_1(NAME, CMP, CONTR, T1, I1, N1) \ - sql_create_complete_1(NAME, CMP, CONTR, T1, I1, N1, 0) - -// --------------------------------------------------- -// End Create 1 -// --------------------------------------------------- - -// --------------------------------------------------- -// Begin Create 2 -// --------------------------------------------------- -#define sql_create_basic_c_order_2(NAME, CMP, CONTR, T1, I1, O1, T2, I2, O2)\ - struct NAME; \ - template int sql_compare_##NAME (const NAME &, const NAME &);\ - struct NAME { \ - T1 I1;\ - T2 I2; \ - NAME () {} \ - NAME (const Row &row);\ - sql_compare_define_##CMP(NAME, T1, I1, T2, I2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0)\ - }; \ - template \ - void populate_##NAME (NAME *s, const Row &row) { \ - s->I1 = static_cast(row.at(O1));\ - s->I2 = static_cast(row.at(O2)); \ - } \ - inline NAME::NAME (const Row &row) \ - {populate_##NAME(this, row);} \ - sql_COMPARE__##CMP(NAME, I1, I2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ) - -#define sql_create_complete_2(NAME, CMP, CONTR, T1, I1, N1, O1, T2, I2, N2, O2) \ - struct NAME; \ - enum NAME##_enum { \ - NAME##_##I1,\ - NAME##_##I2 \ - ,NAME##_NULL \ - }; \ - template \ - class NAME##_value_list { \ - /*friend std::ostream& operator << <> (std::ostream&, const NAME##_value_list&); */\ - public: \ - const NAME *obj;\ - cchar *delem;\ - Manip manip;\ - public: \ - NAME##_value_list (const NAME *o, cchar *d, Manip m) \ - : obj(o), delem(d), manip(m) {} \ - };\ - template \ - class NAME##_##field_list {\ - /* friend std::ostream& operator << <> (std::ostream&, const NAME##_field_list&); */\ - public: \ - const NAME *obj; \ - cchar *delem;\ - Manip manip;\ - public: \ - NAME##_field_list (const NAME *o, cchar *d, Manip m) \ - : obj(o), delem(d), manip(m) {} \ - };\ - template \ - class NAME##_equal_list { \ - /* friend std::ostream& operator << <> (std::ostream&, const NAME##_equal_list&); */\ - public: \ - const NAME *obj;\ - cchar *delem;\ - cchar *comp;\ - Manip manip;\ - public: \ - NAME##_equal_list (const NAME *o, cchar *d, cchar *c, Manip m) \ - : obj(o), delem(d), comp(c), manip(m) {}\ - };\ - template \ - class NAME##_cus_value_list {\ - /* friend std::ostream& operator << <> (std::ostream&, \ - const NAME##_cus_value_list&); */\ - public:\ - const NAME *obj;\ - std::vector *include;\ - bool del_vector;\ - cchar *delem;\ - Manip manip;\ - public: \ - ~NAME##_cus_value_list () {if (del_vector) delete include;} \ - NAME##_cus_value_list (const NAME *o, cchar *d, Manip m, bool i1, bool i2);\ - NAME##_cus_value_list (const NAME *o, cchar *d, Manip m, NAME##_enum i1, NAME##_enum i2); \ - NAME##_cus_value_list (const NAME *o, cchar *d, Manip m ,std::vector* i)\ - : obj(o), include(i), del_vector(false), delem(d), manip(m) {}\ - };\ - template \ - class NAME##_cus_field_list { \ - /* friend std::ostream& operator << <> (std::ostream&, \ - const NAME##_cus_field_list&); */\ - public:\ - const NAME *obj; \ - std::vector *include; \ - bool del_vector; \ - cchar *delem;\ - Manip manip;\ - public: \ - ~NAME##_cus_field_list () {if (del_vector) delete include;} \ - NAME##_cus_field_list (const NAME *o, cchar *d, Manip m, bool i1, bool i2); \ - NAME##_cus_field_list (const NAME *o, cchar *d, Manip m, NAME##_enum i1, NAME##_enum i2); \ - NAME##_cus_field_list (const NAME *o, cchar *d, Manip m, std::vector *i) \ - : obj(o), include(i), del_vector(false), delem(d), manip(m) {}\ - };\ - template \ - class NAME##_cus_equal_list {\ - /* friend std::ostream& operator << <> (std::ostream&, \ - const NAME##_cus_equal_list&); */\ - public:\ - const NAME *obj;\ - std::vector *include;\ - bool del_vector;\ - cchar *delem;\ - cchar *comp;\ - Manip manip;\ - public:\ - ~NAME##_##cus_equal_list () {if (del_vector) delete include;}\ - NAME##_##cus_equal_list (const NAME *o, cchar *d, cchar *c, Manip m, bool i1, bool i2); \ - NAME##_##cus_equal_list (const NAME *o, cchar *d, cchar *c, Manip m, NAME##_enum i1, NAME##_enum i2); \ - NAME##_##cus_equal_list (const NAME *o, cchar *d, cchar *c, Manip m, std::vector *i) \ - : obj(o), include(i), del_vector(false), delem(d), comp(c), manip(m) {}\ - };\ - template int sql_compare_##NAME (const NAME &, const NAME &);\ - struct NAME { \ - T1 I1;\ - T2 I2; \ - NAME () {} \ - NAME (const Row &row);\ - void set (const Row &row);\ - sql_compare_define_##CMP(NAME, T1, I1, T2, I2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0)\ - sql_construct_define_##CONTR(NAME, T1, I1, T2, I2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0)\ - static const char *names[];\ - static const char *_table;\ - static const char *& table() {return _table;}\ - NAME##_value_list value_list() const {\ - return value_list(",", quote);}\ - NAME##_value_list value_list(cchar *d) const {\ - return value_list(d, quote);}\ - template \ - NAME##_value_list value_list(cchar *d, Manip m) const; \ - NAME##_field_list field_list() const {\ - return field_list(",", do_nothing);}\ - NAME##_field_list field_list(cchar *d) const {\ - return field_list(d, do_nothing);}\ - template \ - NAME##_field_list field_list(cchar *d, Manip m) const; \ - NAME##_equal_list equal_list(cchar *d = ",", \ - cchar *c = " = ") const{\ - return equal_list(d, c, quote);}\ - template \ - NAME##_equal_list equal_list(cchar *d, cchar *c, Manip m) const; \ - /* cus_data */\ - NAME##_cus_value_list value_list(bool i1, bool i2 = false) const {\ - return value_list(",", quote, i1, i2);\ - }\ - NAME##_cus_value_list value_list(NAME##_enum i1, NAME##_enum i2 = NAME##_NULL) const {\ - return value_list(",", quote, i1, i2);\ - }\ - NAME##_cus_value_list value_list(std::vector *i) const {\ - return value_list(",", quote, i);\ - }\ - NAME##_cus_value_list value_list(sql_cmp_type sc) const {\ - return value_list(",", quote, sc);\ - }\ - NAME##_cus_value_list value_list(cchar *d, bool i1, bool i2 = false) const {\ - return value_list(d, quote, i1, i2);\ - }\ - NAME##_cus_value_list value_list(cchar *d, NAME##_enum i1, NAME##_enum i2 = NAME##_NULL) const {\ - return value_list(d, quote, i1, i2);\ - }\ - NAME##_cus_value_list value_list(cchar *d, \ - std::vector *i) const {\ - return value_list(d, quote, i);\ - }\ - NAME##_cus_value_list value_list(cchar *d, \ - sql_cmp_type sc) const {\ - return value_list(d, quote, sc);\ - }\ - template \ - NAME##_cus_value_list value_list(cchar *d, Manip m,\ - bool i1, bool i2 = false) const; \ - template \ - NAME##_cus_value_list value_list(cchar *d, Manip m,\ - NAME##_enum i1, NAME##_enum i2 = NAME##_NULL) const; \ - template \ - NAME##_cus_value_list value_list(cchar *d, Manip m, \ - std::vector *i) const;\ - template \ - NAME##_cus_value_list value_list(cchar *d, Manip m, \ - sql_cmp_type sc) const;\ - /* cus field */\ - NAME##_cus_field_list field_list(bool i1, bool i2 = false) const {\ - return field_list(",", do_nothing, i1, i2);\ - }\ - NAME##_cus_field_list field_list(NAME##_enum i1, NAME##_enum i2 = NAME##_NULL) const {\ - return field_list(",", do_nothing, i1, i2);\ - }\ - NAME##_cus_field_list field_list(std::vector *i) const {\ - return field_list(",", do_nothing, i);\ - }\ - NAME##_cus_field_list field_list(sql_cmp_type sc) const\ - {\ - return field_list(",", do_nothing, sc);\ - }\ - NAME##_cus_field_list field_list(cchar *d, \ - bool i1, bool i2 = false) const {\ - return field_list(d, do_nothing, i1, i2);\ - }\ - NAME##_cus_field_list field_list(cchar *d,\ - NAME##_enum i1, NAME##_enum i2 = NAME##_NULL) const {\ - return field_list(d, do_nothing, i1, i2);\ - }\ - NAME##_cus_field_list field_list(cchar *d, \ - std::vector *i) const {\ - return field_list(d, do_nothing, i);\ - }\ - NAME##_cus_field_list field_list(cchar *d, \ - sql_cmp_type sc) const {\ - return field_list(d, do_nothing, sc);\ - }\ - template \ - NAME##_cus_field_list field_list(cchar *d, Manip m,\ - bool i1, bool i2 = false) const; \ - template \ - NAME##_cus_field_list field_list(cchar *d, Manip m,\ - NAME##_enum i1, NAME##_enum i2 = NAME##_NULL) const; \ - template \ - NAME##_cus_field_list field_list(cchar *d, Manip m,\ - std::vector *i) const;\ - template \ - NAME##_cus_field_list field_list(cchar *d, Manip m, \ - sql_cmp_type sc) const;\ - /* cus equal */\ - NAME##_cus_equal_list equal_list(bool i1, bool i2 = false) const {\ - return equal_list(",", " = ", quote, i1, i2);\ - }\ - NAME##_cus_equal_list equal_list(NAME##_enum i1, NAME##_enum i2 = NAME##_NULL) const {\ - return equal_list(",", " = ", quote, i1, i2);\ - }\ - NAME##_cus_equal_list equal_list(std::vector *i) const {\ - return equal_list(",", " = ", quote, i);\ - }\ - NAME##_cus_equal_list equal_list(sql_cmp_type sc) const {\ - return equal_list(",", " = ", quote, sc);\ - }\ - NAME##_cus_equal_list equal_list(cchar *d, bool i1, bool i2 = false) const {\ - return equal_list(d, " = ", quote, i1, i2);\ - }\ - NAME##_cus_equal_list equal_list(cchar *d, NAME##_enum i1, NAME##_enum i2 = NAME##_NULL) const {\ - return equal_list(d, " = ", quote, i1, i2);\ - }\ - NAME##_cus_equal_list equal_list(cchar *d, \ - std::vector *i) const {\ - return equal_list(d, " = ", quote, i);\ - }\ - NAME##_cus_equal_list equal_list(cchar *d, \ - sql_cmp_type sc) const {\ - return equal_list(d, " = ", quote, sc);\ - }\ - NAME##_cus_equal_list equal_list(cchar *d, cchar *c,\ - bool i1, bool i2 = false) const {\ - return equal_list(d, c, quote, i1, i2);\ - }\ - NAME##_cus_equal_list equal_list(cchar *d, cchar *c,\ - NAME##_enum i1, NAME##_enum i2 = NAME##_NULL) const {\ - return equal_list(d, c, quote, i1, i2);\ - }\ - NAME##_cus_equal_list equal_list(cchar *d, cchar *c,\ - std::vector *i) const {\ - return equal_list(d, c, quote, i);\ - }\ - NAME##_cus_equal_list equal_list(cchar *d, cchar *c,\ - sql_cmp_type sc) const {\ - return equal_list(d, c, quote, sc);\ - }\ - template \ - NAME##_cus_equal_list equal_list(cchar *d, cchar *c, Manip m, \ - bool i1, bool i2 = false) const; \ - template \ - NAME##_cus_equal_list equal_list(cchar *d, cchar *c, Manip m, \ - NAME##_enum i1, NAME##_enum i2 = NAME##_NULL) const; \ - template \ - NAME##_cus_equal_list equal_list(cchar *d, cchar *c, Manip m, \ - std::vector *i) const;\ - template \ - NAME##_cus_equal_list equal_list(cchar *d, cchar *c, Manip m, \ - sql_cmp_type sc) const;\ - }; \ - const char *NAME::names[] = { \ - N1 ,\ - N2 \ - }; \ - const char *NAME::_table = #NAME ; \ - template \ - NAME##_cus_value_list::NAME##_cus_value_list\ - (const NAME *o, cchar *d, Manip m, bool i1, bool i2) \ - { \ - delem = d;\ - manip = m;\ - del_vector = true;\ - obj = o; \ - include = new std::vector(2, false);\ - if (i1) (*include)[0]=true;\ - if (i2) (*include)[1]=true;\ - } \ - template \ - NAME##_cus_value_list::NAME##_cus_value_list\ - (const NAME *o, cchar *d, Manip m, NAME##_enum i1, NAME##_enum i2) { \ - delem = d;\ - manip = m;\ - del_vector = true; \ - obj = o; \ - include = new std::vector(2, false); \ - if (i1 == NAME##_NULL) return;\ - (*include)[i1]=true;\ - if (i2 == NAME##_NULL) return;\ - (*include)[i2]=true;\ - }\ - template \ - NAME##_cus_field_list::NAME##_cus_field_list\ - (const NAME *o, cchar *d, Manip m, bool i1, bool i2) {\ - delem = d;\ - manip = m;\ - del_vector = true; \ - obj = o; \ - include = new std::vector(2, false); \ - if (i1) (*include)[0]=true;\ - if (i2) (*include)[1]=true;\ - } \ - template \ - NAME##_cus_field_list::NAME##_cus_field_list\ - (const NAME *o, cchar *d, Manip m, NAME##_enum i1, NAME##_enum i2) { \ - delem = d;\ - manip = m;\ - del_vector = true; \ - obj = o; \ - include = new std::vector(2, false); \ - if (i1 == NAME##_NULL) return;\ - (*include)[i1]=true;\ - if (i2 == NAME##_NULL) return;\ - (*include)[i2]=true;\ - }\ - template \ - NAME##_cus_equal_list::NAME##_cus_equal_list\ - (const NAME *o, cchar *d, cchar *c, Manip m, bool i1, bool i2) { \ - delem = d;\ - comp = c;\ - manip = m;\ - del_vector = true; \ - obj = o; \ - include = new std::vector(2, false); \ - if (i1) (*include)[0]=true;\ - if (i2) (*include)[1]=true;\ - } \ - template \ - NAME##_cus_equal_list::NAME##_cus_equal_list\ - (const NAME *o, cchar *d, cchar *c, Manip m, NAME##_enum i1, NAME##_enum i2) { \ - delem = d;\ - comp = c;\ - manip = m;\ - del_vector = true; \ - obj = o; \ - include = new std::vector(2, false); \ - if (i1 == NAME##_NULL) return;\ - (*include)[i1]=true;\ - if (i2 == NAME##_NULL) return;\ - (*include)[i2]=true;\ - }\ - template \ - std::ostream& operator << (std::ostream& s, const NAME##_value_list& obj) { \ - s << obj.manip << obj.obj->I1 << obj.delem;\ - s << obj.manip << obj.obj->I2; \ - return s; \ - } \ - template \ - std::ostream& operator << (std::ostream& s, const NAME##_field_list& obj) { \ - s << obj.manip << obj.obj->names[0] << obj.delem;\ - s << obj.manip << obj.obj->names[1]; \ - return s; \ - } \ - template \ - std::ostream& operator << (std::ostream& s, const NAME##_equal_list& obj) { \ - s << obj.obj->names[0] << obj.comp << obj.manip << obj.obj->I1 << obj.delem;\ - s << obj.obj->names[1] << obj.comp << obj.manip << obj.obj->I2; \ - return s; \ - } \ - template \ - std::ostream& operator << (std::ostream& s, const NAME##_cus_value_list& obj) { \ - bool before = false; \ - if ((*obj.include)[0]) { \ - s << obj.manip << obj.obj->I1;\ - before = true; \ - } \ - if ((*obj.include)[1]) { \ - if (before) s << obj.delem;\ - s << obj.manip << obj.obj->I2;\ - } \ - return s; \ - } \ - template \ - std::ostream& operator << (std::ostream& s, const NAME##_cus_field_list& obj) { \ - bool before = false; \ - if ((*obj.include)[0]) { \ - s << obj.manip << obj.obj->names[0];\ - before = true; \ - } \ - if ((*obj.include)[1]) { \ - if (before) s << obj.delem;\ - s << obj.manip << obj.obj->names[1];\ - } \ - return s; \ - } \ - template \ - std::ostream& operator << (std::ostream& s, const NAME##_cus_equal_list& obj) { \ - bool before = false; \ - if ((*obj.include)[0]) { \ - s << obj.obj->names[0] << obj.comp << obj.manip << obj.obj->I1;\ - before = true; \ - } \ - if ((*obj.include)[1]) { \ - if (before) s << obj.delem;\ - s << obj.obj->names[1] << obj.comp << obj.manip << obj.obj->I2;\ - } \ - return s; \ - } \ - template \ - inline NAME##_value_list NAME::value_list(cchar *d, Manip m) const { \ - return NAME##_value_list (this, d, m); \ - } \ - template \ - inline NAME##_field_list NAME::field_list(cchar *d, Manip m) const { \ - return NAME##_field_list (this, d, m); \ - } \ - template \ - inline NAME##_equal_list NAME::equal_list(cchar *d, cchar *c, Manip m) const { \ - return NAME##_equal_list (this, d, c, m); \ - } \ - template \ - inline NAME##_cus_value_list NAME::value_list(cchar *d, Manip m,\ - bool i1, bool i2) const {\ - return NAME##_cus_value_list (this, d, m, i1, i2); \ - } \ - template \ - inline NAME##_cus_field_list NAME::field_list(cchar *d, Manip m,\ - bool i1, bool i2) const { \ - return NAME##_cus_field_list (this, d, m, i1, i2); \ - } \ - template \ - inline NAME##_cus_equal_list NAME::equal_list(cchar *d, cchar *c, Manip m,\ - bool i1, bool i2) const { \ - return NAME##_cus_equal_list (this, d, c, m, i1, i2); \ - } \ - template \ - inline NAME##_cus_value_list NAME::value_list(cchar *d, Manip m,\ - NAME##_enum i1, NAME##_enum i2) const { \ - return NAME##_cus_value_list (this, d, m, i1, i2); \ - } \ - template \ - inline NAME##_cus_field_list NAME::field_list(cchar *d, Manip m,\ - NAME##_enum i1, NAME##_enum i2) const {\ - return NAME##_cus_field_list (this, d, m, i1, i2); \ - } \ - template \ - inline NAME##_cus_equal_list NAME::equal_list(cchar *d, cchar *c, Manip m, \ - NAME##_enum i1, NAME##_enum i2) const { \ - return NAME##_cus_equal_list (this, d, c, m, i1, i2); \ - } \ - template \ - inline NAME##_cus_value_list NAME::value_list(cchar *d, Manip m,\ - std::vector *i) const {\ - return NAME##_cus_value_list (this, d, m, i);\ - }\ - template \ - inline NAME##_cus_field_list NAME::field_list(cchar *d, Manip m,\ - std::vector *i) const {\ - return NAME##_cus_field_list (this, d, m, i);\ - }\ - template \ - inline NAME##_cus_equal_list NAME::equal_list(cchar *d, cchar *c, Manip m,\ - std::vector *i) const {\ - return NAME##_cus_equal_list (this, d, c, m, i);\ - }\ - template \ - inline NAME##_cus_value_list \ - NAME::value_list(cchar *d, Manip m, sql_cmp_type /*sc*/) const {\ - sql_compare_type_def_##CMP (NAME, value, NUM);\ - }\ - template \ - inline NAME##_cus_field_list \ - NAME::field_list(cchar *d, Manip m, sql_cmp_type /*sc*/) const {\ - sql_compare_type_def_##CMP (NAME, field, NUM);\ - }\ - template \ - inline NAME##_cus_equal_list \ - NAME::equal_list(cchar *d, cchar *c, Manip m, sql_cmp_type /*sc*/) const {\ - sql_compare_type_defe_##CMP (NAME, equal, NUM);\ - }\ - template \ - void populate_##NAME (NAME *s, const Row &row) { \ - s->I1 = static_cast(row.at(O1));\ - s->I2 = static_cast(row.at(O2));\ - } \ - inline NAME::NAME (const Row &row) \ - {populate_##NAME(this, row);}\ - inline void NAME::set (const Row &row)\ - {populate_##NAME(this, row);}\ - sql_COMPARE__##CMP(NAME, I1, I2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ) - -#define sql_create_basic_2(NAME, CMP, CONTR, T1, I1, T2, I2) \ - sql_create_basic_c_order_2(NAME, CMP, CONTR, T1, I1, 0, T2, I2, 1) - -#define sql_create_2(NAME, CMP, CONTR, T1, I1, T2, I2) \ - sql_create_complete_2(NAME, CMP, CONTR, T1, I1, #I1, 0, T2, I2, #I2, 1) \ - -#define sql_create_c_order_2(NAME, CMP, CONTR, T1, I1, O1, T2, I2, O2) \ - sql_create_complete_2(NAME, CMP, CONTR, T1, I1, #I1, O1, T2, I2, #I2, O2) - -#define sql_create_c_names_2(NAME, CMP, CONTR, T1, I1, N1, T2, I2, N2) \ - sql_create_complete_2(NAME, CMP, CONTR, T1, I1, N1, 0, T2, I2, N2, 1) - -// --------------------------------------------------- -// End Create 2 -// --------------------------------------------------- - -// --------------------------------------------------- -// Begin Create 3 -// --------------------------------------------------- -#define sql_create_basic_c_order_3(NAME, CMP, CONTR, T1, I1, O1, T2, I2, O2, T3, I3, O3)\ - struct NAME; \ - template int sql_compare_##NAME (const NAME &, const NAME &);\ - struct NAME { \ - T1 I1;\ - T2 I2;\ - T3 I3; \ - NAME () {} \ - NAME (const Row &row);\ - sql_compare_define_##CMP(NAME, T1, I1, T2, I2, T3, I3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0)\ - }; \ - template \ - void populate_##NAME (NAME *s, const Row &row) { \ - s->I1 = static_cast(row.at(O1));\ - s->I2 = static_cast(row.at(O2));\ - s->I3 = static_cast(row.at(O3)); \ - } \ - inline NAME::NAME (const Row &row) \ - {populate_##NAME(this, row);} \ - sql_COMPARE__##CMP(NAME, I1, I2, I3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ) - -#define sql_create_complete_3(NAME, CMP, CONTR, T1, I1, N1, O1, T2, I2, N2, O2, T3, I3, N3, O3) \ - struct NAME; \ - enum NAME##_enum { \ - NAME##_##I1,\ - NAME##_##I2,\ - NAME##_##I3 \ - ,NAME##_NULL \ - }; \ - template \ - class NAME##_value_list { \ - /*friend std::ostream& operator << <> (std::ostream&, const NAME##_value_list&); */\ - public: \ - const NAME *obj;\ - cchar *delem;\ - Manip manip;\ - public: \ - NAME##_value_list (const NAME *o, cchar *d, Manip m) \ - : obj(o), delem(d), manip(m) {} \ - };\ - template \ - class NAME##_##field_list {\ - /* friend std::ostream& operator << <> (std::ostream&, const NAME##_field_list&); */\ - public: \ - const NAME *obj; \ - cchar *delem;\ - Manip manip;\ - public: \ - NAME##_field_list (const NAME *o, cchar *d, Manip m) \ - : obj(o), delem(d), manip(m) {} \ - };\ - template \ - class NAME##_equal_list { \ - /* friend std::ostream& operator << <> (std::ostream&, const NAME##_equal_list&); */\ - public: \ - const NAME *obj;\ - cchar *delem;\ - cchar *comp;\ - Manip manip;\ - public: \ - NAME##_equal_list (const NAME *o, cchar *d, cchar *c, Manip m) \ - : obj(o), delem(d), comp(c), manip(m) {}\ - };\ - template \ - class NAME##_cus_value_list {\ - /* friend std::ostream& operator << <> (std::ostream&, \ - const NAME##_cus_value_list&); */\ - public:\ - const NAME *obj;\ - std::vector *include;\ - bool del_vector;\ - cchar *delem;\ - Manip manip;\ - public: \ - ~NAME##_cus_value_list () {if (del_vector) delete include;} \ - NAME##_cus_value_list (const NAME *o, cchar *d, Manip m, bool i1, bool i2, bool i3);\ - NAME##_cus_value_list (const NAME *o, cchar *d, Manip m, NAME##_enum i1, NAME##_enum i2, NAME##_enum i3); \ - NAME##_cus_value_list (const NAME *o, cchar *d, Manip m ,std::vector* i)\ - : obj(o), include(i), del_vector(false), delem(d), manip(m) {}\ - };\ - template \ - class NAME##_cus_field_list { \ - /* friend std::ostream& operator << <> (std::ostream&, \ - const NAME##_cus_field_list&); */\ - public:\ - const NAME *obj; \ - std::vector *include; \ - bool del_vector; \ - cchar *delem;\ - Manip manip;\ - public: \ - ~NAME##_cus_field_list () {if (del_vector) delete include;} \ - NAME##_cus_field_list (const NAME *o, cchar *d, Manip m, bool i1, bool i2, bool i3); \ - NAME##_cus_field_list (const NAME *o, cchar *d, Manip m, NAME##_enum i1, NAME##_enum i2, NAME##_enum i3); \ - NAME##_cus_field_list (const NAME *o, cchar *d, Manip m, std::vector *i) \ - : obj(o), include(i), del_vector(false), delem(d), manip(m) {}\ - };\ - template \ - class NAME##_cus_equal_list {\ - /* friend std::ostream& operator << <> (std::ostream&, \ - const NAME##_cus_equal_list&); */\ - public:\ - const NAME *obj;\ - std::vector *include;\ - bool del_vector;\ - cchar *delem;\ - cchar *comp;\ - Manip manip;\ - public:\ - ~NAME##_##cus_equal_list () {if (del_vector) delete include;}\ - NAME##_##cus_equal_list (const NAME *o, cchar *d, cchar *c, Manip m, bool i1, bool i2, bool i3); \ - NAME##_##cus_equal_list (const NAME *o, cchar *d, cchar *c, Manip m, NAME##_enum i1, NAME##_enum i2, NAME##_enum i3); \ - NAME##_##cus_equal_list (const NAME *o, cchar *d, cchar *c, Manip m, std::vector *i) \ - : obj(o), include(i), del_vector(false), delem(d), comp(c), manip(m) {}\ - };\ - template int sql_compare_##NAME (const NAME &, const NAME &);\ - struct NAME { \ - T1 I1;\ - T2 I2;\ - T3 I3; \ - NAME () {} \ - NAME (const Row &row);\ - void set (const Row &row);\ - sql_compare_define_##CMP(NAME, T1, I1, T2, I2, T3, I3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0)\ - sql_construct_define_##CONTR(NAME, T1, I1, T2, I2, T3, I3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0)\ - static const char *names[];\ - static const char *_table;\ - static const char *& table() {return _table;}\ - NAME##_value_list value_list() const {\ - return value_list(",", quote);}\ - NAME##_value_list value_list(cchar *d) const {\ - return value_list(d, quote);}\ - template \ - NAME##_value_list value_list(cchar *d, Manip m) const; \ - NAME##_field_list field_list() const {\ - return field_list(",", do_nothing);}\ - NAME##_field_list field_list(cchar *d) const {\ - return field_list(d, do_nothing);}\ - template \ - NAME##_field_list field_list(cchar *d, Manip m) const; \ - NAME##_equal_list equal_list(cchar *d = ",", \ - cchar *c = " = ") const{\ - return equal_list(d, c, quote);}\ - template \ - NAME##_equal_list equal_list(cchar *d, cchar *c, Manip m) const; \ - /* cus_data */\ - NAME##_cus_value_list value_list(bool i1, bool i2 = false, bool i3 = false) const {\ - return value_list(",", quote, i1, i2, i3);\ - }\ - NAME##_cus_value_list value_list(NAME##_enum i1, NAME##_enum i2 = NAME##_NULL, NAME##_enum i3 = NAME##_NULL) const {\ - return value_list(",", quote, i1, i2, i3);\ - }\ - NAME##_cus_value_list value_list(std::vector *i) const {\ - return value_list(",", quote, i);\ - }\ - NAME##_cus_value_list value_list(sql_cmp_type sc) const {\ - return value_list(",", quote, sc);\ - }\ - NAME##_cus_value_list value_list(cchar *d, bool i1, bool i2 = false, bool i3 = false) const {\ - return value_list(d, quote, i1, i2, i3);\ - }\ - NAME##_cus_value_list value_list(cchar *d, NAME##_enum i1, NAME##_enum i2 = NAME##_NULL, NAME##_enum i3 = NAME##_NULL) const {\ - return value_list(d, quote, i1, i2, i3);\ - }\ - NAME##_cus_value_list value_list(cchar *d, \ - std::vector *i) const {\ - return value_list(d, quote, i);\ - }\ - NAME##_cus_value_list value_list(cchar *d, \ - sql_cmp_type sc) const {\ - return value_list(d, quote, sc);\ - }\ - template \ - NAME##_cus_value_list value_list(cchar *d, Manip m,\ - bool i1, bool i2 = false, bool i3 = false) const; \ - template \ - NAME##_cus_value_list value_list(cchar *d, Manip m,\ - NAME##_enum i1, NAME##_enum i2 = NAME##_NULL, NAME##_enum i3 = NAME##_NULL) const; \ - template \ - NAME##_cus_value_list value_list(cchar *d, Manip m, \ - std::vector *i) const;\ - template \ - NAME##_cus_value_list value_list(cchar *d, Manip m, \ - sql_cmp_type sc) const;\ - /* cus field */\ - NAME##_cus_field_list field_list(bool i1, bool i2 = false, bool i3 = false) const {\ - return field_list(",", do_nothing, i1, i2, i3);\ - }\ - NAME##_cus_field_list field_list(NAME##_enum i1, NAME##_enum i2 = NAME##_NULL, NAME##_enum i3 = NAME##_NULL) const {\ - return field_list(",", do_nothing, i1, i2, i3);\ - }\ - NAME##_cus_field_list field_list(std::vector *i) const {\ - return field_list(",", do_nothing, i);\ - }\ - NAME##_cus_field_list field_list(sql_cmp_type sc) const\ - {\ - return field_list(",", do_nothing, sc);\ - }\ - NAME##_cus_field_list field_list(cchar *d, \ - bool i1, bool i2 = false, bool i3 = false) const {\ - return field_list(d, do_nothing, i1, i2, i3);\ - }\ - NAME##_cus_field_list field_list(cchar *d,\ - NAME##_enum i1, NAME##_enum i2 = NAME##_NULL, NAME##_enum i3 = NAME##_NULL) const {\ - return field_list(d, do_nothing, i1, i2, i3);\ - }\ - NAME##_cus_field_list field_list(cchar *d, \ - std::vector *i) const {\ - return field_list(d, do_nothing, i);\ - }\ - NAME##_cus_field_list field_list(cchar *d, \ - sql_cmp_type sc) const {\ - return field_list(d, do_nothing, sc);\ - }\ - template \ - NAME##_cus_field_list field_list(cchar *d, Manip m,\ - bool i1, bool i2 = false, bool i3 = false) const; \ - template \ - NAME##_cus_field_list field_list(cchar *d, Manip m,\ - NAME##_enum i1, NAME##_enum i2 = NAME##_NULL, NAME##_enum i3 = NAME##_NULL) const; \ - template \ - NAME##_cus_field_list field_list(cchar *d, Manip m,\ - std::vector *i) const;\ - template \ - NAME##_cus_field_list field_list(cchar *d, Manip m, \ - sql_cmp_type sc) const;\ - /* cus equal */\ - NAME##_cus_equal_list equal_list(bool i1, bool i2 = false, bool i3 = false) const {\ - return equal_list(",", " = ", quote, i1, i2, i3);\ - }\ - NAME##_cus_equal_list equal_list(NAME##_enum i1, NAME##_enum i2 = NAME##_NULL, NAME##_enum i3 = NAME##_NULL) const {\ - return equal_list(",", " = ", quote, i1, i2, i3);\ - }\ - NAME##_cus_equal_list equal_list(std::vector *i) const {\ - return equal_list(",", " = ", quote, i);\ - }\ - NAME##_cus_equal_list equal_list(sql_cmp_type sc) const {\ - return equal_list(",", " = ", quote, sc);\ - }\ - NAME##_cus_equal_list equal_list(cchar *d, bool i1, bool i2 = false, bool i3 = false) const {\ - return equal_list(d, " = ", quote, i1, i2, i3);\ - }\ - NAME##_cus_equal_list equal_list(cchar *d, NAME##_enum i1, NAME##_enum i2 = NAME##_NULL, NAME##_enum i3 = NAME##_NULL) const {\ - return equal_list(d, " = ", quote, i1, i2, i3);\ - }\ - NAME##_cus_equal_list equal_list(cchar *d, \ - std::vector *i) const {\ - return equal_list(d, " = ", quote, i);\ - }\ - NAME##_cus_equal_list equal_list(cchar *d, \ - sql_cmp_type sc) const {\ - return equal_list(d, " = ", quote, sc);\ - }\ - NAME##_cus_equal_list equal_list(cchar *d, cchar *c,\ - bool i1, bool i2 = false, bool i3 = false) const {\ - return equal_list(d, c, quote, i1, i2, i3);\ - }\ - NAME##_cus_equal_list equal_list(cchar *d, cchar *c,\ - NAME##_enum i1, NAME##_enum i2 = NAME##_NULL, NAME##_enum i3 = NAME##_NULL) const {\ - return equal_list(d, c, quote, i1, i2, i3);\ - }\ - NAME##_cus_equal_list equal_list(cchar *d, cchar *c,\ - std::vector *i) const {\ - return equal_list(d, c, quote, i);\ - }\ - NAME##_cus_equal_list equal_list(cchar *d, cchar *c,\ - sql_cmp_type sc) const {\ - return equal_list(d, c, quote, sc);\ - }\ - template \ - NAME##_cus_equal_list equal_list(cchar *d, cchar *c, Manip m, \ - bool i1, bool i2 = false, bool i3 = false) const; \ - template \ - NAME##_cus_equal_list equal_list(cchar *d, cchar *c, Manip m, \ - NAME##_enum i1, NAME##_enum i2 = NAME##_NULL, NAME##_enum i3 = NAME##_NULL) const; \ - template \ - NAME##_cus_equal_list equal_list(cchar *d, cchar *c, Manip m, \ - std::vector *i) const;\ - template \ - NAME##_cus_equal_list equal_list(cchar *d, cchar *c, Manip m, \ - sql_cmp_type sc) const;\ - }; \ - const char *NAME::names[] = { \ - N1 ,\ - N2 ,\ - N3 \ - }; \ - const char *NAME::_table = #NAME ; \ - template \ - NAME##_cus_value_list::NAME##_cus_value_list\ - (const NAME *o, cchar *d, Manip m, bool i1, bool i2, bool i3) \ - { \ - delem = d;\ - manip = m;\ - del_vector = true;\ - obj = o; \ - include = new std::vector(3, false);\ - if (i1) (*include)[0]=true;\ - if (i2) (*include)[1]=true;\ - if (i3) (*include)[2]=true;\ - } \ - template \ - NAME##_cus_value_list::NAME##_cus_value_list\ - (const NAME *o, cchar *d, Manip m, NAME##_enum i1, NAME##_enum i2, NAME##_enum i3) { \ - delem = d;\ - manip = m;\ - del_vector = true; \ - obj = o; \ - include = new std::vector(3, false); \ - if (i1 == NAME##_NULL) return;\ - (*include)[i1]=true;\ - if (i2 == NAME##_NULL) return;\ - (*include)[i2]=true;\ - if (i3 == NAME##_NULL) return;\ - (*include)[i3]=true;\ - }\ - template \ - NAME##_cus_field_list::NAME##_cus_field_list\ - (const NAME *o, cchar *d, Manip m, bool i1, bool i2, bool i3) {\ - delem = d;\ - manip = m;\ - del_vector = true; \ - obj = o; \ - include = new std::vector(3, false); \ - if (i1) (*include)[0]=true;\ - if (i2) (*include)[1]=true;\ - if (i3) (*include)[2]=true;\ - } \ - template \ - NAME##_cus_field_list::NAME##_cus_field_list\ - (const NAME *o, cchar *d, Manip m, NAME##_enum i1, NAME##_enum i2, NAME##_enum i3) { \ - delem = d;\ - manip = m;\ - del_vector = true; \ - obj = o; \ - include = new std::vector(3, false); \ - if (i1 == NAME##_NULL) return;\ - (*include)[i1]=true;\ - if (i2 == NAME##_NULL) return;\ - (*include)[i2]=true;\ - if (i3 == NAME##_NULL) return;\ - (*include)[i3]=true;\ - }\ - template \ - NAME##_cus_equal_list::NAME##_cus_equal_list\ - (const NAME *o, cchar *d, cchar *c, Manip m, bool i1, bool i2, bool i3) { \ - delem = d;\ - comp = c;\ - manip = m;\ - del_vector = true; \ - obj = o; \ - include = new std::vector(3, false); \ - if (i1) (*include)[0]=true;\ - if (i2) (*include)[1]=true;\ - if (i3) (*include)[2]=true;\ - } \ - template \ - NAME##_cus_equal_list::NAME##_cus_equal_list\ - (const NAME *o, cchar *d, cchar *c, Manip m, NAME##_enum i1, NAME##_enum i2, NAME##_enum i3) { \ - delem = d;\ - comp = c;\ - manip = m;\ - del_vector = true; \ - obj = o; \ - include = new std::vector(3, false); \ - if (i1 == NAME##_NULL) return;\ - (*include)[i1]=true;\ - if (i2 == NAME##_NULL) return;\ - (*include)[i2]=true;\ - if (i3 == NAME##_NULL) return;\ - (*include)[i3]=true;\ - }\ - template \ - std::ostream& operator << (std::ostream& s, const NAME##_value_list& obj) { \ - s << obj.manip << obj.obj->I1 << obj.delem;\ - s << obj.manip << obj.obj->I2 << obj.delem;\ - s << obj.manip << obj.obj->I3; \ - return s; \ - } \ - template \ - std::ostream& operator << (std::ostream& s, const NAME##_field_list& obj) { \ - s << obj.manip << obj.obj->names[0] << obj.delem;\ - s << obj.manip << obj.obj->names[1] << obj.delem;\ - s << obj.manip << obj.obj->names[2]; \ - return s; \ - } \ - template \ - std::ostream& operator << (std::ostream& s, const NAME##_equal_list& obj) { \ - s << obj.obj->names[0] << obj.comp << obj.manip << obj.obj->I1 << obj.delem;\ - s << obj.obj->names[1] << obj.comp << obj.manip << obj.obj->I2 << obj.delem;\ - s << obj.obj->names[2] << obj.comp << obj.manip << obj.obj->I3; \ - return s; \ - } \ - template \ - std::ostream& operator << (std::ostream& s, const NAME##_cus_value_list& obj) { \ - bool before = false; \ - if ((*obj.include)[0]) { \ - s << obj.manip << obj.obj->I1;\ - before = true; \ - } \ - if ((*obj.include)[1]) { \ - if (before) s << obj.delem;\ - s << obj.manip << obj.obj->I2;\ - before = true; \ - } \ - if ((*obj.include)[2]) { \ - if (before) s << obj.delem;\ - s << obj.manip << obj.obj->I3;\ - } \ - return s; \ - } \ - template \ - std::ostream& operator << (std::ostream& s, const NAME##_cus_field_list& obj) { \ - bool before = false; \ - if ((*obj.include)[0]) { \ - s << obj.manip << obj.obj->names[0];\ - before = true; \ - } \ - if ((*obj.include)[1]) { \ - if (before) s << obj.delem;\ - s << obj.manip << obj.obj->names[1];\ - before = true; \ - } \ - if ((*obj.include)[2]) { \ - if (before) s << obj.delem;\ - s << obj.manip << obj.obj->names[2];\ - } \ - return s; \ - } \ - template \ - std::ostream& operator << (std::ostream& s, const NAME##_cus_equal_list& obj) { \ - bool before = false; \ - if ((*obj.include)[0]) { \ - s << obj.obj->names[0] << obj.comp << obj.manip << obj.obj->I1;\ - before = true; \ - } \ - if ((*obj.include)[1]) { \ - if (before) s << obj.delem;\ - s << obj.obj->names[1] << obj.comp << obj.manip << obj.obj->I2;\ - before = true; \ - } \ - if ((*obj.include)[2]) { \ - if (before) s << obj.delem;\ - s << obj.obj->names[2] << obj.comp << obj.manip << obj.obj->I3;\ - } \ - return s; \ - } \ - template \ - inline NAME##_value_list NAME::value_list(cchar *d, Manip m) const { \ - return NAME##_value_list (this, d, m); \ - } \ - template \ - inline NAME##_field_list NAME::field_list(cchar *d, Manip m) const { \ - return NAME##_field_list (this, d, m); \ - } \ - template \ - inline NAME##_equal_list NAME::equal_list(cchar *d, cchar *c, Manip m) const { \ - return NAME##_equal_list (this, d, c, m); \ - } \ - template \ - inline NAME##_cus_value_list NAME::value_list(cchar *d, Manip m,\ - bool i1, bool i2, bool i3) const {\ - return NAME##_cus_value_list (this, d, m, i1, i2, i3); \ - } \ - template \ - inline NAME##_cus_field_list NAME::field_list(cchar *d, Manip m,\ - bool i1, bool i2, bool i3) const { \ - return NAME##_cus_field_list (this, d, m, i1, i2, i3); \ - } \ - template \ - inline NAME##_cus_equal_list NAME::equal_list(cchar *d, cchar *c, Manip m,\ - bool i1, bool i2, bool i3) const { \ - return NAME##_cus_equal_list (this, d, c, m, i1, i2, i3); \ - } \ - template \ - inline NAME##_cus_value_list NAME::value_list(cchar *d, Manip m,\ - NAME##_enum i1, NAME##_enum i2, NAME##_enum i3) const { \ - return NAME##_cus_value_list (this, d, m, i1, i2, i3); \ - } \ - template \ - inline NAME##_cus_field_list NAME::field_list(cchar *d, Manip m,\ - NAME##_enum i1, NAME##_enum i2, NAME##_enum i3) const {\ - return NAME##_cus_field_list (this, d, m, i1, i2, i3); \ - } \ - template \ - inline NAME##_cus_equal_list NAME::equal_list(cchar *d, cchar *c, Manip m, \ - NAME##_enum i1, NAME##_enum i2, NAME##_enum i3) const { \ - return NAME##_cus_equal_list (this, d, c, m, i1, i2, i3); \ - } \ - template \ - inline NAME##_cus_value_list NAME::value_list(cchar *d, Manip m,\ - std::vector *i) const {\ - return NAME##_cus_value_list (this, d, m, i);\ - }\ - template \ - inline NAME##_cus_field_list NAME::field_list(cchar *d, Manip m,\ - std::vector *i) const {\ - return NAME##_cus_field_list (this, d, m, i);\ - }\ - template \ - inline NAME##_cus_equal_list NAME::equal_list(cchar *d, cchar *c, Manip m,\ - std::vector *i) const {\ - return NAME##_cus_equal_list (this, d, c, m, i);\ - }\ - template \ - inline NAME##_cus_value_list \ - NAME::value_list(cchar *d, Manip m, sql_cmp_type /*sc*/) const {\ - sql_compare_type_def_##CMP (NAME, value, NUM);\ - }\ - template \ - inline NAME##_cus_field_list \ - NAME::field_list(cchar *d, Manip m, sql_cmp_type /*sc*/) const {\ - sql_compare_type_def_##CMP (NAME, field, NUM);\ - }\ - template \ - inline NAME##_cus_equal_list \ - NAME::equal_list(cchar *d, cchar *c, Manip m, sql_cmp_type /*sc*/) const {\ - sql_compare_type_defe_##CMP (NAME, equal, NUM);\ - }\ - template \ - void populate_##NAME (NAME *s, const Row &row) { \ - s->I1 = static_cast(row.at(O1));\ - s->I2 = static_cast(row.at(O2));\ - s->I3 = static_cast(row.at(O3));\ - } \ - inline NAME::NAME (const Row &row) \ - {populate_##NAME(this, row);}\ - inline void NAME::set (const Row &row)\ - {populate_##NAME(this, row);}\ - sql_COMPARE__##CMP(NAME, I1, I2, I3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ) - -#define sql_create_basic_3(NAME, CMP, CONTR, T1, I1, T2, I2, T3, I3) \ - sql_create_basic_c_order_3(NAME, CMP, CONTR, T1, I1, 0, T2, I2, 1, T3, I3, 2) - -#define sql_create_3(NAME, CMP, CONTR, T1, I1, T2, I2, T3, I3) \ - sql_create_complete_3(NAME, CMP, CONTR, T1, I1, #I1, 0, T2, I2, #I2, 1, T3, I3, #I3, 2) \ - -#define sql_create_c_order_3(NAME, CMP, CONTR, T1, I1, O1, T2, I2, O2, T3, I3, O3) \ - sql_create_complete_3(NAME, CMP, CONTR, T1, I1, #I1, O1, T2, I2, #I2, O2, T3, I3, #I3, O3) - -#define sql_create_c_names_3(NAME, CMP, CONTR, T1, I1, N1, T2, I2, N2, T3, I3, N3) \ - sql_create_complete_3(NAME, CMP, CONTR, T1, I1, N1, 0, T2, I2, N2, 1, T3, I3, N3, 2) - -// --------------------------------------------------- -// End Create 3 -// --------------------------------------------------- - -// --------------------------------------------------- -// Begin Create 4 -// --------------------------------------------------- -#define sql_create_basic_c_order_4(NAME, CMP, CONTR, T1, I1, O1, T2, I2, O2, T3, I3, O3, T4, I4, O4)\ - struct NAME; \ - template int sql_compare_##NAME (const NAME &, const NAME &);\ - struct NAME { \ - T1 I1;\ - T2 I2;\ - T3 I3;\ - T4 I4; \ - NAME () {} \ - NAME (const Row &row);\ - sql_compare_define_##CMP(NAME, T1, I1, T2, I2, T3, I3, T4, I4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0)\ - }; \ - template \ - void populate_##NAME (NAME *s, const Row &row) { \ - s->I1 = static_cast(row.at(O1));\ - s->I2 = static_cast(row.at(O2));\ - s->I3 = static_cast(row.at(O3));\ - s->I4 = static_cast(row.at(O4)); \ - } \ - inline NAME::NAME (const Row &row) \ - {populate_##NAME(this, row);} \ - sql_COMPARE__##CMP(NAME, I1, I2, I3, I4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ) - -#define sql_create_complete_4(NAME, CMP, CONTR, T1, I1, N1, O1, T2, I2, N2, O2, T3, I3, N3, O3, T4, I4, N4, O4) \ - struct NAME; \ - enum NAME##_enum { \ - NAME##_##I1,\ - NAME##_##I2,\ - NAME##_##I3,\ - NAME##_##I4 \ - ,NAME##_NULL \ - }; \ - template \ - class NAME##_value_list { \ - /*friend std::ostream& operator << <> (std::ostream&, const NAME##_value_list&); */\ - public: \ - const NAME *obj;\ - cchar *delem;\ - Manip manip;\ - public: \ - NAME##_value_list (const NAME *o, cchar *d, Manip m) \ - : obj(o), delem(d), manip(m) {} \ - };\ - template \ - class NAME##_##field_list {\ - /* friend std::ostream& operator << <> (std::ostream&, const NAME##_field_list&); */\ - public: \ - const NAME *obj; \ - cchar *delem;\ - Manip manip;\ - public: \ - NAME##_field_list (const NAME *o, cchar *d, Manip m) \ - : obj(o), delem(d), manip(m) {} \ - };\ - template \ - class NAME##_equal_list { \ - /* friend std::ostream& operator << <> (std::ostream&, const NAME##_equal_list&); */\ - public: \ - const NAME *obj;\ - cchar *delem;\ - cchar *comp;\ - Manip manip;\ - public: \ - NAME##_equal_list (const NAME *o, cchar *d, cchar *c, Manip m) \ - : obj(o), delem(d), comp(c), manip(m) {}\ - };\ - template \ - class NAME##_cus_value_list {\ - /* friend std::ostream& operator << <> (std::ostream&, \ - const NAME##_cus_value_list&); */\ - public:\ - const NAME *obj;\ - std::vector *include;\ - bool del_vector;\ - cchar *delem;\ - Manip manip;\ - public: \ - ~NAME##_cus_value_list () {if (del_vector) delete include;} \ - NAME##_cus_value_list (const NAME *o, cchar *d, Manip m, bool i1, bool i2, bool i3, bool i4);\ - NAME##_cus_value_list (const NAME *o, cchar *d, Manip m, NAME##_enum i1, NAME##_enum i2, NAME##_enum i3, NAME##_enum i4); \ - NAME##_cus_value_list (const NAME *o, cchar *d, Manip m ,std::vector* i)\ - : obj(o), include(i), del_vector(false), delem(d), manip(m) {}\ - };\ - template \ - class NAME##_cus_field_list { \ - /* friend std::ostream& operator << <> (std::ostream&, \ - const NAME##_cus_field_list&); */\ - public:\ - const NAME *obj; \ - std::vector *include; \ - bool del_vector; \ - cchar *delem;\ - Manip manip;\ - public: \ - ~NAME##_cus_field_list () {if (del_vector) delete include;} \ - NAME##_cus_field_list (const NAME *o, cchar *d, Manip m, bool i1, bool i2, bool i3, bool i4); \ - NAME##_cus_field_list (const NAME *o, cchar *d, Manip m, NAME##_enum i1, NAME##_enum i2, NAME##_enum i3, NAME##_enum i4); \ - NAME##_cus_field_list (const NAME *o, cchar *d, Manip m, std::vector *i) \ - : obj(o), include(i), del_vector(false), delem(d), manip(m) {}\ - };\ - template \ - class NAME##_cus_equal_list {\ - /* friend std::ostream& operator << <> (std::ostream&, \ - const NAME##_cus_equal_list&); */\ - public:\ - const NAME *obj;\ - std::vector *include;\ - bool del_vector;\ - cchar *delem;\ - cchar *comp;\ - Manip manip;\ - public:\ - ~NAME##_##cus_equal_list () {if (del_vector) delete include;}\ - NAME##_##cus_equal_list (const NAME *o, cchar *d, cchar *c, Manip m, bool i1, bool i2, bool i3, bool i4); \ - NAME##_##cus_equal_list (const NAME *o, cchar *d, cchar *c, Manip m, NAME##_enum i1, NAME##_enum i2, NAME##_enum i3, NAME##_enum i4); \ - NAME##_##cus_equal_list (const NAME *o, cchar *d, cchar *c, Manip m, std::vector *i) \ - : obj(o), include(i), del_vector(false), delem(d), comp(c), manip(m) {}\ - };\ - template int sql_compare_##NAME (const NAME &, const NAME &);\ - struct NAME { \ - T1 I1;\ - T2 I2;\ - T3 I3;\ - T4 I4; \ - NAME () {} \ - NAME (const Row &row);\ - void set (const Row &row);\ - sql_compare_define_##CMP(NAME, T1, I1, T2, I2, T3, I3, T4, I4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0)\ - sql_construct_define_##CONTR(NAME, T1, I1, T2, I2, T3, I3, T4, I4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0)\ - static const char *names[];\ - static const char *_table;\ - static const char *& table() {return _table;}\ - NAME##_value_list value_list() const {\ - return value_list(",", quote);}\ - NAME##_value_list value_list(cchar *d) const {\ - return value_list(d, quote);}\ - template \ - NAME##_value_list value_list(cchar *d, Manip m) const; \ - NAME##_field_list field_list() const {\ - return field_list(",", do_nothing);}\ - NAME##_field_list field_list(cchar *d) const {\ - return field_list(d, do_nothing);}\ - template \ - NAME##_field_list field_list(cchar *d, Manip m) const; \ - NAME##_equal_list equal_list(cchar *d = ",", \ - cchar *c = " = ") const{\ - return equal_list(d, c, quote);}\ - template \ - NAME##_equal_list equal_list(cchar *d, cchar *c, Manip m) const; \ - /* cus_data */\ - NAME##_cus_value_list value_list(bool i1, bool i2 = false, bool i3 = false, bool i4 = false) const {\ - return value_list(",", quote, i1, i2, i3, i4);\ - }\ - NAME##_cus_value_list value_list(NAME##_enum i1, NAME##_enum i2 = NAME##_NULL, NAME##_enum i3 = NAME##_NULL, NAME##_enum i4 = NAME##_NULL) const {\ - return value_list(",", quote, i1, i2, i3, i4);\ - }\ - NAME##_cus_value_list value_list(std::vector *i) const {\ - return value_list(",", quote, i);\ - }\ - NAME##_cus_value_list value_list(sql_cmp_type sc) const {\ - return value_list(",", quote, sc);\ - }\ - NAME##_cus_value_list value_list(cchar *d, bool i1, bool i2 = false, bool i3 = false, bool i4 = false) const {\ - return value_list(d, quote, i1, i2, i3, i4);\ - }\ - NAME##_cus_value_list value_list(cchar *d, NAME##_enum i1, NAME##_enum i2 = NAME##_NULL, NAME##_enum i3 = NAME##_NULL, NAME##_enum i4 = NAME##_NULL) const {\ - return value_list(d, quote, i1, i2, i3, i4);\ - }\ - NAME##_cus_value_list value_list(cchar *d, \ - std::vector *i) const {\ - return value_list(d, quote, i);\ - }\ - NAME##_cus_value_list value_list(cchar *d, \ - sql_cmp_type sc) const {\ - return value_list(d, quote, sc);\ - }\ - template \ - NAME##_cus_value_list value_list(cchar *d, Manip m,\ - bool i1, bool i2 = false, bool i3 = false, bool i4 = false) const; \ - template \ - NAME##_cus_value_list value_list(cchar *d, Manip m,\ - NAME##_enum i1, NAME##_enum i2 = NAME##_NULL, NAME##_enum i3 = NAME##_NULL, NAME##_enum i4 = NAME##_NULL) const; \ - template \ - NAME##_cus_value_list value_list(cchar *d, Manip m, \ - std::vector *i) const;\ - template \ - NAME##_cus_value_list value_list(cchar *d, Manip m, \ - sql_cmp_type sc) const;\ - /* cus field */\ - NAME##_cus_field_list field_list(bool i1, bool i2 = false, bool i3 = false, bool i4 = false) const {\ - return field_list(",", do_nothing, i1, i2, i3, i4);\ - }\ - NAME##_cus_field_list field_list(NAME##_enum i1, NAME##_enum i2 = NAME##_NULL, NAME##_enum i3 = NAME##_NULL, NAME##_enum i4 = NAME##_NULL) const {\ - return field_list(",", do_nothing, i1, i2, i3, i4);\ - }\ - NAME##_cus_field_list field_list(std::vector *i) const {\ - return field_list(",", do_nothing, i);\ - }\ - NAME##_cus_field_list field_list(sql_cmp_type sc) const\ - {\ - return field_list(",", do_nothing, sc);\ - }\ - NAME##_cus_field_list field_list(cchar *d, \ - bool i1, bool i2 = false, bool i3 = false, bool i4 = false) const {\ - return field_list(d, do_nothing, i1, i2, i3, i4);\ - }\ - NAME##_cus_field_list field_list(cchar *d,\ - NAME##_enum i1, NAME##_enum i2 = NAME##_NULL, NAME##_enum i3 = NAME##_NULL, NAME##_enum i4 = NAME##_NULL) const {\ - return field_list(d, do_nothing, i1, i2, i3, i4);\ - }\ - NAME##_cus_field_list field_list(cchar *d, \ - std::vector *i) const {\ - return field_list(d, do_nothing, i);\ - }\ - NAME##_cus_field_list field_list(cchar *d, \ - sql_cmp_type sc) const {\ - return field_list(d, do_nothing, sc);\ - }\ - template \ - NAME##_cus_field_list field_list(cchar *d, Manip m,\ - bool i1, bool i2 = false, bool i3 = false, bool i4 = false) const; \ - template \ - NAME##_cus_field_list field_list(cchar *d, Manip m,\ - NAME##_enum i1, NAME##_enum i2 = NAME##_NULL, NAME##_enum i3 = NAME##_NULL, NAME##_enum i4 = NAME##_NULL) const; \ - template \ - NAME##_cus_field_list field_list(cchar *d, Manip m,\ - std::vector *i) const;\ - template \ - NAME##_cus_field_list field_list(cchar *d, Manip m, \ - sql_cmp_type sc) const;\ - /* cus equal */\ - NAME##_cus_equal_list equal_list(bool i1, bool i2 = false, bool i3 = false, bool i4 = false) const {\ - return equal_list(",", " = ", quote, i1, i2, i3, i4);\ - }\ - NAME##_cus_equal_list equal_list(NAME##_enum i1, NAME##_enum i2 = NAME##_NULL, NAME##_enum i3 = NAME##_NULL, NAME##_enum i4 = NAME##_NULL) const {\ - return equal_list(",", " = ", quote, i1, i2, i3, i4);\ - }\ - NAME##_cus_equal_list equal_list(std::vector *i) const {\ - return equal_list(",", " = ", quote, i);\ - }\ - NAME##_cus_equal_list equal_list(sql_cmp_type sc) const {\ - return equal_list(",", " = ", quote, sc);\ - }\ - NAME##_cus_equal_list equal_list(cchar *d, bool i1, bool i2 = false, bool i3 = false, bool i4 = false) const {\ - return equal_list(d, " = ", quote, i1, i2, i3, i4);\ - }\ - NAME##_cus_equal_list equal_list(cchar *d, NAME##_enum i1, NAME##_enum i2 = NAME##_NULL, NAME##_enum i3 = NAME##_NULL, NAME##_enum i4 = NAME##_NULL) const {\ - return equal_list(d, " = ", quote, i1, i2, i3, i4);\ - }\ - NAME##_cus_equal_list equal_list(cchar *d, \ - std::vector *i) const {\ - return equal_list(d, " = ", quote, i);\ - }\ - NAME##_cus_equal_list equal_list(cchar *d, \ - sql_cmp_type sc) const {\ - return equal_list(d, " = ", quote, sc);\ - }\ - NAME##_cus_equal_list equal_list(cchar *d, cchar *c,\ - bool i1, bool i2 = false, bool i3 = false, bool i4 = false) const {\ - return equal_list(d, c, quote, i1, i2, i3, i4);\ - }\ - NAME##_cus_equal_list equal_list(cchar *d, cchar *c,\ - NAME##_enum i1, NAME##_enum i2 = NAME##_NULL, NAME##_enum i3 = NAME##_NULL, NAME##_enum i4 = NAME##_NULL) const {\ - return equal_list(d, c, quote, i1, i2, i3, i4);\ - }\ - NAME##_cus_equal_list equal_list(cchar *d, cchar *c,\ - std::vector *i) const {\ - return equal_list(d, c, quote, i);\ - }\ - NAME##_cus_equal_list equal_list(cchar *d, cchar *c,\ - sql_cmp_type sc) const {\ - return equal_list(d, c, quote, sc);\ - }\ - template \ - NAME##_cus_equal_list equal_list(cchar *d, cchar *c, Manip m, \ - bool i1, bool i2 = false, bool i3 = false, bool i4 = false) const; \ - template \ - NAME##_cus_equal_list equal_list(cchar *d, cchar *c, Manip m, \ - NAME##_enum i1, NAME##_enum i2 = NAME##_NULL, NAME##_enum i3 = NAME##_NULL, NAME##_enum i4 = NAME##_NULL) const; \ - template \ - NAME##_cus_equal_list equal_list(cchar *d, cchar *c, Manip m, \ - std::vector *i) const;\ - template \ - NAME##_cus_equal_list equal_list(cchar *d, cchar *c, Manip m, \ - sql_cmp_type sc) const;\ - }; \ - const char *NAME::names[] = { \ - N1 ,\ - N2 ,\ - N3 ,\ - N4 \ - }; \ - const char *NAME::_table = #NAME ; \ - template \ - NAME##_cus_value_list::NAME##_cus_value_list\ - (const NAME *o, cchar *d, Manip m, bool i1, bool i2, bool i3, bool i4) \ - { \ - delem = d;\ - manip = m;\ - del_vector = true;\ - obj = o; \ - include = new std::vector(4, false);\ - if (i1) (*include)[0]=true;\ - if (i2) (*include)[1]=true;\ - if (i3) (*include)[2]=true;\ - if (i4) (*include)[3]=true;\ - } \ - template \ - NAME##_cus_value_list::NAME##_cus_value_list\ - (const NAME *o, cchar *d, Manip m, NAME##_enum i1, NAME##_enum i2, NAME##_enum i3, NAME##_enum i4) { \ - delem = d;\ - manip = m;\ - del_vector = true; \ - obj = o; \ - include = new std::vector(4, false); \ - if (i1 == NAME##_NULL) return;\ - (*include)[i1]=true;\ - if (i2 == NAME##_NULL) return;\ - (*include)[i2]=true;\ - if (i3 == NAME##_NULL) return;\ - (*include)[i3]=true;\ - if (i4 == NAME##_NULL) return;\ - (*include)[i4]=true;\ - }\ - template \ - NAME##_cus_field_list::NAME##_cus_field_list\ - (const NAME *o, cchar *d, Manip m, bool i1, bool i2, bool i3, bool i4) {\ - delem = d;\ - manip = m;\ - del_vector = true; \ - obj = o; \ - include = new std::vector(4, false); \ - if (i1) (*include)[0]=true;\ - if (i2) (*include)[1]=true;\ - if (i3) (*include)[2]=true;\ - if (i4) (*include)[3]=true;\ - } \ - template \ - NAME##_cus_field_list::NAME##_cus_field_list\ - (const NAME *o, cchar *d, Manip m, NAME##_enum i1, NAME##_enum i2, NAME##_enum i3, NAME##_enum i4) { \ - delem = d;\ - manip = m;\ - del_vector = true; \ - obj = o; \ - include = new std::vector(4, false); \ - if (i1 == NAME##_NULL) return;\ - (*include)[i1]=true;\ - if (i2 == NAME##_NULL) return;\ - (*include)[i2]=true;\ - if (i3 == NAME##_NULL) return;\ - (*include)[i3]=true;\ - if (i4 == NAME##_NULL) return;\ - (*include)[i4]=true;\ - }\ - template \ - NAME##_cus_equal_list::NAME##_cus_equal_list\ - (const NAME *o, cchar *d, cchar *c, Manip m, bool i1, bool i2, bool i3, bool i4) { \ - delem = d;\ - comp = c;\ - manip = m;\ - del_vector = true; \ - obj = o; \ - include = new std::vector(4, false); \ - if (i1) (*include)[0]=true;\ - if (i2) (*include)[1]=true;\ - if (i3) (*include)[2]=true;\ - if (i4) (*include)[3]=true;\ - } \ - template \ - NAME##_cus_equal_list::NAME##_cus_equal_list\ - (const NAME *o, cchar *d, cchar *c, Manip m, NAME##_enum i1, NAME##_enum i2, NAME##_enum i3, NAME##_enum i4) { \ - delem = d;\ - comp = c;\ - manip = m;\ - del_vector = true; \ - obj = o; \ - include = new std::vector(4, false); \ - if (i1 == NAME##_NULL) return;\ - (*include)[i1]=true;\ - if (i2 == NAME##_NULL) return;\ - (*include)[i2]=true;\ - if (i3 == NAME##_NULL) return;\ - (*include)[i3]=true;\ - if (i4 == NAME##_NULL) return;\ - (*include)[i4]=true;\ - }\ - template \ - std::ostream& operator << (std::ostream& s, const NAME##_value_list& obj) { \ - s << obj.manip << obj.obj->I1 << obj.delem;\ - s << obj.manip << obj.obj->I2 << obj.delem;\ - s << obj.manip << obj.obj->I3 << obj.delem;\ - s << obj.manip << obj.obj->I4; \ - return s; \ - } \ - template \ - std::ostream& operator << (std::ostream& s, const NAME##_field_list& obj) { \ - s << obj.manip << obj.obj->names[0] << obj.delem;\ - s << obj.manip << obj.obj->names[1] << obj.delem;\ - s << obj.manip << obj.obj->names[2] << obj.delem;\ - s << obj.manip << obj.obj->names[3]; \ - return s; \ - } \ - template \ - std::ostream& operator << (std::ostream& s, const NAME##_equal_list& obj) { \ - s << obj.obj->names[0] << obj.comp << obj.manip << obj.obj->I1 << obj.delem;\ - s << obj.obj->names[1] << obj.comp << obj.manip << obj.obj->I2 << obj.delem;\ - s << obj.obj->names[2] << obj.comp << obj.manip << obj.obj->I3 << obj.delem;\ - s << obj.obj->names[3] << obj.comp << obj.manip << obj.obj->I4; \ - return s; \ - } \ - template \ - std::ostream& operator << (std::ostream& s, const NAME##_cus_value_list& obj) { \ - bool before = false; \ - if ((*obj.include)[0]) { \ - s << obj.manip << obj.obj->I1;\ - before = true; \ - } \ - if ((*obj.include)[1]) { \ - if (before) s << obj.delem;\ - s << obj.manip << obj.obj->I2;\ - before = true; \ - } \ - if ((*obj.include)[2]) { \ - if (before) s << obj.delem;\ - s << obj.manip << obj.obj->I3;\ - before = true; \ - } \ - if ((*obj.include)[3]) { \ - if (before) s << obj.delem;\ - s << obj.manip << obj.obj->I4;\ - } \ - return s; \ - } \ - template \ - std::ostream& operator << (std::ostream& s, const NAME##_cus_field_list& obj) { \ - bool before = false; \ - if ((*obj.include)[0]) { \ - s << obj.manip << obj.obj->names[0];\ - before = true; \ - } \ - if ((*obj.include)[1]) { \ - if (before) s << obj.delem;\ - s << obj.manip << obj.obj->names[1];\ - before = true; \ - } \ - if ((*obj.include)[2]) { \ - if (before) s << obj.delem;\ - s << obj.manip << obj.obj->names[2];\ - before = true; \ - } \ - if ((*obj.include)[3]) { \ - if (before) s << obj.delem;\ - s << obj.manip << obj.obj->names[3];\ - } \ - return s; \ - } \ - template \ - std::ostream& operator << (std::ostream& s, const NAME##_cus_equal_list& obj) { \ - bool before = false; \ - if ((*obj.include)[0]) { \ - s << obj.obj->names[0] << obj.comp << obj.manip << obj.obj->I1;\ - before = true; \ - } \ - if ((*obj.include)[1]) { \ - if (before) s << obj.delem;\ - s << obj.obj->names[1] << obj.comp << obj.manip << obj.obj->I2;\ - before = true; \ - } \ - if ((*obj.include)[2]) { \ - if (before) s << obj.delem;\ - s << obj.obj->names[2] << obj.comp << obj.manip << obj.obj->I3;\ - before = true; \ - } \ - if ((*obj.include)[3]) { \ - if (before) s << obj.delem;\ - s << obj.obj->names[3] << obj.comp << obj.manip << obj.obj->I4;\ - } \ - return s; \ - } \ - template \ - inline NAME##_value_list NAME::value_list(cchar *d, Manip m) const { \ - return NAME##_value_list (this, d, m); \ - } \ - template \ - inline NAME##_field_list NAME::field_list(cchar *d, Manip m) const { \ - return NAME##_field_list (this, d, m); \ - } \ - template \ - inline NAME##_equal_list NAME::equal_list(cchar *d, cchar *c, Manip m) const { \ - return NAME##_equal_list (this, d, c, m); \ - } \ - template \ - inline NAME##_cus_value_list NAME::value_list(cchar *d, Manip m,\ - bool i1, bool i2, bool i3, bool i4) const {\ - return NAME##_cus_value_list (this, d, m, i1, i2, i3, i4); \ - } \ - template \ - inline NAME##_cus_field_list NAME::field_list(cchar *d, Manip m,\ - bool i1, bool i2, bool i3, bool i4) const { \ - return NAME##_cus_field_list (this, d, m, i1, i2, i3, i4); \ - } \ - template \ - inline NAME##_cus_equal_list NAME::equal_list(cchar *d, cchar *c, Manip m,\ - bool i1, bool i2, bool i3, bool i4) const { \ - return NAME##_cus_equal_list (this, d, c, m, i1, i2, i3, i4); \ - } \ - template \ - inline NAME##_cus_value_list NAME::value_list(cchar *d, Manip m,\ - NAME##_enum i1, NAME##_enum i2, NAME##_enum i3, NAME##_enum i4) const { \ - return NAME##_cus_value_list (this, d, m, i1, i2, i3, i4); \ - } \ - template \ - inline NAME##_cus_field_list NAME::field_list(cchar *d, Manip m,\ - NAME##_enum i1, NAME##_enum i2, NAME##_enum i3, NAME##_enum i4) const {\ - return NAME##_cus_field_list (this, d, m, i1, i2, i3, i4); \ - } \ - template \ - inline NAME##_cus_equal_list NAME::equal_list(cchar *d, cchar *c, Manip m, \ - NAME##_enum i1, NAME##_enum i2, NAME##_enum i3, NAME##_enum i4) const { \ - return NAME##_cus_equal_list (this, d, c, m, i1, i2, i3, i4); \ - } \ - template \ - inline NAME##_cus_value_list NAME::value_list(cchar *d, Manip m,\ - std::vector *i) const {\ - return NAME##_cus_value_list (this, d, m, i);\ - }\ - template \ - inline NAME##_cus_field_list NAME::field_list(cchar *d, Manip m,\ - std::vector *i) const {\ - return NAME##_cus_field_list (this, d, m, i);\ - }\ - template \ - inline NAME##_cus_equal_list NAME::equal_list(cchar *d, cchar *c, Manip m,\ - std::vector *i) const {\ - return NAME##_cus_equal_list (this, d, c, m, i);\ - }\ - template \ - inline NAME##_cus_value_list \ - NAME::value_list(cchar *d, Manip m, sql_cmp_type /*sc*/) const {\ - sql_compare_type_def_##CMP (NAME, value, NUM);\ - }\ - template \ - inline NAME##_cus_field_list \ - NAME::field_list(cchar *d, Manip m, sql_cmp_type /*sc*/) const {\ - sql_compare_type_def_##CMP (NAME, field, NUM);\ - }\ - template \ - inline NAME##_cus_equal_list \ - NAME::equal_list(cchar *d, cchar *c, Manip m, sql_cmp_type /*sc*/) const {\ - sql_compare_type_defe_##CMP (NAME, equal, NUM);\ - }\ - template \ - void populate_##NAME (NAME *s, const Row &row) { \ - s->I1 = static_cast(row.at(O1));\ - s->I2 = static_cast(row.at(O2));\ - s->I3 = static_cast(row.at(O3));\ - s->I4 = static_cast(row.at(O4));\ - } \ - inline NAME::NAME (const Row &row) \ - {populate_##NAME(this, row);}\ - inline void NAME::set (const Row &row)\ - {populate_##NAME(this, row);}\ - sql_COMPARE__##CMP(NAME, I1, I2, I3, I4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ) - -#define sql_create_basic_4(NAME, CMP, CONTR, T1, I1, T2, I2, T3, I3, T4, I4) \ - sql_create_basic_c_order_4(NAME, CMP, CONTR, T1, I1, 0, T2, I2, 1, T3, I3, 2, T4, I4, 3) - -#define sql_create_4(NAME, CMP, CONTR, T1, I1, T2, I2, T3, I3, T4, I4) \ - sql_create_complete_4(NAME, CMP, CONTR, T1, I1, #I1, 0, T2, I2, #I2, 1, T3, I3, #I3, 2, T4, I4, #I4, 3) \ - -#define sql_create_c_order_4(NAME, CMP, CONTR, T1, I1, O1, T2, I2, O2, T3, I3, O3, T4, I4, O4) \ - sql_create_complete_4(NAME, CMP, CONTR, T1, I1, #I1, O1, T2, I2, #I2, O2, T3, I3, #I3, O3, T4, I4, #I4, O4) - -#define sql_create_c_names_4(NAME, CMP, CONTR, T1, I1, N1, T2, I2, N2, T3, I3, N3, T4, I4, N4) \ - sql_create_complete_4(NAME, CMP, CONTR, T1, I1, N1, 0, T2, I2, N2, 1, T3, I3, N3, 2, T4, I4, N4, 3) - -// --------------------------------------------------- -// End Create 4 -// --------------------------------------------------- - -// --------------------------------------------------- -// Begin Create 5 -// --------------------------------------------------- -#define sql_create_basic_c_order_5(NAME, CMP, CONTR, T1, I1, O1, T2, I2, O2, T3, I3, O3, T4, I4, O4, T5, I5, O5)\ - struct NAME; \ - template int sql_compare_##NAME (const NAME &, const NAME &);\ - struct NAME { \ - T1 I1;\ - T2 I2;\ - T3 I3;\ - T4 I4;\ - T5 I5; \ - NAME () {} \ - NAME (const Row &row);\ - sql_compare_define_##CMP(NAME, T1, I1, T2, I2, T3, I3, T4, I4, T5, I5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0)\ - }; \ - template \ - void populate_##NAME (NAME *s, const Row &row) { \ - s->I1 = static_cast(row.at(O1));\ - s->I2 = static_cast(row.at(O2));\ - s->I3 = static_cast(row.at(O3));\ - s->I4 = static_cast(row.at(O4));\ - s->I5 = static_cast(row.at(O5)); \ - } \ - inline NAME::NAME (const Row &row) \ - {populate_##NAME(this, row);} \ - sql_COMPARE__##CMP(NAME, I1, I2, I3, I4, I5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ) - -#define sql_create_complete_5(NAME, CMP, CONTR, T1, I1, N1, O1, T2, I2, N2, O2, T3, I3, N3, O3, T4, I4, N4, O4, T5, I5, N5, O5) \ - struct NAME; \ - enum NAME##_enum { \ - NAME##_##I1,\ - NAME##_##I2,\ - NAME##_##I3,\ - NAME##_##I4,\ - NAME##_##I5 \ - ,NAME##_NULL \ - }; \ - template \ - class NAME##_value_list { \ - /*friend std::ostream& operator << <> (std::ostream&, const NAME##_value_list&); */\ - public: \ - const NAME *obj;\ - cchar *delem;\ - Manip manip;\ - public: \ - NAME##_value_list (const NAME *o, cchar *d, Manip m) \ - : obj(o), delem(d), manip(m) {} \ - };\ - template \ - class NAME##_##field_list {\ - /* friend std::ostream& operator << <> (std::ostream&, const NAME##_field_list&); */\ - public: \ - const NAME *obj; \ - cchar *delem;\ - Manip manip;\ - public: \ - NAME##_field_list (const NAME *o, cchar *d, Manip m) \ - : obj(o), delem(d), manip(m) {} \ - };\ - template \ - class NAME##_equal_list { \ - /* friend std::ostream& operator << <> (std::ostream&, const NAME##_equal_list&); */\ - public: \ - const NAME *obj;\ - cchar *delem;\ - cchar *comp;\ - Manip manip;\ - public: \ - NAME##_equal_list (const NAME *o, cchar *d, cchar *c, Manip m) \ - : obj(o), delem(d), comp(c), manip(m) {}\ - };\ - template \ - class NAME##_cus_value_list {\ - /* friend std::ostream& operator << <> (std::ostream&, \ - const NAME##_cus_value_list&); */\ - public:\ - const NAME *obj;\ - std::vector *include;\ - bool del_vector;\ - cchar *delem;\ - Manip manip;\ - public: \ - ~NAME##_cus_value_list () {if (del_vector) delete include;} \ - NAME##_cus_value_list (const NAME *o, cchar *d, Manip m, bool i1, bool i2, bool i3, bool i4, bool i5);\ - NAME##_cus_value_list (const NAME *o, cchar *d, Manip m, NAME##_enum i1, NAME##_enum i2, NAME##_enum i3, NAME##_enum i4, NAME##_enum i5); \ - NAME##_cus_value_list (const NAME *o, cchar *d, Manip m ,std::vector* i)\ - : obj(o), include(i), del_vector(false), delem(d), manip(m) {}\ - };\ - template \ - class NAME##_cus_field_list { \ - /* friend std::ostream& operator << <> (std::ostream&, \ - const NAME##_cus_field_list&); */\ - public:\ - const NAME *obj; \ - std::vector *include; \ - bool del_vector; \ - cchar *delem;\ - Manip manip;\ - public: \ - ~NAME##_cus_field_list () {if (del_vector) delete include;} \ - NAME##_cus_field_list (const NAME *o, cchar *d, Manip m, bool i1, bool i2, bool i3, bool i4, bool i5); \ - NAME##_cus_field_list (const NAME *o, cchar *d, Manip m, NAME##_enum i1, NAME##_enum i2, NAME##_enum i3, NAME##_enum i4, NAME##_enum i5); \ - NAME##_cus_field_list (const NAME *o, cchar *d, Manip m, std::vector *i) \ - : obj(o), include(i), del_vector(false), delem(d), manip(m) {}\ - };\ - template \ - class NAME##_cus_equal_list {\ - /* friend std::ostream& operator << <> (std::ostream&, \ - const NAME##_cus_equal_list&); */\ - public:\ - const NAME *obj;\ - std::vector *include;\ - bool del_vector;\ - cchar *delem;\ - cchar *comp;\ - Manip manip;\ - public:\ - ~NAME##_##cus_equal_list () {if (del_vector) delete include;}\ - NAME##_##cus_equal_list (const NAME *o, cchar *d, cchar *c, Manip m, bool i1, bool i2, bool i3, bool i4, bool i5); \ - NAME##_##cus_equal_list (const NAME *o, cchar *d, cchar *c, Manip m, NAME##_enum i1, NAME##_enum i2, NAME##_enum i3, NAME##_enum i4, NAME##_enum i5); \ - NAME##_##cus_equal_list (const NAME *o, cchar *d, cchar *c, Manip m, std::vector *i) \ - : obj(o), include(i), del_vector(false), delem(d), comp(c), manip(m) {}\ - };\ - template int sql_compare_##NAME (const NAME &, const NAME &);\ - struct NAME { \ - T1 I1;\ - T2 I2;\ - T3 I3;\ - T4 I4;\ - T5 I5; \ - NAME () {} \ - NAME (const Row &row);\ - void set (const Row &row);\ - sql_compare_define_##CMP(NAME, T1, I1, T2, I2, T3, I3, T4, I4, T5, I5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0)\ - sql_construct_define_##CONTR(NAME, T1, I1, T2, I2, T3, I3, T4, I4, T5, I5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0)\ - static const char *names[];\ - static const char *_table;\ - static const char *& table() {return _table;}\ - NAME##_value_list value_list() const {\ - return value_list(",", quote);}\ - NAME##_value_list value_list(cchar *d) const {\ - return value_list(d, quote);}\ - template \ - NAME##_value_list value_list(cchar *d, Manip m) const; \ - NAME##_field_list field_list() const {\ - return field_list(",", do_nothing);}\ - NAME##_field_list field_list(cchar *d) const {\ - return field_list(d, do_nothing);}\ - template \ - NAME##_field_list field_list(cchar *d, Manip m) const; \ - NAME##_equal_list equal_list(cchar *d = ",", \ - cchar *c = " = ") const{\ - return equal_list(d, c, quote);}\ - template \ - NAME##_equal_list equal_list(cchar *d, cchar *c, Manip m) const; \ - /* cus_data */\ - NAME##_cus_value_list value_list(bool i1, bool i2 = false, bool i3 = false, bool i4 = false, bool i5 = false) const {\ - return value_list(",", quote, i1, i2, i3, i4, i5);\ - }\ - NAME##_cus_value_list value_list(NAME##_enum i1, NAME##_enum i2 = NAME##_NULL, NAME##_enum i3 = NAME##_NULL, NAME##_enum i4 = NAME##_NULL, NAME##_enum i5 = NAME##_NULL) const {\ - return value_list(",", quote, i1, i2, i3, i4, i5);\ - }\ - NAME##_cus_value_list value_list(std::vector *i) const {\ - return value_list(",", quote, i);\ - }\ - NAME##_cus_value_list value_list(sql_cmp_type sc) const {\ - return value_list(",", quote, sc);\ - }\ - NAME##_cus_value_list value_list(cchar *d, bool i1, bool i2 = false, bool i3 = false, bool i4 = false, bool i5 = false) const {\ - return value_list(d, quote, i1, i2, i3, i4, i5);\ - }\ - NAME##_cus_value_list value_list(cchar *d, NAME##_enum i1, NAME##_enum i2 = NAME##_NULL, NAME##_enum i3 = NAME##_NULL, NAME##_enum i4 = NAME##_NULL, NAME##_enum i5 = NAME##_NULL) const {\ - return value_list(d, quote, i1, i2, i3, i4, i5);\ - }\ - NAME##_cus_value_list value_list(cchar *d, \ - std::vector *i) const {\ - return value_list(d, quote, i);\ - }\ - NAME##_cus_value_list value_list(cchar *d, \ - sql_cmp_type sc) const {\ - return value_list(d, quote, sc);\ - }\ - template \ - NAME##_cus_value_list value_list(cchar *d, Manip m,\ - bool i1, bool i2 = false, bool i3 = false, bool i4 = false, bool i5 = false) const; \ - template \ - NAME##_cus_value_list value_list(cchar *d, Manip m,\ - NAME##_enum i1, NAME##_enum i2 = NAME##_NULL, NAME##_enum i3 = NAME##_NULL, NAME##_enum i4 = NAME##_NULL, NAME##_enum i5 = NAME##_NULL) const; \ - template \ - NAME##_cus_value_list value_list(cchar *d, Manip m, \ - std::vector *i) const;\ - template \ - NAME##_cus_value_list value_list(cchar *d, Manip m, \ - sql_cmp_type sc) const;\ - /* cus field */\ - NAME##_cus_field_list field_list(bool i1, bool i2 = false, bool i3 = false, bool i4 = false, bool i5 = false) const {\ - return field_list(",", do_nothing, i1, i2, i3, i4, i5);\ - }\ - NAME##_cus_field_list field_list(NAME##_enum i1, NAME##_enum i2 = NAME##_NULL, NAME##_enum i3 = NAME##_NULL, NAME##_enum i4 = NAME##_NULL, NAME##_enum i5 = NAME##_NULL) const {\ - return field_list(",", do_nothing, i1, i2, i3, i4, i5);\ - }\ - NAME##_cus_field_list field_list(std::vector *i) const {\ - return field_list(",", do_nothing, i);\ - }\ - NAME##_cus_field_list field_list(sql_cmp_type sc) const\ - {\ - return field_list(",", do_nothing, sc);\ - }\ - NAME##_cus_field_list field_list(cchar *d, \ - bool i1, bool i2 = false, bool i3 = false, bool i4 = false, bool i5 = false) const {\ - return field_list(d, do_nothing, i1, i2, i3, i4, i5);\ - }\ - NAME##_cus_field_list field_list(cchar *d,\ - NAME##_enum i1, NAME##_enum i2 = NAME##_NULL, NAME##_enum i3 = NAME##_NULL, NAME##_enum i4 = NAME##_NULL, NAME##_enum i5 = NAME##_NULL) const {\ - return field_list(d, do_nothing, i1, i2, i3, i4, i5);\ - }\ - NAME##_cus_field_list field_list(cchar *d, \ - std::vector *i) const {\ - return field_list(d, do_nothing, i);\ - }\ - NAME##_cus_field_list field_list(cchar *d, \ - sql_cmp_type sc) const {\ - return field_list(d, do_nothing, sc);\ - }\ - template \ - NAME##_cus_field_list field_list(cchar *d, Manip m,\ - bool i1, bool i2 = false, bool i3 = false, bool i4 = false, bool i5 = false) const; \ - template \ - NAME##_cus_field_list field_list(cchar *d, Manip m,\ - NAME##_enum i1, NAME##_enum i2 = NAME##_NULL, NAME##_enum i3 = NAME##_NULL, NAME##_enum i4 = NAME##_NULL, NAME##_enum i5 = NAME##_NULL) const; \ - template \ - NAME##_cus_field_list field_list(cchar *d, Manip m,\ - std::vector *i) const;\ - template \ - NAME##_cus_field_list field_list(cchar *d, Manip m, \ - sql_cmp_type sc) const;\ - /* cus equal */\ - NAME##_cus_equal_list equal_list(bool i1, bool i2 = false, bool i3 = false, bool i4 = false, bool i5 = false) const {\ - return equal_list(",", " = ", quote, i1, i2, i3, i4, i5);\ - }\ - NAME##_cus_equal_list equal_list(NAME##_enum i1, NAME##_enum i2 = NAME##_NULL, NAME##_enum i3 = NAME##_NULL, NAME##_enum i4 = NAME##_NULL, NAME##_enum i5 = NAME##_NULL) const {\ - return equal_list(",", " = ", quote, i1, i2, i3, i4, i5);\ - }\ - NAME##_cus_equal_list equal_list(std::vector *i) const {\ - return equal_list(",", " = ", quote, i);\ - }\ - NAME##_cus_equal_list equal_list(sql_cmp_type sc) const {\ - return equal_list(",", " = ", quote, sc);\ - }\ - NAME##_cus_equal_list equal_list(cchar *d, bool i1, bool i2 = false, bool i3 = false, bool i4 = false, bool i5 = false) const {\ - return equal_list(d, " = ", quote, i1, i2, i3, i4, i5);\ - }\ - NAME##_cus_equal_list equal_list(cchar *d, NAME##_enum i1, NAME##_enum i2 = NAME##_NULL, NAME##_enum i3 = NAME##_NULL, NAME##_enum i4 = NAME##_NULL, NAME##_enum i5 = NAME##_NULL) const {\ - return equal_list(d, " = ", quote, i1, i2, i3, i4, i5);\ - }\ - NAME##_cus_equal_list equal_list(cchar *d, \ - std::vector *i) const {\ - return equal_list(d, " = ", quote, i);\ - }\ - NAME##_cus_equal_list equal_list(cchar *d, \ - sql_cmp_type sc) const {\ - return equal_list(d, " = ", quote, sc);\ - }\ - NAME##_cus_equal_list equal_list(cchar *d, cchar *c,\ - bool i1, bool i2 = false, bool i3 = false, bool i4 = false, bool i5 = false) const {\ - return equal_list(d, c, quote, i1, i2, i3, i4, i5);\ - }\ - NAME##_cus_equal_list equal_list(cchar *d, cchar *c,\ - NAME##_enum i1, NAME##_enum i2 = NAME##_NULL, NAME##_enum i3 = NAME##_NULL, NAME##_enum i4 = NAME##_NULL, NAME##_enum i5 = NAME##_NULL) const {\ - return equal_list(d, c, quote, i1, i2, i3, i4, i5);\ - }\ - NAME##_cus_equal_list equal_list(cchar *d, cchar *c,\ - std::vector *i) const {\ - return equal_list(d, c, quote, i);\ - }\ - NAME##_cus_equal_list equal_list(cchar *d, cchar *c,\ - sql_cmp_type sc) const {\ - return equal_list(d, c, quote, sc);\ - }\ - template \ - NAME##_cus_equal_list equal_list(cchar *d, cchar *c, Manip m, \ - bool i1, bool i2 = false, bool i3 = false, bool i4 = false, bool i5 = false) const; \ - template \ - NAME##_cus_equal_list equal_list(cchar *d, cchar *c, Manip m, \ - NAME##_enum i1, NAME##_enum i2 = NAME##_NULL, NAME##_enum i3 = NAME##_NULL, NAME##_enum i4 = NAME##_NULL, NAME##_enum i5 = NAME##_NULL) const; \ - template \ - NAME##_cus_equal_list equal_list(cchar *d, cchar *c, Manip m, \ - std::vector *i) const;\ - template \ - NAME##_cus_equal_list equal_list(cchar *d, cchar *c, Manip m, \ - sql_cmp_type sc) const;\ - }; \ - const char *NAME::names[] = { \ - N1 ,\ - N2 ,\ - N3 ,\ - N4 ,\ - N5 \ - }; \ - const char *NAME::_table = #NAME ; \ - template \ - NAME##_cus_value_list::NAME##_cus_value_list\ - (const NAME *o, cchar *d, Manip m, bool i1, bool i2, bool i3, bool i4, bool i5) \ - { \ - delem = d;\ - manip = m;\ - del_vector = true;\ - obj = o; \ - include = new std::vector(5, false);\ - if (i1) (*include)[0]=true;\ - if (i2) (*include)[1]=true;\ - if (i3) (*include)[2]=true;\ - if (i4) (*include)[3]=true;\ - if (i5) (*include)[4]=true;\ - } \ - template \ - NAME##_cus_value_list::NAME##_cus_value_list\ - (const NAME *o, cchar *d, Manip m, NAME##_enum i1, NAME##_enum i2, NAME##_enum i3, NAME##_enum i4, NAME##_enum i5) { \ - delem = d;\ - manip = m;\ - del_vector = true; \ - obj = o; \ - include = new std::vector(5, false); \ - if (i1 == NAME##_NULL) return;\ - (*include)[i1]=true;\ - if (i2 == NAME##_NULL) return;\ - (*include)[i2]=true;\ - if (i3 == NAME##_NULL) return;\ - (*include)[i3]=true;\ - if (i4 == NAME##_NULL) return;\ - (*include)[i4]=true;\ - if (i5 == NAME##_NULL) return;\ - (*include)[i5]=true;\ - }\ - template \ - NAME##_cus_field_list::NAME##_cus_field_list\ - (const NAME *o, cchar *d, Manip m, bool i1, bool i2, bool i3, bool i4, bool i5) {\ - delem = d;\ - manip = m;\ - del_vector = true; \ - obj = o; \ - include = new std::vector(5, false); \ - if (i1) (*include)[0]=true;\ - if (i2) (*include)[1]=true;\ - if (i3) (*include)[2]=true;\ - if (i4) (*include)[3]=true;\ - if (i5) (*include)[4]=true;\ - } \ - template \ - NAME##_cus_field_list::NAME##_cus_field_list\ - (const NAME *o, cchar *d, Manip m, NAME##_enum i1, NAME##_enum i2, NAME##_enum i3, NAME##_enum i4, NAME##_enum i5) { \ - delem = d;\ - manip = m;\ - del_vector = true; \ - obj = o; \ - include = new std::vector(5, false); \ - if (i1 == NAME##_NULL) return;\ - (*include)[i1]=true;\ - if (i2 == NAME##_NULL) return;\ - (*include)[i2]=true;\ - if (i3 == NAME##_NULL) return;\ - (*include)[i3]=true;\ - if (i4 == NAME##_NULL) return;\ - (*include)[i4]=true;\ - if (i5 == NAME##_NULL) return;\ - (*include)[i5]=true;\ - }\ - template \ - NAME##_cus_equal_list::NAME##_cus_equal_list\ - (const NAME *o, cchar *d, cchar *c, Manip m, bool i1, bool i2, bool i3, bool i4, bool i5) { \ - delem = d;\ - comp = c;\ - manip = m;\ - del_vector = true; \ - obj = o; \ - include = new std::vector(5, false); \ - if (i1) (*include)[0]=true;\ - if (i2) (*include)[1]=true;\ - if (i3) (*include)[2]=true;\ - if (i4) (*include)[3]=true;\ - if (i5) (*include)[4]=true;\ - } \ - template \ - NAME##_cus_equal_list::NAME##_cus_equal_list\ - (const NAME *o, cchar *d, cchar *c, Manip m, NAME##_enum i1, NAME##_enum i2, NAME##_enum i3, NAME##_enum i4, NAME##_enum i5) { \ - delem = d;\ - comp = c;\ - manip = m;\ - del_vector = true; \ - obj = o; \ - include = new std::vector(5, false); \ - if (i1 == NAME##_NULL) return;\ - (*include)[i1]=true;\ - if (i2 == NAME##_NULL) return;\ - (*include)[i2]=true;\ - if (i3 == NAME##_NULL) return;\ - (*include)[i3]=true;\ - if (i4 == NAME##_NULL) return;\ - (*include)[i4]=true;\ - if (i5 == NAME##_NULL) return;\ - (*include)[i5]=true;\ - }\ - template \ - std::ostream& operator << (std::ostream& s, const NAME##_value_list& obj) { \ - s << obj.manip << obj.obj->I1 << obj.delem;\ - s << obj.manip << obj.obj->I2 << obj.delem;\ - s << obj.manip << obj.obj->I3 << obj.delem;\ - s << obj.manip << obj.obj->I4 << obj.delem;\ - s << obj.manip << obj.obj->I5; \ - return s; \ - } \ - template \ - std::ostream& operator << (std::ostream& s, const NAME##_field_list& obj) { \ - s << obj.manip << obj.obj->names[0] << obj.delem;\ - s << obj.manip << obj.obj->names[1] << obj.delem;\ - s << obj.manip << obj.obj->names[2] << obj.delem;\ - s << obj.manip << obj.obj->names[3] << obj.delem;\ - s << obj.manip << obj.obj->names[4]; \ - return s; \ - } \ - template \ - std::ostream& operator << (std::ostream& s, const NAME##_equal_list& obj) { \ - s << obj.obj->names[0] << obj.comp << obj.manip << obj.obj->I1 << obj.delem;\ - s << obj.obj->names[1] << obj.comp << obj.manip << obj.obj->I2 << obj.delem;\ - s << obj.obj->names[2] << obj.comp << obj.manip << obj.obj->I3 << obj.delem;\ - s << obj.obj->names[3] << obj.comp << obj.manip << obj.obj->I4 << obj.delem;\ - s << obj.obj->names[4] << obj.comp << obj.manip << obj.obj->I5; \ - return s; \ - } \ - template \ - std::ostream& operator << (std::ostream& s, const NAME##_cus_value_list& obj) { \ - bool before = false; \ - if ((*obj.include)[0]) { \ - s << obj.manip << obj.obj->I1;\ - before = true; \ - } \ - if ((*obj.include)[1]) { \ - if (before) s << obj.delem;\ - s << obj.manip << obj.obj->I2;\ - before = true; \ - } \ - if ((*obj.include)[2]) { \ - if (before) s << obj.delem;\ - s << obj.manip << obj.obj->I3;\ - before = true; \ - } \ - if ((*obj.include)[3]) { \ - if (before) s << obj.delem;\ - s << obj.manip << obj.obj->I4;\ - before = true; \ - } \ - if ((*obj.include)[4]) { \ - if (before) s << obj.delem;\ - s << obj.manip << obj.obj->I5;\ - } \ - return s; \ - } \ - template \ - std::ostream& operator << (std::ostream& s, const NAME##_cus_field_list& obj) { \ - bool before = false; \ - if ((*obj.include)[0]) { \ - s << obj.manip << obj.obj->names[0];\ - before = true; \ - } \ - if ((*obj.include)[1]) { \ - if (before) s << obj.delem;\ - s << obj.manip << obj.obj->names[1];\ - before = true; \ - } \ - if ((*obj.include)[2]) { \ - if (before) s << obj.delem;\ - s << obj.manip << obj.obj->names[2];\ - before = true; \ - } \ - if ((*obj.include)[3]) { \ - if (before) s << obj.delem;\ - s << obj.manip << obj.obj->names[3];\ - before = true; \ - } \ - if ((*obj.include)[4]) { \ - if (before) s << obj.delem;\ - s << obj.manip << obj.obj->names[4];\ - } \ - return s; \ - } \ - template \ - std::ostream& operator << (std::ostream& s, const NAME##_cus_equal_list& obj) { \ - bool before = false; \ - if ((*obj.include)[0]) { \ - s << obj.obj->names[0] << obj.comp << obj.manip << obj.obj->I1;\ - before = true; \ - } \ - if ((*obj.include)[1]) { \ - if (before) s << obj.delem;\ - s << obj.obj->names[1] << obj.comp << obj.manip << obj.obj->I2;\ - before = true; \ - } \ - if ((*obj.include)[2]) { \ - if (before) s << obj.delem;\ - s << obj.obj->names[2] << obj.comp << obj.manip << obj.obj->I3;\ - before = true; \ - } \ - if ((*obj.include)[3]) { \ - if (before) s << obj.delem;\ - s << obj.obj->names[3] << obj.comp << obj.manip << obj.obj->I4;\ - before = true; \ - } \ - if ((*obj.include)[4]) { \ - if (before) s << obj.delem;\ - s << obj.obj->names[4] << obj.comp << obj.manip << obj.obj->I5;\ - } \ - return s; \ - } \ - template \ - inline NAME##_value_list NAME::value_list(cchar *d, Manip m) const { \ - return NAME##_value_list (this, d, m); \ - } \ - template \ - inline NAME##_field_list NAME::field_list(cchar *d, Manip m) const { \ - return NAME##_field_list (this, d, m); \ - } \ - template \ - inline NAME##_equal_list NAME::equal_list(cchar *d, cchar *c, Manip m) const { \ - return NAME##_equal_list (this, d, c, m); \ - } \ - template \ - inline NAME##_cus_value_list NAME::value_list(cchar *d, Manip m,\ - bool i1, bool i2, bool i3, bool i4, bool i5) const {\ - return NAME##_cus_value_list (this, d, m, i1, i2, i3, i4, i5); \ - } \ - template \ - inline NAME##_cus_field_list NAME::field_list(cchar *d, Manip m,\ - bool i1, bool i2, bool i3, bool i4, bool i5) const { \ - return NAME##_cus_field_list (this, d, m, i1, i2, i3, i4, i5); \ - } \ - template \ - inline NAME##_cus_equal_list NAME::equal_list(cchar *d, cchar *c, Manip m,\ - bool i1, bool i2, bool i3, bool i4, bool i5) const { \ - return NAME##_cus_equal_list (this, d, c, m, i1, i2, i3, i4, i5); \ - } \ - template \ - inline NAME##_cus_value_list NAME::value_list(cchar *d, Manip m,\ - NAME##_enum i1, NAME##_enum i2, NAME##_enum i3, NAME##_enum i4, NAME##_enum i5) const { \ - return NAME##_cus_value_list (this, d, m, i1, i2, i3, i4, i5); \ - } \ - template \ - inline NAME##_cus_field_list NAME::field_list(cchar *d, Manip m,\ - NAME##_enum i1, NAME##_enum i2, NAME##_enum i3, NAME##_enum i4, NAME##_enum i5) const {\ - return NAME##_cus_field_list (this, d, m, i1, i2, i3, i4, i5); \ - } \ - template \ - inline NAME##_cus_equal_list NAME::equal_list(cchar *d, cchar *c, Manip m, \ - NAME##_enum i1, NAME##_enum i2, NAME##_enum i3, NAME##_enum i4, NAME##_enum i5) const { \ - return NAME##_cus_equal_list (this, d, c, m, i1, i2, i3, i4, i5); \ - } \ - template \ - inline NAME##_cus_value_list NAME::value_list(cchar *d, Manip m,\ - std::vector *i) const {\ - return NAME##_cus_value_list (this, d, m, i);\ - }\ - template \ - inline NAME##_cus_field_list NAME::field_list(cchar *d, Manip m,\ - std::vector *i) const {\ - return NAME##_cus_field_list (this, d, m, i);\ - }\ - template \ - inline NAME##_cus_equal_list NAME::equal_list(cchar *d, cchar *c, Manip m,\ - std::vector *i) const {\ - return NAME##_cus_equal_list (this, d, c, m, i);\ - }\ - template \ - inline NAME##_cus_value_list \ - NAME::value_list(cchar *d, Manip m, sql_cmp_type /*sc*/) const {\ - sql_compare_type_def_##CMP (NAME, value, NUM);\ - }\ - template \ - inline NAME##_cus_field_list \ - NAME::field_list(cchar *d, Manip m, sql_cmp_type /*sc*/) const {\ - sql_compare_type_def_##CMP (NAME, field, NUM);\ - }\ - template \ - inline NAME##_cus_equal_list \ - NAME::equal_list(cchar *d, cchar *c, Manip m, sql_cmp_type /*sc*/) const {\ - sql_compare_type_defe_##CMP (NAME, equal, NUM);\ - }\ - template \ - void populate_##NAME (NAME *s, const Row &row) { \ - s->I1 = static_cast(row.at(O1));\ - s->I2 = static_cast(row.at(O2));\ - s->I3 = static_cast(row.at(O3));\ - s->I4 = static_cast(row.at(O4));\ - s->I5 = static_cast(row.at(O5));\ - } \ - inline NAME::NAME (const Row &row) \ - {populate_##NAME(this, row);}\ - inline void NAME::set (const Row &row)\ - {populate_##NAME(this, row);}\ - sql_COMPARE__##CMP(NAME, I1, I2, I3, I4, I5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ) - -#define sql_create_basic_5(NAME, CMP, CONTR, T1, I1, T2, I2, T3, I3, T4, I4, T5, I5) \ - sql_create_basic_c_order_5(NAME, CMP, CONTR, T1, I1, 0, T2, I2, 1, T3, I3, 2, T4, I4, 3, T5, I5, 4) - -#define sql_create_5(NAME, CMP, CONTR, T1, I1, T2, I2, T3, I3, T4, I4, T5, I5) \ - sql_create_complete_5(NAME, CMP, CONTR, T1, I1, #I1, 0, T2, I2, #I2, 1, T3, I3, #I3, 2, T4, I4, #I4, 3, T5, I5, #I5, 4) \ - -#define sql_create_c_order_5(NAME, CMP, CONTR, T1, I1, O1, T2, I2, O2, T3, I3, O3, T4, I4, O4, T5, I5, O5) \ - sql_create_complete_5(NAME, CMP, CONTR, T1, I1, #I1, O1, T2, I2, #I2, O2, T3, I3, #I3, O3, T4, I4, #I4, O4, T5, I5, #I5, O5) - -#define sql_create_c_names_5(NAME, CMP, CONTR, T1, I1, N1, T2, I2, N2, T3, I3, N3, T4, I4, N4, T5, I5, N5) \ - sql_create_complete_5(NAME, CMP, CONTR, T1, I1, N1, 0, T2, I2, N2, 1, T3, I3, N3, 2, T4, I4, N4, 3, T5, I5, N5, 4) - -// --------------------------------------------------- -// End Create 5 -// --------------------------------------------------- - -// --------------------------------------------------- -// Begin Create 6 -// --------------------------------------------------- -#define sql_create_basic_c_order_6(NAME, CMP, CONTR, T1, I1, O1, T2, I2, O2, T3, I3, O3, T4, I4, O4, T5, I5, O5, T6, I6, O6)\ - struct NAME; \ - template int sql_compare_##NAME (const NAME &, const NAME &);\ - struct NAME { \ - T1 I1;\ - T2 I2;\ - T3 I3;\ - T4 I4;\ - T5 I5;\ - T6 I6; \ - NAME () {} \ - NAME (const Row &row);\ - sql_compare_define_##CMP(NAME, T1, I1, T2, I2, T3, I3, T4, I4, T5, I5, T6, I6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0)\ - }; \ - template \ - void populate_##NAME (NAME *s, const Row &row) { \ - s->I1 = static_cast(row.at(O1));\ - s->I2 = static_cast(row.at(O2));\ - s->I3 = static_cast(row.at(O3));\ - s->I4 = static_cast(row.at(O4));\ - s->I5 = static_cast(row.at(O5));\ - s->I6 = static_cast(row.at(O6)); \ - } \ - inline NAME::NAME (const Row &row) \ - {populate_##NAME(this, row);} \ - sql_COMPARE__##CMP(NAME, I1, I2, I3, I4, I5, I6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ) - -#define sql_create_complete_6(NAME, CMP, CONTR, T1, I1, N1, O1, T2, I2, N2, O2, T3, I3, N3, O3, T4, I4, N4, O4, T5, I5, N5, O5, T6, I6, N6, O6) \ - struct NAME; \ - enum NAME##_enum { \ - NAME##_##I1,\ - NAME##_##I2,\ - NAME##_##I3,\ - NAME##_##I4,\ - NAME##_##I5,\ - NAME##_##I6 \ - ,NAME##_NULL \ - }; \ - template \ - class NAME##_value_list { \ - /*friend std::ostream& operator << <> (std::ostream&, const NAME##_value_list&); */\ - public: \ - const NAME *obj;\ - cchar *delem;\ - Manip manip;\ - public: \ - NAME##_value_list (const NAME *o, cchar *d, Manip m) \ - : obj(o), delem(d), manip(m) {} \ - };\ - template \ - class NAME##_##field_list {\ - /* friend std::ostream& operator << <> (std::ostream&, const NAME##_field_list&); */\ - public: \ - const NAME *obj; \ - cchar *delem;\ - Manip manip;\ - public: \ - NAME##_field_list (const NAME *o, cchar *d, Manip m) \ - : obj(o), delem(d), manip(m) {} \ - };\ - template \ - class NAME##_equal_list { \ - /* friend std::ostream& operator << <> (std::ostream&, const NAME##_equal_list&); */\ - public: \ - const NAME *obj;\ - cchar *delem;\ - cchar *comp;\ - Manip manip;\ - public: \ - NAME##_equal_list (const NAME *o, cchar *d, cchar *c, Manip m) \ - : obj(o), delem(d), comp(c), manip(m) {}\ - };\ - template \ - class NAME##_cus_value_list {\ - /* friend std::ostream& operator << <> (std::ostream&, \ - const NAME##_cus_value_list&); */\ - public:\ - const NAME *obj;\ - std::vector *include;\ - bool del_vector;\ - cchar *delem;\ - Manip manip;\ - public: \ - ~NAME##_cus_value_list () {if (del_vector) delete include;} \ - NAME##_cus_value_list (const NAME *o, cchar *d, Manip m, bool i1, bool i2, bool i3, bool i4, bool i5, bool i6);\ - NAME##_cus_value_list (const NAME *o, cchar *d, Manip m, NAME##_enum i1, NAME##_enum i2, NAME##_enum i3, NAME##_enum i4, NAME##_enum i5, NAME##_enum i6); \ - NAME##_cus_value_list (const NAME *o, cchar *d, Manip m ,std::vector* i)\ - : obj(o), include(i), del_vector(false), delem(d), manip(m) {}\ - };\ - template \ - class NAME##_cus_field_list { \ - /* friend std::ostream& operator << <> (std::ostream&, \ - const NAME##_cus_field_list&); */\ - public:\ - const NAME *obj; \ - std::vector *include; \ - bool del_vector; \ - cchar *delem;\ - Manip manip;\ - public: \ - ~NAME##_cus_field_list () {if (del_vector) delete include;} \ - NAME##_cus_field_list (const NAME *o, cchar *d, Manip m, bool i1, bool i2, bool i3, bool i4, bool i5, bool i6); \ - NAME##_cus_field_list (const NAME *o, cchar *d, Manip m, NAME##_enum i1, NAME##_enum i2, NAME##_enum i3, NAME##_enum i4, NAME##_enum i5, NAME##_enum i6); \ - NAME##_cus_field_list (const NAME *o, cchar *d, Manip m, std::vector *i) \ - : obj(o), include(i), del_vector(false), delem(d), manip(m) {}\ - };\ - template \ - class NAME##_cus_equal_list {\ - /* friend std::ostream& operator << <> (std::ostream&, \ - const NAME##_cus_equal_list&); */\ - public:\ - const NAME *obj;\ - std::vector *include;\ - bool del_vector;\ - cchar *delem;\ - cchar *comp;\ - Manip manip;\ - public:\ - ~NAME##_##cus_equal_list () {if (del_vector) delete include;}\ - NAME##_##cus_equal_list (const NAME *o, cchar *d, cchar *c, Manip m, bool i1, bool i2, bool i3, bool i4, bool i5, bool i6); \ - NAME##_##cus_equal_list (const NAME *o, cchar *d, cchar *c, Manip m, NAME##_enum i1, NAME##_enum i2, NAME##_enum i3, NAME##_enum i4, NAME##_enum i5, NAME##_enum i6); \ - NAME##_##cus_equal_list (const NAME *o, cchar *d, cchar *c, Manip m, std::vector *i) \ - : obj(o), include(i), del_vector(false), delem(d), comp(c), manip(m) {}\ - };\ - template int sql_compare_##NAME (const NAME &, const NAME &);\ - struct NAME { \ - T1 I1;\ - T2 I2;\ - T3 I3;\ - T4 I4;\ - T5 I5;\ - T6 I6; \ - NAME () {} \ - NAME (const Row &row);\ - void set (const Row &row);\ - sql_compare_define_##CMP(NAME, T1, I1, T2, I2, T3, I3, T4, I4, T5, I5, T6, I6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0)\ - sql_construct_define_##CONTR(NAME, T1, I1, T2, I2, T3, I3, T4, I4, T5, I5, T6, I6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0)\ - static const char *names[];\ - static const char *_table;\ - static const char *& table() {return _table;}\ - NAME##_value_list value_list() const {\ - return value_list(",", quote);}\ - NAME##_value_list value_list(cchar *d) const {\ - return value_list(d, quote);}\ - template \ - NAME##_value_list value_list(cchar *d, Manip m) const; \ - NAME##_field_list field_list() const {\ - return field_list(",", do_nothing);}\ - NAME##_field_list field_list(cchar *d) const {\ - return field_list(d, do_nothing);}\ - template \ - NAME##_field_list field_list(cchar *d, Manip m) const; \ - NAME##_equal_list equal_list(cchar *d = ",", \ - cchar *c = " = ") const{\ - return equal_list(d, c, quote);}\ - template \ - NAME##_equal_list equal_list(cchar *d, cchar *c, Manip m) const; \ - /* cus_data */\ - NAME##_cus_value_list value_list(bool i1, bool i2 = false, bool i3 = false, bool i4 = false, bool i5 = false, bool i6 = false) const {\ - return value_list(",", quote, i1, i2, i3, i4, i5, i6);\ - }\ - NAME##_cus_value_list value_list(NAME##_enum i1, NAME##_enum i2 = NAME##_NULL, NAME##_enum i3 = NAME##_NULL, NAME##_enum i4 = NAME##_NULL, NAME##_enum i5 = NAME##_NULL, NAME##_enum i6 = NAME##_NULL) const {\ - return value_list(",", quote, i1, i2, i3, i4, i5, i6);\ - }\ - NAME##_cus_value_list value_list(std::vector *i) const {\ - return value_list(",", quote, i);\ - }\ - NAME##_cus_value_list value_list(sql_cmp_type sc) const {\ - return value_list(",", quote, sc);\ - }\ - NAME##_cus_value_list value_list(cchar *d, bool i1, bool i2 = false, bool i3 = false, bool i4 = false, bool i5 = false, bool i6 = false) const {\ - return value_list(d, quote, i1, i2, i3, i4, i5, i6);\ - }\ - NAME##_cus_value_list value_list(cchar *d, NAME##_enum i1, NAME##_enum i2 = NAME##_NULL, NAME##_enum i3 = NAME##_NULL, NAME##_enum i4 = NAME##_NULL, NAME##_enum i5 = NAME##_NULL, NAME##_enum i6 = NAME##_NULL) const {\ - return value_list(d, quote, i1, i2, i3, i4, i5, i6);\ - }\ - NAME##_cus_value_list value_list(cchar *d, \ - std::vector *i) const {\ - return value_list(d, quote, i);\ - }\ - NAME##_cus_value_list value_list(cchar *d, \ - sql_cmp_type sc) const {\ - return value_list(d, quote, sc);\ - }\ - template \ - NAME##_cus_value_list value_list(cchar *d, Manip m,\ - bool i1, bool i2 = false, bool i3 = false, bool i4 = false, bool i5 = false, bool i6 = false) const; \ - template \ - NAME##_cus_value_list value_list(cchar *d, Manip m,\ - NAME##_enum i1, NAME##_enum i2 = NAME##_NULL, NAME##_enum i3 = NAME##_NULL, NAME##_enum i4 = NAME##_NULL, NAME##_enum i5 = NAME##_NULL, NAME##_enum i6 = NAME##_NULL) const; \ - template \ - NAME##_cus_value_list value_list(cchar *d, Manip m, \ - std::vector *i) const;\ - template \ - NAME##_cus_value_list value_list(cchar *d, Manip m, \ - sql_cmp_type sc) const;\ - /* cus field */\ - NAME##_cus_field_list field_list(bool i1, bool i2 = false, bool i3 = false, bool i4 = false, bool i5 = false, bool i6 = false) const {\ - return field_list(",", do_nothing, i1, i2, i3, i4, i5, i6);\ - }\ - NAME##_cus_field_list field_list(NAME##_enum i1, NAME##_enum i2 = NAME##_NULL, NAME##_enum i3 = NAME##_NULL, NAME##_enum i4 = NAME##_NULL, NAME##_enum i5 = NAME##_NULL, NAME##_enum i6 = NAME##_NULL) const {\ - return field_list(",", do_nothing, i1, i2, i3, i4, i5, i6);\ - }\ - NAME##_cus_field_list field_list(std::vector *i) const {\ - return field_list(",", do_nothing, i);\ - }\ - NAME##_cus_field_list field_list(sql_cmp_type sc) const\ - {\ - return field_list(",", do_nothing, sc);\ - }\ - NAME##_cus_field_list field_list(cchar *d, \ - bool i1, bool i2 = false, bool i3 = false, bool i4 = false, bool i5 = false, bool i6 = false) const {\ - return field_list(d, do_nothing, i1, i2, i3, i4, i5, i6);\ - }\ - NAME##_cus_field_list field_list(cchar *d,\ - NAME##_enum i1, NAME##_enum i2 = NAME##_NULL, NAME##_enum i3 = NAME##_NULL, NAME##_enum i4 = NAME##_NULL, NAME##_enum i5 = NAME##_NULL, NAME##_enum i6 = NAME##_NULL) const {\ - return field_list(d, do_nothing, i1, i2, i3, i4, i5, i6);\ - }\ - NAME##_cus_field_list field_list(cchar *d, \ - std::vector *i) const {\ - return field_list(d, do_nothing, i);\ - }\ - NAME##_cus_field_list field_list(cchar *d, \ - sql_cmp_type sc) const {\ - return field_list(d, do_nothing, sc);\ - }\ - template \ - NAME##_cus_field_list field_list(cchar *d, Manip m,\ - bool i1, bool i2 = false, bool i3 = false, bool i4 = false, bool i5 = false, bool i6 = false) const; \ - template \ - NAME##_cus_field_list field_list(cchar *d, Manip m,\ - NAME##_enum i1, NAME##_enum i2 = NAME##_NULL, NAME##_enum i3 = NAME##_NULL, NAME##_enum i4 = NAME##_NULL, NAME##_enum i5 = NAME##_NULL, NAME##_enum i6 = NAME##_NULL) const; \ - template \ - NAME##_cus_field_list field_list(cchar *d, Manip m,\ - std::vector *i) const;\ - template \ - NAME##_cus_field_list field_list(cchar *d, Manip m, \ - sql_cmp_type sc) const;\ - /* cus equal */\ - NAME##_cus_equal_list equal_list(bool i1, bool i2 = false, bool i3 = false, bool i4 = false, bool i5 = false, bool i6 = false) const {\ - return equal_list(",", " = ", quote, i1, i2, i3, i4, i5, i6);\ - }\ - NAME##_cus_equal_list equal_list(NAME##_enum i1, NAME##_enum i2 = NAME##_NULL, NAME##_enum i3 = NAME##_NULL, NAME##_enum i4 = NAME##_NULL, NAME##_enum i5 = NAME##_NULL, NAME##_enum i6 = NAME##_NULL) const {\ - return equal_list(",", " = ", quote, i1, i2, i3, i4, i5, i6);\ - }\ - NAME##_cus_equal_list equal_list(std::vector *i) const {\ - return equal_list(",", " = ", quote, i);\ - }\ - NAME##_cus_equal_list equal_list(sql_cmp_type sc) const {\ - return equal_list(",", " = ", quote, sc);\ - }\ - NAME##_cus_equal_list equal_list(cchar *d, bool i1, bool i2 = false, bool i3 = false, bool i4 = false, bool i5 = false, bool i6 = false) const {\ - return equal_list(d, " = ", quote, i1, i2, i3, i4, i5, i6);\ - }\ - NAME##_cus_equal_list equal_list(cchar *d, NAME##_enum i1, NAME##_enum i2 = NAME##_NULL, NAME##_enum i3 = NAME##_NULL, NAME##_enum i4 = NAME##_NULL, NAME##_enum i5 = NAME##_NULL, NAME##_enum i6 = NAME##_NULL) const {\ - return equal_list(d, " = ", quote, i1, i2, i3, i4, i5, i6);\ - }\ - NAME##_cus_equal_list equal_list(cchar *d, \ - std::vector *i) const {\ - return equal_list(d, " = ", quote, i);\ - }\ - NAME##_cus_equal_list equal_list(cchar *d, \ - sql_cmp_type sc) const {\ - return equal_list(d, " = ", quote, sc);\ - }\ - NAME##_cus_equal_list equal_list(cchar *d, cchar *c,\ - bool i1, bool i2 = false, bool i3 = false, bool i4 = false, bool i5 = false, bool i6 = false) const {\ - return equal_list(d, c, quote, i1, i2, i3, i4, i5, i6);\ - }\ - NAME##_cus_equal_list equal_list(cchar *d, cchar *c,\ - NAME##_enum i1, NAME##_enum i2 = NAME##_NULL, NAME##_enum i3 = NAME##_NULL, NAME##_enum i4 = NAME##_NULL, NAME##_enum i5 = NAME##_NULL, NAME##_enum i6 = NAME##_NULL) const {\ - return equal_list(d, c, quote, i1, i2, i3, i4, i5, i6);\ - }\ - NAME##_cus_equal_list equal_list(cchar *d, cchar *c,\ - std::vector *i) const {\ - return equal_list(d, c, quote, i);\ - }\ - NAME##_cus_equal_list equal_list(cchar *d, cchar *c,\ - sql_cmp_type sc) const {\ - return equal_list(d, c, quote, sc);\ - }\ - template \ - NAME##_cus_equal_list equal_list(cchar *d, cchar *c, Manip m, \ - bool i1, bool i2 = false, bool i3 = false, bool i4 = false, bool i5 = false, bool i6 = false) const; \ - template \ - NAME##_cus_equal_list equal_list(cchar *d, cchar *c, Manip m, \ - NAME##_enum i1, NAME##_enum i2 = NAME##_NULL, NAME##_enum i3 = NAME##_NULL, NAME##_enum i4 = NAME##_NULL, NAME##_enum i5 = NAME##_NULL, NAME##_enum i6 = NAME##_NULL) const; \ - template \ - NAME##_cus_equal_list equal_list(cchar *d, cchar *c, Manip m, \ - std::vector *i) const;\ - template \ - NAME##_cus_equal_list equal_list(cchar *d, cchar *c, Manip m, \ - sql_cmp_type sc) const;\ - }; \ - const char *NAME::names[] = { \ - N1 ,\ - N2 ,\ - N3 ,\ - N4 ,\ - N5 ,\ - N6 \ - }; \ - const char *NAME::_table = #NAME ; \ - template \ - NAME##_cus_value_list::NAME##_cus_value_list\ - (const NAME *o, cchar *d, Manip m, bool i1, bool i2, bool i3, bool i4, bool i5, bool i6) \ - { \ - delem = d;\ - manip = m;\ - del_vector = true;\ - obj = o; \ - include = new std::vector(6, false);\ - if (i1) (*include)[0]=true;\ - if (i2) (*include)[1]=true;\ - if (i3) (*include)[2]=true;\ - if (i4) (*include)[3]=true;\ - if (i5) (*include)[4]=true;\ - if (i6) (*include)[5]=true;\ - } \ - template \ - NAME##_cus_value_list::NAME##_cus_value_list\ - (const NAME *o, cchar *d, Manip m, NAME##_enum i1, NAME##_enum i2, NAME##_enum i3, NAME##_enum i4, NAME##_enum i5, NAME##_enum i6) { \ - delem = d;\ - manip = m;\ - del_vector = true; \ - obj = o; \ - include = new std::vector(6, false); \ - if (i1 == NAME##_NULL) return;\ - (*include)[i1]=true;\ - if (i2 == NAME##_NULL) return;\ - (*include)[i2]=true;\ - if (i3 == NAME##_NULL) return;\ - (*include)[i3]=true;\ - if (i4 == NAME##_NULL) return;\ - (*include)[i4]=true;\ - if (i5 == NAME##_NULL) return;\ - (*include)[i5]=true;\ - if (i6 == NAME##_NULL) return;\ - (*include)[i6]=true;\ - }\ - template \ - NAME##_cus_field_list::NAME##_cus_field_list\ - (const NAME *o, cchar *d, Manip m, bool i1, bool i2, bool i3, bool i4, bool i5, bool i6) {\ - delem = d;\ - manip = m;\ - del_vector = true; \ - obj = o; \ - include = new std::vector(6, false); \ - if (i1) (*include)[0]=true;\ - if (i2) (*include)[1]=true;\ - if (i3) (*include)[2]=true;\ - if (i4) (*include)[3]=true;\ - if (i5) (*include)[4]=true;\ - if (i6) (*include)[5]=true;\ - } \ - template \ - NAME##_cus_field_list::NAME##_cus_field_list\ - (const NAME *o, cchar *d, Manip m, NAME##_enum i1, NAME##_enum i2, NAME##_enum i3, NAME##_enum i4, NAME##_enum i5, NAME##_enum i6) { \ - delem = d;\ - manip = m;\ - del_vector = true; \ - obj = o; \ - include = new std::vector(6, false); \ - if (i1 == NAME##_NULL) return;\ - (*include)[i1]=true;\ - if (i2 == NAME##_NULL) return;\ - (*include)[i2]=true;\ - if (i3 == NAME##_NULL) return;\ - (*include)[i3]=true;\ - if (i4 == NAME##_NULL) return;\ - (*include)[i4]=true;\ - if (i5 == NAME##_NULL) return;\ - (*include)[i5]=true;\ - if (i6 == NAME##_NULL) return;\ - (*include)[i6]=true;\ - }\ - template \ - NAME##_cus_equal_list::NAME##_cus_equal_list\ - (const NAME *o, cchar *d, cchar *c, Manip m, bool i1, bool i2, bool i3, bool i4, bool i5, bool i6) { \ - delem = d;\ - comp = c;\ - manip = m;\ - del_vector = true; \ - obj = o; \ - include = new std::vector(6, false); \ - if (i1) (*include)[0]=true;\ - if (i2) (*include)[1]=true;\ - if (i3) (*include)[2]=true;\ - if (i4) (*include)[3]=true;\ - if (i5) (*include)[4]=true;\ - if (i6) (*include)[5]=true;\ - } \ - template \ - NAME##_cus_equal_list::NAME##_cus_equal_list\ - (const NAME *o, cchar *d, cchar *c, Manip m, NAME##_enum i1, NAME##_enum i2, NAME##_enum i3, NAME##_enum i4, NAME##_enum i5, NAME##_enum i6) { \ - delem = d;\ - comp = c;\ - manip = m;\ - del_vector = true; \ - obj = o; \ - include = new std::vector(6, false); \ - if (i1 == NAME##_NULL) return;\ - (*include)[i1]=true;\ - if (i2 == NAME##_NULL) return;\ - (*include)[i2]=true;\ - if (i3 == NAME##_NULL) return;\ - (*include)[i3]=true;\ - if (i4 == NAME##_NULL) return;\ - (*include)[i4]=true;\ - if (i5 == NAME##_NULL) return;\ - (*include)[i5]=true;\ - if (i6 == NAME##_NULL) return;\ - (*include)[i6]=true;\ - }\ - template \ - std::ostream& operator << (std::ostream& s, const NAME##_value_list& obj) { \ - s << obj.manip << obj.obj->I1 << obj.delem;\ - s << obj.manip << obj.obj->I2 << obj.delem;\ - s << obj.manip << obj.obj->I3 << obj.delem;\ - s << obj.manip << obj.obj->I4 << obj.delem;\ - s << obj.manip << obj.obj->I5 << obj.delem;\ - s << obj.manip << obj.obj->I6; \ - return s; \ - } \ - template \ - std::ostream& operator << (std::ostream& s, const NAME##_field_list& obj) { \ - s << obj.manip << obj.obj->names[0] << obj.delem;\ - s << obj.manip << obj.obj->names[1] << obj.delem;\ - s << obj.manip << obj.obj->names[2] << obj.delem;\ - s << obj.manip << obj.obj->names[3] << obj.delem;\ - s << obj.manip << obj.obj->names[4] << obj.delem;\ - s << obj.manip << obj.obj->names[5]; \ - return s; \ - } \ - template \ - std::ostream& operator << (std::ostream& s, const NAME##_equal_list& obj) { \ - s << obj.obj->names[0] << obj.comp << obj.manip << obj.obj->I1 << obj.delem;\ - s << obj.obj->names[1] << obj.comp << obj.manip << obj.obj->I2 << obj.delem;\ - s << obj.obj->names[2] << obj.comp << obj.manip << obj.obj->I3 << obj.delem;\ - s << obj.obj->names[3] << obj.comp << obj.manip << obj.obj->I4 << obj.delem;\ - s << obj.obj->names[4] << obj.comp << obj.manip << obj.obj->I5 << obj.delem;\ - s << obj.obj->names[5] << obj.comp << obj.manip << obj.obj->I6; \ - return s; \ - } \ - template \ - std::ostream& operator << (std::ostream& s, const NAME##_cus_value_list& obj) { \ - bool before = false; \ - if ((*obj.include)[0]) { \ - s << obj.manip << obj.obj->I1;\ - before = true; \ - } \ - if ((*obj.include)[1]) { \ - if (before) s << obj.delem;\ - s << obj.manip << obj.obj->I2;\ - before = true; \ - } \ - if ((*obj.include)[2]) { \ - if (before) s << obj.delem;\ - s << obj.manip << obj.obj->I3;\ - before = true; \ - } \ - if ((*obj.include)[3]) { \ - if (before) s << obj.delem;\ - s << obj.manip << obj.obj->I4;\ - before = true; \ - } \ - if ((*obj.include)[4]) { \ - if (before) s << obj.delem;\ - s << obj.manip << obj.obj->I5;\ - before = true; \ - } \ - if ((*obj.include)[5]) { \ - if (before) s << obj.delem;\ - s << obj.manip << obj.obj->I6;\ - } \ - return s; \ - } \ - template \ - std::ostream& operator << (std::ostream& s, const NAME##_cus_field_list& obj) { \ - bool before = false; \ - if ((*obj.include)[0]) { \ - s << obj.manip << obj.obj->names[0];\ - before = true; \ - } \ - if ((*obj.include)[1]) { \ - if (before) s << obj.delem;\ - s << obj.manip << obj.obj->names[1];\ - before = true; \ - } \ - if ((*obj.include)[2]) { \ - if (before) s << obj.delem;\ - s << obj.manip << obj.obj->names[2];\ - before = true; \ - } \ - if ((*obj.include)[3]) { \ - if (before) s << obj.delem;\ - s << obj.manip << obj.obj->names[3];\ - before = true; \ - } \ - if ((*obj.include)[4]) { \ - if (before) s << obj.delem;\ - s << obj.manip << obj.obj->names[4];\ - before = true; \ - } \ - if ((*obj.include)[5]) { \ - if (before) s << obj.delem;\ - s << obj.manip << obj.obj->names[5];\ - } \ - return s; \ - } \ - template \ - std::ostream& operator << (std::ostream& s, const NAME##_cus_equal_list& obj) { \ - bool before = false; \ - if ((*obj.include)[0]) { \ - s << obj.obj->names[0] << obj.comp << obj.manip << obj.obj->I1;\ - before = true; \ - } \ - if ((*obj.include)[1]) { \ - if (before) s << obj.delem;\ - s << obj.obj->names[1] << obj.comp << obj.manip << obj.obj->I2;\ - before = true; \ - } \ - if ((*obj.include)[2]) { \ - if (before) s << obj.delem;\ - s << obj.obj->names[2] << obj.comp << obj.manip << obj.obj->I3;\ - before = true; \ - } \ - if ((*obj.include)[3]) { \ - if (before) s << obj.delem;\ - s << obj.obj->names[3] << obj.comp << obj.manip << obj.obj->I4;\ - before = true; \ - } \ - if ((*obj.include)[4]) { \ - if (before) s << obj.delem;\ - s << obj.obj->names[4] << obj.comp << obj.manip << obj.obj->I5;\ - before = true; \ - } \ - if ((*obj.include)[5]) { \ - if (before) s << obj.delem;\ - s << obj.obj->names[5] << obj.comp << obj.manip << obj.obj->I6;\ - } \ - return s; \ - } \ - template \ - inline NAME##_value_list NAME::value_list(cchar *d, Manip m) const { \ - return NAME##_value_list (this, d, m); \ - } \ - template \ - inline NAME##_field_list NAME::field_list(cchar *d, Manip m) const { \ - return NAME##_field_list (this, d, m); \ - } \ - template \ - inline NAME##_equal_list NAME::equal_list(cchar *d, cchar *c, Manip m) const { \ - return NAME##_equal_list (this, d, c, m); \ - } \ - template \ - inline NAME##_cus_value_list NAME::value_list(cchar *d, Manip m,\ - bool i1, bool i2, bool i3, bool i4, bool i5, bool i6) const {\ - return NAME##_cus_value_list (this, d, m, i1, i2, i3, i4, i5, i6); \ - } \ - template \ - inline NAME##_cus_field_list NAME::field_list(cchar *d, Manip m,\ - bool i1, bool i2, bool i3, bool i4, bool i5, bool i6) const { \ - return NAME##_cus_field_list (this, d, m, i1, i2, i3, i4, i5, i6); \ - } \ - template \ - inline NAME##_cus_equal_list NAME::equal_list(cchar *d, cchar *c, Manip m,\ - bool i1, bool i2, bool i3, bool i4, bool i5, bool i6) const { \ - return NAME##_cus_equal_list (this, d, c, m, i1, i2, i3, i4, i5, i6); \ - } \ - template \ - inline NAME##_cus_value_list NAME::value_list(cchar *d, Manip m,\ - NAME##_enum i1, NAME##_enum i2, NAME##_enum i3, NAME##_enum i4, NAME##_enum i5, NAME##_enum i6) const { \ - return NAME##_cus_value_list (this, d, m, i1, i2, i3, i4, i5, i6); \ - } \ - template \ - inline NAME##_cus_field_list NAME::field_list(cchar *d, Manip m,\ - NAME##_enum i1, NAME##_enum i2, NAME##_enum i3, NAME##_enum i4, NAME##_enum i5, NAME##_enum i6) const {\ - return NAME##_cus_field_list (this, d, m, i1, i2, i3, i4, i5, i6); \ - } \ - template \ - inline NAME##_cus_equal_list NAME::equal_list(cchar *d, cchar *c, Manip m, \ - NAME##_enum i1, NAME##_enum i2, NAME##_enum i3, NAME##_enum i4, NAME##_enum i5, NAME##_enum i6) const { \ - return NAME##_cus_equal_list (this, d, c, m, i1, i2, i3, i4, i5, i6); \ - } \ - template \ - inline NAME##_cus_value_list NAME::value_list(cchar *d, Manip m,\ - std::vector *i) const {\ - return NAME##_cus_value_list (this, d, m, i);\ - }\ - template \ - inline NAME##_cus_field_list NAME::field_list(cchar *d, Manip m,\ - std::vector *i) const {\ - return NAME##_cus_field_list (this, d, m, i);\ - }\ - template \ - inline NAME##_cus_equal_list NAME::equal_list(cchar *d, cchar *c, Manip m,\ - std::vector *i) const {\ - return NAME##_cus_equal_list (this, d, c, m, i);\ - }\ - template \ - inline NAME##_cus_value_list \ - NAME::value_list(cchar *d, Manip m, sql_cmp_type /*sc*/) const {\ - sql_compare_type_def_##CMP (NAME, value, NUM);\ - }\ - template \ - inline NAME##_cus_field_list \ - NAME::field_list(cchar *d, Manip m, sql_cmp_type /*sc*/) const {\ - sql_compare_type_def_##CMP (NAME, field, NUM);\ - }\ - template \ - inline NAME##_cus_equal_list \ - NAME::equal_list(cchar *d, cchar *c, Manip m, sql_cmp_type /*sc*/) const {\ - sql_compare_type_defe_##CMP (NAME, equal, NUM);\ - }\ - template \ - void populate_##NAME (NAME *s, const Row &row) { \ - s->I1 = static_cast(row.at(O1));\ - s->I2 = static_cast(row.at(O2));\ - s->I3 = static_cast(row.at(O3));\ - s->I4 = static_cast(row.at(O4));\ - s->I5 = static_cast(row.at(O5));\ - s->I6 = static_cast(row.at(O6));\ - } \ - inline NAME::NAME (const Row &row) \ - {populate_##NAME(this, row);}\ - inline void NAME::set (const Row &row)\ - {populate_##NAME(this, row);}\ - sql_COMPARE__##CMP(NAME, I1, I2, I3, I4, I5, I6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ) - -#define sql_create_basic_6(NAME, CMP, CONTR, T1, I1, T2, I2, T3, I3, T4, I4, T5, I5, T6, I6) \ - sql_create_basic_c_order_6(NAME, CMP, CONTR, T1, I1, 0, T2, I2, 1, T3, I3, 2, T4, I4, 3, T5, I5, 4, T6, I6, 5) - -#define sql_create_6(NAME, CMP, CONTR, T1, I1, T2, I2, T3, I3, T4, I4, T5, I5, T6, I6) \ - sql_create_complete_6(NAME, CMP, CONTR, T1, I1, #I1, 0, T2, I2, #I2, 1, T3, I3, #I3, 2, T4, I4, #I4, 3, T5, I5, #I5, 4, T6, I6, #I6, 5) \ - -#define sql_create_c_order_6(NAME, CMP, CONTR, T1, I1, O1, T2, I2, O2, T3, I3, O3, T4, I4, O4, T5, I5, O5, T6, I6, O6) \ - sql_create_complete_6(NAME, CMP, CONTR, T1, I1, #I1, O1, T2, I2, #I2, O2, T3, I3, #I3, O3, T4, I4, #I4, O4, T5, I5, #I5, O5, T6, I6, #I6, O6) - -#define sql_create_c_names_6(NAME, CMP, CONTR, T1, I1, N1, T2, I2, N2, T3, I3, N3, T4, I4, N4, T5, I5, N5, T6, I6, N6) \ - sql_create_complete_6(NAME, CMP, CONTR, T1, I1, N1, 0, T2, I2, N2, 1, T3, I3, N3, 2, T4, I4, N4, 3, T5, I5, N5, 4, T6, I6, N6, 5) - -// --------------------------------------------------- -// End Create 6 -// --------------------------------------------------- - -// --------------------------------------------------- -// Begin Create 7 -// --------------------------------------------------- -#define sql_create_basic_c_order_7(NAME, CMP, CONTR, T1, I1, O1, T2, I2, O2, T3, I3, O3, T4, I4, O4, T5, I5, O5, T6, I6, O6, T7, I7, O7)\ - struct NAME; \ - template int sql_compare_##NAME (const NAME &, const NAME &);\ - struct NAME { \ - T1 I1;\ - T2 I2;\ - T3 I3;\ - T4 I4;\ - T5 I5;\ - T6 I6;\ - T7 I7; \ - NAME () {} \ - NAME (const Row &row);\ - sql_compare_define_##CMP(NAME, T1, I1, T2, I2, T3, I3, T4, I4, T5, I5, T6, I6, T7, I7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0)\ - }; \ - template \ - void populate_##NAME (NAME *s, const Row &row) { \ - s->I1 = static_cast(row.at(O1));\ - s->I2 = static_cast(row.at(O2));\ - s->I3 = static_cast(row.at(O3));\ - s->I4 = static_cast(row.at(O4));\ - s->I5 = static_cast(row.at(O5));\ - s->I6 = static_cast(row.at(O6));\ - s->I7 = static_cast(row.at(O7)); \ - } \ - inline NAME::NAME (const Row &row) \ - {populate_##NAME(this, row);} \ - sql_COMPARE__##CMP(NAME, I1, I2, I3, I4, I5, I6, I7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ) - -#define sql_create_complete_7(NAME, CMP, CONTR, T1, I1, N1, O1, T2, I2, N2, O2, T3, I3, N3, O3, T4, I4, N4, O4, T5, I5, N5, O5, T6, I6, N6, O6, T7, I7, N7, O7) \ - struct NAME; \ - enum NAME##_enum { \ - NAME##_##I1,\ - NAME##_##I2,\ - NAME##_##I3,\ - NAME##_##I4,\ - NAME##_##I5,\ - NAME##_##I6,\ - NAME##_##I7 \ - ,NAME##_NULL \ - }; \ - template \ - class NAME##_value_list { \ - /*friend std::ostream& operator << <> (std::ostream&, const NAME##_value_list&); */\ - public: \ - const NAME *obj;\ - cchar *delem;\ - Manip manip;\ - public: \ - NAME##_value_list (const NAME *o, cchar *d, Manip m) \ - : obj(o), delem(d), manip(m) {} \ - };\ - template \ - class NAME##_##field_list {\ - /* friend std::ostream& operator << <> (std::ostream&, const NAME##_field_list&); */\ - public: \ - const NAME *obj; \ - cchar *delem;\ - Manip manip;\ - public: \ - NAME##_field_list (const NAME *o, cchar *d, Manip m) \ - : obj(o), delem(d), manip(m) {} \ - };\ - template \ - class NAME##_equal_list { \ - /* friend std::ostream& operator << <> (std::ostream&, const NAME##_equal_list&); */\ - public: \ - const NAME *obj;\ - cchar *delem;\ - cchar *comp;\ - Manip manip;\ - public: \ - NAME##_equal_list (const NAME *o, cchar *d, cchar *c, Manip m) \ - : obj(o), delem(d), comp(c), manip(m) {}\ - };\ - template \ - class NAME##_cus_value_list {\ - /* friend std::ostream& operator << <> (std::ostream&, \ - const NAME##_cus_value_list&); */\ - public:\ - const NAME *obj;\ - std::vector *include;\ - bool del_vector;\ - cchar *delem;\ - Manip manip;\ - public: \ - ~NAME##_cus_value_list () {if (del_vector) delete include;} \ - NAME##_cus_value_list (const NAME *o, cchar *d, Manip m, bool i1, bool i2, bool i3, bool i4, bool i5, bool i6, bool i7);\ - NAME##_cus_value_list (const NAME *o, cchar *d, Manip m, NAME##_enum i1, NAME##_enum i2, NAME##_enum i3, NAME##_enum i4, NAME##_enum i5, NAME##_enum i6, NAME##_enum i7); \ - NAME##_cus_value_list (const NAME *o, cchar *d, Manip m ,std::vector* i)\ - : obj(o), include(i), del_vector(false), delem(d), manip(m) {}\ - };\ - template \ - class NAME##_cus_field_list { \ - /* friend std::ostream& operator << <> (std::ostream&, \ - const NAME##_cus_field_list&); */\ - public:\ - const NAME *obj; \ - std::vector *include; \ - bool del_vector; \ - cchar *delem;\ - Manip manip;\ - public: \ - ~NAME##_cus_field_list () {if (del_vector) delete include;} \ - NAME##_cus_field_list (const NAME *o, cchar *d, Manip m, bool i1, bool i2, bool i3, bool i4, bool i5, bool i6, bool i7); \ - NAME##_cus_field_list (const NAME *o, cchar *d, Manip m, NAME##_enum i1, NAME##_enum i2, NAME##_enum i3, NAME##_enum i4, NAME##_enum i5, NAME##_enum i6, NAME##_enum i7); \ - NAME##_cus_field_list (const NAME *o, cchar *d, Manip m, std::vector *i) \ - : obj(o), include(i), del_vector(false), delem(d), manip(m) {}\ - };\ - template \ - class NAME##_cus_equal_list {\ - /* friend std::ostream& operator << <> (std::ostream&, \ - const NAME##_cus_equal_list&); */\ - public:\ - const NAME *obj;\ - std::vector *include;\ - bool del_vector;\ - cchar *delem;\ - cchar *comp;\ - Manip manip;\ - public:\ - ~NAME##_##cus_equal_list () {if (del_vector) delete include;}\ - NAME##_##cus_equal_list (const NAME *o, cchar *d, cchar *c, Manip m, bool i1, bool i2, bool i3, bool i4, bool i5, bool i6, bool i7); \ - NAME##_##cus_equal_list (const NAME *o, cchar *d, cchar *c, Manip m, NAME##_enum i1, NAME##_enum i2, NAME##_enum i3, NAME##_enum i4, NAME##_enum i5, NAME##_enum i6, NAME##_enum i7); \ - NAME##_##cus_equal_list (const NAME *o, cchar *d, cchar *c, Manip m, std::vector *i) \ - : obj(o), include(i), del_vector(false), delem(d), comp(c), manip(m) {}\ - };\ - template int sql_compare_##NAME (const NAME &, const NAME &);\ - struct NAME { \ - T1 I1;\ - T2 I2;\ - T3 I3;\ - T4 I4;\ - T5 I5;\ - T6 I6;\ - T7 I7; \ - NAME () {} \ - NAME (const Row &row);\ - void set (const Row &row);\ - sql_compare_define_##CMP(NAME, T1, I1, T2, I2, T3, I3, T4, I4, T5, I5, T6, I6, T7, I7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0)\ - sql_construct_define_##CONTR(NAME, T1, I1, T2, I2, T3, I3, T4, I4, T5, I5, T6, I6, T7, I7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0)\ - static const char *names[];\ - static const char *_table;\ - static const char *& table() {return _table;}\ - NAME##_value_list value_list() const {\ - return value_list(",", quote);}\ - NAME##_value_list value_list(cchar *d) const {\ - return value_list(d, quote);}\ - template \ - NAME##_value_list value_list(cchar *d, Manip m) const; \ - NAME##_field_list field_list() const {\ - return field_list(",", do_nothing);}\ - NAME##_field_list field_list(cchar *d) const {\ - return field_list(d, do_nothing);}\ - template \ - NAME##_field_list field_list(cchar *d, Manip m) const; \ - NAME##_equal_list equal_list(cchar *d = ",", \ - cchar *c = " = ") const{\ - return equal_list(d, c, quote);}\ - template \ - NAME##_equal_list equal_list(cchar *d, cchar *c, Manip m) const; \ - /* cus_data */\ - NAME##_cus_value_list value_list(bool i1, bool i2 = false, bool i3 = false, bool i4 = false, bool i5 = false, bool i6 = false, bool i7 = false) const {\ - return value_list(",", quote, i1, i2, i3, i4, i5, i6, i7);\ - }\ - NAME##_cus_value_list value_list(NAME##_enum i1, NAME##_enum i2 = NAME##_NULL, NAME##_enum i3 = NAME##_NULL, NAME##_enum i4 = NAME##_NULL, NAME##_enum i5 = NAME##_NULL, NAME##_enum i6 = NAME##_NULL, NAME##_enum i7 = NAME##_NULL) const {\ - return value_list(",", quote, i1, i2, i3, i4, i5, i6, i7);\ - }\ - NAME##_cus_value_list value_list(std::vector *i) const {\ - return value_list(",", quote, i);\ - }\ - NAME##_cus_value_list value_list(sql_cmp_type sc) const {\ - return value_list(",", quote, sc);\ - }\ - NAME##_cus_value_list value_list(cchar *d, bool i1, bool i2 = false, bool i3 = false, bool i4 = false, bool i5 = false, bool i6 = false, bool i7 = false) const {\ - return value_list(d, quote, i1, i2, i3, i4, i5, i6, i7);\ - }\ - NAME##_cus_value_list value_list(cchar *d, NAME##_enum i1, NAME##_enum i2 = NAME##_NULL, NAME##_enum i3 = NAME##_NULL, NAME##_enum i4 = NAME##_NULL, NAME##_enum i5 = NAME##_NULL, NAME##_enum i6 = NAME##_NULL, NAME##_enum i7 = NAME##_NULL) const {\ - return value_list(d, quote, i1, i2, i3, i4, i5, i6, i7);\ - }\ - NAME##_cus_value_list value_list(cchar *d, \ - std::vector *i) const {\ - return value_list(d, quote, i);\ - }\ - NAME##_cus_value_list value_list(cchar *d, \ - sql_cmp_type sc) const {\ - return value_list(d, quote, sc);\ - }\ - template \ - NAME##_cus_value_list value_list(cchar *d, Manip m,\ - bool i1, bool i2 = false, bool i3 = false, bool i4 = false, bool i5 = false, bool i6 = false, bool i7 = false) const; \ - template \ - NAME##_cus_value_list value_list(cchar *d, Manip m,\ - NAME##_enum i1, NAME##_enum i2 = NAME##_NULL, NAME##_enum i3 = NAME##_NULL, NAME##_enum i4 = NAME##_NULL, NAME##_enum i5 = NAME##_NULL, NAME##_enum i6 = NAME##_NULL, NAME##_enum i7 = NAME##_NULL) const; \ - template \ - NAME##_cus_value_list value_list(cchar *d, Manip m, \ - std::vector *i) const;\ - template \ - NAME##_cus_value_list value_list(cchar *d, Manip m, \ - sql_cmp_type sc) const;\ - /* cus field */\ - NAME##_cus_field_list field_list(bool i1, bool i2 = false, bool i3 = false, bool i4 = false, bool i5 = false, bool i6 = false, bool i7 = false) const {\ - return field_list(",", do_nothing, i1, i2, i3, i4, i5, i6, i7);\ - }\ - NAME##_cus_field_list field_list(NAME##_enum i1, NAME##_enum i2 = NAME##_NULL, NAME##_enum i3 = NAME##_NULL, NAME##_enum i4 = NAME##_NULL, NAME##_enum i5 = NAME##_NULL, NAME##_enum i6 = NAME##_NULL, NAME##_enum i7 = NAME##_NULL) const {\ - return field_list(",", do_nothing, i1, i2, i3, i4, i5, i6, i7);\ - }\ - NAME##_cus_field_list field_list(std::vector *i) const {\ - return field_list(",", do_nothing, i);\ - }\ - NAME##_cus_field_list field_list(sql_cmp_type sc) const\ - {\ - return field_list(",", do_nothing, sc);\ - }\ - NAME##_cus_field_list field_list(cchar *d, \ - bool i1, bool i2 = false, bool i3 = false, bool i4 = false, bool i5 = false, bool i6 = false, bool i7 = false) const {\ - return field_list(d, do_nothing, i1, i2, i3, i4, i5, i6, i7);\ - }\ - NAME##_cus_field_list field_list(cchar *d,\ - NAME##_enum i1, NAME##_enum i2 = NAME##_NULL, NAME##_enum i3 = NAME##_NULL, NAME##_enum i4 = NAME##_NULL, NAME##_enum i5 = NAME##_NULL, NAME##_enum i6 = NAME##_NULL, NAME##_enum i7 = NAME##_NULL) const {\ - return field_list(d, do_nothing, i1, i2, i3, i4, i5, i6, i7);\ - }\ - NAME##_cus_field_list field_list(cchar *d, \ - std::vector *i) const {\ - return field_list(d, do_nothing, i);\ - }\ - NAME##_cus_field_list field_list(cchar *d, \ - sql_cmp_type sc) const {\ - return field_list(d, do_nothing, sc);\ - }\ - template \ - NAME##_cus_field_list field_list(cchar *d, Manip m,\ - bool i1, bool i2 = false, bool i3 = false, bool i4 = false, bool i5 = false, bool i6 = false, bool i7 = false) const; \ - template \ - NAME##_cus_field_list field_list(cchar *d, Manip m,\ - NAME##_enum i1, NAME##_enum i2 = NAME##_NULL, NAME##_enum i3 = NAME##_NULL, NAME##_enum i4 = NAME##_NULL, NAME##_enum i5 = NAME##_NULL, NAME##_enum i6 = NAME##_NULL, NAME##_enum i7 = NAME##_NULL) const; \ - template \ - NAME##_cus_field_list field_list(cchar *d, Manip m,\ - std::vector *i) const;\ - template \ - NAME##_cus_field_list field_list(cchar *d, Manip m, \ - sql_cmp_type sc) const;\ - /* cus equal */\ - NAME##_cus_equal_list equal_list(bool i1, bool i2 = false, bool i3 = false, bool i4 = false, bool i5 = false, bool i6 = false, bool i7 = false) const {\ - return equal_list(",", " = ", quote, i1, i2, i3, i4, i5, i6, i7);\ - }\ - NAME##_cus_equal_list equal_list(NAME##_enum i1, NAME##_enum i2 = NAME##_NULL, NAME##_enum i3 = NAME##_NULL, NAME##_enum i4 = NAME##_NULL, NAME##_enum i5 = NAME##_NULL, NAME##_enum i6 = NAME##_NULL, NAME##_enum i7 = NAME##_NULL) const {\ - return equal_list(",", " = ", quote, i1, i2, i3, i4, i5, i6, i7);\ - }\ - NAME##_cus_equal_list equal_list(std::vector *i) const {\ - return equal_list(",", " = ", quote, i);\ - }\ - NAME##_cus_equal_list equal_list(sql_cmp_type sc) const {\ - return equal_list(",", " = ", quote, sc);\ - }\ - NAME##_cus_equal_list equal_list(cchar *d, bool i1, bool i2 = false, bool i3 = false, bool i4 = false, bool i5 = false, bool i6 = false, bool i7 = false) const {\ - return equal_list(d, " = ", quote, i1, i2, i3, i4, i5, i6, i7);\ - }\ - NAME##_cus_equal_list equal_list(cchar *d, NAME##_enum i1, NAME##_enum i2 = NAME##_NULL, NAME##_enum i3 = NAME##_NULL, NAME##_enum i4 = NAME##_NULL, NAME##_enum i5 = NAME##_NULL, NAME##_enum i6 = NAME##_NULL, NAME##_enum i7 = NAME##_NULL) const {\ - return equal_list(d, " = ", quote, i1, i2, i3, i4, i5, i6, i7);\ - }\ - NAME##_cus_equal_list equal_list(cchar *d, \ - std::vector *i) const {\ - return equal_list(d, " = ", quote, i);\ - }\ - NAME##_cus_equal_list equal_list(cchar *d, \ - sql_cmp_type sc) const {\ - return equal_list(d, " = ", quote, sc);\ - }\ - NAME##_cus_equal_list equal_list(cchar *d, cchar *c,\ - bool i1, bool i2 = false, bool i3 = false, bool i4 = false, bool i5 = false, bool i6 = false, bool i7 = false) const {\ - return equal_list(d, c, quote, i1, i2, i3, i4, i5, i6, i7);\ - }\ - NAME##_cus_equal_list equal_list(cchar *d, cchar *c,\ - NAME##_enum i1, NAME##_enum i2 = NAME##_NULL, NAME##_enum i3 = NAME##_NULL, NAME##_enum i4 = NAME##_NULL, NAME##_enum i5 = NAME##_NULL, NAME##_enum i6 = NAME##_NULL, NAME##_enum i7 = NAME##_NULL) const {\ - return equal_list(d, c, quote, i1, i2, i3, i4, i5, i6, i7);\ - }\ - NAME##_cus_equal_list equal_list(cchar *d, cchar *c,\ - std::vector *i) const {\ - return equal_list(d, c, quote, i);\ - }\ - NAME##_cus_equal_list equal_list(cchar *d, cchar *c,\ - sql_cmp_type sc) const {\ - return equal_list(d, c, quote, sc);\ - }\ - template \ - NAME##_cus_equal_list equal_list(cchar *d, cchar *c, Manip m, \ - bool i1, bool i2 = false, bool i3 = false, bool i4 = false, bool i5 = false, bool i6 = false, bool i7 = false) const; \ - template \ - NAME##_cus_equal_list equal_list(cchar *d, cchar *c, Manip m, \ - NAME##_enum i1, NAME##_enum i2 = NAME##_NULL, NAME##_enum i3 = NAME##_NULL, NAME##_enum i4 = NAME##_NULL, NAME##_enum i5 = NAME##_NULL, NAME##_enum i6 = NAME##_NULL, NAME##_enum i7 = NAME##_NULL) const; \ - template \ - NAME##_cus_equal_list equal_list(cchar *d, cchar *c, Manip m, \ - std::vector *i) const;\ - template \ - NAME##_cus_equal_list equal_list(cchar *d, cchar *c, Manip m, \ - sql_cmp_type sc) const;\ - }; \ - const char *NAME::names[] = { \ - N1 ,\ - N2 ,\ - N3 ,\ - N4 ,\ - N5 ,\ - N6 ,\ - N7 \ - }; \ - const char *NAME::_table = #NAME ; \ - template \ - NAME##_cus_value_list::NAME##_cus_value_list\ - (const NAME *o, cchar *d, Manip m, bool i1, bool i2, bool i3, bool i4, bool i5, bool i6, bool i7) \ - { \ - delem = d;\ - manip = m;\ - del_vector = true;\ - obj = o; \ - include = new std::vector(7, false);\ - if (i1) (*include)[0]=true;\ - if (i2) (*include)[1]=true;\ - if (i3) (*include)[2]=true;\ - if (i4) (*include)[3]=true;\ - if (i5) (*include)[4]=true;\ - if (i6) (*include)[5]=true;\ - if (i7) (*include)[6]=true;\ - } \ - template \ - NAME##_cus_value_list::NAME##_cus_value_list\ - (const NAME *o, cchar *d, Manip m, NAME##_enum i1, NAME##_enum i2, NAME##_enum i3, NAME##_enum i4, NAME##_enum i5, NAME##_enum i6, NAME##_enum i7) { \ - delem = d;\ - manip = m;\ - del_vector = true; \ - obj = o; \ - include = new std::vector(7, false); \ - if (i1 == NAME##_NULL) return;\ - (*include)[i1]=true;\ - if (i2 == NAME##_NULL) return;\ - (*include)[i2]=true;\ - if (i3 == NAME##_NULL) return;\ - (*include)[i3]=true;\ - if (i4 == NAME##_NULL) return;\ - (*include)[i4]=true;\ - if (i5 == NAME##_NULL) return;\ - (*include)[i5]=true;\ - if (i6 == NAME##_NULL) return;\ - (*include)[i6]=true;\ - if (i7 == NAME##_NULL) return;\ - (*include)[i7]=true;\ - }\ - template \ - NAME##_cus_field_list::NAME##_cus_field_list\ - (const NAME *o, cchar *d, Manip m, bool i1, bool i2, bool i3, bool i4, bool i5, bool i6, bool i7) {\ - delem = d;\ - manip = m;\ - del_vector = true; \ - obj = o; \ - include = new std::vector(7, false); \ - if (i1) (*include)[0]=true;\ - if (i2) (*include)[1]=true;\ - if (i3) (*include)[2]=true;\ - if (i4) (*include)[3]=true;\ - if (i5) (*include)[4]=true;\ - if (i6) (*include)[5]=true;\ - if (i7) (*include)[6]=true;\ - } \ - template \ - NAME##_cus_field_list::NAME##_cus_field_list\ - (const NAME *o, cchar *d, Manip m, NAME##_enum i1, NAME##_enum i2, NAME##_enum i3, NAME##_enum i4, NAME##_enum i5, NAME##_enum i6, NAME##_enum i7) { \ - delem = d;\ - manip = m;\ - del_vector = true; \ - obj = o; \ - include = new std::vector(7, false); \ - if (i1 == NAME##_NULL) return;\ - (*include)[i1]=true;\ - if (i2 == NAME##_NULL) return;\ - (*include)[i2]=true;\ - if (i3 == NAME##_NULL) return;\ - (*include)[i3]=true;\ - if (i4 == NAME##_NULL) return;\ - (*include)[i4]=true;\ - if (i5 == NAME##_NULL) return;\ - (*include)[i5]=true;\ - if (i6 == NAME##_NULL) return;\ - (*include)[i6]=true;\ - if (i7 == NAME##_NULL) return;\ - (*include)[i7]=true;\ - }\ - template \ - NAME##_cus_equal_list::NAME##_cus_equal_list\ - (const NAME *o, cchar *d, cchar *c, Manip m, bool i1, bool i2, bool i3, bool i4, bool i5, bool i6, bool i7) { \ - delem = d;\ - comp = c;\ - manip = m;\ - del_vector = true; \ - obj = o; \ - include = new std::vector(7, false); \ - if (i1) (*include)[0]=true;\ - if (i2) (*include)[1]=true;\ - if (i3) (*include)[2]=true;\ - if (i4) (*include)[3]=true;\ - if (i5) (*include)[4]=true;\ - if (i6) (*include)[5]=true;\ - if (i7) (*include)[6]=true;\ - } \ - template \ - NAME##_cus_equal_list::NAME##_cus_equal_list\ - (const NAME *o, cchar *d, cchar *c, Manip m, NAME##_enum i1, NAME##_enum i2, NAME##_enum i3, NAME##_enum i4, NAME##_enum i5, NAME##_enum i6, NAME##_enum i7) { \ - delem = d;\ - comp = c;\ - manip = m;\ - del_vector = true; \ - obj = o; \ - include = new std::vector(7, false); \ - if (i1 == NAME##_NULL) return;\ - (*include)[i1]=true;\ - if (i2 == NAME##_NULL) return;\ - (*include)[i2]=true;\ - if (i3 == NAME##_NULL) return;\ - (*include)[i3]=true;\ - if (i4 == NAME##_NULL) return;\ - (*include)[i4]=true;\ - if (i5 == NAME##_NULL) return;\ - (*include)[i5]=true;\ - if (i6 == NAME##_NULL) return;\ - (*include)[i6]=true;\ - if (i7 == NAME##_NULL) return;\ - (*include)[i7]=true;\ - }\ - template \ - std::ostream& operator << (std::ostream& s, const NAME##_value_list& obj) { \ - s << obj.manip << obj.obj->I1 << obj.delem;\ - s << obj.manip << obj.obj->I2 << obj.delem;\ - s << obj.manip << obj.obj->I3 << obj.delem;\ - s << obj.manip << obj.obj->I4 << obj.delem;\ - s << obj.manip << obj.obj->I5 << obj.delem;\ - s << obj.manip << obj.obj->I6 << obj.delem;\ - s << obj.manip << obj.obj->I7; \ - return s; \ - } \ - template \ - std::ostream& operator << (std::ostream& s, const NAME##_field_list& obj) { \ - s << obj.manip << obj.obj->names[0] << obj.delem;\ - s << obj.manip << obj.obj->names[1] << obj.delem;\ - s << obj.manip << obj.obj->names[2] << obj.delem;\ - s << obj.manip << obj.obj->names[3] << obj.delem;\ - s << obj.manip << obj.obj->names[4] << obj.delem;\ - s << obj.manip << obj.obj->names[5] << obj.delem;\ - s << obj.manip << obj.obj->names[6]; \ - return s; \ - } \ - template \ - std::ostream& operator << (std::ostream& s, const NAME##_equal_list& obj) { \ - s << obj.obj->names[0] << obj.comp << obj.manip << obj.obj->I1 << obj.delem;\ - s << obj.obj->names[1] << obj.comp << obj.manip << obj.obj->I2 << obj.delem;\ - s << obj.obj->names[2] << obj.comp << obj.manip << obj.obj->I3 << obj.delem;\ - s << obj.obj->names[3] << obj.comp << obj.manip << obj.obj->I4 << obj.delem;\ - s << obj.obj->names[4] << obj.comp << obj.manip << obj.obj->I5 << obj.delem;\ - s << obj.obj->names[5] << obj.comp << obj.manip << obj.obj->I6 << obj.delem;\ - s << obj.obj->names[6] << obj.comp << obj.manip << obj.obj->I7; \ - return s; \ - } \ - template \ - std::ostream& operator << (std::ostream& s, const NAME##_cus_value_list& obj) { \ - bool before = false; \ - if ((*obj.include)[0]) { \ - s << obj.manip << obj.obj->I1;\ - before = true; \ - } \ - if ((*obj.include)[1]) { \ - if (before) s << obj.delem;\ - s << obj.manip << obj.obj->I2;\ - before = true; \ - } \ - if ((*obj.include)[2]) { \ - if (before) s << obj.delem;\ - s << obj.manip << obj.obj->I3;\ - before = true; \ - } \ - if ((*obj.include)[3]) { \ - if (before) s << obj.delem;\ - s << obj.manip << obj.obj->I4;\ - before = true; \ - } \ - if ((*obj.include)[4]) { \ - if (before) s << obj.delem;\ - s << obj.manip << obj.obj->I5;\ - before = true; \ - } \ - if ((*obj.include)[5]) { \ - if (before) s << obj.delem;\ - s << obj.manip << obj.obj->I6;\ - before = true; \ - } \ - if ((*obj.include)[6]) { \ - if (before) s << obj.delem;\ - s << obj.manip << obj.obj->I7;\ - } \ - return s; \ - } \ - template \ - std::ostream& operator << (std::ostream& s, const NAME##_cus_field_list& obj) { \ - bool before = false; \ - if ((*obj.include)[0]) { \ - s << obj.manip << obj.obj->names[0];\ - before = true; \ - } \ - if ((*obj.include)[1]) { \ - if (before) s << obj.delem;\ - s << obj.manip << obj.obj->names[1];\ - before = true; \ - } \ - if ((*obj.include)[2]) { \ - if (before) s << obj.delem;\ - s << obj.manip << obj.obj->names[2];\ - before = true; \ - } \ - if ((*obj.include)[3]) { \ - if (before) s << obj.delem;\ - s << obj.manip << obj.obj->names[3];\ - before = true; \ - } \ - if ((*obj.include)[4]) { \ - if (before) s << obj.delem;\ - s << obj.manip << obj.obj->names[4];\ - before = true; \ - } \ - if ((*obj.include)[5]) { \ - if (before) s << obj.delem;\ - s << obj.manip << obj.obj->names[5];\ - before = true; \ - } \ - if ((*obj.include)[6]) { \ - if (before) s << obj.delem;\ - s << obj.manip << obj.obj->names[6];\ - } \ - return s; \ - } \ - template \ - std::ostream& operator << (std::ostream& s, const NAME##_cus_equal_list& obj) { \ - bool before = false; \ - if ((*obj.include)[0]) { \ - s << obj.obj->names[0] << obj.comp << obj.manip << obj.obj->I1;\ - before = true; \ - } \ - if ((*obj.include)[1]) { \ - if (before) s << obj.delem;\ - s << obj.obj->names[1] << obj.comp << obj.manip << obj.obj->I2;\ - before = true; \ - } \ - if ((*obj.include)[2]) { \ - if (before) s << obj.delem;\ - s << obj.obj->names[2] << obj.comp << obj.manip << obj.obj->I3;\ - before = true; \ - } \ - if ((*obj.include)[3]) { \ - if (before) s << obj.delem;\ - s << obj.obj->names[3] << obj.comp << obj.manip << obj.obj->I4;\ - before = true; \ - } \ - if ((*obj.include)[4]) { \ - if (before) s << obj.delem;\ - s << obj.obj->names[4] << obj.comp << obj.manip << obj.obj->I5;\ - before = true; \ - } \ - if ((*obj.include)[5]) { \ - if (before) s << obj.delem;\ - s << obj.obj->names[5] << obj.comp << obj.manip << obj.obj->I6;\ - before = true; \ - } \ - if ((*obj.include)[6]) { \ - if (before) s << obj.delem;\ - s << obj.obj->names[6] << obj.comp << obj.manip << obj.obj->I7;\ - } \ - return s; \ - } \ - template \ - inline NAME##_value_list NAME::value_list(cchar *d, Manip m) const { \ - return NAME##_value_list (this, d, m); \ - } \ - template \ - inline NAME##_field_list NAME::field_list(cchar *d, Manip m) const { \ - return NAME##_field_list (this, d, m); \ - } \ - template \ - inline NAME##_equal_list NAME::equal_list(cchar *d, cchar *c, Manip m) const { \ - return NAME##_equal_list (this, d, c, m); \ - } \ - template \ - inline NAME##_cus_value_list NAME::value_list(cchar *d, Manip m,\ - bool i1, bool i2, bool i3, bool i4, bool i5, bool i6, bool i7) const {\ - return NAME##_cus_value_list (this, d, m, i1, i2, i3, i4, i5, i6, i7); \ - } \ - template \ - inline NAME##_cus_field_list NAME::field_list(cchar *d, Manip m,\ - bool i1, bool i2, bool i3, bool i4, bool i5, bool i6, bool i7) const { \ - return NAME##_cus_field_list (this, d, m, i1, i2, i3, i4, i5, i6, i7); \ - } \ - template \ - inline NAME##_cus_equal_list NAME::equal_list(cchar *d, cchar *c, Manip m,\ - bool i1, bool i2, bool i3, bool i4, bool i5, bool i6, bool i7) const { \ - return NAME##_cus_equal_list (this, d, c, m, i1, i2, i3, i4, i5, i6, i7); \ - } \ - template \ - inline NAME##_cus_value_list NAME::value_list(cchar *d, Manip m,\ - NAME##_enum i1, NAME##_enum i2, NAME##_enum i3, NAME##_enum i4, NAME##_enum i5, NAME##_enum i6, NAME##_enum i7) const { \ - return NAME##_cus_value_list (this, d, m, i1, i2, i3, i4, i5, i6, i7); \ - } \ - template \ - inline NAME##_cus_field_list NAME::field_list(cchar *d, Manip m,\ - NAME##_enum i1, NAME##_enum i2, NAME##_enum i3, NAME##_enum i4, NAME##_enum i5, NAME##_enum i6, NAME##_enum i7) const {\ - return NAME##_cus_field_list (this, d, m, i1, i2, i3, i4, i5, i6, i7); \ - } \ - template \ - inline NAME##_cus_equal_list NAME::equal_list(cchar *d, cchar *c, Manip m, \ - NAME##_enum i1, NAME##_enum i2, NAME##_enum i3, NAME##_enum i4, NAME##_enum i5, NAME##_enum i6, NAME##_enum i7) const { \ - return NAME##_cus_equal_list (this, d, c, m, i1, i2, i3, i4, i5, i6, i7); \ - } \ - template \ - inline NAME##_cus_value_list NAME::value_list(cchar *d, Manip m,\ - std::vector *i) const {\ - return NAME##_cus_value_list (this, d, m, i);\ - }\ - template \ - inline NAME##_cus_field_list NAME::field_list(cchar *d, Manip m,\ - std::vector *i) const {\ - return NAME##_cus_field_list (this, d, m, i);\ - }\ - template \ - inline NAME##_cus_equal_list NAME::equal_list(cchar *d, cchar *c, Manip m,\ - std::vector *i) const {\ - return NAME##_cus_equal_list (this, d, c, m, i);\ - }\ - template \ - inline NAME##_cus_value_list \ - NAME::value_list(cchar *d, Manip m, sql_cmp_type /*sc*/) const {\ - sql_compare_type_def_##CMP (NAME, value, NUM);\ - }\ - template \ - inline NAME##_cus_field_list \ - NAME::field_list(cchar *d, Manip m, sql_cmp_type /*sc*/) const {\ - sql_compare_type_def_##CMP (NAME, field, NUM);\ - }\ - template \ - inline NAME##_cus_equal_list \ - NAME::equal_list(cchar *d, cchar *c, Manip m, sql_cmp_type /*sc*/) const {\ - sql_compare_type_defe_##CMP (NAME, equal, NUM);\ - }\ - template \ - void populate_##NAME (NAME *s, const Row &row) { \ - s->I1 = static_cast(row.at(O1));\ - s->I2 = static_cast(row.at(O2));\ - s->I3 = static_cast(row.at(O3));\ - s->I4 = static_cast(row.at(O4));\ - s->I5 = static_cast(row.at(O5));\ - s->I6 = static_cast(row.at(O6));\ - s->I7 = static_cast(row.at(O7));\ - } \ - inline NAME::NAME (const Row &row) \ - {populate_##NAME(this, row);}\ - inline void NAME::set (const Row &row)\ - {populate_##NAME(this, row);}\ - sql_COMPARE__##CMP(NAME, I1, I2, I3, I4, I5, I6, I7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ) - -#define sql_create_basic_7(NAME, CMP, CONTR, T1, I1, T2, I2, T3, I3, T4, I4, T5, I5, T6, I6, T7, I7) \ - sql_create_basic_c_order_7(NAME, CMP, CONTR, T1, I1, 0, T2, I2, 1, T3, I3, 2, T4, I4, 3, T5, I5, 4, T6, I6, 5, T7, I7, 6) - -#define sql_create_7(NAME, CMP, CONTR, T1, I1, T2, I2, T3, I3, T4, I4, T5, I5, T6, I6, T7, I7) \ - sql_create_complete_7(NAME, CMP, CONTR, T1, I1, #I1, 0, T2, I2, #I2, 1, T3, I3, #I3, 2, T4, I4, #I4, 3, T5, I5, #I5, 4, T6, I6, #I6, 5, T7, I7, #I7, 6) \ - -#define sql_create_c_order_7(NAME, CMP, CONTR, T1, I1, O1, T2, I2, O2, T3, I3, O3, T4, I4, O4, T5, I5, O5, T6, I6, O6, T7, I7, O7) \ - sql_create_complete_7(NAME, CMP, CONTR, T1, I1, #I1, O1, T2, I2, #I2, O2, T3, I3, #I3, O3, T4, I4, #I4, O4, T5, I5, #I5, O5, T6, I6, #I6, O6, T7, I7, #I7, O7) - -#define sql_create_c_names_7(NAME, CMP, CONTR, T1, I1, N1, T2, I2, N2, T3, I3, N3, T4, I4, N4, T5, I5, N5, T6, I6, N6, T7, I7, N7) \ - sql_create_complete_7(NAME, CMP, CONTR, T1, I1, N1, 0, T2, I2, N2, 1, T3, I3, N3, 2, T4, I4, N4, 3, T5, I5, N5, 4, T6, I6, N6, 5, T7, I7, N7, 6) - -// --------------------------------------------------- -// End Create 7 -// --------------------------------------------------- - -// --------------------------------------------------- -// Begin Create 8 -// --------------------------------------------------- -#define sql_create_basic_c_order_8(NAME, CMP, CONTR, T1, I1, O1, T2, I2, O2, T3, I3, O3, T4, I4, O4, T5, I5, O5, T6, I6, O6, T7, I7, O7, T8, I8, O8)\ - struct NAME; \ - template int sql_compare_##NAME (const NAME &, const NAME &);\ - struct NAME { \ - T1 I1;\ - T2 I2;\ - T3 I3;\ - T4 I4;\ - T5 I5;\ - T6 I6;\ - T7 I7;\ - T8 I8; \ - NAME () {} \ - NAME (const Row &row);\ - sql_compare_define_##CMP(NAME, T1, I1, T2, I2, T3, I3, T4, I4, T5, I5, T6, I6, T7, I7, T8, I8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0)\ - }; \ - template \ - void populate_##NAME (NAME *s, const Row &row) { \ - s->I1 = static_cast(row.at(O1));\ - s->I2 = static_cast(row.at(O2));\ - s->I3 = static_cast(row.at(O3));\ - s->I4 = static_cast(row.at(O4));\ - s->I5 = static_cast(row.at(O5));\ - s->I6 = static_cast(row.at(O6));\ - s->I7 = static_cast(row.at(O7));\ - s->I8 = static_cast(row.at(O8)); \ - } \ - inline NAME::NAME (const Row &row) \ - {populate_##NAME(this, row);} \ - sql_COMPARE__##CMP(NAME, I1, I2, I3, I4, I5, I6, I7, I8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ) - -#define sql_create_complete_8(NAME, CMP, CONTR, T1, I1, N1, O1, T2, I2, N2, O2, T3, I3, N3, O3, T4, I4, N4, O4, T5, I5, N5, O5, T6, I6, N6, O6, T7, I7, N7, O7, T8, I8, N8, O8) \ - struct NAME; \ - enum NAME##_enum { \ - NAME##_##I1,\ - NAME##_##I2,\ - NAME##_##I3,\ - NAME##_##I4,\ - NAME##_##I5,\ - NAME##_##I6,\ - NAME##_##I7,\ - NAME##_##I8 \ - ,NAME##_NULL \ - }; \ - template \ - class NAME##_value_list { \ - /*friend std::ostream& operator << <> (std::ostream&, const NAME##_value_list&); */\ - public: \ - const NAME *obj;\ - cchar *delem;\ - Manip manip;\ - public: \ - NAME##_value_list (const NAME *o, cchar *d, Manip m) \ - : obj(o), delem(d), manip(m) {} \ - };\ - template \ - class NAME##_##field_list {\ - /* friend std::ostream& operator << <> (std::ostream&, const NAME##_field_list&); */\ - public: \ - const NAME *obj; \ - cchar *delem;\ - Manip manip;\ - public: \ - NAME##_field_list (const NAME *o, cchar *d, Manip m) \ - : obj(o), delem(d), manip(m) {} \ - };\ - template \ - class NAME##_equal_list { \ - /* friend std::ostream& operator << <> (std::ostream&, const NAME##_equal_list&); */\ - public: \ - const NAME *obj;\ - cchar *delem;\ - cchar *comp;\ - Manip manip;\ - public: \ - NAME##_equal_list (const NAME *o, cchar *d, cchar *c, Manip m) \ - : obj(o), delem(d), comp(c), manip(m) {}\ - };\ - template \ - class NAME##_cus_value_list {\ - /* friend std::ostream& operator << <> (std::ostream&, \ - const NAME##_cus_value_list&); */\ - public:\ - const NAME *obj;\ - std::vector *include;\ - bool del_vector;\ - cchar *delem;\ - Manip manip;\ - public: \ - ~NAME##_cus_value_list () {if (del_vector) delete include;} \ - NAME##_cus_value_list (const NAME *o, cchar *d, Manip m, bool i1, bool i2, bool i3, bool i4, bool i5, bool i6, bool i7, bool i8);\ - NAME##_cus_value_list (const NAME *o, cchar *d, Manip m, NAME##_enum i1, NAME##_enum i2, NAME##_enum i3, NAME##_enum i4, NAME##_enum i5, NAME##_enum i6, NAME##_enum i7, NAME##_enum i8); \ - NAME##_cus_value_list (const NAME *o, cchar *d, Manip m ,std::vector* i)\ - : obj(o), include(i), del_vector(false), delem(d), manip(m) {}\ - };\ - template \ - class NAME##_cus_field_list { \ - /* friend std::ostream& operator << <> (std::ostream&, \ - const NAME##_cus_field_list&); */\ - public:\ - const NAME *obj; \ - std::vector *include; \ - bool del_vector; \ - cchar *delem;\ - Manip manip;\ - public: \ - ~NAME##_cus_field_list () {if (del_vector) delete include;} \ - NAME##_cus_field_list (const NAME *o, cchar *d, Manip m, bool i1, bool i2, bool i3, bool i4, bool i5, bool i6, bool i7, bool i8); \ - NAME##_cus_field_list (const NAME *o, cchar *d, Manip m, NAME##_enum i1, NAME##_enum i2, NAME##_enum i3, NAME##_enum i4, NAME##_enum i5, NAME##_enum i6, NAME##_enum i7, NAME##_enum i8); \ - NAME##_cus_field_list (const NAME *o, cchar *d, Manip m, std::vector *i) \ - : obj(o), include(i), del_vector(false), delem(d), manip(m) {}\ - };\ - template \ - class NAME##_cus_equal_list {\ - /* friend std::ostream& operator << <> (std::ostream&, \ - const NAME##_cus_equal_list&); */\ - public:\ - const NAME *obj;\ - std::vector *include;\ - bool del_vector;\ - cchar *delem;\ - cchar *comp;\ - Manip manip;\ - public:\ - ~NAME##_##cus_equal_list () {if (del_vector) delete include;}\ - NAME##_##cus_equal_list (const NAME *o, cchar *d, cchar *c, Manip m, bool i1, bool i2, bool i3, bool i4, bool i5, bool i6, bool i7, bool i8); \ - NAME##_##cus_equal_list (const NAME *o, cchar *d, cchar *c, Manip m, NAME##_enum i1, NAME##_enum i2, NAME##_enum i3, NAME##_enum i4, NAME##_enum i5, NAME##_enum i6, NAME##_enum i7, NAME##_enum i8); \ - NAME##_##cus_equal_list (const NAME *o, cchar *d, cchar *c, Manip m, std::vector *i) \ - : obj(o), include(i), del_vector(false), delem(d), comp(c), manip(m) {}\ - };\ - template int sql_compare_##NAME (const NAME &, const NAME &);\ - struct NAME { \ - T1 I1;\ - T2 I2;\ - T3 I3;\ - T4 I4;\ - T5 I5;\ - T6 I6;\ - T7 I7;\ - T8 I8; \ - NAME () {} \ - NAME (const Row &row);\ - void set (const Row &row);\ - sql_compare_define_##CMP(NAME, T1, I1, T2, I2, T3, I3, T4, I4, T5, I5, T6, I6, T7, I7, T8, I8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0)\ - sql_construct_define_##CONTR(NAME, T1, I1, T2, I2, T3, I3, T4, I4, T5, I5, T6, I6, T7, I7, T8, I8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0)\ - static const char *names[];\ - static const char *_table;\ - static const char *& table() {return _table;}\ - NAME##_value_list value_list() const {\ - return value_list(",", quote);}\ - NAME##_value_list value_list(cchar *d) const {\ - return value_list(d, quote);}\ - template \ - NAME##_value_list value_list(cchar *d, Manip m) const; \ - NAME##_field_list field_list() const {\ - return field_list(",", do_nothing);}\ - NAME##_field_list field_list(cchar *d) const {\ - return field_list(d, do_nothing);}\ - template \ - NAME##_field_list field_list(cchar *d, Manip m) const; \ - NAME##_equal_list equal_list(cchar *d = ",", \ - cchar *c = " = ") const{\ - return equal_list(d, c, quote);}\ - template \ - NAME##_equal_list equal_list(cchar *d, cchar *c, Manip m) const; \ - /* cus_data */\ - NAME##_cus_value_list value_list(bool i1, bool i2 = false, bool i3 = false, bool i4 = false, bool i5 = false, bool i6 = false, bool i7 = false, bool i8 = false) const {\ - return value_list(",", quote, i1, i2, i3, i4, i5, i6, i7, i8);\ - }\ - NAME##_cus_value_list value_list(NAME##_enum i1, NAME##_enum i2 = NAME##_NULL, NAME##_enum i3 = NAME##_NULL, NAME##_enum i4 = NAME##_NULL, NAME##_enum i5 = NAME##_NULL, NAME##_enum i6 = NAME##_NULL, NAME##_enum i7 = NAME##_NULL, NAME##_enum i8 = NAME##_NULL) const {\ - return value_list(",", quote, i1, i2, i3, i4, i5, i6, i7, i8);\ - }\ - NAME##_cus_value_list value_list(std::vector *i) const {\ - return value_list(",", quote, i);\ - }\ - NAME##_cus_value_list value_list(sql_cmp_type sc) const {\ - return value_list(",", quote, sc);\ - }\ - NAME##_cus_value_list value_list(cchar *d, bool i1, bool i2 = false, bool i3 = false, bool i4 = false, bool i5 = false, bool i6 = false, bool i7 = false, bool i8 = false) const {\ - return value_list(d, quote, i1, i2, i3, i4, i5, i6, i7, i8);\ - }\ - NAME##_cus_value_list value_list(cchar *d, NAME##_enum i1, NAME##_enum i2 = NAME##_NULL, NAME##_enum i3 = NAME##_NULL, NAME##_enum i4 = NAME##_NULL, NAME##_enum i5 = NAME##_NULL, NAME##_enum i6 = NAME##_NULL, NAME##_enum i7 = NAME##_NULL, NAME##_enum i8 = NAME##_NULL) const {\ - return value_list(d, quote, i1, i2, i3, i4, i5, i6, i7, i8);\ - }\ - NAME##_cus_value_list value_list(cchar *d, \ - std::vector *i) const {\ - return value_list(d, quote, i);\ - }\ - NAME##_cus_value_list value_list(cchar *d, \ - sql_cmp_type sc) const {\ - return value_list(d, quote, sc);\ - }\ - template \ - NAME##_cus_value_list value_list(cchar *d, Manip m,\ - bool i1, bool i2 = false, bool i3 = false, bool i4 = false, bool i5 = false, bool i6 = false, bool i7 = false, bool i8 = false) const; \ - template \ - NAME##_cus_value_list value_list(cchar *d, Manip m,\ - NAME##_enum i1, NAME##_enum i2 = NAME##_NULL, NAME##_enum i3 = NAME##_NULL, NAME##_enum i4 = NAME##_NULL, NAME##_enum i5 = NAME##_NULL, NAME##_enum i6 = NAME##_NULL, NAME##_enum i7 = NAME##_NULL, NAME##_enum i8 = NAME##_NULL) const; \ - template \ - NAME##_cus_value_list value_list(cchar *d, Manip m, \ - std::vector *i) const;\ - template \ - NAME##_cus_value_list value_list(cchar *d, Manip m, \ - sql_cmp_type sc) const;\ - /* cus field */\ - NAME##_cus_field_list field_list(bool i1, bool i2 = false, bool i3 = false, bool i4 = false, bool i5 = false, bool i6 = false, bool i7 = false, bool i8 = false) const {\ - return field_list(",", do_nothing, i1, i2, i3, i4, i5, i6, i7, i8);\ - }\ - NAME##_cus_field_list field_list(NAME##_enum i1, NAME##_enum i2 = NAME##_NULL, NAME##_enum i3 = NAME##_NULL, NAME##_enum i4 = NAME##_NULL, NAME##_enum i5 = NAME##_NULL, NAME##_enum i6 = NAME##_NULL, NAME##_enum i7 = NAME##_NULL, NAME##_enum i8 = NAME##_NULL) const {\ - return field_list(",", do_nothing, i1, i2, i3, i4, i5, i6, i7, i8);\ - }\ - NAME##_cus_field_list field_list(std::vector *i) const {\ - return field_list(",", do_nothing, i);\ - }\ - NAME##_cus_field_list field_list(sql_cmp_type sc) const\ - {\ - return field_list(",", do_nothing, sc);\ - }\ - NAME##_cus_field_list field_list(cchar *d, \ - bool i1, bool i2 = false, bool i3 = false, bool i4 = false, bool i5 = false, bool i6 = false, bool i7 = false, bool i8 = false) const {\ - return field_list(d, do_nothing, i1, i2, i3, i4, i5, i6, i7, i8);\ - }\ - NAME##_cus_field_list field_list(cchar *d,\ - NAME##_enum i1, NAME##_enum i2 = NAME##_NULL, NAME##_enum i3 = NAME##_NULL, NAME##_enum i4 = NAME##_NULL, NAME##_enum i5 = NAME##_NULL, NAME##_enum i6 = NAME##_NULL, NAME##_enum i7 = NAME##_NULL, NAME##_enum i8 = NAME##_NULL) const {\ - return field_list(d, do_nothing, i1, i2, i3, i4, i5, i6, i7, i8);\ - }\ - NAME##_cus_field_list field_list(cchar *d, \ - std::vector *i) const {\ - return field_list(d, do_nothing, i);\ - }\ - NAME##_cus_field_list field_list(cchar *d, \ - sql_cmp_type sc) const {\ - return field_list(d, do_nothing, sc);\ - }\ - template \ - NAME##_cus_field_list field_list(cchar *d, Manip m,\ - bool i1, bool i2 = false, bool i3 = false, bool i4 = false, bool i5 = false, bool i6 = false, bool i7 = false, bool i8 = false) const; \ - template \ - NAME##_cus_field_list field_list(cchar *d, Manip m,\ - NAME##_enum i1, NAME##_enum i2 = NAME##_NULL, NAME##_enum i3 = NAME##_NULL, NAME##_enum i4 = NAME##_NULL, NAME##_enum i5 = NAME##_NULL, NAME##_enum i6 = NAME##_NULL, NAME##_enum i7 = NAME##_NULL, NAME##_enum i8 = NAME##_NULL) const; \ - template \ - NAME##_cus_field_list field_list(cchar *d, Manip m,\ - std::vector *i) const;\ - template \ - NAME##_cus_field_list field_list(cchar *d, Manip m, \ - sql_cmp_type sc) const;\ - /* cus equal */\ - NAME##_cus_equal_list equal_list(bool i1, bool i2 = false, bool i3 = false, bool i4 = false, bool i5 = false, bool i6 = false, bool i7 = false, bool i8 = false) const {\ - return equal_list(",", " = ", quote, i1, i2, i3, i4, i5, i6, i7, i8);\ - }\ - NAME##_cus_equal_list equal_list(NAME##_enum i1, NAME##_enum i2 = NAME##_NULL, NAME##_enum i3 = NAME##_NULL, NAME##_enum i4 = NAME##_NULL, NAME##_enum i5 = NAME##_NULL, NAME##_enum i6 = NAME##_NULL, NAME##_enum i7 = NAME##_NULL, NAME##_enum i8 = NAME##_NULL) const {\ - return equal_list(",", " = ", quote, i1, i2, i3, i4, i5, i6, i7, i8);\ - }\ - NAME##_cus_equal_list equal_list(std::vector *i) const {\ - return equal_list(",", " = ", quote, i);\ - }\ - NAME##_cus_equal_list equal_list(sql_cmp_type sc) const {\ - return equal_list(",", " = ", quote, sc);\ - }\ - NAME##_cus_equal_list equal_list(cchar *d, bool i1, bool i2 = false, bool i3 = false, bool i4 = false, bool i5 = false, bool i6 = false, bool i7 = false, bool i8 = false) const {\ - return equal_list(d, " = ", quote, i1, i2, i3, i4, i5, i6, i7, i8);\ - }\ - NAME##_cus_equal_list equal_list(cchar *d, NAME##_enum i1, NAME##_enum i2 = NAME##_NULL, NAME##_enum i3 = NAME##_NULL, NAME##_enum i4 = NAME##_NULL, NAME##_enum i5 = NAME##_NULL, NAME##_enum i6 = NAME##_NULL, NAME##_enum i7 = NAME##_NULL, NAME##_enum i8 = NAME##_NULL) const {\ - return equal_list(d, " = ", quote, i1, i2, i3, i4, i5, i6, i7, i8);\ - }\ - NAME##_cus_equal_list equal_list(cchar *d, \ - std::vector *i) const {\ - return equal_list(d, " = ", quote, i);\ - }\ - NAME##_cus_equal_list equal_list(cchar *d, \ - sql_cmp_type sc) const {\ - return equal_list(d, " = ", quote, sc);\ - }\ - NAME##_cus_equal_list equal_list(cchar *d, cchar *c,\ - bool i1, bool i2 = false, bool i3 = false, bool i4 = false, bool i5 = false, bool i6 = false, bool i7 = false, bool i8 = false) const {\ - return equal_list(d, c, quote, i1, i2, i3, i4, i5, i6, i7, i8);\ - }\ - NAME##_cus_equal_list equal_list(cchar *d, cchar *c,\ - NAME##_enum i1, NAME##_enum i2 = NAME##_NULL, NAME##_enum i3 = NAME##_NULL, NAME##_enum i4 = NAME##_NULL, NAME##_enum i5 = NAME##_NULL, NAME##_enum i6 = NAME##_NULL, NAME##_enum i7 = NAME##_NULL, NAME##_enum i8 = NAME##_NULL) const {\ - return equal_list(d, c, quote, i1, i2, i3, i4, i5, i6, i7, i8);\ - }\ - NAME##_cus_equal_list equal_list(cchar *d, cchar *c,\ - std::vector *i) const {\ - return equal_list(d, c, quote, i);\ - }\ - NAME##_cus_equal_list equal_list(cchar *d, cchar *c,\ - sql_cmp_type sc) const {\ - return equal_list(d, c, quote, sc);\ - }\ - template \ - NAME##_cus_equal_list equal_list(cchar *d, cchar *c, Manip m, \ - bool i1, bool i2 = false, bool i3 = false, bool i4 = false, bool i5 = false, bool i6 = false, bool i7 = false, bool i8 = false) const; \ - template \ - NAME##_cus_equal_list equal_list(cchar *d, cchar *c, Manip m, \ - NAME##_enum i1, NAME##_enum i2 = NAME##_NULL, NAME##_enum i3 = NAME##_NULL, NAME##_enum i4 = NAME##_NULL, NAME##_enum i5 = NAME##_NULL, NAME##_enum i6 = NAME##_NULL, NAME##_enum i7 = NAME##_NULL, NAME##_enum i8 = NAME##_NULL) const; \ - template \ - NAME##_cus_equal_list equal_list(cchar *d, cchar *c, Manip m, \ - std::vector *i) const;\ - template \ - NAME##_cus_equal_list equal_list(cchar *d, cchar *c, Manip m, \ - sql_cmp_type sc) const;\ - }; \ - const char *NAME::names[] = { \ - N1 ,\ - N2 ,\ - N3 ,\ - N4 ,\ - N5 ,\ - N6 ,\ - N7 ,\ - N8 \ - }; \ - const char *NAME::_table = #NAME ; \ - template \ - NAME##_cus_value_list::NAME##_cus_value_list\ - (const NAME *o, cchar *d, Manip m, bool i1, bool i2, bool i3, bool i4, bool i5, bool i6, bool i7, bool i8) \ - { \ - delem = d;\ - manip = m;\ - del_vector = true;\ - obj = o; \ - include = new std::vector(8, false);\ - if (i1) (*include)[0]=true;\ - if (i2) (*include)[1]=true;\ - if (i3) (*include)[2]=true;\ - if (i4) (*include)[3]=true;\ - if (i5) (*include)[4]=true;\ - if (i6) (*include)[5]=true;\ - if (i7) (*include)[6]=true;\ - if (i8) (*include)[7]=true;\ - } \ - template \ - NAME##_cus_value_list::NAME##_cus_value_list\ - (const NAME *o, cchar *d, Manip m, NAME##_enum i1, NAME##_enum i2, NAME##_enum i3, NAME##_enum i4, NAME##_enum i5, NAME##_enum i6, NAME##_enum i7, NAME##_enum i8) { \ - delem = d;\ - manip = m;\ - del_vector = true; \ - obj = o; \ - include = new std::vector(8, false); \ - if (i1 == NAME##_NULL) return;\ - (*include)[i1]=true;\ - if (i2 == NAME##_NULL) return;\ - (*include)[i2]=true;\ - if (i3 == NAME##_NULL) return;\ - (*include)[i3]=true;\ - if (i4 == NAME##_NULL) return;\ - (*include)[i4]=true;\ - if (i5 == NAME##_NULL) return;\ - (*include)[i5]=true;\ - if (i6 == NAME##_NULL) return;\ - (*include)[i6]=true;\ - if (i7 == NAME##_NULL) return;\ - (*include)[i7]=true;\ - if (i8 == NAME##_NULL) return;\ - (*include)[i8]=true;\ - }\ - template \ - NAME##_cus_field_list::NAME##_cus_field_list\ - (const NAME *o, cchar *d, Manip m, bool i1, bool i2, bool i3, bool i4, bool i5, bool i6, bool i7, bool i8) {\ - delem = d;\ - manip = m;\ - del_vector = true; \ - obj = o; \ - include = new std::vector(8, false); \ - if (i1) (*include)[0]=true;\ - if (i2) (*include)[1]=true;\ - if (i3) (*include)[2]=true;\ - if (i4) (*include)[3]=true;\ - if (i5) (*include)[4]=true;\ - if (i6) (*include)[5]=true;\ - if (i7) (*include)[6]=true;\ - if (i8) (*include)[7]=true;\ - } \ - template \ - NAME##_cus_field_list::NAME##_cus_field_list\ - (const NAME *o, cchar *d, Manip m, NAME##_enum i1, NAME##_enum i2, NAME##_enum i3, NAME##_enum i4, NAME##_enum i5, NAME##_enum i6, NAME##_enum i7, NAME##_enum i8) { \ - delem = d;\ - manip = m;\ - del_vector = true; \ - obj = o; \ - include = new std::vector(8, false); \ - if (i1 == NAME##_NULL) return;\ - (*include)[i1]=true;\ - if (i2 == NAME##_NULL) return;\ - (*include)[i2]=true;\ - if (i3 == NAME##_NULL) return;\ - (*include)[i3]=true;\ - if (i4 == NAME##_NULL) return;\ - (*include)[i4]=true;\ - if (i5 == NAME##_NULL) return;\ - (*include)[i5]=true;\ - if (i6 == NAME##_NULL) return;\ - (*include)[i6]=true;\ - if (i7 == NAME##_NULL) return;\ - (*include)[i7]=true;\ - if (i8 == NAME##_NULL) return;\ - (*include)[i8]=true;\ - }\ - template \ - NAME##_cus_equal_list::NAME##_cus_equal_list\ - (const NAME *o, cchar *d, cchar *c, Manip m, bool i1, bool i2, bool i3, bool i4, bool i5, bool i6, bool i7, bool i8) { \ - delem = d;\ - comp = c;\ - manip = m;\ - del_vector = true; \ - obj = o; \ - include = new std::vector(8, false); \ - if (i1) (*include)[0]=true;\ - if (i2) (*include)[1]=true;\ - if (i3) (*include)[2]=true;\ - if (i4) (*include)[3]=true;\ - if (i5) (*include)[4]=true;\ - if (i6) (*include)[5]=true;\ - if (i7) (*include)[6]=true;\ - if (i8) (*include)[7]=true;\ - } \ - template \ - NAME##_cus_equal_list::NAME##_cus_equal_list\ - (const NAME *o, cchar *d, cchar *c, Manip m, NAME##_enum i1, NAME##_enum i2, NAME##_enum i3, NAME##_enum i4, NAME##_enum i5, NAME##_enum i6, NAME##_enum i7, NAME##_enum i8) { \ - delem = d;\ - comp = c;\ - manip = m;\ - del_vector = true; \ - obj = o; \ - include = new std::vector(8, false); \ - if (i1 == NAME##_NULL) return;\ - (*include)[i1]=true;\ - if (i2 == NAME##_NULL) return;\ - (*include)[i2]=true;\ - if (i3 == NAME##_NULL) return;\ - (*include)[i3]=true;\ - if (i4 == NAME##_NULL) return;\ - (*include)[i4]=true;\ - if (i5 == NAME##_NULL) return;\ - (*include)[i5]=true;\ - if (i6 == NAME##_NULL) return;\ - (*include)[i6]=true;\ - if (i7 == NAME##_NULL) return;\ - (*include)[i7]=true;\ - if (i8 == NAME##_NULL) return;\ - (*include)[i8]=true;\ - }\ - template \ - std::ostream& operator << (std::ostream& s, const NAME##_value_list& obj) { \ - s << obj.manip << obj.obj->I1 << obj.delem;\ - s << obj.manip << obj.obj->I2 << obj.delem;\ - s << obj.manip << obj.obj->I3 << obj.delem;\ - s << obj.manip << obj.obj->I4 << obj.delem;\ - s << obj.manip << obj.obj->I5 << obj.delem;\ - s << obj.manip << obj.obj->I6 << obj.delem;\ - s << obj.manip << obj.obj->I7 << obj.delem;\ - s << obj.manip << obj.obj->I8; \ - return s; \ - } \ - template \ - std::ostream& operator << (std::ostream& s, const NAME##_field_list& obj) { \ - s << obj.manip << obj.obj->names[0] << obj.delem;\ - s << obj.manip << obj.obj->names[1] << obj.delem;\ - s << obj.manip << obj.obj->names[2] << obj.delem;\ - s << obj.manip << obj.obj->names[3] << obj.delem;\ - s << obj.manip << obj.obj->names[4] << obj.delem;\ - s << obj.manip << obj.obj->names[5] << obj.delem;\ - s << obj.manip << obj.obj->names[6] << obj.delem;\ - s << obj.manip << obj.obj->names[7]; \ - return s; \ - } \ - template \ - std::ostream& operator << (std::ostream& s, const NAME##_equal_list& obj) { \ - s << obj.obj->names[0] << obj.comp << obj.manip << obj.obj->I1 << obj.delem;\ - s << obj.obj->names[1] << obj.comp << obj.manip << obj.obj->I2 << obj.delem;\ - s << obj.obj->names[2] << obj.comp << obj.manip << obj.obj->I3 << obj.delem;\ - s << obj.obj->names[3] << obj.comp << obj.manip << obj.obj->I4 << obj.delem;\ - s << obj.obj->names[4] << obj.comp << obj.manip << obj.obj->I5 << obj.delem;\ - s << obj.obj->names[5] << obj.comp << obj.manip << obj.obj->I6 << obj.delem;\ - s << obj.obj->names[6] << obj.comp << obj.manip << obj.obj->I7 << obj.delem;\ - s << obj.obj->names[7] << obj.comp << obj.manip << obj.obj->I8; \ - return s; \ - } \ - template \ - std::ostream& operator << (std::ostream& s, const NAME##_cus_value_list& obj) { \ - bool before = false; \ - if ((*obj.include)[0]) { \ - s << obj.manip << obj.obj->I1;\ - before = true; \ - } \ - if ((*obj.include)[1]) { \ - if (before) s << obj.delem;\ - s << obj.manip << obj.obj->I2;\ - before = true; \ - } \ - if ((*obj.include)[2]) { \ - if (before) s << obj.delem;\ - s << obj.manip << obj.obj->I3;\ - before = true; \ - } \ - if ((*obj.include)[3]) { \ - if (before) s << obj.delem;\ - s << obj.manip << obj.obj->I4;\ - before = true; \ - } \ - if ((*obj.include)[4]) { \ - if (before) s << obj.delem;\ - s << obj.manip << obj.obj->I5;\ - before = true; \ - } \ - if ((*obj.include)[5]) { \ - if (before) s << obj.delem;\ - s << obj.manip << obj.obj->I6;\ - before = true; \ - } \ - if ((*obj.include)[6]) { \ - if (before) s << obj.delem;\ - s << obj.manip << obj.obj->I7;\ - before = true; \ - } \ - if ((*obj.include)[7]) { \ - if (before) s << obj.delem;\ - s << obj.manip << obj.obj->I8;\ - } \ - return s; \ - } \ - template \ - std::ostream& operator << (std::ostream& s, const NAME##_cus_field_list& obj) { \ - bool before = false; \ - if ((*obj.include)[0]) { \ - s << obj.manip << obj.obj->names[0];\ - before = true; \ - } \ - if ((*obj.include)[1]) { \ - if (before) s << obj.delem;\ - s << obj.manip << obj.obj->names[1];\ - before = true; \ - } \ - if ((*obj.include)[2]) { \ - if (before) s << obj.delem;\ - s << obj.manip << obj.obj->names[2];\ - before = true; \ - } \ - if ((*obj.include)[3]) { \ - if (before) s << obj.delem;\ - s << obj.manip << obj.obj->names[3];\ - before = true; \ - } \ - if ((*obj.include)[4]) { \ - if (before) s << obj.delem;\ - s << obj.manip << obj.obj->names[4];\ - before = true; \ - } \ - if ((*obj.include)[5]) { \ - if (before) s << obj.delem;\ - s << obj.manip << obj.obj->names[5];\ - before = true; \ - } \ - if ((*obj.include)[6]) { \ - if (before) s << obj.delem;\ - s << obj.manip << obj.obj->names[6];\ - before = true; \ - } \ - if ((*obj.include)[7]) { \ - if (before) s << obj.delem;\ - s << obj.manip << obj.obj->names[7];\ - } \ - return s; \ - } \ - template \ - std::ostream& operator << (std::ostream& s, const NAME##_cus_equal_list& obj) { \ - bool before = false; \ - if ((*obj.include)[0]) { \ - s << obj.obj->names[0] << obj.comp << obj.manip << obj.obj->I1;\ - before = true; \ - } \ - if ((*obj.include)[1]) { \ - if (before) s << obj.delem;\ - s << obj.obj->names[1] << obj.comp << obj.manip << obj.obj->I2;\ - before = true; \ - } \ - if ((*obj.include)[2]) { \ - if (before) s << obj.delem;\ - s << obj.obj->names[2] << obj.comp << obj.manip << obj.obj->I3;\ - before = true; \ - } \ - if ((*obj.include)[3]) { \ - if (before) s << obj.delem;\ - s << obj.obj->names[3] << obj.comp << obj.manip << obj.obj->I4;\ - before = true; \ - } \ - if ((*obj.include)[4]) { \ - if (before) s << obj.delem;\ - s << obj.obj->names[4] << obj.comp << obj.manip << obj.obj->I5;\ - before = true; \ - } \ - if ((*obj.include)[5]) { \ - if (before) s << obj.delem;\ - s << obj.obj->names[5] << obj.comp << obj.manip << obj.obj->I6;\ - before = true; \ - } \ - if ((*obj.include)[6]) { \ - if (before) s << obj.delem;\ - s << obj.obj->names[6] << obj.comp << obj.manip << obj.obj->I7;\ - before = true; \ - } \ - if ((*obj.include)[7]) { \ - if (before) s << obj.delem;\ - s << obj.obj->names[7] << obj.comp << obj.manip << obj.obj->I8;\ - } \ - return s; \ - } \ - template \ - inline NAME##_value_list NAME::value_list(cchar *d, Manip m) const { \ - return NAME##_value_list (this, d, m); \ - } \ - template \ - inline NAME##_field_list NAME::field_list(cchar *d, Manip m) const { \ - return NAME##_field_list (this, d, m); \ - } \ - template \ - inline NAME##_equal_list NAME::equal_list(cchar *d, cchar *c, Manip m) const { \ - return NAME##_equal_list (this, d, c, m); \ - } \ - template \ - inline NAME##_cus_value_list NAME::value_list(cchar *d, Manip m,\ - bool i1, bool i2, bool i3, bool i4, bool i5, bool i6, bool i7, bool i8) const {\ - return NAME##_cus_value_list (this, d, m, i1, i2, i3, i4, i5, i6, i7, i8); \ - } \ - template \ - inline NAME##_cus_field_list NAME::field_list(cchar *d, Manip m,\ - bool i1, bool i2, bool i3, bool i4, bool i5, bool i6, bool i7, bool i8) const { \ - return NAME##_cus_field_list (this, d, m, i1, i2, i3, i4, i5, i6, i7, i8); \ - } \ - template \ - inline NAME##_cus_equal_list NAME::equal_list(cchar *d, cchar *c, Manip m,\ - bool i1, bool i2, bool i3, bool i4, bool i5, bool i6, bool i7, bool i8) const { \ - return NAME##_cus_equal_list (this, d, c, m, i1, i2, i3, i4, i5, i6, i7, i8); \ - } \ - template \ - inline NAME##_cus_value_list NAME::value_list(cchar *d, Manip m,\ - NAME##_enum i1, NAME##_enum i2, NAME##_enum i3, NAME##_enum i4, NAME##_enum i5, NAME##_enum i6, NAME##_enum i7, NAME##_enum i8) const { \ - return NAME##_cus_value_list (this, d, m, i1, i2, i3, i4, i5, i6, i7, i8); \ - } \ - template \ - inline NAME##_cus_field_list NAME::field_list(cchar *d, Manip m,\ - NAME##_enum i1, NAME##_enum i2, NAME##_enum i3, NAME##_enum i4, NAME##_enum i5, NAME##_enum i6, NAME##_enum i7, NAME##_enum i8) const {\ - return NAME##_cus_field_list (this, d, m, i1, i2, i3, i4, i5, i6, i7, i8); \ - } \ - template \ - inline NAME##_cus_equal_list NAME::equal_list(cchar *d, cchar *c, Manip m, \ - NAME##_enum i1, NAME##_enum i2, NAME##_enum i3, NAME##_enum i4, NAME##_enum i5, NAME##_enum i6, NAME##_enum i7, NAME##_enum i8) const { \ - return NAME##_cus_equal_list (this, d, c, m, i1, i2, i3, i4, i5, i6, i7, i8); \ - } \ - template \ - inline NAME##_cus_value_list NAME::value_list(cchar *d, Manip m,\ - std::vector *i) const {\ - return NAME##_cus_value_list (this, d, m, i);\ - }\ - template \ - inline NAME##_cus_field_list NAME::field_list(cchar *d, Manip m,\ - std::vector *i) const {\ - return NAME##_cus_field_list (this, d, m, i);\ - }\ - template \ - inline NAME##_cus_equal_list NAME::equal_list(cchar *d, cchar *c, Manip m,\ - std::vector *i) const {\ - return NAME##_cus_equal_list (this, d, c, m, i);\ - }\ - template \ - inline NAME##_cus_value_list \ - NAME::value_list(cchar *d, Manip m, sql_cmp_type /*sc*/) const {\ - sql_compare_type_def_##CMP (NAME, value, NUM);\ - }\ - template \ - inline NAME##_cus_field_list \ - NAME::field_list(cchar *d, Manip m, sql_cmp_type /*sc*/) const {\ - sql_compare_type_def_##CMP (NAME, field, NUM);\ - }\ - template \ - inline NAME##_cus_equal_list \ - NAME::equal_list(cchar *d, cchar *c, Manip m, sql_cmp_type /*sc*/) const {\ - sql_compare_type_defe_##CMP (NAME, equal, NUM);\ - }\ - template \ - void populate_##NAME (NAME *s, const Row &row) { \ - s->I1 = static_cast(row.at(O1));\ - s->I2 = static_cast(row.at(O2));\ - s->I3 = static_cast(row.at(O3));\ - s->I4 = static_cast(row.at(O4));\ - s->I5 = static_cast(row.at(O5));\ - s->I6 = static_cast(row.at(O6));\ - s->I7 = static_cast(row.at(O7));\ - s->I8 = static_cast(row.at(O8));\ - } \ - inline NAME::NAME (const Row &row) \ - {populate_##NAME(this, row);}\ - inline void NAME::set (const Row &row)\ - {populate_##NAME(this, row);}\ - sql_COMPARE__##CMP(NAME, I1, I2, I3, I4, I5, I6, I7, I8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ) - -#define sql_create_basic_8(NAME, CMP, CONTR, T1, I1, T2, I2, T3, I3, T4, I4, T5, I5, T6, I6, T7, I7, T8, I8) \ - sql_create_basic_c_order_8(NAME, CMP, CONTR, T1, I1, 0, T2, I2, 1, T3, I3, 2, T4, I4, 3, T5, I5, 4, T6, I6, 5, T7, I7, 6, T8, I8, 7) - -#define sql_create_8(NAME, CMP, CONTR, T1, I1, T2, I2, T3, I3, T4, I4, T5, I5, T6, I6, T7, I7, T8, I8) \ - sql_create_complete_8(NAME, CMP, CONTR, T1, I1, #I1, 0, T2, I2, #I2, 1, T3, I3, #I3, 2, T4, I4, #I4, 3, T5, I5, #I5, 4, T6, I6, #I6, 5, T7, I7, #I7, 6, T8, I8, #I8, 7) \ - -#define sql_create_c_order_8(NAME, CMP, CONTR, T1, I1, O1, T2, I2, O2, T3, I3, O3, T4, I4, O4, T5, I5, O5, T6, I6, O6, T7, I7, O7, T8, I8, O8) \ - sql_create_complete_8(NAME, CMP, CONTR, T1, I1, #I1, O1, T2, I2, #I2, O2, T3, I3, #I3, O3, T4, I4, #I4, O4, T5, I5, #I5, O5, T6, I6, #I6, O6, T7, I7, #I7, O7, T8, I8, #I8, O8) - -#define sql_create_c_names_8(NAME, CMP, CONTR, T1, I1, N1, T2, I2, N2, T3, I3, N3, T4, I4, N4, T5, I5, N5, T6, I6, N6, T7, I7, N7, T8, I8, N8) \ - sql_create_complete_8(NAME, CMP, CONTR, T1, I1, N1, 0, T2, I2, N2, 1, T3, I3, N3, 2, T4, I4, N4, 3, T5, I5, N5, 4, T6, I6, N6, 5, T7, I7, N7, 6, T8, I8, N8, 7) - -// --------------------------------------------------- -// End Create 8 -// --------------------------------------------------- - -// --------------------------------------------------- -// Begin Create 9 -// --------------------------------------------------- -#define sql_create_basic_c_order_9(NAME, CMP, CONTR, T1, I1, O1, T2, I2, O2, T3, I3, O3, T4, I4, O4, T5, I5, O5, T6, I6, O6, T7, I7, O7, T8, I8, O8, T9, I9, O9)\ - struct NAME; \ - template int sql_compare_##NAME (const NAME &, const NAME &);\ - struct NAME { \ - T1 I1;\ - T2 I2;\ - T3 I3;\ - T4 I4;\ - T5 I5;\ - T6 I6;\ - T7 I7;\ - T8 I8;\ - T9 I9; \ - NAME () {} \ - NAME (const Row &row);\ - sql_compare_define_##CMP(NAME, T1, I1, T2, I2, T3, I3, T4, I4, T5, I5, T6, I6, T7, I7, T8, I8, T9, I9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0)\ - }; \ - template \ - void populate_##NAME (NAME *s, const Row &row) { \ - s->I1 = static_cast(row.at(O1));\ - s->I2 = static_cast(row.at(O2));\ - s->I3 = static_cast(row.at(O3));\ - s->I4 = static_cast(row.at(O4));\ - s->I5 = static_cast(row.at(O5));\ - s->I6 = static_cast(row.at(O6));\ - s->I7 = static_cast(row.at(O7));\ - s->I8 = static_cast(row.at(O8));\ - s->I9 = static_cast(row.at(O9)); \ - } \ - inline NAME::NAME (const Row &row) \ - {populate_##NAME(this, row);} \ - sql_COMPARE__##CMP(NAME, I1, I2, I3, I4, I5, I6, I7, I8, I9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ) - -#define sql_create_complete_9(NAME, CMP, CONTR, T1, I1, N1, O1, T2, I2, N2, O2, T3, I3, N3, O3, T4, I4, N4, O4, T5, I5, N5, O5, T6, I6, N6, O6, T7, I7, N7, O7, T8, I8, N8, O8, T9, I9, N9, O9) \ - struct NAME; \ - enum NAME##_enum { \ - NAME##_##I1,\ - NAME##_##I2,\ - NAME##_##I3,\ - NAME##_##I4,\ - NAME##_##I5,\ - NAME##_##I6,\ - NAME##_##I7,\ - NAME##_##I8,\ - NAME##_##I9 \ - ,NAME##_NULL \ - }; \ - template \ - class NAME##_value_list { \ - /*friend std::ostream& operator << <> (std::ostream&, const NAME##_value_list&); */\ - public: \ - const NAME *obj;\ - cchar *delem;\ - Manip manip;\ - public: \ - NAME##_value_list (const NAME *o, cchar *d, Manip m) \ - : obj(o), delem(d), manip(m) {} \ - };\ - template \ - class NAME##_##field_list {\ - /* friend std::ostream& operator << <> (std::ostream&, const NAME##_field_list&); */\ - public: \ - const NAME *obj; \ - cchar *delem;\ - Manip manip;\ - public: \ - NAME##_field_list (const NAME *o, cchar *d, Manip m) \ - : obj(o), delem(d), manip(m) {} \ - };\ - template \ - class NAME##_equal_list { \ - /* friend std::ostream& operator << <> (std::ostream&, const NAME##_equal_list&); */\ - public: \ - const NAME *obj;\ - cchar *delem;\ - cchar *comp;\ - Manip manip;\ - public: \ - NAME##_equal_list (const NAME *o, cchar *d, cchar *c, Manip m) \ - : obj(o), delem(d), comp(c), manip(m) {}\ - };\ - template \ - class NAME##_cus_value_list {\ - /* friend std::ostream& operator << <> (std::ostream&, \ - const NAME##_cus_value_list&); */\ - public:\ - const NAME *obj;\ - std::vector *include;\ - bool del_vector;\ - cchar *delem;\ - Manip manip;\ - public: \ - ~NAME##_cus_value_list () {if (del_vector) delete include;} \ - NAME##_cus_value_list (const NAME *o, cchar *d, Manip m, bool i1, bool i2, bool i3, bool i4, bool i5, bool i6, bool i7, bool i8, bool i9);\ - NAME##_cus_value_list (const NAME *o, cchar *d, Manip m, NAME##_enum i1, NAME##_enum i2, NAME##_enum i3, NAME##_enum i4, NAME##_enum i5, NAME##_enum i6, NAME##_enum i7, NAME##_enum i8, NAME##_enum i9); \ - NAME##_cus_value_list (const NAME *o, cchar *d, Manip m ,std::vector* i)\ - : obj(o), include(i), del_vector(false), delem(d), manip(m) {}\ - };\ - template \ - class NAME##_cus_field_list { \ - /* friend std::ostream& operator << <> (std::ostream&, \ - const NAME##_cus_field_list&); */\ - public:\ - const NAME *obj; \ - std::vector *include; \ - bool del_vector; \ - cchar *delem;\ - Manip manip;\ - public: \ - ~NAME##_cus_field_list () {if (del_vector) delete include;} \ - NAME##_cus_field_list (const NAME *o, cchar *d, Manip m, bool i1, bool i2, bool i3, bool i4, bool i5, bool i6, bool i7, bool i8, bool i9); \ - NAME##_cus_field_list (const NAME *o, cchar *d, Manip m, NAME##_enum i1, NAME##_enum i2, NAME##_enum i3, NAME##_enum i4, NAME##_enum i5, NAME##_enum i6, NAME##_enum i7, NAME##_enum i8, NAME##_enum i9); \ - NAME##_cus_field_list (const NAME *o, cchar *d, Manip m, std::vector *i) \ - : obj(o), include(i), del_vector(false), delem(d), manip(m) {}\ - };\ - template \ - class NAME##_cus_equal_list {\ - /* friend std::ostream& operator << <> (std::ostream&, \ - const NAME##_cus_equal_list&); */\ - public:\ - const NAME *obj;\ - std::vector *include;\ - bool del_vector;\ - cchar *delem;\ - cchar *comp;\ - Manip manip;\ - public:\ - ~NAME##_##cus_equal_list () {if (del_vector) delete include;}\ - NAME##_##cus_equal_list (const NAME *o, cchar *d, cchar *c, Manip m, bool i1, bool i2, bool i3, bool i4, bool i5, bool i6, bool i7, bool i8, bool i9); \ - NAME##_##cus_equal_list (const NAME *o, cchar *d, cchar *c, Manip m, NAME##_enum i1, NAME##_enum i2, NAME##_enum i3, NAME##_enum i4, NAME##_enum i5, NAME##_enum i6, NAME##_enum i7, NAME##_enum i8, NAME##_enum i9); \ - NAME##_##cus_equal_list (const NAME *o, cchar *d, cchar *c, Manip m, std::vector *i) \ - : obj(o), include(i), del_vector(false), delem(d), comp(c), manip(m) {}\ - };\ - template int sql_compare_##NAME (const NAME &, const NAME &);\ - struct NAME { \ - T1 I1;\ - T2 I2;\ - T3 I3;\ - T4 I4;\ - T5 I5;\ - T6 I6;\ - T7 I7;\ - T8 I8;\ - T9 I9; \ - NAME () {} \ - NAME (const Row &row);\ - void set (const Row &row);\ - sql_compare_define_##CMP(NAME, T1, I1, T2, I2, T3, I3, T4, I4, T5, I5, T6, I6, T7, I7, T8, I8, T9, I9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0)\ - sql_construct_define_##CONTR(NAME, T1, I1, T2, I2, T3, I3, T4, I4, T5, I5, T6, I6, T7, I7, T8, I8, T9, I9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0)\ - static const char *names[];\ - static const char *_table;\ - static const char *& table() {return _table;}\ - NAME##_value_list value_list() const {\ - return value_list(",", quote);}\ - NAME##_value_list value_list(cchar *d) const {\ - return value_list(d, quote);}\ - template \ - NAME##_value_list value_list(cchar *d, Manip m) const; \ - NAME##_field_list field_list() const {\ - return field_list(",", do_nothing);}\ - NAME##_field_list field_list(cchar *d) const {\ - return field_list(d, do_nothing);}\ - template \ - NAME##_field_list field_list(cchar *d, Manip m) const; \ - NAME##_equal_list equal_list(cchar *d = ",", \ - cchar *c = " = ") const{\ - return equal_list(d, c, quote);}\ - template \ - NAME##_equal_list equal_list(cchar *d, cchar *c, Manip m) const; \ - /* cus_data */\ - NAME##_cus_value_list value_list(bool i1, bool i2 = false, bool i3 = false, bool i4 = false, bool i5 = false, bool i6 = false, bool i7 = false, bool i8 = false, bool i9 = false) const {\ - return value_list(",", quote, i1, i2, i3, i4, i5, i6, i7, i8, i9);\ - }\ - NAME##_cus_value_list value_list(NAME##_enum i1, NAME##_enum i2 = NAME##_NULL, NAME##_enum i3 = NAME##_NULL, NAME##_enum i4 = NAME##_NULL, NAME##_enum i5 = NAME##_NULL, NAME##_enum i6 = NAME##_NULL, NAME##_enum i7 = NAME##_NULL, NAME##_enum i8 = NAME##_NULL, NAME##_enum i9 = NAME##_NULL) const {\ - return value_list(",", quote, i1, i2, i3, i4, i5, i6, i7, i8, i9);\ - }\ - NAME##_cus_value_list value_list(std::vector *i) const {\ - return value_list(",", quote, i);\ - }\ - NAME##_cus_value_list value_list(sql_cmp_type sc) const {\ - return value_list(",", quote, sc);\ - }\ - NAME##_cus_value_list value_list(cchar *d, bool i1, bool i2 = false, bool i3 = false, bool i4 = false, bool i5 = false, bool i6 = false, bool i7 = false, bool i8 = false, bool i9 = false) const {\ - return value_list(d, quote, i1, i2, i3, i4, i5, i6, i7, i8, i9);\ - }\ - NAME##_cus_value_list value_list(cchar *d, NAME##_enum i1, NAME##_enum i2 = NAME##_NULL, NAME##_enum i3 = NAME##_NULL, NAME##_enum i4 = NAME##_NULL, NAME##_enum i5 = NAME##_NULL, NAME##_enum i6 = NAME##_NULL, NAME##_enum i7 = NAME##_NULL, NAME##_enum i8 = NAME##_NULL, NAME##_enum i9 = NAME##_NULL) const {\ - return value_list(d, quote, i1, i2, i3, i4, i5, i6, i7, i8, i9);\ - }\ - NAME##_cus_value_list value_list(cchar *d, \ - std::vector *i) const {\ - return value_list(d, quote, i);\ - }\ - NAME##_cus_value_list value_list(cchar *d, \ - sql_cmp_type sc) const {\ - return value_list(d, quote, sc);\ - }\ - template \ - NAME##_cus_value_list value_list(cchar *d, Manip m,\ - bool i1, bool i2 = false, bool i3 = false, bool i4 = false, bool i5 = false, bool i6 = false, bool i7 = false, bool i8 = false, bool i9 = false) const; \ - template \ - NAME##_cus_value_list value_list(cchar *d, Manip m,\ - NAME##_enum i1, NAME##_enum i2 = NAME##_NULL, NAME##_enum i3 = NAME##_NULL, NAME##_enum i4 = NAME##_NULL, NAME##_enum i5 = NAME##_NULL, NAME##_enum i6 = NAME##_NULL, NAME##_enum i7 = NAME##_NULL, NAME##_enum i8 = NAME##_NULL, NAME##_enum i9 = NAME##_NULL) const; \ - template \ - NAME##_cus_value_list value_list(cchar *d, Manip m, \ - std::vector *i) const;\ - template \ - NAME##_cus_value_list value_list(cchar *d, Manip m, \ - sql_cmp_type sc) const;\ - /* cus field */\ - NAME##_cus_field_list field_list(bool i1, bool i2 = false, bool i3 = false, bool i4 = false, bool i5 = false, bool i6 = false, bool i7 = false, bool i8 = false, bool i9 = false) const {\ - return field_list(",", do_nothing, i1, i2, i3, i4, i5, i6, i7, i8, i9);\ - }\ - NAME##_cus_field_list field_list(NAME##_enum i1, NAME##_enum i2 = NAME##_NULL, NAME##_enum i3 = NAME##_NULL, NAME##_enum i4 = NAME##_NULL, NAME##_enum i5 = NAME##_NULL, NAME##_enum i6 = NAME##_NULL, NAME##_enum i7 = NAME##_NULL, NAME##_enum i8 = NAME##_NULL, NAME##_enum i9 = NAME##_NULL) const {\ - return field_list(",", do_nothing, i1, i2, i3, i4, i5, i6, i7, i8, i9);\ - }\ - NAME##_cus_field_list field_list(std::vector *i) const {\ - return field_list(",", do_nothing, i);\ - }\ - NAME##_cus_field_list field_list(sql_cmp_type sc) const\ - {\ - return field_list(",", do_nothing, sc);\ - }\ - NAME##_cus_field_list field_list(cchar *d, \ - bool i1, bool i2 = false, bool i3 = false, bool i4 = false, bool i5 = false, bool i6 = false, bool i7 = false, bool i8 = false, bool i9 = false) const {\ - return field_list(d, do_nothing, i1, i2, i3, i4, i5, i6, i7, i8, i9);\ - }\ - NAME##_cus_field_list field_list(cchar *d,\ - NAME##_enum i1, NAME##_enum i2 = NAME##_NULL, NAME##_enum i3 = NAME##_NULL, NAME##_enum i4 = NAME##_NULL, NAME##_enum i5 = NAME##_NULL, NAME##_enum i6 = NAME##_NULL, NAME##_enum i7 = NAME##_NULL, NAME##_enum i8 = NAME##_NULL, NAME##_enum i9 = NAME##_NULL) const {\ - return field_list(d, do_nothing, i1, i2, i3, i4, i5, i6, i7, i8, i9);\ - }\ - NAME##_cus_field_list field_list(cchar *d, \ - std::vector *i) const {\ - return field_list(d, do_nothing, i);\ - }\ - NAME##_cus_field_list field_list(cchar *d, \ - sql_cmp_type sc) const {\ - return field_list(d, do_nothing, sc);\ - }\ - template \ - NAME##_cus_field_list field_list(cchar *d, Manip m,\ - bool i1, bool i2 = false, bool i3 = false, bool i4 = false, bool i5 = false, bool i6 = false, bool i7 = false, bool i8 = false, bool i9 = false) const; \ - template \ - NAME##_cus_field_list field_list(cchar *d, Manip m,\ - NAME##_enum i1, NAME##_enum i2 = NAME##_NULL, NAME##_enum i3 = NAME##_NULL, NAME##_enum i4 = NAME##_NULL, NAME##_enum i5 = NAME##_NULL, NAME##_enum i6 = NAME##_NULL, NAME##_enum i7 = NAME##_NULL, NAME##_enum i8 = NAME##_NULL, NAME##_enum i9 = NAME##_NULL) const; \ - template \ - NAME##_cus_field_list field_list(cchar *d, Manip m,\ - std::vector *i) const;\ - template \ - NAME##_cus_field_list field_list(cchar *d, Manip m, \ - sql_cmp_type sc) const;\ - /* cus equal */\ - NAME##_cus_equal_list equal_list(bool i1, bool i2 = false, bool i3 = false, bool i4 = false, bool i5 = false, bool i6 = false, bool i7 = false, bool i8 = false, bool i9 = false) const {\ - return equal_list(",", " = ", quote, i1, i2, i3, i4, i5, i6, i7, i8, i9);\ - }\ - NAME##_cus_equal_list equal_list(NAME##_enum i1, NAME##_enum i2 = NAME##_NULL, NAME##_enum i3 = NAME##_NULL, NAME##_enum i4 = NAME##_NULL, NAME##_enum i5 = NAME##_NULL, NAME##_enum i6 = NAME##_NULL, NAME##_enum i7 = NAME##_NULL, NAME##_enum i8 = NAME##_NULL, NAME##_enum i9 = NAME##_NULL) const {\ - return equal_list(",", " = ", quote, i1, i2, i3, i4, i5, i6, i7, i8, i9);\ - }\ - NAME##_cus_equal_list equal_list(std::vector *i) const {\ - return equal_list(",", " = ", quote, i);\ - }\ - NAME##_cus_equal_list equal_list(sql_cmp_type sc) const {\ - return equal_list(",", " = ", quote, sc);\ - }\ - NAME##_cus_equal_list equal_list(cchar *d, bool i1, bool i2 = false, bool i3 = false, bool i4 = false, bool i5 = false, bool i6 = false, bool i7 = false, bool i8 = false, bool i9 = false) const {\ - return equal_list(d, " = ", quote, i1, i2, i3, i4, i5, i6, i7, i8, i9);\ - }\ - NAME##_cus_equal_list equal_list(cchar *d, NAME##_enum i1, NAME##_enum i2 = NAME##_NULL, NAME##_enum i3 = NAME##_NULL, NAME##_enum i4 = NAME##_NULL, NAME##_enum i5 = NAME##_NULL, NAME##_enum i6 = NAME##_NULL, NAME##_enum i7 = NAME##_NULL, NAME##_enum i8 = NAME##_NULL, NAME##_enum i9 = NAME##_NULL) const {\ - return equal_list(d, " = ", quote, i1, i2, i3, i4, i5, i6, i7, i8, i9);\ - }\ - NAME##_cus_equal_list equal_list(cchar *d, \ - std::vector *i) const {\ - return equal_list(d, " = ", quote, i);\ - }\ - NAME##_cus_equal_list equal_list(cchar *d, \ - sql_cmp_type sc) const {\ - return equal_list(d, " = ", quote, sc);\ - }\ - NAME##_cus_equal_list equal_list(cchar *d, cchar *c,\ - bool i1, bool i2 = false, bool i3 = false, bool i4 = false, bool i5 = false, bool i6 = false, bool i7 = false, bool i8 = false, bool i9 = false) const {\ - return equal_list(d, c, quote, i1, i2, i3, i4, i5, i6, i7, i8, i9);\ - }\ - NAME##_cus_equal_list equal_list(cchar *d, cchar *c,\ - NAME##_enum i1, NAME##_enum i2 = NAME##_NULL, NAME##_enum i3 = NAME##_NULL, NAME##_enum i4 = NAME##_NULL, NAME##_enum i5 = NAME##_NULL, NAME##_enum i6 = NAME##_NULL, NAME##_enum i7 = NAME##_NULL, NAME##_enum i8 = NAME##_NULL, NAME##_enum i9 = NAME##_NULL) const {\ - return equal_list(d, c, quote, i1, i2, i3, i4, i5, i6, i7, i8, i9);\ - }\ - NAME##_cus_equal_list equal_list(cchar *d, cchar *c,\ - std::vector *i) const {\ - return equal_list(d, c, quote, i);\ - }\ - NAME##_cus_equal_list equal_list(cchar *d, cchar *c,\ - sql_cmp_type sc) const {\ - return equal_list(d, c, quote, sc);\ - }\ - template \ - NAME##_cus_equal_list equal_list(cchar *d, cchar *c, Manip m, \ - bool i1, bool i2 = false, bool i3 = false, bool i4 = false, bool i5 = false, bool i6 = false, bool i7 = false, bool i8 = false, bool i9 = false) const; \ - template \ - NAME##_cus_equal_list equal_list(cchar *d, cchar *c, Manip m, \ - NAME##_enum i1, NAME##_enum i2 = NAME##_NULL, NAME##_enum i3 = NAME##_NULL, NAME##_enum i4 = NAME##_NULL, NAME##_enum i5 = NAME##_NULL, NAME##_enum i6 = NAME##_NULL, NAME##_enum i7 = NAME##_NULL, NAME##_enum i8 = NAME##_NULL, NAME##_enum i9 = NAME##_NULL) const; \ - template \ - NAME##_cus_equal_list equal_list(cchar *d, cchar *c, Manip m, \ - std::vector *i) const;\ - template \ - NAME##_cus_equal_list equal_list(cchar *d, cchar *c, Manip m, \ - sql_cmp_type sc) const;\ - }; \ - const char *NAME::names[] = { \ - N1 ,\ - N2 ,\ - N3 ,\ - N4 ,\ - N5 ,\ - N6 ,\ - N7 ,\ - N8 ,\ - N9 \ - }; \ - const char *NAME::_table = #NAME ; \ - template \ - NAME##_cus_value_list::NAME##_cus_value_list\ - (const NAME *o, cchar *d, Manip m, bool i1, bool i2, bool i3, bool i4, bool i5, bool i6, bool i7, bool i8, bool i9) \ - { \ - delem = d;\ - manip = m;\ - del_vector = true;\ - obj = o; \ - include = new std::vector(9, false);\ - if (i1) (*include)[0]=true;\ - if (i2) (*include)[1]=true;\ - if (i3) (*include)[2]=true;\ - if (i4) (*include)[3]=true;\ - if (i5) (*include)[4]=true;\ - if (i6) (*include)[5]=true;\ - if (i7) (*include)[6]=true;\ - if (i8) (*include)[7]=true;\ - if (i9) (*include)[8]=true;\ - } \ - template \ - NAME##_cus_value_list::NAME##_cus_value_list\ - (const NAME *o, cchar *d, Manip m, NAME##_enum i1, NAME##_enum i2, NAME##_enum i3, NAME##_enum i4, NAME##_enum i5, NAME##_enum i6, NAME##_enum i7, NAME##_enum i8, NAME##_enum i9) { \ - delem = d;\ - manip = m;\ - del_vector = true; \ - obj = o; \ - include = new std::vector(9, false); \ - if (i1 == NAME##_NULL) return;\ - (*include)[i1]=true;\ - if (i2 == NAME##_NULL) return;\ - (*include)[i2]=true;\ - if (i3 == NAME##_NULL) return;\ - (*include)[i3]=true;\ - if (i4 == NAME##_NULL) return;\ - (*include)[i4]=true;\ - if (i5 == NAME##_NULL) return;\ - (*include)[i5]=true;\ - if (i6 == NAME##_NULL) return;\ - (*include)[i6]=true;\ - if (i7 == NAME##_NULL) return;\ - (*include)[i7]=true;\ - if (i8 == NAME##_NULL) return;\ - (*include)[i8]=true;\ - if (i9 == NAME##_NULL) return;\ - (*include)[i9]=true;\ - }\ - template \ - NAME##_cus_field_list::NAME##_cus_field_list\ - (const NAME *o, cchar *d, Manip m, bool i1, bool i2, bool i3, bool i4, bool i5, bool i6, bool i7, bool i8, bool i9) {\ - delem = d;\ - manip = m;\ - del_vector = true; \ - obj = o; \ - include = new std::vector(9, false); \ - if (i1) (*include)[0]=true;\ - if (i2) (*include)[1]=true;\ - if (i3) (*include)[2]=true;\ - if (i4) (*include)[3]=true;\ - if (i5) (*include)[4]=true;\ - if (i6) (*include)[5]=true;\ - if (i7) (*include)[6]=true;\ - if (i8) (*include)[7]=true;\ - if (i9) (*include)[8]=true;\ - } \ - template \ - NAME##_cus_field_list::NAME##_cus_field_list\ - (const NAME *o, cchar *d, Manip m, NAME##_enum i1, NAME##_enum i2, NAME##_enum i3, NAME##_enum i4, NAME##_enum i5, NAME##_enum i6, NAME##_enum i7, NAME##_enum i8, NAME##_enum i9) { \ - delem = d;\ - manip = m;\ - del_vector = true; \ - obj = o; \ - include = new std::vector(9, false); \ - if (i1 == NAME##_NULL) return;\ - (*include)[i1]=true;\ - if (i2 == NAME##_NULL) return;\ - (*include)[i2]=true;\ - if (i3 == NAME##_NULL) return;\ - (*include)[i3]=true;\ - if (i4 == NAME##_NULL) return;\ - (*include)[i4]=true;\ - if (i5 == NAME##_NULL) return;\ - (*include)[i5]=true;\ - if (i6 == NAME##_NULL) return;\ - (*include)[i6]=true;\ - if (i7 == NAME##_NULL) return;\ - (*include)[i7]=true;\ - if (i8 == NAME##_NULL) return;\ - (*include)[i8]=true;\ - if (i9 == NAME##_NULL) return;\ - (*include)[i9]=true;\ - }\ - template \ - NAME##_cus_equal_list::NAME##_cus_equal_list\ - (const NAME *o, cchar *d, cchar *c, Manip m, bool i1, bool i2, bool i3, bool i4, bool i5, bool i6, bool i7, bool i8, bool i9) { \ - delem = d;\ - comp = c;\ - manip = m;\ - del_vector = true; \ - obj = o; \ - include = new std::vector(9, false); \ - if (i1) (*include)[0]=true;\ - if (i2) (*include)[1]=true;\ - if (i3) (*include)[2]=true;\ - if (i4) (*include)[3]=true;\ - if (i5) (*include)[4]=true;\ - if (i6) (*include)[5]=true;\ - if (i7) (*include)[6]=true;\ - if (i8) (*include)[7]=true;\ - if (i9) (*include)[8]=true;\ - } \ - template \ - NAME##_cus_equal_list::NAME##_cus_equal_list\ - (const NAME *o, cchar *d, cchar *c, Manip m, NAME##_enum i1, NAME##_enum i2, NAME##_enum i3, NAME##_enum i4, NAME##_enum i5, NAME##_enum i6, NAME##_enum i7, NAME##_enum i8, NAME##_enum i9) { \ - delem = d;\ - comp = c;\ - manip = m;\ - del_vector = true; \ - obj = o; \ - include = new std::vector(9, false); \ - if (i1 == NAME##_NULL) return;\ - (*include)[i1]=true;\ - if (i2 == NAME##_NULL) return;\ - (*include)[i2]=true;\ - if (i3 == NAME##_NULL) return;\ - (*include)[i3]=true;\ - if (i4 == NAME##_NULL) return;\ - (*include)[i4]=true;\ - if (i5 == NAME##_NULL) return;\ - (*include)[i5]=true;\ - if (i6 == NAME##_NULL) return;\ - (*include)[i6]=true;\ - if (i7 == NAME##_NULL) return;\ - (*include)[i7]=true;\ - if (i8 == NAME##_NULL) return;\ - (*include)[i8]=true;\ - if (i9 == NAME##_NULL) return;\ - (*include)[i9]=true;\ - }\ - template \ - std::ostream& operator << (std::ostream& s, const NAME##_value_list& obj) { \ - s << obj.manip << obj.obj->I1 << obj.delem;\ - s << obj.manip << obj.obj->I2 << obj.delem;\ - s << obj.manip << obj.obj->I3 << obj.delem;\ - s << obj.manip << obj.obj->I4 << obj.delem;\ - s << obj.manip << obj.obj->I5 << obj.delem;\ - s << obj.manip << obj.obj->I6 << obj.delem;\ - s << obj.manip << obj.obj->I7 << obj.delem;\ - s << obj.manip << obj.obj->I8 << obj.delem;\ - s << obj.manip << obj.obj->I9; \ - return s; \ - } \ - template \ - std::ostream& operator << (std::ostream& s, const NAME##_field_list& obj) { \ - s << obj.manip << obj.obj->names[0] << obj.delem;\ - s << obj.manip << obj.obj->names[1] << obj.delem;\ - s << obj.manip << obj.obj->names[2] << obj.delem;\ - s << obj.manip << obj.obj->names[3] << obj.delem;\ - s << obj.manip << obj.obj->names[4] << obj.delem;\ - s << obj.manip << obj.obj->names[5] << obj.delem;\ - s << obj.manip << obj.obj->names[6] << obj.delem;\ - s << obj.manip << obj.obj->names[7] << obj.delem;\ - s << obj.manip << obj.obj->names[8]; \ - return s; \ - } \ - template \ - std::ostream& operator << (std::ostream& s, const NAME##_equal_list& obj) { \ - s << obj.obj->names[0] << obj.comp << obj.manip << obj.obj->I1 << obj.delem;\ - s << obj.obj->names[1] << obj.comp << obj.manip << obj.obj->I2 << obj.delem;\ - s << obj.obj->names[2] << obj.comp << obj.manip << obj.obj->I3 << obj.delem;\ - s << obj.obj->names[3] << obj.comp << obj.manip << obj.obj->I4 << obj.delem;\ - s << obj.obj->names[4] << obj.comp << obj.manip << obj.obj->I5 << obj.delem;\ - s << obj.obj->names[5] << obj.comp << obj.manip << obj.obj->I6 << obj.delem;\ - s << obj.obj->names[6] << obj.comp << obj.manip << obj.obj->I7 << obj.delem;\ - s << obj.obj->names[7] << obj.comp << obj.manip << obj.obj->I8 << obj.delem;\ - s << obj.obj->names[8] << obj.comp << obj.manip << obj.obj->I9; \ - return s; \ - } \ - template \ - std::ostream& operator << (std::ostream& s, const NAME##_cus_value_list& obj) { \ - bool before = false; \ - if ((*obj.include)[0]) { \ - s << obj.manip << obj.obj->I1;\ - before = true; \ - } \ - if ((*obj.include)[1]) { \ - if (before) s << obj.delem;\ - s << obj.manip << obj.obj->I2;\ - before = true; \ - } \ - if ((*obj.include)[2]) { \ - if (before) s << obj.delem;\ - s << obj.manip << obj.obj->I3;\ - before = true; \ - } \ - if ((*obj.include)[3]) { \ - if (before) s << obj.delem;\ - s << obj.manip << obj.obj->I4;\ - before = true; \ - } \ - if ((*obj.include)[4]) { \ - if (before) s << obj.delem;\ - s << obj.manip << obj.obj->I5;\ - before = true; \ - } \ - if ((*obj.include)[5]) { \ - if (before) s << obj.delem;\ - s << obj.manip << obj.obj->I6;\ - before = true; \ - } \ - if ((*obj.include)[6]) { \ - if (before) s << obj.delem;\ - s << obj.manip << obj.obj->I7;\ - before = true; \ - } \ - if ((*obj.include)[7]) { \ - if (before) s << obj.delem;\ - s << obj.manip << obj.obj->I8;\ - before = true; \ - } \ - if ((*obj.include)[8]) { \ - if (before) s << obj.delem;\ - s << obj.manip << obj.obj->I9;\ - } \ - return s; \ - } \ - template \ - std::ostream& operator << (std::ostream& s, const NAME##_cus_field_list& obj) { \ - bool before = false; \ - if ((*obj.include)[0]) { \ - s << obj.manip << obj.obj->names[0];\ - before = true; \ - } \ - if ((*obj.include)[1]) { \ - if (before) s << obj.delem;\ - s << obj.manip << obj.obj->names[1];\ - before = true; \ - } \ - if ((*obj.include)[2]) { \ - if (before) s << obj.delem;\ - s << obj.manip << obj.obj->names[2];\ - before = true; \ - } \ - if ((*obj.include)[3]) { \ - if (before) s << obj.delem;\ - s << obj.manip << obj.obj->names[3];\ - before = true; \ - } \ - if ((*obj.include)[4]) { \ - if (before) s << obj.delem;\ - s << obj.manip << obj.obj->names[4];\ - before = true; \ - } \ - if ((*obj.include)[5]) { \ - if (before) s << obj.delem;\ - s << obj.manip << obj.obj->names[5];\ - before = true; \ - } \ - if ((*obj.include)[6]) { \ - if (before) s << obj.delem;\ - s << obj.manip << obj.obj->names[6];\ - before = true; \ - } \ - if ((*obj.include)[7]) { \ - if (before) s << obj.delem;\ - s << obj.manip << obj.obj->names[7];\ - before = true; \ - } \ - if ((*obj.include)[8]) { \ - if (before) s << obj.delem;\ - s << obj.manip << obj.obj->names[8];\ - } \ - return s; \ - } \ - template \ - std::ostream& operator << (std::ostream& s, const NAME##_cus_equal_list& obj) { \ - bool before = false; \ - if ((*obj.include)[0]) { \ - s << obj.obj->names[0] << obj.comp << obj.manip << obj.obj->I1;\ - before = true; \ - } \ - if ((*obj.include)[1]) { \ - if (before) s << obj.delem;\ - s << obj.obj->names[1] << obj.comp << obj.manip << obj.obj->I2;\ - before = true; \ - } \ - if ((*obj.include)[2]) { \ - if (before) s << obj.delem;\ - s << obj.obj->names[2] << obj.comp << obj.manip << obj.obj->I3;\ - before = true; \ - } \ - if ((*obj.include)[3]) { \ - if (before) s << obj.delem;\ - s << obj.obj->names[3] << obj.comp << obj.manip << obj.obj->I4;\ - before = true; \ - } \ - if ((*obj.include)[4]) { \ - if (before) s << obj.delem;\ - s << obj.obj->names[4] << obj.comp << obj.manip << obj.obj->I5;\ - before = true; \ - } \ - if ((*obj.include)[5]) { \ - if (before) s << obj.delem;\ - s << obj.obj->names[5] << obj.comp << obj.manip << obj.obj->I6;\ - before = true; \ - } \ - if ((*obj.include)[6]) { \ - if (before) s << obj.delem;\ - s << obj.obj->names[6] << obj.comp << obj.manip << obj.obj->I7;\ - before = true; \ - } \ - if ((*obj.include)[7]) { \ - if (before) s << obj.delem;\ - s << obj.obj->names[7] << obj.comp << obj.manip << obj.obj->I8;\ - before = true; \ - } \ - if ((*obj.include)[8]) { \ - if (before) s << obj.delem;\ - s << obj.obj->names[8] << obj.comp << obj.manip << obj.obj->I9;\ - } \ - return s; \ - } \ - template \ - inline NAME##_value_list NAME::value_list(cchar *d, Manip m) const { \ - return NAME##_value_list (this, d, m); \ - } \ - template \ - inline NAME##_field_list NAME::field_list(cchar *d, Manip m) const { \ - return NAME##_field_list (this, d, m); \ - } \ - template \ - inline NAME##_equal_list NAME::equal_list(cchar *d, cchar *c, Manip m) const { \ - return NAME##_equal_list (this, d, c, m); \ - } \ - template \ - inline NAME##_cus_value_list NAME::value_list(cchar *d, Manip m,\ - bool i1, bool i2, bool i3, bool i4, bool i5, bool i6, bool i7, bool i8, bool i9) const {\ - return NAME##_cus_value_list (this, d, m, i1, i2, i3, i4, i5, i6, i7, i8, i9); \ - } \ - template \ - inline NAME##_cus_field_list NAME::field_list(cchar *d, Manip m,\ - bool i1, bool i2, bool i3, bool i4, bool i5, bool i6, bool i7, bool i8, bool i9) const { \ - return NAME##_cus_field_list (this, d, m, i1, i2, i3, i4, i5, i6, i7, i8, i9); \ - } \ - template \ - inline NAME##_cus_equal_list NAME::equal_list(cchar *d, cchar *c, Manip m,\ - bool i1, bool i2, bool i3, bool i4, bool i5, bool i6, bool i7, bool i8, bool i9) const { \ - return NAME##_cus_equal_list (this, d, c, m, i1, i2, i3, i4, i5, i6, i7, i8, i9); \ - } \ - template \ - inline NAME##_cus_value_list NAME::value_list(cchar *d, Manip m,\ - NAME##_enum i1, NAME##_enum i2, NAME##_enum i3, NAME##_enum i4, NAME##_enum i5, NAME##_enum i6, NAME##_enum i7, NAME##_enum i8, NAME##_enum i9) const { \ - return NAME##_cus_value_list (this, d, m, i1, i2, i3, i4, i5, i6, i7, i8, i9); \ - } \ - template \ - inline NAME##_cus_field_list NAME::field_list(cchar *d, Manip m,\ - NAME##_enum i1, NAME##_enum i2, NAME##_enum i3, NAME##_enum i4, NAME##_enum i5, NAME##_enum i6, NAME##_enum i7, NAME##_enum i8, NAME##_enum i9) const {\ - return NAME##_cus_field_list (this, d, m, i1, i2, i3, i4, i5, i6, i7, i8, i9); \ - } \ - template \ - inline NAME##_cus_equal_list NAME::equal_list(cchar *d, cchar *c, Manip m, \ - NAME##_enum i1, NAME##_enum i2, NAME##_enum i3, NAME##_enum i4, NAME##_enum i5, NAME##_enum i6, NAME##_enum i7, NAME##_enum i8, NAME##_enum i9) const { \ - return NAME##_cus_equal_list (this, d, c, m, i1, i2, i3, i4, i5, i6, i7, i8, i9); \ - } \ - template \ - inline NAME##_cus_value_list NAME::value_list(cchar *d, Manip m,\ - std::vector *i) const {\ - return NAME##_cus_value_list (this, d, m, i);\ - }\ - template \ - inline NAME##_cus_field_list NAME::field_list(cchar *d, Manip m,\ - std::vector *i) const {\ - return NAME##_cus_field_list (this, d, m, i);\ - }\ - template \ - inline NAME##_cus_equal_list NAME::equal_list(cchar *d, cchar *c, Manip m,\ - std::vector *i) const {\ - return NAME##_cus_equal_list (this, d, c, m, i);\ - }\ - template \ - inline NAME##_cus_value_list \ - NAME::value_list(cchar *d, Manip m, sql_cmp_type /*sc*/) const {\ - sql_compare_type_def_##CMP (NAME, value, NUM);\ - }\ - template \ - inline NAME##_cus_field_list \ - NAME::field_list(cchar *d, Manip m, sql_cmp_type /*sc*/) const {\ - sql_compare_type_def_##CMP (NAME, field, NUM);\ - }\ - template \ - inline NAME##_cus_equal_list \ - NAME::equal_list(cchar *d, cchar *c, Manip m, sql_cmp_type /*sc*/) const {\ - sql_compare_type_defe_##CMP (NAME, equal, NUM);\ - }\ - template \ - void populate_##NAME (NAME *s, const Row &row) { \ - s->I1 = static_cast(row.at(O1));\ - s->I2 = static_cast(row.at(O2));\ - s->I3 = static_cast(row.at(O3));\ - s->I4 = static_cast(row.at(O4));\ - s->I5 = static_cast(row.at(O5));\ - s->I6 = static_cast(row.at(O6));\ - s->I7 = static_cast(row.at(O7));\ - s->I8 = static_cast(row.at(O8));\ - s->I9 = static_cast(row.at(O9));\ - } \ - inline NAME::NAME (const Row &row) \ - {populate_##NAME(this, row);}\ - inline void NAME::set (const Row &row)\ - {populate_##NAME(this, row);}\ - sql_COMPARE__##CMP(NAME, I1, I2, I3, I4, I5, I6, I7, I8, I9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ) - -#define sql_create_basic_9(NAME, CMP, CONTR, T1, I1, T2, I2, T3, I3, T4, I4, T5, I5, T6, I6, T7, I7, T8, I8, T9, I9) \ - sql_create_basic_c_order_9(NAME, CMP, CONTR, T1, I1, 0, T2, I2, 1, T3, I3, 2, T4, I4, 3, T5, I5, 4, T6, I6, 5, T7, I7, 6, T8, I8, 7, T9, I9, 8) - -#define sql_create_9(NAME, CMP, CONTR, T1, I1, T2, I2, T3, I3, T4, I4, T5, I5, T6, I6, T7, I7, T8, I8, T9, I9) \ - sql_create_complete_9(NAME, CMP, CONTR, T1, I1, #I1, 0, T2, I2, #I2, 1, T3, I3, #I3, 2, T4, I4, #I4, 3, T5, I5, #I5, 4, T6, I6, #I6, 5, T7, I7, #I7, 6, T8, I8, #I8, 7, T9, I9, #I9, 8) \ - -#define sql_create_c_order_9(NAME, CMP, CONTR, T1, I1, O1, T2, I2, O2, T3, I3, O3, T4, I4, O4, T5, I5, O5, T6, I6, O6, T7, I7, O7, T8, I8, O8, T9, I9, O9) \ - sql_create_complete_9(NAME, CMP, CONTR, T1, I1, #I1, O1, T2, I2, #I2, O2, T3, I3, #I3, O3, T4, I4, #I4, O4, T5, I5, #I5, O5, T6, I6, #I6, O6, T7, I7, #I7, O7, T8, I8, #I8, O8, T9, I9, #I9, O9) - -#define sql_create_c_names_9(NAME, CMP, CONTR, T1, I1, N1, T2, I2, N2, T3, I3, N3, T4, I4, N4, T5, I5, N5, T6, I6, N6, T7, I7, N7, T8, I8, N8, T9, I9, N9) \ - sql_create_complete_9(NAME, CMP, CONTR, T1, I1, N1, 0, T2, I2, N2, 1, T3, I3, N3, 2, T4, I4, N4, 3, T5, I5, N5, 4, T6, I6, N6, 5, T7, I7, N7, 6, T8, I8, N8, 7, T9, I9, N9, 8) - -// --------------------------------------------------- -// End Create 9 -// --------------------------------------------------- - -// --------------------------------------------------- -// Begin Create 10 -// --------------------------------------------------- -#define sql_create_basic_c_order_10(NAME, CMP, CONTR, T1, I1, O1, T2, I2, O2, T3, I3, O3, T4, I4, O4, T5, I5, O5, T6, I6, O6, T7, I7, O7, T8, I8, O8, T9, I9, O9, T10, I10, O10)\ - struct NAME; \ - template int sql_compare_##NAME (const NAME &, const NAME &);\ - struct NAME { \ - T1 I1;\ - T2 I2;\ - T3 I3;\ - T4 I4;\ - T5 I5;\ - T6 I6;\ - T7 I7;\ - T8 I8;\ - T9 I9;\ - T10 I10; \ - NAME () {} \ - NAME (const Row &row);\ - sql_compare_define_##CMP(NAME, T1, I1, T2, I2, T3, I3, T4, I4, T5, I5, T6, I6, T7, I7, T8, I8, T9, I9, T10, I10, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0)\ - }; \ - template \ - void populate_##NAME (NAME *s, const Row &row) { \ - s->I1 = static_cast(row.at(O1));\ - s->I2 = static_cast(row.at(O2));\ - s->I3 = static_cast(row.at(O3));\ - s->I4 = static_cast(row.at(O4));\ - s->I5 = static_cast(row.at(O5));\ - s->I6 = static_cast(row.at(O6));\ - s->I7 = static_cast(row.at(O7));\ - s->I8 = static_cast(row.at(O8));\ - s->I9 = static_cast(row.at(O9));\ - s->I10 = static_cast(row.at(O10)); \ - } \ - inline NAME::NAME (const Row &row) \ - {populate_##NAME(this, row);} \ - sql_COMPARE__##CMP(NAME, I1, I2, I3, I4, I5, I6, I7, I8, I9, I10, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ) - -#define sql_create_complete_10(NAME, CMP, CONTR, T1, I1, N1, O1, T2, I2, N2, O2, T3, I3, N3, O3, T4, I4, N4, O4, T5, I5, N5, O5, T6, I6, N6, O6, T7, I7, N7, O7, T8, I8, N8, O8, T9, I9, N9, O9, T10, I10, N10, O10) \ - struct NAME; \ - enum NAME##_enum { \ - NAME##_##I1,\ - NAME##_##I2,\ - NAME##_##I3,\ - NAME##_##I4,\ - NAME##_##I5,\ - NAME##_##I6,\ - NAME##_##I7,\ - NAME##_##I8,\ - NAME##_##I9,\ - NAME##_##I10 \ - ,NAME##_NULL \ - }; \ - template \ - class NAME##_value_list { \ - /*friend std::ostream& operator << <> (std::ostream&, const NAME##_value_list&); */\ - public: \ - const NAME *obj;\ - cchar *delem;\ - Manip manip;\ - public: \ - NAME##_value_list (const NAME *o, cchar *d, Manip m) \ - : obj(o), delem(d), manip(m) {} \ - };\ - template \ - class NAME##_##field_list {\ - /* friend std::ostream& operator << <> (std::ostream&, const NAME##_field_list&); */\ - public: \ - const NAME *obj; \ - cchar *delem;\ - Manip manip;\ - public: \ - NAME##_field_list (const NAME *o, cchar *d, Manip m) \ - : obj(o), delem(d), manip(m) {} \ - };\ - template \ - class NAME##_equal_list { \ - /* friend std::ostream& operator << <> (std::ostream&, const NAME##_equal_list&); */\ - public: \ - const NAME *obj;\ - cchar *delem;\ - cchar *comp;\ - Manip manip;\ - public: \ - NAME##_equal_list (const NAME *o, cchar *d, cchar *c, Manip m) \ - : obj(o), delem(d), comp(c), manip(m) {}\ - };\ - template \ - class NAME##_cus_value_list {\ - /* friend std::ostream& operator << <> (std::ostream&, \ - const NAME##_cus_value_list&); */\ - public:\ - const NAME *obj;\ - std::vector *include;\ - bool del_vector;\ - cchar *delem;\ - Manip manip;\ - public: \ - ~NAME##_cus_value_list () {if (del_vector) delete include;} \ - NAME##_cus_value_list (const NAME *o, cchar *d, Manip m, bool i1, bool i2, bool i3, bool i4, bool i5, bool i6, bool i7, bool i8, bool i9, bool i10);\ - NAME##_cus_value_list (const NAME *o, cchar *d, Manip m, NAME##_enum i1, NAME##_enum i2, NAME##_enum i3, NAME##_enum i4, NAME##_enum i5, NAME##_enum i6, NAME##_enum i7, NAME##_enum i8, NAME##_enum i9, NAME##_enum i10); \ - NAME##_cus_value_list (const NAME *o, cchar *d, Manip m ,std::vector* i)\ - : obj(o), include(i), del_vector(false), delem(d), manip(m) {}\ - };\ - template \ - class NAME##_cus_field_list { \ - /* friend std::ostream& operator << <> (std::ostream&, \ - const NAME##_cus_field_list&); */\ - public:\ - const NAME *obj; \ - std::vector *include; \ - bool del_vector; \ - cchar *delem;\ - Manip manip;\ - public: \ - ~NAME##_cus_field_list () {if (del_vector) delete include;} \ - NAME##_cus_field_list (const NAME *o, cchar *d, Manip m, bool i1, bool i2, bool i3, bool i4, bool i5, bool i6, bool i7, bool i8, bool i9, bool i10); \ - NAME##_cus_field_list (const NAME *o, cchar *d, Manip m, NAME##_enum i1, NAME##_enum i2, NAME##_enum i3, NAME##_enum i4, NAME##_enum i5, NAME##_enum i6, NAME##_enum i7, NAME##_enum i8, NAME##_enum i9, NAME##_enum i10); \ - NAME##_cus_field_list (const NAME *o, cchar *d, Manip m, std::vector *i) \ - : obj(o), include(i), del_vector(false), delem(d), manip(m) {}\ - };\ - template \ - class NAME##_cus_equal_list {\ - /* friend std::ostream& operator << <> (std::ostream&, \ - const NAME##_cus_equal_list&); */\ - public:\ - const NAME *obj;\ - std::vector *include;\ - bool del_vector;\ - cchar *delem;\ - cchar *comp;\ - Manip manip;\ - public:\ - ~NAME##_##cus_equal_list () {if (del_vector) delete include;}\ - NAME##_##cus_equal_list (const NAME *o, cchar *d, cchar *c, Manip m, bool i1, bool i2, bool i3, bool i4, bool i5, bool i6, bool i7, bool i8, bool i9, bool i10); \ - NAME##_##cus_equal_list (const NAME *o, cchar *d, cchar *c, Manip m, NAME##_enum i1, NAME##_enum i2, NAME##_enum i3, NAME##_enum i4, NAME##_enum i5, NAME##_enum i6, NAME##_enum i7, NAME##_enum i8, NAME##_enum i9, NAME##_enum i10); \ - NAME##_##cus_equal_list (const NAME *o, cchar *d, cchar *c, Manip m, std::vector *i) \ - : obj(o), include(i), del_vector(false), delem(d), comp(c), manip(m) {}\ - };\ - template int sql_compare_##NAME (const NAME &, const NAME &);\ - struct NAME { \ - T1 I1;\ - T2 I2;\ - T3 I3;\ - T4 I4;\ - T5 I5;\ - T6 I6;\ - T7 I7;\ - T8 I8;\ - T9 I9;\ - T10 I10; \ - NAME () {} \ - NAME (const Row &row);\ - void set (const Row &row);\ - sql_compare_define_##CMP(NAME, T1, I1, T2, I2, T3, I3, T4, I4, T5, I5, T6, I6, T7, I7, T8, I8, T9, I9, T10, I10, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0)\ - sql_construct_define_##CONTR(NAME, T1, I1, T2, I2, T3, I3, T4, I4, T5, I5, T6, I6, T7, I7, T8, I8, T9, I9, T10, I10, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0)\ - static const char *names[];\ - static const char *_table;\ - static const char *& table() {return _table;}\ - NAME##_value_list value_list() const {\ - return value_list(",", quote);}\ - NAME##_value_list value_list(cchar *d) const {\ - return value_list(d, quote);}\ - template \ - NAME##_value_list value_list(cchar *d, Manip m) const; \ - NAME##_field_list field_list() const {\ - return field_list(",", do_nothing);}\ - NAME##_field_list field_list(cchar *d) const {\ - return field_list(d, do_nothing);}\ - template \ - NAME##_field_list field_list(cchar *d, Manip m) const; \ - NAME##_equal_list equal_list(cchar *d = ",", \ - cchar *c = " = ") const{\ - return equal_list(d, c, quote);}\ - template \ - NAME##_equal_list equal_list(cchar *d, cchar *c, Manip m) const; \ - /* cus_data */\ - NAME##_cus_value_list value_list(bool i1, bool i2 = false, bool i3 = false, bool i4 = false, bool i5 = false, bool i6 = false, bool i7 = false, bool i8 = false, bool i9 = false, bool i10 = false) const {\ - return value_list(",", quote, i1, i2, i3, i4, i5, i6, i7, i8, i9, i10);\ - }\ - NAME##_cus_value_list value_list(NAME##_enum i1, NAME##_enum i2 = NAME##_NULL, NAME##_enum i3 = NAME##_NULL, NAME##_enum i4 = NAME##_NULL, NAME##_enum i5 = NAME##_NULL, NAME##_enum i6 = NAME##_NULL, NAME##_enum i7 = NAME##_NULL, NAME##_enum i8 = NAME##_NULL, NAME##_enum i9 = NAME##_NULL, NAME##_enum i10 = NAME##_NULL) const {\ - return value_list(",", quote, i1, i2, i3, i4, i5, i6, i7, i8, i9, i10);\ - }\ - NAME##_cus_value_list value_list(std::vector *i) const {\ - return value_list(",", quote, i);\ - }\ - NAME##_cus_value_list value_list(sql_cmp_type sc) const {\ - return value_list(",", quote, sc);\ - }\ - NAME##_cus_value_list value_list(cchar *d, bool i1, bool i2 = false, bool i3 = false, bool i4 = false, bool i5 = false, bool i6 = false, bool i7 = false, bool i8 = false, bool i9 = false, bool i10 = false) const {\ - return value_list(d, quote, i1, i2, i3, i4, i5, i6, i7, i8, i9, i10);\ - }\ - NAME##_cus_value_list value_list(cchar *d, NAME##_enum i1, NAME##_enum i2 = NAME##_NULL, NAME##_enum i3 = NAME##_NULL, NAME##_enum i4 = NAME##_NULL, NAME##_enum i5 = NAME##_NULL, NAME##_enum i6 = NAME##_NULL, NAME##_enum i7 = NAME##_NULL, NAME##_enum i8 = NAME##_NULL, NAME##_enum i9 = NAME##_NULL, NAME##_enum i10 = NAME##_NULL) const {\ - return value_list(d, quote, i1, i2, i3, i4, i5, i6, i7, i8, i9, i10);\ - }\ - NAME##_cus_value_list value_list(cchar *d, \ - std::vector *i) const {\ - return value_list(d, quote, i);\ - }\ - NAME##_cus_value_list value_list(cchar *d, \ - sql_cmp_type sc) const {\ - return value_list(d, quote, sc);\ - }\ - template \ - NAME##_cus_value_list value_list(cchar *d, Manip m,\ - bool i1, bool i2 = false, bool i3 = false, bool i4 = false, bool i5 = false, bool i6 = false, bool i7 = false, bool i8 = false, bool i9 = false, bool i10 = false) const; \ - template \ - NAME##_cus_value_list value_list(cchar *d, Manip m,\ - NAME##_enum i1, NAME##_enum i2 = NAME##_NULL, NAME##_enum i3 = NAME##_NULL, NAME##_enum i4 = NAME##_NULL, NAME##_enum i5 = NAME##_NULL, NAME##_enum i6 = NAME##_NULL, NAME##_enum i7 = NAME##_NULL, NAME##_enum i8 = NAME##_NULL, NAME##_enum i9 = NAME##_NULL, NAME##_enum i10 = NAME##_NULL) const; \ - template \ - NAME##_cus_value_list value_list(cchar *d, Manip m, \ - std::vector *i) const;\ - template \ - NAME##_cus_value_list value_list(cchar *d, Manip m, \ - sql_cmp_type sc) const;\ - /* cus field */\ - NAME##_cus_field_list field_list(bool i1, bool i2 = false, bool i3 = false, bool i4 = false, bool i5 = false, bool i6 = false, bool i7 = false, bool i8 = false, bool i9 = false, bool i10 = false) const {\ - return field_list(",", do_nothing, i1, i2, i3, i4, i5, i6, i7, i8, i9, i10);\ - }\ - NAME##_cus_field_list field_list(NAME##_enum i1, NAME##_enum i2 = NAME##_NULL, NAME##_enum i3 = NAME##_NULL, NAME##_enum i4 = NAME##_NULL, NAME##_enum i5 = NAME##_NULL, NAME##_enum i6 = NAME##_NULL, NAME##_enum i7 = NAME##_NULL, NAME##_enum i8 = NAME##_NULL, NAME##_enum i9 = NAME##_NULL, NAME##_enum i10 = NAME##_NULL) const {\ - return field_list(",", do_nothing, i1, i2, i3, i4, i5, i6, i7, i8, i9, i10);\ - }\ - NAME##_cus_field_list field_list(std::vector *i) const {\ - return field_list(",", do_nothing, i);\ - }\ - NAME##_cus_field_list field_list(sql_cmp_type sc) const\ - {\ - return field_list(",", do_nothing, sc);\ - }\ - NAME##_cus_field_list field_list(cchar *d, \ - bool i1, bool i2 = false, bool i3 = false, bool i4 = false, bool i5 = false, bool i6 = false, bool i7 = false, bool i8 = false, bool i9 = false, bool i10 = false) const {\ - return field_list(d, do_nothing, i1, i2, i3, i4, i5, i6, i7, i8, i9, i10);\ - }\ - NAME##_cus_field_list field_list(cchar *d,\ - NAME##_enum i1, NAME##_enum i2 = NAME##_NULL, NAME##_enum i3 = NAME##_NULL, NAME##_enum i4 = NAME##_NULL, NAME##_enum i5 = NAME##_NULL, NAME##_enum i6 = NAME##_NULL, NAME##_enum i7 = NAME##_NULL, NAME##_enum i8 = NAME##_NULL, NAME##_enum i9 = NAME##_NULL, NAME##_enum i10 = NAME##_NULL) const {\ - return field_list(d, do_nothing, i1, i2, i3, i4, i5, i6, i7, i8, i9, i10);\ - }\ - NAME##_cus_field_list field_list(cchar *d, \ - std::vector *i) const {\ - return field_list(d, do_nothing, i);\ - }\ - NAME##_cus_field_list field_list(cchar *d, \ - sql_cmp_type sc) const {\ - return field_list(d, do_nothing, sc);\ - }\ - template \ - NAME##_cus_field_list field_list(cchar *d, Manip m,\ - bool i1, bool i2 = false, bool i3 = false, bool i4 = false, bool i5 = false, bool i6 = false, bool i7 = false, bool i8 = false, bool i9 = false, bool i10 = false) const; \ - template \ - NAME##_cus_field_list field_list(cchar *d, Manip m,\ - NAME##_enum i1, NAME##_enum i2 = NAME##_NULL, NAME##_enum i3 = NAME##_NULL, NAME##_enum i4 = NAME##_NULL, NAME##_enum i5 = NAME##_NULL, NAME##_enum i6 = NAME##_NULL, NAME##_enum i7 = NAME##_NULL, NAME##_enum i8 = NAME##_NULL, NAME##_enum i9 = NAME##_NULL, NAME##_enum i10 = NAME##_NULL) const; \ - template \ - NAME##_cus_field_list field_list(cchar *d, Manip m,\ - std::vector *i) const;\ - template \ - NAME##_cus_field_list field_list(cchar *d, Manip m, \ - sql_cmp_type sc) const;\ - /* cus equal */\ - NAME##_cus_equal_list equal_list(bool i1, bool i2 = false, bool i3 = false, bool i4 = false, bool i5 = false, bool i6 = false, bool i7 = false, bool i8 = false, bool i9 = false, bool i10 = false) const {\ - return equal_list(",", " = ", quote, i1, i2, i3, i4, i5, i6, i7, i8, i9, i10);\ - }\ - NAME##_cus_equal_list equal_list(NAME##_enum i1, NAME##_enum i2 = NAME##_NULL, NAME##_enum i3 = NAME##_NULL, NAME##_enum i4 = NAME##_NULL, NAME##_enum i5 = NAME##_NULL, NAME##_enum i6 = NAME##_NULL, NAME##_enum i7 = NAME##_NULL, NAME##_enum i8 = NAME##_NULL, NAME##_enum i9 = NAME##_NULL, NAME##_enum i10 = NAME##_NULL) const {\ - return equal_list(",", " = ", quote, i1, i2, i3, i4, i5, i6, i7, i8, i9, i10);\ - }\ - NAME##_cus_equal_list equal_list(std::vector *i) const {\ - return equal_list(",", " = ", quote, i);\ - }\ - NAME##_cus_equal_list equal_list(sql_cmp_type sc) const {\ - return equal_list(",", " = ", quote, sc);\ - }\ - NAME##_cus_equal_list equal_list(cchar *d, bool i1, bool i2 = false, bool i3 = false, bool i4 = false, bool i5 = false, bool i6 = false, bool i7 = false, bool i8 = false, bool i9 = false, bool i10 = false) const {\ - return equal_list(d, " = ", quote, i1, i2, i3, i4, i5, i6, i7, i8, i9, i10);\ - }\ - NAME##_cus_equal_list equal_list(cchar *d, NAME##_enum i1, NAME##_enum i2 = NAME##_NULL, NAME##_enum i3 = NAME##_NULL, NAME##_enum i4 = NAME##_NULL, NAME##_enum i5 = NAME##_NULL, NAME##_enum i6 = NAME##_NULL, NAME##_enum i7 = NAME##_NULL, NAME##_enum i8 = NAME##_NULL, NAME##_enum i9 = NAME##_NULL, NAME##_enum i10 = NAME##_NULL) const {\ - return equal_list(d, " = ", quote, i1, i2, i3, i4, i5, i6, i7, i8, i9, i10);\ - }\ - NAME##_cus_equal_list equal_list(cchar *d, \ - std::vector *i) const {\ - return equal_list(d, " = ", quote, i);\ - }\ - NAME##_cus_equal_list equal_list(cchar *d, \ - sql_cmp_type sc) const {\ - return equal_list(d, " = ", quote, sc);\ - }\ - NAME##_cus_equal_list equal_list(cchar *d, cchar *c,\ - bool i1, bool i2 = false, bool i3 = false, bool i4 = false, bool i5 = false, bool i6 = false, bool i7 = false, bool i8 = false, bool i9 = false, bool i10 = false) const {\ - return equal_list(d, c, quote, i1, i2, i3, i4, i5, i6, i7, i8, i9, i10);\ - }\ - NAME##_cus_equal_list equal_list(cchar *d, cchar *c,\ - NAME##_enum i1, NAME##_enum i2 = NAME##_NULL, NAME##_enum i3 = NAME##_NULL, NAME##_enum i4 = NAME##_NULL, NAME##_enum i5 = NAME##_NULL, NAME##_enum i6 = NAME##_NULL, NAME##_enum i7 = NAME##_NULL, NAME##_enum i8 = NAME##_NULL, NAME##_enum i9 = NAME##_NULL, NAME##_enum i10 = NAME##_NULL) const {\ - return equal_list(d, c, quote, i1, i2, i3, i4, i5, i6, i7, i8, i9, i10);\ - }\ - NAME##_cus_equal_list equal_list(cchar *d, cchar *c,\ - std::vector *i) const {\ - return equal_list(d, c, quote, i);\ - }\ - NAME##_cus_equal_list equal_list(cchar *d, cchar *c,\ - sql_cmp_type sc) const {\ - return equal_list(d, c, quote, sc);\ - }\ - template \ - NAME##_cus_equal_list equal_list(cchar *d, cchar *c, Manip m, \ - bool i1, bool i2 = false, bool i3 = false, bool i4 = false, bool i5 = false, bool i6 = false, bool i7 = false, bool i8 = false, bool i9 = false, bool i10 = false) const; \ - template \ - NAME##_cus_equal_list equal_list(cchar *d, cchar *c, Manip m, \ - NAME##_enum i1, NAME##_enum i2 = NAME##_NULL, NAME##_enum i3 = NAME##_NULL, NAME##_enum i4 = NAME##_NULL, NAME##_enum i5 = NAME##_NULL, NAME##_enum i6 = NAME##_NULL, NAME##_enum i7 = NAME##_NULL, NAME##_enum i8 = NAME##_NULL, NAME##_enum i9 = NAME##_NULL, NAME##_enum i10 = NAME##_NULL) const; \ - template \ - NAME##_cus_equal_list equal_list(cchar *d, cchar *c, Manip m, \ - std::vector *i) const;\ - template \ - NAME##_cus_equal_list equal_list(cchar *d, cchar *c, Manip m, \ - sql_cmp_type sc) const;\ - }; \ - const char *NAME::names[] = { \ - N1 ,\ - N2 ,\ - N3 ,\ - N4 ,\ - N5 ,\ - N6 ,\ - N7 ,\ - N8 ,\ - N9 ,\ - N10 \ - }; \ - const char *NAME::_table = #NAME ; \ - template \ - NAME##_cus_value_list::NAME##_cus_value_list\ - (const NAME *o, cchar *d, Manip m, bool i1, bool i2, bool i3, bool i4, bool i5, bool i6, bool i7, bool i8, bool i9, bool i10) \ - { \ - delem = d;\ - manip = m;\ - del_vector = true;\ - obj = o; \ - include = new std::vector(10, false);\ - if (i1) (*include)[0]=true;\ - if (i2) (*include)[1]=true;\ - if (i3) (*include)[2]=true;\ - if (i4) (*include)[3]=true;\ - if (i5) (*include)[4]=true;\ - if (i6) (*include)[5]=true;\ - if (i7) (*include)[6]=true;\ - if (i8) (*include)[7]=true;\ - if (i9) (*include)[8]=true;\ - if (i10) (*include)[9]=true;\ - } \ - template \ - NAME##_cus_value_list::NAME##_cus_value_list\ - (const NAME *o, cchar *d, Manip m, NAME##_enum i1, NAME##_enum i2, NAME##_enum i3, NAME##_enum i4, NAME##_enum i5, NAME##_enum i6, NAME##_enum i7, NAME##_enum i8, NAME##_enum i9, NAME##_enum i10) { \ - delem = d;\ - manip = m;\ - del_vector = true; \ - obj = o; \ - include = new std::vector(10, false); \ - if (i1 == NAME##_NULL) return;\ - (*include)[i1]=true;\ - if (i2 == NAME##_NULL) return;\ - (*include)[i2]=true;\ - if (i3 == NAME##_NULL) return;\ - (*include)[i3]=true;\ - if (i4 == NAME##_NULL) return;\ - (*include)[i4]=true;\ - if (i5 == NAME##_NULL) return;\ - (*include)[i5]=true;\ - if (i6 == NAME##_NULL) return;\ - (*include)[i6]=true;\ - if (i7 == NAME##_NULL) return;\ - (*include)[i7]=true;\ - if (i8 == NAME##_NULL) return;\ - (*include)[i8]=true;\ - if (i9 == NAME##_NULL) return;\ - (*include)[i9]=true;\ - if (i10 == NAME##_NULL) return;\ - (*include)[i10]=true;\ - }\ - template \ - NAME##_cus_field_list::NAME##_cus_field_list\ - (const NAME *o, cchar *d, Manip m, bool i1, bool i2, bool i3, bool i4, bool i5, bool i6, bool i7, bool i8, bool i9, bool i10) {\ - delem = d;\ - manip = m;\ - del_vector = true; \ - obj = o; \ - include = new std::vector(10, false); \ - if (i1) (*include)[0]=true;\ - if (i2) (*include)[1]=true;\ - if (i3) (*include)[2]=true;\ - if (i4) (*include)[3]=true;\ - if (i5) (*include)[4]=true;\ - if (i6) (*include)[5]=true;\ - if (i7) (*include)[6]=true;\ - if (i8) (*include)[7]=true;\ - if (i9) (*include)[8]=true;\ - if (i10) (*include)[9]=true;\ - } \ - template \ - NAME##_cus_field_list::NAME##_cus_field_list\ - (const NAME *o, cchar *d, Manip m, NAME##_enum i1, NAME##_enum i2, NAME##_enum i3, NAME##_enum i4, NAME##_enum i5, NAME##_enum i6, NAME##_enum i7, NAME##_enum i8, NAME##_enum i9, NAME##_enum i10) { \ - delem = d;\ - manip = m;\ - del_vector = true; \ - obj = o; \ - include = new std::vector(10, false); \ - if (i1 == NAME##_NULL) return;\ - (*include)[i1]=true;\ - if (i2 == NAME##_NULL) return;\ - (*include)[i2]=true;\ - if (i3 == NAME##_NULL) return;\ - (*include)[i3]=true;\ - if (i4 == NAME##_NULL) return;\ - (*include)[i4]=true;\ - if (i5 == NAME##_NULL) return;\ - (*include)[i5]=true;\ - if (i6 == NAME##_NULL) return;\ - (*include)[i6]=true;\ - if (i7 == NAME##_NULL) return;\ - (*include)[i7]=true;\ - if (i8 == NAME##_NULL) return;\ - (*include)[i8]=true;\ - if (i9 == NAME##_NULL) return;\ - (*include)[i9]=true;\ - if (i10 == NAME##_NULL) return;\ - (*include)[i10]=true;\ - }\ - template \ - NAME##_cus_equal_list::NAME##_cus_equal_list\ - (const NAME *o, cchar *d, cchar *c, Manip m, bool i1, bool i2, bool i3, bool i4, bool i5, bool i6, bool i7, bool i8, bool i9, bool i10) { \ - delem = d;\ - comp = c;\ - manip = m;\ - del_vector = true; \ - obj = o; \ - include = new std::vector(10, false); \ - if (i1) (*include)[0]=true;\ - if (i2) (*include)[1]=true;\ - if (i3) (*include)[2]=true;\ - if (i4) (*include)[3]=true;\ - if (i5) (*include)[4]=true;\ - if (i6) (*include)[5]=true;\ - if (i7) (*include)[6]=true;\ - if (i8) (*include)[7]=true;\ - if (i9) (*include)[8]=true;\ - if (i10) (*include)[9]=true;\ - } \ - template \ - NAME##_cus_equal_list::NAME##_cus_equal_list\ - (const NAME *o, cchar *d, cchar *c, Manip m, NAME##_enum i1, NAME##_enum i2, NAME##_enum i3, NAME##_enum i4, NAME##_enum i5, NAME##_enum i6, NAME##_enum i7, NAME##_enum i8, NAME##_enum i9, NAME##_enum i10) { \ - delem = d;\ - comp = c;\ - manip = m;\ - del_vector = true; \ - obj = o; \ - include = new std::vector(10, false); \ - if (i1 == NAME##_NULL) return;\ - (*include)[i1]=true;\ - if (i2 == NAME##_NULL) return;\ - (*include)[i2]=true;\ - if (i3 == NAME##_NULL) return;\ - (*include)[i3]=true;\ - if (i4 == NAME##_NULL) return;\ - (*include)[i4]=true;\ - if (i5 == NAME##_NULL) return;\ - (*include)[i5]=true;\ - if (i6 == NAME##_NULL) return;\ - (*include)[i6]=true;\ - if (i7 == NAME##_NULL) return;\ - (*include)[i7]=true;\ - if (i8 == NAME##_NULL) return;\ - (*include)[i8]=true;\ - if (i9 == NAME##_NULL) return;\ - (*include)[i9]=true;\ - if (i10 == NAME##_NULL) return;\ - (*include)[i10]=true;\ - }\ - template \ - std::ostream& operator << (std::ostream& s, const NAME##_value_list& obj) { \ - s << obj.manip << obj.obj->I1 << obj.delem;\ - s << obj.manip << obj.obj->I2 << obj.delem;\ - s << obj.manip << obj.obj->I3 << obj.delem;\ - s << obj.manip << obj.obj->I4 << obj.delem;\ - s << obj.manip << obj.obj->I5 << obj.delem;\ - s << obj.manip << obj.obj->I6 << obj.delem;\ - s << obj.manip << obj.obj->I7 << obj.delem;\ - s << obj.manip << obj.obj->I8 << obj.delem;\ - s << obj.manip << obj.obj->I9 << obj.delem;\ - s << obj.manip << obj.obj->I10; \ - return s; \ - } \ - template \ - std::ostream& operator << (std::ostream& s, const NAME##_field_list& obj) { \ - s << obj.manip << obj.obj->names[0] << obj.delem;\ - s << obj.manip << obj.obj->names[1] << obj.delem;\ - s << obj.manip << obj.obj->names[2] << obj.delem;\ - s << obj.manip << obj.obj->names[3] << obj.delem;\ - s << obj.manip << obj.obj->names[4] << obj.delem;\ - s << obj.manip << obj.obj->names[5] << obj.delem;\ - s << obj.manip << obj.obj->names[6] << obj.delem;\ - s << obj.manip << obj.obj->names[7] << obj.delem;\ - s << obj.manip << obj.obj->names[8] << obj.delem;\ - s << obj.manip << obj.obj->names[9]; \ - return s; \ - } \ - template \ - std::ostream& operator << (std::ostream& s, const NAME##_equal_list& obj) { \ - s << obj.obj->names[0] << obj.comp << obj.manip << obj.obj->I1 << obj.delem;\ - s << obj.obj->names[1] << obj.comp << obj.manip << obj.obj->I2 << obj.delem;\ - s << obj.obj->names[2] << obj.comp << obj.manip << obj.obj->I3 << obj.delem;\ - s << obj.obj->names[3] << obj.comp << obj.manip << obj.obj->I4 << obj.delem;\ - s << obj.obj->names[4] << obj.comp << obj.manip << obj.obj->I5 << obj.delem;\ - s << obj.obj->names[5] << obj.comp << obj.manip << obj.obj->I6 << obj.delem;\ - s << obj.obj->names[6] << obj.comp << obj.manip << obj.obj->I7 << obj.delem;\ - s << obj.obj->names[7] << obj.comp << obj.manip << obj.obj->I8 << obj.delem;\ - s << obj.obj->names[8] << obj.comp << obj.manip << obj.obj->I9 << obj.delem;\ - s << obj.obj->names[9] << obj.comp << obj.manip << obj.obj->I10; \ - return s; \ - } \ - template \ - std::ostream& operator << (std::ostream& s, const NAME##_cus_value_list& obj) { \ - bool before = false; \ - if ((*obj.include)[0]) { \ - s << obj.manip << obj.obj->I1;\ - before = true; \ - } \ - if ((*obj.include)[1]) { \ - if (before) s << obj.delem;\ - s << obj.manip << obj.obj->I2;\ - before = true; \ - } \ - if ((*obj.include)[2]) { \ - if (before) s << obj.delem;\ - s << obj.manip << obj.obj->I3;\ - before = true; \ - } \ - if ((*obj.include)[3]) { \ - if (before) s << obj.delem;\ - s << obj.manip << obj.obj->I4;\ - before = true; \ - } \ - if ((*obj.include)[4]) { \ - if (before) s << obj.delem;\ - s << obj.manip << obj.obj->I5;\ - before = true; \ - } \ - if ((*obj.include)[5]) { \ - if (before) s << obj.delem;\ - s << obj.manip << obj.obj->I6;\ - before = true; \ - } \ - if ((*obj.include)[6]) { \ - if (before) s << obj.delem;\ - s << obj.manip << obj.obj->I7;\ - before = true; \ - } \ - if ((*obj.include)[7]) { \ - if (before) s << obj.delem;\ - s << obj.manip << obj.obj->I8;\ - before = true; \ - } \ - if ((*obj.include)[8]) { \ - if (before) s << obj.delem;\ - s << obj.manip << obj.obj->I9;\ - before = true; \ - } \ - if ((*obj.include)[9]) { \ - if (before) s << obj.delem;\ - s << obj.manip << obj.obj->I10;\ - } \ - return s; \ - } \ - template \ - std::ostream& operator << (std::ostream& s, const NAME##_cus_field_list& obj) { \ - bool before = false; \ - if ((*obj.include)[0]) { \ - s << obj.manip << obj.obj->names[0];\ - before = true; \ - } \ - if ((*obj.include)[1]) { \ - if (before) s << obj.delem;\ - s << obj.manip << obj.obj->names[1];\ - before = true; \ - } \ - if ((*obj.include)[2]) { \ - if (before) s << obj.delem;\ - s << obj.manip << obj.obj->names[2];\ - before = true; \ - } \ - if ((*obj.include)[3]) { \ - if (before) s << obj.delem;\ - s << obj.manip << obj.obj->names[3];\ - before = true; \ - } \ - if ((*obj.include)[4]) { \ - if (before) s << obj.delem;\ - s << obj.manip << obj.obj->names[4];\ - before = true; \ - } \ - if ((*obj.include)[5]) { \ - if (before) s << obj.delem;\ - s << obj.manip << obj.obj->names[5];\ - before = true; \ - } \ - if ((*obj.include)[6]) { \ - if (before) s << obj.delem;\ - s << obj.manip << obj.obj->names[6];\ - before = true; \ - } \ - if ((*obj.include)[7]) { \ - if (before) s << obj.delem;\ - s << obj.manip << obj.obj->names[7];\ - before = true; \ - } \ - if ((*obj.include)[8]) { \ - if (before) s << obj.delem;\ - s << obj.manip << obj.obj->names[8];\ - before = true; \ - } \ - if ((*obj.include)[9]) { \ - if (before) s << obj.delem;\ - s << obj.manip << obj.obj->names[9];\ - } \ - return s; \ - } \ - template \ - std::ostream& operator << (std::ostream& s, const NAME##_cus_equal_list& obj) { \ - bool before = false; \ - if ((*obj.include)[0]) { \ - s << obj.obj->names[0] << obj.comp << obj.manip << obj.obj->I1;\ - before = true; \ - } \ - if ((*obj.include)[1]) { \ - if (before) s << obj.delem;\ - s << obj.obj->names[1] << obj.comp << obj.manip << obj.obj->I2;\ - before = true; \ - } \ - if ((*obj.include)[2]) { \ - if (before) s << obj.delem;\ - s << obj.obj->names[2] << obj.comp << obj.manip << obj.obj->I3;\ - before = true; \ - } \ - if ((*obj.include)[3]) { \ - if (before) s << obj.delem;\ - s << obj.obj->names[3] << obj.comp << obj.manip << obj.obj->I4;\ - before = true; \ - } \ - if ((*obj.include)[4]) { \ - if (before) s << obj.delem;\ - s << obj.obj->names[4] << obj.comp << obj.manip << obj.obj->I5;\ - before = true; \ - } \ - if ((*obj.include)[5]) { \ - if (before) s << obj.delem;\ - s << obj.obj->names[5] << obj.comp << obj.manip << obj.obj->I6;\ - before = true; \ - } \ - if ((*obj.include)[6]) { \ - if (before) s << obj.delem;\ - s << obj.obj->names[6] << obj.comp << obj.manip << obj.obj->I7;\ - before = true; \ - } \ - if ((*obj.include)[7]) { \ - if (before) s << obj.delem;\ - s << obj.obj->names[7] << obj.comp << obj.manip << obj.obj->I8;\ - before = true; \ - } \ - if ((*obj.include)[8]) { \ - if (before) s << obj.delem;\ - s << obj.obj->names[8] << obj.comp << obj.manip << obj.obj->I9;\ - before = true; \ - } \ - if ((*obj.include)[9]) { \ - if (before) s << obj.delem;\ - s << obj.obj->names[9] << obj.comp << obj.manip << obj.obj->I10;\ - } \ - return s; \ - } \ - template \ - inline NAME##_value_list NAME::value_list(cchar *d, Manip m) const { \ - return NAME##_value_list (this, d, m); \ - } \ - template \ - inline NAME##_field_list NAME::field_list(cchar *d, Manip m) const { \ - return NAME##_field_list (this, d, m); \ - } \ - template \ - inline NAME##_equal_list NAME::equal_list(cchar *d, cchar *c, Manip m) const { \ - return NAME##_equal_list (this, d, c, m); \ - } \ - template \ - inline NAME##_cus_value_list NAME::value_list(cchar *d, Manip m,\ - bool i1, bool i2, bool i3, bool i4, bool i5, bool i6, bool i7, bool i8, bool i9, bool i10) const {\ - return NAME##_cus_value_list (this, d, m, i1, i2, i3, i4, i5, i6, i7, i8, i9, i10); \ - } \ - template \ - inline NAME##_cus_field_list NAME::field_list(cchar *d, Manip m,\ - bool i1, bool i2, bool i3, bool i4, bool i5, bool i6, bool i7, bool i8, bool i9, bool i10) const { \ - return NAME##_cus_field_list (this, d, m, i1, i2, i3, i4, i5, i6, i7, i8, i9, i10); \ - } \ - template \ - inline NAME##_cus_equal_list NAME::equal_list(cchar *d, cchar *c, Manip m,\ - bool i1, bool i2, bool i3, bool i4, bool i5, bool i6, bool i7, bool i8, bool i9, bool i10) const { \ - return NAME##_cus_equal_list (this, d, c, m, i1, i2, i3, i4, i5, i6, i7, i8, i9, i10); \ - } \ - template \ - inline NAME##_cus_value_list NAME::value_list(cchar *d, Manip m,\ - NAME##_enum i1, NAME##_enum i2, NAME##_enum i3, NAME##_enum i4, NAME##_enum i5, NAME##_enum i6, NAME##_enum i7, NAME##_enum i8, NAME##_enum i9, NAME##_enum i10) const { \ - return NAME##_cus_value_list (this, d, m, i1, i2, i3, i4, i5, i6, i7, i8, i9, i10); \ - } \ - template \ - inline NAME##_cus_field_list NAME::field_list(cchar *d, Manip m,\ - NAME##_enum i1, NAME##_enum i2, NAME##_enum i3, NAME##_enum i4, NAME##_enum i5, NAME##_enum i6, NAME##_enum i7, NAME##_enum i8, NAME##_enum i9, NAME##_enum i10) const {\ - return NAME##_cus_field_list (this, d, m, i1, i2, i3, i4, i5, i6, i7, i8, i9, i10); \ - } \ - template \ - inline NAME##_cus_equal_list NAME::equal_list(cchar *d, cchar *c, Manip m, \ - NAME##_enum i1, NAME##_enum i2, NAME##_enum i3, NAME##_enum i4, NAME##_enum i5, NAME##_enum i6, NAME##_enum i7, NAME##_enum i8, NAME##_enum i9, NAME##_enum i10) const { \ - return NAME##_cus_equal_list (this, d, c, m, i1, i2, i3, i4, i5, i6, i7, i8, i9, i10); \ - } \ - template \ - inline NAME##_cus_value_list NAME::value_list(cchar *d, Manip m,\ - std::vector *i) const {\ - return NAME##_cus_value_list (this, d, m, i);\ - }\ - template \ - inline NAME##_cus_field_list NAME::field_list(cchar *d, Manip m,\ - std::vector *i) const {\ - return NAME##_cus_field_list (this, d, m, i);\ - }\ - template \ - inline NAME##_cus_equal_list NAME::equal_list(cchar *d, cchar *c, Manip m,\ - std::vector *i) const {\ - return NAME##_cus_equal_list (this, d, c, m, i);\ - }\ - template \ - inline NAME##_cus_value_list \ - NAME::value_list(cchar *d, Manip m, sql_cmp_type /*sc*/) const {\ - sql_compare_type_def_##CMP (NAME, value, NUM);\ - }\ - template \ - inline NAME##_cus_field_list \ - NAME::field_list(cchar *d, Manip m, sql_cmp_type /*sc*/) const {\ - sql_compare_type_def_##CMP (NAME, field, NUM);\ - }\ - template \ - inline NAME##_cus_equal_list \ - NAME::equal_list(cchar *d, cchar *c, Manip m, sql_cmp_type /*sc*/) const {\ - sql_compare_type_defe_##CMP (NAME, equal, NUM);\ - }\ - template \ - void populate_##NAME (NAME *s, const Row &row) { \ - s->I1 = static_cast(row.at(O1));\ - s->I2 = static_cast(row.at(O2));\ - s->I3 = static_cast(row.at(O3));\ - s->I4 = static_cast(row.at(O4));\ - s->I5 = static_cast(row.at(O5));\ - s->I6 = static_cast(row.at(O6));\ - s->I7 = static_cast(row.at(O7));\ - s->I8 = static_cast(row.at(O8));\ - s->I9 = static_cast(row.at(O9));\ - s->I10 = static_cast(row.at(O10));\ - } \ - inline NAME::NAME (const Row &row) \ - {populate_##NAME(this, row);}\ - inline void NAME::set (const Row &row)\ - {populate_##NAME(this, row);}\ - sql_COMPARE__##CMP(NAME, I1, I2, I3, I4, I5, I6, I7, I8, I9, I10, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ) - -#define sql_create_basic_10(NAME, CMP, CONTR, T1, I1, T2, I2, T3, I3, T4, I4, T5, I5, T6, I6, T7, I7, T8, I8, T9, I9, T10, I10) \ - sql_create_basic_c_order_10(NAME, CMP, CONTR, T1, I1, 0, T2, I2, 1, T3, I3, 2, T4, I4, 3, T5, I5, 4, T6, I6, 5, T7, I7, 6, T8, I8, 7, T9, I9, 8, T10, I10, 9) - -#define sql_create_10(NAME, CMP, CONTR, T1, I1, T2, I2, T3, I3, T4, I4, T5, I5, T6, I6, T7, I7, T8, I8, T9, I9, T10, I10) \ - sql_create_complete_10(NAME, CMP, CONTR, T1, I1, #I1, 0, T2, I2, #I2, 1, T3, I3, #I3, 2, T4, I4, #I4, 3, T5, I5, #I5, 4, T6, I6, #I6, 5, T7, I7, #I7, 6, T8, I8, #I8, 7, T9, I9, #I9, 8, T10, I10, #I10, 9) \ - -#define sql_create_c_order_10(NAME, CMP, CONTR, T1, I1, O1, T2, I2, O2, T3, I3, O3, T4, I4, O4, T5, I5, O5, T6, I6, O6, T7, I7, O7, T8, I8, O8, T9, I9, O9, T10, I10, O10) \ - sql_create_complete_10(NAME, CMP, CONTR, T1, I1, #I1, O1, T2, I2, #I2, O2, T3, I3, #I3, O3, T4, I4, #I4, O4, T5, I5, #I5, O5, T6, I6, #I6, O6, T7, I7, #I7, O7, T8, I8, #I8, O8, T9, I9, #I9, O9, T10, I10, #I10, O10) - -#define sql_create_c_names_10(NAME, CMP, CONTR, T1, I1, N1, T2, I2, N2, T3, I3, N3, T4, I4, N4, T5, I5, N5, T6, I6, N6, T7, I7, N7, T8, I8, N8, T9, I9, N9, T10, I10, N10) \ - sql_create_complete_10(NAME, CMP, CONTR, T1, I1, N1, 0, T2, I2, N2, 1, T3, I3, N3, 2, T4, I4, N4, 3, T5, I5, N5, 4, T6, I6, N6, 5, T7, I7, N7, 6, T8, I8, N8, 7, T9, I9, N9, 8, T10, I10, N10, 9) - -// --------------------------------------------------- -// End Create 10 -// --------------------------------------------------- - -// --------------------------------------------------- -// Begin Create 11 -// --------------------------------------------------- -#define sql_create_basic_c_order_11(NAME, CMP, CONTR, T1, I1, O1, T2, I2, O2, T3, I3, O3, T4, I4, O4, T5, I5, O5, T6, I6, O6, T7, I7, O7, T8, I8, O8, T9, I9, O9, T10, I10, O10, T11, I11, O11)\ - struct NAME; \ - template int sql_compare_##NAME (const NAME &, const NAME &);\ - struct NAME { \ - T1 I1;\ - T2 I2;\ - T3 I3;\ - T4 I4;\ - T5 I5;\ - T6 I6;\ - T7 I7;\ - T8 I8;\ - T9 I9;\ - T10 I10;\ - T11 I11; \ - NAME () {} \ - NAME (const Row &row);\ - sql_compare_define_##CMP(NAME, T1, I1, T2, I2, T3, I3, T4, I4, T5, I5, T6, I6, T7, I7, T8, I8, T9, I9, T10, I10, T11, I11, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0)\ - }; \ - template \ - void populate_##NAME (NAME *s, const Row &row) { \ - s->I1 = static_cast(row.at(O1));\ - s->I2 = static_cast(row.at(O2));\ - s->I3 = static_cast(row.at(O3));\ - s->I4 = static_cast(row.at(O4));\ - s->I5 = static_cast(row.at(O5));\ - s->I6 = static_cast(row.at(O6));\ - s->I7 = static_cast(row.at(O7));\ - s->I8 = static_cast(row.at(O8));\ - s->I9 = static_cast(row.at(O9));\ - s->I10 = static_cast(row.at(O10));\ - s->I11 = static_cast(row.at(O11)); \ - } \ - inline NAME::NAME (const Row &row) \ - {populate_##NAME(this, row);} \ - sql_COMPARE__##CMP(NAME, I1, I2, I3, I4, I5, I6, I7, I8, I9, I10, I11, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ) - -#define sql_create_complete_11(NAME, CMP, CONTR, T1, I1, N1, O1, T2, I2, N2, O2, T3, I3, N3, O3, T4, I4, N4, O4, T5, I5, N5, O5, T6, I6, N6, O6, T7, I7, N7, O7, T8, I8, N8, O8, T9, I9, N9, O9, T10, I10, N10, O10, T11, I11, N11, O11) \ - struct NAME; \ - enum NAME##_enum { \ - NAME##_##I1,\ - NAME##_##I2,\ - NAME##_##I3,\ - NAME##_##I4,\ - NAME##_##I5,\ - NAME##_##I6,\ - NAME##_##I7,\ - NAME##_##I8,\ - NAME##_##I9,\ - NAME##_##I10,\ - NAME##_##I11 \ - ,NAME##_NULL \ - }; \ - template \ - class NAME##_value_list { \ - /*friend std::ostream& operator << <> (std::ostream&, const NAME##_value_list&); */\ - public: \ - const NAME *obj;\ - cchar *delem;\ - Manip manip;\ - public: \ - NAME##_value_list (const NAME *o, cchar *d, Manip m) \ - : obj(o), delem(d), manip(m) {} \ - };\ - template \ - class NAME##_##field_list {\ - /* friend std::ostream& operator << <> (std::ostream&, const NAME##_field_list&); */\ - public: \ - const NAME *obj; \ - cchar *delem;\ - Manip manip;\ - public: \ - NAME##_field_list (const NAME *o, cchar *d, Manip m) \ - : obj(o), delem(d), manip(m) {} \ - };\ - template \ - class NAME##_equal_list { \ - /* friend std::ostream& operator << <> (std::ostream&, const NAME##_equal_list&); */\ - public: \ - const NAME *obj;\ - cchar *delem;\ - cchar *comp;\ - Manip manip;\ - public: \ - NAME##_equal_list (const NAME *o, cchar *d, cchar *c, Manip m) \ - : obj(o), delem(d), comp(c), manip(m) {}\ - };\ - template \ - class NAME##_cus_value_list {\ - /* friend std::ostream& operator << <> (std::ostream&, \ - const NAME##_cus_value_list&); */\ - public:\ - const NAME *obj;\ - std::vector *include;\ - bool del_vector;\ - cchar *delem;\ - Manip manip;\ - public: \ - ~NAME##_cus_value_list () {if (del_vector) delete include;} \ - NAME##_cus_value_list (const NAME *o, cchar *d, Manip m, bool i1, bool i2, bool i3, bool i4, bool i5, bool i6, bool i7, bool i8, bool i9, bool i10, bool i11);\ - NAME##_cus_value_list (const NAME *o, cchar *d, Manip m, NAME##_enum i1, NAME##_enum i2, NAME##_enum i3, NAME##_enum i4, NAME##_enum i5, NAME##_enum i6, NAME##_enum i7, NAME##_enum i8, NAME##_enum i9, NAME##_enum i10, NAME##_enum i11); \ - NAME##_cus_value_list (const NAME *o, cchar *d, Manip m ,std::vector* i)\ - : obj(o), include(i), del_vector(false), delem(d), manip(m) {}\ - };\ - template \ - class NAME##_cus_field_list { \ - /* friend std::ostream& operator << <> (std::ostream&, \ - const NAME##_cus_field_list&); */\ - public:\ - const NAME *obj; \ - std::vector *include; \ - bool del_vector; \ - cchar *delem;\ - Manip manip;\ - public: \ - ~NAME##_cus_field_list () {if (del_vector) delete include;} \ - NAME##_cus_field_list (const NAME *o, cchar *d, Manip m, bool i1, bool i2, bool i3, bool i4, bool i5, bool i6, bool i7, bool i8, bool i9, bool i10, bool i11); \ - NAME##_cus_field_list (const NAME *o, cchar *d, Manip m, NAME##_enum i1, NAME##_enum i2, NAME##_enum i3, NAME##_enum i4, NAME##_enum i5, NAME##_enum i6, NAME##_enum i7, NAME##_enum i8, NAME##_enum i9, NAME##_enum i10, NAME##_enum i11); \ - NAME##_cus_field_list (const NAME *o, cchar *d, Manip m, std::vector *i) \ - : obj(o), include(i), del_vector(false), delem(d), manip(m) {}\ - };\ - template \ - class NAME##_cus_equal_list {\ - /* friend std::ostream& operator << <> (std::ostream&, \ - const NAME##_cus_equal_list&); */\ - public:\ - const NAME *obj;\ - std::vector *include;\ - bool del_vector;\ - cchar *delem;\ - cchar *comp;\ - Manip manip;\ - public:\ - ~NAME##_##cus_equal_list () {if (del_vector) delete include;}\ - NAME##_##cus_equal_list (const NAME *o, cchar *d, cchar *c, Manip m, bool i1, bool i2, bool i3, bool i4, bool i5, bool i6, bool i7, bool i8, bool i9, bool i10, bool i11); \ - NAME##_##cus_equal_list (const NAME *o, cchar *d, cchar *c, Manip m, NAME##_enum i1, NAME##_enum i2, NAME##_enum i3, NAME##_enum i4, NAME##_enum i5, NAME##_enum i6, NAME##_enum i7, NAME##_enum i8, NAME##_enum i9, NAME##_enum i10, NAME##_enum i11); \ - NAME##_##cus_equal_list (const NAME *o, cchar *d, cchar *c, Manip m, std::vector *i) \ - : obj(o), include(i), del_vector(false), delem(d), comp(c), manip(m) {}\ - };\ - template int sql_compare_##NAME (const NAME &, const NAME &);\ - struct NAME { \ - T1 I1;\ - T2 I2;\ - T3 I3;\ - T4 I4;\ - T5 I5;\ - T6 I6;\ - T7 I7;\ - T8 I8;\ - T9 I9;\ - T10 I10;\ - T11 I11; \ - NAME () {} \ - NAME (const Row &row);\ - void set (const Row &row);\ - sql_compare_define_##CMP(NAME, T1, I1, T2, I2, T3, I3, T4, I4, T5, I5, T6, I6, T7, I7, T8, I8, T9, I9, T10, I10, T11, I11, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0)\ - sql_construct_define_##CONTR(NAME, T1, I1, T2, I2, T3, I3, T4, I4, T5, I5, T6, I6, T7, I7, T8, I8, T9, I9, T10, I10, T11, I11, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0)\ - static const char *names[];\ - static const char *_table;\ - static const char *& table() {return _table;}\ - NAME##_value_list value_list() const {\ - return value_list(",", quote);}\ - NAME##_value_list value_list(cchar *d) const {\ - return value_list(d, quote);}\ - template \ - NAME##_value_list value_list(cchar *d, Manip m) const; \ - NAME##_field_list field_list() const {\ - return field_list(",", do_nothing);}\ - NAME##_field_list field_list(cchar *d) const {\ - return field_list(d, do_nothing);}\ - template \ - NAME##_field_list field_list(cchar *d, Manip m) const; \ - NAME##_equal_list equal_list(cchar *d = ",", \ - cchar *c = " = ") const{\ - return equal_list(d, c, quote);}\ - template \ - NAME##_equal_list equal_list(cchar *d, cchar *c, Manip m) const; \ - /* cus_data */\ - NAME##_cus_value_list value_list(bool i1, bool i2 = false, bool i3 = false, bool i4 = false, bool i5 = false, bool i6 = false, bool i7 = false, bool i8 = false, bool i9 = false, bool i10 = false, bool i11 = false) const {\ - return value_list(",", quote, i1, i2, i3, i4, i5, i6, i7, i8, i9, i10, i11);\ - }\ - NAME##_cus_value_list value_list(NAME##_enum i1, NAME##_enum i2 = NAME##_NULL, NAME##_enum i3 = NAME##_NULL, NAME##_enum i4 = NAME##_NULL, NAME##_enum i5 = NAME##_NULL, NAME##_enum i6 = NAME##_NULL, NAME##_enum i7 = NAME##_NULL, NAME##_enum i8 = NAME##_NULL, NAME##_enum i9 = NAME##_NULL, NAME##_enum i10 = NAME##_NULL, NAME##_enum i11 = NAME##_NULL) const {\ - return value_list(",", quote, i1, i2, i3, i4, i5, i6, i7, i8, i9, i10, i11);\ - }\ - NAME##_cus_value_list value_list(std::vector *i) const {\ - return value_list(",", quote, i);\ - }\ - NAME##_cus_value_list value_list(sql_cmp_type sc) const {\ - return value_list(",", quote, sc);\ - }\ - NAME##_cus_value_list value_list(cchar *d, bool i1, bool i2 = false, bool i3 = false, bool i4 = false, bool i5 = false, bool i6 = false, bool i7 = false, bool i8 = false, bool i9 = false, bool i10 = false, bool i11 = false) const {\ - return value_list(d, quote, i1, i2, i3, i4, i5, i6, i7, i8, i9, i10, i11);\ - }\ - NAME##_cus_value_list value_list(cchar *d, NAME##_enum i1, NAME##_enum i2 = NAME##_NULL, NAME##_enum i3 = NAME##_NULL, NAME##_enum i4 = NAME##_NULL, NAME##_enum i5 = NAME##_NULL, NAME##_enum i6 = NAME##_NULL, NAME##_enum i7 = NAME##_NULL, NAME##_enum i8 = NAME##_NULL, NAME##_enum i9 = NAME##_NULL, NAME##_enum i10 = NAME##_NULL, NAME##_enum i11 = NAME##_NULL) const {\ - return value_list(d, quote, i1, i2, i3, i4, i5, i6, i7, i8, i9, i10, i11);\ - }\ - NAME##_cus_value_list value_list(cchar *d, \ - std::vector *i) const {\ - return value_list(d, quote, i);\ - }\ - NAME##_cus_value_list value_list(cchar *d, \ - sql_cmp_type sc) const {\ - return value_list(d, quote, sc);\ - }\ - template \ - NAME##_cus_value_list value_list(cchar *d, Manip m,\ - bool i1, bool i2 = false, bool i3 = false, bool i4 = false, bool i5 = false, bool i6 = false, bool i7 = false, bool i8 = false, bool i9 = false, bool i10 = false, bool i11 = false) const; \ - template \ - NAME##_cus_value_list value_list(cchar *d, Manip m,\ - NAME##_enum i1, NAME##_enum i2 = NAME##_NULL, NAME##_enum i3 = NAME##_NULL, NAME##_enum i4 = NAME##_NULL, NAME##_enum i5 = NAME##_NULL, NAME##_enum i6 = NAME##_NULL, NAME##_enum i7 = NAME##_NULL, NAME##_enum i8 = NAME##_NULL, NAME##_enum i9 = NAME##_NULL, NAME##_enum i10 = NAME##_NULL, NAME##_enum i11 = NAME##_NULL) const; \ - template \ - NAME##_cus_value_list value_list(cchar *d, Manip m, \ - std::vector *i) const;\ - template \ - NAME##_cus_value_list value_list(cchar *d, Manip m, \ - sql_cmp_type sc) const;\ - /* cus field */\ - NAME##_cus_field_list field_list(bool i1, bool i2 = false, bool i3 = false, bool i4 = false, bool i5 = false, bool i6 = false, bool i7 = false, bool i8 = false, bool i9 = false, bool i10 = false, bool i11 = false) const {\ - return field_list(",", do_nothing, i1, i2, i3, i4, i5, i6, i7, i8, i9, i10, i11);\ - }\ - NAME##_cus_field_list field_list(NAME##_enum i1, NAME##_enum i2 = NAME##_NULL, NAME##_enum i3 = NAME##_NULL, NAME##_enum i4 = NAME##_NULL, NAME##_enum i5 = NAME##_NULL, NAME##_enum i6 = NAME##_NULL, NAME##_enum i7 = NAME##_NULL, NAME##_enum i8 = NAME##_NULL, NAME##_enum i9 = NAME##_NULL, NAME##_enum i10 = NAME##_NULL, NAME##_enum i11 = NAME##_NULL) const {\ - return field_list(",", do_nothing, i1, i2, i3, i4, i5, i6, i7, i8, i9, i10, i11);\ - }\ - NAME##_cus_field_list field_list(std::vector *i) const {\ - return field_list(",", do_nothing, i);\ - }\ - NAME##_cus_field_list field_list(sql_cmp_type sc) const\ - {\ - return field_list(",", do_nothing, sc);\ - }\ - NAME##_cus_field_list field_list(cchar *d, \ - bool i1, bool i2 = false, bool i3 = false, bool i4 = false, bool i5 = false, bool i6 = false, bool i7 = false, bool i8 = false, bool i9 = false, bool i10 = false, bool i11 = false) const {\ - return field_list(d, do_nothing, i1, i2, i3, i4, i5, i6, i7, i8, i9, i10, i11);\ - }\ - NAME##_cus_field_list field_list(cchar *d,\ - NAME##_enum i1, NAME##_enum i2 = NAME##_NULL, NAME##_enum i3 = NAME##_NULL, NAME##_enum i4 = NAME##_NULL, NAME##_enum i5 = NAME##_NULL, NAME##_enum i6 = NAME##_NULL, NAME##_enum i7 = NAME##_NULL, NAME##_enum i8 = NAME##_NULL, NAME##_enum i9 = NAME##_NULL, NAME##_enum i10 = NAME##_NULL, NAME##_enum i11 = NAME##_NULL) const {\ - return field_list(d, do_nothing, i1, i2, i3, i4, i5, i6, i7, i8, i9, i10, i11);\ - }\ - NAME##_cus_field_list field_list(cchar *d, \ - std::vector *i) const {\ - return field_list(d, do_nothing, i);\ - }\ - NAME##_cus_field_list field_list(cchar *d, \ - sql_cmp_type sc) const {\ - return field_list(d, do_nothing, sc);\ - }\ - template \ - NAME##_cus_field_list field_list(cchar *d, Manip m,\ - bool i1, bool i2 = false, bool i3 = false, bool i4 = false, bool i5 = false, bool i6 = false, bool i7 = false, bool i8 = false, bool i9 = false, bool i10 = false, bool i11 = false) const; \ - template \ - NAME##_cus_field_list field_list(cchar *d, Manip m,\ - NAME##_enum i1, NAME##_enum i2 = NAME##_NULL, NAME##_enum i3 = NAME##_NULL, NAME##_enum i4 = NAME##_NULL, NAME##_enum i5 = NAME##_NULL, NAME##_enum i6 = NAME##_NULL, NAME##_enum i7 = NAME##_NULL, NAME##_enum i8 = NAME##_NULL, NAME##_enum i9 = NAME##_NULL, NAME##_enum i10 = NAME##_NULL, NAME##_enum i11 = NAME##_NULL) const; \ - template \ - NAME##_cus_field_list field_list(cchar *d, Manip m,\ - std::vector *i) const;\ - template \ - NAME##_cus_field_list field_list(cchar *d, Manip m, \ - sql_cmp_type sc) const;\ - /* cus equal */\ - NAME##_cus_equal_list equal_list(bool i1, bool i2 = false, bool i3 = false, bool i4 = false, bool i5 = false, bool i6 = false, bool i7 = false, bool i8 = false, bool i9 = false, bool i10 = false, bool i11 = false) const {\ - return equal_list(",", " = ", quote, i1, i2, i3, i4, i5, i6, i7, i8, i9, i10, i11);\ - }\ - NAME##_cus_equal_list equal_list(NAME##_enum i1, NAME##_enum i2 = NAME##_NULL, NAME##_enum i3 = NAME##_NULL, NAME##_enum i4 = NAME##_NULL, NAME##_enum i5 = NAME##_NULL, NAME##_enum i6 = NAME##_NULL, NAME##_enum i7 = NAME##_NULL, NAME##_enum i8 = NAME##_NULL, NAME##_enum i9 = NAME##_NULL, NAME##_enum i10 = NAME##_NULL, NAME##_enum i11 = NAME##_NULL) const {\ - return equal_list(",", " = ", quote, i1, i2, i3, i4, i5, i6, i7, i8, i9, i10, i11);\ - }\ - NAME##_cus_equal_list equal_list(std::vector *i) const {\ - return equal_list(",", " = ", quote, i);\ - }\ - NAME##_cus_equal_list equal_list(sql_cmp_type sc) const {\ - return equal_list(",", " = ", quote, sc);\ - }\ - NAME##_cus_equal_list equal_list(cchar *d, bool i1, bool i2 = false, bool i3 = false, bool i4 = false, bool i5 = false, bool i6 = false, bool i7 = false, bool i8 = false, bool i9 = false, bool i10 = false, bool i11 = false) const {\ - return equal_list(d, " = ", quote, i1, i2, i3, i4, i5, i6, i7, i8, i9, i10, i11);\ - }\ - NAME##_cus_equal_list equal_list(cchar *d, NAME##_enum i1, NAME##_enum i2 = NAME##_NULL, NAME##_enum i3 = NAME##_NULL, NAME##_enum i4 = NAME##_NULL, NAME##_enum i5 = NAME##_NULL, NAME##_enum i6 = NAME##_NULL, NAME##_enum i7 = NAME##_NULL, NAME##_enum i8 = NAME##_NULL, NAME##_enum i9 = NAME##_NULL, NAME##_enum i10 = NAME##_NULL, NAME##_enum i11 = NAME##_NULL) const {\ - return equal_list(d, " = ", quote, i1, i2, i3, i4, i5, i6, i7, i8, i9, i10, i11);\ - }\ - NAME##_cus_equal_list equal_list(cchar *d, \ - std::vector *i) const {\ - return equal_list(d, " = ", quote, i);\ - }\ - NAME##_cus_equal_list equal_list(cchar *d, \ - sql_cmp_type sc) const {\ - return equal_list(d, " = ", quote, sc);\ - }\ - NAME##_cus_equal_list equal_list(cchar *d, cchar *c,\ - bool i1, bool i2 = false, bool i3 = false, bool i4 = false, bool i5 = false, bool i6 = false, bool i7 = false, bool i8 = false, bool i9 = false, bool i10 = false, bool i11 = false) const {\ - return equal_list(d, c, quote, i1, i2, i3, i4, i5, i6, i7, i8, i9, i10, i11);\ - }\ - NAME##_cus_equal_list equal_list(cchar *d, cchar *c,\ - NAME##_enum i1, NAME##_enum i2 = NAME##_NULL, NAME##_enum i3 = NAME##_NULL, NAME##_enum i4 = NAME##_NULL, NAME##_enum i5 = NAME##_NULL, NAME##_enum i6 = NAME##_NULL, NAME##_enum i7 = NAME##_NULL, NAME##_enum i8 = NAME##_NULL, NAME##_enum i9 = NAME##_NULL, NAME##_enum i10 = NAME##_NULL, NAME##_enum i11 = NAME##_NULL) const {\ - return equal_list(d, c, quote, i1, i2, i3, i4, i5, i6, i7, i8, i9, i10, i11);\ - }\ - NAME##_cus_equal_list equal_list(cchar *d, cchar *c,\ - std::vector *i) const {\ - return equal_list(d, c, quote, i);\ - }\ - NAME##_cus_equal_list equal_list(cchar *d, cchar *c,\ - sql_cmp_type sc) const {\ - return equal_list(d, c, quote, sc);\ - }\ - template \ - NAME##_cus_equal_list equal_list(cchar *d, cchar *c, Manip m, \ - bool i1, bool i2 = false, bool i3 = false, bool i4 = false, bool i5 = false, bool i6 = false, bool i7 = false, bool i8 = false, bool i9 = false, bool i10 = false, bool i11 = false) const; \ - template \ - NAME##_cus_equal_list equal_list(cchar *d, cchar *c, Manip m, \ - NAME##_enum i1, NAME##_enum i2 = NAME##_NULL, NAME##_enum i3 = NAME##_NULL, NAME##_enum i4 = NAME##_NULL, NAME##_enum i5 = NAME##_NULL, NAME##_enum i6 = NAME##_NULL, NAME##_enum i7 = NAME##_NULL, NAME##_enum i8 = NAME##_NULL, NAME##_enum i9 = NAME##_NULL, NAME##_enum i10 = NAME##_NULL, NAME##_enum i11 = NAME##_NULL) const; \ - template \ - NAME##_cus_equal_list equal_list(cchar *d, cchar *c, Manip m, \ - std::vector *i) const;\ - template \ - NAME##_cus_equal_list equal_list(cchar *d, cchar *c, Manip m, \ - sql_cmp_type sc) const;\ - }; \ - const char *NAME::names[] = { \ - N1 ,\ - N2 ,\ - N3 ,\ - N4 ,\ - N5 ,\ - N6 ,\ - N7 ,\ - N8 ,\ - N9 ,\ - N10 ,\ - N11 \ - }; \ - const char *NAME::_table = #NAME ; \ - template \ - NAME##_cus_value_list::NAME##_cus_value_list\ - (const NAME *o, cchar *d, Manip m, bool i1, bool i2, bool i3, bool i4, bool i5, bool i6, bool i7, bool i8, bool i9, bool i10, bool i11) \ - { \ - delem = d;\ - manip = m;\ - del_vector = true;\ - obj = o; \ - include = new std::vector(11, false);\ - if (i1) (*include)[0]=true;\ - if (i2) (*include)[1]=true;\ - if (i3) (*include)[2]=true;\ - if (i4) (*include)[3]=true;\ - if (i5) (*include)[4]=true;\ - if (i6) (*include)[5]=true;\ - if (i7) (*include)[6]=true;\ - if (i8) (*include)[7]=true;\ - if (i9) (*include)[8]=true;\ - if (i10) (*include)[9]=true;\ - if (i11) (*include)[10]=true;\ - } \ - template \ - NAME##_cus_value_list::NAME##_cus_value_list\ - (const NAME *o, cchar *d, Manip m, NAME##_enum i1, NAME##_enum i2, NAME##_enum i3, NAME##_enum i4, NAME##_enum i5, NAME##_enum i6, NAME##_enum i7, NAME##_enum i8, NAME##_enum i9, NAME##_enum i10, NAME##_enum i11) { \ - delem = d;\ - manip = m;\ - del_vector = true; \ - obj = o; \ - include = new std::vector(11, false); \ - if (i1 == NAME##_NULL) return;\ - (*include)[i1]=true;\ - if (i2 == NAME##_NULL) return;\ - (*include)[i2]=true;\ - if (i3 == NAME##_NULL) return;\ - (*include)[i3]=true;\ - if (i4 == NAME##_NULL) return;\ - (*include)[i4]=true;\ - if (i5 == NAME##_NULL) return;\ - (*include)[i5]=true;\ - if (i6 == NAME##_NULL) return;\ - (*include)[i6]=true;\ - if (i7 == NAME##_NULL) return;\ - (*include)[i7]=true;\ - if (i8 == NAME##_NULL) return;\ - (*include)[i8]=true;\ - if (i9 == NAME##_NULL) return;\ - (*include)[i9]=true;\ - if (i10 == NAME##_NULL) return;\ - (*include)[i10]=true;\ - if (i11 == NAME##_NULL) return;\ - (*include)[i11]=true;\ - }\ - template \ - NAME##_cus_field_list::NAME##_cus_field_list\ - (const NAME *o, cchar *d, Manip m, bool i1, bool i2, bool i3, bool i4, bool i5, bool i6, bool i7, bool i8, bool i9, bool i10, bool i11) {\ - delem = d;\ - manip = m;\ - del_vector = true; \ - obj = o; \ - include = new std::vector(11, false); \ - if (i1) (*include)[0]=true;\ - if (i2) (*include)[1]=true;\ - if (i3) (*include)[2]=true;\ - if (i4) (*include)[3]=true;\ - if (i5) (*include)[4]=true;\ - if (i6) (*include)[5]=true;\ - if (i7) (*include)[6]=true;\ - if (i8) (*include)[7]=true;\ - if (i9) (*include)[8]=true;\ - if (i10) (*include)[9]=true;\ - if (i11) (*include)[10]=true;\ - } \ - template \ - NAME##_cus_field_list::NAME##_cus_field_list\ - (const NAME *o, cchar *d, Manip m, NAME##_enum i1, NAME##_enum i2, NAME##_enum i3, NAME##_enum i4, NAME##_enum i5, NAME##_enum i6, NAME##_enum i7, NAME##_enum i8, NAME##_enum i9, NAME##_enum i10, NAME##_enum i11) { \ - delem = d;\ - manip = m;\ - del_vector = true; \ - obj = o; \ - include = new std::vector(11, false); \ - if (i1 == NAME##_NULL) return;\ - (*include)[i1]=true;\ - if (i2 == NAME##_NULL) return;\ - (*include)[i2]=true;\ - if (i3 == NAME##_NULL) return;\ - (*include)[i3]=true;\ - if (i4 == NAME##_NULL) return;\ - (*include)[i4]=true;\ - if (i5 == NAME##_NULL) return;\ - (*include)[i5]=true;\ - if (i6 == NAME##_NULL) return;\ - (*include)[i6]=true;\ - if (i7 == NAME##_NULL) return;\ - (*include)[i7]=true;\ - if (i8 == NAME##_NULL) return;\ - (*include)[i8]=true;\ - if (i9 == NAME##_NULL) return;\ - (*include)[i9]=true;\ - if (i10 == NAME##_NULL) return;\ - (*include)[i10]=true;\ - if (i11 == NAME##_NULL) return;\ - (*include)[i11]=true;\ - }\ - template \ - NAME##_cus_equal_list::NAME##_cus_equal_list\ - (const NAME *o, cchar *d, cchar *c, Manip m, bool i1, bool i2, bool i3, bool i4, bool i5, bool i6, bool i7, bool i8, bool i9, bool i10, bool i11) { \ - delem = d;\ - comp = c;\ - manip = m;\ - del_vector = true; \ - obj = o; \ - include = new std::vector(11, false); \ - if (i1) (*include)[0]=true;\ - if (i2) (*include)[1]=true;\ - if (i3) (*include)[2]=true;\ - if (i4) (*include)[3]=true;\ - if (i5) (*include)[4]=true;\ - if (i6) (*include)[5]=true;\ - if (i7) (*include)[6]=true;\ - if (i8) (*include)[7]=true;\ - if (i9) (*include)[8]=true;\ - if (i10) (*include)[9]=true;\ - if (i11) (*include)[10]=true;\ - } \ - template \ - NAME##_cus_equal_list::NAME##_cus_equal_list\ - (const NAME *o, cchar *d, cchar *c, Manip m, NAME##_enum i1, NAME##_enum i2, NAME##_enum i3, NAME##_enum i4, NAME##_enum i5, NAME##_enum i6, NAME##_enum i7, NAME##_enum i8, NAME##_enum i9, NAME##_enum i10, NAME##_enum i11) { \ - delem = d;\ - comp = c;\ - manip = m;\ - del_vector = true; \ - obj = o; \ - include = new std::vector(11, false); \ - if (i1 == NAME##_NULL) return;\ - (*include)[i1]=true;\ - if (i2 == NAME##_NULL) return;\ - (*include)[i2]=true;\ - if (i3 == NAME##_NULL) return;\ - (*include)[i3]=true;\ - if (i4 == NAME##_NULL) return;\ - (*include)[i4]=true;\ - if (i5 == NAME##_NULL) return;\ - (*include)[i5]=true;\ - if (i6 == NAME##_NULL) return;\ - (*include)[i6]=true;\ - if (i7 == NAME##_NULL) return;\ - (*include)[i7]=true;\ - if (i8 == NAME##_NULL) return;\ - (*include)[i8]=true;\ - if (i9 == NAME##_NULL) return;\ - (*include)[i9]=true;\ - if (i10 == NAME##_NULL) return;\ - (*include)[i10]=true;\ - if (i11 == NAME##_NULL) return;\ - (*include)[i11]=true;\ - }\ - template \ - std::ostream& operator << (std::ostream& s, const NAME##_value_list& obj) { \ - s << obj.manip << obj.obj->I1 << obj.delem;\ - s << obj.manip << obj.obj->I2 << obj.delem;\ - s << obj.manip << obj.obj->I3 << obj.delem;\ - s << obj.manip << obj.obj->I4 << obj.delem;\ - s << obj.manip << obj.obj->I5 << obj.delem;\ - s << obj.manip << obj.obj->I6 << obj.delem;\ - s << obj.manip << obj.obj->I7 << obj.delem;\ - s << obj.manip << obj.obj->I8 << obj.delem;\ - s << obj.manip << obj.obj->I9 << obj.delem;\ - s << obj.manip << obj.obj->I10 << obj.delem;\ - s << obj.manip << obj.obj->I11; \ - return s; \ - } \ - template \ - std::ostream& operator << (std::ostream& s, const NAME##_field_list& obj) { \ - s << obj.manip << obj.obj->names[0] << obj.delem;\ - s << obj.manip << obj.obj->names[1] << obj.delem;\ - s << obj.manip << obj.obj->names[2] << obj.delem;\ - s << obj.manip << obj.obj->names[3] << obj.delem;\ - s << obj.manip << obj.obj->names[4] << obj.delem;\ - s << obj.manip << obj.obj->names[5] << obj.delem;\ - s << obj.manip << obj.obj->names[6] << obj.delem;\ - s << obj.manip << obj.obj->names[7] << obj.delem;\ - s << obj.manip << obj.obj->names[8] << obj.delem;\ - s << obj.manip << obj.obj->names[9] << obj.delem;\ - s << obj.manip << obj.obj->names[10]; \ - return s; \ - } \ - template \ - std::ostream& operator << (std::ostream& s, const NAME##_equal_list& obj) { \ - s << obj.obj->names[0] << obj.comp << obj.manip << obj.obj->I1 << obj.delem;\ - s << obj.obj->names[1] << obj.comp << obj.manip << obj.obj->I2 << obj.delem;\ - s << obj.obj->names[2] << obj.comp << obj.manip << obj.obj->I3 << obj.delem;\ - s << obj.obj->names[3] << obj.comp << obj.manip << obj.obj->I4 << obj.delem;\ - s << obj.obj->names[4] << obj.comp << obj.manip << obj.obj->I5 << obj.delem;\ - s << obj.obj->names[5] << obj.comp << obj.manip << obj.obj->I6 << obj.delem;\ - s << obj.obj->names[6] << obj.comp << obj.manip << obj.obj->I7 << obj.delem;\ - s << obj.obj->names[7] << obj.comp << obj.manip << obj.obj->I8 << obj.delem;\ - s << obj.obj->names[8] << obj.comp << obj.manip << obj.obj->I9 << obj.delem;\ - s << obj.obj->names[9] << obj.comp << obj.manip << obj.obj->I10 << obj.delem;\ - s << obj.obj->names[10] << obj.comp << obj.manip << obj.obj->I11; \ - return s; \ - } \ - template \ - std::ostream& operator << (std::ostream& s, const NAME##_cus_value_list& obj) { \ - bool before = false; \ - if ((*obj.include)[0]) { \ - s << obj.manip << obj.obj->I1;\ - before = true; \ - } \ - if ((*obj.include)[1]) { \ - if (before) s << obj.delem;\ - s << obj.manip << obj.obj->I2;\ - before = true; \ - } \ - if ((*obj.include)[2]) { \ - if (before) s << obj.delem;\ - s << obj.manip << obj.obj->I3;\ - before = true; \ - } \ - if ((*obj.include)[3]) { \ - if (before) s << obj.delem;\ - s << obj.manip << obj.obj->I4;\ - before = true; \ - } \ - if ((*obj.include)[4]) { \ - if (before) s << obj.delem;\ - s << obj.manip << obj.obj->I5;\ - before = true; \ - } \ - if ((*obj.include)[5]) { \ - if (before) s << obj.delem;\ - s << obj.manip << obj.obj->I6;\ - before = true; \ - } \ - if ((*obj.include)[6]) { \ - if (before) s << obj.delem;\ - s << obj.manip << obj.obj->I7;\ - before = true; \ - } \ - if ((*obj.include)[7]) { \ - if (before) s << obj.delem;\ - s << obj.manip << obj.obj->I8;\ - before = true; \ - } \ - if ((*obj.include)[8]) { \ - if (before) s << obj.delem;\ - s << obj.manip << obj.obj->I9;\ - before = true; \ - } \ - if ((*obj.include)[9]) { \ - if (before) s << obj.delem;\ - s << obj.manip << obj.obj->I10;\ - before = true; \ - } \ - if ((*obj.include)[10]) { \ - if (before) s << obj.delem;\ - s << obj.manip << obj.obj->I11;\ - } \ - return s; \ - } \ - template \ - std::ostream& operator << (std::ostream& s, const NAME##_cus_field_list& obj) { \ - bool before = false; \ - if ((*obj.include)[0]) { \ - s << obj.manip << obj.obj->names[0];\ - before = true; \ - } \ - if ((*obj.include)[1]) { \ - if (before) s << obj.delem;\ - s << obj.manip << obj.obj->names[1];\ - before = true; \ - } \ - if ((*obj.include)[2]) { \ - if (before) s << obj.delem;\ - s << obj.manip << obj.obj->names[2];\ - before = true; \ - } \ - if ((*obj.include)[3]) { \ - if (before) s << obj.delem;\ - s << obj.manip << obj.obj->names[3];\ - before = true; \ - } \ - if ((*obj.include)[4]) { \ - if (before) s << obj.delem;\ - s << obj.manip << obj.obj->names[4];\ - before = true; \ - } \ - if ((*obj.include)[5]) { \ - if (before) s << obj.delem;\ - s << obj.manip << obj.obj->names[5];\ - before = true; \ - } \ - if ((*obj.include)[6]) { \ - if (before) s << obj.delem;\ - s << obj.manip << obj.obj->names[6];\ - before = true; \ - } \ - if ((*obj.include)[7]) { \ - if (before) s << obj.delem;\ - s << obj.manip << obj.obj->names[7];\ - before = true; \ - } \ - if ((*obj.include)[8]) { \ - if (before) s << obj.delem;\ - s << obj.manip << obj.obj->names[8];\ - before = true; \ - } \ - if ((*obj.include)[9]) { \ - if (before) s << obj.delem;\ - s << obj.manip << obj.obj->names[9];\ - before = true; \ - } \ - if ((*obj.include)[10]) { \ - if (before) s << obj.delem;\ - s << obj.manip << obj.obj->names[10];\ - } \ - return s; \ - } \ - template \ - std::ostream& operator << (std::ostream& s, const NAME##_cus_equal_list& obj) { \ - bool before = false; \ - if ((*obj.include)[0]) { \ - s << obj.obj->names[0] << obj.comp << obj.manip << obj.obj->I1;\ - before = true; \ - } \ - if ((*obj.include)[1]) { \ - if (before) s << obj.delem;\ - s << obj.obj->names[1] << obj.comp << obj.manip << obj.obj->I2;\ - before = true; \ - } \ - if ((*obj.include)[2]) { \ - if (before) s << obj.delem;\ - s << obj.obj->names[2] << obj.comp << obj.manip << obj.obj->I3;\ - before = true; \ - } \ - if ((*obj.include)[3]) { \ - if (before) s << obj.delem;\ - s << obj.obj->names[3] << obj.comp << obj.manip << obj.obj->I4;\ - before = true; \ - } \ - if ((*obj.include)[4]) { \ - if (before) s << obj.delem;\ - s << obj.obj->names[4] << obj.comp << obj.manip << obj.obj->I5;\ - before = true; \ - } \ - if ((*obj.include)[5]) { \ - if (before) s << obj.delem;\ - s << obj.obj->names[5] << obj.comp << obj.manip << obj.obj->I6;\ - before = true; \ - } \ - if ((*obj.include)[6]) { \ - if (before) s << obj.delem;\ - s << obj.obj->names[6] << obj.comp << obj.manip << obj.obj->I7;\ - before = true; \ - } \ - if ((*obj.include)[7]) { \ - if (before) s << obj.delem;\ - s << obj.obj->names[7] << obj.comp << obj.manip << obj.obj->I8;\ - before = true; \ - } \ - if ((*obj.include)[8]) { \ - if (before) s << obj.delem;\ - s << obj.obj->names[8] << obj.comp << obj.manip << obj.obj->I9;\ - before = true; \ - } \ - if ((*obj.include)[9]) { \ - if (before) s << obj.delem;\ - s << obj.obj->names[9] << obj.comp << obj.manip << obj.obj->I10;\ - before = true; \ - } \ - if ((*obj.include)[10]) { \ - if (before) s << obj.delem;\ - s << obj.obj->names[10] << obj.comp << obj.manip << obj.obj->I11;\ - } \ - return s; \ - } \ - template \ - inline NAME##_value_list NAME::value_list(cchar *d, Manip m) const { \ - return NAME##_value_list (this, d, m); \ - } \ - template \ - inline NAME##_field_list NAME::field_list(cchar *d, Manip m) const { \ - return NAME##_field_list (this, d, m); \ - } \ - template \ - inline NAME##_equal_list NAME::equal_list(cchar *d, cchar *c, Manip m) const { \ - return NAME##_equal_list (this, d, c, m); \ - } \ - template \ - inline NAME##_cus_value_list NAME::value_list(cchar *d, Manip m,\ - bool i1, bool i2, bool i3, bool i4, bool i5, bool i6, bool i7, bool i8, bool i9, bool i10, bool i11) const {\ - return NAME##_cus_value_list (this, d, m, i1, i2, i3, i4, i5, i6, i7, i8, i9, i10, i11); \ - } \ - template \ - inline NAME##_cus_field_list NAME::field_list(cchar *d, Manip m,\ - bool i1, bool i2, bool i3, bool i4, bool i5, bool i6, bool i7, bool i8, bool i9, bool i10, bool i11) const { \ - return NAME##_cus_field_list (this, d, m, i1, i2, i3, i4, i5, i6, i7, i8, i9, i10, i11); \ - } \ - template \ - inline NAME##_cus_equal_list NAME::equal_list(cchar *d, cchar *c, Manip m,\ - bool i1, bool i2, bool i3, bool i4, bool i5, bool i6, bool i7, bool i8, bool i9, bool i10, bool i11) const { \ - return NAME##_cus_equal_list (this, d, c, m, i1, i2, i3, i4, i5, i6, i7, i8, i9, i10, i11); \ - } \ - template \ - inline NAME##_cus_value_list NAME::value_list(cchar *d, Manip m,\ - NAME##_enum i1, NAME##_enum i2, NAME##_enum i3, NAME##_enum i4, NAME##_enum i5, NAME##_enum i6, NAME##_enum i7, NAME##_enum i8, NAME##_enum i9, NAME##_enum i10, NAME##_enum i11) const { \ - return NAME##_cus_value_list (this, d, m, i1, i2, i3, i4, i5, i6, i7, i8, i9, i10, i11); \ - } \ - template \ - inline NAME##_cus_field_list NAME::field_list(cchar *d, Manip m,\ - NAME##_enum i1, NAME##_enum i2, NAME##_enum i3, NAME##_enum i4, NAME##_enum i5, NAME##_enum i6, NAME##_enum i7, NAME##_enum i8, NAME##_enum i9, NAME##_enum i10, NAME##_enum i11) const {\ - return NAME##_cus_field_list (this, d, m, i1, i2, i3, i4, i5, i6, i7, i8, i9, i10, i11); \ - } \ - template \ - inline NAME##_cus_equal_list NAME::equal_list(cchar *d, cchar *c, Manip m, \ - NAME##_enum i1, NAME##_enum i2, NAME##_enum i3, NAME##_enum i4, NAME##_enum i5, NAME##_enum i6, NAME##_enum i7, NAME##_enum i8, NAME##_enum i9, NAME##_enum i10, NAME##_enum i11) const { \ - return NAME##_cus_equal_list (this, d, c, m, i1, i2, i3, i4, i5, i6, i7, i8, i9, i10, i11); \ - } \ - template \ - inline NAME##_cus_value_list NAME::value_list(cchar *d, Manip m,\ - std::vector *i) const {\ - return NAME##_cus_value_list (this, d, m, i);\ - }\ - template \ - inline NAME##_cus_field_list NAME::field_list(cchar *d, Manip m,\ - std::vector *i) const {\ - return NAME##_cus_field_list (this, d, m, i);\ - }\ - template \ - inline NAME##_cus_equal_list NAME::equal_list(cchar *d, cchar *c, Manip m,\ - std::vector *i) const {\ - return NAME##_cus_equal_list (this, d, c, m, i);\ - }\ - template \ - inline NAME##_cus_value_list \ - NAME::value_list(cchar *d, Manip m, sql_cmp_type /*sc*/) const {\ - sql_compare_type_def_##CMP (NAME, value, NUM);\ - }\ - template \ - inline NAME##_cus_field_list \ - NAME::field_list(cchar *d, Manip m, sql_cmp_type /*sc*/) const {\ - sql_compare_type_def_##CMP (NAME, field, NUM);\ - }\ - template \ - inline NAME##_cus_equal_list \ - NAME::equal_list(cchar *d, cchar *c, Manip m, sql_cmp_type /*sc*/) const {\ - sql_compare_type_defe_##CMP (NAME, equal, NUM);\ - }\ - template \ - void populate_##NAME (NAME *s, const Row &row) { \ - s->I1 = static_cast(row.at(O1));\ - s->I2 = static_cast(row.at(O2));\ - s->I3 = static_cast(row.at(O3));\ - s->I4 = static_cast(row.at(O4));\ - s->I5 = static_cast(row.at(O5));\ - s->I6 = static_cast(row.at(O6));\ - s->I7 = static_cast(row.at(O7));\ - s->I8 = static_cast(row.at(O8));\ - s->I9 = static_cast(row.at(O9));\ - s->I10 = static_cast(row.at(O10));\ - s->I11 = static_cast(row.at(O11));\ - } \ - inline NAME::NAME (const Row &row) \ - {populate_##NAME(this, row);}\ - inline void NAME::set (const Row &row)\ - {populate_##NAME(this, row);}\ - sql_COMPARE__##CMP(NAME, I1, I2, I3, I4, I5, I6, I7, I8, I9, I10, I11, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ) - -#define sql_create_basic_11(NAME, CMP, CONTR, T1, I1, T2, I2, T3, I3, T4, I4, T5, I5, T6, I6, T7, I7, T8, I8, T9, I9, T10, I10, T11, I11) \ - sql_create_basic_c_order_11(NAME, CMP, CONTR, T1, I1, 0, T2, I2, 1, T3, I3, 2, T4, I4, 3, T5, I5, 4, T6, I6, 5, T7, I7, 6, T8, I8, 7, T9, I9, 8, T10, I10, 9, T11, I11, 10) - -#define sql_create_11(NAME, CMP, CONTR, T1, I1, T2, I2, T3, I3, T4, I4, T5, I5, T6, I6, T7, I7, T8, I8, T9, I9, T10, I10, T11, I11) \ - sql_create_complete_11(NAME, CMP, CONTR, T1, I1, #I1, 0, T2, I2, #I2, 1, T3, I3, #I3, 2, T4, I4, #I4, 3, T5, I5, #I5, 4, T6, I6, #I6, 5, T7, I7, #I7, 6, T8, I8, #I8, 7, T9, I9, #I9, 8, T10, I10, #I10, 9, T11, I11, #I11, 10) \ - -#define sql_create_c_order_11(NAME, CMP, CONTR, T1, I1, O1, T2, I2, O2, T3, I3, O3, T4, I4, O4, T5, I5, O5, T6, I6, O6, T7, I7, O7, T8, I8, O8, T9, I9, O9, T10, I10, O10, T11, I11, O11) \ - sql_create_complete_11(NAME, CMP, CONTR, T1, I1, #I1, O1, T2, I2, #I2, O2, T3, I3, #I3, O3, T4, I4, #I4, O4, T5, I5, #I5, O5, T6, I6, #I6, O6, T7, I7, #I7, O7, T8, I8, #I8, O8, T9, I9, #I9, O9, T10, I10, #I10, O10, T11, I11, #I11, O11) - -#define sql_create_c_names_11(NAME, CMP, CONTR, T1, I1, N1, T2, I2, N2, T3, I3, N3, T4, I4, N4, T5, I5, N5, T6, I6, N6, T7, I7, N7, T8, I8, N8, T9, I9, N9, T10, I10, N10, T11, I11, N11) \ - sql_create_complete_11(NAME, CMP, CONTR, T1, I1, N1, 0, T2, I2, N2, 1, T3, I3, N3, 2, T4, I4, N4, 3, T5, I5, N5, 4, T6, I6, N6, 5, T7, I7, N7, 6, T8, I8, N8, 7, T9, I9, N9, 8, T10, I10, N10, 9, T11, I11, N11, 10) - -// --------------------------------------------------- -// End Create 11 -// --------------------------------------------------- - -// --------------------------------------------------- -// Begin Create 12 -// --------------------------------------------------- -#define sql_create_basic_c_order_12(NAME, CMP, CONTR, T1, I1, O1, T2, I2, O2, T3, I3, O3, T4, I4, O4, T5, I5, O5, T6, I6, O6, T7, I7, O7, T8, I8, O8, T9, I9, O9, T10, I10, O10, T11, I11, O11, T12, I12, O12)\ - struct NAME; \ - template int sql_compare_##NAME (const NAME &, const NAME &);\ - struct NAME { \ - T1 I1;\ - T2 I2;\ - T3 I3;\ - T4 I4;\ - T5 I5;\ - T6 I6;\ - T7 I7;\ - T8 I8;\ - T9 I9;\ - T10 I10;\ - T11 I11;\ - T12 I12; \ - NAME () {} \ - NAME (const Row &row);\ - sql_compare_define_##CMP(NAME, T1, I1, T2, I2, T3, I3, T4, I4, T5, I5, T6, I6, T7, I7, T8, I8, T9, I9, T10, I10, T11, I11, T12, I12, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0)\ - }; \ - template \ - void populate_##NAME (NAME *s, const Row &row) { \ - s->I1 = static_cast(row.at(O1));\ - s->I2 = static_cast(row.at(O2));\ - s->I3 = static_cast(row.at(O3));\ - s->I4 = static_cast(row.at(O4));\ - s->I5 = static_cast(row.at(O5));\ - s->I6 = static_cast(row.at(O6));\ - s->I7 = static_cast(row.at(O7));\ - s->I8 = static_cast(row.at(O8));\ - s->I9 = static_cast(row.at(O9));\ - s->I10 = static_cast(row.at(O10));\ - s->I11 = static_cast(row.at(O11));\ - s->I12 = static_cast(row.at(O12)); \ - } \ - inline NAME::NAME (const Row &row) \ - {populate_##NAME(this, row);} \ - sql_COMPARE__##CMP(NAME, I1, I2, I3, I4, I5, I6, I7, I8, I9, I10, I11, I12, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ) - -#define sql_create_complete_12(NAME, CMP, CONTR, T1, I1, N1, O1, T2, I2, N2, O2, T3, I3, N3, O3, T4, I4, N4, O4, T5, I5, N5, O5, T6, I6, N6, O6, T7, I7, N7, O7, T8, I8, N8, O8, T9, I9, N9, O9, T10, I10, N10, O10, T11, I11, N11, O11, T12, I12, N12, O12) \ - struct NAME; \ - enum NAME##_enum { \ - NAME##_##I1,\ - NAME##_##I2,\ - NAME##_##I3,\ - NAME##_##I4,\ - NAME##_##I5,\ - NAME##_##I6,\ - NAME##_##I7,\ - NAME##_##I8,\ - NAME##_##I9,\ - NAME##_##I10,\ - NAME##_##I11,\ - NAME##_##I12 \ - ,NAME##_NULL \ - }; \ - template \ - class NAME##_value_list { \ - /*friend std::ostream& operator << <> (std::ostream&, const NAME##_value_list&); */\ - public: \ - const NAME *obj;\ - cchar *delem;\ - Manip manip;\ - public: \ - NAME##_value_list (const NAME *o, cchar *d, Manip m) \ - : obj(o), delem(d), manip(m) {} \ - };\ - template \ - class NAME##_##field_list {\ - /* friend std::ostream& operator << <> (std::ostream&, const NAME##_field_list&); */\ - public: \ - const NAME *obj; \ - cchar *delem;\ - Manip manip;\ - public: \ - NAME##_field_list (const NAME *o, cchar *d, Manip m) \ - : obj(o), delem(d), manip(m) {} \ - };\ - template \ - class NAME##_equal_list { \ - /* friend std::ostream& operator << <> (std::ostream&, const NAME##_equal_list&); */\ - public: \ - const NAME *obj;\ - cchar *delem;\ - cchar *comp;\ - Manip manip;\ - public: \ - NAME##_equal_list (const NAME *o, cchar *d, cchar *c, Manip m) \ - : obj(o), delem(d), comp(c), manip(m) {}\ - };\ - template \ - class NAME##_cus_value_list {\ - /* friend std::ostream& operator << <> (std::ostream&, \ - const NAME##_cus_value_list&); */\ - public:\ - const NAME *obj;\ - std::vector *include;\ - bool del_vector;\ - cchar *delem;\ - Manip manip;\ - public: \ - ~NAME##_cus_value_list () {if (del_vector) delete include;} \ - NAME##_cus_value_list (const NAME *o, cchar *d, Manip m, bool i1, bool i2, bool i3, bool i4, bool i5, bool i6, bool i7, bool i8, bool i9, bool i10, bool i11, bool i12);\ - NAME##_cus_value_list (const NAME *o, cchar *d, Manip m, NAME##_enum i1, NAME##_enum i2, NAME##_enum i3, NAME##_enum i4, NAME##_enum i5, NAME##_enum i6, NAME##_enum i7, NAME##_enum i8, NAME##_enum i9, NAME##_enum i10, NAME##_enum i11, NAME##_enum i12); \ - NAME##_cus_value_list (const NAME *o, cchar *d, Manip m ,std::vector* i)\ - : obj(o), include(i), del_vector(false), delem(d), manip(m) {}\ - };\ - template \ - class NAME##_cus_field_list { \ - /* friend std::ostream& operator << <> (std::ostream&, \ - const NAME##_cus_field_list&); */\ - public:\ - const NAME *obj; \ - std::vector *include; \ - bool del_vector; \ - cchar *delem;\ - Manip manip;\ - public: \ - ~NAME##_cus_field_list () {if (del_vector) delete include;} \ - NAME##_cus_field_list (const NAME *o, cchar *d, Manip m, bool i1, bool i2, bool i3, bool i4, bool i5, bool i6, bool i7, bool i8, bool i9, bool i10, bool i11, bool i12); \ - NAME##_cus_field_list (const NAME *o, cchar *d, Manip m, NAME##_enum i1, NAME##_enum i2, NAME##_enum i3, NAME##_enum i4, NAME##_enum i5, NAME##_enum i6, NAME##_enum i7, NAME##_enum i8, NAME##_enum i9, NAME##_enum i10, NAME##_enum i11, NAME##_enum i12); \ - NAME##_cus_field_list (const NAME *o, cchar *d, Manip m, std::vector *i) \ - : obj(o), include(i), del_vector(false), delem(d), manip(m) {}\ - };\ - template \ - class NAME##_cus_equal_list {\ - /* friend std::ostream& operator << <> (std::ostream&, \ - const NAME##_cus_equal_list&); */\ - public:\ - const NAME *obj;\ - std::vector *include;\ - bool del_vector;\ - cchar *delem;\ - cchar *comp;\ - Manip manip;\ - public:\ - ~NAME##_##cus_equal_list () {if (del_vector) delete include;}\ - NAME##_##cus_equal_list (const NAME *o, cchar *d, cchar *c, Manip m, bool i1, bool i2, bool i3, bool i4, bool i5, bool i6, bool i7, bool i8, bool i9, bool i10, bool i11, bool i12); \ - NAME##_##cus_equal_list (const NAME *o, cchar *d, cchar *c, Manip m, NAME##_enum i1, NAME##_enum i2, NAME##_enum i3, NAME##_enum i4, NAME##_enum i5, NAME##_enum i6, NAME##_enum i7, NAME##_enum i8, NAME##_enum i9, NAME##_enum i10, NAME##_enum i11, NAME##_enum i12); \ - NAME##_##cus_equal_list (const NAME *o, cchar *d, cchar *c, Manip m, std::vector *i) \ - : obj(o), include(i), del_vector(false), delem(d), comp(c), manip(m) {}\ - };\ - template int sql_compare_##NAME (const NAME &, const NAME &);\ - struct NAME { \ - T1 I1;\ - T2 I2;\ - T3 I3;\ - T4 I4;\ - T5 I5;\ - T6 I6;\ - T7 I7;\ - T8 I8;\ - T9 I9;\ - T10 I10;\ - T11 I11;\ - T12 I12; \ - NAME () {} \ - NAME (const Row &row);\ - void set (const Row &row);\ - sql_compare_define_##CMP(NAME, T1, I1, T2, I2, T3, I3, T4, I4, T5, I5, T6, I6, T7, I7, T8, I8, T9, I9, T10, I10, T11, I11, T12, I12, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0)\ - sql_construct_define_##CONTR(NAME, T1, I1, T2, I2, T3, I3, T4, I4, T5, I5, T6, I6, T7, I7, T8, I8, T9, I9, T10, I10, T11, I11, T12, I12, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0)\ - static const char *names[];\ - static const char *_table;\ - static const char *& table() {return _table;}\ - NAME##_value_list value_list() const {\ - return value_list(",", quote);}\ - NAME##_value_list value_list(cchar *d) const {\ - return value_list(d, quote);}\ - template \ - NAME##_value_list value_list(cchar *d, Manip m) const; \ - NAME##_field_list field_list() const {\ - return field_list(",", do_nothing);}\ - NAME##_field_list field_list(cchar *d) const {\ - return field_list(d, do_nothing);}\ - template \ - NAME##_field_list field_list(cchar *d, Manip m) const; \ - NAME##_equal_list equal_list(cchar *d = ",", \ - cchar *c = " = ") const{\ - return equal_list(d, c, quote);}\ - template \ - NAME##_equal_list equal_list(cchar *d, cchar *c, Manip m) const; \ - /* cus_data */\ - NAME##_cus_value_list value_list(bool i1, bool i2 = false, bool i3 = false, bool i4 = false, bool i5 = false, bool i6 = false, bool i7 = false, bool i8 = false, bool i9 = false, bool i10 = false, bool i11 = false, bool i12 = false) const {\ - return value_list(",", quote, i1, i2, i3, i4, i5, i6, i7, i8, i9, i10, i11, i12);\ - }\ - NAME##_cus_value_list value_list(NAME##_enum i1, NAME##_enum i2 = NAME##_NULL, NAME##_enum i3 = NAME##_NULL, NAME##_enum i4 = NAME##_NULL, NAME##_enum i5 = NAME##_NULL, NAME##_enum i6 = NAME##_NULL, NAME##_enum i7 = NAME##_NULL, NAME##_enum i8 = NAME##_NULL, NAME##_enum i9 = NAME##_NULL, NAME##_enum i10 = NAME##_NULL, NAME##_enum i11 = NAME##_NULL, NAME##_enum i12 = NAME##_NULL) const {\ - return value_list(",", quote, i1, i2, i3, i4, i5, i6, i7, i8, i9, i10, i11, i12);\ - }\ - NAME##_cus_value_list value_list(std::vector *i) const {\ - return value_list(",", quote, i);\ - }\ - NAME##_cus_value_list value_list(sql_cmp_type sc) const {\ - return value_list(",", quote, sc);\ - }\ - NAME##_cus_value_list value_list(cchar *d, bool i1, bool i2 = false, bool i3 = false, bool i4 = false, bool i5 = false, bool i6 = false, bool i7 = false, bool i8 = false, bool i9 = false, bool i10 = false, bool i11 = false, bool i12 = false) const {\ - return value_list(d, quote, i1, i2, i3, i4, i5, i6, i7, i8, i9, i10, i11, i12);\ - }\ - NAME##_cus_value_list value_list(cchar *d, NAME##_enum i1, NAME##_enum i2 = NAME##_NULL, NAME##_enum i3 = NAME##_NULL, NAME##_enum i4 = NAME##_NULL, NAME##_enum i5 = NAME##_NULL, NAME##_enum i6 = NAME##_NULL, NAME##_enum i7 = NAME##_NULL, NAME##_enum i8 = NAME##_NULL, NAME##_enum i9 = NAME##_NULL, NAME##_enum i10 = NAME##_NULL, NAME##_enum i11 = NAME##_NULL, NAME##_enum i12 = NAME##_NULL) const {\ - return value_list(d, quote, i1, i2, i3, i4, i5, i6, i7, i8, i9, i10, i11, i12);\ - }\ - NAME##_cus_value_list value_list(cchar *d, \ - std::vector *i) const {\ - return value_list(d, quote, i);\ - }\ - NAME##_cus_value_list value_list(cchar *d, \ - sql_cmp_type sc) const {\ - return value_list(d, quote, sc);\ - }\ - template \ - NAME##_cus_value_list value_list(cchar *d, Manip m,\ - bool i1, bool i2 = false, bool i3 = false, bool i4 = false, bool i5 = false, bool i6 = false, bool i7 = false, bool i8 = false, bool i9 = false, bool i10 = false, bool i11 = false, bool i12 = false) const; \ - template \ - NAME##_cus_value_list value_list(cchar *d, Manip m,\ - NAME##_enum i1, NAME##_enum i2 = NAME##_NULL, NAME##_enum i3 = NAME##_NULL, NAME##_enum i4 = NAME##_NULL, NAME##_enum i5 = NAME##_NULL, NAME##_enum i6 = NAME##_NULL, NAME##_enum i7 = NAME##_NULL, NAME##_enum i8 = NAME##_NULL, NAME##_enum i9 = NAME##_NULL, NAME##_enum i10 = NAME##_NULL, NAME##_enum i11 = NAME##_NULL, NAME##_enum i12 = NAME##_NULL) const; \ - template \ - NAME##_cus_value_list value_list(cchar *d, Manip m, \ - std::vector *i) const;\ - template \ - NAME##_cus_value_list value_list(cchar *d, Manip m, \ - sql_cmp_type sc) const;\ - /* cus field */\ - NAME##_cus_field_list field_list(bool i1, bool i2 = false, bool i3 = false, bool i4 = false, bool i5 = false, bool i6 = false, bool i7 = false, bool i8 = false, bool i9 = false, bool i10 = false, bool i11 = false, bool i12 = false) const {\ - return field_list(",", do_nothing, i1, i2, i3, i4, i5, i6, i7, i8, i9, i10, i11, i12);\ - }\ - NAME##_cus_field_list field_list(NAME##_enum i1, NAME##_enum i2 = NAME##_NULL, NAME##_enum i3 = NAME##_NULL, NAME##_enum i4 = NAME##_NULL, NAME##_enum i5 = NAME##_NULL, NAME##_enum i6 = NAME##_NULL, NAME##_enum i7 = NAME##_NULL, NAME##_enum i8 = NAME##_NULL, NAME##_enum i9 = NAME##_NULL, NAME##_enum i10 = NAME##_NULL, NAME##_enum i11 = NAME##_NULL, NAME##_enum i12 = NAME##_NULL) const {\ - return field_list(",", do_nothing, i1, i2, i3, i4, i5, i6, i7, i8, i9, i10, i11, i12);\ - }\ - NAME##_cus_field_list field_list(std::vector *i) const {\ - return field_list(",", do_nothing, i);\ - }\ - NAME##_cus_field_list field_list(sql_cmp_type sc) const\ - {\ - return field_list(",", do_nothing, sc);\ - }\ - NAME##_cus_field_list field_list(cchar *d, \ - bool i1, bool i2 = false, bool i3 = false, bool i4 = false, bool i5 = false, bool i6 = false, bool i7 = false, bool i8 = false, bool i9 = false, bool i10 = false, bool i11 = false, bool i12 = false) const {\ - return field_list(d, do_nothing, i1, i2, i3, i4, i5, i6, i7, i8, i9, i10, i11, i12);\ - }\ - NAME##_cus_field_list field_list(cchar *d,\ - NAME##_enum i1, NAME##_enum i2 = NAME##_NULL, NAME##_enum i3 = NAME##_NULL, NAME##_enum i4 = NAME##_NULL, NAME##_enum i5 = NAME##_NULL, NAME##_enum i6 = NAME##_NULL, NAME##_enum i7 = NAME##_NULL, NAME##_enum i8 = NAME##_NULL, NAME##_enum i9 = NAME##_NULL, NAME##_enum i10 = NAME##_NULL, NAME##_enum i11 = NAME##_NULL, NAME##_enum i12 = NAME##_NULL) const {\ - return field_list(d, do_nothing, i1, i2, i3, i4, i5, i6, i7, i8, i9, i10, i11, i12);\ - }\ - NAME##_cus_field_list field_list(cchar *d, \ - std::vector *i) const {\ - return field_list(d, do_nothing, i);\ - }\ - NAME##_cus_field_list field_list(cchar *d, \ - sql_cmp_type sc) const {\ - return field_list(d, do_nothing, sc);\ - }\ - template \ - NAME##_cus_field_list field_list(cchar *d, Manip m,\ - bool i1, bool i2 = false, bool i3 = false, bool i4 = false, bool i5 = false, bool i6 = false, bool i7 = false, bool i8 = false, bool i9 = false, bool i10 = false, bool i11 = false, bool i12 = false) const; \ - template \ - NAME##_cus_field_list field_list(cchar *d, Manip m,\ - NAME##_enum i1, NAME##_enum i2 = NAME##_NULL, NAME##_enum i3 = NAME##_NULL, NAME##_enum i4 = NAME##_NULL, NAME##_enum i5 = NAME##_NULL, NAME##_enum i6 = NAME##_NULL, NAME##_enum i7 = NAME##_NULL, NAME##_enum i8 = NAME##_NULL, NAME##_enum i9 = NAME##_NULL, NAME##_enum i10 = NAME##_NULL, NAME##_enum i11 = NAME##_NULL, NAME##_enum i12 = NAME##_NULL) const; \ - template \ - NAME##_cus_field_list field_list(cchar *d, Manip m,\ - std::vector *i) const;\ - template \ - NAME##_cus_field_list field_list(cchar *d, Manip m, \ - sql_cmp_type sc) const;\ - /* cus equal */\ - NAME##_cus_equal_list equal_list(bool i1, bool i2 = false, bool i3 = false, bool i4 = false, bool i5 = false, bool i6 = false, bool i7 = false, bool i8 = false, bool i9 = false, bool i10 = false, bool i11 = false, bool i12 = false) const {\ - return equal_list(",", " = ", quote, i1, i2, i3, i4, i5, i6, i7, i8, i9, i10, i11, i12);\ - }\ - NAME##_cus_equal_list equal_list(NAME##_enum i1, NAME##_enum i2 = NAME##_NULL, NAME##_enum i3 = NAME##_NULL, NAME##_enum i4 = NAME##_NULL, NAME##_enum i5 = NAME##_NULL, NAME##_enum i6 = NAME##_NULL, NAME##_enum i7 = NAME##_NULL, NAME##_enum i8 = NAME##_NULL, NAME##_enum i9 = NAME##_NULL, NAME##_enum i10 = NAME##_NULL, NAME##_enum i11 = NAME##_NULL, NAME##_enum i12 = NAME##_NULL) const {\ - return equal_list(",", " = ", quote, i1, i2, i3, i4, i5, i6, i7, i8, i9, i10, i11, i12);\ - }\ - NAME##_cus_equal_list equal_list(std::vector *i) const {\ - return equal_list(",", " = ", quote, i);\ - }\ - NAME##_cus_equal_list equal_list(sql_cmp_type sc) const {\ - return equal_list(",", " = ", quote, sc);\ - }\ - NAME##_cus_equal_list equal_list(cchar *d, bool i1, bool i2 = false, bool i3 = false, bool i4 = false, bool i5 = false, bool i6 = false, bool i7 = false, bool i8 = false, bool i9 = false, bool i10 = false, bool i11 = false, bool i12 = false) const {\ - return equal_list(d, " = ", quote, i1, i2, i3, i4, i5, i6, i7, i8, i9, i10, i11, i12);\ - }\ - NAME##_cus_equal_list equal_list(cchar *d, NAME##_enum i1, NAME##_enum i2 = NAME##_NULL, NAME##_enum i3 = NAME##_NULL, NAME##_enum i4 = NAME##_NULL, NAME##_enum i5 = NAME##_NULL, NAME##_enum i6 = NAME##_NULL, NAME##_enum i7 = NAME##_NULL, NAME##_enum i8 = NAME##_NULL, NAME##_enum i9 = NAME##_NULL, NAME##_enum i10 = NAME##_NULL, NAME##_enum i11 = NAME##_NULL, NAME##_enum i12 = NAME##_NULL) const {\ - return equal_list(d, " = ", quote, i1, i2, i3, i4, i5, i6, i7, i8, i9, i10, i11, i12);\ - }\ - NAME##_cus_equal_list equal_list(cchar *d, \ - std::vector *i) const {\ - return equal_list(d, " = ", quote, i);\ - }\ - NAME##_cus_equal_list equal_list(cchar *d, \ - sql_cmp_type sc) const {\ - return equal_list(d, " = ", quote, sc);\ - }\ - NAME##_cus_equal_list equal_list(cchar *d, cchar *c,\ - bool i1, bool i2 = false, bool i3 = false, bool i4 = false, bool i5 = false, bool i6 = false, bool i7 = false, bool i8 = false, bool i9 = false, bool i10 = false, bool i11 = false, bool i12 = false) const {\ - return equal_list(d, c, quote, i1, i2, i3, i4, i5, i6, i7, i8, i9, i10, i11, i12);\ - }\ - NAME##_cus_equal_list equal_list(cchar *d, cchar *c,\ - NAME##_enum i1, NAME##_enum i2 = NAME##_NULL, NAME##_enum i3 = NAME##_NULL, NAME##_enum i4 = NAME##_NULL, NAME##_enum i5 = NAME##_NULL, NAME##_enum i6 = NAME##_NULL, NAME##_enum i7 = NAME##_NULL, NAME##_enum i8 = NAME##_NULL, NAME##_enum i9 = NAME##_NULL, NAME##_enum i10 = NAME##_NULL, NAME##_enum i11 = NAME##_NULL, NAME##_enum i12 = NAME##_NULL) const {\ - return equal_list(d, c, quote, i1, i2, i3, i4, i5, i6, i7, i8, i9, i10, i11, i12);\ - }\ - NAME##_cus_equal_list equal_list(cchar *d, cchar *c,\ - std::vector *i) const {\ - return equal_list(d, c, quote, i);\ - }\ - NAME##_cus_equal_list equal_list(cchar *d, cchar *c,\ - sql_cmp_type sc) const {\ - return equal_list(d, c, quote, sc);\ - }\ - template \ - NAME##_cus_equal_list equal_list(cchar *d, cchar *c, Manip m, \ - bool i1, bool i2 = false, bool i3 = false, bool i4 = false, bool i5 = false, bool i6 = false, bool i7 = false, bool i8 = false, bool i9 = false, bool i10 = false, bool i11 = false, bool i12 = false) const; \ - template \ - NAME##_cus_equal_list equal_list(cchar *d, cchar *c, Manip m, \ - NAME##_enum i1, NAME##_enum i2 = NAME##_NULL, NAME##_enum i3 = NAME##_NULL, NAME##_enum i4 = NAME##_NULL, NAME##_enum i5 = NAME##_NULL, NAME##_enum i6 = NAME##_NULL, NAME##_enum i7 = NAME##_NULL, NAME##_enum i8 = NAME##_NULL, NAME##_enum i9 = NAME##_NULL, NAME##_enum i10 = NAME##_NULL, NAME##_enum i11 = NAME##_NULL, NAME##_enum i12 = NAME##_NULL) const; \ - template \ - NAME##_cus_equal_list equal_list(cchar *d, cchar *c, Manip m, \ - std::vector *i) const;\ - template \ - NAME##_cus_equal_list equal_list(cchar *d, cchar *c, Manip m, \ - sql_cmp_type sc) const;\ - }; \ - const char *NAME::names[] = { \ - N1 ,\ - N2 ,\ - N3 ,\ - N4 ,\ - N5 ,\ - N6 ,\ - N7 ,\ - N8 ,\ - N9 ,\ - N10 ,\ - N11 ,\ - N12 \ - }; \ - const char *NAME::_table = #NAME ; \ - template \ - NAME##_cus_value_list::NAME##_cus_value_list\ - (const NAME *o, cchar *d, Manip m, bool i1, bool i2, bool i3, bool i4, bool i5, bool i6, bool i7, bool i8, bool i9, bool i10, bool i11, bool i12) \ - { \ - delem = d;\ - manip = m;\ - del_vector = true;\ - obj = o; \ - include = new std::vector(12, false);\ - if (i1) (*include)[0]=true;\ - if (i2) (*include)[1]=true;\ - if (i3) (*include)[2]=true;\ - if (i4) (*include)[3]=true;\ - if (i5) (*include)[4]=true;\ - if (i6) (*include)[5]=true;\ - if (i7) (*include)[6]=true;\ - if (i8) (*include)[7]=true;\ - if (i9) (*include)[8]=true;\ - if (i10) (*include)[9]=true;\ - if (i11) (*include)[10]=true;\ - if (i12) (*include)[11]=true;\ - } \ - template \ - NAME##_cus_value_list::NAME##_cus_value_list\ - (const NAME *o, cchar *d, Manip m, NAME##_enum i1, NAME##_enum i2, NAME##_enum i3, NAME##_enum i4, NAME##_enum i5, NAME##_enum i6, NAME##_enum i7, NAME##_enum i8, NAME##_enum i9, NAME##_enum i10, NAME##_enum i11, NAME##_enum i12) { \ - delem = d;\ - manip = m;\ - del_vector = true; \ - obj = o; \ - include = new std::vector(12, false); \ - if (i1 == NAME##_NULL) return;\ - (*include)[i1]=true;\ - if (i2 == NAME##_NULL) return;\ - (*include)[i2]=true;\ - if (i3 == NAME##_NULL) return;\ - (*include)[i3]=true;\ - if (i4 == NAME##_NULL) return;\ - (*include)[i4]=true;\ - if (i5 == NAME##_NULL) return;\ - (*include)[i5]=true;\ - if (i6 == NAME##_NULL) return;\ - (*include)[i6]=true;\ - if (i7 == NAME##_NULL) return;\ - (*include)[i7]=true;\ - if (i8 == NAME##_NULL) return;\ - (*include)[i8]=true;\ - if (i9 == NAME##_NULL) return;\ - (*include)[i9]=true;\ - if (i10 == NAME##_NULL) return;\ - (*include)[i10]=true;\ - if (i11 == NAME##_NULL) return;\ - (*include)[i11]=true;\ - if (i12 == NAME##_NULL) return;\ - (*include)[i12]=true;\ - }\ - template \ - NAME##_cus_field_list::NAME##_cus_field_list\ - (const NAME *o, cchar *d, Manip m, bool i1, bool i2, bool i3, bool i4, bool i5, bool i6, bool i7, bool i8, bool i9, bool i10, bool i11, bool i12) {\ - delem = d;\ - manip = m;\ - del_vector = true; \ - obj = o; \ - include = new std::vector(12, false); \ - if (i1) (*include)[0]=true;\ - if (i2) (*include)[1]=true;\ - if (i3) (*include)[2]=true;\ - if (i4) (*include)[3]=true;\ - if (i5) (*include)[4]=true;\ - if (i6) (*include)[5]=true;\ - if (i7) (*include)[6]=true;\ - if (i8) (*include)[7]=true;\ - if (i9) (*include)[8]=true;\ - if (i10) (*include)[9]=true;\ - if (i11) (*include)[10]=true;\ - if (i12) (*include)[11]=true;\ - } \ - template \ - NAME##_cus_field_list::NAME##_cus_field_list\ - (const NAME *o, cchar *d, Manip m, NAME##_enum i1, NAME##_enum i2, NAME##_enum i3, NAME##_enum i4, NAME##_enum i5, NAME##_enum i6, NAME##_enum i7, NAME##_enum i8, NAME##_enum i9, NAME##_enum i10, NAME##_enum i11, NAME##_enum i12) { \ - delem = d;\ - manip = m;\ - del_vector = true; \ - obj = o; \ - include = new std::vector(12, false); \ - if (i1 == NAME##_NULL) return;\ - (*include)[i1]=true;\ - if (i2 == NAME##_NULL) return;\ - (*include)[i2]=true;\ - if (i3 == NAME##_NULL) return;\ - (*include)[i3]=true;\ - if (i4 == NAME##_NULL) return;\ - (*include)[i4]=true;\ - if (i5 == NAME##_NULL) return;\ - (*include)[i5]=true;\ - if (i6 == NAME##_NULL) return;\ - (*include)[i6]=true;\ - if (i7 == NAME##_NULL) return;\ - (*include)[i7]=true;\ - if (i8 == NAME##_NULL) return;\ - (*include)[i8]=true;\ - if (i9 == NAME##_NULL) return;\ - (*include)[i9]=true;\ - if (i10 == NAME##_NULL) return;\ - (*include)[i10]=true;\ - if (i11 == NAME##_NULL) return;\ - (*include)[i11]=true;\ - if (i12 == NAME##_NULL) return;\ - (*include)[i12]=true;\ - }\ - template \ - NAME##_cus_equal_list::NAME##_cus_equal_list\ - (const NAME *o, cchar *d, cchar *c, Manip m, bool i1, bool i2, bool i3, bool i4, bool i5, bool i6, bool i7, bool i8, bool i9, bool i10, bool i11, bool i12) { \ - delem = d;\ - comp = c;\ - manip = m;\ - del_vector = true; \ - obj = o; \ - include = new std::vector(12, false); \ - if (i1) (*include)[0]=true;\ - if (i2) (*include)[1]=true;\ - if (i3) (*include)[2]=true;\ - if (i4) (*include)[3]=true;\ - if (i5) (*include)[4]=true;\ - if (i6) (*include)[5]=true;\ - if (i7) (*include)[6]=true;\ - if (i8) (*include)[7]=true;\ - if (i9) (*include)[8]=true;\ - if (i10) (*include)[9]=true;\ - if (i11) (*include)[10]=true;\ - if (i12) (*include)[11]=true;\ - } \ - template \ - NAME##_cus_equal_list::NAME##_cus_equal_list\ - (const NAME *o, cchar *d, cchar *c, Manip m, NAME##_enum i1, NAME##_enum i2, NAME##_enum i3, NAME##_enum i4, NAME##_enum i5, NAME##_enum i6, NAME##_enum i7, NAME##_enum i8, NAME##_enum i9, NAME##_enum i10, NAME##_enum i11, NAME##_enum i12) { \ - delem = d;\ - comp = c;\ - manip = m;\ - del_vector = true; \ - obj = o; \ - include = new std::vector(12, false); \ - if (i1 == NAME##_NULL) return;\ - (*include)[i1]=true;\ - if (i2 == NAME##_NULL) return;\ - (*include)[i2]=true;\ - if (i3 == NAME##_NULL) return;\ - (*include)[i3]=true;\ - if (i4 == NAME##_NULL) return;\ - (*include)[i4]=true;\ - if (i5 == NAME##_NULL) return;\ - (*include)[i5]=true;\ - if (i6 == NAME##_NULL) return;\ - (*include)[i6]=true;\ - if (i7 == NAME##_NULL) return;\ - (*include)[i7]=true;\ - if (i8 == NAME##_NULL) return;\ - (*include)[i8]=true;\ - if (i9 == NAME##_NULL) return;\ - (*include)[i9]=true;\ - if (i10 == NAME##_NULL) return;\ - (*include)[i10]=true;\ - if (i11 == NAME##_NULL) return;\ - (*include)[i11]=true;\ - if (i12 == NAME##_NULL) return;\ - (*include)[i12]=true;\ - }\ - template \ - std::ostream& operator << (std::ostream& s, const NAME##_value_list& obj) { \ - s << obj.manip << obj.obj->I1 << obj.delem;\ - s << obj.manip << obj.obj->I2 << obj.delem;\ - s << obj.manip << obj.obj->I3 << obj.delem;\ - s << obj.manip << obj.obj->I4 << obj.delem;\ - s << obj.manip << obj.obj->I5 << obj.delem;\ - s << obj.manip << obj.obj->I6 << obj.delem;\ - s << obj.manip << obj.obj->I7 << obj.delem;\ - s << obj.manip << obj.obj->I8 << obj.delem;\ - s << obj.manip << obj.obj->I9 << obj.delem;\ - s << obj.manip << obj.obj->I10 << obj.delem;\ - s << obj.manip << obj.obj->I11 << obj.delem;\ - s << obj.manip << obj.obj->I12; \ - return s; \ - } \ - template \ - std::ostream& operator << (std::ostream& s, const NAME##_field_list& obj) { \ - s << obj.manip << obj.obj->names[0] << obj.delem;\ - s << obj.manip << obj.obj->names[1] << obj.delem;\ - s << obj.manip << obj.obj->names[2] << obj.delem;\ - s << obj.manip << obj.obj->names[3] << obj.delem;\ - s << obj.manip << obj.obj->names[4] << obj.delem;\ - s << obj.manip << obj.obj->names[5] << obj.delem;\ - s << obj.manip << obj.obj->names[6] << obj.delem;\ - s << obj.manip << obj.obj->names[7] << obj.delem;\ - s << obj.manip << obj.obj->names[8] << obj.delem;\ - s << obj.manip << obj.obj->names[9] << obj.delem;\ - s << obj.manip << obj.obj->names[10] << obj.delem;\ - s << obj.manip << obj.obj->names[11]; \ - return s; \ - } \ - template \ - std::ostream& operator << (std::ostream& s, const NAME##_equal_list& obj) { \ - s << obj.obj->names[0] << obj.comp << obj.manip << obj.obj->I1 << obj.delem;\ - s << obj.obj->names[1] << obj.comp << obj.manip << obj.obj->I2 << obj.delem;\ - s << obj.obj->names[2] << obj.comp << obj.manip << obj.obj->I3 << obj.delem;\ - s << obj.obj->names[3] << obj.comp << obj.manip << obj.obj->I4 << obj.delem;\ - s << obj.obj->names[4] << obj.comp << obj.manip << obj.obj->I5 << obj.delem;\ - s << obj.obj->names[5] << obj.comp << obj.manip << obj.obj->I6 << obj.delem;\ - s << obj.obj->names[6] << obj.comp << obj.manip << obj.obj->I7 << obj.delem;\ - s << obj.obj->names[7] << obj.comp << obj.manip << obj.obj->I8 << obj.delem;\ - s << obj.obj->names[8] << obj.comp << obj.manip << obj.obj->I9 << obj.delem;\ - s << obj.obj->names[9] << obj.comp << obj.manip << obj.obj->I10 << obj.delem;\ - s << obj.obj->names[10] << obj.comp << obj.manip << obj.obj->I11 << obj.delem;\ - s << obj.obj->names[11] << obj.comp << obj.manip << obj.obj->I12; \ - return s; \ - } \ - template \ - std::ostream& operator << (std::ostream& s, const NAME##_cus_value_list& obj) { \ - bool before = false; \ - if ((*obj.include)[0]) { \ - s << obj.manip << obj.obj->I1;\ - before = true; \ - } \ - if ((*obj.include)[1]) { \ - if (before) s << obj.delem;\ - s << obj.manip << obj.obj->I2;\ - before = true; \ - } \ - if ((*obj.include)[2]) { \ - if (before) s << obj.delem;\ - s << obj.manip << obj.obj->I3;\ - before = true; \ - } \ - if ((*obj.include)[3]) { \ - if (before) s << obj.delem;\ - s << obj.manip << obj.obj->I4;\ - before = true; \ - } \ - if ((*obj.include)[4]) { \ - if (before) s << obj.delem;\ - s << obj.manip << obj.obj->I5;\ - before = true; \ - } \ - if ((*obj.include)[5]) { \ - if (before) s << obj.delem;\ - s << obj.manip << obj.obj->I6;\ - before = true; \ - } \ - if ((*obj.include)[6]) { \ - if (before) s << obj.delem;\ - s << obj.manip << obj.obj->I7;\ - before = true; \ - } \ - if ((*obj.include)[7]) { \ - if (before) s << obj.delem;\ - s << obj.manip << obj.obj->I8;\ - before = true; \ - } \ - if ((*obj.include)[8]) { \ - if (before) s << obj.delem;\ - s << obj.manip << obj.obj->I9;\ - before = true; \ - } \ - if ((*obj.include)[9]) { \ - if (before) s << obj.delem;\ - s << obj.manip << obj.obj->I10;\ - before = true; \ - } \ - if ((*obj.include)[10]) { \ - if (before) s << obj.delem;\ - s << obj.manip << obj.obj->I11;\ - before = true; \ - } \ - if ((*obj.include)[11]) { \ - if (before) s << obj.delem;\ - s << obj.manip << obj.obj->I12;\ - } \ - return s; \ - } \ - template \ - std::ostream& operator << (std::ostream& s, const NAME##_cus_field_list& obj) { \ - bool before = false; \ - if ((*obj.include)[0]) { \ - s << obj.manip << obj.obj->names[0];\ - before = true; \ - } \ - if ((*obj.include)[1]) { \ - if (before) s << obj.delem;\ - s << obj.manip << obj.obj->names[1];\ - before = true; \ - } \ - if ((*obj.include)[2]) { \ - if (before) s << obj.delem;\ - s << obj.manip << obj.obj->names[2];\ - before = true; \ - } \ - if ((*obj.include)[3]) { \ - if (before) s << obj.delem;\ - s << obj.manip << obj.obj->names[3];\ - before = true; \ - } \ - if ((*obj.include)[4]) { \ - if (before) s << obj.delem;\ - s << obj.manip << obj.obj->names[4];\ - before = true; \ - } \ - if ((*obj.include)[5]) { \ - if (before) s << obj.delem;\ - s << obj.manip << obj.obj->names[5];\ - before = true; \ - } \ - if ((*obj.include)[6]) { \ - if (before) s << obj.delem;\ - s << obj.manip << obj.obj->names[6];\ - before = true; \ - } \ - if ((*obj.include)[7]) { \ - if (before) s << obj.delem;\ - s << obj.manip << obj.obj->names[7];\ - before = true; \ - } \ - if ((*obj.include)[8]) { \ - if (before) s << obj.delem;\ - s << obj.manip << obj.obj->names[8];\ - before = true; \ - } \ - if ((*obj.include)[9]) { \ - if (before) s << obj.delem;\ - s << obj.manip << obj.obj->names[9];\ - before = true; \ - } \ - if ((*obj.include)[10]) { \ - if (before) s << obj.delem;\ - s << obj.manip << obj.obj->names[10];\ - before = true; \ - } \ - if ((*obj.include)[11]) { \ - if (before) s << obj.delem;\ - s << obj.manip << obj.obj->names[11];\ - } \ - return s; \ - } \ - template \ - std::ostream& operator << (std::ostream& s, const NAME##_cus_equal_list& obj) { \ - bool before = false; \ - if ((*obj.include)[0]) { \ - s << obj.obj->names[0] << obj.comp << obj.manip << obj.obj->I1;\ - before = true; \ - } \ - if ((*obj.include)[1]) { \ - if (before) s << obj.delem;\ - s << obj.obj->names[1] << obj.comp << obj.manip << obj.obj->I2;\ - before = true; \ - } \ - if ((*obj.include)[2]) { \ - if (before) s << obj.delem;\ - s << obj.obj->names[2] << obj.comp << obj.manip << obj.obj->I3;\ - before = true; \ - } \ - if ((*obj.include)[3]) { \ - if (before) s << obj.delem;\ - s << obj.obj->names[3] << obj.comp << obj.manip << obj.obj->I4;\ - before = true; \ - } \ - if ((*obj.include)[4]) { \ - if (before) s << obj.delem;\ - s << obj.obj->names[4] << obj.comp << obj.manip << obj.obj->I5;\ - before = true; \ - } \ - if ((*obj.include)[5]) { \ - if (before) s << obj.delem;\ - s << obj.obj->names[5] << obj.comp << obj.manip << obj.obj->I6;\ - before = true; \ - } \ - if ((*obj.include)[6]) { \ - if (before) s << obj.delem;\ - s << obj.obj->names[6] << obj.comp << obj.manip << obj.obj->I7;\ - before = true; \ - } \ - if ((*obj.include)[7]) { \ - if (before) s << obj.delem;\ - s << obj.obj->names[7] << obj.comp << obj.manip << obj.obj->I8;\ - before = true; \ - } \ - if ((*obj.include)[8]) { \ - if (before) s << obj.delem;\ - s << obj.obj->names[8] << obj.comp << obj.manip << obj.obj->I9;\ - before = true; \ - } \ - if ((*obj.include)[9]) { \ - if (before) s << obj.delem;\ - s << obj.obj->names[9] << obj.comp << obj.manip << obj.obj->I10;\ - before = true; \ - } \ - if ((*obj.include)[10]) { \ - if (before) s << obj.delem;\ - s << obj.obj->names[10] << obj.comp << obj.manip << obj.obj->I11;\ - before = true; \ - } \ - if ((*obj.include)[11]) { \ - if (before) s << obj.delem;\ - s << obj.obj->names[11] << obj.comp << obj.manip << obj.obj->I12;\ - } \ - return s; \ - } \ - template \ - inline NAME##_value_list NAME::value_list(cchar *d, Manip m) const { \ - return NAME##_value_list (this, d, m); \ - } \ - template \ - inline NAME##_field_list NAME::field_list(cchar *d, Manip m) const { \ - return NAME##_field_list (this, d, m); \ - } \ - template \ - inline NAME##_equal_list NAME::equal_list(cchar *d, cchar *c, Manip m) const { \ - return NAME##_equal_list (this, d, c, m); \ - } \ - template \ - inline NAME##_cus_value_list NAME::value_list(cchar *d, Manip m,\ - bool i1, bool i2, bool i3, bool i4, bool i5, bool i6, bool i7, bool i8, bool i9, bool i10, bool i11, bool i12) const {\ - return NAME##_cus_value_list (this, d, m, i1, i2, i3, i4, i5, i6, i7, i8, i9, i10, i11, i12); \ - } \ - template \ - inline NAME##_cus_field_list NAME::field_list(cchar *d, Manip m,\ - bool i1, bool i2, bool i3, bool i4, bool i5, bool i6, bool i7, bool i8, bool i9, bool i10, bool i11, bool i12) const { \ - return NAME##_cus_field_list (this, d, m, i1, i2, i3, i4, i5, i6, i7, i8, i9, i10, i11, i12); \ - } \ - template \ - inline NAME##_cus_equal_list NAME::equal_list(cchar *d, cchar *c, Manip m,\ - bool i1, bool i2, bool i3, bool i4, bool i5, bool i6, bool i7, bool i8, bool i9, bool i10, bool i11, bool i12) const { \ - return NAME##_cus_equal_list (this, d, c, m, i1, i2, i3, i4, i5, i6, i7, i8, i9, i10, i11, i12); \ - } \ - template \ - inline NAME##_cus_value_list NAME::value_list(cchar *d, Manip m,\ - NAME##_enum i1, NAME##_enum i2, NAME##_enum i3, NAME##_enum i4, NAME##_enum i5, NAME##_enum i6, NAME##_enum i7, NAME##_enum i8, NAME##_enum i9, NAME##_enum i10, NAME##_enum i11, NAME##_enum i12) const { \ - return NAME##_cus_value_list (this, d, m, i1, i2, i3, i4, i5, i6, i7, i8, i9, i10, i11, i12); \ - } \ - template \ - inline NAME##_cus_field_list NAME::field_list(cchar *d, Manip m,\ - NAME##_enum i1, NAME##_enum i2, NAME##_enum i3, NAME##_enum i4, NAME##_enum i5, NAME##_enum i6, NAME##_enum i7, NAME##_enum i8, NAME##_enum i9, NAME##_enum i10, NAME##_enum i11, NAME##_enum i12) const {\ - return NAME##_cus_field_list (this, d, m, i1, i2, i3, i4, i5, i6, i7, i8, i9, i10, i11, i12); \ - } \ - template \ - inline NAME##_cus_equal_list NAME::equal_list(cchar *d, cchar *c, Manip m, \ - NAME##_enum i1, NAME##_enum i2, NAME##_enum i3, NAME##_enum i4, NAME##_enum i5, NAME##_enum i6, NAME##_enum i7, NAME##_enum i8, NAME##_enum i9, NAME##_enum i10, NAME##_enum i11, NAME##_enum i12) const { \ - return NAME##_cus_equal_list (this, d, c, m, i1, i2, i3, i4, i5, i6, i7, i8, i9, i10, i11, i12); \ - } \ - template \ - inline NAME##_cus_value_list NAME::value_list(cchar *d, Manip m,\ - std::vector *i) const {\ - return NAME##_cus_value_list (this, d, m, i);\ - }\ - template \ - inline NAME##_cus_field_list NAME::field_list(cchar *d, Manip m,\ - std::vector *i) const {\ - return NAME##_cus_field_list (this, d, m, i);\ - }\ - template \ - inline NAME##_cus_equal_list NAME::equal_list(cchar *d, cchar *c, Manip m,\ - std::vector *i) const {\ - return NAME##_cus_equal_list (this, d, c, m, i);\ - }\ - template \ - inline NAME##_cus_value_list \ - NAME::value_list(cchar *d, Manip m, sql_cmp_type /*sc*/) const {\ - sql_compare_type_def_##CMP (NAME, value, NUM);\ - }\ - template \ - inline NAME##_cus_field_list \ - NAME::field_list(cchar *d, Manip m, sql_cmp_type /*sc*/) const {\ - sql_compare_type_def_##CMP (NAME, field, NUM);\ - }\ - template \ - inline NAME##_cus_equal_list \ - NAME::equal_list(cchar *d, cchar *c, Manip m, sql_cmp_type /*sc*/) const {\ - sql_compare_type_defe_##CMP (NAME, equal, NUM);\ - }\ - template \ - void populate_##NAME (NAME *s, const Row &row) { \ - s->I1 = static_cast(row.at(O1));\ - s->I2 = static_cast(row.at(O2));\ - s->I3 = static_cast(row.at(O3));\ - s->I4 = static_cast(row.at(O4));\ - s->I5 = static_cast(row.at(O5));\ - s->I6 = static_cast(row.at(O6));\ - s->I7 = static_cast(row.at(O7));\ - s->I8 = static_cast(row.at(O8));\ - s->I9 = static_cast(row.at(O9));\ - s->I10 = static_cast(row.at(O10));\ - s->I11 = static_cast(row.at(O11));\ - s->I12 = static_cast(row.at(O12));\ - } \ - inline NAME::NAME (const Row &row) \ - {populate_##NAME(this, row);}\ - inline void NAME::set (const Row &row)\ - {populate_##NAME(this, row);}\ - sql_COMPARE__##CMP(NAME, I1, I2, I3, I4, I5, I6, I7, I8, I9, I10, I11, I12, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ) - -#define sql_create_basic_12(NAME, CMP, CONTR, T1, I1, T2, I2, T3, I3, T4, I4, T5, I5, T6, I6, T7, I7, T8, I8, T9, I9, T10, I10, T11, I11, T12, I12) \ - sql_create_basic_c_order_12(NAME, CMP, CONTR, T1, I1, 0, T2, I2, 1, T3, I3, 2, T4, I4, 3, T5, I5, 4, T6, I6, 5, T7, I7, 6, T8, I8, 7, T9, I9, 8, T10, I10, 9, T11, I11, 10, T12, I12, 11) - -#define sql_create_12(NAME, CMP, CONTR, T1, I1, T2, I2, T3, I3, T4, I4, T5, I5, T6, I6, T7, I7, T8, I8, T9, I9, T10, I10, T11, I11, T12, I12) \ - sql_create_complete_12(NAME, CMP, CONTR, T1, I1, #I1, 0, T2, I2, #I2, 1, T3, I3, #I3, 2, T4, I4, #I4, 3, T5, I5, #I5, 4, T6, I6, #I6, 5, T7, I7, #I7, 6, T8, I8, #I8, 7, T9, I9, #I9, 8, T10, I10, #I10, 9, T11, I11, #I11, 10, T12, I12, #I12, 11) \ - -#define sql_create_c_order_12(NAME, CMP, CONTR, T1, I1, O1, T2, I2, O2, T3, I3, O3, T4, I4, O4, T5, I5, O5, T6, I6, O6, T7, I7, O7, T8, I8, O8, T9, I9, O9, T10, I10, O10, T11, I11, O11, T12, I12, O12) \ - sql_create_complete_12(NAME, CMP, CONTR, T1, I1, #I1, O1, T2, I2, #I2, O2, T3, I3, #I3, O3, T4, I4, #I4, O4, T5, I5, #I5, O5, T6, I6, #I6, O6, T7, I7, #I7, O7, T8, I8, #I8, O8, T9, I9, #I9, O9, T10, I10, #I10, O10, T11, I11, #I11, O11, T12, I12, #I12, O12) - -#define sql_create_c_names_12(NAME, CMP, CONTR, T1, I1, N1, T2, I2, N2, T3, I3, N3, T4, I4, N4, T5, I5, N5, T6, I6, N6, T7, I7, N7, T8, I8, N8, T9, I9, N9, T10, I10, N10, T11, I11, N11, T12, I12, N12) \ - sql_create_complete_12(NAME, CMP, CONTR, T1, I1, N1, 0, T2, I2, N2, 1, T3, I3, N3, 2, T4, I4, N4, 3, T5, I5, N5, 4, T6, I6, N6, 5, T7, I7, N7, 6, T8, I8, N8, 7, T9, I9, N9, 8, T10, I10, N10, 9, T11, I11, N11, 10, T12, I12, N12, 11) - -// --------------------------------------------------- -// End Create 12 -// --------------------------------------------------- - -// --------------------------------------------------- -// Begin Create 13 -// --------------------------------------------------- -#define sql_create_basic_c_order_13(NAME, CMP, CONTR, T1, I1, O1, T2, I2, O2, T3, I3, O3, T4, I4, O4, T5, I5, O5, T6, I6, O6, T7, I7, O7, T8, I8, O8, T9, I9, O9, T10, I10, O10, T11, I11, O11, T12, I12, O12, T13, I13, O13)\ - struct NAME; \ - template int sql_compare_##NAME (const NAME &, const NAME &);\ - struct NAME { \ - T1 I1;\ - T2 I2;\ - T3 I3;\ - T4 I4;\ - T5 I5;\ - T6 I6;\ - T7 I7;\ - T8 I8;\ - T9 I9;\ - T10 I10;\ - T11 I11;\ - T12 I12;\ - T13 I13; \ - NAME () {} \ - NAME (const Row &row);\ - sql_compare_define_##CMP(NAME, T1, I1, T2, I2, T3, I3, T4, I4, T5, I5, T6, I6, T7, I7, T8, I8, T9, I9, T10, I10, T11, I11, T12, I12, T13, I13, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0)\ - }; \ - template \ - void populate_##NAME (NAME *s, const Row &row) { \ - s->I1 = static_cast(row.at(O1));\ - s->I2 = static_cast(row.at(O2));\ - s->I3 = static_cast(row.at(O3));\ - s->I4 = static_cast(row.at(O4));\ - s->I5 = static_cast(row.at(O5));\ - s->I6 = static_cast(row.at(O6));\ - s->I7 = static_cast(row.at(O7));\ - s->I8 = static_cast(row.at(O8));\ - s->I9 = static_cast(row.at(O9));\ - s->I10 = static_cast(row.at(O10));\ - s->I11 = static_cast(row.at(O11));\ - s->I12 = static_cast(row.at(O12));\ - s->I13 = static_cast(row.at(O13)); \ - } \ - inline NAME::NAME (const Row &row) \ - {populate_##NAME(this, row);} \ - sql_COMPARE__##CMP(NAME, I1, I2, I3, I4, I5, I6, I7, I8, I9, I10, I11, I12, I13, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ) - -#define sql_create_complete_13(NAME, CMP, CONTR, T1, I1, N1, O1, T2, I2, N2, O2, T3, I3, N3, O3, T4, I4, N4, O4, T5, I5, N5, O5, T6, I6, N6, O6, T7, I7, N7, O7, T8, I8, N8, O8, T9, I9, N9, O9, T10, I10, N10, O10, T11, I11, N11, O11, T12, I12, N12, O12, T13, I13, N13, O13) \ - struct NAME; \ - enum NAME##_enum { \ - NAME##_##I1,\ - NAME##_##I2,\ - NAME##_##I3,\ - NAME##_##I4,\ - NAME##_##I5,\ - NAME##_##I6,\ - NAME##_##I7,\ - NAME##_##I8,\ - NAME##_##I9,\ - NAME##_##I10,\ - NAME##_##I11,\ - NAME##_##I12,\ - NAME##_##I13 \ - ,NAME##_NULL \ - }; \ - template \ - class NAME##_value_list { \ - /*friend std::ostream& operator << <> (std::ostream&, const NAME##_value_list&); */\ - public: \ - const NAME *obj;\ - cchar *delem;\ - Manip manip;\ - public: \ - NAME##_value_list (const NAME *o, cchar *d, Manip m) \ - : obj(o), delem(d), manip(m) {} \ - };\ - template \ - class NAME##_##field_list {\ - /* friend std::ostream& operator << <> (std::ostream&, const NAME##_field_list&); */\ - public: \ - const NAME *obj; \ - cchar *delem;\ - Manip manip;\ - public: \ - NAME##_field_list (const NAME *o, cchar *d, Manip m) \ - : obj(o), delem(d), manip(m) {} \ - };\ - template \ - class NAME##_equal_list { \ - /* friend std::ostream& operator << <> (std::ostream&, const NAME##_equal_list&); */\ - public: \ - const NAME *obj;\ - cchar *delem;\ - cchar *comp;\ - Manip manip;\ - public: \ - NAME##_equal_list (const NAME *o, cchar *d, cchar *c, Manip m) \ - : obj(o), delem(d), comp(c), manip(m) {}\ - };\ - template \ - class NAME##_cus_value_list {\ - /* friend std::ostream& operator << <> (std::ostream&, \ - const NAME##_cus_value_list&); */\ - public:\ - const NAME *obj;\ - std::vector *include;\ - bool del_vector;\ - cchar *delem;\ - Manip manip;\ - public: \ - ~NAME##_cus_value_list () {if (del_vector) delete include;} \ - NAME##_cus_value_list (const NAME *o, cchar *d, Manip m, bool i1, bool i2, bool i3, bool i4, bool i5, bool i6, bool i7, bool i8, bool i9, bool i10, bool i11, bool i12, bool i13);\ - NAME##_cus_value_list (const NAME *o, cchar *d, Manip m, NAME##_enum i1, NAME##_enum i2, NAME##_enum i3, NAME##_enum i4, NAME##_enum i5, NAME##_enum i6, NAME##_enum i7, NAME##_enum i8, NAME##_enum i9, NAME##_enum i10, NAME##_enum i11, NAME##_enum i12, NAME##_enum i13); \ - NAME##_cus_value_list (const NAME *o, cchar *d, Manip m ,std::vector* i)\ - : obj(o), include(i), del_vector(false), delem(d), manip(m) {}\ - };\ - template \ - class NAME##_cus_field_list { \ - /* friend std::ostream& operator << <> (std::ostream&, \ - const NAME##_cus_field_list&); */\ - public:\ - const NAME *obj; \ - std::vector *include; \ - bool del_vector; \ - cchar *delem;\ - Manip manip;\ - public: \ - ~NAME##_cus_field_list () {if (del_vector) delete include;} \ - NAME##_cus_field_list (const NAME *o, cchar *d, Manip m, bool i1, bool i2, bool i3, bool i4, bool i5, bool i6, bool i7, bool i8, bool i9, bool i10, bool i11, bool i12, bool i13); \ - NAME##_cus_field_list (const NAME *o, cchar *d, Manip m, NAME##_enum i1, NAME##_enum i2, NAME##_enum i3, NAME##_enum i4, NAME##_enum i5, NAME##_enum i6, NAME##_enum i7, NAME##_enum i8, NAME##_enum i9, NAME##_enum i10, NAME##_enum i11, NAME##_enum i12, NAME##_enum i13); \ - NAME##_cus_field_list (const NAME *o, cchar *d, Manip m, std::vector *i) \ - : obj(o), include(i), del_vector(false), delem(d), manip(m) {}\ - };\ - template \ - class NAME##_cus_equal_list {\ - /* friend std::ostream& operator << <> (std::ostream&, \ - const NAME##_cus_equal_list&); */\ - public:\ - const NAME *obj;\ - std::vector *include;\ - bool del_vector;\ - cchar *delem;\ - cchar *comp;\ - Manip manip;\ - public:\ - ~NAME##_##cus_equal_list () {if (del_vector) delete include;}\ - NAME##_##cus_equal_list (const NAME *o, cchar *d, cchar *c, Manip m, bool i1, bool i2, bool i3, bool i4, bool i5, bool i6, bool i7, bool i8, bool i9, bool i10, bool i11, bool i12, bool i13); \ - NAME##_##cus_equal_list (const NAME *o, cchar *d, cchar *c, Manip m, NAME##_enum i1, NAME##_enum i2, NAME##_enum i3, NAME##_enum i4, NAME##_enum i5, NAME##_enum i6, NAME##_enum i7, NAME##_enum i8, NAME##_enum i9, NAME##_enum i10, NAME##_enum i11, NAME##_enum i12, NAME##_enum i13); \ - NAME##_##cus_equal_list (const NAME *o, cchar *d, cchar *c, Manip m, std::vector *i) \ - : obj(o), include(i), del_vector(false), delem(d), comp(c), manip(m) {}\ - };\ - template int sql_compare_##NAME (const NAME &, const NAME &);\ - struct NAME { \ - T1 I1;\ - T2 I2;\ - T3 I3;\ - T4 I4;\ - T5 I5;\ - T6 I6;\ - T7 I7;\ - T8 I8;\ - T9 I9;\ - T10 I10;\ - T11 I11;\ - T12 I12;\ - T13 I13; \ - NAME () {} \ - NAME (const Row &row);\ - void set (const Row &row);\ - sql_compare_define_##CMP(NAME, T1, I1, T2, I2, T3, I3, T4, I4, T5, I5, T6, I6, T7, I7, T8, I8, T9, I9, T10, I10, T11, I11, T12, I12, T13, I13, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0)\ - sql_construct_define_##CONTR(NAME, T1, I1, T2, I2, T3, I3, T4, I4, T5, I5, T6, I6, T7, I7, T8, I8, T9, I9, T10, I10, T11, I11, T12, I12, T13, I13, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0)\ - static const char *names[];\ - static const char *_table;\ - static const char *& table() {return _table;}\ - NAME##_value_list value_list() const {\ - return value_list(",", quote);}\ - NAME##_value_list value_list(cchar *d) const {\ - return value_list(d, quote);}\ - template \ - NAME##_value_list value_list(cchar *d, Manip m) const; \ - NAME##_field_list field_list() const {\ - return field_list(",", do_nothing);}\ - NAME##_field_list field_list(cchar *d) const {\ - return field_list(d, do_nothing);}\ - template \ - NAME##_field_list field_list(cchar *d, Manip m) const; \ - NAME##_equal_list equal_list(cchar *d = ",", \ - cchar *c = " = ") const{\ - return equal_list(d, c, quote);}\ - template \ - NAME##_equal_list equal_list(cchar *d, cchar *c, Manip m) const; \ - /* cus_data */\ - NAME##_cus_value_list value_list(bool i1, bool i2 = false, bool i3 = false, bool i4 = false, bool i5 = false, bool i6 = false, bool i7 = false, bool i8 = false, bool i9 = false, bool i10 = false, bool i11 = false, bool i12 = false, bool i13 = false) const {\ - return value_list(",", quote, i1, i2, i3, i4, i5, i6, i7, i8, i9, i10, i11, i12, i13);\ - }\ - NAME##_cus_value_list value_list(NAME##_enum i1, NAME##_enum i2 = NAME##_NULL, NAME##_enum i3 = NAME##_NULL, NAME##_enum i4 = NAME##_NULL, NAME##_enum i5 = NAME##_NULL, NAME##_enum i6 = NAME##_NULL, NAME##_enum i7 = NAME##_NULL, NAME##_enum i8 = NAME##_NULL, NAME##_enum i9 = NAME##_NULL, NAME##_enum i10 = NAME##_NULL, NAME##_enum i11 = NAME##_NULL, NAME##_enum i12 = NAME##_NULL, NAME##_enum i13 = NAME##_NULL) const {\ - return value_list(",", quote, i1, i2, i3, i4, i5, i6, i7, i8, i9, i10, i11, i12, i13);\ - }\ - NAME##_cus_value_list value_list(std::vector *i) const {\ - return value_list(",", quote, i);\ - }\ - NAME##_cus_value_list value_list(sql_cmp_type sc) const {\ - return value_list(",", quote, sc);\ - }\ - NAME##_cus_value_list value_list(cchar *d, bool i1, bool i2 = false, bool i3 = false, bool i4 = false, bool i5 = false, bool i6 = false, bool i7 = false, bool i8 = false, bool i9 = false, bool i10 = false, bool i11 = false, bool i12 = false, bool i13 = false) const {\ - return value_list(d, quote, i1, i2, i3, i4, i5, i6, i7, i8, i9, i10, i11, i12, i13);\ - }\ - NAME##_cus_value_list value_list(cchar *d, NAME##_enum i1, NAME##_enum i2 = NAME##_NULL, NAME##_enum i3 = NAME##_NULL, NAME##_enum i4 = NAME##_NULL, NAME##_enum i5 = NAME##_NULL, NAME##_enum i6 = NAME##_NULL, NAME##_enum i7 = NAME##_NULL, NAME##_enum i8 = NAME##_NULL, NAME##_enum i9 = NAME##_NULL, NAME##_enum i10 = NAME##_NULL, NAME##_enum i11 = NAME##_NULL, NAME##_enum i12 = NAME##_NULL, NAME##_enum i13 = NAME##_NULL) const {\ - return value_list(d, quote, i1, i2, i3, i4, i5, i6, i7, i8, i9, i10, i11, i12, i13);\ - }\ - NAME##_cus_value_list value_list(cchar *d, \ - std::vector *i) const {\ - return value_list(d, quote, i);\ - }\ - NAME##_cus_value_list value_list(cchar *d, \ - sql_cmp_type sc) const {\ - return value_list(d, quote, sc);\ - }\ - template \ - NAME##_cus_value_list value_list(cchar *d, Manip m,\ - bool i1, bool i2 = false, bool i3 = false, bool i4 = false, bool i5 = false, bool i6 = false, bool i7 = false, bool i8 = false, bool i9 = false, bool i10 = false, bool i11 = false, bool i12 = false, bool i13 = false) const; \ - template \ - NAME##_cus_value_list value_list(cchar *d, Manip m,\ - NAME##_enum i1, NAME##_enum i2 = NAME##_NULL, NAME##_enum i3 = NAME##_NULL, NAME##_enum i4 = NAME##_NULL, NAME##_enum i5 = NAME##_NULL, NAME##_enum i6 = NAME##_NULL, NAME##_enum i7 = NAME##_NULL, NAME##_enum i8 = NAME##_NULL, NAME##_enum i9 = NAME##_NULL, NAME##_enum i10 = NAME##_NULL, NAME##_enum i11 = NAME##_NULL, NAME##_enum i12 = NAME##_NULL, NAME##_enum i13 = NAME##_NULL) const; \ - template \ - NAME##_cus_value_list value_list(cchar *d, Manip m, \ - std::vector *i) const;\ - template \ - NAME##_cus_value_list value_list(cchar *d, Manip m, \ - sql_cmp_type sc) const;\ - /* cus field */\ - NAME##_cus_field_list field_list(bool i1, bool i2 = false, bool i3 = false, bool i4 = false, bool i5 = false, bool i6 = false, bool i7 = false, bool i8 = false, bool i9 = false, bool i10 = false, bool i11 = false, bool i12 = false, bool i13 = false) const {\ - return field_list(",", do_nothing, i1, i2, i3, i4, i5, i6, i7, i8, i9, i10, i11, i12, i13);\ - }\ - NAME##_cus_field_list field_list(NAME##_enum i1, NAME##_enum i2 = NAME##_NULL, NAME##_enum i3 = NAME##_NULL, NAME##_enum i4 = NAME##_NULL, NAME##_enum i5 = NAME##_NULL, NAME##_enum i6 = NAME##_NULL, NAME##_enum i7 = NAME##_NULL, NAME##_enum i8 = NAME##_NULL, NAME##_enum i9 = NAME##_NULL, NAME##_enum i10 = NAME##_NULL, NAME##_enum i11 = NAME##_NULL, NAME##_enum i12 = NAME##_NULL, NAME##_enum i13 = NAME##_NULL) const {\ - return field_list(",", do_nothing, i1, i2, i3, i4, i5, i6, i7, i8, i9, i10, i11, i12, i13);\ - }\ - NAME##_cus_field_list field_list(std::vector *i) const {\ - return field_list(",", do_nothing, i);\ - }\ - NAME##_cus_field_list field_list(sql_cmp_type sc) const\ - {\ - return field_list(",", do_nothing, sc);\ - }\ - NAME##_cus_field_list field_list(cchar *d, \ - bool i1, bool i2 = false, bool i3 = false, bool i4 = false, bool i5 = false, bool i6 = false, bool i7 = false, bool i8 = false, bool i9 = false, bool i10 = false, bool i11 = false, bool i12 = false, bool i13 = false) const {\ - return field_list(d, do_nothing, i1, i2, i3, i4, i5, i6, i7, i8, i9, i10, i11, i12, i13);\ - }\ - NAME##_cus_field_list field_list(cchar *d,\ - NAME##_enum i1, NAME##_enum i2 = NAME##_NULL, NAME##_enum i3 = NAME##_NULL, NAME##_enum i4 = NAME##_NULL, NAME##_enum i5 = NAME##_NULL, NAME##_enum i6 = NAME##_NULL, NAME##_enum i7 = NAME##_NULL, NAME##_enum i8 = NAME##_NULL, NAME##_enum i9 = NAME##_NULL, NAME##_enum i10 = NAME##_NULL, NAME##_enum i11 = NAME##_NULL, NAME##_enum i12 = NAME##_NULL, NAME##_enum i13 = NAME##_NULL) const {\ - return field_list(d, do_nothing, i1, i2, i3, i4, i5, i6, i7, i8, i9, i10, i11, i12, i13);\ - }\ - NAME##_cus_field_list field_list(cchar *d, \ - std::vector *i) const {\ - return field_list(d, do_nothing, i);\ - }\ - NAME##_cus_field_list field_list(cchar *d, \ - sql_cmp_type sc) const {\ - return field_list(d, do_nothing, sc);\ - }\ - template \ - NAME##_cus_field_list field_list(cchar *d, Manip m,\ - bool i1, bool i2 = false, bool i3 = false, bool i4 = false, bool i5 = false, bool i6 = false, bool i7 = false, bool i8 = false, bool i9 = false, bool i10 = false, bool i11 = false, bool i12 = false, bool i13 = false) const; \ - template \ - NAME##_cus_field_list field_list(cchar *d, Manip m,\ - NAME##_enum i1, NAME##_enum i2 = NAME##_NULL, NAME##_enum i3 = NAME##_NULL, NAME##_enum i4 = NAME##_NULL, NAME##_enum i5 = NAME##_NULL, NAME##_enum i6 = NAME##_NULL, NAME##_enum i7 = NAME##_NULL, NAME##_enum i8 = NAME##_NULL, NAME##_enum i9 = NAME##_NULL, NAME##_enum i10 = NAME##_NULL, NAME##_enum i11 = NAME##_NULL, NAME##_enum i12 = NAME##_NULL, NAME##_enum i13 = NAME##_NULL) const; \ - template \ - NAME##_cus_field_list field_list(cchar *d, Manip m,\ - std::vector *i) const;\ - template \ - NAME##_cus_field_list field_list(cchar *d, Manip m, \ - sql_cmp_type sc) const;\ - /* cus equal */\ - NAME##_cus_equal_list equal_list(bool i1, bool i2 = false, bool i3 = false, bool i4 = false, bool i5 = false, bool i6 = false, bool i7 = false, bool i8 = false, bool i9 = false, bool i10 = false, bool i11 = false, bool i12 = false, bool i13 = false) const {\ - return equal_list(",", " = ", quote, i1, i2, i3, i4, i5, i6, i7, i8, i9, i10, i11, i12, i13);\ - }\ - NAME##_cus_equal_list equal_list(NAME##_enum i1, NAME##_enum i2 = NAME##_NULL, NAME##_enum i3 = NAME##_NULL, NAME##_enum i4 = NAME##_NULL, NAME##_enum i5 = NAME##_NULL, NAME##_enum i6 = NAME##_NULL, NAME##_enum i7 = NAME##_NULL, NAME##_enum i8 = NAME##_NULL, NAME##_enum i9 = NAME##_NULL, NAME##_enum i10 = NAME##_NULL, NAME##_enum i11 = NAME##_NULL, NAME##_enum i12 = NAME##_NULL, NAME##_enum i13 = NAME##_NULL) const {\ - return equal_list(",", " = ", quote, i1, i2, i3, i4, i5, i6, i7, i8, i9, i10, i11, i12, i13);\ - }\ - NAME##_cus_equal_list equal_list(std::vector *i) const {\ - return equal_list(",", " = ", quote, i);\ - }\ - NAME##_cus_equal_list equal_list(sql_cmp_type sc) const {\ - return equal_list(",", " = ", quote, sc);\ - }\ - NAME##_cus_equal_list equal_list(cchar *d, bool i1, bool i2 = false, bool i3 = false, bool i4 = false, bool i5 = false, bool i6 = false, bool i7 = false, bool i8 = false, bool i9 = false, bool i10 = false, bool i11 = false, bool i12 = false, bool i13 = false) const {\ - return equal_list(d, " = ", quote, i1, i2, i3, i4, i5, i6, i7, i8, i9, i10, i11, i12, i13);\ - }\ - NAME##_cus_equal_list equal_list(cchar *d, NAME##_enum i1, NAME##_enum i2 = NAME##_NULL, NAME##_enum i3 = NAME##_NULL, NAME##_enum i4 = NAME##_NULL, NAME##_enum i5 = NAME##_NULL, NAME##_enum i6 = NAME##_NULL, NAME##_enum i7 = NAME##_NULL, NAME##_enum i8 = NAME##_NULL, NAME##_enum i9 = NAME##_NULL, NAME##_enum i10 = NAME##_NULL, NAME##_enum i11 = NAME##_NULL, NAME##_enum i12 = NAME##_NULL, NAME##_enum i13 = NAME##_NULL) const {\ - return equal_list(d, " = ", quote, i1, i2, i3, i4, i5, i6, i7, i8, i9, i10, i11, i12, i13);\ - }\ - NAME##_cus_equal_list equal_list(cchar *d, \ - std::vector *i) const {\ - return equal_list(d, " = ", quote, i);\ - }\ - NAME##_cus_equal_list equal_list(cchar *d, \ - sql_cmp_type sc) const {\ - return equal_list(d, " = ", quote, sc);\ - }\ - NAME##_cus_equal_list equal_list(cchar *d, cchar *c,\ - bool i1, bool i2 = false, bool i3 = false, bool i4 = false, bool i5 = false, bool i6 = false, bool i7 = false, bool i8 = false, bool i9 = false, bool i10 = false, bool i11 = false, bool i12 = false, bool i13 = false) const {\ - return equal_list(d, c, quote, i1, i2, i3, i4, i5, i6, i7, i8, i9, i10, i11, i12, i13);\ - }\ - NAME##_cus_equal_list equal_list(cchar *d, cchar *c,\ - NAME##_enum i1, NAME##_enum i2 = NAME##_NULL, NAME##_enum i3 = NAME##_NULL, NAME##_enum i4 = NAME##_NULL, NAME##_enum i5 = NAME##_NULL, NAME##_enum i6 = NAME##_NULL, NAME##_enum i7 = NAME##_NULL, NAME##_enum i8 = NAME##_NULL, NAME##_enum i9 = NAME##_NULL, NAME##_enum i10 = NAME##_NULL, NAME##_enum i11 = NAME##_NULL, NAME##_enum i12 = NAME##_NULL, NAME##_enum i13 = NAME##_NULL) const {\ - return equal_list(d, c, quote, i1, i2, i3, i4, i5, i6, i7, i8, i9, i10, i11, i12, i13);\ - }\ - NAME##_cus_equal_list equal_list(cchar *d, cchar *c,\ - std::vector *i) const {\ - return equal_list(d, c, quote, i);\ - }\ - NAME##_cus_equal_list equal_list(cchar *d, cchar *c,\ - sql_cmp_type sc) const {\ - return equal_list(d, c, quote, sc);\ - }\ - template \ - NAME##_cus_equal_list equal_list(cchar *d, cchar *c, Manip m, \ - bool i1, bool i2 = false, bool i3 = false, bool i4 = false, bool i5 = false, bool i6 = false, bool i7 = false, bool i8 = false, bool i9 = false, bool i10 = false, bool i11 = false, bool i12 = false, bool i13 = false) const; \ - template \ - NAME##_cus_equal_list equal_list(cchar *d, cchar *c, Manip m, \ - NAME##_enum i1, NAME##_enum i2 = NAME##_NULL, NAME##_enum i3 = NAME##_NULL, NAME##_enum i4 = NAME##_NULL, NAME##_enum i5 = NAME##_NULL, NAME##_enum i6 = NAME##_NULL, NAME##_enum i7 = NAME##_NULL, NAME##_enum i8 = NAME##_NULL, NAME##_enum i9 = NAME##_NULL, NAME##_enum i10 = NAME##_NULL, NAME##_enum i11 = NAME##_NULL, NAME##_enum i12 = NAME##_NULL, NAME##_enum i13 = NAME##_NULL) const; \ - template \ - NAME##_cus_equal_list equal_list(cchar *d, cchar *c, Manip m, \ - std::vector *i) const;\ - template \ - NAME##_cus_equal_list equal_list(cchar *d, cchar *c, Manip m, \ - sql_cmp_type sc) const;\ - }; \ - const char *NAME::names[] = { \ - N1 ,\ - N2 ,\ - N3 ,\ - N4 ,\ - N5 ,\ - N6 ,\ - N7 ,\ - N8 ,\ - N9 ,\ - N10 ,\ - N11 ,\ - N12 ,\ - N13 \ - }; \ - const char *NAME::_table = #NAME ; \ - template \ - NAME##_cus_value_list::NAME##_cus_value_list\ - (const NAME *o, cchar *d, Manip m, bool i1, bool i2, bool i3, bool i4, bool i5, bool i6, bool i7, bool i8, bool i9, bool i10, bool i11, bool i12, bool i13) \ - { \ - delem = d;\ - manip = m;\ - del_vector = true;\ - obj = o; \ - include = new std::vector(13, false);\ - if (i1) (*include)[0]=true;\ - if (i2) (*include)[1]=true;\ - if (i3) (*include)[2]=true;\ - if (i4) (*include)[3]=true;\ - if (i5) (*include)[4]=true;\ - if (i6) (*include)[5]=true;\ - if (i7) (*include)[6]=true;\ - if (i8) (*include)[7]=true;\ - if (i9) (*include)[8]=true;\ - if (i10) (*include)[9]=true;\ - if (i11) (*include)[10]=true;\ - if (i12) (*include)[11]=true;\ - if (i13) (*include)[12]=true;\ - } \ - template \ - NAME##_cus_value_list::NAME##_cus_value_list\ - (const NAME *o, cchar *d, Manip m, NAME##_enum i1, NAME##_enum i2, NAME##_enum i3, NAME##_enum i4, NAME##_enum i5, NAME##_enum i6, NAME##_enum i7, NAME##_enum i8, NAME##_enum i9, NAME##_enum i10, NAME##_enum i11, NAME##_enum i12, NAME##_enum i13) { \ - delem = d;\ - manip = m;\ - del_vector = true; \ - obj = o; \ - include = new std::vector(13, false); \ - if (i1 == NAME##_NULL) return;\ - (*include)[i1]=true;\ - if (i2 == NAME##_NULL) return;\ - (*include)[i2]=true;\ - if (i3 == NAME##_NULL) return;\ - (*include)[i3]=true;\ - if (i4 == NAME##_NULL) return;\ - (*include)[i4]=true;\ - if (i5 == NAME##_NULL) return;\ - (*include)[i5]=true;\ - if (i6 == NAME##_NULL) return;\ - (*include)[i6]=true;\ - if (i7 == NAME##_NULL) return;\ - (*include)[i7]=true;\ - if (i8 == NAME##_NULL) return;\ - (*include)[i8]=true;\ - if (i9 == NAME##_NULL) return;\ - (*include)[i9]=true;\ - if (i10 == NAME##_NULL) return;\ - (*include)[i10]=true;\ - if (i11 == NAME##_NULL) return;\ - (*include)[i11]=true;\ - if (i12 == NAME##_NULL) return;\ - (*include)[i12]=true;\ - if (i13 == NAME##_NULL) return;\ - (*include)[i13]=true;\ - }\ - template \ - NAME##_cus_field_list::NAME##_cus_field_list\ - (const NAME *o, cchar *d, Manip m, bool i1, bool i2, bool i3, bool i4, bool i5, bool i6, bool i7, bool i8, bool i9, bool i10, bool i11, bool i12, bool i13) {\ - delem = d;\ - manip = m;\ - del_vector = true; \ - obj = o; \ - include = new std::vector(13, false); \ - if (i1) (*include)[0]=true;\ - if (i2) (*include)[1]=true;\ - if (i3) (*include)[2]=true;\ - if (i4) (*include)[3]=true;\ - if (i5) (*include)[4]=true;\ - if (i6) (*include)[5]=true;\ - if (i7) (*include)[6]=true;\ - if (i8) (*include)[7]=true;\ - if (i9) (*include)[8]=true;\ - if (i10) (*include)[9]=true;\ - if (i11) (*include)[10]=true;\ - if (i12) (*include)[11]=true;\ - if (i13) (*include)[12]=true;\ - } \ - template \ - NAME##_cus_field_list::NAME##_cus_field_list\ - (const NAME *o, cchar *d, Manip m, NAME##_enum i1, NAME##_enum i2, NAME##_enum i3, NAME##_enum i4, NAME##_enum i5, NAME##_enum i6, NAME##_enum i7, NAME##_enum i8, NAME##_enum i9, NAME##_enum i10, NAME##_enum i11, NAME##_enum i12, NAME##_enum i13) { \ - delem = d;\ - manip = m;\ - del_vector = true; \ - obj = o; \ - include = new std::vector(13, false); \ - if (i1 == NAME##_NULL) return;\ - (*include)[i1]=true;\ - if (i2 == NAME##_NULL) return;\ - (*include)[i2]=true;\ - if (i3 == NAME##_NULL) return;\ - (*include)[i3]=true;\ - if (i4 == NAME##_NULL) return;\ - (*include)[i4]=true;\ - if (i5 == NAME##_NULL) return;\ - (*include)[i5]=true;\ - if (i6 == NAME##_NULL) return;\ - (*include)[i6]=true;\ - if (i7 == NAME##_NULL) return;\ - (*include)[i7]=true;\ - if (i8 == NAME##_NULL) return;\ - (*include)[i8]=true;\ - if (i9 == NAME##_NULL) return;\ - (*include)[i9]=true;\ - if (i10 == NAME##_NULL) return;\ - (*include)[i10]=true;\ - if (i11 == NAME##_NULL) return;\ - (*include)[i11]=true;\ - if (i12 == NAME##_NULL) return;\ - (*include)[i12]=true;\ - if (i13 == NAME##_NULL) return;\ - (*include)[i13]=true;\ - }\ - template \ - NAME##_cus_equal_list::NAME##_cus_equal_list\ - (const NAME *o, cchar *d, cchar *c, Manip m, bool i1, bool i2, bool i3, bool i4, bool i5, bool i6, bool i7, bool i8, bool i9, bool i10, bool i11, bool i12, bool i13) { \ - delem = d;\ - comp = c;\ - manip = m;\ - del_vector = true; \ - obj = o; \ - include = new std::vector(13, false); \ - if (i1) (*include)[0]=true;\ - if (i2) (*include)[1]=true;\ - if (i3) (*include)[2]=true;\ - if (i4) (*include)[3]=true;\ - if (i5) (*include)[4]=true;\ - if (i6) (*include)[5]=true;\ - if (i7) (*include)[6]=true;\ - if (i8) (*include)[7]=true;\ - if (i9) (*include)[8]=true;\ - if (i10) (*include)[9]=true;\ - if (i11) (*include)[10]=true;\ - if (i12) (*include)[11]=true;\ - if (i13) (*include)[12]=true;\ - } \ - template \ - NAME##_cus_equal_list::NAME##_cus_equal_list\ - (const NAME *o, cchar *d, cchar *c, Manip m, NAME##_enum i1, NAME##_enum i2, NAME##_enum i3, NAME##_enum i4, NAME##_enum i5, NAME##_enum i6, NAME##_enum i7, NAME##_enum i8, NAME##_enum i9, NAME##_enum i10, NAME##_enum i11, NAME##_enum i12, NAME##_enum i13) { \ - delem = d;\ - comp = c;\ - manip = m;\ - del_vector = true; \ - obj = o; \ - include = new std::vector(13, false); \ - if (i1 == NAME##_NULL) return;\ - (*include)[i1]=true;\ - if (i2 == NAME##_NULL) return;\ - (*include)[i2]=true;\ - if (i3 == NAME##_NULL) return;\ - (*include)[i3]=true;\ - if (i4 == NAME##_NULL) return;\ - (*include)[i4]=true;\ - if (i5 == NAME##_NULL) return;\ - (*include)[i5]=true;\ - if (i6 == NAME##_NULL) return;\ - (*include)[i6]=true;\ - if (i7 == NAME##_NULL) return;\ - (*include)[i7]=true;\ - if (i8 == NAME##_NULL) return;\ - (*include)[i8]=true;\ - if (i9 == NAME##_NULL) return;\ - (*include)[i9]=true;\ - if (i10 == NAME##_NULL) return;\ - (*include)[i10]=true;\ - if (i11 == NAME##_NULL) return;\ - (*include)[i11]=true;\ - if (i12 == NAME##_NULL) return;\ - (*include)[i12]=true;\ - if (i13 == NAME##_NULL) return;\ - (*include)[i13]=true;\ - }\ - template \ - std::ostream& operator << (std::ostream& s, const NAME##_value_list& obj) { \ - s << obj.manip << obj.obj->I1 << obj.delem;\ - s << obj.manip << obj.obj->I2 << obj.delem;\ - s << obj.manip << obj.obj->I3 << obj.delem;\ - s << obj.manip << obj.obj->I4 << obj.delem;\ - s << obj.manip << obj.obj->I5 << obj.delem;\ - s << obj.manip << obj.obj->I6 << obj.delem;\ - s << obj.manip << obj.obj->I7 << obj.delem;\ - s << obj.manip << obj.obj->I8 << obj.delem;\ - s << obj.manip << obj.obj->I9 << obj.delem;\ - s << obj.manip << obj.obj->I10 << obj.delem;\ - s << obj.manip << obj.obj->I11 << obj.delem;\ - s << obj.manip << obj.obj->I12 << obj.delem;\ - s << obj.manip << obj.obj->I13; \ - return s; \ - } \ - template \ - std::ostream& operator << (std::ostream& s, const NAME##_field_list& obj) { \ - s << obj.manip << obj.obj->names[0] << obj.delem;\ - s << obj.manip << obj.obj->names[1] << obj.delem;\ - s << obj.manip << obj.obj->names[2] << obj.delem;\ - s << obj.manip << obj.obj->names[3] << obj.delem;\ - s << obj.manip << obj.obj->names[4] << obj.delem;\ - s << obj.manip << obj.obj->names[5] << obj.delem;\ - s << obj.manip << obj.obj->names[6] << obj.delem;\ - s << obj.manip << obj.obj->names[7] << obj.delem;\ - s << obj.manip << obj.obj->names[8] << obj.delem;\ - s << obj.manip << obj.obj->names[9] << obj.delem;\ - s << obj.manip << obj.obj->names[10] << obj.delem;\ - s << obj.manip << obj.obj->names[11] << obj.delem;\ - s << obj.manip << obj.obj->names[12]; \ - return s; \ - } \ - template \ - std::ostream& operator << (std::ostream& s, const NAME##_equal_list& obj) { \ - s << obj.obj->names[0] << obj.comp << obj.manip << obj.obj->I1 << obj.delem;\ - s << obj.obj->names[1] << obj.comp << obj.manip << obj.obj->I2 << obj.delem;\ - s << obj.obj->names[2] << obj.comp << obj.manip << obj.obj->I3 << obj.delem;\ - s << obj.obj->names[3] << obj.comp << obj.manip << obj.obj->I4 << obj.delem;\ - s << obj.obj->names[4] << obj.comp << obj.manip << obj.obj->I5 << obj.delem;\ - s << obj.obj->names[5] << obj.comp << obj.manip << obj.obj->I6 << obj.delem;\ - s << obj.obj->names[6] << obj.comp << obj.manip << obj.obj->I7 << obj.delem;\ - s << obj.obj->names[7] << obj.comp << obj.manip << obj.obj->I8 << obj.delem;\ - s << obj.obj->names[8] << obj.comp << obj.manip << obj.obj->I9 << obj.delem;\ - s << obj.obj->names[9] << obj.comp << obj.manip << obj.obj->I10 << obj.delem;\ - s << obj.obj->names[10] << obj.comp << obj.manip << obj.obj->I11 << obj.delem;\ - s << obj.obj->names[11] << obj.comp << obj.manip << obj.obj->I12 << obj.delem;\ - s << obj.obj->names[12] << obj.comp << obj.manip << obj.obj->I13; \ - return s; \ - } \ - template \ - std::ostream& operator << (std::ostream& s, const NAME##_cus_value_list& obj) { \ - bool before = false; \ - if ((*obj.include)[0]) { \ - s << obj.manip << obj.obj->I1;\ - before = true; \ - } \ - if ((*obj.include)[1]) { \ - if (before) s << obj.delem;\ - s << obj.manip << obj.obj->I2;\ - before = true; \ - } \ - if ((*obj.include)[2]) { \ - if (before) s << obj.delem;\ - s << obj.manip << obj.obj->I3;\ - before = true; \ - } \ - if ((*obj.include)[3]) { \ - if (before) s << obj.delem;\ - s << obj.manip << obj.obj->I4;\ - before = true; \ - } \ - if ((*obj.include)[4]) { \ - if (before) s << obj.delem;\ - s << obj.manip << obj.obj->I5;\ - before = true; \ - } \ - if ((*obj.include)[5]) { \ - if (before) s << obj.delem;\ - s << obj.manip << obj.obj->I6;\ - before = true; \ - } \ - if ((*obj.include)[6]) { \ - if (before) s << obj.delem;\ - s << obj.manip << obj.obj->I7;\ - before = true; \ - } \ - if ((*obj.include)[7]) { \ - if (before) s << obj.delem;\ - s << obj.manip << obj.obj->I8;\ - before = true; \ - } \ - if ((*obj.include)[8]) { \ - if (before) s << obj.delem;\ - s << obj.manip << obj.obj->I9;\ - before = true; \ - } \ - if ((*obj.include)[9]) { \ - if (before) s << obj.delem;\ - s << obj.manip << obj.obj->I10;\ - before = true; \ - } \ - if ((*obj.include)[10]) { \ - if (before) s << obj.delem;\ - s << obj.manip << obj.obj->I11;\ - before = true; \ - } \ - if ((*obj.include)[11]) { \ - if (before) s << obj.delem;\ - s << obj.manip << obj.obj->I12;\ - before = true; \ - } \ - if ((*obj.include)[12]) { \ - if (before) s << obj.delem;\ - s << obj.manip << obj.obj->I13;\ - } \ - return s; \ - } \ - template \ - std::ostream& operator << (std::ostream& s, const NAME##_cus_field_list& obj) { \ - bool before = false; \ - if ((*obj.include)[0]) { \ - s << obj.manip << obj.obj->names[0];\ - before = true; \ - } \ - if ((*obj.include)[1]) { \ - if (before) s << obj.delem;\ - s << obj.manip << obj.obj->names[1];\ - before = true; \ - } \ - if ((*obj.include)[2]) { \ - if (before) s << obj.delem;\ - s << obj.manip << obj.obj->names[2];\ - before = true; \ - } \ - if ((*obj.include)[3]) { \ - if (before) s << obj.delem;\ - s << obj.manip << obj.obj->names[3];\ - before = true; \ - } \ - if ((*obj.include)[4]) { \ - if (before) s << obj.delem;\ - s << obj.manip << obj.obj->names[4];\ - before = true; \ - } \ - if ((*obj.include)[5]) { \ - if (before) s << obj.delem;\ - s << obj.manip << obj.obj->names[5];\ - before = true; \ - } \ - if ((*obj.include)[6]) { \ - if (before) s << obj.delem;\ - s << obj.manip << obj.obj->names[6];\ - before = true; \ - } \ - if ((*obj.include)[7]) { \ - if (before) s << obj.delem;\ - s << obj.manip << obj.obj->names[7];\ - before = true; \ - } \ - if ((*obj.include)[8]) { \ - if (before) s << obj.delem;\ - s << obj.manip << obj.obj->names[8];\ - before = true; \ - } \ - if ((*obj.include)[9]) { \ - if (before) s << obj.delem;\ - s << obj.manip << obj.obj->names[9];\ - before = true; \ - } \ - if ((*obj.include)[10]) { \ - if (before) s << obj.delem;\ - s << obj.manip << obj.obj->names[10];\ - before = true; \ - } \ - if ((*obj.include)[11]) { \ - if (before) s << obj.delem;\ - s << obj.manip << obj.obj->names[11];\ - before = true; \ - } \ - if ((*obj.include)[12]) { \ - if (before) s << obj.delem;\ - s << obj.manip << obj.obj->names[12];\ - } \ - return s; \ - } \ - template \ - std::ostream& operator << (std::ostream& s, const NAME##_cus_equal_list& obj) { \ - bool before = false; \ - if ((*obj.include)[0]) { \ - s << obj.obj->names[0] << obj.comp << obj.manip << obj.obj->I1;\ - before = true; \ - } \ - if ((*obj.include)[1]) { \ - if (before) s << obj.delem;\ - s << obj.obj->names[1] << obj.comp << obj.manip << obj.obj->I2;\ - before = true; \ - } \ - if ((*obj.include)[2]) { \ - if (before) s << obj.delem;\ - s << obj.obj->names[2] << obj.comp << obj.manip << obj.obj->I3;\ - before = true; \ - } \ - if ((*obj.include)[3]) { \ - if (before) s << obj.delem;\ - s << obj.obj->names[3] << obj.comp << obj.manip << obj.obj->I4;\ - before = true; \ - } \ - if ((*obj.include)[4]) { \ - if (before) s << obj.delem;\ - s << obj.obj->names[4] << obj.comp << obj.manip << obj.obj->I5;\ - before = true; \ - } \ - if ((*obj.include)[5]) { \ - if (before) s << obj.delem;\ - s << obj.obj->names[5] << obj.comp << obj.manip << obj.obj->I6;\ - before = true; \ - } \ - if ((*obj.include)[6]) { \ - if (before) s << obj.delem;\ - s << obj.obj->names[6] << obj.comp << obj.manip << obj.obj->I7;\ - before = true; \ - } \ - if ((*obj.include)[7]) { \ - if (before) s << obj.delem;\ - s << obj.obj->names[7] << obj.comp << obj.manip << obj.obj->I8;\ - before = true; \ - } \ - if ((*obj.include)[8]) { \ - if (before) s << obj.delem;\ - s << obj.obj->names[8] << obj.comp << obj.manip << obj.obj->I9;\ - before = true; \ - } \ - if ((*obj.include)[9]) { \ - if (before) s << obj.delem;\ - s << obj.obj->names[9] << obj.comp << obj.manip << obj.obj->I10;\ - before = true; \ - } \ - if ((*obj.include)[10]) { \ - if (before) s << obj.delem;\ - s << obj.obj->names[10] << obj.comp << obj.manip << obj.obj->I11;\ - before = true; \ - } \ - if ((*obj.include)[11]) { \ - if (before) s << obj.delem;\ - s << obj.obj->names[11] << obj.comp << obj.manip << obj.obj->I12;\ - before = true; \ - } \ - if ((*obj.include)[12]) { \ - if (before) s << obj.delem;\ - s << obj.obj->names[12] << obj.comp << obj.manip << obj.obj->I13;\ - } \ - return s; \ - } \ - template \ - inline NAME##_value_list NAME::value_list(cchar *d, Manip m) const { \ - return NAME##_value_list (this, d, m); \ - } \ - template \ - inline NAME##_field_list NAME::field_list(cchar *d, Manip m) const { \ - return NAME##_field_list (this, d, m); \ - } \ - template \ - inline NAME##_equal_list NAME::equal_list(cchar *d, cchar *c, Manip m) const { \ - return NAME##_equal_list (this, d, c, m); \ - } \ - template \ - inline NAME##_cus_value_list NAME::value_list(cchar *d, Manip m,\ - bool i1, bool i2, bool i3, bool i4, bool i5, bool i6, bool i7, bool i8, bool i9, bool i10, bool i11, bool i12, bool i13) const {\ - return NAME##_cus_value_list (this, d, m, i1, i2, i3, i4, i5, i6, i7, i8, i9, i10, i11, i12, i13); \ - } \ - template \ - inline NAME##_cus_field_list NAME::field_list(cchar *d, Manip m,\ - bool i1, bool i2, bool i3, bool i4, bool i5, bool i6, bool i7, bool i8, bool i9, bool i10, bool i11, bool i12, bool i13) const { \ - return NAME##_cus_field_list (this, d, m, i1, i2, i3, i4, i5, i6, i7, i8, i9, i10, i11, i12, i13); \ - } \ - template \ - inline NAME##_cus_equal_list NAME::equal_list(cchar *d, cchar *c, Manip m,\ - bool i1, bool i2, bool i3, bool i4, bool i5, bool i6, bool i7, bool i8, bool i9, bool i10, bool i11, bool i12, bool i13) const { \ - return NAME##_cus_equal_list (this, d, c, m, i1, i2, i3, i4, i5, i6, i7, i8, i9, i10, i11, i12, i13); \ - } \ - template \ - inline NAME##_cus_value_list NAME::value_list(cchar *d, Manip m,\ - NAME##_enum i1, NAME##_enum i2, NAME##_enum i3, NAME##_enum i4, NAME##_enum i5, NAME##_enum i6, NAME##_enum i7, NAME##_enum i8, NAME##_enum i9, NAME##_enum i10, NAME##_enum i11, NAME##_enum i12, NAME##_enum i13) const { \ - return NAME##_cus_value_list (this, d, m, i1, i2, i3, i4, i5, i6, i7, i8, i9, i10, i11, i12, i13); \ - } \ - template \ - inline NAME##_cus_field_list NAME::field_list(cchar *d, Manip m,\ - NAME##_enum i1, NAME##_enum i2, NAME##_enum i3, NAME##_enum i4, NAME##_enum i5, NAME##_enum i6, NAME##_enum i7, NAME##_enum i8, NAME##_enum i9, NAME##_enum i10, NAME##_enum i11, NAME##_enum i12, NAME##_enum i13) const {\ - return NAME##_cus_field_list (this, d, m, i1, i2, i3, i4, i5, i6, i7, i8, i9, i10, i11, i12, i13); \ - } \ - template \ - inline NAME##_cus_equal_list NAME::equal_list(cchar *d, cchar *c, Manip m, \ - NAME##_enum i1, NAME##_enum i2, NAME##_enum i3, NAME##_enum i4, NAME##_enum i5, NAME##_enum i6, NAME##_enum i7, NAME##_enum i8, NAME##_enum i9, NAME##_enum i10, NAME##_enum i11, NAME##_enum i12, NAME##_enum i13) const { \ - return NAME##_cus_equal_list (this, d, c, m, i1, i2, i3, i4, i5, i6, i7, i8, i9, i10, i11, i12, i13); \ - } \ - template \ - inline NAME##_cus_value_list NAME::value_list(cchar *d, Manip m,\ - std::vector *i) const {\ - return NAME##_cus_value_list (this, d, m, i);\ - }\ - template \ - inline NAME##_cus_field_list NAME::field_list(cchar *d, Manip m,\ - std::vector *i) const {\ - return NAME##_cus_field_list (this, d, m, i);\ - }\ - template \ - inline NAME##_cus_equal_list NAME::equal_list(cchar *d, cchar *c, Manip m,\ - std::vector *i) const {\ - return NAME##_cus_equal_list (this, d, c, m, i);\ - }\ - template \ - inline NAME##_cus_value_list \ - NAME::value_list(cchar *d, Manip m, sql_cmp_type /*sc*/) const {\ - sql_compare_type_def_##CMP (NAME, value, NUM);\ - }\ - template \ - inline NAME##_cus_field_list \ - NAME::field_list(cchar *d, Manip m, sql_cmp_type /*sc*/) const {\ - sql_compare_type_def_##CMP (NAME, field, NUM);\ - }\ - template \ - inline NAME##_cus_equal_list \ - NAME::equal_list(cchar *d, cchar *c, Manip m, sql_cmp_type /*sc*/) const {\ - sql_compare_type_defe_##CMP (NAME, equal, NUM);\ - }\ - template \ - void populate_##NAME (NAME *s, const Row &row) { \ - s->I1 = static_cast(row.at(O1));\ - s->I2 = static_cast(row.at(O2));\ - s->I3 = static_cast(row.at(O3));\ - s->I4 = static_cast(row.at(O4));\ - s->I5 = static_cast(row.at(O5));\ - s->I6 = static_cast(row.at(O6));\ - s->I7 = static_cast(row.at(O7));\ - s->I8 = static_cast(row.at(O8));\ - s->I9 = static_cast(row.at(O9));\ - s->I10 = static_cast(row.at(O10));\ - s->I11 = static_cast(row.at(O11));\ - s->I12 = static_cast(row.at(O12));\ - s->I13 = static_cast(row.at(O13));\ - } \ - inline NAME::NAME (const Row &row) \ - {populate_##NAME(this, row);}\ - inline void NAME::set (const Row &row)\ - {populate_##NAME(this, row);}\ - sql_COMPARE__##CMP(NAME, I1, I2, I3, I4, I5, I6, I7, I8, I9, I10, I11, I12, I13, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ) - -#define sql_create_basic_13(NAME, CMP, CONTR, T1, I1, T2, I2, T3, I3, T4, I4, T5, I5, T6, I6, T7, I7, T8, I8, T9, I9, T10, I10, T11, I11, T12, I12, T13, I13) \ - sql_create_basic_c_order_13(NAME, CMP, CONTR, T1, I1, 0, T2, I2, 1, T3, I3, 2, T4, I4, 3, T5, I5, 4, T6, I6, 5, T7, I7, 6, T8, I8, 7, T9, I9, 8, T10, I10, 9, T11, I11, 10, T12, I12, 11, T13, I13, 12) - -#define sql_create_13(NAME, CMP, CONTR, T1, I1, T2, I2, T3, I3, T4, I4, T5, I5, T6, I6, T7, I7, T8, I8, T9, I9, T10, I10, T11, I11, T12, I12, T13, I13) \ - sql_create_complete_13(NAME, CMP, CONTR, T1, I1, #I1, 0, T2, I2, #I2, 1, T3, I3, #I3, 2, T4, I4, #I4, 3, T5, I5, #I5, 4, T6, I6, #I6, 5, T7, I7, #I7, 6, T8, I8, #I8, 7, T9, I9, #I9, 8, T10, I10, #I10, 9, T11, I11, #I11, 10, T12, I12, #I12, 11, T13, I13, #I13, 12) \ - -#define sql_create_c_order_13(NAME, CMP, CONTR, T1, I1, O1, T2, I2, O2, T3, I3, O3, T4, I4, O4, T5, I5, O5, T6, I6, O6, T7, I7, O7, T8, I8, O8, T9, I9, O9, T10, I10, O10, T11, I11, O11, T12, I12, O12, T13, I13, O13) \ - sql_create_complete_13(NAME, CMP, CONTR, T1, I1, #I1, O1, T2, I2, #I2, O2, T3, I3, #I3, O3, T4, I4, #I4, O4, T5, I5, #I5, O5, T6, I6, #I6, O6, T7, I7, #I7, O7, T8, I8, #I8, O8, T9, I9, #I9, O9, T10, I10, #I10, O10, T11, I11, #I11, O11, T12, I12, #I12, O12, T13, I13, #I13, O13) - -#define sql_create_c_names_13(NAME, CMP, CONTR, T1, I1, N1, T2, I2, N2, T3, I3, N3, T4, I4, N4, T5, I5, N5, T6, I6, N6, T7, I7, N7, T8, I8, N8, T9, I9, N9, T10, I10, N10, T11, I11, N11, T12, I12, N12, T13, I13, N13) \ - sql_create_complete_13(NAME, CMP, CONTR, T1, I1, N1, 0, T2, I2, N2, 1, T3, I3, N3, 2, T4, I4, N4, 3, T5, I5, N5, 4, T6, I6, N6, 5, T7, I7, N7, 6, T8, I8, N8, 7, T9, I9, N9, 8, T10, I10, N10, 9, T11, I11, N11, 10, T12, I12, N12, 11, T13, I13, N13, 12) - -// --------------------------------------------------- -// End Create 13 -// --------------------------------------------------- - -// --------------------------------------------------- -// Begin Create 14 -// --------------------------------------------------- -#define sql_create_basic_c_order_14(NAME, CMP, CONTR, T1, I1, O1, T2, I2, O2, T3, I3, O3, T4, I4, O4, T5, I5, O5, T6, I6, O6, T7, I7, O7, T8, I8, O8, T9, I9, O9, T10, I10, O10, T11, I11, O11, T12, I12, O12, T13, I13, O13, T14, I14, O14)\ - struct NAME; \ - template int sql_compare_##NAME (const NAME &, const NAME &);\ - struct NAME { \ - T1 I1;\ - T2 I2;\ - T3 I3;\ - T4 I4;\ - T5 I5;\ - T6 I6;\ - T7 I7;\ - T8 I8;\ - T9 I9;\ - T10 I10;\ - T11 I11;\ - T12 I12;\ - T13 I13;\ - T14 I14; \ - NAME () {} \ - NAME (const Row &row);\ - sql_compare_define_##CMP(NAME, T1, I1, T2, I2, T3, I3, T4, I4, T5, I5, T6, I6, T7, I7, T8, I8, T9, I9, T10, I10, T11, I11, T12, I12, T13, I13, T14, I14, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0)\ - }; \ - template \ - void populate_##NAME (NAME *s, const Row &row) { \ - s->I1 = static_cast(row.at(O1));\ - s->I2 = static_cast(row.at(O2));\ - s->I3 = static_cast(row.at(O3));\ - s->I4 = static_cast(row.at(O4));\ - s->I5 = static_cast(row.at(O5));\ - s->I6 = static_cast(row.at(O6));\ - s->I7 = static_cast(row.at(O7));\ - s->I8 = static_cast(row.at(O8));\ - s->I9 = static_cast(row.at(O9));\ - s->I10 = static_cast(row.at(O10));\ - s->I11 = static_cast(row.at(O11));\ - s->I12 = static_cast(row.at(O12));\ - s->I13 = static_cast(row.at(O13));\ - s->I14 = static_cast(row.at(O14)); \ - } \ - inline NAME::NAME (const Row &row) \ - {populate_##NAME(this, row);} \ - sql_COMPARE__##CMP(NAME, I1, I2, I3, I4, I5, I6, I7, I8, I9, I10, I11, I12, I13, I14, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ) - -#define sql_create_complete_14(NAME, CMP, CONTR, T1, I1, N1, O1, T2, I2, N2, O2, T3, I3, N3, O3, T4, I4, N4, O4, T5, I5, N5, O5, T6, I6, N6, O6, T7, I7, N7, O7, T8, I8, N8, O8, T9, I9, N9, O9, T10, I10, N10, O10, T11, I11, N11, O11, T12, I12, N12, O12, T13, I13, N13, O13, T14, I14, N14, O14) \ - struct NAME; \ - enum NAME##_enum { \ - NAME##_##I1,\ - NAME##_##I2,\ - NAME##_##I3,\ - NAME##_##I4,\ - NAME##_##I5,\ - NAME##_##I6,\ - NAME##_##I7,\ - NAME##_##I8,\ - NAME##_##I9,\ - NAME##_##I10,\ - NAME##_##I11,\ - NAME##_##I12,\ - NAME##_##I13,\ - NAME##_##I14 \ - ,NAME##_NULL \ - }; \ - template \ - class NAME##_value_list { \ - /*friend std::ostream& operator << <> (std::ostream&, const NAME##_value_list&); */\ - public: \ - const NAME *obj;\ - cchar *delem;\ - Manip manip;\ - public: \ - NAME##_value_list (const NAME *o, cchar *d, Manip m) \ - : obj(o), delem(d), manip(m) {} \ - };\ - template \ - class NAME##_##field_list {\ - /* friend std::ostream& operator << <> (std::ostream&, const NAME##_field_list&); */\ - public: \ - const NAME *obj; \ - cchar *delem;\ - Manip manip;\ - public: \ - NAME##_field_list (const NAME *o, cchar *d, Manip m) \ - : obj(o), delem(d), manip(m) {} \ - };\ - template \ - class NAME##_equal_list { \ - /* friend std::ostream& operator << <> (std::ostream&, const NAME##_equal_list&); */\ - public: \ - const NAME *obj;\ - cchar *delem;\ - cchar *comp;\ - Manip manip;\ - public: \ - NAME##_equal_list (const NAME *o, cchar *d, cchar *c, Manip m) \ - : obj(o), delem(d), comp(c), manip(m) {}\ - };\ - template \ - class NAME##_cus_value_list {\ - /* friend std::ostream& operator << <> (std::ostream&, \ - const NAME##_cus_value_list&); */\ - public:\ - const NAME *obj;\ - std::vector *include;\ - bool del_vector;\ - cchar *delem;\ - Manip manip;\ - public: \ - ~NAME##_cus_value_list () {if (del_vector) delete include;} \ - NAME##_cus_value_list (const NAME *o, cchar *d, Manip m, bool i1, bool i2, bool i3, bool i4, bool i5, bool i6, bool i7, bool i8, bool i9, bool i10, bool i11, bool i12, bool i13, bool i14);\ - NAME##_cus_value_list (const NAME *o, cchar *d, Manip m, NAME##_enum i1, NAME##_enum i2, NAME##_enum i3, NAME##_enum i4, NAME##_enum i5, NAME##_enum i6, NAME##_enum i7, NAME##_enum i8, NAME##_enum i9, NAME##_enum i10, NAME##_enum i11, NAME##_enum i12, NAME##_enum i13, NAME##_enum i14); \ - NAME##_cus_value_list (const NAME *o, cchar *d, Manip m ,std::vector* i)\ - : obj(o), include(i), del_vector(false), delem(d), manip(m) {}\ - };\ - template \ - class NAME##_cus_field_list { \ - /* friend std::ostream& operator << <> (std::ostream&, \ - const NAME##_cus_field_list&); */\ - public:\ - const NAME *obj; \ - std::vector *include; \ - bool del_vector; \ - cchar *delem;\ - Manip manip;\ - public: \ - ~NAME##_cus_field_list () {if (del_vector) delete include;} \ - NAME##_cus_field_list (const NAME *o, cchar *d, Manip m, bool i1, bool i2, bool i3, bool i4, bool i5, bool i6, bool i7, bool i8, bool i9, bool i10, bool i11, bool i12, bool i13, bool i14); \ - NAME##_cus_field_list (const NAME *o, cchar *d, Manip m, NAME##_enum i1, NAME##_enum i2, NAME##_enum i3, NAME##_enum i4, NAME##_enum i5, NAME##_enum i6, NAME##_enum i7, NAME##_enum i8, NAME##_enum i9, NAME##_enum i10, NAME##_enum i11, NAME##_enum i12, NAME##_enum i13, NAME##_enum i14); \ - NAME##_cus_field_list (const NAME *o, cchar *d, Manip m, std::vector *i) \ - : obj(o), include(i), del_vector(false), delem(d), manip(m) {}\ - };\ - template \ - class NAME##_cus_equal_list {\ - /* friend std::ostream& operator << <> (std::ostream&, \ - const NAME##_cus_equal_list&); */\ - public:\ - const NAME *obj;\ - std::vector *include;\ - bool del_vector;\ - cchar *delem;\ - cchar *comp;\ - Manip manip;\ - public:\ - ~NAME##_##cus_equal_list () {if (del_vector) delete include;}\ - NAME##_##cus_equal_list (const NAME *o, cchar *d, cchar *c, Manip m, bool i1, bool i2, bool i3, bool i4, bool i5, bool i6, bool i7, bool i8, bool i9, bool i10, bool i11, bool i12, bool i13, bool i14); \ - NAME##_##cus_equal_list (const NAME *o, cchar *d, cchar *c, Manip m, NAME##_enum i1, NAME##_enum i2, NAME##_enum i3, NAME##_enum i4, NAME##_enum i5, NAME##_enum i6, NAME##_enum i7, NAME##_enum i8, NAME##_enum i9, NAME##_enum i10, NAME##_enum i11, NAME##_enum i12, NAME##_enum i13, NAME##_enum i14); \ - NAME##_##cus_equal_list (const NAME *o, cchar *d, cchar *c, Manip m, std::vector *i) \ - : obj(o), include(i), del_vector(false), delem(d), comp(c), manip(m) {}\ - };\ - template int sql_compare_##NAME (const NAME &, const NAME &);\ - struct NAME { \ - T1 I1;\ - T2 I2;\ - T3 I3;\ - T4 I4;\ - T5 I5;\ - T6 I6;\ - T7 I7;\ - T8 I8;\ - T9 I9;\ - T10 I10;\ - T11 I11;\ - T12 I12;\ - T13 I13;\ - T14 I14; \ - NAME () {} \ - NAME (const Row &row);\ - void set (const Row &row);\ - sql_compare_define_##CMP(NAME, T1, I1, T2, I2, T3, I3, T4, I4, T5, I5, T6, I6, T7, I7, T8, I8, T9, I9, T10, I10, T11, I11, T12, I12, T13, I13, T14, I14, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0)\ - sql_construct_define_##CONTR(NAME, T1, I1, T2, I2, T3, I3, T4, I4, T5, I5, T6, I6, T7, I7, T8, I8, T9, I9, T10, I10, T11, I11, T12, I12, T13, I13, T14, I14, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0)\ - static const char *names[];\ - static const char *_table;\ - static const char *& table() {return _table;}\ - NAME##_value_list value_list() const {\ - return value_list(",", quote);}\ - NAME##_value_list value_list(cchar *d) const {\ - return value_list(d, quote);}\ - template \ - NAME##_value_list value_list(cchar *d, Manip m) const; \ - NAME##_field_list field_list() const {\ - return field_list(",", do_nothing);}\ - NAME##_field_list field_list(cchar *d) const {\ - return field_list(d, do_nothing);}\ - template \ - NAME##_field_list field_list(cchar *d, Manip m) const; \ - NAME##_equal_list equal_list(cchar *d = ",", \ - cchar *c = " = ") const{\ - return equal_list(d, c, quote);}\ - template \ - NAME##_equal_list equal_list(cchar *d, cchar *c, Manip m) const; \ - /* cus_data */\ - NAME##_cus_value_list value_list(bool i1, bool i2 = false, bool i3 = false, bool i4 = false, bool i5 = false, bool i6 = false, bool i7 = false, bool i8 = false, bool i9 = false, bool i10 = false, bool i11 = false, bool i12 = false, bool i13 = false, bool i14 = false) const {\ - return value_list(",", quote, i1, i2, i3, i4, i5, i6, i7, i8, i9, i10, i11, i12, i13, i14);\ - }\ - NAME##_cus_value_list value_list(NAME##_enum i1, NAME##_enum i2 = NAME##_NULL, NAME##_enum i3 = NAME##_NULL, NAME##_enum i4 = NAME##_NULL, NAME##_enum i5 = NAME##_NULL, NAME##_enum i6 = NAME##_NULL, NAME##_enum i7 = NAME##_NULL, NAME##_enum i8 = NAME##_NULL, NAME##_enum i9 = NAME##_NULL, NAME##_enum i10 = NAME##_NULL, NAME##_enum i11 = NAME##_NULL, NAME##_enum i12 = NAME##_NULL, NAME##_enum i13 = NAME##_NULL, NAME##_enum i14 = NAME##_NULL) const {\ - return value_list(",", quote, i1, i2, i3, i4, i5, i6, i7, i8, i9, i10, i11, i12, i13, i14);\ - }\ - NAME##_cus_value_list value_list(std::vector *i) const {\ - return value_list(",", quote, i);\ - }\ - NAME##_cus_value_list value_list(sql_cmp_type sc) const {\ - return value_list(",", quote, sc);\ - }\ - NAME##_cus_value_list value_list(cchar *d, bool i1, bool i2 = false, bool i3 = false, bool i4 = false, bool i5 = false, bool i6 = false, bool i7 = false, bool i8 = false, bool i9 = false, bool i10 = false, bool i11 = false, bool i12 = false, bool i13 = false, bool i14 = false) const {\ - return value_list(d, quote, i1, i2, i3, i4, i5, i6, i7, i8, i9, i10, i11, i12, i13, i14);\ - }\ - NAME##_cus_value_list value_list(cchar *d, NAME##_enum i1, NAME##_enum i2 = NAME##_NULL, NAME##_enum i3 = NAME##_NULL, NAME##_enum i4 = NAME##_NULL, NAME##_enum i5 = NAME##_NULL, NAME##_enum i6 = NAME##_NULL, NAME##_enum i7 = NAME##_NULL, NAME##_enum i8 = NAME##_NULL, NAME##_enum i9 = NAME##_NULL, NAME##_enum i10 = NAME##_NULL, NAME##_enum i11 = NAME##_NULL, NAME##_enum i12 = NAME##_NULL, NAME##_enum i13 = NAME##_NULL, NAME##_enum i14 = NAME##_NULL) const {\ - return value_list(d, quote, i1, i2, i3, i4, i5, i6, i7, i8, i9, i10, i11, i12, i13, i14);\ - }\ - NAME##_cus_value_list value_list(cchar *d, \ - std::vector *i) const {\ - return value_list(d, quote, i);\ - }\ - NAME##_cus_value_list value_list(cchar *d, \ - sql_cmp_type sc) const {\ - return value_list(d, quote, sc);\ - }\ - template \ - NAME##_cus_value_list value_list(cchar *d, Manip m,\ - bool i1, bool i2 = false, bool i3 = false, bool i4 = false, bool i5 = false, bool i6 = false, bool i7 = false, bool i8 = false, bool i9 = false, bool i10 = false, bool i11 = false, bool i12 = false, bool i13 = false, bool i14 = false) const; \ - template \ - NAME##_cus_value_list value_list(cchar *d, Manip m,\ - NAME##_enum i1, NAME##_enum i2 = NAME##_NULL, NAME##_enum i3 = NAME##_NULL, NAME##_enum i4 = NAME##_NULL, NAME##_enum i5 = NAME##_NULL, NAME##_enum i6 = NAME##_NULL, NAME##_enum i7 = NAME##_NULL, NAME##_enum i8 = NAME##_NULL, NAME##_enum i9 = NAME##_NULL, NAME##_enum i10 = NAME##_NULL, NAME##_enum i11 = NAME##_NULL, NAME##_enum i12 = NAME##_NULL, NAME##_enum i13 = NAME##_NULL, NAME##_enum i14 = NAME##_NULL) const; \ - template \ - NAME##_cus_value_list value_list(cchar *d, Manip m, \ - std::vector *i) const;\ - template \ - NAME##_cus_value_list value_list(cchar *d, Manip m, \ - sql_cmp_type sc) const;\ - /* cus field */\ - NAME##_cus_field_list field_list(bool i1, bool i2 = false, bool i3 = false, bool i4 = false, bool i5 = false, bool i6 = false, bool i7 = false, bool i8 = false, bool i9 = false, bool i10 = false, bool i11 = false, bool i12 = false, bool i13 = false, bool i14 = false) const {\ - return field_list(",", do_nothing, i1, i2, i3, i4, i5, i6, i7, i8, i9, i10, i11, i12, i13, i14);\ - }\ - NAME##_cus_field_list field_list(NAME##_enum i1, NAME##_enum i2 = NAME##_NULL, NAME##_enum i3 = NAME##_NULL, NAME##_enum i4 = NAME##_NULL, NAME##_enum i5 = NAME##_NULL, NAME##_enum i6 = NAME##_NULL, NAME##_enum i7 = NAME##_NULL, NAME##_enum i8 = NAME##_NULL, NAME##_enum i9 = NAME##_NULL, NAME##_enum i10 = NAME##_NULL, NAME##_enum i11 = NAME##_NULL, NAME##_enum i12 = NAME##_NULL, NAME##_enum i13 = NAME##_NULL, NAME##_enum i14 = NAME##_NULL) const {\ - return field_list(",", do_nothing, i1, i2, i3, i4, i5, i6, i7, i8, i9, i10, i11, i12, i13, i14);\ - }\ - NAME##_cus_field_list field_list(std::vector *i) const {\ - return field_list(",", do_nothing, i);\ - }\ - NAME##_cus_field_list field_list(sql_cmp_type sc) const\ - {\ - return field_list(",", do_nothing, sc);\ - }\ - NAME##_cus_field_list field_list(cchar *d, \ - bool i1, bool i2 = false, bool i3 = false, bool i4 = false, bool i5 = false, bool i6 = false, bool i7 = false, bool i8 = false, bool i9 = false, bool i10 = false, bool i11 = false, bool i12 = false, bool i13 = false, bool i14 = false) const {\ - return field_list(d, do_nothing, i1, i2, i3, i4, i5, i6, i7, i8, i9, i10, i11, i12, i13, i14);\ - }\ - NAME##_cus_field_list field_list(cchar *d,\ - NAME##_enum i1, NAME##_enum i2 = NAME##_NULL, NAME##_enum i3 = NAME##_NULL, NAME##_enum i4 = NAME##_NULL, NAME##_enum i5 = NAME##_NULL, NAME##_enum i6 = NAME##_NULL, NAME##_enum i7 = NAME##_NULL, NAME##_enum i8 = NAME##_NULL, NAME##_enum i9 = NAME##_NULL, NAME##_enum i10 = NAME##_NULL, NAME##_enum i11 = NAME##_NULL, NAME##_enum i12 = NAME##_NULL, NAME##_enum i13 = NAME##_NULL, NAME##_enum i14 = NAME##_NULL) const {\ - return field_list(d, do_nothing, i1, i2, i3, i4, i5, i6, i7, i8, i9, i10, i11, i12, i13, i14);\ - }\ - NAME##_cus_field_list field_list(cchar *d, \ - std::vector *i) const {\ - return field_list(d, do_nothing, i);\ - }\ - NAME##_cus_field_list field_list(cchar *d, \ - sql_cmp_type sc) const {\ - return field_list(d, do_nothing, sc);\ - }\ - template \ - NAME##_cus_field_list field_list(cchar *d, Manip m,\ - bool i1, bool i2 = false, bool i3 = false, bool i4 = false, bool i5 = false, bool i6 = false, bool i7 = false, bool i8 = false, bool i9 = false, bool i10 = false, bool i11 = false, bool i12 = false, bool i13 = false, bool i14 = false) const; \ - template \ - NAME##_cus_field_list field_list(cchar *d, Manip m,\ - NAME##_enum i1, NAME##_enum i2 = NAME##_NULL, NAME##_enum i3 = NAME##_NULL, NAME##_enum i4 = NAME##_NULL, NAME##_enum i5 = NAME##_NULL, NAME##_enum i6 = NAME##_NULL, NAME##_enum i7 = NAME##_NULL, NAME##_enum i8 = NAME##_NULL, NAME##_enum i9 = NAME##_NULL, NAME##_enum i10 = NAME##_NULL, NAME##_enum i11 = NAME##_NULL, NAME##_enum i12 = NAME##_NULL, NAME##_enum i13 = NAME##_NULL, NAME##_enum i14 = NAME##_NULL) const; \ - template \ - NAME##_cus_field_list field_list(cchar *d, Manip m,\ - std::vector *i) const;\ - template \ - NAME##_cus_field_list field_list(cchar *d, Manip m, \ - sql_cmp_type sc) const;\ - /* cus equal */\ - NAME##_cus_equal_list equal_list(bool i1, bool i2 = false, bool i3 = false, bool i4 = false, bool i5 = false, bool i6 = false, bool i7 = false, bool i8 = false, bool i9 = false, bool i10 = false, bool i11 = false, bool i12 = false, bool i13 = false, bool i14 = false) const {\ - return equal_list(",", " = ", quote, i1, i2, i3, i4, i5, i6, i7, i8, i9, i10, i11, i12, i13, i14);\ - }\ - NAME##_cus_equal_list equal_list(NAME##_enum i1, NAME##_enum i2 = NAME##_NULL, NAME##_enum i3 = NAME##_NULL, NAME##_enum i4 = NAME##_NULL, NAME##_enum i5 = NAME##_NULL, NAME##_enum i6 = NAME##_NULL, NAME##_enum i7 = NAME##_NULL, NAME##_enum i8 = NAME##_NULL, NAME##_enum i9 = NAME##_NULL, NAME##_enum i10 = NAME##_NULL, NAME##_enum i11 = NAME##_NULL, NAME##_enum i12 = NAME##_NULL, NAME##_enum i13 = NAME##_NULL, NAME##_enum i14 = NAME##_NULL) const {\ - return equal_list(",", " = ", quote, i1, i2, i3, i4, i5, i6, i7, i8, i9, i10, i11, i12, i13, i14);\ - }\ - NAME##_cus_equal_list equal_list(std::vector *i) const {\ - return equal_list(",", " = ", quote, i);\ - }\ - NAME##_cus_equal_list equal_list(sql_cmp_type sc) const {\ - return equal_list(",", " = ", quote, sc);\ - }\ - NAME##_cus_equal_list equal_list(cchar *d, bool i1, bool i2 = false, bool i3 = false, bool i4 = false, bool i5 = false, bool i6 = false, bool i7 = false, bool i8 = false, bool i9 = false, bool i10 = false, bool i11 = false, bool i12 = false, bool i13 = false, bool i14 = false) const {\ - return equal_list(d, " = ", quote, i1, i2, i3, i4, i5, i6, i7, i8, i9, i10, i11, i12, i13, i14);\ - }\ - NAME##_cus_equal_list equal_list(cchar *d, NAME##_enum i1, NAME##_enum i2 = NAME##_NULL, NAME##_enum i3 = NAME##_NULL, NAME##_enum i4 = NAME##_NULL, NAME##_enum i5 = NAME##_NULL, NAME##_enum i6 = NAME##_NULL, NAME##_enum i7 = NAME##_NULL, NAME##_enum i8 = NAME##_NULL, NAME##_enum i9 = NAME##_NULL, NAME##_enum i10 = NAME##_NULL, NAME##_enum i11 = NAME##_NULL, NAME##_enum i12 = NAME##_NULL, NAME##_enum i13 = NAME##_NULL, NAME##_enum i14 = NAME##_NULL) const {\ - return equal_list(d, " = ", quote, i1, i2, i3, i4, i5, i6, i7, i8, i9, i10, i11, i12, i13, i14);\ - }\ - NAME##_cus_equal_list equal_list(cchar *d, \ - std::vector *i) const {\ - return equal_list(d, " = ", quote, i);\ - }\ - NAME##_cus_equal_list equal_list(cchar *d, \ - sql_cmp_type sc) const {\ - return equal_list(d, " = ", quote, sc);\ - }\ - NAME##_cus_equal_list equal_list(cchar *d, cchar *c,\ - bool i1, bool i2 = false, bool i3 = false, bool i4 = false, bool i5 = false, bool i6 = false, bool i7 = false, bool i8 = false, bool i9 = false, bool i10 = false, bool i11 = false, bool i12 = false, bool i13 = false, bool i14 = false) const {\ - return equal_list(d, c, quote, i1, i2, i3, i4, i5, i6, i7, i8, i9, i10, i11, i12, i13, i14);\ - }\ - NAME##_cus_equal_list equal_list(cchar *d, cchar *c,\ - NAME##_enum i1, NAME##_enum i2 = NAME##_NULL, NAME##_enum i3 = NAME##_NULL, NAME##_enum i4 = NAME##_NULL, NAME##_enum i5 = NAME##_NULL, NAME##_enum i6 = NAME##_NULL, NAME##_enum i7 = NAME##_NULL, NAME##_enum i8 = NAME##_NULL, NAME##_enum i9 = NAME##_NULL, NAME##_enum i10 = NAME##_NULL, NAME##_enum i11 = NAME##_NULL, NAME##_enum i12 = NAME##_NULL, NAME##_enum i13 = NAME##_NULL, NAME##_enum i14 = NAME##_NULL) const {\ - return equal_list(d, c, quote, i1, i2, i3, i4, i5, i6, i7, i8, i9, i10, i11, i12, i13, i14);\ - }\ - NAME##_cus_equal_list equal_list(cchar *d, cchar *c,\ - std::vector *i) const {\ - return equal_list(d, c, quote, i);\ - }\ - NAME##_cus_equal_list equal_list(cchar *d, cchar *c,\ - sql_cmp_type sc) const {\ - return equal_list(d, c, quote, sc);\ - }\ - template \ - NAME##_cus_equal_list equal_list(cchar *d, cchar *c, Manip m, \ - bool i1, bool i2 = false, bool i3 = false, bool i4 = false, bool i5 = false, bool i6 = false, bool i7 = false, bool i8 = false, bool i9 = false, bool i10 = false, bool i11 = false, bool i12 = false, bool i13 = false, bool i14 = false) const; \ - template \ - NAME##_cus_equal_list equal_list(cchar *d, cchar *c, Manip m, \ - NAME##_enum i1, NAME##_enum i2 = NAME##_NULL, NAME##_enum i3 = NAME##_NULL, NAME##_enum i4 = NAME##_NULL, NAME##_enum i5 = NAME##_NULL, NAME##_enum i6 = NAME##_NULL, NAME##_enum i7 = NAME##_NULL, NAME##_enum i8 = NAME##_NULL, NAME##_enum i9 = NAME##_NULL, NAME##_enum i10 = NAME##_NULL, NAME##_enum i11 = NAME##_NULL, NAME##_enum i12 = NAME##_NULL, NAME##_enum i13 = NAME##_NULL, NAME##_enum i14 = NAME##_NULL) const; \ - template \ - NAME##_cus_equal_list equal_list(cchar *d, cchar *c, Manip m, \ - std::vector *i) const;\ - template \ - NAME##_cus_equal_list equal_list(cchar *d, cchar *c, Manip m, \ - sql_cmp_type sc) const;\ - }; \ - const char *NAME::names[] = { \ - N1 ,\ - N2 ,\ - N3 ,\ - N4 ,\ - N5 ,\ - N6 ,\ - N7 ,\ - N8 ,\ - N9 ,\ - N10 ,\ - N11 ,\ - N12 ,\ - N13 ,\ - N14 \ - }; \ - const char *NAME::_table = #NAME ; \ - template \ - NAME##_cus_value_list::NAME##_cus_value_list\ - (const NAME *o, cchar *d, Manip m, bool i1, bool i2, bool i3, bool i4, bool i5, bool i6, bool i7, bool i8, bool i9, bool i10, bool i11, bool i12, bool i13, bool i14) \ - { \ - delem = d;\ - manip = m;\ - del_vector = true;\ - obj = o; \ - include = new std::vector(14, false);\ - if (i1) (*include)[0]=true;\ - if (i2) (*include)[1]=true;\ - if (i3) (*include)[2]=true;\ - if (i4) (*include)[3]=true;\ - if (i5) (*include)[4]=true;\ - if (i6) (*include)[5]=true;\ - if (i7) (*include)[6]=true;\ - if (i8) (*include)[7]=true;\ - if (i9) (*include)[8]=true;\ - if (i10) (*include)[9]=true;\ - if (i11) (*include)[10]=true;\ - if (i12) (*include)[11]=true;\ - if (i13) (*include)[12]=true;\ - if (i14) (*include)[13]=true;\ - } \ - template \ - NAME##_cus_value_list::NAME##_cus_value_list\ - (const NAME *o, cchar *d, Manip m, NAME##_enum i1, NAME##_enum i2, NAME##_enum i3, NAME##_enum i4, NAME##_enum i5, NAME##_enum i6, NAME##_enum i7, NAME##_enum i8, NAME##_enum i9, NAME##_enum i10, NAME##_enum i11, NAME##_enum i12, NAME##_enum i13, NAME##_enum i14) { \ - delem = d;\ - manip = m;\ - del_vector = true; \ - obj = o; \ - include = new std::vector(14, false); \ - if (i1 == NAME##_NULL) return;\ - (*include)[i1]=true;\ - if (i2 == NAME##_NULL) return;\ - (*include)[i2]=true;\ - if (i3 == NAME##_NULL) return;\ - (*include)[i3]=true;\ - if (i4 == NAME##_NULL) return;\ - (*include)[i4]=true;\ - if (i5 == NAME##_NULL) return;\ - (*include)[i5]=true;\ - if (i6 == NAME##_NULL) return;\ - (*include)[i6]=true;\ - if (i7 == NAME##_NULL) return;\ - (*include)[i7]=true;\ - if (i8 == NAME##_NULL) return;\ - (*include)[i8]=true;\ - if (i9 == NAME##_NULL) return;\ - (*include)[i9]=true;\ - if (i10 == NAME##_NULL) return;\ - (*include)[i10]=true;\ - if (i11 == NAME##_NULL) return;\ - (*include)[i11]=true;\ - if (i12 == NAME##_NULL) return;\ - (*include)[i12]=true;\ - if (i13 == NAME##_NULL) return;\ - (*include)[i13]=true;\ - if (i14 == NAME##_NULL) return;\ - (*include)[i14]=true;\ - }\ - template \ - NAME##_cus_field_list::NAME##_cus_field_list\ - (const NAME *o, cchar *d, Manip m, bool i1, bool i2, bool i3, bool i4, bool i5, bool i6, bool i7, bool i8, bool i9, bool i10, bool i11, bool i12, bool i13, bool i14) {\ - delem = d;\ - manip = m;\ - del_vector = true; \ - obj = o; \ - include = new std::vector(14, false); \ - if (i1) (*include)[0]=true;\ - if (i2) (*include)[1]=true;\ - if (i3) (*include)[2]=true;\ - if (i4) (*include)[3]=true;\ - if (i5) (*include)[4]=true;\ - if (i6) (*include)[5]=true;\ - if (i7) (*include)[6]=true;\ - if (i8) (*include)[7]=true;\ - if (i9) (*include)[8]=true;\ - if (i10) (*include)[9]=true;\ - if (i11) (*include)[10]=true;\ - if (i12) (*include)[11]=true;\ - if (i13) (*include)[12]=true;\ - if (i14) (*include)[13]=true;\ - } \ - template \ - NAME##_cus_field_list::NAME##_cus_field_list\ - (const NAME *o, cchar *d, Manip m, NAME##_enum i1, NAME##_enum i2, NAME##_enum i3, NAME##_enum i4, NAME##_enum i5, NAME##_enum i6, NAME##_enum i7, NAME##_enum i8, NAME##_enum i9, NAME##_enum i10, NAME##_enum i11, NAME##_enum i12, NAME##_enum i13, NAME##_enum i14) { \ - delem = d;\ - manip = m;\ - del_vector = true; \ - obj = o; \ - include = new std::vector(14, false); \ - if (i1 == NAME##_NULL) return;\ - (*include)[i1]=true;\ - if (i2 == NAME##_NULL) return;\ - (*include)[i2]=true;\ - if (i3 == NAME##_NULL) return;\ - (*include)[i3]=true;\ - if (i4 == NAME##_NULL) return;\ - (*include)[i4]=true;\ - if (i5 == NAME##_NULL) return;\ - (*include)[i5]=true;\ - if (i6 == NAME##_NULL) return;\ - (*include)[i6]=true;\ - if (i7 == NAME##_NULL) return;\ - (*include)[i7]=true;\ - if (i8 == NAME##_NULL) return;\ - (*include)[i8]=true;\ - if (i9 == NAME##_NULL) return;\ - (*include)[i9]=true;\ - if (i10 == NAME##_NULL) return;\ - (*include)[i10]=true;\ - if (i11 == NAME##_NULL) return;\ - (*include)[i11]=true;\ - if (i12 == NAME##_NULL) return;\ - (*include)[i12]=true;\ - if (i13 == NAME##_NULL) return;\ - (*include)[i13]=true;\ - if (i14 == NAME##_NULL) return;\ - (*include)[i14]=true;\ - }\ - template \ - NAME##_cus_equal_list::NAME##_cus_equal_list\ - (const NAME *o, cchar *d, cchar *c, Manip m, bool i1, bool i2, bool i3, bool i4, bool i5, bool i6, bool i7, bool i8, bool i9, bool i10, bool i11, bool i12, bool i13, bool i14) { \ - delem = d;\ - comp = c;\ - manip = m;\ - del_vector = true; \ - obj = o; \ - include = new std::vector(14, false); \ - if (i1) (*include)[0]=true;\ - if (i2) (*include)[1]=true;\ - if (i3) (*include)[2]=true;\ - if (i4) (*include)[3]=true;\ - if (i5) (*include)[4]=true;\ - if (i6) (*include)[5]=true;\ - if (i7) (*include)[6]=true;\ - if (i8) (*include)[7]=true;\ - if (i9) (*include)[8]=true;\ - if (i10) (*include)[9]=true;\ - if (i11) (*include)[10]=true;\ - if (i12) (*include)[11]=true;\ - if (i13) (*include)[12]=true;\ - if (i14) (*include)[13]=true;\ - } \ - template \ - NAME##_cus_equal_list::NAME##_cus_equal_list\ - (const NAME *o, cchar *d, cchar *c, Manip m, NAME##_enum i1, NAME##_enum i2, NAME##_enum i3, NAME##_enum i4, NAME##_enum i5, NAME##_enum i6, NAME##_enum i7, NAME##_enum i8, NAME##_enum i9, NAME##_enum i10, NAME##_enum i11, NAME##_enum i12, NAME##_enum i13, NAME##_enum i14) { \ - delem = d;\ - comp = c;\ - manip = m;\ - del_vector = true; \ - obj = o; \ - include = new std::vector(14, false); \ - if (i1 == NAME##_NULL) return;\ - (*include)[i1]=true;\ - if (i2 == NAME##_NULL) return;\ - (*include)[i2]=true;\ - if (i3 == NAME##_NULL) return;\ - (*include)[i3]=true;\ - if (i4 == NAME##_NULL) return;\ - (*include)[i4]=true;\ - if (i5 == NAME##_NULL) return;\ - (*include)[i5]=true;\ - if (i6 == NAME##_NULL) return;\ - (*include)[i6]=true;\ - if (i7 == NAME##_NULL) return;\ - (*include)[i7]=true;\ - if (i8 == NAME##_NULL) return;\ - (*include)[i8]=true;\ - if (i9 == NAME##_NULL) return;\ - (*include)[i9]=true;\ - if (i10 == NAME##_NULL) return;\ - (*include)[i10]=true;\ - if (i11 == NAME##_NULL) return;\ - (*include)[i11]=true;\ - if (i12 == NAME##_NULL) return;\ - (*include)[i12]=true;\ - if (i13 == NAME##_NULL) return;\ - (*include)[i13]=true;\ - if (i14 == NAME##_NULL) return;\ - (*include)[i14]=true;\ - }\ - template \ - std::ostream& operator << (std::ostream& s, const NAME##_value_list& obj) { \ - s << obj.manip << obj.obj->I1 << obj.delem;\ - s << obj.manip << obj.obj->I2 << obj.delem;\ - s << obj.manip << obj.obj->I3 << obj.delem;\ - s << obj.manip << obj.obj->I4 << obj.delem;\ - s << obj.manip << obj.obj->I5 << obj.delem;\ - s << obj.manip << obj.obj->I6 << obj.delem;\ - s << obj.manip << obj.obj->I7 << obj.delem;\ - s << obj.manip << obj.obj->I8 << obj.delem;\ - s << obj.manip << obj.obj->I9 << obj.delem;\ - s << obj.manip << obj.obj->I10 << obj.delem;\ - s << obj.manip << obj.obj->I11 << obj.delem;\ - s << obj.manip << obj.obj->I12 << obj.delem;\ - s << obj.manip << obj.obj->I13 << obj.delem;\ - s << obj.manip << obj.obj->I14; \ - return s; \ - } \ - template \ - std::ostream& operator << (std::ostream& s, const NAME##_field_list& obj) { \ - s << obj.manip << obj.obj->names[0] << obj.delem;\ - s << obj.manip << obj.obj->names[1] << obj.delem;\ - s << obj.manip << obj.obj->names[2] << obj.delem;\ - s << obj.manip << obj.obj->names[3] << obj.delem;\ - s << obj.manip << obj.obj->names[4] << obj.delem;\ - s << obj.manip << obj.obj->names[5] << obj.delem;\ - s << obj.manip << obj.obj->names[6] << obj.delem;\ - s << obj.manip << obj.obj->names[7] << obj.delem;\ - s << obj.manip << obj.obj->names[8] << obj.delem;\ - s << obj.manip << obj.obj->names[9] << obj.delem;\ - s << obj.manip << obj.obj->names[10] << obj.delem;\ - s << obj.manip << obj.obj->names[11] << obj.delem;\ - s << obj.manip << obj.obj->names[12] << obj.delem;\ - s << obj.manip << obj.obj->names[13]; \ - return s; \ - } \ - template \ - std::ostream& operator << (std::ostream& s, const NAME##_equal_list& obj) { \ - s << obj.obj->names[0] << obj.comp << obj.manip << obj.obj->I1 << obj.delem;\ - s << obj.obj->names[1] << obj.comp << obj.manip << obj.obj->I2 << obj.delem;\ - s << obj.obj->names[2] << obj.comp << obj.manip << obj.obj->I3 << obj.delem;\ - s << obj.obj->names[3] << obj.comp << obj.manip << obj.obj->I4 << obj.delem;\ - s << obj.obj->names[4] << obj.comp << obj.manip << obj.obj->I5 << obj.delem;\ - s << obj.obj->names[5] << obj.comp << obj.manip << obj.obj->I6 << obj.delem;\ - s << obj.obj->names[6] << obj.comp << obj.manip << obj.obj->I7 << obj.delem;\ - s << obj.obj->names[7] << obj.comp << obj.manip << obj.obj->I8 << obj.delem;\ - s << obj.obj->names[8] << obj.comp << obj.manip << obj.obj->I9 << obj.delem;\ - s << obj.obj->names[9] << obj.comp << obj.manip << obj.obj->I10 << obj.delem;\ - s << obj.obj->names[10] << obj.comp << obj.manip << obj.obj->I11 << obj.delem;\ - s << obj.obj->names[11] << obj.comp << obj.manip << obj.obj->I12 << obj.delem;\ - s << obj.obj->names[12] << obj.comp << obj.manip << obj.obj->I13 << obj.delem;\ - s << obj.obj->names[13] << obj.comp << obj.manip << obj.obj->I14; \ - return s; \ - } \ - template \ - std::ostream& operator << (std::ostream& s, const NAME##_cus_value_list& obj) { \ - bool before = false; \ - if ((*obj.include)[0]) { \ - s << obj.manip << obj.obj->I1;\ - before = true; \ - } \ - if ((*obj.include)[1]) { \ - if (before) s << obj.delem;\ - s << obj.manip << obj.obj->I2;\ - before = true; \ - } \ - if ((*obj.include)[2]) { \ - if (before) s << obj.delem;\ - s << obj.manip << obj.obj->I3;\ - before = true; \ - } \ - if ((*obj.include)[3]) { \ - if (before) s << obj.delem;\ - s << obj.manip << obj.obj->I4;\ - before = true; \ - } \ - if ((*obj.include)[4]) { \ - if (before) s << obj.delem;\ - s << obj.manip << obj.obj->I5;\ - before = true; \ - } \ - if ((*obj.include)[5]) { \ - if (before) s << obj.delem;\ - s << obj.manip << obj.obj->I6;\ - before = true; \ - } \ - if ((*obj.include)[6]) { \ - if (before) s << obj.delem;\ - s << obj.manip << obj.obj->I7;\ - before = true; \ - } \ - if ((*obj.include)[7]) { \ - if (before) s << obj.delem;\ - s << obj.manip << obj.obj->I8;\ - before = true; \ - } \ - if ((*obj.include)[8]) { \ - if (before) s << obj.delem;\ - s << obj.manip << obj.obj->I9;\ - before = true; \ - } \ - if ((*obj.include)[9]) { \ - if (before) s << obj.delem;\ - s << obj.manip << obj.obj->I10;\ - before = true; \ - } \ - if ((*obj.include)[10]) { \ - if (before) s << obj.delem;\ - s << obj.manip << obj.obj->I11;\ - before = true; \ - } \ - if ((*obj.include)[11]) { \ - if (before) s << obj.delem;\ - s << obj.manip << obj.obj->I12;\ - before = true; \ - } \ - if ((*obj.include)[12]) { \ - if (before) s << obj.delem;\ - s << obj.manip << obj.obj->I13;\ - before = true; \ - } \ - if ((*obj.include)[13]) { \ - if (before) s << obj.delem;\ - s << obj.manip << obj.obj->I14;\ - } \ - return s; \ - } \ - template \ - std::ostream& operator << (std::ostream& s, const NAME##_cus_field_list& obj) { \ - bool before = false; \ - if ((*obj.include)[0]) { \ - s << obj.manip << obj.obj->names[0];\ - before = true; \ - } \ - if ((*obj.include)[1]) { \ - if (before) s << obj.delem;\ - s << obj.manip << obj.obj->names[1];\ - before = true; \ - } \ - if ((*obj.include)[2]) { \ - if (before) s << obj.delem;\ - s << obj.manip << obj.obj->names[2];\ - before = true; \ - } \ - if ((*obj.include)[3]) { \ - if (before) s << obj.delem;\ - s << obj.manip << obj.obj->names[3];\ - before = true; \ - } \ - if ((*obj.include)[4]) { \ - if (before) s << obj.delem;\ - s << obj.manip << obj.obj->names[4];\ - before = true; \ - } \ - if ((*obj.include)[5]) { \ - if (before) s << obj.delem;\ - s << obj.manip << obj.obj->names[5];\ - before = true; \ - } \ - if ((*obj.include)[6]) { \ - if (before) s << obj.delem;\ - s << obj.manip << obj.obj->names[6];\ - before = true; \ - } \ - if ((*obj.include)[7]) { \ - if (before) s << obj.delem;\ - s << obj.manip << obj.obj->names[7];\ - before = true; \ - } \ - if ((*obj.include)[8]) { \ - if (before) s << obj.delem;\ - s << obj.manip << obj.obj->names[8];\ - before = true; \ - } \ - if ((*obj.include)[9]) { \ - if (before) s << obj.delem;\ - s << obj.manip << obj.obj->names[9];\ - before = true; \ - } \ - if ((*obj.include)[10]) { \ - if (before) s << obj.delem;\ - s << obj.manip << obj.obj->names[10];\ - before = true; \ - } \ - if ((*obj.include)[11]) { \ - if (before) s << obj.delem;\ - s << obj.manip << obj.obj->names[11];\ - before = true; \ - } \ - if ((*obj.include)[12]) { \ - if (before) s << obj.delem;\ - s << obj.manip << obj.obj->names[12];\ - before = true; \ - } \ - if ((*obj.include)[13]) { \ - if (before) s << obj.delem;\ - s << obj.manip << obj.obj->names[13];\ - } \ - return s; \ - } \ - template \ - std::ostream& operator << (std::ostream& s, const NAME##_cus_equal_list& obj) { \ - bool before = false; \ - if ((*obj.include)[0]) { \ - s << obj.obj->names[0] << obj.comp << obj.manip << obj.obj->I1;\ - before = true; \ - } \ - if ((*obj.include)[1]) { \ - if (before) s << obj.delem;\ - s << obj.obj->names[1] << obj.comp << obj.manip << obj.obj->I2;\ - before = true; \ - } \ - if ((*obj.include)[2]) { \ - if (before) s << obj.delem;\ - s << obj.obj->names[2] << obj.comp << obj.manip << obj.obj->I3;\ - before = true; \ - } \ - if ((*obj.include)[3]) { \ - if (before) s << obj.delem;\ - s << obj.obj->names[3] << obj.comp << obj.manip << obj.obj->I4;\ - before = true; \ - } \ - if ((*obj.include)[4]) { \ - if (before) s << obj.delem;\ - s << obj.obj->names[4] << obj.comp << obj.manip << obj.obj->I5;\ - before = true; \ - } \ - if ((*obj.include)[5]) { \ - if (before) s << obj.delem;\ - s << obj.obj->names[5] << obj.comp << obj.manip << obj.obj->I6;\ - before = true; \ - } \ - if ((*obj.include)[6]) { \ - if (before) s << obj.delem;\ - s << obj.obj->names[6] << obj.comp << obj.manip << obj.obj->I7;\ - before = true; \ - } \ - if ((*obj.include)[7]) { \ - if (before) s << obj.delem;\ - s << obj.obj->names[7] << obj.comp << obj.manip << obj.obj->I8;\ - before = true; \ - } \ - if ((*obj.include)[8]) { \ - if (before) s << obj.delem;\ - s << obj.obj->names[8] << obj.comp << obj.manip << obj.obj->I9;\ - before = true; \ - } \ - if ((*obj.include)[9]) { \ - if (before) s << obj.delem;\ - s << obj.obj->names[9] << obj.comp << obj.manip << obj.obj->I10;\ - before = true; \ - } \ - if ((*obj.include)[10]) { \ - if (before) s << obj.delem;\ - s << obj.obj->names[10] << obj.comp << obj.manip << obj.obj->I11;\ - before = true; \ - } \ - if ((*obj.include)[11]) { \ - if (before) s << obj.delem;\ - s << obj.obj->names[11] << obj.comp << obj.manip << obj.obj->I12;\ - before = true; \ - } \ - if ((*obj.include)[12]) { \ - if (before) s << obj.delem;\ - s << obj.obj->names[12] << obj.comp << obj.manip << obj.obj->I13;\ - before = true; \ - } \ - if ((*obj.include)[13]) { \ - if (before) s << obj.delem;\ - s << obj.obj->names[13] << obj.comp << obj.manip << obj.obj->I14;\ - } \ - return s; \ - } \ - template \ - inline NAME##_value_list NAME::value_list(cchar *d, Manip m) const { \ - return NAME##_value_list (this, d, m); \ - } \ - template \ - inline NAME##_field_list NAME::field_list(cchar *d, Manip m) const { \ - return NAME##_field_list (this, d, m); \ - } \ - template \ - inline NAME##_equal_list NAME::equal_list(cchar *d, cchar *c, Manip m) const { \ - return NAME##_equal_list (this, d, c, m); \ - } \ - template \ - inline NAME##_cus_value_list NAME::value_list(cchar *d, Manip m,\ - bool i1, bool i2, bool i3, bool i4, bool i5, bool i6, bool i7, bool i8, bool i9, bool i10, bool i11, bool i12, bool i13, bool i14) const {\ - return NAME##_cus_value_list (this, d, m, i1, i2, i3, i4, i5, i6, i7, i8, i9, i10, i11, i12, i13, i14); \ - } \ - template \ - inline NAME##_cus_field_list NAME::field_list(cchar *d, Manip m,\ - bool i1, bool i2, bool i3, bool i4, bool i5, bool i6, bool i7, bool i8, bool i9, bool i10, bool i11, bool i12, bool i13, bool i14) const { \ - return NAME##_cus_field_list (this, d, m, i1, i2, i3, i4, i5, i6, i7, i8, i9, i10, i11, i12, i13, i14); \ - } \ - template \ - inline NAME##_cus_equal_list NAME::equal_list(cchar *d, cchar *c, Manip m,\ - bool i1, bool i2, bool i3, bool i4, bool i5, bool i6, bool i7, bool i8, bool i9, bool i10, bool i11, bool i12, bool i13, bool i14) const { \ - return NAME##_cus_equal_list (this, d, c, m, i1, i2, i3, i4, i5, i6, i7, i8, i9, i10, i11, i12, i13, i14); \ - } \ - template \ - inline NAME##_cus_value_list NAME::value_list(cchar *d, Manip m,\ - NAME##_enum i1, NAME##_enum i2, NAME##_enum i3, NAME##_enum i4, NAME##_enum i5, NAME##_enum i6, NAME##_enum i7, NAME##_enum i8, NAME##_enum i9, NAME##_enum i10, NAME##_enum i11, NAME##_enum i12, NAME##_enum i13, NAME##_enum i14) const { \ - return NAME##_cus_value_list (this, d, m, i1, i2, i3, i4, i5, i6, i7, i8, i9, i10, i11, i12, i13, i14); \ - } \ - template \ - inline NAME##_cus_field_list NAME::field_list(cchar *d, Manip m,\ - NAME##_enum i1, NAME##_enum i2, NAME##_enum i3, NAME##_enum i4, NAME##_enum i5, NAME##_enum i6, NAME##_enum i7, NAME##_enum i8, NAME##_enum i9, NAME##_enum i10, NAME##_enum i11, NAME##_enum i12, NAME##_enum i13, NAME##_enum i14) const {\ - return NAME##_cus_field_list (this, d, m, i1, i2, i3, i4, i5, i6, i7, i8, i9, i10, i11, i12, i13, i14); \ - } \ - template \ - inline NAME##_cus_equal_list NAME::equal_list(cchar *d, cchar *c, Manip m, \ - NAME##_enum i1, NAME##_enum i2, NAME##_enum i3, NAME##_enum i4, NAME##_enum i5, NAME##_enum i6, NAME##_enum i7, NAME##_enum i8, NAME##_enum i9, NAME##_enum i10, NAME##_enum i11, NAME##_enum i12, NAME##_enum i13, NAME##_enum i14) const { \ - return NAME##_cus_equal_list (this, d, c, m, i1, i2, i3, i4, i5, i6, i7, i8, i9, i10, i11, i12, i13, i14); \ - } \ - template \ - inline NAME##_cus_value_list NAME::value_list(cchar *d, Manip m,\ - std::vector *i) const {\ - return NAME##_cus_value_list (this, d, m, i);\ - }\ - template \ - inline NAME##_cus_field_list NAME::field_list(cchar *d, Manip m,\ - std::vector *i) const {\ - return NAME##_cus_field_list (this, d, m, i);\ - }\ - template \ - inline NAME##_cus_equal_list NAME::equal_list(cchar *d, cchar *c, Manip m,\ - std::vector *i) const {\ - return NAME##_cus_equal_list (this, d, c, m, i);\ - }\ - template \ - inline NAME##_cus_value_list \ - NAME::value_list(cchar *d, Manip m, sql_cmp_type /*sc*/) const {\ - sql_compare_type_def_##CMP (NAME, value, NUM);\ - }\ - template \ - inline NAME##_cus_field_list \ - NAME::field_list(cchar *d, Manip m, sql_cmp_type /*sc*/) const {\ - sql_compare_type_def_##CMP (NAME, field, NUM);\ - }\ - template \ - inline NAME##_cus_equal_list \ - NAME::equal_list(cchar *d, cchar *c, Manip m, sql_cmp_type /*sc*/) const {\ - sql_compare_type_defe_##CMP (NAME, equal, NUM);\ - }\ - template \ - void populate_##NAME (NAME *s, const Row &row) { \ - s->I1 = static_cast(row.at(O1));\ - s->I2 = static_cast(row.at(O2));\ - s->I3 = static_cast(row.at(O3));\ - s->I4 = static_cast(row.at(O4));\ - s->I5 = static_cast(row.at(O5));\ - s->I6 = static_cast(row.at(O6));\ - s->I7 = static_cast(row.at(O7));\ - s->I8 = static_cast(row.at(O8));\ - s->I9 = static_cast(row.at(O9));\ - s->I10 = static_cast(row.at(O10));\ - s->I11 = static_cast(row.at(O11));\ - s->I12 = static_cast(row.at(O12));\ - s->I13 = static_cast(row.at(O13));\ - s->I14 = static_cast(row.at(O14));\ - } \ - inline NAME::NAME (const Row &row) \ - {populate_##NAME(this, row);}\ - inline void NAME::set (const Row &row)\ - {populate_##NAME(this, row);}\ - sql_COMPARE__##CMP(NAME, I1, I2, I3, I4, I5, I6, I7, I8, I9, I10, I11, I12, I13, I14, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ) - -#define sql_create_basic_14(NAME, CMP, CONTR, T1, I1, T2, I2, T3, I3, T4, I4, T5, I5, T6, I6, T7, I7, T8, I8, T9, I9, T10, I10, T11, I11, T12, I12, T13, I13, T14, I14) \ - sql_create_basic_c_order_14(NAME, CMP, CONTR, T1, I1, 0, T2, I2, 1, T3, I3, 2, T4, I4, 3, T5, I5, 4, T6, I6, 5, T7, I7, 6, T8, I8, 7, T9, I9, 8, T10, I10, 9, T11, I11, 10, T12, I12, 11, T13, I13, 12, T14, I14, 13) - -#define sql_create_14(NAME, CMP, CONTR, T1, I1, T2, I2, T3, I3, T4, I4, T5, I5, T6, I6, T7, I7, T8, I8, T9, I9, T10, I10, T11, I11, T12, I12, T13, I13, T14, I14) \ - sql_create_complete_14(NAME, CMP, CONTR, T1, I1, #I1, 0, T2, I2, #I2, 1, T3, I3, #I3, 2, T4, I4, #I4, 3, T5, I5, #I5, 4, T6, I6, #I6, 5, T7, I7, #I7, 6, T8, I8, #I8, 7, T9, I9, #I9, 8, T10, I10, #I10, 9, T11, I11, #I11, 10, T12, I12, #I12, 11, T13, I13, #I13, 12, T14, I14, #I14, 13) \ - -#define sql_create_c_order_14(NAME, CMP, CONTR, T1, I1, O1, T2, I2, O2, T3, I3, O3, T4, I4, O4, T5, I5, O5, T6, I6, O6, T7, I7, O7, T8, I8, O8, T9, I9, O9, T10, I10, O10, T11, I11, O11, T12, I12, O12, T13, I13, O13, T14, I14, O14) \ - sql_create_complete_14(NAME, CMP, CONTR, T1, I1, #I1, O1, T2, I2, #I2, O2, T3, I3, #I3, O3, T4, I4, #I4, O4, T5, I5, #I5, O5, T6, I6, #I6, O6, T7, I7, #I7, O7, T8, I8, #I8, O8, T9, I9, #I9, O9, T10, I10, #I10, O10, T11, I11, #I11, O11, T12, I12, #I12, O12, T13, I13, #I13, O13, T14, I14, #I14, O14) - -#define sql_create_c_names_14(NAME, CMP, CONTR, T1, I1, N1, T2, I2, N2, T3, I3, N3, T4, I4, N4, T5, I5, N5, T6, I6, N6, T7, I7, N7, T8, I8, N8, T9, I9, N9, T10, I10, N10, T11, I11, N11, T12, I12, N12, T13, I13, N13, T14, I14, N14) \ - sql_create_complete_14(NAME, CMP, CONTR, T1, I1, N1, 0, T2, I2, N2, 1, T3, I3, N3, 2, T4, I4, N4, 3, T5, I5, N5, 4, T6, I6, N6, 5, T7, I7, N7, 6, T8, I8, N8, 7, T9, I9, N9, 8, T10, I10, N10, 9, T11, I11, N11, 10, T12, I12, N12, 11, T13, I13, N13, 12, T14, I14, N14, 13) - -// --------------------------------------------------- -// End Create 14 -// --------------------------------------------------- - -// --------------------------------------------------- -// Begin Create 15 -// --------------------------------------------------- -#define sql_create_basic_c_order_15(NAME, CMP, CONTR, T1, I1, O1, T2, I2, O2, T3, I3, O3, T4, I4, O4, T5, I5, O5, T6, I6, O6, T7, I7, O7, T8, I8, O8, T9, I9, O9, T10, I10, O10, T11, I11, O11, T12, I12, O12, T13, I13, O13, T14, I14, O14, T15, I15, O15)\ - struct NAME; \ - template int sql_compare_##NAME (const NAME &, const NAME &);\ - struct NAME { \ - T1 I1;\ - T2 I2;\ - T3 I3;\ - T4 I4;\ - T5 I5;\ - T6 I6;\ - T7 I7;\ - T8 I8;\ - T9 I9;\ - T10 I10;\ - T11 I11;\ - T12 I12;\ - T13 I13;\ - T14 I14;\ - T15 I15; \ - NAME () {} \ - NAME (const Row &row);\ - sql_compare_define_##CMP(NAME, T1, I1, T2, I2, T3, I3, T4, I4, T5, I5, T6, I6, T7, I7, T8, I8, T9, I9, T10, I10, T11, I11, T12, I12, T13, I13, T14, I14, T15, I15, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0)\ - }; \ - template \ - void populate_##NAME (NAME *s, const Row &row) { \ - s->I1 = static_cast(row.at(O1));\ - s->I2 = static_cast(row.at(O2));\ - s->I3 = static_cast(row.at(O3));\ - s->I4 = static_cast(row.at(O4));\ - s->I5 = static_cast(row.at(O5));\ - s->I6 = static_cast(row.at(O6));\ - s->I7 = static_cast(row.at(O7));\ - s->I8 = static_cast(row.at(O8));\ - s->I9 = static_cast(row.at(O9));\ - s->I10 = static_cast(row.at(O10));\ - s->I11 = static_cast(row.at(O11));\ - s->I12 = static_cast(row.at(O12));\ - s->I13 = static_cast(row.at(O13));\ - s->I14 = static_cast(row.at(O14));\ - s->I15 = static_cast(row.at(O15)); \ - } \ - inline NAME::NAME (const Row &row) \ - {populate_##NAME(this, row);} \ - sql_COMPARE__##CMP(NAME, I1, I2, I3, I4, I5, I6, I7, I8, I9, I10, I11, I12, I13, I14, I15, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ) - -#define sql_create_complete_15(NAME, CMP, CONTR, T1, I1, N1, O1, T2, I2, N2, O2, T3, I3, N3, O3, T4, I4, N4, O4, T5, I5, N5, O5, T6, I6, N6, O6, T7, I7, N7, O7, T8, I8, N8, O8, T9, I9, N9, O9, T10, I10, N10, O10, T11, I11, N11, O11, T12, I12, N12, O12, T13, I13, N13, O13, T14, I14, N14, O14, T15, I15, N15, O15) \ - struct NAME; \ - enum NAME##_enum { \ - NAME##_##I1,\ - NAME##_##I2,\ - NAME##_##I3,\ - NAME##_##I4,\ - NAME##_##I5,\ - NAME##_##I6,\ - NAME##_##I7,\ - NAME##_##I8,\ - NAME##_##I9,\ - NAME##_##I10,\ - NAME##_##I11,\ - NAME##_##I12,\ - NAME##_##I13,\ - NAME##_##I14,\ - NAME##_##I15 \ - ,NAME##_NULL \ - }; \ - template \ - class NAME##_value_list { \ - /*friend std::ostream& operator << <> (std::ostream&, const NAME##_value_list&); */\ - public: \ - const NAME *obj;\ - cchar *delem;\ - Manip manip;\ - public: \ - NAME##_value_list (const NAME *o, cchar *d, Manip m) \ - : obj(o), delem(d), manip(m) {} \ - };\ - template \ - class NAME##_##field_list {\ - /* friend std::ostream& operator << <> (std::ostream&, const NAME##_field_list&); */\ - public: \ - const NAME *obj; \ - cchar *delem;\ - Manip manip;\ - public: \ - NAME##_field_list (const NAME *o, cchar *d, Manip m) \ - : obj(o), delem(d), manip(m) {} \ - };\ - template \ - class NAME##_equal_list { \ - /* friend std::ostream& operator << <> (std::ostream&, const NAME##_equal_list&); */\ - public: \ - const NAME *obj;\ - cchar *delem;\ - cchar *comp;\ - Manip manip;\ - public: \ - NAME##_equal_list (const NAME *o, cchar *d, cchar *c, Manip m) \ - : obj(o), delem(d), comp(c), manip(m) {}\ - };\ - template \ - class NAME##_cus_value_list {\ - /* friend std::ostream& operator << <> (std::ostream&, \ - const NAME##_cus_value_list&); */\ - public:\ - const NAME *obj;\ - std::vector *include;\ - bool del_vector;\ - cchar *delem;\ - Manip manip;\ - public: \ - ~NAME##_cus_value_list () {if (del_vector) delete include;} \ - NAME##_cus_value_list (const NAME *o, cchar *d, Manip m, bool i1, bool i2, bool i3, bool i4, bool i5, bool i6, bool i7, bool i8, bool i9, bool i10, bool i11, bool i12, bool i13, bool i14, bool i15);\ - NAME##_cus_value_list (const NAME *o, cchar *d, Manip m, NAME##_enum i1, NAME##_enum i2, NAME##_enum i3, NAME##_enum i4, NAME##_enum i5, NAME##_enum i6, NAME##_enum i7, NAME##_enum i8, NAME##_enum i9, NAME##_enum i10, NAME##_enum i11, NAME##_enum i12, NAME##_enum i13, NAME##_enum i14, NAME##_enum i15); \ - NAME##_cus_value_list (const NAME *o, cchar *d, Manip m ,std::vector* i)\ - : obj(o), include(i), del_vector(false), delem(d), manip(m) {}\ - };\ - template \ - class NAME##_cus_field_list { \ - /* friend std::ostream& operator << <> (std::ostream&, \ - const NAME##_cus_field_list&); */\ - public:\ - const NAME *obj; \ - std::vector *include; \ - bool del_vector; \ - cchar *delem;\ - Manip manip;\ - public: \ - ~NAME##_cus_field_list () {if (del_vector) delete include;} \ - NAME##_cus_field_list (const NAME *o, cchar *d, Manip m, bool i1, bool i2, bool i3, bool i4, bool i5, bool i6, bool i7, bool i8, bool i9, bool i10, bool i11, bool i12, bool i13, bool i14, bool i15); \ - NAME##_cus_field_list (const NAME *o, cchar *d, Manip m, NAME##_enum i1, NAME##_enum i2, NAME##_enum i3, NAME##_enum i4, NAME##_enum i5, NAME##_enum i6, NAME##_enum i7, NAME##_enum i8, NAME##_enum i9, NAME##_enum i10, NAME##_enum i11, NAME##_enum i12, NAME##_enum i13, NAME##_enum i14, NAME##_enum i15); \ - NAME##_cus_field_list (const NAME *o, cchar *d, Manip m, std::vector *i) \ - : obj(o), include(i), del_vector(false), delem(d), manip(m) {}\ - };\ - template \ - class NAME##_cus_equal_list {\ - /* friend std::ostream& operator << <> (std::ostream&, \ - const NAME##_cus_equal_list&); */\ - public:\ - const NAME *obj;\ - std::vector *include;\ - bool del_vector;\ - cchar *delem;\ - cchar *comp;\ - Manip manip;\ - public:\ - ~NAME##_##cus_equal_list () {if (del_vector) delete include;}\ - NAME##_##cus_equal_list (const NAME *o, cchar *d, cchar *c, Manip m, bool i1, bool i2, bool i3, bool i4, bool i5, bool i6, bool i7, bool i8, bool i9, bool i10, bool i11, bool i12, bool i13, bool i14, bool i15); \ - NAME##_##cus_equal_list (const NAME *o, cchar *d, cchar *c, Manip m, NAME##_enum i1, NAME##_enum i2, NAME##_enum i3, NAME##_enum i4, NAME##_enum i5, NAME##_enum i6, NAME##_enum i7, NAME##_enum i8, NAME##_enum i9, NAME##_enum i10, NAME##_enum i11, NAME##_enum i12, NAME##_enum i13, NAME##_enum i14, NAME##_enum i15); \ - NAME##_##cus_equal_list (const NAME *o, cchar *d, cchar *c, Manip m, std::vector *i) \ - : obj(o), include(i), del_vector(false), delem(d), comp(c), manip(m) {}\ - };\ - template int sql_compare_##NAME (const NAME &, const NAME &);\ - struct NAME { \ - T1 I1;\ - T2 I2;\ - T3 I3;\ - T4 I4;\ - T5 I5;\ - T6 I6;\ - T7 I7;\ - T8 I8;\ - T9 I9;\ - T10 I10;\ - T11 I11;\ - T12 I12;\ - T13 I13;\ - T14 I14;\ - T15 I15; \ - NAME () {} \ - NAME (const Row &row);\ - void set (const Row &row);\ - sql_compare_define_##CMP(NAME, T1, I1, T2, I2, T3, I3, T4, I4, T5, I5, T6, I6, T7, I7, T8, I8, T9, I9, T10, I10, T11, I11, T12, I12, T13, I13, T14, I14, T15, I15, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0)\ - sql_construct_define_##CONTR(NAME, T1, I1, T2, I2, T3, I3, T4, I4, T5, I5, T6, I6, T7, I7, T8, I8, T9, I9, T10, I10, T11, I11, T12, I12, T13, I13, T14, I14, T15, I15, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0)\ - static const char *names[];\ - static const char *_table;\ - static const char *& table() {return _table;}\ - NAME##_value_list value_list() const {\ - return value_list(",", quote);}\ - NAME##_value_list value_list(cchar *d) const {\ - return value_list(d, quote);}\ - template \ - NAME##_value_list value_list(cchar *d, Manip m) const; \ - NAME##_field_list field_list() const {\ - return field_list(",", do_nothing);}\ - NAME##_field_list field_list(cchar *d) const {\ - return field_list(d, do_nothing);}\ - template \ - NAME##_field_list field_list(cchar *d, Manip m) const; \ - NAME##_equal_list equal_list(cchar *d = ",", \ - cchar *c = " = ") const{\ - return equal_list(d, c, quote);}\ - template \ - NAME##_equal_list equal_list(cchar *d, cchar *c, Manip m) const; \ - /* cus_data */\ - NAME##_cus_value_list value_list(bool i1, bool i2 = false, bool i3 = false, bool i4 = false, bool i5 = false, bool i6 = false, bool i7 = false, bool i8 = false, bool i9 = false, bool i10 = false, bool i11 = false, bool i12 = false, bool i13 = false, bool i14 = false, bool i15 = false) const {\ - return value_list(",", quote, i1, i2, i3, i4, i5, i6, i7, i8, i9, i10, i11, i12, i13, i14, i15);\ - }\ - NAME##_cus_value_list value_list(NAME##_enum i1, NAME##_enum i2 = NAME##_NULL, NAME##_enum i3 = NAME##_NULL, NAME##_enum i4 = NAME##_NULL, NAME##_enum i5 = NAME##_NULL, NAME##_enum i6 = NAME##_NULL, NAME##_enum i7 = NAME##_NULL, NAME##_enum i8 = NAME##_NULL, NAME##_enum i9 = NAME##_NULL, NAME##_enum i10 = NAME##_NULL, NAME##_enum i11 = NAME##_NULL, NAME##_enum i12 = NAME##_NULL, NAME##_enum i13 = NAME##_NULL, NAME##_enum i14 = NAME##_NULL, NAME##_enum i15 = NAME##_NULL) const {\ - return value_list(",", quote, i1, i2, i3, i4, i5, i6, i7, i8, i9, i10, i11, i12, i13, i14, i15);\ - }\ - NAME##_cus_value_list value_list(std::vector *i) const {\ - return value_list(",", quote, i);\ - }\ - NAME##_cus_value_list value_list(sql_cmp_type sc) const {\ - return value_list(",", quote, sc);\ - }\ - NAME##_cus_value_list value_list(cchar *d, bool i1, bool i2 = false, bool i3 = false, bool i4 = false, bool i5 = false, bool i6 = false, bool i7 = false, bool i8 = false, bool i9 = false, bool i10 = false, bool i11 = false, bool i12 = false, bool i13 = false, bool i14 = false, bool i15 = false) const {\ - return value_list(d, quote, i1, i2, i3, i4, i5, i6, i7, i8, i9, i10, i11, i12, i13, i14, i15);\ - }\ - NAME##_cus_value_list value_list(cchar *d, NAME##_enum i1, NAME##_enum i2 = NAME##_NULL, NAME##_enum i3 = NAME##_NULL, NAME##_enum i4 = NAME##_NULL, NAME##_enum i5 = NAME##_NULL, NAME##_enum i6 = NAME##_NULL, NAME##_enum i7 = NAME##_NULL, NAME##_enum i8 = NAME##_NULL, NAME##_enum i9 = NAME##_NULL, NAME##_enum i10 = NAME##_NULL, NAME##_enum i11 = NAME##_NULL, NAME##_enum i12 = NAME##_NULL, NAME##_enum i13 = NAME##_NULL, NAME##_enum i14 = NAME##_NULL, NAME##_enum i15 = NAME##_NULL) const {\ - return value_list(d, quote, i1, i2, i3, i4, i5, i6, i7, i8, i9, i10, i11, i12, i13, i14, i15);\ - }\ - NAME##_cus_value_list value_list(cchar *d, \ - std::vector *i) const {\ - return value_list(d, quote, i);\ - }\ - NAME##_cus_value_list value_list(cchar *d, \ - sql_cmp_type sc) const {\ - return value_list(d, quote, sc);\ - }\ - template \ - NAME##_cus_value_list value_list(cchar *d, Manip m,\ - bool i1, bool i2 = false, bool i3 = false, bool i4 = false, bool i5 = false, bool i6 = false, bool i7 = false, bool i8 = false, bool i9 = false, bool i10 = false, bool i11 = false, bool i12 = false, bool i13 = false, bool i14 = false, bool i15 = false) const; \ - template \ - NAME##_cus_value_list value_list(cchar *d, Manip m,\ - NAME##_enum i1, NAME##_enum i2 = NAME##_NULL, NAME##_enum i3 = NAME##_NULL, NAME##_enum i4 = NAME##_NULL, NAME##_enum i5 = NAME##_NULL, NAME##_enum i6 = NAME##_NULL, NAME##_enum i7 = NAME##_NULL, NAME##_enum i8 = NAME##_NULL, NAME##_enum i9 = NAME##_NULL, NAME##_enum i10 = NAME##_NULL, NAME##_enum i11 = NAME##_NULL, NAME##_enum i12 = NAME##_NULL, NAME##_enum i13 = NAME##_NULL, NAME##_enum i14 = NAME##_NULL, NAME##_enum i15 = NAME##_NULL) const; \ - template \ - NAME##_cus_value_list value_list(cchar *d, Manip m, \ - std::vector *i) const;\ - template \ - NAME##_cus_value_list value_list(cchar *d, Manip m, \ - sql_cmp_type sc) const;\ - /* cus field */\ - NAME##_cus_field_list field_list(bool i1, bool i2 = false, bool i3 = false, bool i4 = false, bool i5 = false, bool i6 = false, bool i7 = false, bool i8 = false, bool i9 = false, bool i10 = false, bool i11 = false, bool i12 = false, bool i13 = false, bool i14 = false, bool i15 = false) const {\ - return field_list(",", do_nothing, i1, i2, i3, i4, i5, i6, i7, i8, i9, i10, i11, i12, i13, i14, i15);\ - }\ - NAME##_cus_field_list field_list(NAME##_enum i1, NAME##_enum i2 = NAME##_NULL, NAME##_enum i3 = NAME##_NULL, NAME##_enum i4 = NAME##_NULL, NAME##_enum i5 = NAME##_NULL, NAME##_enum i6 = NAME##_NULL, NAME##_enum i7 = NAME##_NULL, NAME##_enum i8 = NAME##_NULL, NAME##_enum i9 = NAME##_NULL, NAME##_enum i10 = NAME##_NULL, NAME##_enum i11 = NAME##_NULL, NAME##_enum i12 = NAME##_NULL, NAME##_enum i13 = NAME##_NULL, NAME##_enum i14 = NAME##_NULL, NAME##_enum i15 = NAME##_NULL) const {\ - return field_list(",", do_nothing, i1, i2, i3, i4, i5, i6, i7, i8, i9, i10, i11, i12, i13, i14, i15);\ - }\ - NAME##_cus_field_list field_list(std::vector *i) const {\ - return field_list(",", do_nothing, i);\ - }\ - NAME##_cus_field_list field_list(sql_cmp_type sc) const\ - {\ - return field_list(",", do_nothing, sc);\ - }\ - NAME##_cus_field_list field_list(cchar *d, \ - bool i1, bool i2 = false, bool i3 = false, bool i4 = false, bool i5 = false, bool i6 = false, bool i7 = false, bool i8 = false, bool i9 = false, bool i10 = false, bool i11 = false, bool i12 = false, bool i13 = false, bool i14 = false, bool i15 = false) const {\ - return field_list(d, do_nothing, i1, i2, i3, i4, i5, i6, i7, i8, i9, i10, i11, i12, i13, i14, i15);\ - }\ - NAME##_cus_field_list field_list(cchar *d,\ - NAME##_enum i1, NAME##_enum i2 = NAME##_NULL, NAME##_enum i3 = NAME##_NULL, NAME##_enum i4 = NAME##_NULL, NAME##_enum i5 = NAME##_NULL, NAME##_enum i6 = NAME##_NULL, NAME##_enum i7 = NAME##_NULL, NAME##_enum i8 = NAME##_NULL, NAME##_enum i9 = NAME##_NULL, NAME##_enum i10 = NAME##_NULL, NAME##_enum i11 = NAME##_NULL, NAME##_enum i12 = NAME##_NULL, NAME##_enum i13 = NAME##_NULL, NAME##_enum i14 = NAME##_NULL, NAME##_enum i15 = NAME##_NULL) const {\ - return field_list(d, do_nothing, i1, i2, i3, i4, i5, i6, i7, i8, i9, i10, i11, i12, i13, i14, i15);\ - }\ - NAME##_cus_field_list field_list(cchar *d, \ - std::vector *i) const {\ - return field_list(d, do_nothing, i);\ - }\ - NAME##_cus_field_list field_list(cchar *d, \ - sql_cmp_type sc) const {\ - return field_list(d, do_nothing, sc);\ - }\ - template \ - NAME##_cus_field_list field_list(cchar *d, Manip m,\ - bool i1, bool i2 = false, bool i3 = false, bool i4 = false, bool i5 = false, bool i6 = false, bool i7 = false, bool i8 = false, bool i9 = false, bool i10 = false, bool i11 = false, bool i12 = false, bool i13 = false, bool i14 = false, bool i15 = false) const; \ - template \ - NAME##_cus_field_list field_list(cchar *d, Manip m,\ - NAME##_enum i1, NAME##_enum i2 = NAME##_NULL, NAME##_enum i3 = NAME##_NULL, NAME##_enum i4 = NAME##_NULL, NAME##_enum i5 = NAME##_NULL, NAME##_enum i6 = NAME##_NULL, NAME##_enum i7 = NAME##_NULL, NAME##_enum i8 = NAME##_NULL, NAME##_enum i9 = NAME##_NULL, NAME##_enum i10 = NAME##_NULL, NAME##_enum i11 = NAME##_NULL, NAME##_enum i12 = NAME##_NULL, NAME##_enum i13 = NAME##_NULL, NAME##_enum i14 = NAME##_NULL, NAME##_enum i15 = NAME##_NULL) const; \ - template \ - NAME##_cus_field_list field_list(cchar *d, Manip m,\ - std::vector *i) const;\ - template \ - NAME##_cus_field_list field_list(cchar *d, Manip m, \ - sql_cmp_type sc) const;\ - /* cus equal */\ - NAME##_cus_equal_list equal_list(bool i1, bool i2 = false, bool i3 = false, bool i4 = false, bool i5 = false, bool i6 = false, bool i7 = false, bool i8 = false, bool i9 = false, bool i10 = false, bool i11 = false, bool i12 = false, bool i13 = false, bool i14 = false, bool i15 = false) const {\ - return equal_list(",", " = ", quote, i1, i2, i3, i4, i5, i6, i7, i8, i9, i10, i11, i12, i13, i14, i15);\ - }\ - NAME##_cus_equal_list equal_list(NAME##_enum i1, NAME##_enum i2 = NAME##_NULL, NAME##_enum i3 = NAME##_NULL, NAME##_enum i4 = NAME##_NULL, NAME##_enum i5 = NAME##_NULL, NAME##_enum i6 = NAME##_NULL, NAME##_enum i7 = NAME##_NULL, NAME##_enum i8 = NAME##_NULL, NAME##_enum i9 = NAME##_NULL, NAME##_enum i10 = NAME##_NULL, NAME##_enum i11 = NAME##_NULL, NAME##_enum i12 = NAME##_NULL, NAME##_enum i13 = NAME##_NULL, NAME##_enum i14 = NAME##_NULL, NAME##_enum i15 = NAME##_NULL) const {\ - return equal_list(",", " = ", quote, i1, i2, i3, i4, i5, i6, i7, i8, i9, i10, i11, i12, i13, i14, i15);\ - }\ - NAME##_cus_equal_list equal_list(std::vector *i) const {\ - return equal_list(",", " = ", quote, i);\ - }\ - NAME##_cus_equal_list equal_list(sql_cmp_type sc) const {\ - return equal_list(",", " = ", quote, sc);\ - }\ - NAME##_cus_equal_list equal_list(cchar *d, bool i1, bool i2 = false, bool i3 = false, bool i4 = false, bool i5 = false, bool i6 = false, bool i7 = false, bool i8 = false, bool i9 = false, bool i10 = false, bool i11 = false, bool i12 = false, bool i13 = false, bool i14 = false, bool i15 = false) const {\ - return equal_list(d, " = ", quote, i1, i2, i3, i4, i5, i6, i7, i8, i9, i10, i11, i12, i13, i14, i15);\ - }\ - NAME##_cus_equal_list equal_list(cchar *d, NAME##_enum i1, NAME##_enum i2 = NAME##_NULL, NAME##_enum i3 = NAME##_NULL, NAME##_enum i4 = NAME##_NULL, NAME##_enum i5 = NAME##_NULL, NAME##_enum i6 = NAME##_NULL, NAME##_enum i7 = NAME##_NULL, NAME##_enum i8 = NAME##_NULL, NAME##_enum i9 = NAME##_NULL, NAME##_enum i10 = NAME##_NULL, NAME##_enum i11 = NAME##_NULL, NAME##_enum i12 = NAME##_NULL, NAME##_enum i13 = NAME##_NULL, NAME##_enum i14 = NAME##_NULL, NAME##_enum i15 = NAME##_NULL) const {\ - return equal_list(d, " = ", quote, i1, i2, i3, i4, i5, i6, i7, i8, i9, i10, i11, i12, i13, i14, i15);\ - }\ - NAME##_cus_equal_list equal_list(cchar *d, \ - std::vector *i) const {\ - return equal_list(d, " = ", quote, i);\ - }\ - NAME##_cus_equal_list equal_list(cchar *d, \ - sql_cmp_type sc) const {\ - return equal_list(d, " = ", quote, sc);\ - }\ - NAME##_cus_equal_list equal_list(cchar *d, cchar *c,\ - bool i1, bool i2 = false, bool i3 = false, bool i4 = false, bool i5 = false, bool i6 = false, bool i7 = false, bool i8 = false, bool i9 = false, bool i10 = false, bool i11 = false, bool i12 = false, bool i13 = false, bool i14 = false, bool i15 = false) const {\ - return equal_list(d, c, quote, i1, i2, i3, i4, i5, i6, i7, i8, i9, i10, i11, i12, i13, i14, i15);\ - }\ - NAME##_cus_equal_list equal_list(cchar *d, cchar *c,\ - NAME##_enum i1, NAME##_enum i2 = NAME##_NULL, NAME##_enum i3 = NAME##_NULL, NAME##_enum i4 = NAME##_NULL, NAME##_enum i5 = NAME##_NULL, NAME##_enum i6 = NAME##_NULL, NAME##_enum i7 = NAME##_NULL, NAME##_enum i8 = NAME##_NULL, NAME##_enum i9 = NAME##_NULL, NAME##_enum i10 = NAME##_NULL, NAME##_enum i11 = NAME##_NULL, NAME##_enum i12 = NAME##_NULL, NAME##_enum i13 = NAME##_NULL, NAME##_enum i14 = NAME##_NULL, NAME##_enum i15 = NAME##_NULL) const {\ - return equal_list(d, c, quote, i1, i2, i3, i4, i5, i6, i7, i8, i9, i10, i11, i12, i13, i14, i15);\ - }\ - NAME##_cus_equal_list equal_list(cchar *d, cchar *c,\ - std::vector *i) const {\ - return equal_list(d, c, quote, i);\ - }\ - NAME##_cus_equal_list equal_list(cchar *d, cchar *c,\ - sql_cmp_type sc) const {\ - return equal_list(d, c, quote, sc);\ - }\ - template \ - NAME##_cus_equal_list equal_list(cchar *d, cchar *c, Manip m, \ - bool i1, bool i2 = false, bool i3 = false, bool i4 = false, bool i5 = false, bool i6 = false, bool i7 = false, bool i8 = false, bool i9 = false, bool i10 = false, bool i11 = false, bool i12 = false, bool i13 = false, bool i14 = false, bool i15 = false) const; \ - template \ - NAME##_cus_equal_list equal_list(cchar *d, cchar *c, Manip m, \ - NAME##_enum i1, NAME##_enum i2 = NAME##_NULL, NAME##_enum i3 = NAME##_NULL, NAME##_enum i4 = NAME##_NULL, NAME##_enum i5 = NAME##_NULL, NAME##_enum i6 = NAME##_NULL, NAME##_enum i7 = NAME##_NULL, NAME##_enum i8 = NAME##_NULL, NAME##_enum i9 = NAME##_NULL, NAME##_enum i10 = NAME##_NULL, NAME##_enum i11 = NAME##_NULL, NAME##_enum i12 = NAME##_NULL, NAME##_enum i13 = NAME##_NULL, NAME##_enum i14 = NAME##_NULL, NAME##_enum i15 = NAME##_NULL) const; \ - template \ - NAME##_cus_equal_list equal_list(cchar *d, cchar *c, Manip m, \ - std::vector *i) const;\ - template \ - NAME##_cus_equal_list equal_list(cchar *d, cchar *c, Manip m, \ - sql_cmp_type sc) const;\ - }; \ - const char *NAME::names[] = { \ - N1 ,\ - N2 ,\ - N3 ,\ - N4 ,\ - N5 ,\ - N6 ,\ - N7 ,\ - N8 ,\ - N9 ,\ - N10 ,\ - N11 ,\ - N12 ,\ - N13 ,\ - N14 ,\ - N15 \ - }; \ - const char *NAME::_table = #NAME ; \ - template \ - NAME##_cus_value_list::NAME##_cus_value_list\ - (const NAME *o, cchar *d, Manip m, bool i1, bool i2, bool i3, bool i4, bool i5, bool i6, bool i7, bool i8, bool i9, bool i10, bool i11, bool i12, bool i13, bool i14, bool i15) \ - { \ - delem = d;\ - manip = m;\ - del_vector = true;\ - obj = o; \ - include = new std::vector(15, false);\ - if (i1) (*include)[0]=true;\ - if (i2) (*include)[1]=true;\ - if (i3) (*include)[2]=true;\ - if (i4) (*include)[3]=true;\ - if (i5) (*include)[4]=true;\ - if (i6) (*include)[5]=true;\ - if (i7) (*include)[6]=true;\ - if (i8) (*include)[7]=true;\ - if (i9) (*include)[8]=true;\ - if (i10) (*include)[9]=true;\ - if (i11) (*include)[10]=true;\ - if (i12) (*include)[11]=true;\ - if (i13) (*include)[12]=true;\ - if (i14) (*include)[13]=true;\ - if (i15) (*include)[14]=true;\ - } \ - template \ - NAME##_cus_value_list::NAME##_cus_value_list\ - (const NAME *o, cchar *d, Manip m, NAME##_enum i1, NAME##_enum i2, NAME##_enum i3, NAME##_enum i4, NAME##_enum i5, NAME##_enum i6, NAME##_enum i7, NAME##_enum i8, NAME##_enum i9, NAME##_enum i10, NAME##_enum i11, NAME##_enum i12, NAME##_enum i13, NAME##_enum i14, NAME##_enum i15) { \ - delem = d;\ - manip = m;\ - del_vector = true; \ - obj = o; \ - include = new std::vector(15, false); \ - if (i1 == NAME##_NULL) return;\ - (*include)[i1]=true;\ - if (i2 == NAME##_NULL) return;\ - (*include)[i2]=true;\ - if (i3 == NAME##_NULL) return;\ - (*include)[i3]=true;\ - if (i4 == NAME##_NULL) return;\ - (*include)[i4]=true;\ - if (i5 == NAME##_NULL) return;\ - (*include)[i5]=true;\ - if (i6 == NAME##_NULL) return;\ - (*include)[i6]=true;\ - if (i7 == NAME##_NULL) return;\ - (*include)[i7]=true;\ - if (i8 == NAME##_NULL) return;\ - (*include)[i8]=true;\ - if (i9 == NAME##_NULL) return;\ - (*include)[i9]=true;\ - if (i10 == NAME##_NULL) return;\ - (*include)[i10]=true;\ - if (i11 == NAME##_NULL) return;\ - (*include)[i11]=true;\ - if (i12 == NAME##_NULL) return;\ - (*include)[i12]=true;\ - if (i13 == NAME##_NULL) return;\ - (*include)[i13]=true;\ - if (i14 == NAME##_NULL) return;\ - (*include)[i14]=true;\ - if (i15 == NAME##_NULL) return;\ - (*include)[i15]=true;\ - }\ - template \ - NAME##_cus_field_list::NAME##_cus_field_list\ - (const NAME *o, cchar *d, Manip m, bool i1, bool i2, bool i3, bool i4, bool i5, bool i6, bool i7, bool i8, bool i9, bool i10, bool i11, bool i12, bool i13, bool i14, bool i15) {\ - delem = d;\ - manip = m;\ - del_vector = true; \ - obj = o; \ - include = new std::vector(15, false); \ - if (i1) (*include)[0]=true;\ - if (i2) (*include)[1]=true;\ - if (i3) (*include)[2]=true;\ - if (i4) (*include)[3]=true;\ - if (i5) (*include)[4]=true;\ - if (i6) (*include)[5]=true;\ - if (i7) (*include)[6]=true;\ - if (i8) (*include)[7]=true;\ - if (i9) (*include)[8]=true;\ - if (i10) (*include)[9]=true;\ - if (i11) (*include)[10]=true;\ - if (i12) (*include)[11]=true;\ - if (i13) (*include)[12]=true;\ - if (i14) (*include)[13]=true;\ - if (i15) (*include)[14]=true;\ - } \ - template \ - NAME##_cus_field_list::NAME##_cus_field_list\ - (const NAME *o, cchar *d, Manip m, NAME##_enum i1, NAME##_enum i2, NAME##_enum i3, NAME##_enum i4, NAME##_enum i5, NAME##_enum i6, NAME##_enum i7, NAME##_enum i8, NAME##_enum i9, NAME##_enum i10, NAME##_enum i11, NAME##_enum i12, NAME##_enum i13, NAME##_enum i14, NAME##_enum i15) { \ - delem = d;\ - manip = m;\ - del_vector = true; \ - obj = o; \ - include = new std::vector(15, false); \ - if (i1 == NAME##_NULL) return;\ - (*include)[i1]=true;\ - if (i2 == NAME##_NULL) return;\ - (*include)[i2]=true;\ - if (i3 == NAME##_NULL) return;\ - (*include)[i3]=true;\ - if (i4 == NAME##_NULL) return;\ - (*include)[i4]=true;\ - if (i5 == NAME##_NULL) return;\ - (*include)[i5]=true;\ - if (i6 == NAME##_NULL) return;\ - (*include)[i6]=true;\ - if (i7 == NAME##_NULL) return;\ - (*include)[i7]=true;\ - if (i8 == NAME##_NULL) return;\ - (*include)[i8]=true;\ - if (i9 == NAME##_NULL) return;\ - (*include)[i9]=true;\ - if (i10 == NAME##_NULL) return;\ - (*include)[i10]=true;\ - if (i11 == NAME##_NULL) return;\ - (*include)[i11]=true;\ - if (i12 == NAME##_NULL) return;\ - (*include)[i12]=true;\ - if (i13 == NAME##_NULL) return;\ - (*include)[i13]=true;\ - if (i14 == NAME##_NULL) return;\ - (*include)[i14]=true;\ - if (i15 == NAME##_NULL) return;\ - (*include)[i15]=true;\ - }\ - template \ - NAME##_cus_equal_list::NAME##_cus_equal_list\ - (const NAME *o, cchar *d, cchar *c, Manip m, bool i1, bool i2, bool i3, bool i4, bool i5, bool i6, bool i7, bool i8, bool i9, bool i10, bool i11, bool i12, bool i13, bool i14, bool i15) { \ - delem = d;\ - comp = c;\ - manip = m;\ - del_vector = true; \ - obj = o; \ - include = new std::vector(15, false); \ - if (i1) (*include)[0]=true;\ - if (i2) (*include)[1]=true;\ - if (i3) (*include)[2]=true;\ - if (i4) (*include)[3]=true;\ - if (i5) (*include)[4]=true;\ - if (i6) (*include)[5]=true;\ - if (i7) (*include)[6]=true;\ - if (i8) (*include)[7]=true;\ - if (i9) (*include)[8]=true;\ - if (i10) (*include)[9]=true;\ - if (i11) (*include)[10]=true;\ - if (i12) (*include)[11]=true;\ - if (i13) (*include)[12]=true;\ - if (i14) (*include)[13]=true;\ - if (i15) (*include)[14]=true;\ - } \ - template \ - NAME##_cus_equal_list::NAME##_cus_equal_list\ - (const NAME *o, cchar *d, cchar *c, Manip m, NAME##_enum i1, NAME##_enum i2, NAME##_enum i3, NAME##_enum i4, NAME##_enum i5, NAME##_enum i6, NAME##_enum i7, NAME##_enum i8, NAME##_enum i9, NAME##_enum i10, NAME##_enum i11, NAME##_enum i12, NAME##_enum i13, NAME##_enum i14, NAME##_enum i15) { \ - delem = d;\ - comp = c;\ - manip = m;\ - del_vector = true; \ - obj = o; \ - include = new std::vector(15, false); \ - if (i1 == NAME##_NULL) return;\ - (*include)[i1]=true;\ - if (i2 == NAME##_NULL) return;\ - (*include)[i2]=true;\ - if (i3 == NAME##_NULL) return;\ - (*include)[i3]=true;\ - if (i4 == NAME##_NULL) return;\ - (*include)[i4]=true;\ - if (i5 == NAME##_NULL) return;\ - (*include)[i5]=true;\ - if (i6 == NAME##_NULL) return;\ - (*include)[i6]=true;\ - if (i7 == NAME##_NULL) return;\ - (*include)[i7]=true;\ - if (i8 == NAME##_NULL) return;\ - (*include)[i8]=true;\ - if (i9 == NAME##_NULL) return;\ - (*include)[i9]=true;\ - if (i10 == NAME##_NULL) return;\ - (*include)[i10]=true;\ - if (i11 == NAME##_NULL) return;\ - (*include)[i11]=true;\ - if (i12 == NAME##_NULL) return;\ - (*include)[i12]=true;\ - if (i13 == NAME##_NULL) return;\ - (*include)[i13]=true;\ - if (i14 == NAME##_NULL) return;\ - (*include)[i14]=true;\ - if (i15 == NAME##_NULL) return;\ - (*include)[i15]=true;\ - }\ - template \ - std::ostream& operator << (std::ostream& s, const NAME##_value_list& obj) { \ - s << obj.manip << obj.obj->I1 << obj.delem;\ - s << obj.manip << obj.obj->I2 << obj.delem;\ - s << obj.manip << obj.obj->I3 << obj.delem;\ - s << obj.manip << obj.obj->I4 << obj.delem;\ - s << obj.manip << obj.obj->I5 << obj.delem;\ - s << obj.manip << obj.obj->I6 << obj.delem;\ - s << obj.manip << obj.obj->I7 << obj.delem;\ - s << obj.manip << obj.obj->I8 << obj.delem;\ - s << obj.manip << obj.obj->I9 << obj.delem;\ - s << obj.manip << obj.obj->I10 << obj.delem;\ - s << obj.manip << obj.obj->I11 << obj.delem;\ - s << obj.manip << obj.obj->I12 << obj.delem;\ - s << obj.manip << obj.obj->I13 << obj.delem;\ - s << obj.manip << obj.obj->I14 << obj.delem;\ - s << obj.manip << obj.obj->I15; \ - return s; \ - } \ - template \ - std::ostream& operator << (std::ostream& s, const NAME##_field_list& obj) { \ - s << obj.manip << obj.obj->names[0] << obj.delem;\ - s << obj.manip << obj.obj->names[1] << obj.delem;\ - s << obj.manip << obj.obj->names[2] << obj.delem;\ - s << obj.manip << obj.obj->names[3] << obj.delem;\ - s << obj.manip << obj.obj->names[4] << obj.delem;\ - s << obj.manip << obj.obj->names[5] << obj.delem;\ - s << obj.manip << obj.obj->names[6] << obj.delem;\ - s << obj.manip << obj.obj->names[7] << obj.delem;\ - s << obj.manip << obj.obj->names[8] << obj.delem;\ - s << obj.manip << obj.obj->names[9] << obj.delem;\ - s << obj.manip << obj.obj->names[10] << obj.delem;\ - s << obj.manip << obj.obj->names[11] << obj.delem;\ - s << obj.manip << obj.obj->names[12] << obj.delem;\ - s << obj.manip << obj.obj->names[13] << obj.delem;\ - s << obj.manip << obj.obj->names[14]; \ - return s; \ - } \ - template \ - std::ostream& operator << (std::ostream& s, const NAME##_equal_list& obj) { \ - s << obj.obj->names[0] << obj.comp << obj.manip << obj.obj->I1 << obj.delem;\ - s << obj.obj->names[1] << obj.comp << obj.manip << obj.obj->I2 << obj.delem;\ - s << obj.obj->names[2] << obj.comp << obj.manip << obj.obj->I3 << obj.delem;\ - s << obj.obj->names[3] << obj.comp << obj.manip << obj.obj->I4 << obj.delem;\ - s << obj.obj->names[4] << obj.comp << obj.manip << obj.obj->I5 << obj.delem;\ - s << obj.obj->names[5] << obj.comp << obj.manip << obj.obj->I6 << obj.delem;\ - s << obj.obj->names[6] << obj.comp << obj.manip << obj.obj->I7 << obj.delem;\ - s << obj.obj->names[7] << obj.comp << obj.manip << obj.obj->I8 << obj.delem;\ - s << obj.obj->names[8] << obj.comp << obj.manip << obj.obj->I9 << obj.delem;\ - s << obj.obj->names[9] << obj.comp << obj.manip << obj.obj->I10 << obj.delem;\ - s << obj.obj->names[10] << obj.comp << obj.manip << obj.obj->I11 << obj.delem;\ - s << obj.obj->names[11] << obj.comp << obj.manip << obj.obj->I12 << obj.delem;\ - s << obj.obj->names[12] << obj.comp << obj.manip << obj.obj->I13 << obj.delem;\ - s << obj.obj->names[13] << obj.comp << obj.manip << obj.obj->I14 << obj.delem;\ - s << obj.obj->names[14] << obj.comp << obj.manip << obj.obj->I15; \ - return s; \ - } \ - template \ - std::ostream& operator << (std::ostream& s, const NAME##_cus_value_list& obj) { \ - bool before = false; \ - if ((*obj.include)[0]) { \ - s << obj.manip << obj.obj->I1;\ - before = true; \ - } \ - if ((*obj.include)[1]) { \ - if (before) s << obj.delem;\ - s << obj.manip << obj.obj->I2;\ - before = true; \ - } \ - if ((*obj.include)[2]) { \ - if (before) s << obj.delem;\ - s << obj.manip << obj.obj->I3;\ - before = true; \ - } \ - if ((*obj.include)[3]) { \ - if (before) s << obj.delem;\ - s << obj.manip << obj.obj->I4;\ - before = true; \ - } \ - if ((*obj.include)[4]) { \ - if (before) s << obj.delem;\ - s << obj.manip << obj.obj->I5;\ - before = true; \ - } \ - if ((*obj.include)[5]) { \ - if (before) s << obj.delem;\ - s << obj.manip << obj.obj->I6;\ - before = true; \ - } \ - if ((*obj.include)[6]) { \ - if (before) s << obj.delem;\ - s << obj.manip << obj.obj->I7;\ - before = true; \ - } \ - if ((*obj.include)[7]) { \ - if (before) s << obj.delem;\ - s << obj.manip << obj.obj->I8;\ - before = true; \ - } \ - if ((*obj.include)[8]) { \ - if (before) s << obj.delem;\ - s << obj.manip << obj.obj->I9;\ - before = true; \ - } \ - if ((*obj.include)[9]) { \ - if (before) s << obj.delem;\ - s << obj.manip << obj.obj->I10;\ - before = true; \ - } \ - if ((*obj.include)[10]) { \ - if (before) s << obj.delem;\ - s << obj.manip << obj.obj->I11;\ - before = true; \ - } \ - if ((*obj.include)[11]) { \ - if (before) s << obj.delem;\ - s << obj.manip << obj.obj->I12;\ - before = true; \ - } \ - if ((*obj.include)[12]) { \ - if (before) s << obj.delem;\ - s << obj.manip << obj.obj->I13;\ - before = true; \ - } \ - if ((*obj.include)[13]) { \ - if (before) s << obj.delem;\ - s << obj.manip << obj.obj->I14;\ - before = true; \ - } \ - if ((*obj.include)[14]) { \ - if (before) s << obj.delem;\ - s << obj.manip << obj.obj->I15;\ - } \ - return s; \ - } \ - template \ - std::ostream& operator << (std::ostream& s, const NAME##_cus_field_list& obj) { \ - bool before = false; \ - if ((*obj.include)[0]) { \ - s << obj.manip << obj.obj->names[0];\ - before = true; \ - } \ - if ((*obj.include)[1]) { \ - if (before) s << obj.delem;\ - s << obj.manip << obj.obj->names[1];\ - before = true; \ - } \ - if ((*obj.include)[2]) { \ - if (before) s << obj.delem;\ - s << obj.manip << obj.obj->names[2];\ - before = true; \ - } \ - if ((*obj.include)[3]) { \ - if (before) s << obj.delem;\ - s << obj.manip << obj.obj->names[3];\ - before = true; \ - } \ - if ((*obj.include)[4]) { \ - if (before) s << obj.delem;\ - s << obj.manip << obj.obj->names[4];\ - before = true; \ - } \ - if ((*obj.include)[5]) { \ - if (before) s << obj.delem;\ - s << obj.manip << obj.obj->names[5];\ - before = true; \ - } \ - if ((*obj.include)[6]) { \ - if (before) s << obj.delem;\ - s << obj.manip << obj.obj->names[6];\ - before = true; \ - } \ - if ((*obj.include)[7]) { \ - if (before) s << obj.delem;\ - s << obj.manip << obj.obj->names[7];\ - before = true; \ - } \ - if ((*obj.include)[8]) { \ - if (before) s << obj.delem;\ - s << obj.manip << obj.obj->names[8];\ - before = true; \ - } \ - if ((*obj.include)[9]) { \ - if (before) s << obj.delem;\ - s << obj.manip << obj.obj->names[9];\ - before = true; \ - } \ - if ((*obj.include)[10]) { \ - if (before) s << obj.delem;\ - s << obj.manip << obj.obj->names[10];\ - before = true; \ - } \ - if ((*obj.include)[11]) { \ - if (before) s << obj.delem;\ - s << obj.manip << obj.obj->names[11];\ - before = true; \ - } \ - if ((*obj.include)[12]) { \ - if (before) s << obj.delem;\ - s << obj.manip << obj.obj->names[12];\ - before = true; \ - } \ - if ((*obj.include)[13]) { \ - if (before) s << obj.delem;\ - s << obj.manip << obj.obj->names[13];\ - before = true; \ - } \ - if ((*obj.include)[14]) { \ - if (before) s << obj.delem;\ - s << obj.manip << obj.obj->names[14];\ - } \ - return s; \ - } \ - template \ - std::ostream& operator << (std::ostream& s, const NAME##_cus_equal_list& obj) { \ - bool before = false; \ - if ((*obj.include)[0]) { \ - s << obj.obj->names[0] << obj.comp << obj.manip << obj.obj->I1;\ - before = true; \ - } \ - if ((*obj.include)[1]) { \ - if (before) s << obj.delem;\ - s << obj.obj->names[1] << obj.comp << obj.manip << obj.obj->I2;\ - before = true; \ - } \ - if ((*obj.include)[2]) { \ - if (before) s << obj.delem;\ - s << obj.obj->names[2] << obj.comp << obj.manip << obj.obj->I3;\ - before = true; \ - } \ - if ((*obj.include)[3]) { \ - if (before) s << obj.delem;\ - s << obj.obj->names[3] << obj.comp << obj.manip << obj.obj->I4;\ - before = true; \ - } \ - if ((*obj.include)[4]) { \ - if (before) s << obj.delem;\ - s << obj.obj->names[4] << obj.comp << obj.manip << obj.obj->I5;\ - before = true; \ - } \ - if ((*obj.include)[5]) { \ - if (before) s << obj.delem;\ - s << obj.obj->names[5] << obj.comp << obj.manip << obj.obj->I6;\ - before = true; \ - } \ - if ((*obj.include)[6]) { \ - if (before) s << obj.delem;\ - s << obj.obj->names[6] << obj.comp << obj.manip << obj.obj->I7;\ - before = true; \ - } \ - if ((*obj.include)[7]) { \ - if (before) s << obj.delem;\ - s << obj.obj->names[7] << obj.comp << obj.manip << obj.obj->I8;\ - before = true; \ - } \ - if ((*obj.include)[8]) { \ - if (before) s << obj.delem;\ - s << obj.obj->names[8] << obj.comp << obj.manip << obj.obj->I9;\ - before = true; \ - } \ - if ((*obj.include)[9]) { \ - if (before) s << obj.delem;\ - s << obj.obj->names[9] << obj.comp << obj.manip << obj.obj->I10;\ - before = true; \ - } \ - if ((*obj.include)[10]) { \ - if (before) s << obj.delem;\ - s << obj.obj->names[10] << obj.comp << obj.manip << obj.obj->I11;\ - before = true; \ - } \ - if ((*obj.include)[11]) { \ - if (before) s << obj.delem;\ - s << obj.obj->names[11] << obj.comp << obj.manip << obj.obj->I12;\ - before = true; \ - } \ - if ((*obj.include)[12]) { \ - if (before) s << obj.delem;\ - s << obj.obj->names[12] << obj.comp << obj.manip << obj.obj->I13;\ - before = true; \ - } \ - if ((*obj.include)[13]) { \ - if (before) s << obj.delem;\ - s << obj.obj->names[13] << obj.comp << obj.manip << obj.obj->I14;\ - before = true; \ - } \ - if ((*obj.include)[14]) { \ - if (before) s << obj.delem;\ - s << obj.obj->names[14] << obj.comp << obj.manip << obj.obj->I15;\ - } \ - return s; \ - } \ - template \ - inline NAME##_value_list NAME::value_list(cchar *d, Manip m) const { \ - return NAME##_value_list (this, d, m); \ - } \ - template \ - inline NAME##_field_list NAME::field_list(cchar *d, Manip m) const { \ - return NAME##_field_list (this, d, m); \ - } \ - template \ - inline NAME##_equal_list NAME::equal_list(cchar *d, cchar *c, Manip m) const { \ - return NAME##_equal_list (this, d, c, m); \ - } \ - template \ - inline NAME##_cus_value_list NAME::value_list(cchar *d, Manip m,\ - bool i1, bool i2, bool i3, bool i4, bool i5, bool i6, bool i7, bool i8, bool i9, bool i10, bool i11, bool i12, bool i13, bool i14, bool i15) const {\ - return NAME##_cus_value_list (this, d, m, i1, i2, i3, i4, i5, i6, i7, i8, i9, i10, i11, i12, i13, i14, i15); \ - } \ - template \ - inline NAME##_cus_field_list NAME::field_list(cchar *d, Manip m,\ - bool i1, bool i2, bool i3, bool i4, bool i5, bool i6, bool i7, bool i8, bool i9, bool i10, bool i11, bool i12, bool i13, bool i14, bool i15) const { \ - return NAME##_cus_field_list (this, d, m, i1, i2, i3, i4, i5, i6, i7, i8, i9, i10, i11, i12, i13, i14, i15); \ - } \ - template \ - inline NAME##_cus_equal_list NAME::equal_list(cchar *d, cchar *c, Manip m,\ - bool i1, bool i2, bool i3, bool i4, bool i5, bool i6, bool i7, bool i8, bool i9, bool i10, bool i11, bool i12, bool i13, bool i14, bool i15) const { \ - return NAME##_cus_equal_list (this, d, c, m, i1, i2, i3, i4, i5, i6, i7, i8, i9, i10, i11, i12, i13, i14, i15); \ - } \ - template \ - inline NAME##_cus_value_list NAME::value_list(cchar *d, Manip m,\ - NAME##_enum i1, NAME##_enum i2, NAME##_enum i3, NAME##_enum i4, NAME##_enum i5, NAME##_enum i6, NAME##_enum i7, NAME##_enum i8, NAME##_enum i9, NAME##_enum i10, NAME##_enum i11, NAME##_enum i12, NAME##_enum i13, NAME##_enum i14, NAME##_enum i15) const { \ - return NAME##_cus_value_list (this, d, m, i1, i2, i3, i4, i5, i6, i7, i8, i9, i10, i11, i12, i13, i14, i15); \ - } \ - template \ - inline NAME##_cus_field_list NAME::field_list(cchar *d, Manip m,\ - NAME##_enum i1, NAME##_enum i2, NAME##_enum i3, NAME##_enum i4, NAME##_enum i5, NAME##_enum i6, NAME##_enum i7, NAME##_enum i8, NAME##_enum i9, NAME##_enum i10, NAME##_enum i11, NAME##_enum i12, NAME##_enum i13, NAME##_enum i14, NAME##_enum i15) const {\ - return NAME##_cus_field_list (this, d, m, i1, i2, i3, i4, i5, i6, i7, i8, i9, i10, i11, i12, i13, i14, i15); \ - } \ - template \ - inline NAME##_cus_equal_list NAME::equal_list(cchar *d, cchar *c, Manip m, \ - NAME##_enum i1, NAME##_enum i2, NAME##_enum i3, NAME##_enum i4, NAME##_enum i5, NAME##_enum i6, NAME##_enum i7, NAME##_enum i8, NAME##_enum i9, NAME##_enum i10, NAME##_enum i11, NAME##_enum i12, NAME##_enum i13, NAME##_enum i14, NAME##_enum i15) const { \ - return NAME##_cus_equal_list (this, d, c, m, i1, i2, i3, i4, i5, i6, i7, i8, i9, i10, i11, i12, i13, i14, i15); \ - } \ - template \ - inline NAME##_cus_value_list NAME::value_list(cchar *d, Manip m,\ - std::vector *i) const {\ - return NAME##_cus_value_list (this, d, m, i);\ - }\ - template \ - inline NAME##_cus_field_list NAME::field_list(cchar *d, Manip m,\ - std::vector *i) const {\ - return NAME##_cus_field_list (this, d, m, i);\ - }\ - template \ - inline NAME##_cus_equal_list NAME::equal_list(cchar *d, cchar *c, Manip m,\ - std::vector *i) const {\ - return NAME##_cus_equal_list (this, d, c, m, i);\ - }\ - template \ - inline NAME##_cus_value_list \ - NAME::value_list(cchar *d, Manip m, sql_cmp_type /*sc*/) const {\ - sql_compare_type_def_##CMP (NAME, value, NUM);\ - }\ - template \ - inline NAME##_cus_field_list \ - NAME::field_list(cchar *d, Manip m, sql_cmp_type /*sc*/) const {\ - sql_compare_type_def_##CMP (NAME, field, NUM);\ - }\ - template \ - inline NAME##_cus_equal_list \ - NAME::equal_list(cchar *d, cchar *c, Manip m, sql_cmp_type /*sc*/) const {\ - sql_compare_type_defe_##CMP (NAME, equal, NUM);\ - }\ - template \ - void populate_##NAME (NAME *s, const Row &row) { \ - s->I1 = static_cast(row.at(O1));\ - s->I2 = static_cast(row.at(O2));\ - s->I3 = static_cast(row.at(O3));\ - s->I4 = static_cast(row.at(O4));\ - s->I5 = static_cast(row.at(O5));\ - s->I6 = static_cast(row.at(O6));\ - s->I7 = static_cast(row.at(O7));\ - s->I8 = static_cast(row.at(O8));\ - s->I9 = static_cast(row.at(O9));\ - s->I10 = static_cast(row.at(O10));\ - s->I11 = static_cast(row.at(O11));\ - s->I12 = static_cast(row.at(O12));\ - s->I13 = static_cast(row.at(O13));\ - s->I14 = static_cast(row.at(O14));\ - s->I15 = static_cast(row.at(O15));\ - } \ - inline NAME::NAME (const Row &row) \ - {populate_##NAME(this, row);}\ - inline void NAME::set (const Row &row)\ - {populate_##NAME(this, row);}\ - sql_COMPARE__##CMP(NAME, I1, I2, I3, I4, I5, I6, I7, I8, I9, I10, I11, I12, I13, I14, I15, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ) - -#define sql_create_basic_15(NAME, CMP, CONTR, T1, I1, T2, I2, T3, I3, T4, I4, T5, I5, T6, I6, T7, I7, T8, I8, T9, I9, T10, I10, T11, I11, T12, I12, T13, I13, T14, I14, T15, I15) \ - sql_create_basic_c_order_15(NAME, CMP, CONTR, T1, I1, 0, T2, I2, 1, T3, I3, 2, T4, I4, 3, T5, I5, 4, T6, I6, 5, T7, I7, 6, T8, I8, 7, T9, I9, 8, T10, I10, 9, T11, I11, 10, T12, I12, 11, T13, I13, 12, T14, I14, 13, T15, I15, 14) - -#define sql_create_15(NAME, CMP, CONTR, T1, I1, T2, I2, T3, I3, T4, I4, T5, I5, T6, I6, T7, I7, T8, I8, T9, I9, T10, I10, T11, I11, T12, I12, T13, I13, T14, I14, T15, I15) \ - sql_create_complete_15(NAME, CMP, CONTR, T1, I1, #I1, 0, T2, I2, #I2, 1, T3, I3, #I3, 2, T4, I4, #I4, 3, T5, I5, #I5, 4, T6, I6, #I6, 5, T7, I7, #I7, 6, T8, I8, #I8, 7, T9, I9, #I9, 8, T10, I10, #I10, 9, T11, I11, #I11, 10, T12, I12, #I12, 11, T13, I13, #I13, 12, T14, I14, #I14, 13, T15, I15, #I15, 14) \ - -#define sql_create_c_order_15(NAME, CMP, CONTR, T1, I1, O1, T2, I2, O2, T3, I3, O3, T4, I4, O4, T5, I5, O5, T6, I6, O6, T7, I7, O7, T8, I8, O8, T9, I9, O9, T10, I10, O10, T11, I11, O11, T12, I12, O12, T13, I13, O13, T14, I14, O14, T15, I15, O15) \ - sql_create_complete_15(NAME, CMP, CONTR, T1, I1, #I1, O1, T2, I2, #I2, O2, T3, I3, #I3, O3, T4, I4, #I4, O4, T5, I5, #I5, O5, T6, I6, #I6, O6, T7, I7, #I7, O7, T8, I8, #I8, O8, T9, I9, #I9, O9, T10, I10, #I10, O10, T11, I11, #I11, O11, T12, I12, #I12, O12, T13, I13, #I13, O13, T14, I14, #I14, O14, T15, I15, #I15, O15) - -#define sql_create_c_names_15(NAME, CMP, CONTR, T1, I1, N1, T2, I2, N2, T3, I3, N3, T4, I4, N4, T5, I5, N5, T6, I6, N6, T7, I7, N7, T8, I8, N8, T9, I9, N9, T10, I10, N10, T11, I11, N11, T12, I12, N12, T13, I13, N13, T14, I14, N14, T15, I15, N15) \ - sql_create_complete_15(NAME, CMP, CONTR, T1, I1, N1, 0, T2, I2, N2, 1, T3, I3, N3, 2, T4, I4, N4, 3, T5, I5, N5, 4, T6, I6, N6, 5, T7, I7, N7, 6, T8, I8, N8, 7, T9, I9, N9, 8, T10, I10, N10, 9, T11, I11, N11, 10, T12, I12, N12, 11, T13, I13, N13, 12, T14, I14, N14, 13, T15, I15, N15, 14) - -// --------------------------------------------------- -// End Create 15 -// --------------------------------------------------- - -// --------------------------------------------------- -// Begin Create 16 -// --------------------------------------------------- -#define sql_create_basic_c_order_16(NAME, CMP, CONTR, T1, I1, O1, T2, I2, O2, T3, I3, O3, T4, I4, O4, T5, I5, O5, T6, I6, O6, T7, I7, O7, T8, I8, O8, T9, I9, O9, T10, I10, O10, T11, I11, O11, T12, I12, O12, T13, I13, O13, T14, I14, O14, T15, I15, O15, T16, I16, O16)\ - struct NAME; \ - template int sql_compare_##NAME (const NAME &, const NAME &);\ - struct NAME { \ - T1 I1;\ - T2 I2;\ - T3 I3;\ - T4 I4;\ - T5 I5;\ - T6 I6;\ - T7 I7;\ - T8 I8;\ - T9 I9;\ - T10 I10;\ - T11 I11;\ - T12 I12;\ - T13 I13;\ - T14 I14;\ - T15 I15;\ - T16 I16; \ - NAME () {} \ - NAME (const Row &row);\ - sql_compare_define_##CMP(NAME, T1, I1, T2, I2, T3, I3, T4, I4, T5, I5, T6, I6, T7, I7, T8, I8, T9, I9, T10, I10, T11, I11, T12, I12, T13, I13, T14, I14, T15, I15, T16, I16, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0)\ - }; \ - template \ - void populate_##NAME (NAME *s, const Row &row) { \ - s->I1 = static_cast(row.at(O1));\ - s->I2 = static_cast(row.at(O2));\ - s->I3 = static_cast(row.at(O3));\ - s->I4 = static_cast(row.at(O4));\ - s->I5 = static_cast(row.at(O5));\ - s->I6 = static_cast(row.at(O6));\ - s->I7 = static_cast(row.at(O7));\ - s->I8 = static_cast(row.at(O8));\ - s->I9 = static_cast(row.at(O9));\ - s->I10 = static_cast(row.at(O10));\ - s->I11 = static_cast(row.at(O11));\ - s->I12 = static_cast(row.at(O12));\ - s->I13 = static_cast(row.at(O13));\ - s->I14 = static_cast(row.at(O14));\ - s->I15 = static_cast(row.at(O15));\ - s->I16 = static_cast(row.at(O16)); \ - } \ - inline NAME::NAME (const Row &row) \ - {populate_##NAME(this, row);} \ - sql_COMPARE__##CMP(NAME, I1, I2, I3, I4, I5, I6, I7, I8, I9, I10, I11, I12, I13, I14, I15, I16, 0, 0, 0, 0, 0, 0, 0, 0, 0 ) - -#define sql_create_complete_16(NAME, CMP, CONTR, T1, I1, N1, O1, T2, I2, N2, O2, T3, I3, N3, O3, T4, I4, N4, O4, T5, I5, N5, O5, T6, I6, N6, O6, T7, I7, N7, O7, T8, I8, N8, O8, T9, I9, N9, O9, T10, I10, N10, O10, T11, I11, N11, O11, T12, I12, N12, O12, T13, I13, N13, O13, T14, I14, N14, O14, T15, I15, N15, O15, T16, I16, N16, O16) \ - struct NAME; \ - enum NAME##_enum { \ - NAME##_##I1,\ - NAME##_##I2,\ - NAME##_##I3,\ - NAME##_##I4,\ - NAME##_##I5,\ - NAME##_##I6,\ - NAME##_##I7,\ - NAME##_##I8,\ - NAME##_##I9,\ - NAME##_##I10,\ - NAME##_##I11,\ - NAME##_##I12,\ - NAME##_##I13,\ - NAME##_##I14,\ - NAME##_##I15,\ - NAME##_##I16 \ - ,NAME##_NULL \ - }; \ - template \ - class NAME##_value_list { \ - /*friend std::ostream& operator << <> (std::ostream&, const NAME##_value_list&); */\ - public: \ - const NAME *obj;\ - cchar *delem;\ - Manip manip;\ - public: \ - NAME##_value_list (const NAME *o, cchar *d, Manip m) \ - : obj(o), delem(d), manip(m) {} \ - };\ - template \ - class NAME##_##field_list {\ - /* friend std::ostream& operator << <> (std::ostream&, const NAME##_field_list&); */\ - public: \ - const NAME *obj; \ - cchar *delem;\ - Manip manip;\ - public: \ - NAME##_field_list (const NAME *o, cchar *d, Manip m) \ - : obj(o), delem(d), manip(m) {} \ - };\ - template \ - class NAME##_equal_list { \ - /* friend std::ostream& operator << <> (std::ostream&, const NAME##_equal_list&); */\ - public: \ - const NAME *obj;\ - cchar *delem;\ - cchar *comp;\ - Manip manip;\ - public: \ - NAME##_equal_list (const NAME *o, cchar *d, cchar *c, Manip m) \ - : obj(o), delem(d), comp(c), manip(m) {}\ - };\ - template \ - class NAME##_cus_value_list {\ - /* friend std::ostream& operator << <> (std::ostream&, \ - const NAME##_cus_value_list&); */\ - public:\ - const NAME *obj;\ - std::vector *include;\ - bool del_vector;\ - cchar *delem;\ - Manip manip;\ - public: \ - ~NAME##_cus_value_list () {if (del_vector) delete include;} \ - NAME##_cus_value_list (const NAME *o, cchar *d, Manip m, bool i1, bool i2, bool i3, bool i4, bool i5, bool i6, bool i7, bool i8, bool i9, bool i10, bool i11, bool i12, bool i13, bool i14, bool i15, bool i16);\ - NAME##_cus_value_list (const NAME *o, cchar *d, Manip m, NAME##_enum i1, NAME##_enum i2, NAME##_enum i3, NAME##_enum i4, NAME##_enum i5, NAME##_enum i6, NAME##_enum i7, NAME##_enum i8, NAME##_enum i9, NAME##_enum i10, NAME##_enum i11, NAME##_enum i12, NAME##_enum i13, NAME##_enum i14, NAME##_enum i15, NAME##_enum i16); \ - NAME##_cus_value_list (const NAME *o, cchar *d, Manip m ,std::vector* i)\ - : obj(o), include(i), del_vector(false), delem(d), manip(m) {}\ - };\ - template \ - class NAME##_cus_field_list { \ - /* friend std::ostream& operator << <> (std::ostream&, \ - const NAME##_cus_field_list&); */\ - public:\ - const NAME *obj; \ - std::vector *include; \ - bool del_vector; \ - cchar *delem;\ - Manip manip;\ - public: \ - ~NAME##_cus_field_list () {if (del_vector) delete include;} \ - NAME##_cus_field_list (const NAME *o, cchar *d, Manip m, bool i1, bool i2, bool i3, bool i4, bool i5, bool i6, bool i7, bool i8, bool i9, bool i10, bool i11, bool i12, bool i13, bool i14, bool i15, bool i16); \ - NAME##_cus_field_list (const NAME *o, cchar *d, Manip m, NAME##_enum i1, NAME##_enum i2, NAME##_enum i3, NAME##_enum i4, NAME##_enum i5, NAME##_enum i6, NAME##_enum i7, NAME##_enum i8, NAME##_enum i9, NAME##_enum i10, NAME##_enum i11, NAME##_enum i12, NAME##_enum i13, NAME##_enum i14, NAME##_enum i15, NAME##_enum i16); \ - NAME##_cus_field_list (const NAME *o, cchar *d, Manip m, std::vector *i) \ - : obj(o), include(i), del_vector(false), delem(d), manip(m) {}\ - };\ - template \ - class NAME##_cus_equal_list {\ - /* friend std::ostream& operator << <> (std::ostream&, \ - const NAME##_cus_equal_list&); */\ - public:\ - const NAME *obj;\ - std::vector *include;\ - bool del_vector;\ - cchar *delem;\ - cchar *comp;\ - Manip manip;\ - public:\ - ~NAME##_##cus_equal_list () {if (del_vector) delete include;}\ - NAME##_##cus_equal_list (const NAME *o, cchar *d, cchar *c, Manip m, bool i1, bool i2, bool i3, bool i4, bool i5, bool i6, bool i7, bool i8, bool i9, bool i10, bool i11, bool i12, bool i13, bool i14, bool i15, bool i16); \ - NAME##_##cus_equal_list (const NAME *o, cchar *d, cchar *c, Manip m, NAME##_enum i1, NAME##_enum i2, NAME##_enum i3, NAME##_enum i4, NAME##_enum i5, NAME##_enum i6, NAME##_enum i7, NAME##_enum i8, NAME##_enum i9, NAME##_enum i10, NAME##_enum i11, NAME##_enum i12, NAME##_enum i13, NAME##_enum i14, NAME##_enum i15, NAME##_enum i16); \ - NAME##_##cus_equal_list (const NAME *o, cchar *d, cchar *c, Manip m, std::vector *i) \ - : obj(o), include(i), del_vector(false), delem(d), comp(c), manip(m) {}\ - };\ - template int sql_compare_##NAME (const NAME &, const NAME &);\ - struct NAME { \ - T1 I1;\ - T2 I2;\ - T3 I3;\ - T4 I4;\ - T5 I5;\ - T6 I6;\ - T7 I7;\ - T8 I8;\ - T9 I9;\ - T10 I10;\ - T11 I11;\ - T12 I12;\ - T13 I13;\ - T14 I14;\ - T15 I15;\ - T16 I16; \ - NAME () {} \ - NAME (const Row &row);\ - void set (const Row &row);\ - sql_compare_define_##CMP(NAME, T1, I1, T2, I2, T3, I3, T4, I4, T5, I5, T6, I6, T7, I7, T8, I8, T9, I9, T10, I10, T11, I11, T12, I12, T13, I13, T14, I14, T15, I15, T16, I16, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0)\ - sql_construct_define_##CONTR(NAME, T1, I1, T2, I2, T3, I3, T4, I4, T5, I5, T6, I6, T7, I7, T8, I8, T9, I9, T10, I10, T11, I11, T12, I12, T13, I13, T14, I14, T15, I15, T16, I16, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0)\ - static const char *names[];\ - static const char *_table;\ - static const char *& table() {return _table;}\ - NAME##_value_list value_list() const {\ - return value_list(",", quote);}\ - NAME##_value_list value_list(cchar *d) const {\ - return value_list(d, quote);}\ - template \ - NAME##_value_list value_list(cchar *d, Manip m) const; \ - NAME##_field_list field_list() const {\ - return field_list(",", do_nothing);}\ - NAME##_field_list field_list(cchar *d) const {\ - return field_list(d, do_nothing);}\ - template \ - NAME##_field_list field_list(cchar *d, Manip m) const; \ - NAME##_equal_list equal_list(cchar *d = ",", \ - cchar *c = " = ") const{\ - return equal_list(d, c, quote);}\ - template \ - NAME##_equal_list equal_list(cchar *d, cchar *c, Manip m) const; \ - /* cus_data */\ - NAME##_cus_value_list value_list(bool i1, bool i2 = false, bool i3 = false, bool i4 = false, bool i5 = false, bool i6 = false, bool i7 = false, bool i8 = false, bool i9 = false, bool i10 = false, bool i11 = false, bool i12 = false, bool i13 = false, bool i14 = false, bool i15 = false, bool i16 = false) const {\ - return value_list(",", quote, i1, i2, i3, i4, i5, i6, i7, i8, i9, i10, i11, i12, i13, i14, i15, i16);\ - }\ - NAME##_cus_value_list value_list(NAME##_enum i1, NAME##_enum i2 = NAME##_NULL, NAME##_enum i3 = NAME##_NULL, NAME##_enum i4 = NAME##_NULL, NAME##_enum i5 = NAME##_NULL, NAME##_enum i6 = NAME##_NULL, NAME##_enum i7 = NAME##_NULL, NAME##_enum i8 = NAME##_NULL, NAME##_enum i9 = NAME##_NULL, NAME##_enum i10 = NAME##_NULL, NAME##_enum i11 = NAME##_NULL, NAME##_enum i12 = NAME##_NULL, NAME##_enum i13 = NAME##_NULL, NAME##_enum i14 = NAME##_NULL, NAME##_enum i15 = NAME##_NULL, NAME##_enum i16 = NAME##_NULL) const {\ - return value_list(",", quote, i1, i2, i3, i4, i5, i6, i7, i8, i9, i10, i11, i12, i13, i14, i15, i16);\ - }\ - NAME##_cus_value_list value_list(std::vector *i) const {\ - return value_list(",", quote, i);\ - }\ - NAME##_cus_value_list value_list(sql_cmp_type sc) const {\ - return value_list(",", quote, sc);\ - }\ - NAME##_cus_value_list value_list(cchar *d, bool i1, bool i2 = false, bool i3 = false, bool i4 = false, bool i5 = false, bool i6 = false, bool i7 = false, bool i8 = false, bool i9 = false, bool i10 = false, bool i11 = false, bool i12 = false, bool i13 = false, bool i14 = false, bool i15 = false, bool i16 = false) const {\ - return value_list(d, quote, i1, i2, i3, i4, i5, i6, i7, i8, i9, i10, i11, i12, i13, i14, i15, i16);\ - }\ - NAME##_cus_value_list value_list(cchar *d, NAME##_enum i1, NAME##_enum i2 = NAME##_NULL, NAME##_enum i3 = NAME##_NULL, NAME##_enum i4 = NAME##_NULL, NAME##_enum i5 = NAME##_NULL, NAME##_enum i6 = NAME##_NULL, NAME##_enum i7 = NAME##_NULL, NAME##_enum i8 = NAME##_NULL, NAME##_enum i9 = NAME##_NULL, NAME##_enum i10 = NAME##_NULL, NAME##_enum i11 = NAME##_NULL, NAME##_enum i12 = NAME##_NULL, NAME##_enum i13 = NAME##_NULL, NAME##_enum i14 = NAME##_NULL, NAME##_enum i15 = NAME##_NULL, NAME##_enum i16 = NAME##_NULL) const {\ - return value_list(d, quote, i1, i2, i3, i4, i5, i6, i7, i8, i9, i10, i11, i12, i13, i14, i15, i16);\ - }\ - NAME##_cus_value_list value_list(cchar *d, \ - std::vector *i) const {\ - return value_list(d, quote, i);\ - }\ - NAME##_cus_value_list value_list(cchar *d, \ - sql_cmp_type sc) const {\ - return value_list(d, quote, sc);\ - }\ - template \ - NAME##_cus_value_list value_list(cchar *d, Manip m,\ - bool i1, bool i2 = false, bool i3 = false, bool i4 = false, bool i5 = false, bool i6 = false, bool i7 = false, bool i8 = false, bool i9 = false, bool i10 = false, bool i11 = false, bool i12 = false, bool i13 = false, bool i14 = false, bool i15 = false, bool i16 = false) const; \ - template \ - NAME##_cus_value_list value_list(cchar *d, Manip m,\ - NAME##_enum i1, NAME##_enum i2 = NAME##_NULL, NAME##_enum i3 = NAME##_NULL, NAME##_enum i4 = NAME##_NULL, NAME##_enum i5 = NAME##_NULL, NAME##_enum i6 = NAME##_NULL, NAME##_enum i7 = NAME##_NULL, NAME##_enum i8 = NAME##_NULL, NAME##_enum i9 = NAME##_NULL, NAME##_enum i10 = NAME##_NULL, NAME##_enum i11 = NAME##_NULL, NAME##_enum i12 = NAME##_NULL, NAME##_enum i13 = NAME##_NULL, NAME##_enum i14 = NAME##_NULL, NAME##_enum i15 = NAME##_NULL, NAME##_enum i16 = NAME##_NULL) const; \ - template \ - NAME##_cus_value_list value_list(cchar *d, Manip m, \ - std::vector *i) const;\ - template \ - NAME##_cus_value_list value_list(cchar *d, Manip m, \ - sql_cmp_type sc) const;\ - /* cus field */\ - NAME##_cus_field_list field_list(bool i1, bool i2 = false, bool i3 = false, bool i4 = false, bool i5 = false, bool i6 = false, bool i7 = false, bool i8 = false, bool i9 = false, bool i10 = false, bool i11 = false, bool i12 = false, bool i13 = false, bool i14 = false, bool i15 = false, bool i16 = false) const {\ - return field_list(",", do_nothing, i1, i2, i3, i4, i5, i6, i7, i8, i9, i10, i11, i12, i13, i14, i15, i16);\ - }\ - NAME##_cus_field_list field_list(NAME##_enum i1, NAME##_enum i2 = NAME##_NULL, NAME##_enum i3 = NAME##_NULL, NAME##_enum i4 = NAME##_NULL, NAME##_enum i5 = NAME##_NULL, NAME##_enum i6 = NAME##_NULL, NAME##_enum i7 = NAME##_NULL, NAME##_enum i8 = NAME##_NULL, NAME##_enum i9 = NAME##_NULL, NAME##_enum i10 = NAME##_NULL, NAME##_enum i11 = NAME##_NULL, NAME##_enum i12 = NAME##_NULL, NAME##_enum i13 = NAME##_NULL, NAME##_enum i14 = NAME##_NULL, NAME##_enum i15 = NAME##_NULL, NAME##_enum i16 = NAME##_NULL) const {\ - return field_list(",", do_nothing, i1, i2, i3, i4, i5, i6, i7, i8, i9, i10, i11, i12, i13, i14, i15, i16);\ - }\ - NAME##_cus_field_list field_list(std::vector *i) const {\ - return field_list(",", do_nothing, i);\ - }\ - NAME##_cus_field_list field_list(sql_cmp_type sc) const\ - {\ - return field_list(",", do_nothing, sc);\ - }\ - NAME##_cus_field_list field_list(cchar *d, \ - bool i1, bool i2 = false, bool i3 = false, bool i4 = false, bool i5 = false, bool i6 = false, bool i7 = false, bool i8 = false, bool i9 = false, bool i10 = false, bool i11 = false, bool i12 = false, bool i13 = false, bool i14 = false, bool i15 = false, bool i16 = false) const {\ - return field_list(d, do_nothing, i1, i2, i3, i4, i5, i6, i7, i8, i9, i10, i11, i12, i13, i14, i15, i16);\ - }\ - NAME##_cus_field_list field_list(cchar *d,\ - NAME##_enum i1, NAME##_enum i2 = NAME##_NULL, NAME##_enum i3 = NAME##_NULL, NAME##_enum i4 = NAME##_NULL, NAME##_enum i5 = NAME##_NULL, NAME##_enum i6 = NAME##_NULL, NAME##_enum i7 = NAME##_NULL, NAME##_enum i8 = NAME##_NULL, NAME##_enum i9 = NAME##_NULL, NAME##_enum i10 = NAME##_NULL, NAME##_enum i11 = NAME##_NULL, NAME##_enum i12 = NAME##_NULL, NAME##_enum i13 = NAME##_NULL, NAME##_enum i14 = NAME##_NULL, NAME##_enum i15 = NAME##_NULL, NAME##_enum i16 = NAME##_NULL) const {\ - return field_list(d, do_nothing, i1, i2, i3, i4, i5, i6, i7, i8, i9, i10, i11, i12, i13, i14, i15, i16);\ - }\ - NAME##_cus_field_list field_list(cchar *d, \ - std::vector *i) const {\ - return field_list(d, do_nothing, i);\ - }\ - NAME##_cus_field_list field_list(cchar *d, \ - sql_cmp_type sc) const {\ - return field_list(d, do_nothing, sc);\ - }\ - template \ - NAME##_cus_field_list field_list(cchar *d, Manip m,\ - bool i1, bool i2 = false, bool i3 = false, bool i4 = false, bool i5 = false, bool i6 = false, bool i7 = false, bool i8 = false, bool i9 = false, bool i10 = false, bool i11 = false, bool i12 = false, bool i13 = false, bool i14 = false, bool i15 = false, bool i16 = false) const; \ - template \ - NAME##_cus_field_list field_list(cchar *d, Manip m,\ - NAME##_enum i1, NAME##_enum i2 = NAME##_NULL, NAME##_enum i3 = NAME##_NULL, NAME##_enum i4 = NAME##_NULL, NAME##_enum i5 = NAME##_NULL, NAME##_enum i6 = NAME##_NULL, NAME##_enum i7 = NAME##_NULL, NAME##_enum i8 = NAME##_NULL, NAME##_enum i9 = NAME##_NULL, NAME##_enum i10 = NAME##_NULL, NAME##_enum i11 = NAME##_NULL, NAME##_enum i12 = NAME##_NULL, NAME##_enum i13 = NAME##_NULL, NAME##_enum i14 = NAME##_NULL, NAME##_enum i15 = NAME##_NULL, NAME##_enum i16 = NAME##_NULL) const; \ - template \ - NAME##_cus_field_list field_list(cchar *d, Manip m,\ - std::vector *i) const;\ - template \ - NAME##_cus_field_list field_list(cchar *d, Manip m, \ - sql_cmp_type sc) const;\ - /* cus equal */\ - NAME##_cus_equal_list equal_list(bool i1, bool i2 = false, bool i3 = false, bool i4 = false, bool i5 = false, bool i6 = false, bool i7 = false, bool i8 = false, bool i9 = false, bool i10 = false, bool i11 = false, bool i12 = false, bool i13 = false, bool i14 = false, bool i15 = false, bool i16 = false) const {\ - return equal_list(",", " = ", quote, i1, i2, i3, i4, i5, i6, i7, i8, i9, i10, i11, i12, i13, i14, i15, i16);\ - }\ - NAME##_cus_equal_list equal_list(NAME##_enum i1, NAME##_enum i2 = NAME##_NULL, NAME##_enum i3 = NAME##_NULL, NAME##_enum i4 = NAME##_NULL, NAME##_enum i5 = NAME##_NULL, NAME##_enum i6 = NAME##_NULL, NAME##_enum i7 = NAME##_NULL, NAME##_enum i8 = NAME##_NULL, NAME##_enum i9 = NAME##_NULL, NAME##_enum i10 = NAME##_NULL, NAME##_enum i11 = NAME##_NULL, NAME##_enum i12 = NAME##_NULL, NAME##_enum i13 = NAME##_NULL, NAME##_enum i14 = NAME##_NULL, NAME##_enum i15 = NAME##_NULL, NAME##_enum i16 = NAME##_NULL) const {\ - return equal_list(",", " = ", quote, i1, i2, i3, i4, i5, i6, i7, i8, i9, i10, i11, i12, i13, i14, i15, i16);\ - }\ - NAME##_cus_equal_list equal_list(std::vector *i) const {\ - return equal_list(",", " = ", quote, i);\ - }\ - NAME##_cus_equal_list equal_list(sql_cmp_type sc) const {\ - return equal_list(",", " = ", quote, sc);\ - }\ - NAME##_cus_equal_list equal_list(cchar *d, bool i1, bool i2 = false, bool i3 = false, bool i4 = false, bool i5 = false, bool i6 = false, bool i7 = false, bool i8 = false, bool i9 = false, bool i10 = false, bool i11 = false, bool i12 = false, bool i13 = false, bool i14 = false, bool i15 = false, bool i16 = false) const {\ - return equal_list(d, " = ", quote, i1, i2, i3, i4, i5, i6, i7, i8, i9, i10, i11, i12, i13, i14, i15, i16);\ - }\ - NAME##_cus_equal_list equal_list(cchar *d, NAME##_enum i1, NAME##_enum i2 = NAME##_NULL, NAME##_enum i3 = NAME##_NULL, NAME##_enum i4 = NAME##_NULL, NAME##_enum i5 = NAME##_NULL, NAME##_enum i6 = NAME##_NULL, NAME##_enum i7 = NAME##_NULL, NAME##_enum i8 = NAME##_NULL, NAME##_enum i9 = NAME##_NULL, NAME##_enum i10 = NAME##_NULL, NAME##_enum i11 = NAME##_NULL, NAME##_enum i12 = NAME##_NULL, NAME##_enum i13 = NAME##_NULL, NAME##_enum i14 = NAME##_NULL, NAME##_enum i15 = NAME##_NULL, NAME##_enum i16 = NAME##_NULL) const {\ - return equal_list(d, " = ", quote, i1, i2, i3, i4, i5, i6, i7, i8, i9, i10, i11, i12, i13, i14, i15, i16);\ - }\ - NAME##_cus_equal_list equal_list(cchar *d, \ - std::vector *i) const {\ - return equal_list(d, " = ", quote, i);\ - }\ - NAME##_cus_equal_list equal_list(cchar *d, \ - sql_cmp_type sc) const {\ - return equal_list(d, " = ", quote, sc);\ - }\ - NAME##_cus_equal_list equal_list(cchar *d, cchar *c,\ - bool i1, bool i2 = false, bool i3 = false, bool i4 = false, bool i5 = false, bool i6 = false, bool i7 = false, bool i8 = false, bool i9 = false, bool i10 = false, bool i11 = false, bool i12 = false, bool i13 = false, bool i14 = false, bool i15 = false, bool i16 = false) const {\ - return equal_list(d, c, quote, i1, i2, i3, i4, i5, i6, i7, i8, i9, i10, i11, i12, i13, i14, i15, i16);\ - }\ - NAME##_cus_equal_list equal_list(cchar *d, cchar *c,\ - NAME##_enum i1, NAME##_enum i2 = NAME##_NULL, NAME##_enum i3 = NAME##_NULL, NAME##_enum i4 = NAME##_NULL, NAME##_enum i5 = NAME##_NULL, NAME##_enum i6 = NAME##_NULL, NAME##_enum i7 = NAME##_NULL, NAME##_enum i8 = NAME##_NULL, NAME##_enum i9 = NAME##_NULL, NAME##_enum i10 = NAME##_NULL, NAME##_enum i11 = NAME##_NULL, NAME##_enum i12 = NAME##_NULL, NAME##_enum i13 = NAME##_NULL, NAME##_enum i14 = NAME##_NULL, NAME##_enum i15 = NAME##_NULL, NAME##_enum i16 = NAME##_NULL) const {\ - return equal_list(d, c, quote, i1, i2, i3, i4, i5, i6, i7, i8, i9, i10, i11, i12, i13, i14, i15, i16);\ - }\ - NAME##_cus_equal_list equal_list(cchar *d, cchar *c,\ - std::vector *i) const {\ - return equal_list(d, c, quote, i);\ - }\ - NAME##_cus_equal_list equal_list(cchar *d, cchar *c,\ - sql_cmp_type sc) const {\ - return equal_list(d, c, quote, sc);\ - }\ - template \ - NAME##_cus_equal_list equal_list(cchar *d, cchar *c, Manip m, \ - bool i1, bool i2 = false, bool i3 = false, bool i4 = false, bool i5 = false, bool i6 = false, bool i7 = false, bool i8 = false, bool i9 = false, bool i10 = false, bool i11 = false, bool i12 = false, bool i13 = false, bool i14 = false, bool i15 = false, bool i16 = false) const; \ - template \ - NAME##_cus_equal_list equal_list(cchar *d, cchar *c, Manip m, \ - NAME##_enum i1, NAME##_enum i2 = NAME##_NULL, NAME##_enum i3 = NAME##_NULL, NAME##_enum i4 = NAME##_NULL, NAME##_enum i5 = NAME##_NULL, NAME##_enum i6 = NAME##_NULL, NAME##_enum i7 = NAME##_NULL, NAME##_enum i8 = NAME##_NULL, NAME##_enum i9 = NAME##_NULL, NAME##_enum i10 = NAME##_NULL, NAME##_enum i11 = NAME##_NULL, NAME##_enum i12 = NAME##_NULL, NAME##_enum i13 = NAME##_NULL, NAME##_enum i14 = NAME##_NULL, NAME##_enum i15 = NAME##_NULL, NAME##_enum i16 = NAME##_NULL) const; \ - template \ - NAME##_cus_equal_list equal_list(cchar *d, cchar *c, Manip m, \ - std::vector *i) const;\ - template \ - NAME##_cus_equal_list equal_list(cchar *d, cchar *c, Manip m, \ - sql_cmp_type sc) const;\ - }; \ - const char *NAME::names[] = { \ - N1 ,\ - N2 ,\ - N3 ,\ - N4 ,\ - N5 ,\ - N6 ,\ - N7 ,\ - N8 ,\ - N9 ,\ - N10 ,\ - N11 ,\ - N12 ,\ - N13 ,\ - N14 ,\ - N15 ,\ - N16 \ - }; \ - const char *NAME::_table = #NAME ; \ - template \ - NAME##_cus_value_list::NAME##_cus_value_list\ - (const NAME *o, cchar *d, Manip m, bool i1, bool i2, bool i3, bool i4, bool i5, bool i6, bool i7, bool i8, bool i9, bool i10, bool i11, bool i12, bool i13, bool i14, bool i15, bool i16) \ - { \ - delem = d;\ - manip = m;\ - del_vector = true;\ - obj = o; \ - include = new std::vector(16, false);\ - if (i1) (*include)[0]=true;\ - if (i2) (*include)[1]=true;\ - if (i3) (*include)[2]=true;\ - if (i4) (*include)[3]=true;\ - if (i5) (*include)[4]=true;\ - if (i6) (*include)[5]=true;\ - if (i7) (*include)[6]=true;\ - if (i8) (*include)[7]=true;\ - if (i9) (*include)[8]=true;\ - if (i10) (*include)[9]=true;\ - if (i11) (*include)[10]=true;\ - if (i12) (*include)[11]=true;\ - if (i13) (*include)[12]=true;\ - if (i14) (*include)[13]=true;\ - if (i15) (*include)[14]=true;\ - if (i16) (*include)[15]=true;\ - } \ - template \ - NAME##_cus_value_list::NAME##_cus_value_list\ - (const NAME *o, cchar *d, Manip m, NAME##_enum i1, NAME##_enum i2, NAME##_enum i3, NAME##_enum i4, NAME##_enum i5, NAME##_enum i6, NAME##_enum i7, NAME##_enum i8, NAME##_enum i9, NAME##_enum i10, NAME##_enum i11, NAME##_enum i12, NAME##_enum i13, NAME##_enum i14, NAME##_enum i15, NAME##_enum i16) { \ - delem = d;\ - manip = m;\ - del_vector = true; \ - obj = o; \ - include = new std::vector(16, false); \ - if (i1 == NAME##_NULL) return;\ - (*include)[i1]=true;\ - if (i2 == NAME##_NULL) return;\ - (*include)[i2]=true;\ - if (i3 == NAME##_NULL) return;\ - (*include)[i3]=true;\ - if (i4 == NAME##_NULL) return;\ - (*include)[i4]=true;\ - if (i5 == NAME##_NULL) return;\ - (*include)[i5]=true;\ - if (i6 == NAME##_NULL) return;\ - (*include)[i6]=true;\ - if (i7 == NAME##_NULL) return;\ - (*include)[i7]=true;\ - if (i8 == NAME##_NULL) return;\ - (*include)[i8]=true;\ - if (i9 == NAME##_NULL) return;\ - (*include)[i9]=true;\ - if (i10 == NAME##_NULL) return;\ - (*include)[i10]=true;\ - if (i11 == NAME##_NULL) return;\ - (*include)[i11]=true;\ - if (i12 == NAME##_NULL) return;\ - (*include)[i12]=true;\ - if (i13 == NAME##_NULL) return;\ - (*include)[i13]=true;\ - if (i14 == NAME##_NULL) return;\ - (*include)[i14]=true;\ - if (i15 == NAME##_NULL) return;\ - (*include)[i15]=true;\ - if (i16 == NAME##_NULL) return;\ - (*include)[i16]=true;\ - }\ - template \ - NAME##_cus_field_list::NAME##_cus_field_list\ - (const NAME *o, cchar *d, Manip m, bool i1, bool i2, bool i3, bool i4, bool i5, bool i6, bool i7, bool i8, bool i9, bool i10, bool i11, bool i12, bool i13, bool i14, bool i15, bool i16) {\ - delem = d;\ - manip = m;\ - del_vector = true; \ - obj = o; \ - include = new std::vector(16, false); \ - if (i1) (*include)[0]=true;\ - if (i2) (*include)[1]=true;\ - if (i3) (*include)[2]=true;\ - if (i4) (*include)[3]=true;\ - if (i5) (*include)[4]=true;\ - if (i6) (*include)[5]=true;\ - if (i7) (*include)[6]=true;\ - if (i8) (*include)[7]=true;\ - if (i9) (*include)[8]=true;\ - if (i10) (*include)[9]=true;\ - if (i11) (*include)[10]=true;\ - if (i12) (*include)[11]=true;\ - if (i13) (*include)[12]=true;\ - if (i14) (*include)[13]=true;\ - if (i15) (*include)[14]=true;\ - if (i16) (*include)[15]=true;\ - } \ - template \ - NAME##_cus_field_list::NAME##_cus_field_list\ - (const NAME *o, cchar *d, Manip m, NAME##_enum i1, NAME##_enum i2, NAME##_enum i3, NAME##_enum i4, NAME##_enum i5, NAME##_enum i6, NAME##_enum i7, NAME##_enum i8, NAME##_enum i9, NAME##_enum i10, NAME##_enum i11, NAME##_enum i12, NAME##_enum i13, NAME##_enum i14, NAME##_enum i15, NAME##_enum i16) { \ - delem = d;\ - manip = m;\ - del_vector = true; \ - obj = o; \ - include = new std::vector(16, false); \ - if (i1 == NAME##_NULL) return;\ - (*include)[i1]=true;\ - if (i2 == NAME##_NULL) return;\ - (*include)[i2]=true;\ - if (i3 == NAME##_NULL) return;\ - (*include)[i3]=true;\ - if (i4 == NAME##_NULL) return;\ - (*include)[i4]=true;\ - if (i5 == NAME##_NULL) return;\ - (*include)[i5]=true;\ - if (i6 == NAME##_NULL) return;\ - (*include)[i6]=true;\ - if (i7 == NAME##_NULL) return;\ - (*include)[i7]=true;\ - if (i8 == NAME##_NULL) return;\ - (*include)[i8]=true;\ - if (i9 == NAME##_NULL) return;\ - (*include)[i9]=true;\ - if (i10 == NAME##_NULL) return;\ - (*include)[i10]=true;\ - if (i11 == NAME##_NULL) return;\ - (*include)[i11]=true;\ - if (i12 == NAME##_NULL) return;\ - (*include)[i12]=true;\ - if (i13 == NAME##_NULL) return;\ - (*include)[i13]=true;\ - if (i14 == NAME##_NULL) return;\ - (*include)[i14]=true;\ - if (i15 == NAME##_NULL) return;\ - (*include)[i15]=true;\ - if (i16 == NAME##_NULL) return;\ - (*include)[i16]=true;\ - }\ - template \ - NAME##_cus_equal_list::NAME##_cus_equal_list\ - (const NAME *o, cchar *d, cchar *c, Manip m, bool i1, bool i2, bool i3, bool i4, bool i5, bool i6, bool i7, bool i8, bool i9, bool i10, bool i11, bool i12, bool i13, bool i14, bool i15, bool i16) { \ - delem = d;\ - comp = c;\ - manip = m;\ - del_vector = true; \ - obj = o; \ - include = new std::vector(16, false); \ - if (i1) (*include)[0]=true;\ - if (i2) (*include)[1]=true;\ - if (i3) (*include)[2]=true;\ - if (i4) (*include)[3]=true;\ - if (i5) (*include)[4]=true;\ - if (i6) (*include)[5]=true;\ - if (i7) (*include)[6]=true;\ - if (i8) (*include)[7]=true;\ - if (i9) (*include)[8]=true;\ - if (i10) (*include)[9]=true;\ - if (i11) (*include)[10]=true;\ - if (i12) (*include)[11]=true;\ - if (i13) (*include)[12]=true;\ - if (i14) (*include)[13]=true;\ - if (i15) (*include)[14]=true;\ - if (i16) (*include)[15]=true;\ - } \ - template \ - NAME##_cus_equal_list::NAME##_cus_equal_list\ - (const NAME *o, cchar *d, cchar *c, Manip m, NAME##_enum i1, NAME##_enum i2, NAME##_enum i3, NAME##_enum i4, NAME##_enum i5, NAME##_enum i6, NAME##_enum i7, NAME##_enum i8, NAME##_enum i9, NAME##_enum i10, NAME##_enum i11, NAME##_enum i12, NAME##_enum i13, NAME##_enum i14, NAME##_enum i15, NAME##_enum i16) { \ - delem = d;\ - comp = c;\ - manip = m;\ - del_vector = true; \ - obj = o; \ - include = new std::vector(16, false); \ - if (i1 == NAME##_NULL) return;\ - (*include)[i1]=true;\ - if (i2 == NAME##_NULL) return;\ - (*include)[i2]=true;\ - if (i3 == NAME##_NULL) return;\ - (*include)[i3]=true;\ - if (i4 == NAME##_NULL) return;\ - (*include)[i4]=true;\ - if (i5 == NAME##_NULL) return;\ - (*include)[i5]=true;\ - if (i6 == NAME##_NULL) return;\ - (*include)[i6]=true;\ - if (i7 == NAME##_NULL) return;\ - (*include)[i7]=true;\ - if (i8 == NAME##_NULL) return;\ - (*include)[i8]=true;\ - if (i9 == NAME##_NULL) return;\ - (*include)[i9]=true;\ - if (i10 == NAME##_NULL) return;\ - (*include)[i10]=true;\ - if (i11 == NAME##_NULL) return;\ - (*include)[i11]=true;\ - if (i12 == NAME##_NULL) return;\ - (*include)[i12]=true;\ - if (i13 == NAME##_NULL) return;\ - (*include)[i13]=true;\ - if (i14 == NAME##_NULL) return;\ - (*include)[i14]=true;\ - if (i15 == NAME##_NULL) return;\ - (*include)[i15]=true;\ - if (i16 == NAME##_NULL) return;\ - (*include)[i16]=true;\ - }\ - template \ - std::ostream& operator << (std::ostream& s, const NAME##_value_list& obj) { \ - s << obj.manip << obj.obj->I1 << obj.delem;\ - s << obj.manip << obj.obj->I2 << obj.delem;\ - s << obj.manip << obj.obj->I3 << obj.delem;\ - s << obj.manip << obj.obj->I4 << obj.delem;\ - s << obj.manip << obj.obj->I5 << obj.delem;\ - s << obj.manip << obj.obj->I6 << obj.delem;\ - s << obj.manip << obj.obj->I7 << obj.delem;\ - s << obj.manip << obj.obj->I8 << obj.delem;\ - s << obj.manip << obj.obj->I9 << obj.delem;\ - s << obj.manip << obj.obj->I10 << obj.delem;\ - s << obj.manip << obj.obj->I11 << obj.delem;\ - s << obj.manip << obj.obj->I12 << obj.delem;\ - s << obj.manip << obj.obj->I13 << obj.delem;\ - s << obj.manip << obj.obj->I14 << obj.delem;\ - s << obj.manip << obj.obj->I15 << obj.delem;\ - s << obj.manip << obj.obj->I16; \ - return s; \ - } \ - template \ - std::ostream& operator << (std::ostream& s, const NAME##_field_list& obj) { \ - s << obj.manip << obj.obj->names[0] << obj.delem;\ - s << obj.manip << obj.obj->names[1] << obj.delem;\ - s << obj.manip << obj.obj->names[2] << obj.delem;\ - s << obj.manip << obj.obj->names[3] << obj.delem;\ - s << obj.manip << obj.obj->names[4] << obj.delem;\ - s << obj.manip << obj.obj->names[5] << obj.delem;\ - s << obj.manip << obj.obj->names[6] << obj.delem;\ - s << obj.manip << obj.obj->names[7] << obj.delem;\ - s << obj.manip << obj.obj->names[8] << obj.delem;\ - s << obj.manip << obj.obj->names[9] << obj.delem;\ - s << obj.manip << obj.obj->names[10] << obj.delem;\ - s << obj.manip << obj.obj->names[11] << obj.delem;\ - s << obj.manip << obj.obj->names[12] << obj.delem;\ - s << obj.manip << obj.obj->names[13] << obj.delem;\ - s << obj.manip << obj.obj->names[14] << obj.delem;\ - s << obj.manip << obj.obj->names[15]; \ - return s; \ - } \ - template \ - std::ostream& operator << (std::ostream& s, const NAME##_equal_list& obj) { \ - s << obj.obj->names[0] << obj.comp << obj.manip << obj.obj->I1 << obj.delem;\ - s << obj.obj->names[1] << obj.comp << obj.manip << obj.obj->I2 << obj.delem;\ - s << obj.obj->names[2] << obj.comp << obj.manip << obj.obj->I3 << obj.delem;\ - s << obj.obj->names[3] << obj.comp << obj.manip << obj.obj->I4 << obj.delem;\ - s << obj.obj->names[4] << obj.comp << obj.manip << obj.obj->I5 << obj.delem;\ - s << obj.obj->names[5] << obj.comp << obj.manip << obj.obj->I6 << obj.delem;\ - s << obj.obj->names[6] << obj.comp << obj.manip << obj.obj->I7 << obj.delem;\ - s << obj.obj->names[7] << obj.comp << obj.manip << obj.obj->I8 << obj.delem;\ - s << obj.obj->names[8] << obj.comp << obj.manip << obj.obj->I9 << obj.delem;\ - s << obj.obj->names[9] << obj.comp << obj.manip << obj.obj->I10 << obj.delem;\ - s << obj.obj->names[10] << obj.comp << obj.manip << obj.obj->I11 << obj.delem;\ - s << obj.obj->names[11] << obj.comp << obj.manip << obj.obj->I12 << obj.delem;\ - s << obj.obj->names[12] << obj.comp << obj.manip << obj.obj->I13 << obj.delem;\ - s << obj.obj->names[13] << obj.comp << obj.manip << obj.obj->I14 << obj.delem;\ - s << obj.obj->names[14] << obj.comp << obj.manip << obj.obj->I15 << obj.delem;\ - s << obj.obj->names[15] << obj.comp << obj.manip << obj.obj->I16; \ - return s; \ - } \ - template \ - std::ostream& operator << (std::ostream& s, const NAME##_cus_value_list& obj) { \ - bool before = false; \ - if ((*obj.include)[0]) { \ - s << obj.manip << obj.obj->I1;\ - before = true; \ - } \ - if ((*obj.include)[1]) { \ - if (before) s << obj.delem;\ - s << obj.manip << obj.obj->I2;\ - before = true; \ - } \ - if ((*obj.include)[2]) { \ - if (before) s << obj.delem;\ - s << obj.manip << obj.obj->I3;\ - before = true; \ - } \ - if ((*obj.include)[3]) { \ - if (before) s << obj.delem;\ - s << obj.manip << obj.obj->I4;\ - before = true; \ - } \ - if ((*obj.include)[4]) { \ - if (before) s << obj.delem;\ - s << obj.manip << obj.obj->I5;\ - before = true; \ - } \ - if ((*obj.include)[5]) { \ - if (before) s << obj.delem;\ - s << obj.manip << obj.obj->I6;\ - before = true; \ - } \ - if ((*obj.include)[6]) { \ - if (before) s << obj.delem;\ - s << obj.manip << obj.obj->I7;\ - before = true; \ - } \ - if ((*obj.include)[7]) { \ - if (before) s << obj.delem;\ - s << obj.manip << obj.obj->I8;\ - before = true; \ - } \ - if ((*obj.include)[8]) { \ - if (before) s << obj.delem;\ - s << obj.manip << obj.obj->I9;\ - before = true; \ - } \ - if ((*obj.include)[9]) { \ - if (before) s << obj.delem;\ - s << obj.manip << obj.obj->I10;\ - before = true; \ - } \ - if ((*obj.include)[10]) { \ - if (before) s << obj.delem;\ - s << obj.manip << obj.obj->I11;\ - before = true; \ - } \ - if ((*obj.include)[11]) { \ - if (before) s << obj.delem;\ - s << obj.manip << obj.obj->I12;\ - before = true; \ - } \ - if ((*obj.include)[12]) { \ - if (before) s << obj.delem;\ - s << obj.manip << obj.obj->I13;\ - before = true; \ - } \ - if ((*obj.include)[13]) { \ - if (before) s << obj.delem;\ - s << obj.manip << obj.obj->I14;\ - before = true; \ - } \ - if ((*obj.include)[14]) { \ - if (before) s << obj.delem;\ - s << obj.manip << obj.obj->I15;\ - before = true; \ - } \ - if ((*obj.include)[15]) { \ - if (before) s << obj.delem;\ - s << obj.manip << obj.obj->I16;\ - } \ - return s; \ - } \ - template \ - std::ostream& operator << (std::ostream& s, const NAME##_cus_field_list& obj) { \ - bool before = false; \ - if ((*obj.include)[0]) { \ - s << obj.manip << obj.obj->names[0];\ - before = true; \ - } \ - if ((*obj.include)[1]) { \ - if (before) s << obj.delem;\ - s << obj.manip << obj.obj->names[1];\ - before = true; \ - } \ - if ((*obj.include)[2]) { \ - if (before) s << obj.delem;\ - s << obj.manip << obj.obj->names[2];\ - before = true; \ - } \ - if ((*obj.include)[3]) { \ - if (before) s << obj.delem;\ - s << obj.manip << obj.obj->names[3];\ - before = true; \ - } \ - if ((*obj.include)[4]) { \ - if (before) s << obj.delem;\ - s << obj.manip << obj.obj->names[4];\ - before = true; \ - } \ - if ((*obj.include)[5]) { \ - if (before) s << obj.delem;\ - s << obj.manip << obj.obj->names[5];\ - before = true; \ - } \ - if ((*obj.include)[6]) { \ - if (before) s << obj.delem;\ - s << obj.manip << obj.obj->names[6];\ - before = true; \ - } \ - if ((*obj.include)[7]) { \ - if (before) s << obj.delem;\ - s << obj.manip << obj.obj->names[7];\ - before = true; \ - } \ - if ((*obj.include)[8]) { \ - if (before) s << obj.delem;\ - s << obj.manip << obj.obj->names[8];\ - before = true; \ - } \ - if ((*obj.include)[9]) { \ - if (before) s << obj.delem;\ - s << obj.manip << obj.obj->names[9];\ - before = true; \ - } \ - if ((*obj.include)[10]) { \ - if (before) s << obj.delem;\ - s << obj.manip << obj.obj->names[10];\ - before = true; \ - } \ - if ((*obj.include)[11]) { \ - if (before) s << obj.delem;\ - s << obj.manip << obj.obj->names[11];\ - before = true; \ - } \ - if ((*obj.include)[12]) { \ - if (before) s << obj.delem;\ - s << obj.manip << obj.obj->names[12];\ - before = true; \ - } \ - if ((*obj.include)[13]) { \ - if (before) s << obj.delem;\ - s << obj.manip << obj.obj->names[13];\ - before = true; \ - } \ - if ((*obj.include)[14]) { \ - if (before) s << obj.delem;\ - s << obj.manip << obj.obj->names[14];\ - before = true; \ - } \ - if ((*obj.include)[15]) { \ - if (before) s << obj.delem;\ - s << obj.manip << obj.obj->names[15];\ - } \ - return s; \ - } \ - template \ - std::ostream& operator << (std::ostream& s, const NAME##_cus_equal_list& obj) { \ - bool before = false; \ - if ((*obj.include)[0]) { \ - s << obj.obj->names[0] << obj.comp << obj.manip << obj.obj->I1;\ - before = true; \ - } \ - if ((*obj.include)[1]) { \ - if (before) s << obj.delem;\ - s << obj.obj->names[1] << obj.comp << obj.manip << obj.obj->I2;\ - before = true; \ - } \ - if ((*obj.include)[2]) { \ - if (before) s << obj.delem;\ - s << obj.obj->names[2] << obj.comp << obj.manip << obj.obj->I3;\ - before = true; \ - } \ - if ((*obj.include)[3]) { \ - if (before) s << obj.delem;\ - s << obj.obj->names[3] << obj.comp << obj.manip << obj.obj->I4;\ - before = true; \ - } \ - if ((*obj.include)[4]) { \ - if (before) s << obj.delem;\ - s << obj.obj->names[4] << obj.comp << obj.manip << obj.obj->I5;\ - before = true; \ - } \ - if ((*obj.include)[5]) { \ - if (before) s << obj.delem;\ - s << obj.obj->names[5] << obj.comp << obj.manip << obj.obj->I6;\ - before = true; \ - } \ - if ((*obj.include)[6]) { \ - if (before) s << obj.delem;\ - s << obj.obj->names[6] << obj.comp << obj.manip << obj.obj->I7;\ - before = true; \ - } \ - if ((*obj.include)[7]) { \ - if (before) s << obj.delem;\ - s << obj.obj->names[7] << obj.comp << obj.manip << obj.obj->I8;\ - before = true; \ - } \ - if ((*obj.include)[8]) { \ - if (before) s << obj.delem;\ - s << obj.obj->names[8] << obj.comp << obj.manip << obj.obj->I9;\ - before = true; \ - } \ - if ((*obj.include)[9]) { \ - if (before) s << obj.delem;\ - s << obj.obj->names[9] << obj.comp << obj.manip << obj.obj->I10;\ - before = true; \ - } \ - if ((*obj.include)[10]) { \ - if (before) s << obj.delem;\ - s << obj.obj->names[10] << obj.comp << obj.manip << obj.obj->I11;\ - before = true; \ - } \ - if ((*obj.include)[11]) { \ - if (before) s << obj.delem;\ - s << obj.obj->names[11] << obj.comp << obj.manip << obj.obj->I12;\ - before = true; \ - } \ - if ((*obj.include)[12]) { \ - if (before) s << obj.delem;\ - s << obj.obj->names[12] << obj.comp << obj.manip << obj.obj->I13;\ - before = true; \ - } \ - if ((*obj.include)[13]) { \ - if (before) s << obj.delem;\ - s << obj.obj->names[13] << obj.comp << obj.manip << obj.obj->I14;\ - before = true; \ - } \ - if ((*obj.include)[14]) { \ - if (before) s << obj.delem;\ - s << obj.obj->names[14] << obj.comp << obj.manip << obj.obj->I15;\ - before = true; \ - } \ - if ((*obj.include)[15]) { \ - if (before) s << obj.delem;\ - s << obj.obj->names[15] << obj.comp << obj.manip << obj.obj->I16;\ - } \ - return s; \ - } \ - template \ - inline NAME##_value_list NAME::value_list(cchar *d, Manip m) const { \ - return NAME##_value_list (this, d, m); \ - } \ - template \ - inline NAME##_field_list NAME::field_list(cchar *d, Manip m) const { \ - return NAME##_field_list (this, d, m); \ - } \ - template \ - inline NAME##_equal_list NAME::equal_list(cchar *d, cchar *c, Manip m) const { \ - return NAME##_equal_list (this, d, c, m); \ - } \ - template \ - inline NAME##_cus_value_list NAME::value_list(cchar *d, Manip m,\ - bool i1, bool i2, bool i3, bool i4, bool i5, bool i6, bool i7, bool i8, bool i9, bool i10, bool i11, bool i12, bool i13, bool i14, bool i15, bool i16) const {\ - return NAME##_cus_value_list (this, d, m, i1, i2, i3, i4, i5, i6, i7, i8, i9, i10, i11, i12, i13, i14, i15, i16); \ - } \ - template \ - inline NAME##_cus_field_list NAME::field_list(cchar *d, Manip m,\ - bool i1, bool i2, bool i3, bool i4, bool i5, bool i6, bool i7, bool i8, bool i9, bool i10, bool i11, bool i12, bool i13, bool i14, bool i15, bool i16) const { \ - return NAME##_cus_field_list (this, d, m, i1, i2, i3, i4, i5, i6, i7, i8, i9, i10, i11, i12, i13, i14, i15, i16); \ - } \ - template \ - inline NAME##_cus_equal_list NAME::equal_list(cchar *d, cchar *c, Manip m,\ - bool i1, bool i2, bool i3, bool i4, bool i5, bool i6, bool i7, bool i8, bool i9, bool i10, bool i11, bool i12, bool i13, bool i14, bool i15, bool i16) const { \ - return NAME##_cus_equal_list (this, d, c, m, i1, i2, i3, i4, i5, i6, i7, i8, i9, i10, i11, i12, i13, i14, i15, i16); \ - } \ - template \ - inline NAME##_cus_value_list NAME::value_list(cchar *d, Manip m,\ - NAME##_enum i1, NAME##_enum i2, NAME##_enum i3, NAME##_enum i4, NAME##_enum i5, NAME##_enum i6, NAME##_enum i7, NAME##_enum i8, NAME##_enum i9, NAME##_enum i10, NAME##_enum i11, NAME##_enum i12, NAME##_enum i13, NAME##_enum i14, NAME##_enum i15, NAME##_enum i16) const { \ - return NAME##_cus_value_list (this, d, m, i1, i2, i3, i4, i5, i6, i7, i8, i9, i10, i11, i12, i13, i14, i15, i16); \ - } \ - template \ - inline NAME##_cus_field_list NAME::field_list(cchar *d, Manip m,\ - NAME##_enum i1, NAME##_enum i2, NAME##_enum i3, NAME##_enum i4, NAME##_enum i5, NAME##_enum i6, NAME##_enum i7, NAME##_enum i8, NAME##_enum i9, NAME##_enum i10, NAME##_enum i11, NAME##_enum i12, NAME##_enum i13, NAME##_enum i14, NAME##_enum i15, NAME##_enum i16) const {\ - return NAME##_cus_field_list (this, d, m, i1, i2, i3, i4, i5, i6, i7, i8, i9, i10, i11, i12, i13, i14, i15, i16); \ - } \ - template \ - inline NAME##_cus_equal_list NAME::equal_list(cchar *d, cchar *c, Manip m, \ - NAME##_enum i1, NAME##_enum i2, NAME##_enum i3, NAME##_enum i4, NAME##_enum i5, NAME##_enum i6, NAME##_enum i7, NAME##_enum i8, NAME##_enum i9, NAME##_enum i10, NAME##_enum i11, NAME##_enum i12, NAME##_enum i13, NAME##_enum i14, NAME##_enum i15, NAME##_enum i16) const { \ - return NAME##_cus_equal_list (this, d, c, m, i1, i2, i3, i4, i5, i6, i7, i8, i9, i10, i11, i12, i13, i14, i15, i16); \ - } \ - template \ - inline NAME##_cus_value_list NAME::value_list(cchar *d, Manip m,\ - std::vector *i) const {\ - return NAME##_cus_value_list (this, d, m, i);\ - }\ - template \ - inline NAME##_cus_field_list NAME::field_list(cchar *d, Manip m,\ - std::vector *i) const {\ - return NAME##_cus_field_list (this, d, m, i);\ - }\ - template \ - inline NAME##_cus_equal_list NAME::equal_list(cchar *d, cchar *c, Manip m,\ - std::vector *i) const {\ - return NAME##_cus_equal_list (this, d, c, m, i);\ - }\ - template \ - inline NAME##_cus_value_list \ - NAME::value_list(cchar *d, Manip m, sql_cmp_type /*sc*/) const {\ - sql_compare_type_def_##CMP (NAME, value, NUM);\ - }\ - template \ - inline NAME##_cus_field_list \ - NAME::field_list(cchar *d, Manip m, sql_cmp_type /*sc*/) const {\ - sql_compare_type_def_##CMP (NAME, field, NUM);\ - }\ - template \ - inline NAME##_cus_equal_list \ - NAME::equal_list(cchar *d, cchar *c, Manip m, sql_cmp_type /*sc*/) const {\ - sql_compare_type_defe_##CMP (NAME, equal, NUM);\ - }\ - template \ - void populate_##NAME (NAME *s, const Row &row) { \ - s->I1 = static_cast(row.at(O1));\ - s->I2 = static_cast(row.at(O2));\ - s->I3 = static_cast(row.at(O3));\ - s->I4 = static_cast(row.at(O4));\ - s->I5 = static_cast(row.at(O5));\ - s->I6 = static_cast(row.at(O6));\ - s->I7 = static_cast(row.at(O7));\ - s->I8 = static_cast(row.at(O8));\ - s->I9 = static_cast(row.at(O9));\ - s->I10 = static_cast(row.at(O10));\ - s->I11 = static_cast(row.at(O11));\ - s->I12 = static_cast(row.at(O12));\ - s->I13 = static_cast(row.at(O13));\ - s->I14 = static_cast(row.at(O14));\ - s->I15 = static_cast(row.at(O15));\ - s->I16 = static_cast(row.at(O16));\ - } \ - inline NAME::NAME (const Row &row) \ - {populate_##NAME(this, row);}\ - inline void NAME::set (const Row &row)\ - {populate_##NAME(this, row);}\ - sql_COMPARE__##CMP(NAME, I1, I2, I3, I4, I5, I6, I7, I8, I9, I10, I11, I12, I13, I14, I15, I16, 0, 0, 0, 0, 0, 0, 0, 0, 0 ) - -#define sql_create_basic_16(NAME, CMP, CONTR, T1, I1, T2, I2, T3, I3, T4, I4, T5, I5, T6, I6, T7, I7, T8, I8, T9, I9, T10, I10, T11, I11, T12, I12, T13, I13, T14, I14, T15, I15, T16, I16) \ - sql_create_basic_c_order_16(NAME, CMP, CONTR, T1, I1, 0, T2, I2, 1, T3, I3, 2, T4, I4, 3, T5, I5, 4, T6, I6, 5, T7, I7, 6, T8, I8, 7, T9, I9, 8, T10, I10, 9, T11, I11, 10, T12, I12, 11, T13, I13, 12, T14, I14, 13, T15, I15, 14, T16, I16, 15) - -#define sql_create_16(NAME, CMP, CONTR, T1, I1, T2, I2, T3, I3, T4, I4, T5, I5, T6, I6, T7, I7, T8, I8, T9, I9, T10, I10, T11, I11, T12, I12, T13, I13, T14, I14, T15, I15, T16, I16) \ - sql_create_complete_16(NAME, CMP, CONTR, T1, I1, #I1, 0, T2, I2, #I2, 1, T3, I3, #I3, 2, T4, I4, #I4, 3, T5, I5, #I5, 4, T6, I6, #I6, 5, T7, I7, #I7, 6, T8, I8, #I8, 7, T9, I9, #I9, 8, T10, I10, #I10, 9, T11, I11, #I11, 10, T12, I12, #I12, 11, T13, I13, #I13, 12, T14, I14, #I14, 13, T15, I15, #I15, 14, T16, I16, #I16, 15) \ - -#define sql_create_c_order_16(NAME, CMP, CONTR, T1, I1, O1, T2, I2, O2, T3, I3, O3, T4, I4, O4, T5, I5, O5, T6, I6, O6, T7, I7, O7, T8, I8, O8, T9, I9, O9, T10, I10, O10, T11, I11, O11, T12, I12, O12, T13, I13, O13, T14, I14, O14, T15, I15, O15, T16, I16, O16) \ - sql_create_complete_16(NAME, CMP, CONTR, T1, I1, #I1, O1, T2, I2, #I2, O2, T3, I3, #I3, O3, T4, I4, #I4, O4, T5, I5, #I5, O5, T6, I6, #I6, O6, T7, I7, #I7, O7, T8, I8, #I8, O8, T9, I9, #I9, O9, T10, I10, #I10, O10, T11, I11, #I11, O11, T12, I12, #I12, O12, T13, I13, #I13, O13, T14, I14, #I14, O14, T15, I15, #I15, O15, T16, I16, #I16, O16) - -#define sql_create_c_names_16(NAME, CMP, CONTR, T1, I1, N1, T2, I2, N2, T3, I3, N3, T4, I4, N4, T5, I5, N5, T6, I6, N6, T7, I7, N7, T8, I8, N8, T9, I9, N9, T10, I10, N10, T11, I11, N11, T12, I12, N12, T13, I13, N13, T14, I14, N14, T15, I15, N15, T16, I16, N16) \ - sql_create_complete_16(NAME, CMP, CONTR, T1, I1, N1, 0, T2, I2, N2, 1, T3, I3, N3, 2, T4, I4, N4, 3, T5, I5, N5, 4, T6, I6, N6, 5, T7, I7, N7, 6, T8, I8, N8, 7, T9, I9, N9, 8, T10, I10, N10, 9, T11, I11, N11, 10, T12, I12, N12, 11, T13, I13, N13, 12, T14, I14, N14, 13, T15, I15, N15, 14, T16, I16, N16, 15) - -// --------------------------------------------------- -// End Create 16 -// --------------------------------------------------- - -// --------------------------------------------------- -// Begin Create 17 -// --------------------------------------------------- -#define sql_create_basic_c_order_17(NAME, CMP, CONTR, T1, I1, O1, T2, I2, O2, T3, I3, O3, T4, I4, O4, T5, I5, O5, T6, I6, O6, T7, I7, O7, T8, I8, O8, T9, I9, O9, T10, I10, O10, T11, I11, O11, T12, I12, O12, T13, I13, O13, T14, I14, O14, T15, I15, O15, T16, I16, O16, T17, I17, O17)\ - struct NAME; \ - template int sql_compare_##NAME (const NAME &, const NAME &);\ - struct NAME { \ - T1 I1;\ - T2 I2;\ - T3 I3;\ - T4 I4;\ - T5 I5;\ - T6 I6;\ - T7 I7;\ - T8 I8;\ - T9 I9;\ - T10 I10;\ - T11 I11;\ - T12 I12;\ - T13 I13;\ - T14 I14;\ - T15 I15;\ - T16 I16;\ - T17 I17; \ - NAME () {} \ - NAME (const Row &row);\ - sql_compare_define_##CMP(NAME, T1, I1, T2, I2, T3, I3, T4, I4, T5, I5, T6, I6, T7, I7, T8, I8, T9, I9, T10, I10, T11, I11, T12, I12, T13, I13, T14, I14, T15, I15, T16, I16, T17, I17, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0)\ - }; \ - template \ - void populate_##NAME (NAME *s, const Row &row) { \ - s->I1 = static_cast(row.at(O1));\ - s->I2 = static_cast(row.at(O2));\ - s->I3 = static_cast(row.at(O3));\ - s->I4 = static_cast(row.at(O4));\ - s->I5 = static_cast(row.at(O5));\ - s->I6 = static_cast(row.at(O6));\ - s->I7 = static_cast(row.at(O7));\ - s->I8 = static_cast(row.at(O8));\ - s->I9 = static_cast(row.at(O9));\ - s->I10 = static_cast(row.at(O10));\ - s->I11 = static_cast(row.at(O11));\ - s->I12 = static_cast(row.at(O12));\ - s->I13 = static_cast(row.at(O13));\ - s->I14 = static_cast(row.at(O14));\ - s->I15 = static_cast(row.at(O15));\ - s->I16 = static_cast(row.at(O16));\ - s->I17 = static_cast(row.at(O17)); \ - } \ - inline NAME::NAME (const Row &row) \ - {populate_##NAME(this, row);} \ - sql_COMPARE__##CMP(NAME, I1, I2, I3, I4, I5, I6, I7, I8, I9, I10, I11, I12, I13, I14, I15, I16, I17, 0, 0, 0, 0, 0, 0, 0, 0 ) - -#define sql_create_complete_17(NAME, CMP, CONTR, T1, I1, N1, O1, T2, I2, N2, O2, T3, I3, N3, O3, T4, I4, N4, O4, T5, I5, N5, O5, T6, I6, N6, O6, T7, I7, N7, O7, T8, I8, N8, O8, T9, I9, N9, O9, T10, I10, N10, O10, T11, I11, N11, O11, T12, I12, N12, O12, T13, I13, N13, O13, T14, I14, N14, O14, T15, I15, N15, O15, T16, I16, N16, O16, T17, I17, N17, O17) \ - struct NAME; \ - enum NAME##_enum { \ - NAME##_##I1,\ - NAME##_##I2,\ - NAME##_##I3,\ - NAME##_##I4,\ - NAME##_##I5,\ - NAME##_##I6,\ - NAME##_##I7,\ - NAME##_##I8,\ - NAME##_##I9,\ - NAME##_##I10,\ - NAME##_##I11,\ - NAME##_##I12,\ - NAME##_##I13,\ - NAME##_##I14,\ - NAME##_##I15,\ - NAME##_##I16,\ - NAME##_##I17 \ - ,NAME##_NULL \ - }; \ - template \ - class NAME##_value_list { \ - /*friend std::ostream& operator << <> (std::ostream&, const NAME##_value_list&); */\ - public: \ - const NAME *obj;\ - cchar *delem;\ - Manip manip;\ - public: \ - NAME##_value_list (const NAME *o, cchar *d, Manip m) \ - : obj(o), delem(d), manip(m) {} \ - };\ - template \ - class NAME##_##field_list {\ - /* friend std::ostream& operator << <> (std::ostream&, const NAME##_field_list&); */\ - public: \ - const NAME *obj; \ - cchar *delem;\ - Manip manip;\ - public: \ - NAME##_field_list (const NAME *o, cchar *d, Manip m) \ - : obj(o), delem(d), manip(m) {} \ - };\ - template \ - class NAME##_equal_list { \ - /* friend std::ostream& operator << <> (std::ostream&, const NAME##_equal_list&); */\ - public: \ - const NAME *obj;\ - cchar *delem;\ - cchar *comp;\ - Manip manip;\ - public: \ - NAME##_equal_list (const NAME *o, cchar *d, cchar *c, Manip m) \ - : obj(o), delem(d), comp(c), manip(m) {}\ - };\ - template \ - class NAME##_cus_value_list {\ - /* friend std::ostream& operator << <> (std::ostream&, \ - const NAME##_cus_value_list&); */\ - public:\ - const NAME *obj;\ - std::vector *include;\ - bool del_vector;\ - cchar *delem;\ - Manip manip;\ - public: \ - ~NAME##_cus_value_list () {if (del_vector) delete include;} \ - NAME##_cus_value_list (const NAME *o, cchar *d, Manip m, bool i1, bool i2, bool i3, bool i4, bool i5, bool i6, bool i7, bool i8, bool i9, bool i10, bool i11, bool i12, bool i13, bool i14, bool i15, bool i16, bool i17);\ - NAME##_cus_value_list (const NAME *o, cchar *d, Manip m, NAME##_enum i1, NAME##_enum i2, NAME##_enum i3, NAME##_enum i4, NAME##_enum i5, NAME##_enum i6, NAME##_enum i7, NAME##_enum i8, NAME##_enum i9, NAME##_enum i10, NAME##_enum i11, NAME##_enum i12, NAME##_enum i13, NAME##_enum i14, NAME##_enum i15, NAME##_enum i16, NAME##_enum i17); \ - NAME##_cus_value_list (const NAME *o, cchar *d, Manip m ,std::vector* i)\ - : obj(o), include(i), del_vector(false), delem(d), manip(m) {}\ - };\ - template \ - class NAME##_cus_field_list { \ - /* friend std::ostream& operator << <> (std::ostream&, \ - const NAME##_cus_field_list&); */\ - public:\ - const NAME *obj; \ - std::vector *include; \ - bool del_vector; \ - cchar *delem;\ - Manip manip;\ - public: \ - ~NAME##_cus_field_list () {if (del_vector) delete include;} \ - NAME##_cus_field_list (const NAME *o, cchar *d, Manip m, bool i1, bool i2, bool i3, bool i4, bool i5, bool i6, bool i7, bool i8, bool i9, bool i10, bool i11, bool i12, bool i13, bool i14, bool i15, bool i16, bool i17); \ - NAME##_cus_field_list (const NAME *o, cchar *d, Manip m, NAME##_enum i1, NAME##_enum i2, NAME##_enum i3, NAME##_enum i4, NAME##_enum i5, NAME##_enum i6, NAME##_enum i7, NAME##_enum i8, NAME##_enum i9, NAME##_enum i10, NAME##_enum i11, NAME##_enum i12, NAME##_enum i13, NAME##_enum i14, NAME##_enum i15, NAME##_enum i16, NAME##_enum i17); \ - NAME##_cus_field_list (const NAME *o, cchar *d, Manip m, std::vector *i) \ - : obj(o), include(i), del_vector(false), delem(d), manip(m) {}\ - };\ - template \ - class NAME##_cus_equal_list {\ - /* friend std::ostream& operator << <> (std::ostream&, \ - const NAME##_cus_equal_list&); */\ - public:\ - const NAME *obj;\ - std::vector *include;\ - bool del_vector;\ - cchar *delem;\ - cchar *comp;\ - Manip manip;\ - public:\ - ~NAME##_##cus_equal_list () {if (del_vector) delete include;}\ - NAME##_##cus_equal_list (const NAME *o, cchar *d, cchar *c, Manip m, bool i1, bool i2, bool i3, bool i4, bool i5, bool i6, bool i7, bool i8, bool i9, bool i10, bool i11, bool i12, bool i13, bool i14, bool i15, bool i16, bool i17); \ - NAME##_##cus_equal_list (const NAME *o, cchar *d, cchar *c, Manip m, NAME##_enum i1, NAME##_enum i2, NAME##_enum i3, NAME##_enum i4, NAME##_enum i5, NAME##_enum i6, NAME##_enum i7, NAME##_enum i8, NAME##_enum i9, NAME##_enum i10, NAME##_enum i11, NAME##_enum i12, NAME##_enum i13, NAME##_enum i14, NAME##_enum i15, NAME##_enum i16, NAME##_enum i17); \ - NAME##_##cus_equal_list (const NAME *o, cchar *d, cchar *c, Manip m, std::vector *i) \ - : obj(o), include(i), del_vector(false), delem(d), comp(c), manip(m) {}\ - };\ - template int sql_compare_##NAME (const NAME &, const NAME &);\ - struct NAME { \ - T1 I1;\ - T2 I2;\ - T3 I3;\ - T4 I4;\ - T5 I5;\ - T6 I6;\ - T7 I7;\ - T8 I8;\ - T9 I9;\ - T10 I10;\ - T11 I11;\ - T12 I12;\ - T13 I13;\ - T14 I14;\ - T15 I15;\ - T16 I16;\ - T17 I17; \ - NAME () {} \ - NAME (const Row &row);\ - void set (const Row &row);\ - sql_compare_define_##CMP(NAME, T1, I1, T2, I2, T3, I3, T4, I4, T5, I5, T6, I6, T7, I7, T8, I8, T9, I9, T10, I10, T11, I11, T12, I12, T13, I13, T14, I14, T15, I15, T16, I16, T17, I17, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0)\ - sql_construct_define_##CONTR(NAME, T1, I1, T2, I2, T3, I3, T4, I4, T5, I5, T6, I6, T7, I7, T8, I8, T9, I9, T10, I10, T11, I11, T12, I12, T13, I13, T14, I14, T15, I15, T16, I16, T17, I17, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0)\ - static const char *names[];\ - static const char *_table;\ - static const char *& table() {return _table;}\ - NAME##_value_list value_list() const {\ - return value_list(",", quote);}\ - NAME##_value_list value_list(cchar *d) const {\ - return value_list(d, quote);}\ - template \ - NAME##_value_list value_list(cchar *d, Manip m) const; \ - NAME##_field_list field_list() const {\ - return field_list(",", do_nothing);}\ - NAME##_field_list field_list(cchar *d) const {\ - return field_list(d, do_nothing);}\ - template \ - NAME##_field_list field_list(cchar *d, Manip m) const; \ - NAME##_equal_list equal_list(cchar *d = ",", \ - cchar *c = " = ") const{\ - return equal_list(d, c, quote);}\ - template \ - NAME##_equal_list equal_list(cchar *d, cchar *c, Manip m) const; \ - /* cus_data */\ - NAME##_cus_value_list value_list(bool i1, bool i2 = false, bool i3 = false, bool i4 = false, bool i5 = false, bool i6 = false, bool i7 = false, bool i8 = false, bool i9 = false, bool i10 = false, bool i11 = false, bool i12 = false, bool i13 = false, bool i14 = false, bool i15 = false, bool i16 = false, bool i17 = false) const {\ - return value_list(",", quote, i1, i2, i3, i4, i5, i6, i7, i8, i9, i10, i11, i12, i13, i14, i15, i16, i17);\ - }\ - NAME##_cus_value_list value_list(NAME##_enum i1, NAME##_enum i2 = NAME##_NULL, NAME##_enum i3 = NAME##_NULL, NAME##_enum i4 = NAME##_NULL, NAME##_enum i5 = NAME##_NULL, NAME##_enum i6 = NAME##_NULL, NAME##_enum i7 = NAME##_NULL, NAME##_enum i8 = NAME##_NULL, NAME##_enum i9 = NAME##_NULL, NAME##_enum i10 = NAME##_NULL, NAME##_enum i11 = NAME##_NULL, NAME##_enum i12 = NAME##_NULL, NAME##_enum i13 = NAME##_NULL, NAME##_enum i14 = NAME##_NULL, NAME##_enum i15 = NAME##_NULL, NAME##_enum i16 = NAME##_NULL, NAME##_enum i17 = NAME##_NULL) const {\ - return value_list(",", quote, i1, i2, i3, i4, i5, i6, i7, i8, i9, i10, i11, i12, i13, i14, i15, i16, i17);\ - }\ - NAME##_cus_value_list value_list(std::vector *i) const {\ - return value_list(",", quote, i);\ - }\ - NAME##_cus_value_list value_list(sql_cmp_type sc) const {\ - return value_list(",", quote, sc);\ - }\ - NAME##_cus_value_list value_list(cchar *d, bool i1, bool i2 = false, bool i3 = false, bool i4 = false, bool i5 = false, bool i6 = false, bool i7 = false, bool i8 = false, bool i9 = false, bool i10 = false, bool i11 = false, bool i12 = false, bool i13 = false, bool i14 = false, bool i15 = false, bool i16 = false, bool i17 = false) const {\ - return value_list(d, quote, i1, i2, i3, i4, i5, i6, i7, i8, i9, i10, i11, i12, i13, i14, i15, i16, i17);\ - }\ - NAME##_cus_value_list value_list(cchar *d, NAME##_enum i1, NAME##_enum i2 = NAME##_NULL, NAME##_enum i3 = NAME##_NULL, NAME##_enum i4 = NAME##_NULL, NAME##_enum i5 = NAME##_NULL, NAME##_enum i6 = NAME##_NULL, NAME##_enum i7 = NAME##_NULL, NAME##_enum i8 = NAME##_NULL, NAME##_enum i9 = NAME##_NULL, NAME##_enum i10 = NAME##_NULL, NAME##_enum i11 = NAME##_NULL, NAME##_enum i12 = NAME##_NULL, NAME##_enum i13 = NAME##_NULL, NAME##_enum i14 = NAME##_NULL, NAME##_enum i15 = NAME##_NULL, NAME##_enum i16 = NAME##_NULL, NAME##_enum i17 = NAME##_NULL) const {\ - return value_list(d, quote, i1, i2, i3, i4, i5, i6, i7, i8, i9, i10, i11, i12, i13, i14, i15, i16, i17);\ - }\ - NAME##_cus_value_list value_list(cchar *d, \ - std::vector *i) const {\ - return value_list(d, quote, i);\ - }\ - NAME##_cus_value_list value_list(cchar *d, \ - sql_cmp_type sc) const {\ - return value_list(d, quote, sc);\ - }\ - template \ - NAME##_cus_value_list value_list(cchar *d, Manip m,\ - bool i1, bool i2 = false, bool i3 = false, bool i4 = false, bool i5 = false, bool i6 = false, bool i7 = false, bool i8 = false, bool i9 = false, bool i10 = false, bool i11 = false, bool i12 = false, bool i13 = false, bool i14 = false, bool i15 = false, bool i16 = false, bool i17 = false) const; \ - template \ - NAME##_cus_value_list value_list(cchar *d, Manip m,\ - NAME##_enum i1, NAME##_enum i2 = NAME##_NULL, NAME##_enum i3 = NAME##_NULL, NAME##_enum i4 = NAME##_NULL, NAME##_enum i5 = NAME##_NULL, NAME##_enum i6 = NAME##_NULL, NAME##_enum i7 = NAME##_NULL, NAME##_enum i8 = NAME##_NULL, NAME##_enum i9 = NAME##_NULL, NAME##_enum i10 = NAME##_NULL, NAME##_enum i11 = NAME##_NULL, NAME##_enum i12 = NAME##_NULL, NAME##_enum i13 = NAME##_NULL, NAME##_enum i14 = NAME##_NULL, NAME##_enum i15 = NAME##_NULL, NAME##_enum i16 = NAME##_NULL, NAME##_enum i17 = NAME##_NULL) const; \ - template \ - NAME##_cus_value_list value_list(cchar *d, Manip m, \ - std::vector *i) const;\ - template \ - NAME##_cus_value_list value_list(cchar *d, Manip m, \ - sql_cmp_type sc) const;\ - /* cus field */\ - NAME##_cus_field_list field_list(bool i1, bool i2 = false, bool i3 = false, bool i4 = false, bool i5 = false, bool i6 = false, bool i7 = false, bool i8 = false, bool i9 = false, bool i10 = false, bool i11 = false, bool i12 = false, bool i13 = false, bool i14 = false, bool i15 = false, bool i16 = false, bool i17 = false) const {\ - return field_list(",", do_nothing, i1, i2, i3, i4, i5, i6, i7, i8, i9, i10, i11, i12, i13, i14, i15, i16, i17);\ - }\ - NAME##_cus_field_list field_list(NAME##_enum i1, NAME##_enum i2 = NAME##_NULL, NAME##_enum i3 = NAME##_NULL, NAME##_enum i4 = NAME##_NULL, NAME##_enum i5 = NAME##_NULL, NAME##_enum i6 = NAME##_NULL, NAME##_enum i7 = NAME##_NULL, NAME##_enum i8 = NAME##_NULL, NAME##_enum i9 = NAME##_NULL, NAME##_enum i10 = NAME##_NULL, NAME##_enum i11 = NAME##_NULL, NAME##_enum i12 = NAME##_NULL, NAME##_enum i13 = NAME##_NULL, NAME##_enum i14 = NAME##_NULL, NAME##_enum i15 = NAME##_NULL, NAME##_enum i16 = NAME##_NULL, NAME##_enum i17 = NAME##_NULL) const {\ - return field_list(",", do_nothing, i1, i2, i3, i4, i5, i6, i7, i8, i9, i10, i11, i12, i13, i14, i15, i16, i17);\ - }\ - NAME##_cus_field_list field_list(std::vector *i) const {\ - return field_list(",", do_nothing, i);\ - }\ - NAME##_cus_field_list field_list(sql_cmp_type sc) const\ - {\ - return field_list(",", do_nothing, sc);\ - }\ - NAME##_cus_field_list field_list(cchar *d, \ - bool i1, bool i2 = false, bool i3 = false, bool i4 = false, bool i5 = false, bool i6 = false, bool i7 = false, bool i8 = false, bool i9 = false, bool i10 = false, bool i11 = false, bool i12 = false, bool i13 = false, bool i14 = false, bool i15 = false, bool i16 = false, bool i17 = false) const {\ - return field_list(d, do_nothing, i1, i2, i3, i4, i5, i6, i7, i8, i9, i10, i11, i12, i13, i14, i15, i16, i17);\ - }\ - NAME##_cus_field_list field_list(cchar *d,\ - NAME##_enum i1, NAME##_enum i2 = NAME##_NULL, NAME##_enum i3 = NAME##_NULL, NAME##_enum i4 = NAME##_NULL, NAME##_enum i5 = NAME##_NULL, NAME##_enum i6 = NAME##_NULL, NAME##_enum i7 = NAME##_NULL, NAME##_enum i8 = NAME##_NULL, NAME##_enum i9 = NAME##_NULL, NAME##_enum i10 = NAME##_NULL, NAME##_enum i11 = NAME##_NULL, NAME##_enum i12 = NAME##_NULL, NAME##_enum i13 = NAME##_NULL, NAME##_enum i14 = NAME##_NULL, NAME##_enum i15 = NAME##_NULL, NAME##_enum i16 = NAME##_NULL, NAME##_enum i17 = NAME##_NULL) const {\ - return field_list(d, do_nothing, i1, i2, i3, i4, i5, i6, i7, i8, i9, i10, i11, i12, i13, i14, i15, i16, i17);\ - }\ - NAME##_cus_field_list field_list(cchar *d, \ - std::vector *i) const {\ - return field_list(d, do_nothing, i);\ - }\ - NAME##_cus_field_list field_list(cchar *d, \ - sql_cmp_type sc) const {\ - return field_list(d, do_nothing, sc);\ - }\ - template \ - NAME##_cus_field_list field_list(cchar *d, Manip m,\ - bool i1, bool i2 = false, bool i3 = false, bool i4 = false, bool i5 = false, bool i6 = false, bool i7 = false, bool i8 = false, bool i9 = false, bool i10 = false, bool i11 = false, bool i12 = false, bool i13 = false, bool i14 = false, bool i15 = false, bool i16 = false, bool i17 = false) const; \ - template \ - NAME##_cus_field_list field_list(cchar *d, Manip m,\ - NAME##_enum i1, NAME##_enum i2 = NAME##_NULL, NAME##_enum i3 = NAME##_NULL, NAME##_enum i4 = NAME##_NULL, NAME##_enum i5 = NAME##_NULL, NAME##_enum i6 = NAME##_NULL, NAME##_enum i7 = NAME##_NULL, NAME##_enum i8 = NAME##_NULL, NAME##_enum i9 = NAME##_NULL, NAME##_enum i10 = NAME##_NULL, NAME##_enum i11 = NAME##_NULL, NAME##_enum i12 = NAME##_NULL, NAME##_enum i13 = NAME##_NULL, NAME##_enum i14 = NAME##_NULL, NAME##_enum i15 = NAME##_NULL, NAME##_enum i16 = NAME##_NULL, NAME##_enum i17 = NAME##_NULL) const; \ - template \ - NAME##_cus_field_list field_list(cchar *d, Manip m,\ - std::vector *i) const;\ - template \ - NAME##_cus_field_list field_list(cchar *d, Manip m, \ - sql_cmp_type sc) const;\ - /* cus equal */\ - NAME##_cus_equal_list equal_list(bool i1, bool i2 = false, bool i3 = false, bool i4 = false, bool i5 = false, bool i6 = false, bool i7 = false, bool i8 = false, bool i9 = false, bool i10 = false, bool i11 = false, bool i12 = false, bool i13 = false, bool i14 = false, bool i15 = false, bool i16 = false, bool i17 = false) const {\ - return equal_list(",", " = ", quote, i1, i2, i3, i4, i5, i6, i7, i8, i9, i10, i11, i12, i13, i14, i15, i16, i17);\ - }\ - NAME##_cus_equal_list equal_list(NAME##_enum i1, NAME##_enum i2 = NAME##_NULL, NAME##_enum i3 = NAME##_NULL, NAME##_enum i4 = NAME##_NULL, NAME##_enum i5 = NAME##_NULL, NAME##_enum i6 = NAME##_NULL, NAME##_enum i7 = NAME##_NULL, NAME##_enum i8 = NAME##_NULL, NAME##_enum i9 = NAME##_NULL, NAME##_enum i10 = NAME##_NULL, NAME##_enum i11 = NAME##_NULL, NAME##_enum i12 = NAME##_NULL, NAME##_enum i13 = NAME##_NULL, NAME##_enum i14 = NAME##_NULL, NAME##_enum i15 = NAME##_NULL, NAME##_enum i16 = NAME##_NULL, NAME##_enum i17 = NAME##_NULL) const {\ - return equal_list(",", " = ", quote, i1, i2, i3, i4, i5, i6, i7, i8, i9, i10, i11, i12, i13, i14, i15, i16, i17);\ - }\ - NAME##_cus_equal_list equal_list(std::vector *i) const {\ - return equal_list(",", " = ", quote, i);\ - }\ - NAME##_cus_equal_list equal_list(sql_cmp_type sc) const {\ - return equal_list(",", " = ", quote, sc);\ - }\ - NAME##_cus_equal_list equal_list(cchar *d, bool i1, bool i2 = false, bool i3 = false, bool i4 = false, bool i5 = false, bool i6 = false, bool i7 = false, bool i8 = false, bool i9 = false, bool i10 = false, bool i11 = false, bool i12 = false, bool i13 = false, bool i14 = false, bool i15 = false, bool i16 = false, bool i17 = false) const {\ - return equal_list(d, " = ", quote, i1, i2, i3, i4, i5, i6, i7, i8, i9, i10, i11, i12, i13, i14, i15, i16, i17);\ - }\ - NAME##_cus_equal_list equal_list(cchar *d, NAME##_enum i1, NAME##_enum i2 = NAME##_NULL, NAME##_enum i3 = NAME##_NULL, NAME##_enum i4 = NAME##_NULL, NAME##_enum i5 = NAME##_NULL, NAME##_enum i6 = NAME##_NULL, NAME##_enum i7 = NAME##_NULL, NAME##_enum i8 = NAME##_NULL, NAME##_enum i9 = NAME##_NULL, NAME##_enum i10 = NAME##_NULL, NAME##_enum i11 = NAME##_NULL, NAME##_enum i12 = NAME##_NULL, NAME##_enum i13 = NAME##_NULL, NAME##_enum i14 = NAME##_NULL, NAME##_enum i15 = NAME##_NULL, NAME##_enum i16 = NAME##_NULL, NAME##_enum i17 = NAME##_NULL) const {\ - return equal_list(d, " = ", quote, i1, i2, i3, i4, i5, i6, i7, i8, i9, i10, i11, i12, i13, i14, i15, i16, i17);\ - }\ - NAME##_cus_equal_list equal_list(cchar *d, \ - std::vector *i) const {\ - return equal_list(d, " = ", quote, i);\ - }\ - NAME##_cus_equal_list equal_list(cchar *d, \ - sql_cmp_type sc) const {\ - return equal_list(d, " = ", quote, sc);\ - }\ - NAME##_cus_equal_list equal_list(cchar *d, cchar *c,\ - bool i1, bool i2 = false, bool i3 = false, bool i4 = false, bool i5 = false, bool i6 = false, bool i7 = false, bool i8 = false, bool i9 = false, bool i10 = false, bool i11 = false, bool i12 = false, bool i13 = false, bool i14 = false, bool i15 = false, bool i16 = false, bool i17 = false) const {\ - return equal_list(d, c, quote, i1, i2, i3, i4, i5, i6, i7, i8, i9, i10, i11, i12, i13, i14, i15, i16, i17);\ - }\ - NAME##_cus_equal_list equal_list(cchar *d, cchar *c,\ - NAME##_enum i1, NAME##_enum i2 = NAME##_NULL, NAME##_enum i3 = NAME##_NULL, NAME##_enum i4 = NAME##_NULL, NAME##_enum i5 = NAME##_NULL, NAME##_enum i6 = NAME##_NULL, NAME##_enum i7 = NAME##_NULL, NAME##_enum i8 = NAME##_NULL, NAME##_enum i9 = NAME##_NULL, NAME##_enum i10 = NAME##_NULL, NAME##_enum i11 = NAME##_NULL, NAME##_enum i12 = NAME##_NULL, NAME##_enum i13 = NAME##_NULL, NAME##_enum i14 = NAME##_NULL, NAME##_enum i15 = NAME##_NULL, NAME##_enum i16 = NAME##_NULL, NAME##_enum i17 = NAME##_NULL) const {\ - return equal_list(d, c, quote, i1, i2, i3, i4, i5, i6, i7, i8, i9, i10, i11, i12, i13, i14, i15, i16, i17);\ - }\ - NAME##_cus_equal_list equal_list(cchar *d, cchar *c,\ - std::vector *i) const {\ - return equal_list(d, c, quote, i);\ - }\ - NAME##_cus_equal_list equal_list(cchar *d, cchar *c,\ - sql_cmp_type sc) const {\ - return equal_list(d, c, quote, sc);\ - }\ - template \ - NAME##_cus_equal_list equal_list(cchar *d, cchar *c, Manip m, \ - bool i1, bool i2 = false, bool i3 = false, bool i4 = false, bool i5 = false, bool i6 = false, bool i7 = false, bool i8 = false, bool i9 = false, bool i10 = false, bool i11 = false, bool i12 = false, bool i13 = false, bool i14 = false, bool i15 = false, bool i16 = false, bool i17 = false) const; \ - template \ - NAME##_cus_equal_list equal_list(cchar *d, cchar *c, Manip m, \ - NAME##_enum i1, NAME##_enum i2 = NAME##_NULL, NAME##_enum i3 = NAME##_NULL, NAME##_enum i4 = NAME##_NULL, NAME##_enum i5 = NAME##_NULL, NAME##_enum i6 = NAME##_NULL, NAME##_enum i7 = NAME##_NULL, NAME##_enum i8 = NAME##_NULL, NAME##_enum i9 = NAME##_NULL, NAME##_enum i10 = NAME##_NULL, NAME##_enum i11 = NAME##_NULL, NAME##_enum i12 = NAME##_NULL, NAME##_enum i13 = NAME##_NULL, NAME##_enum i14 = NAME##_NULL, NAME##_enum i15 = NAME##_NULL, NAME##_enum i16 = NAME##_NULL, NAME##_enum i17 = NAME##_NULL) const; \ - template \ - NAME##_cus_equal_list equal_list(cchar *d, cchar *c, Manip m, \ - std::vector *i) const;\ - template \ - NAME##_cus_equal_list equal_list(cchar *d, cchar *c, Manip m, \ - sql_cmp_type sc) const;\ - }; \ - const char *NAME::names[] = { \ - N1 ,\ - N2 ,\ - N3 ,\ - N4 ,\ - N5 ,\ - N6 ,\ - N7 ,\ - N8 ,\ - N9 ,\ - N10 ,\ - N11 ,\ - N12 ,\ - N13 ,\ - N14 ,\ - N15 ,\ - N16 ,\ - N17 \ - }; \ - const char *NAME::_table = #NAME ; \ - template \ - NAME##_cus_value_list::NAME##_cus_value_list\ - (const NAME *o, cchar *d, Manip m, bool i1, bool i2, bool i3, bool i4, bool i5, bool i6, bool i7, bool i8, bool i9, bool i10, bool i11, bool i12, bool i13, bool i14, bool i15, bool i16, bool i17) \ - { \ - delem = d;\ - manip = m;\ - del_vector = true;\ - obj = o; \ - include = new std::vector(17, false);\ - if (i1) (*include)[0]=true;\ - if (i2) (*include)[1]=true;\ - if (i3) (*include)[2]=true;\ - if (i4) (*include)[3]=true;\ - if (i5) (*include)[4]=true;\ - if (i6) (*include)[5]=true;\ - if (i7) (*include)[6]=true;\ - if (i8) (*include)[7]=true;\ - if (i9) (*include)[8]=true;\ - if (i10) (*include)[9]=true;\ - if (i11) (*include)[10]=true;\ - if (i12) (*include)[11]=true;\ - if (i13) (*include)[12]=true;\ - if (i14) (*include)[13]=true;\ - if (i15) (*include)[14]=true;\ - if (i16) (*include)[15]=true;\ - if (i17) (*include)[16]=true;\ - } \ - template \ - NAME##_cus_value_list::NAME##_cus_value_list\ - (const NAME *o, cchar *d, Manip m, NAME##_enum i1, NAME##_enum i2, NAME##_enum i3, NAME##_enum i4, NAME##_enum i5, NAME##_enum i6, NAME##_enum i7, NAME##_enum i8, NAME##_enum i9, NAME##_enum i10, NAME##_enum i11, NAME##_enum i12, NAME##_enum i13, NAME##_enum i14, NAME##_enum i15, NAME##_enum i16, NAME##_enum i17) { \ - delem = d;\ - manip = m;\ - del_vector = true; \ - obj = o; \ - include = new std::vector(17, false); \ - if (i1 == NAME##_NULL) return;\ - (*include)[i1]=true;\ - if (i2 == NAME##_NULL) return;\ - (*include)[i2]=true;\ - if (i3 == NAME##_NULL) return;\ - (*include)[i3]=true;\ - if (i4 == NAME##_NULL) return;\ - (*include)[i4]=true;\ - if (i5 == NAME##_NULL) return;\ - (*include)[i5]=true;\ - if (i6 == NAME##_NULL) return;\ - (*include)[i6]=true;\ - if (i7 == NAME##_NULL) return;\ - (*include)[i7]=true;\ - if (i8 == NAME##_NULL) return;\ - (*include)[i8]=true;\ - if (i9 == NAME##_NULL) return;\ - (*include)[i9]=true;\ - if (i10 == NAME##_NULL) return;\ - (*include)[i10]=true;\ - if (i11 == NAME##_NULL) return;\ - (*include)[i11]=true;\ - if (i12 == NAME##_NULL) return;\ - (*include)[i12]=true;\ - if (i13 == NAME##_NULL) return;\ - (*include)[i13]=true;\ - if (i14 == NAME##_NULL) return;\ - (*include)[i14]=true;\ - if (i15 == NAME##_NULL) return;\ - (*include)[i15]=true;\ - if (i16 == NAME##_NULL) return;\ - (*include)[i16]=true;\ - if (i17 == NAME##_NULL) return;\ - (*include)[i17]=true;\ - }\ - template \ - NAME##_cus_field_list::NAME##_cus_field_list\ - (const NAME *o, cchar *d, Manip m, bool i1, bool i2, bool i3, bool i4, bool i5, bool i6, bool i7, bool i8, bool i9, bool i10, bool i11, bool i12, bool i13, bool i14, bool i15, bool i16, bool i17) {\ - delem = d;\ - manip = m;\ - del_vector = true; \ - obj = o; \ - include = new std::vector(17, false); \ - if (i1) (*include)[0]=true;\ - if (i2) (*include)[1]=true;\ - if (i3) (*include)[2]=true;\ - if (i4) (*include)[3]=true;\ - if (i5) (*include)[4]=true;\ - if (i6) (*include)[5]=true;\ - if (i7) (*include)[6]=true;\ - if (i8) (*include)[7]=true;\ - if (i9) (*include)[8]=true;\ - if (i10) (*include)[9]=true;\ - if (i11) (*include)[10]=true;\ - if (i12) (*include)[11]=true;\ - if (i13) (*include)[12]=true;\ - if (i14) (*include)[13]=true;\ - if (i15) (*include)[14]=true;\ - if (i16) (*include)[15]=true;\ - if (i17) (*include)[16]=true;\ - } \ - template \ - NAME##_cus_field_list::NAME##_cus_field_list\ - (const NAME *o, cchar *d, Manip m, NAME##_enum i1, NAME##_enum i2, NAME##_enum i3, NAME##_enum i4, NAME##_enum i5, NAME##_enum i6, NAME##_enum i7, NAME##_enum i8, NAME##_enum i9, NAME##_enum i10, NAME##_enum i11, NAME##_enum i12, NAME##_enum i13, NAME##_enum i14, NAME##_enum i15, NAME##_enum i16, NAME##_enum i17) { \ - delem = d;\ - manip = m;\ - del_vector = true; \ - obj = o; \ - include = new std::vector(17, false); \ - if (i1 == NAME##_NULL) return;\ - (*include)[i1]=true;\ - if (i2 == NAME##_NULL) return;\ - (*include)[i2]=true;\ - if (i3 == NAME##_NULL) return;\ - (*include)[i3]=true;\ - if (i4 == NAME##_NULL) return;\ - (*include)[i4]=true;\ - if (i5 == NAME##_NULL) return;\ - (*include)[i5]=true;\ - if (i6 == NAME##_NULL) return;\ - (*include)[i6]=true;\ - if (i7 == NAME##_NULL) return;\ - (*include)[i7]=true;\ - if (i8 == NAME##_NULL) return;\ - (*include)[i8]=true;\ - if (i9 == NAME##_NULL) return;\ - (*include)[i9]=true;\ - if (i10 == NAME##_NULL) return;\ - (*include)[i10]=true;\ - if (i11 == NAME##_NULL) return;\ - (*include)[i11]=true;\ - if (i12 == NAME##_NULL) return;\ - (*include)[i12]=true;\ - if (i13 == NAME##_NULL) return;\ - (*include)[i13]=true;\ - if (i14 == NAME##_NULL) return;\ - (*include)[i14]=true;\ - if (i15 == NAME##_NULL) return;\ - (*include)[i15]=true;\ - if (i16 == NAME##_NULL) return;\ - (*include)[i16]=true;\ - if (i17 == NAME##_NULL) return;\ - (*include)[i17]=true;\ - }\ - template \ - NAME##_cus_equal_list::NAME##_cus_equal_list\ - (const NAME *o, cchar *d, cchar *c, Manip m, bool i1, bool i2, bool i3, bool i4, bool i5, bool i6, bool i7, bool i8, bool i9, bool i10, bool i11, bool i12, bool i13, bool i14, bool i15, bool i16, bool i17) { \ - delem = d;\ - comp = c;\ - manip = m;\ - del_vector = true; \ - obj = o; \ - include = new std::vector(17, false); \ - if (i1) (*include)[0]=true;\ - if (i2) (*include)[1]=true;\ - if (i3) (*include)[2]=true;\ - if (i4) (*include)[3]=true;\ - if (i5) (*include)[4]=true;\ - if (i6) (*include)[5]=true;\ - if (i7) (*include)[6]=true;\ - if (i8) (*include)[7]=true;\ - if (i9) (*include)[8]=true;\ - if (i10) (*include)[9]=true;\ - if (i11) (*include)[10]=true;\ - if (i12) (*include)[11]=true;\ - if (i13) (*include)[12]=true;\ - if (i14) (*include)[13]=true;\ - if (i15) (*include)[14]=true;\ - if (i16) (*include)[15]=true;\ - if (i17) (*include)[16]=true;\ - } \ - template \ - NAME##_cus_equal_list::NAME##_cus_equal_list\ - (const NAME *o, cchar *d, cchar *c, Manip m, NAME##_enum i1, NAME##_enum i2, NAME##_enum i3, NAME##_enum i4, NAME##_enum i5, NAME##_enum i6, NAME##_enum i7, NAME##_enum i8, NAME##_enum i9, NAME##_enum i10, NAME##_enum i11, NAME##_enum i12, NAME##_enum i13, NAME##_enum i14, NAME##_enum i15, NAME##_enum i16, NAME##_enum i17) { \ - delem = d;\ - comp = c;\ - manip = m;\ - del_vector = true; \ - obj = o; \ - include = new std::vector(17, false); \ - if (i1 == NAME##_NULL) return;\ - (*include)[i1]=true;\ - if (i2 == NAME##_NULL) return;\ - (*include)[i2]=true;\ - if (i3 == NAME##_NULL) return;\ - (*include)[i3]=true;\ - if (i4 == NAME##_NULL) return;\ - (*include)[i4]=true;\ - if (i5 == NAME##_NULL) return;\ - (*include)[i5]=true;\ - if (i6 == NAME##_NULL) return;\ - (*include)[i6]=true;\ - if (i7 == NAME##_NULL) return;\ - (*include)[i7]=true;\ - if (i8 == NAME##_NULL) return;\ - (*include)[i8]=true;\ - if (i9 == NAME##_NULL) return;\ - (*include)[i9]=true;\ - if (i10 == NAME##_NULL) return;\ - (*include)[i10]=true;\ - if (i11 == NAME##_NULL) return;\ - (*include)[i11]=true;\ - if (i12 == NAME##_NULL) return;\ - (*include)[i12]=true;\ - if (i13 == NAME##_NULL) return;\ - (*include)[i13]=true;\ - if (i14 == NAME##_NULL) return;\ - (*include)[i14]=true;\ - if (i15 == NAME##_NULL) return;\ - (*include)[i15]=true;\ - if (i16 == NAME##_NULL) return;\ - (*include)[i16]=true;\ - if (i17 == NAME##_NULL) return;\ - (*include)[i17]=true;\ - }\ - template \ - std::ostream& operator << (std::ostream& s, const NAME##_value_list& obj) { \ - s << obj.manip << obj.obj->I1 << obj.delem;\ - s << obj.manip << obj.obj->I2 << obj.delem;\ - s << obj.manip << obj.obj->I3 << obj.delem;\ - s << obj.manip << obj.obj->I4 << obj.delem;\ - s << obj.manip << obj.obj->I5 << obj.delem;\ - s << obj.manip << obj.obj->I6 << obj.delem;\ - s << obj.manip << obj.obj->I7 << obj.delem;\ - s << obj.manip << obj.obj->I8 << obj.delem;\ - s << obj.manip << obj.obj->I9 << obj.delem;\ - s << obj.manip << obj.obj->I10 << obj.delem;\ - s << obj.manip << obj.obj->I11 << obj.delem;\ - s << obj.manip << obj.obj->I12 << obj.delem;\ - s << obj.manip << obj.obj->I13 << obj.delem;\ - s << obj.manip << obj.obj->I14 << obj.delem;\ - s << obj.manip << obj.obj->I15 << obj.delem;\ - s << obj.manip << obj.obj->I16 << obj.delem;\ - s << obj.manip << obj.obj->I17; \ - return s; \ - } \ - template \ - std::ostream& operator << (std::ostream& s, const NAME##_field_list& obj) { \ - s << obj.manip << obj.obj->names[0] << obj.delem;\ - s << obj.manip << obj.obj->names[1] << obj.delem;\ - s << obj.manip << obj.obj->names[2] << obj.delem;\ - s << obj.manip << obj.obj->names[3] << obj.delem;\ - s << obj.manip << obj.obj->names[4] << obj.delem;\ - s << obj.manip << obj.obj->names[5] << obj.delem;\ - s << obj.manip << obj.obj->names[6] << obj.delem;\ - s << obj.manip << obj.obj->names[7] << obj.delem;\ - s << obj.manip << obj.obj->names[8] << obj.delem;\ - s << obj.manip << obj.obj->names[9] << obj.delem;\ - s << obj.manip << obj.obj->names[10] << obj.delem;\ - s << obj.manip << obj.obj->names[11] << obj.delem;\ - s << obj.manip << obj.obj->names[12] << obj.delem;\ - s << obj.manip << obj.obj->names[13] << obj.delem;\ - s << obj.manip << obj.obj->names[14] << obj.delem;\ - s << obj.manip << obj.obj->names[15] << obj.delem;\ - s << obj.manip << obj.obj->names[16]; \ - return s; \ - } \ - template \ - std::ostream& operator << (std::ostream& s, const NAME##_equal_list& obj) { \ - s << obj.obj->names[0] << obj.comp << obj.manip << obj.obj->I1 << obj.delem;\ - s << obj.obj->names[1] << obj.comp << obj.manip << obj.obj->I2 << obj.delem;\ - s << obj.obj->names[2] << obj.comp << obj.manip << obj.obj->I3 << obj.delem;\ - s << obj.obj->names[3] << obj.comp << obj.manip << obj.obj->I4 << obj.delem;\ - s << obj.obj->names[4] << obj.comp << obj.manip << obj.obj->I5 << obj.delem;\ - s << obj.obj->names[5] << obj.comp << obj.manip << obj.obj->I6 << obj.delem;\ - s << obj.obj->names[6] << obj.comp << obj.manip << obj.obj->I7 << obj.delem;\ - s << obj.obj->names[7] << obj.comp << obj.manip << obj.obj->I8 << obj.delem;\ - s << obj.obj->names[8] << obj.comp << obj.manip << obj.obj->I9 << obj.delem;\ - s << obj.obj->names[9] << obj.comp << obj.manip << obj.obj->I10 << obj.delem;\ - s << obj.obj->names[10] << obj.comp << obj.manip << obj.obj->I11 << obj.delem;\ - s << obj.obj->names[11] << obj.comp << obj.manip << obj.obj->I12 << obj.delem;\ - s << obj.obj->names[12] << obj.comp << obj.manip << obj.obj->I13 << obj.delem;\ - s << obj.obj->names[13] << obj.comp << obj.manip << obj.obj->I14 << obj.delem;\ - s << obj.obj->names[14] << obj.comp << obj.manip << obj.obj->I15 << obj.delem;\ - s << obj.obj->names[15] << obj.comp << obj.manip << obj.obj->I16 << obj.delem;\ - s << obj.obj->names[16] << obj.comp << obj.manip << obj.obj->I17; \ - return s; \ - } \ - template \ - std::ostream& operator << (std::ostream& s, const NAME##_cus_value_list& obj) { \ - bool before = false; \ - if ((*obj.include)[0]) { \ - s << obj.manip << obj.obj->I1;\ - before = true; \ - } \ - if ((*obj.include)[1]) { \ - if (before) s << obj.delem;\ - s << obj.manip << obj.obj->I2;\ - before = true; \ - } \ - if ((*obj.include)[2]) { \ - if (before) s << obj.delem;\ - s << obj.manip << obj.obj->I3;\ - before = true; \ - } \ - if ((*obj.include)[3]) { \ - if (before) s << obj.delem;\ - s << obj.manip << obj.obj->I4;\ - before = true; \ - } \ - if ((*obj.include)[4]) { \ - if (before) s << obj.delem;\ - s << obj.manip << obj.obj->I5;\ - before = true; \ - } \ - if ((*obj.include)[5]) { \ - if (before) s << obj.delem;\ - s << obj.manip << obj.obj->I6;\ - before = true; \ - } \ - if ((*obj.include)[6]) { \ - if (before) s << obj.delem;\ - s << obj.manip << obj.obj->I7;\ - before = true; \ - } \ - if ((*obj.include)[7]) { \ - if (before) s << obj.delem;\ - s << obj.manip << obj.obj->I8;\ - before = true; \ - } \ - if ((*obj.include)[8]) { \ - if (before) s << obj.delem;\ - s << obj.manip << obj.obj->I9;\ - before = true; \ - } \ - if ((*obj.include)[9]) { \ - if (before) s << obj.delem;\ - s << obj.manip << obj.obj->I10;\ - before = true; \ - } \ - if ((*obj.include)[10]) { \ - if (before) s << obj.delem;\ - s << obj.manip << obj.obj->I11;\ - before = true; \ - } \ - if ((*obj.include)[11]) { \ - if (before) s << obj.delem;\ - s << obj.manip << obj.obj->I12;\ - before = true; \ - } \ - if ((*obj.include)[12]) { \ - if (before) s << obj.delem;\ - s << obj.manip << obj.obj->I13;\ - before = true; \ - } \ - if ((*obj.include)[13]) { \ - if (before) s << obj.delem;\ - s << obj.manip << obj.obj->I14;\ - before = true; \ - } \ - if ((*obj.include)[14]) { \ - if (before) s << obj.delem;\ - s << obj.manip << obj.obj->I15;\ - before = true; \ - } \ - if ((*obj.include)[15]) { \ - if (before) s << obj.delem;\ - s << obj.manip << obj.obj->I16;\ - before = true; \ - } \ - if ((*obj.include)[16]) { \ - if (before) s << obj.delem;\ - s << obj.manip << obj.obj->I17;\ - } \ - return s; \ - } \ - template \ - std::ostream& operator << (std::ostream& s, const NAME##_cus_field_list& obj) { \ - bool before = false; \ - if ((*obj.include)[0]) { \ - s << obj.manip << obj.obj->names[0];\ - before = true; \ - } \ - if ((*obj.include)[1]) { \ - if (before) s << obj.delem;\ - s << obj.manip << obj.obj->names[1];\ - before = true; \ - } \ - if ((*obj.include)[2]) { \ - if (before) s << obj.delem;\ - s << obj.manip << obj.obj->names[2];\ - before = true; \ - } \ - if ((*obj.include)[3]) { \ - if (before) s << obj.delem;\ - s << obj.manip << obj.obj->names[3];\ - before = true; \ - } \ - if ((*obj.include)[4]) { \ - if (before) s << obj.delem;\ - s << obj.manip << obj.obj->names[4];\ - before = true; \ - } \ - if ((*obj.include)[5]) { \ - if (before) s << obj.delem;\ - s << obj.manip << obj.obj->names[5];\ - before = true; \ - } \ - if ((*obj.include)[6]) { \ - if (before) s << obj.delem;\ - s << obj.manip << obj.obj->names[6];\ - before = true; \ - } \ - if ((*obj.include)[7]) { \ - if (before) s << obj.delem;\ - s << obj.manip << obj.obj->names[7];\ - before = true; \ - } \ - if ((*obj.include)[8]) { \ - if (before) s << obj.delem;\ - s << obj.manip << obj.obj->names[8];\ - before = true; \ - } \ - if ((*obj.include)[9]) { \ - if (before) s << obj.delem;\ - s << obj.manip << obj.obj->names[9];\ - before = true; \ - } \ - if ((*obj.include)[10]) { \ - if (before) s << obj.delem;\ - s << obj.manip << obj.obj->names[10];\ - before = true; \ - } \ - if ((*obj.include)[11]) { \ - if (before) s << obj.delem;\ - s << obj.manip << obj.obj->names[11];\ - before = true; \ - } \ - if ((*obj.include)[12]) { \ - if (before) s << obj.delem;\ - s << obj.manip << obj.obj->names[12];\ - before = true; \ - } \ - if ((*obj.include)[13]) { \ - if (before) s << obj.delem;\ - s << obj.manip << obj.obj->names[13];\ - before = true; \ - } \ - if ((*obj.include)[14]) { \ - if (before) s << obj.delem;\ - s << obj.manip << obj.obj->names[14];\ - before = true; \ - } \ - if ((*obj.include)[15]) { \ - if (before) s << obj.delem;\ - s << obj.manip << obj.obj->names[15];\ - before = true; \ - } \ - if ((*obj.include)[16]) { \ - if (before) s << obj.delem;\ - s << obj.manip << obj.obj->names[16];\ - } \ - return s; \ - } \ - template \ - std::ostream& operator << (std::ostream& s, const NAME##_cus_equal_list& obj) { \ - bool before = false; \ - if ((*obj.include)[0]) { \ - s << obj.obj->names[0] << obj.comp << obj.manip << obj.obj->I1;\ - before = true; \ - } \ - if ((*obj.include)[1]) { \ - if (before) s << obj.delem;\ - s << obj.obj->names[1] << obj.comp << obj.manip << obj.obj->I2;\ - before = true; \ - } \ - if ((*obj.include)[2]) { \ - if (before) s << obj.delem;\ - s << obj.obj->names[2] << obj.comp << obj.manip << obj.obj->I3;\ - before = true; \ - } \ - if ((*obj.include)[3]) { \ - if (before) s << obj.delem;\ - s << obj.obj->names[3] << obj.comp << obj.manip << obj.obj->I4;\ - before = true; \ - } \ - if ((*obj.include)[4]) { \ - if (before) s << obj.delem;\ - s << obj.obj->names[4] << obj.comp << obj.manip << obj.obj->I5;\ - before = true; \ - } \ - if ((*obj.include)[5]) { \ - if (before) s << obj.delem;\ - s << obj.obj->names[5] << obj.comp << obj.manip << obj.obj->I6;\ - before = true; \ - } \ - if ((*obj.include)[6]) { \ - if (before) s << obj.delem;\ - s << obj.obj->names[6] << obj.comp << obj.manip << obj.obj->I7;\ - before = true; \ - } \ - if ((*obj.include)[7]) { \ - if (before) s << obj.delem;\ - s << obj.obj->names[7] << obj.comp << obj.manip << obj.obj->I8;\ - before = true; \ - } \ - if ((*obj.include)[8]) { \ - if (before) s << obj.delem;\ - s << obj.obj->names[8] << obj.comp << obj.manip << obj.obj->I9;\ - before = true; \ - } \ - if ((*obj.include)[9]) { \ - if (before) s << obj.delem;\ - s << obj.obj->names[9] << obj.comp << obj.manip << obj.obj->I10;\ - before = true; \ - } \ - if ((*obj.include)[10]) { \ - if (before) s << obj.delem;\ - s << obj.obj->names[10] << obj.comp << obj.manip << obj.obj->I11;\ - before = true; \ - } \ - if ((*obj.include)[11]) { \ - if (before) s << obj.delem;\ - s << obj.obj->names[11] << obj.comp << obj.manip << obj.obj->I12;\ - before = true; \ - } \ - if ((*obj.include)[12]) { \ - if (before) s << obj.delem;\ - s << obj.obj->names[12] << obj.comp << obj.manip << obj.obj->I13;\ - before = true; \ - } \ - if ((*obj.include)[13]) { \ - if (before) s << obj.delem;\ - s << obj.obj->names[13] << obj.comp << obj.manip << obj.obj->I14;\ - before = true; \ - } \ - if ((*obj.include)[14]) { \ - if (before) s << obj.delem;\ - s << obj.obj->names[14] << obj.comp << obj.manip << obj.obj->I15;\ - before = true; \ - } \ - if ((*obj.include)[15]) { \ - if (before) s << obj.delem;\ - s << obj.obj->names[15] << obj.comp << obj.manip << obj.obj->I16;\ - before = true; \ - } \ - if ((*obj.include)[16]) { \ - if (before) s << obj.delem;\ - s << obj.obj->names[16] << obj.comp << obj.manip << obj.obj->I17;\ - } \ - return s; \ - } \ - template \ - inline NAME##_value_list NAME::value_list(cchar *d, Manip m) const { \ - return NAME##_value_list (this, d, m); \ - } \ - template \ - inline NAME##_field_list NAME::field_list(cchar *d, Manip m) const { \ - return NAME##_field_list (this, d, m); \ - } \ - template \ - inline NAME##_equal_list NAME::equal_list(cchar *d, cchar *c, Manip m) const { \ - return NAME##_equal_list (this, d, c, m); \ - } \ - template \ - inline NAME##_cus_value_list NAME::value_list(cchar *d, Manip m,\ - bool i1, bool i2, bool i3, bool i4, bool i5, bool i6, bool i7, bool i8, bool i9, bool i10, bool i11, bool i12, bool i13, bool i14, bool i15, bool i16, bool i17) const {\ - return NAME##_cus_value_list (this, d, m, i1, i2, i3, i4, i5, i6, i7, i8, i9, i10, i11, i12, i13, i14, i15, i16, i17); \ - } \ - template \ - inline NAME##_cus_field_list NAME::field_list(cchar *d, Manip m,\ - bool i1, bool i2, bool i3, bool i4, bool i5, bool i6, bool i7, bool i8, bool i9, bool i10, bool i11, bool i12, bool i13, bool i14, bool i15, bool i16, bool i17) const { \ - return NAME##_cus_field_list (this, d, m, i1, i2, i3, i4, i5, i6, i7, i8, i9, i10, i11, i12, i13, i14, i15, i16, i17); \ - } \ - template \ - inline NAME##_cus_equal_list NAME::equal_list(cchar *d, cchar *c, Manip m,\ - bool i1, bool i2, bool i3, bool i4, bool i5, bool i6, bool i7, bool i8, bool i9, bool i10, bool i11, bool i12, bool i13, bool i14, bool i15, bool i16, bool i17) const { \ - return NAME##_cus_equal_list (this, d, c, m, i1, i2, i3, i4, i5, i6, i7, i8, i9, i10, i11, i12, i13, i14, i15, i16, i17); \ - } \ - template \ - inline NAME##_cus_value_list NAME::value_list(cchar *d, Manip m,\ - NAME##_enum i1, NAME##_enum i2, NAME##_enum i3, NAME##_enum i4, NAME##_enum i5, NAME##_enum i6, NAME##_enum i7, NAME##_enum i8, NAME##_enum i9, NAME##_enum i10, NAME##_enum i11, NAME##_enum i12, NAME##_enum i13, NAME##_enum i14, NAME##_enum i15, NAME##_enum i16, NAME##_enum i17) const { \ - return NAME##_cus_value_list (this, d, m, i1, i2, i3, i4, i5, i6, i7, i8, i9, i10, i11, i12, i13, i14, i15, i16, i17); \ - } \ - template \ - inline NAME##_cus_field_list NAME::field_list(cchar *d, Manip m,\ - NAME##_enum i1, NAME##_enum i2, NAME##_enum i3, NAME##_enum i4, NAME##_enum i5, NAME##_enum i6, NAME##_enum i7, NAME##_enum i8, NAME##_enum i9, NAME##_enum i10, NAME##_enum i11, NAME##_enum i12, NAME##_enum i13, NAME##_enum i14, NAME##_enum i15, NAME##_enum i16, NAME##_enum i17) const {\ - return NAME##_cus_field_list (this, d, m, i1, i2, i3, i4, i5, i6, i7, i8, i9, i10, i11, i12, i13, i14, i15, i16, i17); \ - } \ - template \ - inline NAME##_cus_equal_list NAME::equal_list(cchar *d, cchar *c, Manip m, \ - NAME##_enum i1, NAME##_enum i2, NAME##_enum i3, NAME##_enum i4, NAME##_enum i5, NAME##_enum i6, NAME##_enum i7, NAME##_enum i8, NAME##_enum i9, NAME##_enum i10, NAME##_enum i11, NAME##_enum i12, NAME##_enum i13, NAME##_enum i14, NAME##_enum i15, NAME##_enum i16, NAME##_enum i17) const { \ - return NAME##_cus_equal_list (this, d, c, m, i1, i2, i3, i4, i5, i6, i7, i8, i9, i10, i11, i12, i13, i14, i15, i16, i17); \ - } \ - template \ - inline NAME##_cus_value_list NAME::value_list(cchar *d, Manip m,\ - std::vector *i) const {\ - return NAME##_cus_value_list (this, d, m, i);\ - }\ - template \ - inline NAME##_cus_field_list NAME::field_list(cchar *d, Manip m,\ - std::vector *i) const {\ - return NAME##_cus_field_list (this, d, m, i);\ - }\ - template \ - inline NAME##_cus_equal_list NAME::equal_list(cchar *d, cchar *c, Manip m,\ - std::vector *i) const {\ - return NAME##_cus_equal_list (this, d, c, m, i);\ - }\ - template \ - inline NAME##_cus_value_list \ - NAME::value_list(cchar *d, Manip m, sql_cmp_type /*sc*/) const {\ - sql_compare_type_def_##CMP (NAME, value, NUM);\ - }\ - template \ - inline NAME##_cus_field_list \ - NAME::field_list(cchar *d, Manip m, sql_cmp_type /*sc*/) const {\ - sql_compare_type_def_##CMP (NAME, field, NUM);\ - }\ - template \ - inline NAME##_cus_equal_list \ - NAME::equal_list(cchar *d, cchar *c, Manip m, sql_cmp_type /*sc*/) const {\ - sql_compare_type_defe_##CMP (NAME, equal, NUM);\ - }\ - template \ - void populate_##NAME (NAME *s, const Row &row) { \ - s->I1 = static_cast(row.at(O1));\ - s->I2 = static_cast(row.at(O2));\ - s->I3 = static_cast(row.at(O3));\ - s->I4 = static_cast(row.at(O4));\ - s->I5 = static_cast(row.at(O5));\ - s->I6 = static_cast(row.at(O6));\ - s->I7 = static_cast(row.at(O7));\ - s->I8 = static_cast(row.at(O8));\ - s->I9 = static_cast(row.at(O9));\ - s->I10 = static_cast(row.at(O10));\ - s->I11 = static_cast(row.at(O11));\ - s->I12 = static_cast(row.at(O12));\ - s->I13 = static_cast(row.at(O13));\ - s->I14 = static_cast(row.at(O14));\ - s->I15 = static_cast(row.at(O15));\ - s->I16 = static_cast(row.at(O16));\ - s->I17 = static_cast(row.at(O17));\ - } \ - inline NAME::NAME (const Row &row) \ - {populate_##NAME(this, row);}\ - inline void NAME::set (const Row &row)\ - {populate_##NAME(this, row);}\ - sql_COMPARE__##CMP(NAME, I1, I2, I3, I4, I5, I6, I7, I8, I9, I10, I11, I12, I13, I14, I15, I16, I17, 0, 0, 0, 0, 0, 0, 0, 0 ) - -#define sql_create_basic_17(NAME, CMP, CONTR, T1, I1, T2, I2, T3, I3, T4, I4, T5, I5, T6, I6, T7, I7, T8, I8, T9, I9, T10, I10, T11, I11, T12, I12, T13, I13, T14, I14, T15, I15, T16, I16, T17, I17) \ - sql_create_basic_c_order_17(NAME, CMP, CONTR, T1, I1, 0, T2, I2, 1, T3, I3, 2, T4, I4, 3, T5, I5, 4, T6, I6, 5, T7, I7, 6, T8, I8, 7, T9, I9, 8, T10, I10, 9, T11, I11, 10, T12, I12, 11, T13, I13, 12, T14, I14, 13, T15, I15, 14, T16, I16, 15, T17, I17, 16) - -#define sql_create_17(NAME, CMP, CONTR, T1, I1, T2, I2, T3, I3, T4, I4, T5, I5, T6, I6, T7, I7, T8, I8, T9, I9, T10, I10, T11, I11, T12, I12, T13, I13, T14, I14, T15, I15, T16, I16, T17, I17) \ - sql_create_complete_17(NAME, CMP, CONTR, T1, I1, #I1, 0, T2, I2, #I2, 1, T3, I3, #I3, 2, T4, I4, #I4, 3, T5, I5, #I5, 4, T6, I6, #I6, 5, T7, I7, #I7, 6, T8, I8, #I8, 7, T9, I9, #I9, 8, T10, I10, #I10, 9, T11, I11, #I11, 10, T12, I12, #I12, 11, T13, I13, #I13, 12, T14, I14, #I14, 13, T15, I15, #I15, 14, T16, I16, #I16, 15, T17, I17, #I17, 16) \ - -#define sql_create_c_order_17(NAME, CMP, CONTR, T1, I1, O1, T2, I2, O2, T3, I3, O3, T4, I4, O4, T5, I5, O5, T6, I6, O6, T7, I7, O7, T8, I8, O8, T9, I9, O9, T10, I10, O10, T11, I11, O11, T12, I12, O12, T13, I13, O13, T14, I14, O14, T15, I15, O15, T16, I16, O16, T17, I17, O17) \ - sql_create_complete_17(NAME, CMP, CONTR, T1, I1, #I1, O1, T2, I2, #I2, O2, T3, I3, #I3, O3, T4, I4, #I4, O4, T5, I5, #I5, O5, T6, I6, #I6, O6, T7, I7, #I7, O7, T8, I8, #I8, O8, T9, I9, #I9, O9, T10, I10, #I10, O10, T11, I11, #I11, O11, T12, I12, #I12, O12, T13, I13, #I13, O13, T14, I14, #I14, O14, T15, I15, #I15, O15, T16, I16, #I16, O16, T17, I17, #I17, O17) - -#define sql_create_c_names_17(NAME, CMP, CONTR, T1, I1, N1, T2, I2, N2, T3, I3, N3, T4, I4, N4, T5, I5, N5, T6, I6, N6, T7, I7, N7, T8, I8, N8, T9, I9, N9, T10, I10, N10, T11, I11, N11, T12, I12, N12, T13, I13, N13, T14, I14, N14, T15, I15, N15, T16, I16, N16, T17, I17, N17) \ - sql_create_complete_17(NAME, CMP, CONTR, T1, I1, N1, 0, T2, I2, N2, 1, T3, I3, N3, 2, T4, I4, N4, 3, T5, I5, N5, 4, T6, I6, N6, 5, T7, I7, N7, 6, T8, I8, N8, 7, T9, I9, N9, 8, T10, I10, N10, 9, T11, I11, N11, 10, T12, I12, N12, 11, T13, I13, N13, 12, T14, I14, N14, 13, T15, I15, N15, 14, T16, I16, N16, 15, T17, I17, N17, 16) - -// --------------------------------------------------- -// End Create 17 -// --------------------------------------------------- - -// --------------------------------------------------- -// Begin Create 18 -// --------------------------------------------------- -#define sql_create_basic_c_order_18(NAME, CMP, CONTR, T1, I1, O1, T2, I2, O2, T3, I3, O3, T4, I4, O4, T5, I5, O5, T6, I6, O6, T7, I7, O7, T8, I8, O8, T9, I9, O9, T10, I10, O10, T11, I11, O11, T12, I12, O12, T13, I13, O13, T14, I14, O14, T15, I15, O15, T16, I16, O16, T17, I17, O17, T18, I18, O18)\ - struct NAME; \ - template int sql_compare_##NAME (const NAME &, const NAME &);\ - struct NAME { \ - T1 I1;\ - T2 I2;\ - T3 I3;\ - T4 I4;\ - T5 I5;\ - T6 I6;\ - T7 I7;\ - T8 I8;\ - T9 I9;\ - T10 I10;\ - T11 I11;\ - T12 I12;\ - T13 I13;\ - T14 I14;\ - T15 I15;\ - T16 I16;\ - T17 I17;\ - T18 I18; \ - NAME () {} \ - NAME (const Row &row);\ - sql_compare_define_##CMP(NAME, T1, I1, T2, I2, T3, I3, T4, I4, T5, I5, T6, I6, T7, I7, T8, I8, T9, I9, T10, I10, T11, I11, T12, I12, T13, I13, T14, I14, T15, I15, T16, I16, T17, I17, T18, I18, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0)\ - }; \ - template \ - void populate_##NAME (NAME *s, const Row &row) { \ - s->I1 = static_cast(row.at(O1));\ - s->I2 = static_cast(row.at(O2));\ - s->I3 = static_cast(row.at(O3));\ - s->I4 = static_cast(row.at(O4));\ - s->I5 = static_cast(row.at(O5));\ - s->I6 = static_cast(row.at(O6));\ - s->I7 = static_cast(row.at(O7));\ - s->I8 = static_cast(row.at(O8));\ - s->I9 = static_cast(row.at(O9));\ - s->I10 = static_cast(row.at(O10));\ - s->I11 = static_cast(row.at(O11));\ - s->I12 = static_cast(row.at(O12));\ - s->I13 = static_cast(row.at(O13));\ - s->I14 = static_cast(row.at(O14));\ - s->I15 = static_cast(row.at(O15));\ - s->I16 = static_cast(row.at(O16));\ - s->I17 = static_cast(row.at(O17));\ - s->I18 = static_cast(row.at(O18)); \ - } \ - inline NAME::NAME (const Row &row) \ - {populate_##NAME(this, row);} \ - sql_COMPARE__##CMP(NAME, I1, I2, I3, I4, I5, I6, I7, I8, I9, I10, I11, I12, I13, I14, I15, I16, I17, I18, 0, 0, 0, 0, 0, 0, 0 ) - -#define sql_create_complete_18(NAME, CMP, CONTR, T1, I1, N1, O1, T2, I2, N2, O2, T3, I3, N3, O3, T4, I4, N4, O4, T5, I5, N5, O5, T6, I6, N6, O6, T7, I7, N7, O7, T8, I8, N8, O8, T9, I9, N9, O9, T10, I10, N10, O10, T11, I11, N11, O11, T12, I12, N12, O12, T13, I13, N13, O13, T14, I14, N14, O14, T15, I15, N15, O15, T16, I16, N16, O16, T17, I17, N17, O17, T18, I18, N18, O18) \ - struct NAME; \ - enum NAME##_enum { \ - NAME##_##I1,\ - NAME##_##I2,\ - NAME##_##I3,\ - NAME##_##I4,\ - NAME##_##I5,\ - NAME##_##I6,\ - NAME##_##I7,\ - NAME##_##I8,\ - NAME##_##I9,\ - NAME##_##I10,\ - NAME##_##I11,\ - NAME##_##I12,\ - NAME##_##I13,\ - NAME##_##I14,\ - NAME##_##I15,\ - NAME##_##I16,\ - NAME##_##I17,\ - NAME##_##I18 \ - ,NAME##_NULL \ - }; \ - template \ - class NAME##_value_list { \ - /*friend std::ostream& operator << <> (std::ostream&, const NAME##_value_list&); */\ - public: \ - const NAME *obj;\ - cchar *delem;\ - Manip manip;\ - public: \ - NAME##_value_list (const NAME *o, cchar *d, Manip m) \ - : obj(o), delem(d), manip(m) {} \ - };\ - template \ - class NAME##_##field_list {\ - /* friend std::ostream& operator << <> (std::ostream&, const NAME##_field_list&); */\ - public: \ - const NAME *obj; \ - cchar *delem;\ - Manip manip;\ - public: \ - NAME##_field_list (const NAME *o, cchar *d, Manip m) \ - : obj(o), delem(d), manip(m) {} \ - };\ - template \ - class NAME##_equal_list { \ - /* friend std::ostream& operator << <> (std::ostream&, const NAME##_equal_list&); */\ - public: \ - const NAME *obj;\ - cchar *delem;\ - cchar *comp;\ - Manip manip;\ - public: \ - NAME##_equal_list (const NAME *o, cchar *d, cchar *c, Manip m) \ - : obj(o), delem(d), comp(c), manip(m) {}\ - };\ - template \ - class NAME##_cus_value_list {\ - /* friend std::ostream& operator << <> (std::ostream&, \ - const NAME##_cus_value_list&); */\ - public:\ - const NAME *obj;\ - std::vector *include;\ - bool del_vector;\ - cchar *delem;\ - Manip manip;\ - public: \ - ~NAME##_cus_value_list () {if (del_vector) delete include;} \ - NAME##_cus_value_list (const NAME *o, cchar *d, Manip m, bool i1, bool i2, bool i3, bool i4, bool i5, bool i6, bool i7, bool i8, bool i9, bool i10, bool i11, bool i12, bool i13, bool i14, bool i15, bool i16, bool i17, bool i18);\ - NAME##_cus_value_list (const NAME *o, cchar *d, Manip m, NAME##_enum i1, NAME##_enum i2, NAME##_enum i3, NAME##_enum i4, NAME##_enum i5, NAME##_enum i6, NAME##_enum i7, NAME##_enum i8, NAME##_enum i9, NAME##_enum i10, NAME##_enum i11, NAME##_enum i12, NAME##_enum i13, NAME##_enum i14, NAME##_enum i15, NAME##_enum i16, NAME##_enum i17, NAME##_enum i18); \ - NAME##_cus_value_list (const NAME *o, cchar *d, Manip m ,std::vector* i)\ - : obj(o), include(i), del_vector(false), delem(d), manip(m) {}\ - };\ - template \ - class NAME##_cus_field_list { \ - /* friend std::ostream& operator << <> (std::ostream&, \ - const NAME##_cus_field_list&); */\ - public:\ - const NAME *obj; \ - std::vector *include; \ - bool del_vector; \ - cchar *delem;\ - Manip manip;\ - public: \ - ~NAME##_cus_field_list () {if (del_vector) delete include;} \ - NAME##_cus_field_list (const NAME *o, cchar *d, Manip m, bool i1, bool i2, bool i3, bool i4, bool i5, bool i6, bool i7, bool i8, bool i9, bool i10, bool i11, bool i12, bool i13, bool i14, bool i15, bool i16, bool i17, bool i18); \ - NAME##_cus_field_list (const NAME *o, cchar *d, Manip m, NAME##_enum i1, NAME##_enum i2, NAME##_enum i3, NAME##_enum i4, NAME##_enum i5, NAME##_enum i6, NAME##_enum i7, NAME##_enum i8, NAME##_enum i9, NAME##_enum i10, NAME##_enum i11, NAME##_enum i12, NAME##_enum i13, NAME##_enum i14, NAME##_enum i15, NAME##_enum i16, NAME##_enum i17, NAME##_enum i18); \ - NAME##_cus_field_list (const NAME *o, cchar *d, Manip m, std::vector *i) \ - : obj(o), include(i), del_vector(false), delem(d), manip(m) {}\ - };\ - template \ - class NAME##_cus_equal_list {\ - /* friend std::ostream& operator << <> (std::ostream&, \ - const NAME##_cus_equal_list&); */\ - public:\ - const NAME *obj;\ - std::vector *include;\ - bool del_vector;\ - cchar *delem;\ - cchar *comp;\ - Manip manip;\ - public:\ - ~NAME##_##cus_equal_list () {if (del_vector) delete include;}\ - NAME##_##cus_equal_list (const NAME *o, cchar *d, cchar *c, Manip m, bool i1, bool i2, bool i3, bool i4, bool i5, bool i6, bool i7, bool i8, bool i9, bool i10, bool i11, bool i12, bool i13, bool i14, bool i15, bool i16, bool i17, bool i18); \ - NAME##_##cus_equal_list (const NAME *o, cchar *d, cchar *c, Manip m, NAME##_enum i1, NAME##_enum i2, NAME##_enum i3, NAME##_enum i4, NAME##_enum i5, NAME##_enum i6, NAME##_enum i7, NAME##_enum i8, NAME##_enum i9, NAME##_enum i10, NAME##_enum i11, NAME##_enum i12, NAME##_enum i13, NAME##_enum i14, NAME##_enum i15, NAME##_enum i16, NAME##_enum i17, NAME##_enum i18); \ - NAME##_##cus_equal_list (const NAME *o, cchar *d, cchar *c, Manip m, std::vector *i) \ - : obj(o), include(i), del_vector(false), delem(d), comp(c), manip(m) {}\ - };\ - template int sql_compare_##NAME (const NAME &, const NAME &);\ - struct NAME { \ - T1 I1;\ - T2 I2;\ - T3 I3;\ - T4 I4;\ - T5 I5;\ - T6 I6;\ - T7 I7;\ - T8 I8;\ - T9 I9;\ - T10 I10;\ - T11 I11;\ - T12 I12;\ - T13 I13;\ - T14 I14;\ - T15 I15;\ - T16 I16;\ - T17 I17;\ - T18 I18; \ - NAME () {} \ - NAME (const Row &row);\ - void set (const Row &row);\ - sql_compare_define_##CMP(NAME, T1, I1, T2, I2, T3, I3, T4, I4, T5, I5, T6, I6, T7, I7, T8, I8, T9, I9, T10, I10, T11, I11, T12, I12, T13, I13, T14, I14, T15, I15, T16, I16, T17, I17, T18, I18, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0)\ - sql_construct_define_##CONTR(NAME, T1, I1, T2, I2, T3, I3, T4, I4, T5, I5, T6, I6, T7, I7, T8, I8, T9, I9, T10, I10, T11, I11, T12, I12, T13, I13, T14, I14, T15, I15, T16, I16, T17, I17, T18, I18, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0)\ - static const char *names[];\ - static const char *_table;\ - static const char *& table() {return _table;}\ - NAME##_value_list value_list() const {\ - return value_list(",", quote);}\ - NAME##_value_list value_list(cchar *d) const {\ - return value_list(d, quote);}\ - template \ - NAME##_value_list value_list(cchar *d, Manip m) const; \ - NAME##_field_list field_list() const {\ - return field_list(",", do_nothing);}\ - NAME##_field_list field_list(cchar *d) const {\ - return field_list(d, do_nothing);}\ - template \ - NAME##_field_list field_list(cchar *d, Manip m) const; \ - NAME##_equal_list equal_list(cchar *d = ",", \ - cchar *c = " = ") const{\ - return equal_list(d, c, quote);}\ - template \ - NAME##_equal_list equal_list(cchar *d, cchar *c, Manip m) const; \ - /* cus_data */\ - NAME##_cus_value_list value_list(bool i1, bool i2 = false, bool i3 = false, bool i4 = false, bool i5 = false, bool i6 = false, bool i7 = false, bool i8 = false, bool i9 = false, bool i10 = false, bool i11 = false, bool i12 = false, bool i13 = false, bool i14 = false, bool i15 = false, bool i16 = false, bool i17 = false, bool i18 = false) const {\ - return value_list(",", quote, i1, i2, i3, i4, i5, i6, i7, i8, i9, i10, i11, i12, i13, i14, i15, i16, i17, i18);\ - }\ - NAME##_cus_value_list value_list(NAME##_enum i1, NAME##_enum i2 = NAME##_NULL, NAME##_enum i3 = NAME##_NULL, NAME##_enum i4 = NAME##_NULL, NAME##_enum i5 = NAME##_NULL, NAME##_enum i6 = NAME##_NULL, NAME##_enum i7 = NAME##_NULL, NAME##_enum i8 = NAME##_NULL, NAME##_enum i9 = NAME##_NULL, NAME##_enum i10 = NAME##_NULL, NAME##_enum i11 = NAME##_NULL, NAME##_enum i12 = NAME##_NULL, NAME##_enum i13 = NAME##_NULL, NAME##_enum i14 = NAME##_NULL, NAME##_enum i15 = NAME##_NULL, NAME##_enum i16 = NAME##_NULL, NAME##_enum i17 = NAME##_NULL, NAME##_enum i18 = NAME##_NULL) const {\ - return value_list(",", quote, i1, i2, i3, i4, i5, i6, i7, i8, i9, i10, i11, i12, i13, i14, i15, i16, i17, i18);\ - }\ - NAME##_cus_value_list value_list(std::vector *i) const {\ - return value_list(",", quote, i);\ - }\ - NAME##_cus_value_list value_list(sql_cmp_type sc) const {\ - return value_list(",", quote, sc);\ - }\ - NAME##_cus_value_list value_list(cchar *d, bool i1, bool i2 = false, bool i3 = false, bool i4 = false, bool i5 = false, bool i6 = false, bool i7 = false, bool i8 = false, bool i9 = false, bool i10 = false, bool i11 = false, bool i12 = false, bool i13 = false, bool i14 = false, bool i15 = false, bool i16 = false, bool i17 = false, bool i18 = false) const {\ - return value_list(d, quote, i1, i2, i3, i4, i5, i6, i7, i8, i9, i10, i11, i12, i13, i14, i15, i16, i17, i18);\ - }\ - NAME##_cus_value_list value_list(cchar *d, NAME##_enum i1, NAME##_enum i2 = NAME##_NULL, NAME##_enum i3 = NAME##_NULL, NAME##_enum i4 = NAME##_NULL, NAME##_enum i5 = NAME##_NULL, NAME##_enum i6 = NAME##_NULL, NAME##_enum i7 = NAME##_NULL, NAME##_enum i8 = NAME##_NULL, NAME##_enum i9 = NAME##_NULL, NAME##_enum i10 = NAME##_NULL, NAME##_enum i11 = NAME##_NULL, NAME##_enum i12 = NAME##_NULL, NAME##_enum i13 = NAME##_NULL, NAME##_enum i14 = NAME##_NULL, NAME##_enum i15 = NAME##_NULL, NAME##_enum i16 = NAME##_NULL, NAME##_enum i17 = NAME##_NULL, NAME##_enum i18 = NAME##_NULL) const {\ - return value_list(d, quote, i1, i2, i3, i4, i5, i6, i7, i8, i9, i10, i11, i12, i13, i14, i15, i16, i17, i18);\ - }\ - NAME##_cus_value_list value_list(cchar *d, \ - std::vector *i) const {\ - return value_list(d, quote, i);\ - }\ - NAME##_cus_value_list value_list(cchar *d, \ - sql_cmp_type sc) const {\ - return value_list(d, quote, sc);\ - }\ - template \ - NAME##_cus_value_list value_list(cchar *d, Manip m,\ - bool i1, bool i2 = false, bool i3 = false, bool i4 = false, bool i5 = false, bool i6 = false, bool i7 = false, bool i8 = false, bool i9 = false, bool i10 = false, bool i11 = false, bool i12 = false, bool i13 = false, bool i14 = false, bool i15 = false, bool i16 = false, bool i17 = false, bool i18 = false) const; \ - template \ - NAME##_cus_value_list value_list(cchar *d, Manip m,\ - NAME##_enum i1, NAME##_enum i2 = NAME##_NULL, NAME##_enum i3 = NAME##_NULL, NAME##_enum i4 = NAME##_NULL, NAME##_enum i5 = NAME##_NULL, NAME##_enum i6 = NAME##_NULL, NAME##_enum i7 = NAME##_NULL, NAME##_enum i8 = NAME##_NULL, NAME##_enum i9 = NAME##_NULL, NAME##_enum i10 = NAME##_NULL, NAME##_enum i11 = NAME##_NULL, NAME##_enum i12 = NAME##_NULL, NAME##_enum i13 = NAME##_NULL, NAME##_enum i14 = NAME##_NULL, NAME##_enum i15 = NAME##_NULL, NAME##_enum i16 = NAME##_NULL, NAME##_enum i17 = NAME##_NULL, NAME##_enum i18 = NAME##_NULL) const; \ - template \ - NAME##_cus_value_list value_list(cchar *d, Manip m, \ - std::vector *i) const;\ - template \ - NAME##_cus_value_list value_list(cchar *d, Manip m, \ - sql_cmp_type sc) const;\ - /* cus field */\ - NAME##_cus_field_list field_list(bool i1, bool i2 = false, bool i3 = false, bool i4 = false, bool i5 = false, bool i6 = false, bool i7 = false, bool i8 = false, bool i9 = false, bool i10 = false, bool i11 = false, bool i12 = false, bool i13 = false, bool i14 = false, bool i15 = false, bool i16 = false, bool i17 = false, bool i18 = false) const {\ - return field_list(",", do_nothing, i1, i2, i3, i4, i5, i6, i7, i8, i9, i10, i11, i12, i13, i14, i15, i16, i17, i18);\ - }\ - NAME##_cus_field_list field_list(NAME##_enum i1, NAME##_enum i2 = NAME##_NULL, NAME##_enum i3 = NAME##_NULL, NAME##_enum i4 = NAME##_NULL, NAME##_enum i5 = NAME##_NULL, NAME##_enum i6 = NAME##_NULL, NAME##_enum i7 = NAME##_NULL, NAME##_enum i8 = NAME##_NULL, NAME##_enum i9 = NAME##_NULL, NAME##_enum i10 = NAME##_NULL, NAME##_enum i11 = NAME##_NULL, NAME##_enum i12 = NAME##_NULL, NAME##_enum i13 = NAME##_NULL, NAME##_enum i14 = NAME##_NULL, NAME##_enum i15 = NAME##_NULL, NAME##_enum i16 = NAME##_NULL, NAME##_enum i17 = NAME##_NULL, NAME##_enum i18 = NAME##_NULL) const {\ - return field_list(",", do_nothing, i1, i2, i3, i4, i5, i6, i7, i8, i9, i10, i11, i12, i13, i14, i15, i16, i17, i18);\ - }\ - NAME##_cus_field_list field_list(std::vector *i) const {\ - return field_list(",", do_nothing, i);\ - }\ - NAME##_cus_field_list field_list(sql_cmp_type sc) const\ - {\ - return field_list(",", do_nothing, sc);\ - }\ - NAME##_cus_field_list field_list(cchar *d, \ - bool i1, bool i2 = false, bool i3 = false, bool i4 = false, bool i5 = false, bool i6 = false, bool i7 = false, bool i8 = false, bool i9 = false, bool i10 = false, bool i11 = false, bool i12 = false, bool i13 = false, bool i14 = false, bool i15 = false, bool i16 = false, bool i17 = false, bool i18 = false) const {\ - return field_list(d, do_nothing, i1, i2, i3, i4, i5, i6, i7, i8, i9, i10, i11, i12, i13, i14, i15, i16, i17, i18);\ - }\ - NAME##_cus_field_list field_list(cchar *d,\ - NAME##_enum i1, NAME##_enum i2 = NAME##_NULL, NAME##_enum i3 = NAME##_NULL, NAME##_enum i4 = NAME##_NULL, NAME##_enum i5 = NAME##_NULL, NAME##_enum i6 = NAME##_NULL, NAME##_enum i7 = NAME##_NULL, NAME##_enum i8 = NAME##_NULL, NAME##_enum i9 = NAME##_NULL, NAME##_enum i10 = NAME##_NULL, NAME##_enum i11 = NAME##_NULL, NAME##_enum i12 = NAME##_NULL, NAME##_enum i13 = NAME##_NULL, NAME##_enum i14 = NAME##_NULL, NAME##_enum i15 = NAME##_NULL, NAME##_enum i16 = NAME##_NULL, NAME##_enum i17 = NAME##_NULL, NAME##_enum i18 = NAME##_NULL) const {\ - return field_list(d, do_nothing, i1, i2, i3, i4, i5, i6, i7, i8, i9, i10, i11, i12, i13, i14, i15, i16, i17, i18);\ - }\ - NAME##_cus_field_list field_list(cchar *d, \ - std::vector *i) const {\ - return field_list(d, do_nothing, i);\ - }\ - NAME##_cus_field_list field_list(cchar *d, \ - sql_cmp_type sc) const {\ - return field_list(d, do_nothing, sc);\ - }\ - template \ - NAME##_cus_field_list field_list(cchar *d, Manip m,\ - bool i1, bool i2 = false, bool i3 = false, bool i4 = false, bool i5 = false, bool i6 = false, bool i7 = false, bool i8 = false, bool i9 = false, bool i10 = false, bool i11 = false, bool i12 = false, bool i13 = false, bool i14 = false, bool i15 = false, bool i16 = false, bool i17 = false, bool i18 = false) const; \ - template \ - NAME##_cus_field_list field_list(cchar *d, Manip m,\ - NAME##_enum i1, NAME##_enum i2 = NAME##_NULL, NAME##_enum i3 = NAME##_NULL, NAME##_enum i4 = NAME##_NULL, NAME##_enum i5 = NAME##_NULL, NAME##_enum i6 = NAME##_NULL, NAME##_enum i7 = NAME##_NULL, NAME##_enum i8 = NAME##_NULL, NAME##_enum i9 = NAME##_NULL, NAME##_enum i10 = NAME##_NULL, NAME##_enum i11 = NAME##_NULL, NAME##_enum i12 = NAME##_NULL, NAME##_enum i13 = NAME##_NULL, NAME##_enum i14 = NAME##_NULL, NAME##_enum i15 = NAME##_NULL, NAME##_enum i16 = NAME##_NULL, NAME##_enum i17 = NAME##_NULL, NAME##_enum i18 = NAME##_NULL) const; \ - template \ - NAME##_cus_field_list field_list(cchar *d, Manip m,\ - std::vector *i) const;\ - template \ - NAME##_cus_field_list field_list(cchar *d, Manip m, \ - sql_cmp_type sc) const;\ - /* cus equal */\ - NAME##_cus_equal_list equal_list(bool i1, bool i2 = false, bool i3 = false, bool i4 = false, bool i5 = false, bool i6 = false, bool i7 = false, bool i8 = false, bool i9 = false, bool i10 = false, bool i11 = false, bool i12 = false, bool i13 = false, bool i14 = false, bool i15 = false, bool i16 = false, bool i17 = false, bool i18 = false) const {\ - return equal_list(",", " = ", quote, i1, i2, i3, i4, i5, i6, i7, i8, i9, i10, i11, i12, i13, i14, i15, i16, i17, i18);\ - }\ - NAME##_cus_equal_list equal_list(NAME##_enum i1, NAME##_enum i2 = NAME##_NULL, NAME##_enum i3 = NAME##_NULL, NAME##_enum i4 = NAME##_NULL, NAME##_enum i5 = NAME##_NULL, NAME##_enum i6 = NAME##_NULL, NAME##_enum i7 = NAME##_NULL, NAME##_enum i8 = NAME##_NULL, NAME##_enum i9 = NAME##_NULL, NAME##_enum i10 = NAME##_NULL, NAME##_enum i11 = NAME##_NULL, NAME##_enum i12 = NAME##_NULL, NAME##_enum i13 = NAME##_NULL, NAME##_enum i14 = NAME##_NULL, NAME##_enum i15 = NAME##_NULL, NAME##_enum i16 = NAME##_NULL, NAME##_enum i17 = NAME##_NULL, NAME##_enum i18 = NAME##_NULL) const {\ - return equal_list(",", " = ", quote, i1, i2, i3, i4, i5, i6, i7, i8, i9, i10, i11, i12, i13, i14, i15, i16, i17, i18);\ - }\ - NAME##_cus_equal_list equal_list(std::vector *i) const {\ - return equal_list(",", " = ", quote, i);\ - }\ - NAME##_cus_equal_list equal_list(sql_cmp_type sc) const {\ - return equal_list(",", " = ", quote, sc);\ - }\ - NAME##_cus_equal_list equal_list(cchar *d, bool i1, bool i2 = false, bool i3 = false, bool i4 = false, bool i5 = false, bool i6 = false, bool i7 = false, bool i8 = false, bool i9 = false, bool i10 = false, bool i11 = false, bool i12 = false, bool i13 = false, bool i14 = false, bool i15 = false, bool i16 = false, bool i17 = false, bool i18 = false) const {\ - return equal_list(d, " = ", quote, i1, i2, i3, i4, i5, i6, i7, i8, i9, i10, i11, i12, i13, i14, i15, i16, i17, i18);\ - }\ - NAME##_cus_equal_list equal_list(cchar *d, NAME##_enum i1, NAME##_enum i2 = NAME##_NULL, NAME##_enum i3 = NAME##_NULL, NAME##_enum i4 = NAME##_NULL, NAME##_enum i5 = NAME##_NULL, NAME##_enum i6 = NAME##_NULL, NAME##_enum i7 = NAME##_NULL, NAME##_enum i8 = NAME##_NULL, NAME##_enum i9 = NAME##_NULL, NAME##_enum i10 = NAME##_NULL, NAME##_enum i11 = NAME##_NULL, NAME##_enum i12 = NAME##_NULL, NAME##_enum i13 = NAME##_NULL, NAME##_enum i14 = NAME##_NULL, NAME##_enum i15 = NAME##_NULL, NAME##_enum i16 = NAME##_NULL, NAME##_enum i17 = NAME##_NULL, NAME##_enum i18 = NAME##_NULL) const {\ - return equal_list(d, " = ", quote, i1, i2, i3, i4, i5, i6, i7, i8, i9, i10, i11, i12, i13, i14, i15, i16, i17, i18);\ - }\ - NAME##_cus_equal_list equal_list(cchar *d, \ - std::vector *i) const {\ - return equal_list(d, " = ", quote, i);\ - }\ - NAME##_cus_equal_list equal_list(cchar *d, \ - sql_cmp_type sc) const {\ - return equal_list(d, " = ", quote, sc);\ - }\ - NAME##_cus_equal_list equal_list(cchar *d, cchar *c,\ - bool i1, bool i2 = false, bool i3 = false, bool i4 = false, bool i5 = false, bool i6 = false, bool i7 = false, bool i8 = false, bool i9 = false, bool i10 = false, bool i11 = false, bool i12 = false, bool i13 = false, bool i14 = false, bool i15 = false, bool i16 = false, bool i17 = false, bool i18 = false) const {\ - return equal_list(d, c, quote, i1, i2, i3, i4, i5, i6, i7, i8, i9, i10, i11, i12, i13, i14, i15, i16, i17, i18);\ - }\ - NAME##_cus_equal_list equal_list(cchar *d, cchar *c,\ - NAME##_enum i1, NAME##_enum i2 = NAME##_NULL, NAME##_enum i3 = NAME##_NULL, NAME##_enum i4 = NAME##_NULL, NAME##_enum i5 = NAME##_NULL, NAME##_enum i6 = NAME##_NULL, NAME##_enum i7 = NAME##_NULL, NAME##_enum i8 = NAME##_NULL, NAME##_enum i9 = NAME##_NULL, NAME##_enum i10 = NAME##_NULL, NAME##_enum i11 = NAME##_NULL, NAME##_enum i12 = NAME##_NULL, NAME##_enum i13 = NAME##_NULL, NAME##_enum i14 = NAME##_NULL, NAME##_enum i15 = NAME##_NULL, NAME##_enum i16 = NAME##_NULL, NAME##_enum i17 = NAME##_NULL, NAME##_enum i18 = NAME##_NULL) const {\ - return equal_list(d, c, quote, i1, i2, i3, i4, i5, i6, i7, i8, i9, i10, i11, i12, i13, i14, i15, i16, i17, i18);\ - }\ - NAME##_cus_equal_list equal_list(cchar *d, cchar *c,\ - std::vector *i) const {\ - return equal_list(d, c, quote, i);\ - }\ - NAME##_cus_equal_list equal_list(cchar *d, cchar *c,\ - sql_cmp_type sc) const {\ - return equal_list(d, c, quote, sc);\ - }\ - template \ - NAME##_cus_equal_list equal_list(cchar *d, cchar *c, Manip m, \ - bool i1, bool i2 = false, bool i3 = false, bool i4 = false, bool i5 = false, bool i6 = false, bool i7 = false, bool i8 = false, bool i9 = false, bool i10 = false, bool i11 = false, bool i12 = false, bool i13 = false, bool i14 = false, bool i15 = false, bool i16 = false, bool i17 = false, bool i18 = false) const; \ - template \ - NAME##_cus_equal_list equal_list(cchar *d, cchar *c, Manip m, \ - NAME##_enum i1, NAME##_enum i2 = NAME##_NULL, NAME##_enum i3 = NAME##_NULL, NAME##_enum i4 = NAME##_NULL, NAME##_enum i5 = NAME##_NULL, NAME##_enum i6 = NAME##_NULL, NAME##_enum i7 = NAME##_NULL, NAME##_enum i8 = NAME##_NULL, NAME##_enum i9 = NAME##_NULL, NAME##_enum i10 = NAME##_NULL, NAME##_enum i11 = NAME##_NULL, NAME##_enum i12 = NAME##_NULL, NAME##_enum i13 = NAME##_NULL, NAME##_enum i14 = NAME##_NULL, NAME##_enum i15 = NAME##_NULL, NAME##_enum i16 = NAME##_NULL, NAME##_enum i17 = NAME##_NULL, NAME##_enum i18 = NAME##_NULL) const; \ - template \ - NAME##_cus_equal_list equal_list(cchar *d, cchar *c, Manip m, \ - std::vector *i) const;\ - template \ - NAME##_cus_equal_list equal_list(cchar *d, cchar *c, Manip m, \ - sql_cmp_type sc) const;\ - }; \ - const char *NAME::names[] = { \ - N1 ,\ - N2 ,\ - N3 ,\ - N4 ,\ - N5 ,\ - N6 ,\ - N7 ,\ - N8 ,\ - N9 ,\ - N10 ,\ - N11 ,\ - N12 ,\ - N13 ,\ - N14 ,\ - N15 ,\ - N16 ,\ - N17 ,\ - N18 \ - }; \ - const char *NAME::_table = #NAME ; \ - template \ - NAME##_cus_value_list::NAME##_cus_value_list\ - (const NAME *o, cchar *d, Manip m, bool i1, bool i2, bool i3, bool i4, bool i5, bool i6, bool i7, bool i8, bool i9, bool i10, bool i11, bool i12, bool i13, bool i14, bool i15, bool i16, bool i17, bool i18) \ - { \ - delem = d;\ - manip = m;\ - del_vector = true;\ - obj = o; \ - include = new std::vector(18, false);\ - if (i1) (*include)[0]=true;\ - if (i2) (*include)[1]=true;\ - if (i3) (*include)[2]=true;\ - if (i4) (*include)[3]=true;\ - if (i5) (*include)[4]=true;\ - if (i6) (*include)[5]=true;\ - if (i7) (*include)[6]=true;\ - if (i8) (*include)[7]=true;\ - if (i9) (*include)[8]=true;\ - if (i10) (*include)[9]=true;\ - if (i11) (*include)[10]=true;\ - if (i12) (*include)[11]=true;\ - if (i13) (*include)[12]=true;\ - if (i14) (*include)[13]=true;\ - if (i15) (*include)[14]=true;\ - if (i16) (*include)[15]=true;\ - if (i17) (*include)[16]=true;\ - if (i18) (*include)[17]=true;\ - } \ - template \ - NAME##_cus_value_list::NAME##_cus_value_list\ - (const NAME *o, cchar *d, Manip m, NAME##_enum i1, NAME##_enum i2, NAME##_enum i3, NAME##_enum i4, NAME##_enum i5, NAME##_enum i6, NAME##_enum i7, NAME##_enum i8, NAME##_enum i9, NAME##_enum i10, NAME##_enum i11, NAME##_enum i12, NAME##_enum i13, NAME##_enum i14, NAME##_enum i15, NAME##_enum i16, NAME##_enum i17, NAME##_enum i18) { \ - delem = d;\ - manip = m;\ - del_vector = true; \ - obj = o; \ - include = new std::vector(18, false); \ - if (i1 == NAME##_NULL) return;\ - (*include)[i1]=true;\ - if (i2 == NAME##_NULL) return;\ - (*include)[i2]=true;\ - if (i3 == NAME##_NULL) return;\ - (*include)[i3]=true;\ - if (i4 == NAME##_NULL) return;\ - (*include)[i4]=true;\ - if (i5 == NAME##_NULL) return;\ - (*include)[i5]=true;\ - if (i6 == NAME##_NULL) return;\ - (*include)[i6]=true;\ - if (i7 == NAME##_NULL) return;\ - (*include)[i7]=true;\ - if (i8 == NAME##_NULL) return;\ - (*include)[i8]=true;\ - if (i9 == NAME##_NULL) return;\ - (*include)[i9]=true;\ - if (i10 == NAME##_NULL) return;\ - (*include)[i10]=true;\ - if (i11 == NAME##_NULL) return;\ - (*include)[i11]=true;\ - if (i12 == NAME##_NULL) return;\ - (*include)[i12]=true;\ - if (i13 == NAME##_NULL) return;\ - (*include)[i13]=true;\ - if (i14 == NAME##_NULL) return;\ - (*include)[i14]=true;\ - if (i15 == NAME##_NULL) return;\ - (*include)[i15]=true;\ - if (i16 == NAME##_NULL) return;\ - (*include)[i16]=true;\ - if (i17 == NAME##_NULL) return;\ - (*include)[i17]=true;\ - if (i18 == NAME##_NULL) return;\ - (*include)[i18]=true;\ - }\ - template \ - NAME##_cus_field_list::NAME##_cus_field_list\ - (const NAME *o, cchar *d, Manip m, bool i1, bool i2, bool i3, bool i4, bool i5, bool i6, bool i7, bool i8, bool i9, bool i10, bool i11, bool i12, bool i13, bool i14, bool i15, bool i16, bool i17, bool i18) {\ - delem = d;\ - manip = m;\ - del_vector = true; \ - obj = o; \ - include = new std::vector(18, false); \ - if (i1) (*include)[0]=true;\ - if (i2) (*include)[1]=true;\ - if (i3) (*include)[2]=true;\ - if (i4) (*include)[3]=true;\ - if (i5) (*include)[4]=true;\ - if (i6) (*include)[5]=true;\ - if (i7) (*include)[6]=true;\ - if (i8) (*include)[7]=true;\ - if (i9) (*include)[8]=true;\ - if (i10) (*include)[9]=true;\ - if (i11) (*include)[10]=true;\ - if (i12) (*include)[11]=true;\ - if (i13) (*include)[12]=true;\ - if (i14) (*include)[13]=true;\ - if (i15) (*include)[14]=true;\ - if (i16) (*include)[15]=true;\ - if (i17) (*include)[16]=true;\ - if (i18) (*include)[17]=true;\ - } \ - template \ - NAME##_cus_field_list::NAME##_cus_field_list\ - (const NAME *o, cchar *d, Manip m, NAME##_enum i1, NAME##_enum i2, NAME##_enum i3, NAME##_enum i4, NAME##_enum i5, NAME##_enum i6, NAME##_enum i7, NAME##_enum i8, NAME##_enum i9, NAME##_enum i10, NAME##_enum i11, NAME##_enum i12, NAME##_enum i13, NAME##_enum i14, NAME##_enum i15, NAME##_enum i16, NAME##_enum i17, NAME##_enum i18) { \ - delem = d;\ - manip = m;\ - del_vector = true; \ - obj = o; \ - include = new std::vector(18, false); \ - if (i1 == NAME##_NULL) return;\ - (*include)[i1]=true;\ - if (i2 == NAME##_NULL) return;\ - (*include)[i2]=true;\ - if (i3 == NAME##_NULL) return;\ - (*include)[i3]=true;\ - if (i4 == NAME##_NULL) return;\ - (*include)[i4]=true;\ - if (i5 == NAME##_NULL) return;\ - (*include)[i5]=true;\ - if (i6 == NAME##_NULL) return;\ - (*include)[i6]=true;\ - if (i7 == NAME##_NULL) return;\ - (*include)[i7]=true;\ - if (i8 == NAME##_NULL) return;\ - (*include)[i8]=true;\ - if (i9 == NAME##_NULL) return;\ - (*include)[i9]=true;\ - if (i10 == NAME##_NULL) return;\ - (*include)[i10]=true;\ - if (i11 == NAME##_NULL) return;\ - (*include)[i11]=true;\ - if (i12 == NAME##_NULL) return;\ - (*include)[i12]=true;\ - if (i13 == NAME##_NULL) return;\ - (*include)[i13]=true;\ - if (i14 == NAME##_NULL) return;\ - (*include)[i14]=true;\ - if (i15 == NAME##_NULL) return;\ - (*include)[i15]=true;\ - if (i16 == NAME##_NULL) return;\ - (*include)[i16]=true;\ - if (i17 == NAME##_NULL) return;\ - (*include)[i17]=true;\ - if (i18 == NAME##_NULL) return;\ - (*include)[i18]=true;\ - }\ - template \ - NAME##_cus_equal_list::NAME##_cus_equal_list\ - (const NAME *o, cchar *d, cchar *c, Manip m, bool i1, bool i2, bool i3, bool i4, bool i5, bool i6, bool i7, bool i8, bool i9, bool i10, bool i11, bool i12, bool i13, bool i14, bool i15, bool i16, bool i17, bool i18) { \ - delem = d;\ - comp = c;\ - manip = m;\ - del_vector = true; \ - obj = o; \ - include = new std::vector(18, false); \ - if (i1) (*include)[0]=true;\ - if (i2) (*include)[1]=true;\ - if (i3) (*include)[2]=true;\ - if (i4) (*include)[3]=true;\ - if (i5) (*include)[4]=true;\ - if (i6) (*include)[5]=true;\ - if (i7) (*include)[6]=true;\ - if (i8) (*include)[7]=true;\ - if (i9) (*include)[8]=true;\ - if (i10) (*include)[9]=true;\ - if (i11) (*include)[10]=true;\ - if (i12) (*include)[11]=true;\ - if (i13) (*include)[12]=true;\ - if (i14) (*include)[13]=true;\ - if (i15) (*include)[14]=true;\ - if (i16) (*include)[15]=true;\ - if (i17) (*include)[16]=true;\ - if (i18) (*include)[17]=true;\ - } \ - template \ - NAME##_cus_equal_list::NAME##_cus_equal_list\ - (const NAME *o, cchar *d, cchar *c, Manip m, NAME##_enum i1, NAME##_enum i2, NAME##_enum i3, NAME##_enum i4, NAME##_enum i5, NAME##_enum i6, NAME##_enum i7, NAME##_enum i8, NAME##_enum i9, NAME##_enum i10, NAME##_enum i11, NAME##_enum i12, NAME##_enum i13, NAME##_enum i14, NAME##_enum i15, NAME##_enum i16, NAME##_enum i17, NAME##_enum i18) { \ - delem = d;\ - comp = c;\ - manip = m;\ - del_vector = true; \ - obj = o; \ - include = new std::vector(18, false); \ - if (i1 == NAME##_NULL) return;\ - (*include)[i1]=true;\ - if (i2 == NAME##_NULL) return;\ - (*include)[i2]=true;\ - if (i3 == NAME##_NULL) return;\ - (*include)[i3]=true;\ - if (i4 == NAME##_NULL) return;\ - (*include)[i4]=true;\ - if (i5 == NAME##_NULL) return;\ - (*include)[i5]=true;\ - if (i6 == NAME##_NULL) return;\ - (*include)[i6]=true;\ - if (i7 == NAME##_NULL) return;\ - (*include)[i7]=true;\ - if (i8 == NAME##_NULL) return;\ - (*include)[i8]=true;\ - if (i9 == NAME##_NULL) return;\ - (*include)[i9]=true;\ - if (i10 == NAME##_NULL) return;\ - (*include)[i10]=true;\ - if (i11 == NAME##_NULL) return;\ - (*include)[i11]=true;\ - if (i12 == NAME##_NULL) return;\ - (*include)[i12]=true;\ - if (i13 == NAME##_NULL) return;\ - (*include)[i13]=true;\ - if (i14 == NAME##_NULL) return;\ - (*include)[i14]=true;\ - if (i15 == NAME##_NULL) return;\ - (*include)[i15]=true;\ - if (i16 == NAME##_NULL) return;\ - (*include)[i16]=true;\ - if (i17 == NAME##_NULL) return;\ - (*include)[i17]=true;\ - if (i18 == NAME##_NULL) return;\ - (*include)[i18]=true;\ - }\ - template \ - std::ostream& operator << (std::ostream& s, const NAME##_value_list& obj) { \ - s << obj.manip << obj.obj->I1 << obj.delem;\ - s << obj.manip << obj.obj->I2 << obj.delem;\ - s << obj.manip << obj.obj->I3 << obj.delem;\ - s << obj.manip << obj.obj->I4 << obj.delem;\ - s << obj.manip << obj.obj->I5 << obj.delem;\ - s << obj.manip << obj.obj->I6 << obj.delem;\ - s << obj.manip << obj.obj->I7 << obj.delem;\ - s << obj.manip << obj.obj->I8 << obj.delem;\ - s << obj.manip << obj.obj->I9 << obj.delem;\ - s << obj.manip << obj.obj->I10 << obj.delem;\ - s << obj.manip << obj.obj->I11 << obj.delem;\ - s << obj.manip << obj.obj->I12 << obj.delem;\ - s << obj.manip << obj.obj->I13 << obj.delem;\ - s << obj.manip << obj.obj->I14 << obj.delem;\ - s << obj.manip << obj.obj->I15 << obj.delem;\ - s << obj.manip << obj.obj->I16 << obj.delem;\ - s << obj.manip << obj.obj->I17 << obj.delem;\ - s << obj.manip << obj.obj->I18; \ - return s; \ - } \ - template \ - std::ostream& operator << (std::ostream& s, const NAME##_field_list& obj) { \ - s << obj.manip << obj.obj->names[0] << obj.delem;\ - s << obj.manip << obj.obj->names[1] << obj.delem;\ - s << obj.manip << obj.obj->names[2] << obj.delem;\ - s << obj.manip << obj.obj->names[3] << obj.delem;\ - s << obj.manip << obj.obj->names[4] << obj.delem;\ - s << obj.manip << obj.obj->names[5] << obj.delem;\ - s << obj.manip << obj.obj->names[6] << obj.delem;\ - s << obj.manip << obj.obj->names[7] << obj.delem;\ - s << obj.manip << obj.obj->names[8] << obj.delem;\ - s << obj.manip << obj.obj->names[9] << obj.delem;\ - s << obj.manip << obj.obj->names[10] << obj.delem;\ - s << obj.manip << obj.obj->names[11] << obj.delem;\ - s << obj.manip << obj.obj->names[12] << obj.delem;\ - s << obj.manip << obj.obj->names[13] << obj.delem;\ - s << obj.manip << obj.obj->names[14] << obj.delem;\ - s << obj.manip << obj.obj->names[15] << obj.delem;\ - s << obj.manip << obj.obj->names[16] << obj.delem;\ - s << obj.manip << obj.obj->names[17]; \ - return s; \ - } \ - template \ - std::ostream& operator << (std::ostream& s, const NAME##_equal_list& obj) { \ - s << obj.obj->names[0] << obj.comp << obj.manip << obj.obj->I1 << obj.delem;\ - s << obj.obj->names[1] << obj.comp << obj.manip << obj.obj->I2 << obj.delem;\ - s << obj.obj->names[2] << obj.comp << obj.manip << obj.obj->I3 << obj.delem;\ - s << obj.obj->names[3] << obj.comp << obj.manip << obj.obj->I4 << obj.delem;\ - s << obj.obj->names[4] << obj.comp << obj.manip << obj.obj->I5 << obj.delem;\ - s << obj.obj->names[5] << obj.comp << obj.manip << obj.obj->I6 << obj.delem;\ - s << obj.obj->names[6] << obj.comp << obj.manip << obj.obj->I7 << obj.delem;\ - s << obj.obj->names[7] << obj.comp << obj.manip << obj.obj->I8 << obj.delem;\ - s << obj.obj->names[8] << obj.comp << obj.manip << obj.obj->I9 << obj.delem;\ - s << obj.obj->names[9] << obj.comp << obj.manip << obj.obj->I10 << obj.delem;\ - s << obj.obj->names[10] << obj.comp << obj.manip << obj.obj->I11 << obj.delem;\ - s << obj.obj->names[11] << obj.comp << obj.manip << obj.obj->I12 << obj.delem;\ - s << obj.obj->names[12] << obj.comp << obj.manip << obj.obj->I13 << obj.delem;\ - s << obj.obj->names[13] << obj.comp << obj.manip << obj.obj->I14 << obj.delem;\ - s << obj.obj->names[14] << obj.comp << obj.manip << obj.obj->I15 << obj.delem;\ - s << obj.obj->names[15] << obj.comp << obj.manip << obj.obj->I16 << obj.delem;\ - s << obj.obj->names[16] << obj.comp << obj.manip << obj.obj->I17 << obj.delem;\ - s << obj.obj->names[17] << obj.comp << obj.manip << obj.obj->I18; \ - return s; \ - } \ - template \ - std::ostream& operator << (std::ostream& s, const NAME##_cus_value_list& obj) { \ - bool before = false; \ - if ((*obj.include)[0]) { \ - s << obj.manip << obj.obj->I1;\ - before = true; \ - } \ - if ((*obj.include)[1]) { \ - if (before) s << obj.delem;\ - s << obj.manip << obj.obj->I2;\ - before = true; \ - } \ - if ((*obj.include)[2]) { \ - if (before) s << obj.delem;\ - s << obj.manip << obj.obj->I3;\ - before = true; \ - } \ - if ((*obj.include)[3]) { \ - if (before) s << obj.delem;\ - s << obj.manip << obj.obj->I4;\ - before = true; \ - } \ - if ((*obj.include)[4]) { \ - if (before) s << obj.delem;\ - s << obj.manip << obj.obj->I5;\ - before = true; \ - } \ - if ((*obj.include)[5]) { \ - if (before) s << obj.delem;\ - s << obj.manip << obj.obj->I6;\ - before = true; \ - } \ - if ((*obj.include)[6]) { \ - if (before) s << obj.delem;\ - s << obj.manip << obj.obj->I7;\ - before = true; \ - } \ - if ((*obj.include)[7]) { \ - if (before) s << obj.delem;\ - s << obj.manip << obj.obj->I8;\ - before = true; \ - } \ - if ((*obj.include)[8]) { \ - if (before) s << obj.delem;\ - s << obj.manip << obj.obj->I9;\ - before = true; \ - } \ - if ((*obj.include)[9]) { \ - if (before) s << obj.delem;\ - s << obj.manip << obj.obj->I10;\ - before = true; \ - } \ - if ((*obj.include)[10]) { \ - if (before) s << obj.delem;\ - s << obj.manip << obj.obj->I11;\ - before = true; \ - } \ - if ((*obj.include)[11]) { \ - if (before) s << obj.delem;\ - s << obj.manip << obj.obj->I12;\ - before = true; \ - } \ - if ((*obj.include)[12]) { \ - if (before) s << obj.delem;\ - s << obj.manip << obj.obj->I13;\ - before = true; \ - } \ - if ((*obj.include)[13]) { \ - if (before) s << obj.delem;\ - s << obj.manip << obj.obj->I14;\ - before = true; \ - } \ - if ((*obj.include)[14]) { \ - if (before) s << obj.delem;\ - s << obj.manip << obj.obj->I15;\ - before = true; \ - } \ - if ((*obj.include)[15]) { \ - if (before) s << obj.delem;\ - s << obj.manip << obj.obj->I16;\ - before = true; \ - } \ - if ((*obj.include)[16]) { \ - if (before) s << obj.delem;\ - s << obj.manip << obj.obj->I17;\ - before = true; \ - } \ - if ((*obj.include)[17]) { \ - if (before) s << obj.delem;\ - s << obj.manip << obj.obj->I18;\ - } \ - return s; \ - } \ - template \ - std::ostream& operator << (std::ostream& s, const NAME##_cus_field_list& obj) { \ - bool before = false; \ - if ((*obj.include)[0]) { \ - s << obj.manip << obj.obj->names[0];\ - before = true; \ - } \ - if ((*obj.include)[1]) { \ - if (before) s << obj.delem;\ - s << obj.manip << obj.obj->names[1];\ - before = true; \ - } \ - if ((*obj.include)[2]) { \ - if (before) s << obj.delem;\ - s << obj.manip << obj.obj->names[2];\ - before = true; \ - } \ - if ((*obj.include)[3]) { \ - if (before) s << obj.delem;\ - s << obj.manip << obj.obj->names[3];\ - before = true; \ - } \ - if ((*obj.include)[4]) { \ - if (before) s << obj.delem;\ - s << obj.manip << obj.obj->names[4];\ - before = true; \ - } \ - if ((*obj.include)[5]) { \ - if (before) s << obj.delem;\ - s << obj.manip << obj.obj->names[5];\ - before = true; \ - } \ - if ((*obj.include)[6]) { \ - if (before) s << obj.delem;\ - s << obj.manip << obj.obj->names[6];\ - before = true; \ - } \ - if ((*obj.include)[7]) { \ - if (before) s << obj.delem;\ - s << obj.manip << obj.obj->names[7];\ - before = true; \ - } \ - if ((*obj.include)[8]) { \ - if (before) s << obj.delem;\ - s << obj.manip << obj.obj->names[8];\ - before = true; \ - } \ - if ((*obj.include)[9]) { \ - if (before) s << obj.delem;\ - s << obj.manip << obj.obj->names[9];\ - before = true; \ - } \ - if ((*obj.include)[10]) { \ - if (before) s << obj.delem;\ - s << obj.manip << obj.obj->names[10];\ - before = true; \ - } \ - if ((*obj.include)[11]) { \ - if (before) s << obj.delem;\ - s << obj.manip << obj.obj->names[11];\ - before = true; \ - } \ - if ((*obj.include)[12]) { \ - if (before) s << obj.delem;\ - s << obj.manip << obj.obj->names[12];\ - before = true; \ - } \ - if ((*obj.include)[13]) { \ - if (before) s << obj.delem;\ - s << obj.manip << obj.obj->names[13];\ - before = true; \ - } \ - if ((*obj.include)[14]) { \ - if (before) s << obj.delem;\ - s << obj.manip << obj.obj->names[14];\ - before = true; \ - } \ - if ((*obj.include)[15]) { \ - if (before) s << obj.delem;\ - s << obj.manip << obj.obj->names[15];\ - before = true; \ - } \ - if ((*obj.include)[16]) { \ - if (before) s << obj.delem;\ - s << obj.manip << obj.obj->names[16];\ - before = true; \ - } \ - if ((*obj.include)[17]) { \ - if (before) s << obj.delem;\ - s << obj.manip << obj.obj->names[17];\ - } \ - return s; \ - } \ - template \ - std::ostream& operator << (std::ostream& s, const NAME##_cus_equal_list& obj) { \ - bool before = false; \ - if ((*obj.include)[0]) { \ - s << obj.obj->names[0] << obj.comp << obj.manip << obj.obj->I1;\ - before = true; \ - } \ - if ((*obj.include)[1]) { \ - if (before) s << obj.delem;\ - s << obj.obj->names[1] << obj.comp << obj.manip << obj.obj->I2;\ - before = true; \ - } \ - if ((*obj.include)[2]) { \ - if (before) s << obj.delem;\ - s << obj.obj->names[2] << obj.comp << obj.manip << obj.obj->I3;\ - before = true; \ - } \ - if ((*obj.include)[3]) { \ - if (before) s << obj.delem;\ - s << obj.obj->names[3] << obj.comp << obj.manip << obj.obj->I4;\ - before = true; \ - } \ - if ((*obj.include)[4]) { \ - if (before) s << obj.delem;\ - s << obj.obj->names[4] << obj.comp << obj.manip << obj.obj->I5;\ - before = true; \ - } \ - if ((*obj.include)[5]) { \ - if (before) s << obj.delem;\ - s << obj.obj->names[5] << obj.comp << obj.manip << obj.obj->I6;\ - before = true; \ - } \ - if ((*obj.include)[6]) { \ - if (before) s << obj.delem;\ - s << obj.obj->names[6] << obj.comp << obj.manip << obj.obj->I7;\ - before = true; \ - } \ - if ((*obj.include)[7]) { \ - if (before) s << obj.delem;\ - s << obj.obj->names[7] << obj.comp << obj.manip << obj.obj->I8;\ - before = true; \ - } \ - if ((*obj.include)[8]) { \ - if (before) s << obj.delem;\ - s << obj.obj->names[8] << obj.comp << obj.manip << obj.obj->I9;\ - before = true; \ - } \ - if ((*obj.include)[9]) { \ - if (before) s << obj.delem;\ - s << obj.obj->names[9] << obj.comp << obj.manip << obj.obj->I10;\ - before = true; \ - } \ - if ((*obj.include)[10]) { \ - if (before) s << obj.delem;\ - s << obj.obj->names[10] << obj.comp << obj.manip << obj.obj->I11;\ - before = true; \ - } \ - if ((*obj.include)[11]) { \ - if (before) s << obj.delem;\ - s << obj.obj->names[11] << obj.comp << obj.manip << obj.obj->I12;\ - before = true; \ - } \ - if ((*obj.include)[12]) { \ - if (before) s << obj.delem;\ - s << obj.obj->names[12] << obj.comp << obj.manip << obj.obj->I13;\ - before = true; \ - } \ - if ((*obj.include)[13]) { \ - if (before) s << obj.delem;\ - s << obj.obj->names[13] << obj.comp << obj.manip << obj.obj->I14;\ - before = true; \ - } \ - if ((*obj.include)[14]) { \ - if (before) s << obj.delem;\ - s << obj.obj->names[14] << obj.comp << obj.manip << obj.obj->I15;\ - before = true; \ - } \ - if ((*obj.include)[15]) { \ - if (before) s << obj.delem;\ - s << obj.obj->names[15] << obj.comp << obj.manip << obj.obj->I16;\ - before = true; \ - } \ - if ((*obj.include)[16]) { \ - if (before) s << obj.delem;\ - s << obj.obj->names[16] << obj.comp << obj.manip << obj.obj->I17;\ - before = true; \ - } \ - if ((*obj.include)[17]) { \ - if (before) s << obj.delem;\ - s << obj.obj->names[17] << obj.comp << obj.manip << obj.obj->I18;\ - } \ - return s; \ - } \ - template \ - inline NAME##_value_list NAME::value_list(cchar *d, Manip m) const { \ - return NAME##_value_list (this, d, m); \ - } \ - template \ - inline NAME##_field_list NAME::field_list(cchar *d, Manip m) const { \ - return NAME##_field_list (this, d, m); \ - } \ - template \ - inline NAME##_equal_list NAME::equal_list(cchar *d, cchar *c, Manip m) const { \ - return NAME##_equal_list (this, d, c, m); \ - } \ - template \ - inline NAME##_cus_value_list NAME::value_list(cchar *d, Manip m,\ - bool i1, bool i2, bool i3, bool i4, bool i5, bool i6, bool i7, bool i8, bool i9, bool i10, bool i11, bool i12, bool i13, bool i14, bool i15, bool i16, bool i17, bool i18) const {\ - return NAME##_cus_value_list (this, d, m, i1, i2, i3, i4, i5, i6, i7, i8, i9, i10, i11, i12, i13, i14, i15, i16, i17, i18); \ - } \ - template \ - inline NAME##_cus_field_list NAME::field_list(cchar *d, Manip m,\ - bool i1, bool i2, bool i3, bool i4, bool i5, bool i6, bool i7, bool i8, bool i9, bool i10, bool i11, bool i12, bool i13, bool i14, bool i15, bool i16, bool i17, bool i18) const { \ - return NAME##_cus_field_list (this, d, m, i1, i2, i3, i4, i5, i6, i7, i8, i9, i10, i11, i12, i13, i14, i15, i16, i17, i18); \ - } \ - template \ - inline NAME##_cus_equal_list NAME::equal_list(cchar *d, cchar *c, Manip m,\ - bool i1, bool i2, bool i3, bool i4, bool i5, bool i6, bool i7, bool i8, bool i9, bool i10, bool i11, bool i12, bool i13, bool i14, bool i15, bool i16, bool i17, bool i18) const { \ - return NAME##_cus_equal_list (this, d, c, m, i1, i2, i3, i4, i5, i6, i7, i8, i9, i10, i11, i12, i13, i14, i15, i16, i17, i18); \ - } \ - template \ - inline NAME##_cus_value_list NAME::value_list(cchar *d, Manip m,\ - NAME##_enum i1, NAME##_enum i2, NAME##_enum i3, NAME##_enum i4, NAME##_enum i5, NAME##_enum i6, NAME##_enum i7, NAME##_enum i8, NAME##_enum i9, NAME##_enum i10, NAME##_enum i11, NAME##_enum i12, NAME##_enum i13, NAME##_enum i14, NAME##_enum i15, NAME##_enum i16, NAME##_enum i17, NAME##_enum i18) const { \ - return NAME##_cus_value_list (this, d, m, i1, i2, i3, i4, i5, i6, i7, i8, i9, i10, i11, i12, i13, i14, i15, i16, i17, i18); \ - } \ - template \ - inline NAME##_cus_field_list NAME::field_list(cchar *d, Manip m,\ - NAME##_enum i1, NAME##_enum i2, NAME##_enum i3, NAME##_enum i4, NAME##_enum i5, NAME##_enum i6, NAME##_enum i7, NAME##_enum i8, NAME##_enum i9, NAME##_enum i10, NAME##_enum i11, NAME##_enum i12, NAME##_enum i13, NAME##_enum i14, NAME##_enum i15, NAME##_enum i16, NAME##_enum i17, NAME##_enum i18) const {\ - return NAME##_cus_field_list (this, d, m, i1, i2, i3, i4, i5, i6, i7, i8, i9, i10, i11, i12, i13, i14, i15, i16, i17, i18); \ - } \ - template \ - inline NAME##_cus_equal_list NAME::equal_list(cchar *d, cchar *c, Manip m, \ - NAME##_enum i1, NAME##_enum i2, NAME##_enum i3, NAME##_enum i4, NAME##_enum i5, NAME##_enum i6, NAME##_enum i7, NAME##_enum i8, NAME##_enum i9, NAME##_enum i10, NAME##_enum i11, NAME##_enum i12, NAME##_enum i13, NAME##_enum i14, NAME##_enum i15, NAME##_enum i16, NAME##_enum i17, NAME##_enum i18) const { \ - return NAME##_cus_equal_list (this, d, c, m, i1, i2, i3, i4, i5, i6, i7, i8, i9, i10, i11, i12, i13, i14, i15, i16, i17, i18); \ - } \ - template \ - inline NAME##_cus_value_list NAME::value_list(cchar *d, Manip m,\ - std::vector *i) const {\ - return NAME##_cus_value_list (this, d, m, i);\ - }\ - template \ - inline NAME##_cus_field_list NAME::field_list(cchar *d, Manip m,\ - std::vector *i) const {\ - return NAME##_cus_field_list (this, d, m, i);\ - }\ - template \ - inline NAME##_cus_equal_list NAME::equal_list(cchar *d, cchar *c, Manip m,\ - std::vector *i) const {\ - return NAME##_cus_equal_list (this, d, c, m, i);\ - }\ - template \ - inline NAME##_cus_value_list \ - NAME::value_list(cchar *d, Manip m, sql_cmp_type /*sc*/) const {\ - sql_compare_type_def_##CMP (NAME, value, NUM);\ - }\ - template \ - inline NAME##_cus_field_list \ - NAME::field_list(cchar *d, Manip m, sql_cmp_type /*sc*/) const {\ - sql_compare_type_def_##CMP (NAME, field, NUM);\ - }\ - template \ - inline NAME##_cus_equal_list \ - NAME::equal_list(cchar *d, cchar *c, Manip m, sql_cmp_type /*sc*/) const {\ - sql_compare_type_defe_##CMP (NAME, equal, NUM);\ - }\ - template \ - void populate_##NAME (NAME *s, const Row &row) { \ - s->I1 = static_cast(row.at(O1));\ - s->I2 = static_cast(row.at(O2));\ - s->I3 = static_cast(row.at(O3));\ - s->I4 = static_cast(row.at(O4));\ - s->I5 = static_cast(row.at(O5));\ - s->I6 = static_cast(row.at(O6));\ - s->I7 = static_cast(row.at(O7));\ - s->I8 = static_cast(row.at(O8));\ - s->I9 = static_cast(row.at(O9));\ - s->I10 = static_cast(row.at(O10));\ - s->I11 = static_cast(row.at(O11));\ - s->I12 = static_cast(row.at(O12));\ - s->I13 = static_cast(row.at(O13));\ - s->I14 = static_cast(row.at(O14));\ - s->I15 = static_cast(row.at(O15));\ - s->I16 = static_cast(row.at(O16));\ - s->I17 = static_cast(row.at(O17));\ - s->I18 = static_cast(row.at(O18));\ - } \ - inline NAME::NAME (const Row &row) \ - {populate_##NAME(this, row);}\ - inline void NAME::set (const Row &row)\ - {populate_##NAME(this, row);}\ - sql_COMPARE__##CMP(NAME, I1, I2, I3, I4, I5, I6, I7, I8, I9, I10, I11, I12, I13, I14, I15, I16, I17, I18, 0, 0, 0, 0, 0, 0, 0 ) - -#define sql_create_basic_18(NAME, CMP, CONTR, T1, I1, T2, I2, T3, I3, T4, I4, T5, I5, T6, I6, T7, I7, T8, I8, T9, I9, T10, I10, T11, I11, T12, I12, T13, I13, T14, I14, T15, I15, T16, I16, T17, I17, T18, I18) \ - sql_create_basic_c_order_18(NAME, CMP, CONTR, T1, I1, 0, T2, I2, 1, T3, I3, 2, T4, I4, 3, T5, I5, 4, T6, I6, 5, T7, I7, 6, T8, I8, 7, T9, I9, 8, T10, I10, 9, T11, I11, 10, T12, I12, 11, T13, I13, 12, T14, I14, 13, T15, I15, 14, T16, I16, 15, T17, I17, 16, T18, I18, 17) - -#define sql_create_18(NAME, CMP, CONTR, T1, I1, T2, I2, T3, I3, T4, I4, T5, I5, T6, I6, T7, I7, T8, I8, T9, I9, T10, I10, T11, I11, T12, I12, T13, I13, T14, I14, T15, I15, T16, I16, T17, I17, T18, I18) \ - sql_create_complete_18(NAME, CMP, CONTR, T1, I1, #I1, 0, T2, I2, #I2, 1, T3, I3, #I3, 2, T4, I4, #I4, 3, T5, I5, #I5, 4, T6, I6, #I6, 5, T7, I7, #I7, 6, T8, I8, #I8, 7, T9, I9, #I9, 8, T10, I10, #I10, 9, T11, I11, #I11, 10, T12, I12, #I12, 11, T13, I13, #I13, 12, T14, I14, #I14, 13, T15, I15, #I15, 14, T16, I16, #I16, 15, T17, I17, #I17, 16, T18, I18, #I18, 17) \ - -#define sql_create_c_order_18(NAME, CMP, CONTR, T1, I1, O1, T2, I2, O2, T3, I3, O3, T4, I4, O4, T5, I5, O5, T6, I6, O6, T7, I7, O7, T8, I8, O8, T9, I9, O9, T10, I10, O10, T11, I11, O11, T12, I12, O12, T13, I13, O13, T14, I14, O14, T15, I15, O15, T16, I16, O16, T17, I17, O17, T18, I18, O18) \ - sql_create_complete_18(NAME, CMP, CONTR, T1, I1, #I1, O1, T2, I2, #I2, O2, T3, I3, #I3, O3, T4, I4, #I4, O4, T5, I5, #I5, O5, T6, I6, #I6, O6, T7, I7, #I7, O7, T8, I8, #I8, O8, T9, I9, #I9, O9, T10, I10, #I10, O10, T11, I11, #I11, O11, T12, I12, #I12, O12, T13, I13, #I13, O13, T14, I14, #I14, O14, T15, I15, #I15, O15, T16, I16, #I16, O16, T17, I17, #I17, O17, T18, I18, #I18, O18) - -#define sql_create_c_names_18(NAME, CMP, CONTR, T1, I1, N1, T2, I2, N2, T3, I3, N3, T4, I4, N4, T5, I5, N5, T6, I6, N6, T7, I7, N7, T8, I8, N8, T9, I9, N9, T10, I10, N10, T11, I11, N11, T12, I12, N12, T13, I13, N13, T14, I14, N14, T15, I15, N15, T16, I16, N16, T17, I17, N17, T18, I18, N18) \ - sql_create_complete_18(NAME, CMP, CONTR, T1, I1, N1, 0, T2, I2, N2, 1, T3, I3, N3, 2, T4, I4, N4, 3, T5, I5, N5, 4, T6, I6, N6, 5, T7, I7, N7, 6, T8, I8, N8, 7, T9, I9, N9, 8, T10, I10, N10, 9, T11, I11, N11, 10, T12, I12, N12, 11, T13, I13, N13, 12, T14, I14, N14, 13, T15, I15, N15, 14, T16, I16, N16, 15, T17, I17, N17, 16, T18, I18, N18, 17) - -// --------------------------------------------------- -// End Create 18 -// --------------------------------------------------- - -// --------------------------------------------------- -// Begin Create 19 -// --------------------------------------------------- -#define sql_create_basic_c_order_19(NAME, CMP, CONTR, T1, I1, O1, T2, I2, O2, T3, I3, O3, T4, I4, O4, T5, I5, O5, T6, I6, O6, T7, I7, O7, T8, I8, O8, T9, I9, O9, T10, I10, O10, T11, I11, O11, T12, I12, O12, T13, I13, O13, T14, I14, O14, T15, I15, O15, T16, I16, O16, T17, I17, O17, T18, I18, O18, T19, I19, O19)\ - struct NAME; \ - template int sql_compare_##NAME (const NAME &, const NAME &);\ - struct NAME { \ - T1 I1;\ - T2 I2;\ - T3 I3;\ - T4 I4;\ - T5 I5;\ - T6 I6;\ - T7 I7;\ - T8 I8;\ - T9 I9;\ - T10 I10;\ - T11 I11;\ - T12 I12;\ - T13 I13;\ - T14 I14;\ - T15 I15;\ - T16 I16;\ - T17 I17;\ - T18 I18;\ - T19 I19; \ - NAME () {} \ - NAME (const Row &row);\ - sql_compare_define_##CMP(NAME, T1, I1, T2, I2, T3, I3, T4, I4, T5, I5, T6, I6, T7, I7, T8, I8, T9, I9, T10, I10, T11, I11, T12, I12, T13, I13, T14, I14, T15, I15, T16, I16, T17, I17, T18, I18, T19, I19, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0)\ - }; \ - template \ - void populate_##NAME (NAME *s, const Row &row) { \ - s->I1 = static_cast(row.at(O1));\ - s->I2 = static_cast(row.at(O2));\ - s->I3 = static_cast(row.at(O3));\ - s->I4 = static_cast(row.at(O4));\ - s->I5 = static_cast(row.at(O5));\ - s->I6 = static_cast(row.at(O6));\ - s->I7 = static_cast(row.at(O7));\ - s->I8 = static_cast(row.at(O8));\ - s->I9 = static_cast(row.at(O9));\ - s->I10 = static_cast(row.at(O10));\ - s->I11 = static_cast(row.at(O11));\ - s->I12 = static_cast(row.at(O12));\ - s->I13 = static_cast(row.at(O13));\ - s->I14 = static_cast(row.at(O14));\ - s->I15 = static_cast(row.at(O15));\ - s->I16 = static_cast(row.at(O16));\ - s->I17 = static_cast(row.at(O17));\ - s->I18 = static_cast(row.at(O18));\ - s->I19 = static_cast(row.at(O19)); \ - } \ - inline NAME::NAME (const Row &row) \ - {populate_##NAME(this, row);} \ - sql_COMPARE__##CMP(NAME, I1, I2, I3, I4, I5, I6, I7, I8, I9, I10, I11, I12, I13, I14, I15, I16, I17, I18, I19, 0, 0, 0, 0, 0, 0 ) - -#define sql_create_complete_19(NAME, CMP, CONTR, T1, I1, N1, O1, T2, I2, N2, O2, T3, I3, N3, O3, T4, I4, N4, O4, T5, I5, N5, O5, T6, I6, N6, O6, T7, I7, N7, O7, T8, I8, N8, O8, T9, I9, N9, O9, T10, I10, N10, O10, T11, I11, N11, O11, T12, I12, N12, O12, T13, I13, N13, O13, T14, I14, N14, O14, T15, I15, N15, O15, T16, I16, N16, O16, T17, I17, N17, O17, T18, I18, N18, O18, T19, I19, N19, O19) \ - struct NAME; \ - enum NAME##_enum { \ - NAME##_##I1,\ - NAME##_##I2,\ - NAME##_##I3,\ - NAME##_##I4,\ - NAME##_##I5,\ - NAME##_##I6,\ - NAME##_##I7,\ - NAME##_##I8,\ - NAME##_##I9,\ - NAME##_##I10,\ - NAME##_##I11,\ - NAME##_##I12,\ - NAME##_##I13,\ - NAME##_##I14,\ - NAME##_##I15,\ - NAME##_##I16,\ - NAME##_##I17,\ - NAME##_##I18,\ - NAME##_##I19 \ - ,NAME##_NULL \ - }; \ - template \ - class NAME##_value_list { \ - /*friend std::ostream& operator << <> (std::ostream&, const NAME##_value_list&); */\ - public: \ - const NAME *obj;\ - cchar *delem;\ - Manip manip;\ - public: \ - NAME##_value_list (const NAME *o, cchar *d, Manip m) \ - : obj(o), delem(d), manip(m) {} \ - };\ - template \ - class NAME##_##field_list {\ - /* friend std::ostream& operator << <> (std::ostream&, const NAME##_field_list&); */\ - public: \ - const NAME *obj; \ - cchar *delem;\ - Manip manip;\ - public: \ - NAME##_field_list (const NAME *o, cchar *d, Manip m) \ - : obj(o), delem(d), manip(m) {} \ - };\ - template \ - class NAME##_equal_list { \ - /* friend std::ostream& operator << <> (std::ostream&, const NAME##_equal_list&); */\ - public: \ - const NAME *obj;\ - cchar *delem;\ - cchar *comp;\ - Manip manip;\ - public: \ - NAME##_equal_list (const NAME *o, cchar *d, cchar *c, Manip m) \ - : obj(o), delem(d), comp(c), manip(m) {}\ - };\ - template \ - class NAME##_cus_value_list {\ - /* friend std::ostream& operator << <> (std::ostream&, \ - const NAME##_cus_value_list&); */\ - public:\ - const NAME *obj;\ - std::vector *include;\ - bool del_vector;\ - cchar *delem;\ - Manip manip;\ - public: \ - ~NAME##_cus_value_list () {if (del_vector) delete include;} \ - NAME##_cus_value_list (const NAME *o, cchar *d, Manip m, bool i1, bool i2, bool i3, bool i4, bool i5, bool i6, bool i7, bool i8, bool i9, bool i10, bool i11, bool i12, bool i13, bool i14, bool i15, bool i16, bool i17, bool i18, bool i19);\ - NAME##_cus_value_list (const NAME *o, cchar *d, Manip m, NAME##_enum i1, NAME##_enum i2, NAME##_enum i3, NAME##_enum i4, NAME##_enum i5, NAME##_enum i6, NAME##_enum i7, NAME##_enum i8, NAME##_enum i9, NAME##_enum i10, NAME##_enum i11, NAME##_enum i12, NAME##_enum i13, NAME##_enum i14, NAME##_enum i15, NAME##_enum i16, NAME##_enum i17, NAME##_enum i18, NAME##_enum i19); \ - NAME##_cus_value_list (const NAME *o, cchar *d, Manip m ,std::vector* i)\ - : obj(o), include(i), del_vector(false), delem(d), manip(m) {}\ - };\ - template \ - class NAME##_cus_field_list { \ - /* friend std::ostream& operator << <> (std::ostream&, \ - const NAME##_cus_field_list&); */\ - public:\ - const NAME *obj; \ - std::vector *include; \ - bool del_vector; \ - cchar *delem;\ - Manip manip;\ - public: \ - ~NAME##_cus_field_list () {if (del_vector) delete include;} \ - NAME##_cus_field_list (const NAME *o, cchar *d, Manip m, bool i1, bool i2, bool i3, bool i4, bool i5, bool i6, bool i7, bool i8, bool i9, bool i10, bool i11, bool i12, bool i13, bool i14, bool i15, bool i16, bool i17, bool i18, bool i19); \ - NAME##_cus_field_list (const NAME *o, cchar *d, Manip m, NAME##_enum i1, NAME##_enum i2, NAME##_enum i3, NAME##_enum i4, NAME##_enum i5, NAME##_enum i6, NAME##_enum i7, NAME##_enum i8, NAME##_enum i9, NAME##_enum i10, NAME##_enum i11, NAME##_enum i12, NAME##_enum i13, NAME##_enum i14, NAME##_enum i15, NAME##_enum i16, NAME##_enum i17, NAME##_enum i18, NAME##_enum i19); \ - NAME##_cus_field_list (const NAME *o, cchar *d, Manip m, std::vector *i) \ - : obj(o), include(i), del_vector(false), delem(d), manip(m) {}\ - };\ - template \ - class NAME##_cus_equal_list {\ - /* friend std::ostream& operator << <> (std::ostream&, \ - const NAME##_cus_equal_list&); */\ - public:\ - const NAME *obj;\ - std::vector *include;\ - bool del_vector;\ - cchar *delem;\ - cchar *comp;\ - Manip manip;\ - public:\ - ~NAME##_##cus_equal_list () {if (del_vector) delete include;}\ - NAME##_##cus_equal_list (const NAME *o, cchar *d, cchar *c, Manip m, bool i1, bool i2, bool i3, bool i4, bool i5, bool i6, bool i7, bool i8, bool i9, bool i10, bool i11, bool i12, bool i13, bool i14, bool i15, bool i16, bool i17, bool i18, bool i19); \ - NAME##_##cus_equal_list (const NAME *o, cchar *d, cchar *c, Manip m, NAME##_enum i1, NAME##_enum i2, NAME##_enum i3, NAME##_enum i4, NAME##_enum i5, NAME##_enum i6, NAME##_enum i7, NAME##_enum i8, NAME##_enum i9, NAME##_enum i10, NAME##_enum i11, NAME##_enum i12, NAME##_enum i13, NAME##_enum i14, NAME##_enum i15, NAME##_enum i16, NAME##_enum i17, NAME##_enum i18, NAME##_enum i19); \ - NAME##_##cus_equal_list (const NAME *o, cchar *d, cchar *c, Manip m, std::vector *i) \ - : obj(o), include(i), del_vector(false), delem(d), comp(c), manip(m) {}\ - };\ - template int sql_compare_##NAME (const NAME &, const NAME &);\ - struct NAME { \ - T1 I1;\ - T2 I2;\ - T3 I3;\ - T4 I4;\ - T5 I5;\ - T6 I6;\ - T7 I7;\ - T8 I8;\ - T9 I9;\ - T10 I10;\ - T11 I11;\ - T12 I12;\ - T13 I13;\ - T14 I14;\ - T15 I15;\ - T16 I16;\ - T17 I17;\ - T18 I18;\ - T19 I19; \ - NAME () {} \ - NAME (const Row &row);\ - void set (const Row &row);\ - sql_compare_define_##CMP(NAME, T1, I1, T2, I2, T3, I3, T4, I4, T5, I5, T6, I6, T7, I7, T8, I8, T9, I9, T10, I10, T11, I11, T12, I12, T13, I13, T14, I14, T15, I15, T16, I16, T17, I17, T18, I18, T19, I19, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0)\ - sql_construct_define_##CONTR(NAME, T1, I1, T2, I2, T3, I3, T4, I4, T5, I5, T6, I6, T7, I7, T8, I8, T9, I9, T10, I10, T11, I11, T12, I12, T13, I13, T14, I14, T15, I15, T16, I16, T17, I17, T18, I18, T19, I19, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0)\ - static const char *names[];\ - static const char *_table;\ - static const char *& table() {return _table;}\ - NAME##_value_list value_list() const {\ - return value_list(",", quote);}\ - NAME##_value_list value_list(cchar *d) const {\ - return value_list(d, quote);}\ - template \ - NAME##_value_list value_list(cchar *d, Manip m) const; \ - NAME##_field_list field_list() const {\ - return field_list(",", do_nothing);}\ - NAME##_field_list field_list(cchar *d) const {\ - return field_list(d, do_nothing);}\ - template \ - NAME##_field_list field_list(cchar *d, Manip m) const; \ - NAME##_equal_list equal_list(cchar *d = ",", \ - cchar *c = " = ") const{\ - return equal_list(d, c, quote);}\ - template \ - NAME##_equal_list equal_list(cchar *d, cchar *c, Manip m) const; \ - /* cus_data */\ - NAME##_cus_value_list value_list(bool i1, bool i2 = false, bool i3 = false, bool i4 = false, bool i5 = false, bool i6 = false, bool i7 = false, bool i8 = false, bool i9 = false, bool i10 = false, bool i11 = false, bool i12 = false, bool i13 = false, bool i14 = false, bool i15 = false, bool i16 = false, bool i17 = false, bool i18 = false, bool i19 = false) const {\ - return value_list(",", quote, i1, i2, i3, i4, i5, i6, i7, i8, i9, i10, i11, i12, i13, i14, i15, i16, i17, i18, i19);\ - }\ - NAME##_cus_value_list value_list(NAME##_enum i1, NAME##_enum i2 = NAME##_NULL, NAME##_enum i3 = NAME##_NULL, NAME##_enum i4 = NAME##_NULL, NAME##_enum i5 = NAME##_NULL, NAME##_enum i6 = NAME##_NULL, NAME##_enum i7 = NAME##_NULL, NAME##_enum i8 = NAME##_NULL, NAME##_enum i9 = NAME##_NULL, NAME##_enum i10 = NAME##_NULL, NAME##_enum i11 = NAME##_NULL, NAME##_enum i12 = NAME##_NULL, NAME##_enum i13 = NAME##_NULL, NAME##_enum i14 = NAME##_NULL, NAME##_enum i15 = NAME##_NULL, NAME##_enum i16 = NAME##_NULL, NAME##_enum i17 = NAME##_NULL, NAME##_enum i18 = NAME##_NULL, NAME##_enum i19 = NAME##_NULL) const {\ - return value_list(",", quote, i1, i2, i3, i4, i5, i6, i7, i8, i9, i10, i11, i12, i13, i14, i15, i16, i17, i18, i19);\ - }\ - NAME##_cus_value_list value_list(std::vector *i) const {\ - return value_list(",", quote, i);\ - }\ - NAME##_cus_value_list value_list(sql_cmp_type sc) const {\ - return value_list(",", quote, sc);\ - }\ - NAME##_cus_value_list value_list(cchar *d, bool i1, bool i2 = false, bool i3 = false, bool i4 = false, bool i5 = false, bool i6 = false, bool i7 = false, bool i8 = false, bool i9 = false, bool i10 = false, bool i11 = false, bool i12 = false, bool i13 = false, bool i14 = false, bool i15 = false, bool i16 = false, bool i17 = false, bool i18 = false, bool i19 = false) const {\ - return value_list(d, quote, i1, i2, i3, i4, i5, i6, i7, i8, i9, i10, i11, i12, i13, i14, i15, i16, i17, i18, i19);\ - }\ - NAME##_cus_value_list value_list(cchar *d, NAME##_enum i1, NAME##_enum i2 = NAME##_NULL, NAME##_enum i3 = NAME##_NULL, NAME##_enum i4 = NAME##_NULL, NAME##_enum i5 = NAME##_NULL, NAME##_enum i6 = NAME##_NULL, NAME##_enum i7 = NAME##_NULL, NAME##_enum i8 = NAME##_NULL, NAME##_enum i9 = NAME##_NULL, NAME##_enum i10 = NAME##_NULL, NAME##_enum i11 = NAME##_NULL, NAME##_enum i12 = NAME##_NULL, NAME##_enum i13 = NAME##_NULL, NAME##_enum i14 = NAME##_NULL, NAME##_enum i15 = NAME##_NULL, NAME##_enum i16 = NAME##_NULL, NAME##_enum i17 = NAME##_NULL, NAME##_enum i18 = NAME##_NULL, NAME##_enum i19 = NAME##_NULL) const {\ - return value_list(d, quote, i1, i2, i3, i4, i5, i6, i7, i8, i9, i10, i11, i12, i13, i14, i15, i16, i17, i18, i19);\ - }\ - NAME##_cus_value_list value_list(cchar *d, \ - std::vector *i) const {\ - return value_list(d, quote, i);\ - }\ - NAME##_cus_value_list value_list(cchar *d, \ - sql_cmp_type sc) const {\ - return value_list(d, quote, sc);\ - }\ - template \ - NAME##_cus_value_list value_list(cchar *d, Manip m,\ - bool i1, bool i2 = false, bool i3 = false, bool i4 = false, bool i5 = false, bool i6 = false, bool i7 = false, bool i8 = false, bool i9 = false, bool i10 = false, bool i11 = false, bool i12 = false, bool i13 = false, bool i14 = false, bool i15 = false, bool i16 = false, bool i17 = false, bool i18 = false, bool i19 = false) const; \ - template \ - NAME##_cus_value_list value_list(cchar *d, Manip m,\ - NAME##_enum i1, NAME##_enum i2 = NAME##_NULL, NAME##_enum i3 = NAME##_NULL, NAME##_enum i4 = NAME##_NULL, NAME##_enum i5 = NAME##_NULL, NAME##_enum i6 = NAME##_NULL, NAME##_enum i7 = NAME##_NULL, NAME##_enum i8 = NAME##_NULL, NAME##_enum i9 = NAME##_NULL, NAME##_enum i10 = NAME##_NULL, NAME##_enum i11 = NAME##_NULL, NAME##_enum i12 = NAME##_NULL, NAME##_enum i13 = NAME##_NULL, NAME##_enum i14 = NAME##_NULL, NAME##_enum i15 = NAME##_NULL, NAME##_enum i16 = NAME##_NULL, NAME##_enum i17 = NAME##_NULL, NAME##_enum i18 = NAME##_NULL, NAME##_enum i19 = NAME##_NULL) const; \ - template \ - NAME##_cus_value_list value_list(cchar *d, Manip m, \ - std::vector *i) const;\ - template \ - NAME##_cus_value_list value_list(cchar *d, Manip m, \ - sql_cmp_type sc) const;\ - /* cus field */\ - NAME##_cus_field_list field_list(bool i1, bool i2 = false, bool i3 = false, bool i4 = false, bool i5 = false, bool i6 = false, bool i7 = false, bool i8 = false, bool i9 = false, bool i10 = false, bool i11 = false, bool i12 = false, bool i13 = false, bool i14 = false, bool i15 = false, bool i16 = false, bool i17 = false, bool i18 = false, bool i19 = false) const {\ - return field_list(",", do_nothing, i1, i2, i3, i4, i5, i6, i7, i8, i9, i10, i11, i12, i13, i14, i15, i16, i17, i18, i19);\ - }\ - NAME##_cus_field_list field_list(NAME##_enum i1, NAME##_enum i2 = NAME##_NULL, NAME##_enum i3 = NAME##_NULL, NAME##_enum i4 = NAME##_NULL, NAME##_enum i5 = NAME##_NULL, NAME##_enum i6 = NAME##_NULL, NAME##_enum i7 = NAME##_NULL, NAME##_enum i8 = NAME##_NULL, NAME##_enum i9 = NAME##_NULL, NAME##_enum i10 = NAME##_NULL, NAME##_enum i11 = NAME##_NULL, NAME##_enum i12 = NAME##_NULL, NAME##_enum i13 = NAME##_NULL, NAME##_enum i14 = NAME##_NULL, NAME##_enum i15 = NAME##_NULL, NAME##_enum i16 = NAME##_NULL, NAME##_enum i17 = NAME##_NULL, NAME##_enum i18 = NAME##_NULL, NAME##_enum i19 = NAME##_NULL) const {\ - return field_list(",", do_nothing, i1, i2, i3, i4, i5, i6, i7, i8, i9, i10, i11, i12, i13, i14, i15, i16, i17, i18, i19);\ - }\ - NAME##_cus_field_list field_list(std::vector *i) const {\ - return field_list(",", do_nothing, i);\ - }\ - NAME##_cus_field_list field_list(sql_cmp_type sc) const\ - {\ - return field_list(",", do_nothing, sc);\ - }\ - NAME##_cus_field_list field_list(cchar *d, \ - bool i1, bool i2 = false, bool i3 = false, bool i4 = false, bool i5 = false, bool i6 = false, bool i7 = false, bool i8 = false, bool i9 = false, bool i10 = false, bool i11 = false, bool i12 = false, bool i13 = false, bool i14 = false, bool i15 = false, bool i16 = false, bool i17 = false, bool i18 = false, bool i19 = false) const {\ - return field_list(d, do_nothing, i1, i2, i3, i4, i5, i6, i7, i8, i9, i10, i11, i12, i13, i14, i15, i16, i17, i18, i19);\ - }\ - NAME##_cus_field_list field_list(cchar *d,\ - NAME##_enum i1, NAME##_enum i2 = NAME##_NULL, NAME##_enum i3 = NAME##_NULL, NAME##_enum i4 = NAME##_NULL, NAME##_enum i5 = NAME##_NULL, NAME##_enum i6 = NAME##_NULL, NAME##_enum i7 = NAME##_NULL, NAME##_enum i8 = NAME##_NULL, NAME##_enum i9 = NAME##_NULL, NAME##_enum i10 = NAME##_NULL, NAME##_enum i11 = NAME##_NULL, NAME##_enum i12 = NAME##_NULL, NAME##_enum i13 = NAME##_NULL, NAME##_enum i14 = NAME##_NULL, NAME##_enum i15 = NAME##_NULL, NAME##_enum i16 = NAME##_NULL, NAME##_enum i17 = NAME##_NULL, NAME##_enum i18 = NAME##_NULL, NAME##_enum i19 = NAME##_NULL) const {\ - return field_list(d, do_nothing, i1, i2, i3, i4, i5, i6, i7, i8, i9, i10, i11, i12, i13, i14, i15, i16, i17, i18, i19);\ - }\ - NAME##_cus_field_list field_list(cchar *d, \ - std::vector *i) const {\ - return field_list(d, do_nothing, i);\ - }\ - NAME##_cus_field_list field_list(cchar *d, \ - sql_cmp_type sc) const {\ - return field_list(d, do_nothing, sc);\ - }\ - template \ - NAME##_cus_field_list field_list(cchar *d, Manip m,\ - bool i1, bool i2 = false, bool i3 = false, bool i4 = false, bool i5 = false, bool i6 = false, bool i7 = false, bool i8 = false, bool i9 = false, bool i10 = false, bool i11 = false, bool i12 = false, bool i13 = false, bool i14 = false, bool i15 = false, bool i16 = false, bool i17 = false, bool i18 = false, bool i19 = false) const; \ - template \ - NAME##_cus_field_list field_list(cchar *d, Manip m,\ - NAME##_enum i1, NAME##_enum i2 = NAME##_NULL, NAME##_enum i3 = NAME##_NULL, NAME##_enum i4 = NAME##_NULL, NAME##_enum i5 = NAME##_NULL, NAME##_enum i6 = NAME##_NULL, NAME##_enum i7 = NAME##_NULL, NAME##_enum i8 = NAME##_NULL, NAME##_enum i9 = NAME##_NULL, NAME##_enum i10 = NAME##_NULL, NAME##_enum i11 = NAME##_NULL, NAME##_enum i12 = NAME##_NULL, NAME##_enum i13 = NAME##_NULL, NAME##_enum i14 = NAME##_NULL, NAME##_enum i15 = NAME##_NULL, NAME##_enum i16 = NAME##_NULL, NAME##_enum i17 = NAME##_NULL, NAME##_enum i18 = NAME##_NULL, NAME##_enum i19 = NAME##_NULL) const; \ - template \ - NAME##_cus_field_list field_list(cchar *d, Manip m,\ - std::vector *i) const;\ - template \ - NAME##_cus_field_list field_list(cchar *d, Manip m, \ - sql_cmp_type sc) const;\ - /* cus equal */\ - NAME##_cus_equal_list equal_list(bool i1, bool i2 = false, bool i3 = false, bool i4 = false, bool i5 = false, bool i6 = false, bool i7 = false, bool i8 = false, bool i9 = false, bool i10 = false, bool i11 = false, bool i12 = false, bool i13 = false, bool i14 = false, bool i15 = false, bool i16 = false, bool i17 = false, bool i18 = false, bool i19 = false) const {\ - return equal_list(",", " = ", quote, i1, i2, i3, i4, i5, i6, i7, i8, i9, i10, i11, i12, i13, i14, i15, i16, i17, i18, i19);\ - }\ - NAME##_cus_equal_list equal_list(NAME##_enum i1, NAME##_enum i2 = NAME##_NULL, NAME##_enum i3 = NAME##_NULL, NAME##_enum i4 = NAME##_NULL, NAME##_enum i5 = NAME##_NULL, NAME##_enum i6 = NAME##_NULL, NAME##_enum i7 = NAME##_NULL, NAME##_enum i8 = NAME##_NULL, NAME##_enum i9 = NAME##_NULL, NAME##_enum i10 = NAME##_NULL, NAME##_enum i11 = NAME##_NULL, NAME##_enum i12 = NAME##_NULL, NAME##_enum i13 = NAME##_NULL, NAME##_enum i14 = NAME##_NULL, NAME##_enum i15 = NAME##_NULL, NAME##_enum i16 = NAME##_NULL, NAME##_enum i17 = NAME##_NULL, NAME##_enum i18 = NAME##_NULL, NAME##_enum i19 = NAME##_NULL) const {\ - return equal_list(",", " = ", quote, i1, i2, i3, i4, i5, i6, i7, i8, i9, i10, i11, i12, i13, i14, i15, i16, i17, i18, i19);\ - }\ - NAME##_cus_equal_list equal_list(std::vector *i) const {\ - return equal_list(",", " = ", quote, i);\ - }\ - NAME##_cus_equal_list equal_list(sql_cmp_type sc) const {\ - return equal_list(",", " = ", quote, sc);\ - }\ - NAME##_cus_equal_list equal_list(cchar *d, bool i1, bool i2 = false, bool i3 = false, bool i4 = false, bool i5 = false, bool i6 = false, bool i7 = false, bool i8 = false, bool i9 = false, bool i10 = false, bool i11 = false, bool i12 = false, bool i13 = false, bool i14 = false, bool i15 = false, bool i16 = false, bool i17 = false, bool i18 = false, bool i19 = false) const {\ - return equal_list(d, " = ", quote, i1, i2, i3, i4, i5, i6, i7, i8, i9, i10, i11, i12, i13, i14, i15, i16, i17, i18, i19);\ - }\ - NAME##_cus_equal_list equal_list(cchar *d, NAME##_enum i1, NAME##_enum i2 = NAME##_NULL, NAME##_enum i3 = NAME##_NULL, NAME##_enum i4 = NAME##_NULL, NAME##_enum i5 = NAME##_NULL, NAME##_enum i6 = NAME##_NULL, NAME##_enum i7 = NAME##_NULL, NAME##_enum i8 = NAME##_NULL, NAME##_enum i9 = NAME##_NULL, NAME##_enum i10 = NAME##_NULL, NAME##_enum i11 = NAME##_NULL, NAME##_enum i12 = NAME##_NULL, NAME##_enum i13 = NAME##_NULL, NAME##_enum i14 = NAME##_NULL, NAME##_enum i15 = NAME##_NULL, NAME##_enum i16 = NAME##_NULL, NAME##_enum i17 = NAME##_NULL, NAME##_enum i18 = NAME##_NULL, NAME##_enum i19 = NAME##_NULL) const {\ - return equal_list(d, " = ", quote, i1, i2, i3, i4, i5, i6, i7, i8, i9, i10, i11, i12, i13, i14, i15, i16, i17, i18, i19);\ - }\ - NAME##_cus_equal_list equal_list(cchar *d, \ - std::vector *i) const {\ - return equal_list(d, " = ", quote, i);\ - }\ - NAME##_cus_equal_list equal_list(cchar *d, \ - sql_cmp_type sc) const {\ - return equal_list(d, " = ", quote, sc);\ - }\ - NAME##_cus_equal_list equal_list(cchar *d, cchar *c,\ - bool i1, bool i2 = false, bool i3 = false, bool i4 = false, bool i5 = false, bool i6 = false, bool i7 = false, bool i8 = false, bool i9 = false, bool i10 = false, bool i11 = false, bool i12 = false, bool i13 = false, bool i14 = false, bool i15 = false, bool i16 = false, bool i17 = false, bool i18 = false, bool i19 = false) const {\ - return equal_list(d, c, quote, i1, i2, i3, i4, i5, i6, i7, i8, i9, i10, i11, i12, i13, i14, i15, i16, i17, i18, i19);\ - }\ - NAME##_cus_equal_list equal_list(cchar *d, cchar *c,\ - NAME##_enum i1, NAME##_enum i2 = NAME##_NULL, NAME##_enum i3 = NAME##_NULL, NAME##_enum i4 = NAME##_NULL, NAME##_enum i5 = NAME##_NULL, NAME##_enum i6 = NAME##_NULL, NAME##_enum i7 = NAME##_NULL, NAME##_enum i8 = NAME##_NULL, NAME##_enum i9 = NAME##_NULL, NAME##_enum i10 = NAME##_NULL, NAME##_enum i11 = NAME##_NULL, NAME##_enum i12 = NAME##_NULL, NAME##_enum i13 = NAME##_NULL, NAME##_enum i14 = NAME##_NULL, NAME##_enum i15 = NAME##_NULL, NAME##_enum i16 = NAME##_NULL, NAME##_enum i17 = NAME##_NULL, NAME##_enum i18 = NAME##_NULL, NAME##_enum i19 = NAME##_NULL) const {\ - return equal_list(d, c, quote, i1, i2, i3, i4, i5, i6, i7, i8, i9, i10, i11, i12, i13, i14, i15, i16, i17, i18, i19);\ - }\ - NAME##_cus_equal_list equal_list(cchar *d, cchar *c,\ - std::vector *i) const {\ - return equal_list(d, c, quote, i);\ - }\ - NAME##_cus_equal_list equal_list(cchar *d, cchar *c,\ - sql_cmp_type sc) const {\ - return equal_list(d, c, quote, sc);\ - }\ - template \ - NAME##_cus_equal_list equal_list(cchar *d, cchar *c, Manip m, \ - bool i1, bool i2 = false, bool i3 = false, bool i4 = false, bool i5 = false, bool i6 = false, bool i7 = false, bool i8 = false, bool i9 = false, bool i10 = false, bool i11 = false, bool i12 = false, bool i13 = false, bool i14 = false, bool i15 = false, bool i16 = false, bool i17 = false, bool i18 = false, bool i19 = false) const; \ - template \ - NAME##_cus_equal_list equal_list(cchar *d, cchar *c, Manip m, \ - NAME##_enum i1, NAME##_enum i2 = NAME##_NULL, NAME##_enum i3 = NAME##_NULL, NAME##_enum i4 = NAME##_NULL, NAME##_enum i5 = NAME##_NULL, NAME##_enum i6 = NAME##_NULL, NAME##_enum i7 = NAME##_NULL, NAME##_enum i8 = NAME##_NULL, NAME##_enum i9 = NAME##_NULL, NAME##_enum i10 = NAME##_NULL, NAME##_enum i11 = NAME##_NULL, NAME##_enum i12 = NAME##_NULL, NAME##_enum i13 = NAME##_NULL, NAME##_enum i14 = NAME##_NULL, NAME##_enum i15 = NAME##_NULL, NAME##_enum i16 = NAME##_NULL, NAME##_enum i17 = NAME##_NULL, NAME##_enum i18 = NAME##_NULL, NAME##_enum i19 = NAME##_NULL) const; \ - template \ - NAME##_cus_equal_list equal_list(cchar *d, cchar *c, Manip m, \ - std::vector *i) const;\ - template \ - NAME##_cus_equal_list equal_list(cchar *d, cchar *c, Manip m, \ - sql_cmp_type sc) const;\ - }; \ - const char *NAME::names[] = { \ - N1 ,\ - N2 ,\ - N3 ,\ - N4 ,\ - N5 ,\ - N6 ,\ - N7 ,\ - N8 ,\ - N9 ,\ - N10 ,\ - N11 ,\ - N12 ,\ - N13 ,\ - N14 ,\ - N15 ,\ - N16 ,\ - N17 ,\ - N18 ,\ - N19 \ - }; \ - const char *NAME::_table = #NAME ; \ - template \ - NAME##_cus_value_list::NAME##_cus_value_list\ - (const NAME *o, cchar *d, Manip m, bool i1, bool i2, bool i3, bool i4, bool i5, bool i6, bool i7, bool i8, bool i9, bool i10, bool i11, bool i12, bool i13, bool i14, bool i15, bool i16, bool i17, bool i18, bool i19) \ - { \ - delem = d;\ - manip = m;\ - del_vector = true;\ - obj = o; \ - include = new std::vector(19, false);\ - if (i1) (*include)[0]=true;\ - if (i2) (*include)[1]=true;\ - if (i3) (*include)[2]=true;\ - if (i4) (*include)[3]=true;\ - if (i5) (*include)[4]=true;\ - if (i6) (*include)[5]=true;\ - if (i7) (*include)[6]=true;\ - if (i8) (*include)[7]=true;\ - if (i9) (*include)[8]=true;\ - if (i10) (*include)[9]=true;\ - if (i11) (*include)[10]=true;\ - if (i12) (*include)[11]=true;\ - if (i13) (*include)[12]=true;\ - if (i14) (*include)[13]=true;\ - if (i15) (*include)[14]=true;\ - if (i16) (*include)[15]=true;\ - if (i17) (*include)[16]=true;\ - if (i18) (*include)[17]=true;\ - if (i19) (*include)[18]=true;\ - } \ - template \ - NAME##_cus_value_list::NAME##_cus_value_list\ - (const NAME *o, cchar *d, Manip m, NAME##_enum i1, NAME##_enum i2, NAME##_enum i3, NAME##_enum i4, NAME##_enum i5, NAME##_enum i6, NAME##_enum i7, NAME##_enum i8, NAME##_enum i9, NAME##_enum i10, NAME##_enum i11, NAME##_enum i12, NAME##_enum i13, NAME##_enum i14, NAME##_enum i15, NAME##_enum i16, NAME##_enum i17, NAME##_enum i18, NAME##_enum i19) { \ - delem = d;\ - manip = m;\ - del_vector = true; \ - obj = o; \ - include = new std::vector(19, false); \ - if (i1 == NAME##_NULL) return;\ - (*include)[i1]=true;\ - if (i2 == NAME##_NULL) return;\ - (*include)[i2]=true;\ - if (i3 == NAME##_NULL) return;\ - (*include)[i3]=true;\ - if (i4 == NAME##_NULL) return;\ - (*include)[i4]=true;\ - if (i5 == NAME##_NULL) return;\ - (*include)[i5]=true;\ - if (i6 == NAME##_NULL) return;\ - (*include)[i6]=true;\ - if (i7 == NAME##_NULL) return;\ - (*include)[i7]=true;\ - if (i8 == NAME##_NULL) return;\ - (*include)[i8]=true;\ - if (i9 == NAME##_NULL) return;\ - (*include)[i9]=true;\ - if (i10 == NAME##_NULL) return;\ - (*include)[i10]=true;\ - if (i11 == NAME##_NULL) return;\ - (*include)[i11]=true;\ - if (i12 == NAME##_NULL) return;\ - (*include)[i12]=true;\ - if (i13 == NAME##_NULL) return;\ - (*include)[i13]=true;\ - if (i14 == NAME##_NULL) return;\ - (*include)[i14]=true;\ - if (i15 == NAME##_NULL) return;\ - (*include)[i15]=true;\ - if (i16 == NAME##_NULL) return;\ - (*include)[i16]=true;\ - if (i17 == NAME##_NULL) return;\ - (*include)[i17]=true;\ - if (i18 == NAME##_NULL) return;\ - (*include)[i18]=true;\ - if (i19 == NAME##_NULL) return;\ - (*include)[i19]=true;\ - }\ - template \ - NAME##_cus_field_list::NAME##_cus_field_list\ - (const NAME *o, cchar *d, Manip m, bool i1, bool i2, bool i3, bool i4, bool i5, bool i6, bool i7, bool i8, bool i9, bool i10, bool i11, bool i12, bool i13, bool i14, bool i15, bool i16, bool i17, bool i18, bool i19) {\ - delem = d;\ - manip = m;\ - del_vector = true; \ - obj = o; \ - include = new std::vector(19, false); \ - if (i1) (*include)[0]=true;\ - if (i2) (*include)[1]=true;\ - if (i3) (*include)[2]=true;\ - if (i4) (*include)[3]=true;\ - if (i5) (*include)[4]=true;\ - if (i6) (*include)[5]=true;\ - if (i7) (*include)[6]=true;\ - if (i8) (*include)[7]=true;\ - if (i9) (*include)[8]=true;\ - if (i10) (*include)[9]=true;\ - if (i11) (*include)[10]=true;\ - if (i12) (*include)[11]=true;\ - if (i13) (*include)[12]=true;\ - if (i14) (*include)[13]=true;\ - if (i15) (*include)[14]=true;\ - if (i16) (*include)[15]=true;\ - if (i17) (*include)[16]=true;\ - if (i18) (*include)[17]=true;\ - if (i19) (*include)[18]=true;\ - } \ - template \ - NAME##_cus_field_list::NAME##_cus_field_list\ - (const NAME *o, cchar *d, Manip m, NAME##_enum i1, NAME##_enum i2, NAME##_enum i3, NAME##_enum i4, NAME##_enum i5, NAME##_enum i6, NAME##_enum i7, NAME##_enum i8, NAME##_enum i9, NAME##_enum i10, NAME##_enum i11, NAME##_enum i12, NAME##_enum i13, NAME##_enum i14, NAME##_enum i15, NAME##_enum i16, NAME##_enum i17, NAME##_enum i18, NAME##_enum i19) { \ - delem = d;\ - manip = m;\ - del_vector = true; \ - obj = o; \ - include = new std::vector(19, false); \ - if (i1 == NAME##_NULL) return;\ - (*include)[i1]=true;\ - if (i2 == NAME##_NULL) return;\ - (*include)[i2]=true;\ - if (i3 == NAME##_NULL) return;\ - (*include)[i3]=true;\ - if (i4 == NAME##_NULL) return;\ - (*include)[i4]=true;\ - if (i5 == NAME##_NULL) return;\ - (*include)[i5]=true;\ - if (i6 == NAME##_NULL) return;\ - (*include)[i6]=true;\ - if (i7 == NAME##_NULL) return;\ - (*include)[i7]=true;\ - if (i8 == NAME##_NULL) return;\ - (*include)[i8]=true;\ - if (i9 == NAME##_NULL) return;\ - (*include)[i9]=true;\ - if (i10 == NAME##_NULL) return;\ - (*include)[i10]=true;\ - if (i11 == NAME##_NULL) return;\ - (*include)[i11]=true;\ - if (i12 == NAME##_NULL) return;\ - (*include)[i12]=true;\ - if (i13 == NAME##_NULL) return;\ - (*include)[i13]=true;\ - if (i14 == NAME##_NULL) return;\ - (*include)[i14]=true;\ - if (i15 == NAME##_NULL) return;\ - (*include)[i15]=true;\ - if (i16 == NAME##_NULL) return;\ - (*include)[i16]=true;\ - if (i17 == NAME##_NULL) return;\ - (*include)[i17]=true;\ - if (i18 == NAME##_NULL) return;\ - (*include)[i18]=true;\ - if (i19 == NAME##_NULL) return;\ - (*include)[i19]=true;\ - }\ - template \ - NAME##_cus_equal_list::NAME##_cus_equal_list\ - (const NAME *o, cchar *d, cchar *c, Manip m, bool i1, bool i2, bool i3, bool i4, bool i5, bool i6, bool i7, bool i8, bool i9, bool i10, bool i11, bool i12, bool i13, bool i14, bool i15, bool i16, bool i17, bool i18, bool i19) { \ - delem = d;\ - comp = c;\ - manip = m;\ - del_vector = true; \ - obj = o; \ - include = new std::vector(19, false); \ - if (i1) (*include)[0]=true;\ - if (i2) (*include)[1]=true;\ - if (i3) (*include)[2]=true;\ - if (i4) (*include)[3]=true;\ - if (i5) (*include)[4]=true;\ - if (i6) (*include)[5]=true;\ - if (i7) (*include)[6]=true;\ - if (i8) (*include)[7]=true;\ - if (i9) (*include)[8]=true;\ - if (i10) (*include)[9]=true;\ - if (i11) (*include)[10]=true;\ - if (i12) (*include)[11]=true;\ - if (i13) (*include)[12]=true;\ - if (i14) (*include)[13]=true;\ - if (i15) (*include)[14]=true;\ - if (i16) (*include)[15]=true;\ - if (i17) (*include)[16]=true;\ - if (i18) (*include)[17]=true;\ - if (i19) (*include)[18]=true;\ - } \ - template \ - NAME##_cus_equal_list::NAME##_cus_equal_list\ - (const NAME *o, cchar *d, cchar *c, Manip m, NAME##_enum i1, NAME##_enum i2, NAME##_enum i3, NAME##_enum i4, NAME##_enum i5, NAME##_enum i6, NAME##_enum i7, NAME##_enum i8, NAME##_enum i9, NAME##_enum i10, NAME##_enum i11, NAME##_enum i12, NAME##_enum i13, NAME##_enum i14, NAME##_enum i15, NAME##_enum i16, NAME##_enum i17, NAME##_enum i18, NAME##_enum i19) { \ - delem = d;\ - comp = c;\ - manip = m;\ - del_vector = true; \ - obj = o; \ - include = new std::vector(19, false); \ - if (i1 == NAME##_NULL) return;\ - (*include)[i1]=true;\ - if (i2 == NAME##_NULL) return;\ - (*include)[i2]=true;\ - if (i3 == NAME##_NULL) return;\ - (*include)[i3]=true;\ - if (i4 == NAME##_NULL) return;\ - (*include)[i4]=true;\ - if (i5 == NAME##_NULL) return;\ - (*include)[i5]=true;\ - if (i6 == NAME##_NULL) return;\ - (*include)[i6]=true;\ - if (i7 == NAME##_NULL) return;\ - (*include)[i7]=true;\ - if (i8 == NAME##_NULL) return;\ - (*include)[i8]=true;\ - if (i9 == NAME##_NULL) return;\ - (*include)[i9]=true;\ - if (i10 == NAME##_NULL) return;\ - (*include)[i10]=true;\ - if (i11 == NAME##_NULL) return;\ - (*include)[i11]=true;\ - if (i12 == NAME##_NULL) return;\ - (*include)[i12]=true;\ - if (i13 == NAME##_NULL) return;\ - (*include)[i13]=true;\ - if (i14 == NAME##_NULL) return;\ - (*include)[i14]=true;\ - if (i15 == NAME##_NULL) return;\ - (*include)[i15]=true;\ - if (i16 == NAME##_NULL) return;\ - (*include)[i16]=true;\ - if (i17 == NAME##_NULL) return;\ - (*include)[i17]=true;\ - if (i18 == NAME##_NULL) return;\ - (*include)[i18]=true;\ - if (i19 == NAME##_NULL) return;\ - (*include)[i19]=true;\ - }\ - template \ - std::ostream& operator << (std::ostream& s, const NAME##_value_list& obj) { \ - s << obj.manip << obj.obj->I1 << obj.delem;\ - s << obj.manip << obj.obj->I2 << obj.delem;\ - s << obj.manip << obj.obj->I3 << obj.delem;\ - s << obj.manip << obj.obj->I4 << obj.delem;\ - s << obj.manip << obj.obj->I5 << obj.delem;\ - s << obj.manip << obj.obj->I6 << obj.delem;\ - s << obj.manip << obj.obj->I7 << obj.delem;\ - s << obj.manip << obj.obj->I8 << obj.delem;\ - s << obj.manip << obj.obj->I9 << obj.delem;\ - s << obj.manip << obj.obj->I10 << obj.delem;\ - s << obj.manip << obj.obj->I11 << obj.delem;\ - s << obj.manip << obj.obj->I12 << obj.delem;\ - s << obj.manip << obj.obj->I13 << obj.delem;\ - s << obj.manip << obj.obj->I14 << obj.delem;\ - s << obj.manip << obj.obj->I15 << obj.delem;\ - s << obj.manip << obj.obj->I16 << obj.delem;\ - s << obj.manip << obj.obj->I17 << obj.delem;\ - s << obj.manip << obj.obj->I18 << obj.delem;\ - s << obj.manip << obj.obj->I19; \ - return s; \ - } \ - template \ - std::ostream& operator << (std::ostream& s, const NAME##_field_list& obj) { \ - s << obj.manip << obj.obj->names[0] << obj.delem;\ - s << obj.manip << obj.obj->names[1] << obj.delem;\ - s << obj.manip << obj.obj->names[2] << obj.delem;\ - s << obj.manip << obj.obj->names[3] << obj.delem;\ - s << obj.manip << obj.obj->names[4] << obj.delem;\ - s << obj.manip << obj.obj->names[5] << obj.delem;\ - s << obj.manip << obj.obj->names[6] << obj.delem;\ - s << obj.manip << obj.obj->names[7] << obj.delem;\ - s << obj.manip << obj.obj->names[8] << obj.delem;\ - s << obj.manip << obj.obj->names[9] << obj.delem;\ - s << obj.manip << obj.obj->names[10] << obj.delem;\ - s << obj.manip << obj.obj->names[11] << obj.delem;\ - s << obj.manip << obj.obj->names[12] << obj.delem;\ - s << obj.manip << obj.obj->names[13] << obj.delem;\ - s << obj.manip << obj.obj->names[14] << obj.delem;\ - s << obj.manip << obj.obj->names[15] << obj.delem;\ - s << obj.manip << obj.obj->names[16] << obj.delem;\ - s << obj.manip << obj.obj->names[17] << obj.delem;\ - s << obj.manip << obj.obj->names[18]; \ - return s; \ - } \ - template \ - std::ostream& operator << (std::ostream& s, const NAME##_equal_list& obj) { \ - s << obj.obj->names[0] << obj.comp << obj.manip << obj.obj->I1 << obj.delem;\ - s << obj.obj->names[1] << obj.comp << obj.manip << obj.obj->I2 << obj.delem;\ - s << obj.obj->names[2] << obj.comp << obj.manip << obj.obj->I3 << obj.delem;\ - s << obj.obj->names[3] << obj.comp << obj.manip << obj.obj->I4 << obj.delem;\ - s << obj.obj->names[4] << obj.comp << obj.manip << obj.obj->I5 << obj.delem;\ - s << obj.obj->names[5] << obj.comp << obj.manip << obj.obj->I6 << obj.delem;\ - s << obj.obj->names[6] << obj.comp << obj.manip << obj.obj->I7 << obj.delem;\ - s << obj.obj->names[7] << obj.comp << obj.manip << obj.obj->I8 << obj.delem;\ - s << obj.obj->names[8] << obj.comp << obj.manip << obj.obj->I9 << obj.delem;\ - s << obj.obj->names[9] << obj.comp << obj.manip << obj.obj->I10 << obj.delem;\ - s << obj.obj->names[10] << obj.comp << obj.manip << obj.obj->I11 << obj.delem;\ - s << obj.obj->names[11] << obj.comp << obj.manip << obj.obj->I12 << obj.delem;\ - s << obj.obj->names[12] << obj.comp << obj.manip << obj.obj->I13 << obj.delem;\ - s << obj.obj->names[13] << obj.comp << obj.manip << obj.obj->I14 << obj.delem;\ - s << obj.obj->names[14] << obj.comp << obj.manip << obj.obj->I15 << obj.delem;\ - s << obj.obj->names[15] << obj.comp << obj.manip << obj.obj->I16 << obj.delem;\ - s << obj.obj->names[16] << obj.comp << obj.manip << obj.obj->I17 << obj.delem;\ - s << obj.obj->names[17] << obj.comp << obj.manip << obj.obj->I18 << obj.delem;\ - s << obj.obj->names[18] << obj.comp << obj.manip << obj.obj->I19; \ - return s; \ - } \ - template \ - std::ostream& operator << (std::ostream& s, const NAME##_cus_value_list& obj) { \ - bool before = false; \ - if ((*obj.include)[0]) { \ - s << obj.manip << obj.obj->I1;\ - before = true; \ - } \ - if ((*obj.include)[1]) { \ - if (before) s << obj.delem;\ - s << obj.manip << obj.obj->I2;\ - before = true; \ - } \ - if ((*obj.include)[2]) { \ - if (before) s << obj.delem;\ - s << obj.manip << obj.obj->I3;\ - before = true; \ - } \ - if ((*obj.include)[3]) { \ - if (before) s << obj.delem;\ - s << obj.manip << obj.obj->I4;\ - before = true; \ - } \ - if ((*obj.include)[4]) { \ - if (before) s << obj.delem;\ - s << obj.manip << obj.obj->I5;\ - before = true; \ - } \ - if ((*obj.include)[5]) { \ - if (before) s << obj.delem;\ - s << obj.manip << obj.obj->I6;\ - before = true; \ - } \ - if ((*obj.include)[6]) { \ - if (before) s << obj.delem;\ - s << obj.manip << obj.obj->I7;\ - before = true; \ - } \ - if ((*obj.include)[7]) { \ - if (before) s << obj.delem;\ - s << obj.manip << obj.obj->I8;\ - before = true; \ - } \ - if ((*obj.include)[8]) { \ - if (before) s << obj.delem;\ - s << obj.manip << obj.obj->I9;\ - before = true; \ - } \ - if ((*obj.include)[9]) { \ - if (before) s << obj.delem;\ - s << obj.manip << obj.obj->I10;\ - before = true; \ - } \ - if ((*obj.include)[10]) { \ - if (before) s << obj.delem;\ - s << obj.manip << obj.obj->I11;\ - before = true; \ - } \ - if ((*obj.include)[11]) { \ - if (before) s << obj.delem;\ - s << obj.manip << obj.obj->I12;\ - before = true; \ - } \ - if ((*obj.include)[12]) { \ - if (before) s << obj.delem;\ - s << obj.manip << obj.obj->I13;\ - before = true; \ - } \ - if ((*obj.include)[13]) { \ - if (before) s << obj.delem;\ - s << obj.manip << obj.obj->I14;\ - before = true; \ - } \ - if ((*obj.include)[14]) { \ - if (before) s << obj.delem;\ - s << obj.manip << obj.obj->I15;\ - before = true; \ - } \ - if ((*obj.include)[15]) { \ - if (before) s << obj.delem;\ - s << obj.manip << obj.obj->I16;\ - before = true; \ - } \ - if ((*obj.include)[16]) { \ - if (before) s << obj.delem;\ - s << obj.manip << obj.obj->I17;\ - before = true; \ - } \ - if ((*obj.include)[17]) { \ - if (before) s << obj.delem;\ - s << obj.manip << obj.obj->I18;\ - before = true; \ - } \ - if ((*obj.include)[18]) { \ - if (before) s << obj.delem;\ - s << obj.manip << obj.obj->I19;\ - } \ - return s; \ - } \ - template \ - std::ostream& operator << (std::ostream& s, const NAME##_cus_field_list& obj) { \ - bool before = false; \ - if ((*obj.include)[0]) { \ - s << obj.manip << obj.obj->names[0];\ - before = true; \ - } \ - if ((*obj.include)[1]) { \ - if (before) s << obj.delem;\ - s << obj.manip << obj.obj->names[1];\ - before = true; \ - } \ - if ((*obj.include)[2]) { \ - if (before) s << obj.delem;\ - s << obj.manip << obj.obj->names[2];\ - before = true; \ - } \ - if ((*obj.include)[3]) { \ - if (before) s << obj.delem;\ - s << obj.manip << obj.obj->names[3];\ - before = true; \ - } \ - if ((*obj.include)[4]) { \ - if (before) s << obj.delem;\ - s << obj.manip << obj.obj->names[4];\ - before = true; \ - } \ - if ((*obj.include)[5]) { \ - if (before) s << obj.delem;\ - s << obj.manip << obj.obj->names[5];\ - before = true; \ - } \ - if ((*obj.include)[6]) { \ - if (before) s << obj.delem;\ - s << obj.manip << obj.obj->names[6];\ - before = true; \ - } \ - if ((*obj.include)[7]) { \ - if (before) s << obj.delem;\ - s << obj.manip << obj.obj->names[7];\ - before = true; \ - } \ - if ((*obj.include)[8]) { \ - if (before) s << obj.delem;\ - s << obj.manip << obj.obj->names[8];\ - before = true; \ - } \ - if ((*obj.include)[9]) { \ - if (before) s << obj.delem;\ - s << obj.manip << obj.obj->names[9];\ - before = true; \ - } \ - if ((*obj.include)[10]) { \ - if (before) s << obj.delem;\ - s << obj.manip << obj.obj->names[10];\ - before = true; \ - } \ - if ((*obj.include)[11]) { \ - if (before) s << obj.delem;\ - s << obj.manip << obj.obj->names[11];\ - before = true; \ - } \ - if ((*obj.include)[12]) { \ - if (before) s << obj.delem;\ - s << obj.manip << obj.obj->names[12];\ - before = true; \ - } \ - if ((*obj.include)[13]) { \ - if (before) s << obj.delem;\ - s << obj.manip << obj.obj->names[13];\ - before = true; \ - } \ - if ((*obj.include)[14]) { \ - if (before) s << obj.delem;\ - s << obj.manip << obj.obj->names[14];\ - before = true; \ - } \ - if ((*obj.include)[15]) { \ - if (before) s << obj.delem;\ - s << obj.manip << obj.obj->names[15];\ - before = true; \ - } \ - if ((*obj.include)[16]) { \ - if (before) s << obj.delem;\ - s << obj.manip << obj.obj->names[16];\ - before = true; \ - } \ - if ((*obj.include)[17]) { \ - if (before) s << obj.delem;\ - s << obj.manip << obj.obj->names[17];\ - before = true; \ - } \ - if ((*obj.include)[18]) { \ - if (before) s << obj.delem;\ - s << obj.manip << obj.obj->names[18];\ - } \ - return s; \ - } \ - template \ - std::ostream& operator << (std::ostream& s, const NAME##_cus_equal_list& obj) { \ - bool before = false; \ - if ((*obj.include)[0]) { \ - s << obj.obj->names[0] << obj.comp << obj.manip << obj.obj->I1;\ - before = true; \ - } \ - if ((*obj.include)[1]) { \ - if (before) s << obj.delem;\ - s << obj.obj->names[1] << obj.comp << obj.manip << obj.obj->I2;\ - before = true; \ - } \ - if ((*obj.include)[2]) { \ - if (before) s << obj.delem;\ - s << obj.obj->names[2] << obj.comp << obj.manip << obj.obj->I3;\ - before = true; \ - } \ - if ((*obj.include)[3]) { \ - if (before) s << obj.delem;\ - s << obj.obj->names[3] << obj.comp << obj.manip << obj.obj->I4;\ - before = true; \ - } \ - if ((*obj.include)[4]) { \ - if (before) s << obj.delem;\ - s << obj.obj->names[4] << obj.comp << obj.manip << obj.obj->I5;\ - before = true; \ - } \ - if ((*obj.include)[5]) { \ - if (before) s << obj.delem;\ - s << obj.obj->names[5] << obj.comp << obj.manip << obj.obj->I6;\ - before = true; \ - } \ - if ((*obj.include)[6]) { \ - if (before) s << obj.delem;\ - s << obj.obj->names[6] << obj.comp << obj.manip << obj.obj->I7;\ - before = true; \ - } \ - if ((*obj.include)[7]) { \ - if (before) s << obj.delem;\ - s << obj.obj->names[7] << obj.comp << obj.manip << obj.obj->I8;\ - before = true; \ - } \ - if ((*obj.include)[8]) { \ - if (before) s << obj.delem;\ - s << obj.obj->names[8] << obj.comp << obj.manip << obj.obj->I9;\ - before = true; \ - } \ - if ((*obj.include)[9]) { \ - if (before) s << obj.delem;\ - s << obj.obj->names[9] << obj.comp << obj.manip << obj.obj->I10;\ - before = true; \ - } \ - if ((*obj.include)[10]) { \ - if (before) s << obj.delem;\ - s << obj.obj->names[10] << obj.comp << obj.manip << obj.obj->I11;\ - before = true; \ - } \ - if ((*obj.include)[11]) { \ - if (before) s << obj.delem;\ - s << obj.obj->names[11] << obj.comp << obj.manip << obj.obj->I12;\ - before = true; \ - } \ - if ((*obj.include)[12]) { \ - if (before) s << obj.delem;\ - s << obj.obj->names[12] << obj.comp << obj.manip << obj.obj->I13;\ - before = true; \ - } \ - if ((*obj.include)[13]) { \ - if (before) s << obj.delem;\ - s << obj.obj->names[13] << obj.comp << obj.manip << obj.obj->I14;\ - before = true; \ - } \ - if ((*obj.include)[14]) { \ - if (before) s << obj.delem;\ - s << obj.obj->names[14] << obj.comp << obj.manip << obj.obj->I15;\ - before = true; \ - } \ - if ((*obj.include)[15]) { \ - if (before) s << obj.delem;\ - s << obj.obj->names[15] << obj.comp << obj.manip << obj.obj->I16;\ - before = true; \ - } \ - if ((*obj.include)[16]) { \ - if (before) s << obj.delem;\ - s << obj.obj->names[16] << obj.comp << obj.manip << obj.obj->I17;\ - before = true; \ - } \ - if ((*obj.include)[17]) { \ - if (before) s << obj.delem;\ - s << obj.obj->names[17] << obj.comp << obj.manip << obj.obj->I18;\ - before = true; \ - } \ - if ((*obj.include)[18]) { \ - if (before) s << obj.delem;\ - s << obj.obj->names[18] << obj.comp << obj.manip << obj.obj->I19;\ - } \ - return s; \ - } \ - template \ - inline NAME##_value_list NAME::value_list(cchar *d, Manip m) const { \ - return NAME##_value_list (this, d, m); \ - } \ - template \ - inline NAME##_field_list NAME::field_list(cchar *d, Manip m) const { \ - return NAME##_field_list (this, d, m); \ - } \ - template \ - inline NAME##_equal_list NAME::equal_list(cchar *d, cchar *c, Manip m) const { \ - return NAME##_equal_list (this, d, c, m); \ - } \ - template \ - inline NAME##_cus_value_list NAME::value_list(cchar *d, Manip m,\ - bool i1, bool i2, bool i3, bool i4, bool i5, bool i6, bool i7, bool i8, bool i9, bool i10, bool i11, bool i12, bool i13, bool i14, bool i15, bool i16, bool i17, bool i18, bool i19) const {\ - return NAME##_cus_value_list (this, d, m, i1, i2, i3, i4, i5, i6, i7, i8, i9, i10, i11, i12, i13, i14, i15, i16, i17, i18, i19); \ - } \ - template \ - inline NAME##_cus_field_list NAME::field_list(cchar *d, Manip m,\ - bool i1, bool i2, bool i3, bool i4, bool i5, bool i6, bool i7, bool i8, bool i9, bool i10, bool i11, bool i12, bool i13, bool i14, bool i15, bool i16, bool i17, bool i18, bool i19) const { \ - return NAME##_cus_field_list (this, d, m, i1, i2, i3, i4, i5, i6, i7, i8, i9, i10, i11, i12, i13, i14, i15, i16, i17, i18, i19); \ - } \ - template \ - inline NAME##_cus_equal_list NAME::equal_list(cchar *d, cchar *c, Manip m,\ - bool i1, bool i2, bool i3, bool i4, bool i5, bool i6, bool i7, bool i8, bool i9, bool i10, bool i11, bool i12, bool i13, bool i14, bool i15, bool i16, bool i17, bool i18, bool i19) const { \ - return NAME##_cus_equal_list (this, d, c, m, i1, i2, i3, i4, i5, i6, i7, i8, i9, i10, i11, i12, i13, i14, i15, i16, i17, i18, i19); \ - } \ - template \ - inline NAME##_cus_value_list NAME::value_list(cchar *d, Manip m,\ - NAME##_enum i1, NAME##_enum i2, NAME##_enum i3, NAME##_enum i4, NAME##_enum i5, NAME##_enum i6, NAME##_enum i7, NAME##_enum i8, NAME##_enum i9, NAME##_enum i10, NAME##_enum i11, NAME##_enum i12, NAME##_enum i13, NAME##_enum i14, NAME##_enum i15, NAME##_enum i16, NAME##_enum i17, NAME##_enum i18, NAME##_enum i19) const { \ - return NAME##_cus_value_list (this, d, m, i1, i2, i3, i4, i5, i6, i7, i8, i9, i10, i11, i12, i13, i14, i15, i16, i17, i18, i19); \ - } \ - template \ - inline NAME##_cus_field_list NAME::field_list(cchar *d, Manip m,\ - NAME##_enum i1, NAME##_enum i2, NAME##_enum i3, NAME##_enum i4, NAME##_enum i5, NAME##_enum i6, NAME##_enum i7, NAME##_enum i8, NAME##_enum i9, NAME##_enum i10, NAME##_enum i11, NAME##_enum i12, NAME##_enum i13, NAME##_enum i14, NAME##_enum i15, NAME##_enum i16, NAME##_enum i17, NAME##_enum i18, NAME##_enum i19) const {\ - return NAME##_cus_field_list (this, d, m, i1, i2, i3, i4, i5, i6, i7, i8, i9, i10, i11, i12, i13, i14, i15, i16, i17, i18, i19); \ - } \ - template \ - inline NAME##_cus_equal_list NAME::equal_list(cchar *d, cchar *c, Manip m, \ - NAME##_enum i1, NAME##_enum i2, NAME##_enum i3, NAME##_enum i4, NAME##_enum i5, NAME##_enum i6, NAME##_enum i7, NAME##_enum i8, NAME##_enum i9, NAME##_enum i10, NAME##_enum i11, NAME##_enum i12, NAME##_enum i13, NAME##_enum i14, NAME##_enum i15, NAME##_enum i16, NAME##_enum i17, NAME##_enum i18, NAME##_enum i19) const { \ - return NAME##_cus_equal_list (this, d, c, m, i1, i2, i3, i4, i5, i6, i7, i8, i9, i10, i11, i12, i13, i14, i15, i16, i17, i18, i19); \ - } \ - template \ - inline NAME##_cus_value_list NAME::value_list(cchar *d, Manip m,\ - std::vector *i) const {\ - return NAME##_cus_value_list (this, d, m, i);\ - }\ - template \ - inline NAME##_cus_field_list NAME::field_list(cchar *d, Manip m,\ - std::vector *i) const {\ - return NAME##_cus_field_list (this, d, m, i);\ - }\ - template \ - inline NAME##_cus_equal_list NAME::equal_list(cchar *d, cchar *c, Manip m,\ - std::vector *i) const {\ - return NAME##_cus_equal_list (this, d, c, m, i);\ - }\ - template \ - inline NAME##_cus_value_list \ - NAME::value_list(cchar *d, Manip m, sql_cmp_type /*sc*/) const {\ - sql_compare_type_def_##CMP (NAME, value, NUM);\ - }\ - template \ - inline NAME##_cus_field_list \ - NAME::field_list(cchar *d, Manip m, sql_cmp_type /*sc*/) const {\ - sql_compare_type_def_##CMP (NAME, field, NUM);\ - }\ - template \ - inline NAME##_cus_equal_list \ - NAME::equal_list(cchar *d, cchar *c, Manip m, sql_cmp_type /*sc*/) const {\ - sql_compare_type_defe_##CMP (NAME, equal, NUM);\ - }\ - template \ - void populate_##NAME (NAME *s, const Row &row) { \ - s->I1 = static_cast(row.at(O1));\ - s->I2 = static_cast(row.at(O2));\ - s->I3 = static_cast(row.at(O3));\ - s->I4 = static_cast(row.at(O4));\ - s->I5 = static_cast(row.at(O5));\ - s->I6 = static_cast(row.at(O6));\ - s->I7 = static_cast(row.at(O7));\ - s->I8 = static_cast(row.at(O8));\ - s->I9 = static_cast(row.at(O9));\ - s->I10 = static_cast(row.at(O10));\ - s->I11 = static_cast(row.at(O11));\ - s->I12 = static_cast(row.at(O12));\ - s->I13 = static_cast(row.at(O13));\ - s->I14 = static_cast(row.at(O14));\ - s->I15 = static_cast(row.at(O15));\ - s->I16 = static_cast(row.at(O16));\ - s->I17 = static_cast(row.at(O17));\ - s->I18 = static_cast(row.at(O18));\ - s->I19 = static_cast(row.at(O19));\ - } \ - inline NAME::NAME (const Row &row) \ - {populate_##NAME(this, row);}\ - inline void NAME::set (const Row &row)\ - {populate_##NAME(this, row);}\ - sql_COMPARE__##CMP(NAME, I1, I2, I3, I4, I5, I6, I7, I8, I9, I10, I11, I12, I13, I14, I15, I16, I17, I18, I19, 0, 0, 0, 0, 0, 0 ) - -#define sql_create_basic_19(NAME, CMP, CONTR, T1, I1, T2, I2, T3, I3, T4, I4, T5, I5, T6, I6, T7, I7, T8, I8, T9, I9, T10, I10, T11, I11, T12, I12, T13, I13, T14, I14, T15, I15, T16, I16, T17, I17, T18, I18, T19, I19) \ - sql_create_basic_c_order_19(NAME, CMP, CONTR, T1, I1, 0, T2, I2, 1, T3, I3, 2, T4, I4, 3, T5, I5, 4, T6, I6, 5, T7, I7, 6, T8, I8, 7, T9, I9, 8, T10, I10, 9, T11, I11, 10, T12, I12, 11, T13, I13, 12, T14, I14, 13, T15, I15, 14, T16, I16, 15, T17, I17, 16, T18, I18, 17, T19, I19, 18) - -#define sql_create_19(NAME, CMP, CONTR, T1, I1, T2, I2, T3, I3, T4, I4, T5, I5, T6, I6, T7, I7, T8, I8, T9, I9, T10, I10, T11, I11, T12, I12, T13, I13, T14, I14, T15, I15, T16, I16, T17, I17, T18, I18, T19, I19) \ - sql_create_complete_19(NAME, CMP, CONTR, T1, I1, #I1, 0, T2, I2, #I2, 1, T3, I3, #I3, 2, T4, I4, #I4, 3, T5, I5, #I5, 4, T6, I6, #I6, 5, T7, I7, #I7, 6, T8, I8, #I8, 7, T9, I9, #I9, 8, T10, I10, #I10, 9, T11, I11, #I11, 10, T12, I12, #I12, 11, T13, I13, #I13, 12, T14, I14, #I14, 13, T15, I15, #I15, 14, T16, I16, #I16, 15, T17, I17, #I17, 16, T18, I18, #I18, 17, T19, I19, #I19, 18) \ - -#define sql_create_c_order_19(NAME, CMP, CONTR, T1, I1, O1, T2, I2, O2, T3, I3, O3, T4, I4, O4, T5, I5, O5, T6, I6, O6, T7, I7, O7, T8, I8, O8, T9, I9, O9, T10, I10, O10, T11, I11, O11, T12, I12, O12, T13, I13, O13, T14, I14, O14, T15, I15, O15, T16, I16, O16, T17, I17, O17, T18, I18, O18, T19, I19, O19) \ - sql_create_complete_19(NAME, CMP, CONTR, T1, I1, #I1, O1, T2, I2, #I2, O2, T3, I3, #I3, O3, T4, I4, #I4, O4, T5, I5, #I5, O5, T6, I6, #I6, O6, T7, I7, #I7, O7, T8, I8, #I8, O8, T9, I9, #I9, O9, T10, I10, #I10, O10, T11, I11, #I11, O11, T12, I12, #I12, O12, T13, I13, #I13, O13, T14, I14, #I14, O14, T15, I15, #I15, O15, T16, I16, #I16, O16, T17, I17, #I17, O17, T18, I18, #I18, O18, T19, I19, #I19, O19) - -#define sql_create_c_names_19(NAME, CMP, CONTR, T1, I1, N1, T2, I2, N2, T3, I3, N3, T4, I4, N4, T5, I5, N5, T6, I6, N6, T7, I7, N7, T8, I8, N8, T9, I9, N9, T10, I10, N10, T11, I11, N11, T12, I12, N12, T13, I13, N13, T14, I14, N14, T15, I15, N15, T16, I16, N16, T17, I17, N17, T18, I18, N18, T19, I19, N19) \ - sql_create_complete_19(NAME, CMP, CONTR, T1, I1, N1, 0, T2, I2, N2, 1, T3, I3, N3, 2, T4, I4, N4, 3, T5, I5, N5, 4, T6, I6, N6, 5, T7, I7, N7, 6, T8, I8, N8, 7, T9, I9, N9, 8, T10, I10, N10, 9, T11, I11, N11, 10, T12, I12, N12, 11, T13, I13, N13, 12, T14, I14, N14, 13, T15, I15, N15, 14, T16, I16, N16, 15, T17, I17, N17, 16, T18, I18, N18, 17, T19, I19, N19, 18) - -// --------------------------------------------------- -// End Create 19 -// --------------------------------------------------- - -// --------------------------------------------------- -// Begin Create 20 -// --------------------------------------------------- -#define sql_create_basic_c_order_20(NAME, CMP, CONTR, T1, I1, O1, T2, I2, O2, T3, I3, O3, T4, I4, O4, T5, I5, O5, T6, I6, O6, T7, I7, O7, T8, I8, O8, T9, I9, O9, T10, I10, O10, T11, I11, O11, T12, I12, O12, T13, I13, O13, T14, I14, O14, T15, I15, O15, T16, I16, O16, T17, I17, O17, T18, I18, O18, T19, I19, O19, T20, I20, O20)\ - struct NAME; \ - template int sql_compare_##NAME (const NAME &, const NAME &);\ - struct NAME { \ - T1 I1;\ - T2 I2;\ - T3 I3;\ - T4 I4;\ - T5 I5;\ - T6 I6;\ - T7 I7;\ - T8 I8;\ - T9 I9;\ - T10 I10;\ - T11 I11;\ - T12 I12;\ - T13 I13;\ - T14 I14;\ - T15 I15;\ - T16 I16;\ - T17 I17;\ - T18 I18;\ - T19 I19;\ - T20 I20; \ - NAME () {} \ - NAME (const Row &row);\ - sql_compare_define_##CMP(NAME, T1, I1, T2, I2, T3, I3, T4, I4, T5, I5, T6, I6, T7, I7, T8, I8, T9, I9, T10, I10, T11, I11, T12, I12, T13, I13, T14, I14, T15, I15, T16, I16, T17, I17, T18, I18, T19, I19, T20, I20, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0)\ - }; \ - template \ - void populate_##NAME (NAME *s, const Row &row) { \ - s->I1 = static_cast(row.at(O1));\ - s->I2 = static_cast(row.at(O2));\ - s->I3 = static_cast(row.at(O3));\ - s->I4 = static_cast(row.at(O4));\ - s->I5 = static_cast(row.at(O5));\ - s->I6 = static_cast(row.at(O6));\ - s->I7 = static_cast(row.at(O7));\ - s->I8 = static_cast(row.at(O8));\ - s->I9 = static_cast(row.at(O9));\ - s->I10 = static_cast(row.at(O10));\ - s->I11 = static_cast(row.at(O11));\ - s->I12 = static_cast(row.at(O12));\ - s->I13 = static_cast(row.at(O13));\ - s->I14 = static_cast(row.at(O14));\ - s->I15 = static_cast(row.at(O15));\ - s->I16 = static_cast(row.at(O16));\ - s->I17 = static_cast(row.at(O17));\ - s->I18 = static_cast(row.at(O18));\ - s->I19 = static_cast(row.at(O19));\ - s->I20 = static_cast(row.at(O20)); \ - } \ - inline NAME::NAME (const Row &row) \ - {populate_##NAME(this, row);} \ - sql_COMPARE__##CMP(NAME, I1, I2, I3, I4, I5, I6, I7, I8, I9, I10, I11, I12, I13, I14, I15, I16, I17, I18, I19, I20, 0, 0, 0, 0, 0 ) - -#define sql_create_complete_20(NAME, CMP, CONTR, T1, I1, N1, O1, T2, I2, N2, O2, T3, I3, N3, O3, T4, I4, N4, O4, T5, I5, N5, O5, T6, I6, N6, O6, T7, I7, N7, O7, T8, I8, N8, O8, T9, I9, N9, O9, T10, I10, N10, O10, T11, I11, N11, O11, T12, I12, N12, O12, T13, I13, N13, O13, T14, I14, N14, O14, T15, I15, N15, O15, T16, I16, N16, O16, T17, I17, N17, O17, T18, I18, N18, O18, T19, I19, N19, O19, T20, I20, N20, O20) \ - struct NAME; \ - enum NAME##_enum { \ - NAME##_##I1,\ - NAME##_##I2,\ - NAME##_##I3,\ - NAME##_##I4,\ - NAME##_##I5,\ - NAME##_##I6,\ - NAME##_##I7,\ - NAME##_##I8,\ - NAME##_##I9,\ - NAME##_##I10,\ - NAME##_##I11,\ - NAME##_##I12,\ - NAME##_##I13,\ - NAME##_##I14,\ - NAME##_##I15,\ - NAME##_##I16,\ - NAME##_##I17,\ - NAME##_##I18,\ - NAME##_##I19,\ - NAME##_##I20 \ - ,NAME##_NULL \ - }; \ - template \ - class NAME##_value_list { \ - /*friend std::ostream& operator << <> (std::ostream&, const NAME##_value_list&); */\ - public: \ - const NAME *obj;\ - cchar *delem;\ - Manip manip;\ - public: \ - NAME##_value_list (const NAME *o, cchar *d, Manip m) \ - : obj(o), delem(d), manip(m) {} \ - };\ - template \ - class NAME##_##field_list {\ - /* friend std::ostream& operator << <> (std::ostream&, const NAME##_field_list&); */\ - public: \ - const NAME *obj; \ - cchar *delem;\ - Manip manip;\ - public: \ - NAME##_field_list (const NAME *o, cchar *d, Manip m) \ - : obj(o), delem(d), manip(m) {} \ - };\ - template \ - class NAME##_equal_list { \ - /* friend std::ostream& operator << <> (std::ostream&, const NAME##_equal_list&); */\ - public: \ - const NAME *obj;\ - cchar *delem;\ - cchar *comp;\ - Manip manip;\ - public: \ - NAME##_equal_list (const NAME *o, cchar *d, cchar *c, Manip m) \ - : obj(o), delem(d), comp(c), manip(m) {}\ - };\ - template \ - class NAME##_cus_value_list {\ - /* friend std::ostream& operator << <> (std::ostream&, \ - const NAME##_cus_value_list&); */\ - public:\ - const NAME *obj;\ - std::vector *include;\ - bool del_vector;\ - cchar *delem;\ - Manip manip;\ - public: \ - ~NAME##_cus_value_list () {if (del_vector) delete include;} \ - NAME##_cus_value_list (const NAME *o, cchar *d, Manip m, bool i1, bool i2, bool i3, bool i4, bool i5, bool i6, bool i7, bool i8, bool i9, bool i10, bool i11, bool i12, bool i13, bool i14, bool i15, bool i16, bool i17, bool i18, bool i19, bool i20);\ - NAME##_cus_value_list (const NAME *o, cchar *d, Manip m, NAME##_enum i1, NAME##_enum i2, NAME##_enum i3, NAME##_enum i4, NAME##_enum i5, NAME##_enum i6, NAME##_enum i7, NAME##_enum i8, NAME##_enum i9, NAME##_enum i10, NAME##_enum i11, NAME##_enum i12, NAME##_enum i13, NAME##_enum i14, NAME##_enum i15, NAME##_enum i16, NAME##_enum i17, NAME##_enum i18, NAME##_enum i19, NAME##_enum i20); \ - NAME##_cus_value_list (const NAME *o, cchar *d, Manip m ,std::vector* i)\ - : obj(o), include(i), del_vector(false), delem(d), manip(m) {}\ - };\ - template \ - class NAME##_cus_field_list { \ - /* friend std::ostream& operator << <> (std::ostream&, \ - const NAME##_cus_field_list&); */\ - public:\ - const NAME *obj; \ - std::vector *include; \ - bool del_vector; \ - cchar *delem;\ - Manip manip;\ - public: \ - ~NAME##_cus_field_list () {if (del_vector) delete include;} \ - NAME##_cus_field_list (const NAME *o, cchar *d, Manip m, bool i1, bool i2, bool i3, bool i4, bool i5, bool i6, bool i7, bool i8, bool i9, bool i10, bool i11, bool i12, bool i13, bool i14, bool i15, bool i16, bool i17, bool i18, bool i19, bool i20); \ - NAME##_cus_field_list (const NAME *o, cchar *d, Manip m, NAME##_enum i1, NAME##_enum i2, NAME##_enum i3, NAME##_enum i4, NAME##_enum i5, NAME##_enum i6, NAME##_enum i7, NAME##_enum i8, NAME##_enum i9, NAME##_enum i10, NAME##_enum i11, NAME##_enum i12, NAME##_enum i13, NAME##_enum i14, NAME##_enum i15, NAME##_enum i16, NAME##_enum i17, NAME##_enum i18, NAME##_enum i19, NAME##_enum i20); \ - NAME##_cus_field_list (const NAME *o, cchar *d, Manip m, std::vector *i) \ - : obj(o), include(i), del_vector(false), delem(d), manip(m) {}\ - };\ - template \ - class NAME##_cus_equal_list {\ - /* friend std::ostream& operator << <> (std::ostream&, \ - const NAME##_cus_equal_list&); */\ - public:\ - const NAME *obj;\ - std::vector *include;\ - bool del_vector;\ - cchar *delem;\ - cchar *comp;\ - Manip manip;\ - public:\ - ~NAME##_##cus_equal_list () {if (del_vector) delete include;}\ - NAME##_##cus_equal_list (const NAME *o, cchar *d, cchar *c, Manip m, bool i1, bool i2, bool i3, bool i4, bool i5, bool i6, bool i7, bool i8, bool i9, bool i10, bool i11, bool i12, bool i13, bool i14, bool i15, bool i16, bool i17, bool i18, bool i19, bool i20); \ - NAME##_##cus_equal_list (const NAME *o, cchar *d, cchar *c, Manip m, NAME##_enum i1, NAME##_enum i2, NAME##_enum i3, NAME##_enum i4, NAME##_enum i5, NAME##_enum i6, NAME##_enum i7, NAME##_enum i8, NAME##_enum i9, NAME##_enum i10, NAME##_enum i11, NAME##_enum i12, NAME##_enum i13, NAME##_enum i14, NAME##_enum i15, NAME##_enum i16, NAME##_enum i17, NAME##_enum i18, NAME##_enum i19, NAME##_enum i20); \ - NAME##_##cus_equal_list (const NAME *o, cchar *d, cchar *c, Manip m, std::vector *i) \ - : obj(o), include(i), del_vector(false), delem(d), comp(c), manip(m) {}\ - };\ - template int sql_compare_##NAME (const NAME &, const NAME &);\ - struct NAME { \ - T1 I1;\ - T2 I2;\ - T3 I3;\ - T4 I4;\ - T5 I5;\ - T6 I6;\ - T7 I7;\ - T8 I8;\ - T9 I9;\ - T10 I10;\ - T11 I11;\ - T12 I12;\ - T13 I13;\ - T14 I14;\ - T15 I15;\ - T16 I16;\ - T17 I17;\ - T18 I18;\ - T19 I19;\ - T20 I20; \ - NAME () {} \ - NAME (const Row &row);\ - void set (const Row &row);\ - sql_compare_define_##CMP(NAME, T1, I1, T2, I2, T3, I3, T4, I4, T5, I5, T6, I6, T7, I7, T8, I8, T9, I9, T10, I10, T11, I11, T12, I12, T13, I13, T14, I14, T15, I15, T16, I16, T17, I17, T18, I18, T19, I19, T20, I20, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0)\ - sql_construct_define_##CONTR(NAME, T1, I1, T2, I2, T3, I3, T4, I4, T5, I5, T6, I6, T7, I7, T8, I8, T9, I9, T10, I10, T11, I11, T12, I12, T13, I13, T14, I14, T15, I15, T16, I16, T17, I17, T18, I18, T19, I19, T20, I20, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0)\ - static const char *names[];\ - static const char *_table;\ - static const char *& table() {return _table;}\ - NAME##_value_list value_list() const {\ - return value_list(",", quote);}\ - NAME##_value_list value_list(cchar *d) const {\ - return value_list(d, quote);}\ - template \ - NAME##_value_list value_list(cchar *d, Manip m) const; \ - NAME##_field_list field_list() const {\ - return field_list(",", do_nothing);}\ - NAME##_field_list field_list(cchar *d) const {\ - return field_list(d, do_nothing);}\ - template \ - NAME##_field_list field_list(cchar *d, Manip m) const; \ - NAME##_equal_list equal_list(cchar *d = ",", \ - cchar *c = " = ") const{\ - return equal_list(d, c, quote);}\ - template \ - NAME##_equal_list equal_list(cchar *d, cchar *c, Manip m) const; \ - /* cus_data */\ - NAME##_cus_value_list value_list(bool i1, bool i2 = false, bool i3 = false, bool i4 = false, bool i5 = false, bool i6 = false, bool i7 = false, bool i8 = false, bool i9 = false, bool i10 = false, bool i11 = false, bool i12 = false, bool i13 = false, bool i14 = false, bool i15 = false, bool i16 = false, bool i17 = false, bool i18 = false, bool i19 = false, bool i20 = false) const {\ - return value_list(",", quote, i1, i2, i3, i4, i5, i6, i7, i8, i9, i10, i11, i12, i13, i14, i15, i16, i17, i18, i19, i20);\ - }\ - NAME##_cus_value_list value_list(NAME##_enum i1, NAME##_enum i2 = NAME##_NULL, NAME##_enum i3 = NAME##_NULL, NAME##_enum i4 = NAME##_NULL, NAME##_enum i5 = NAME##_NULL, NAME##_enum i6 = NAME##_NULL, NAME##_enum i7 = NAME##_NULL, NAME##_enum i8 = NAME##_NULL, NAME##_enum i9 = NAME##_NULL, NAME##_enum i10 = NAME##_NULL, NAME##_enum i11 = NAME##_NULL, NAME##_enum i12 = NAME##_NULL, NAME##_enum i13 = NAME##_NULL, NAME##_enum i14 = NAME##_NULL, NAME##_enum i15 = NAME##_NULL, NAME##_enum i16 = NAME##_NULL, NAME##_enum i17 = NAME##_NULL, NAME##_enum i18 = NAME##_NULL, NAME##_enum i19 = NAME##_NULL, NAME##_enum i20 = NAME##_NULL) const {\ - return value_list(",", quote, i1, i2, i3, i4, i5, i6, i7, i8, i9, i10, i11, i12, i13, i14, i15, i16, i17, i18, i19, i20);\ - }\ - NAME##_cus_value_list value_list(std::vector *i) const {\ - return value_list(",", quote, i);\ - }\ - NAME##_cus_value_list value_list(sql_cmp_type sc) const {\ - return value_list(",", quote, sc);\ - }\ - NAME##_cus_value_list value_list(cchar *d, bool i1, bool i2 = false, bool i3 = false, bool i4 = false, bool i5 = false, bool i6 = false, bool i7 = false, bool i8 = false, bool i9 = false, bool i10 = false, bool i11 = false, bool i12 = false, bool i13 = false, bool i14 = false, bool i15 = false, bool i16 = false, bool i17 = false, bool i18 = false, bool i19 = false, bool i20 = false) const {\ - return value_list(d, quote, i1, i2, i3, i4, i5, i6, i7, i8, i9, i10, i11, i12, i13, i14, i15, i16, i17, i18, i19, i20);\ - }\ - NAME##_cus_value_list value_list(cchar *d, NAME##_enum i1, NAME##_enum i2 = NAME##_NULL, NAME##_enum i3 = NAME##_NULL, NAME##_enum i4 = NAME##_NULL, NAME##_enum i5 = NAME##_NULL, NAME##_enum i6 = NAME##_NULL, NAME##_enum i7 = NAME##_NULL, NAME##_enum i8 = NAME##_NULL, NAME##_enum i9 = NAME##_NULL, NAME##_enum i10 = NAME##_NULL, NAME##_enum i11 = NAME##_NULL, NAME##_enum i12 = NAME##_NULL, NAME##_enum i13 = NAME##_NULL, NAME##_enum i14 = NAME##_NULL, NAME##_enum i15 = NAME##_NULL, NAME##_enum i16 = NAME##_NULL, NAME##_enum i17 = NAME##_NULL, NAME##_enum i18 = NAME##_NULL, NAME##_enum i19 = NAME##_NULL, NAME##_enum i20 = NAME##_NULL) const {\ - return value_list(d, quote, i1, i2, i3, i4, i5, i6, i7, i8, i9, i10, i11, i12, i13, i14, i15, i16, i17, i18, i19, i20);\ - }\ - NAME##_cus_value_list value_list(cchar *d, \ - std::vector *i) const {\ - return value_list(d, quote, i);\ - }\ - NAME##_cus_value_list value_list(cchar *d, \ - sql_cmp_type sc) const {\ - return value_list(d, quote, sc);\ - }\ - template \ - NAME##_cus_value_list value_list(cchar *d, Manip m,\ - bool i1, bool i2 = false, bool i3 = false, bool i4 = false, bool i5 = false, bool i6 = false, bool i7 = false, bool i8 = false, bool i9 = false, bool i10 = false, bool i11 = false, bool i12 = false, bool i13 = false, bool i14 = false, bool i15 = false, bool i16 = false, bool i17 = false, bool i18 = false, bool i19 = false, bool i20 = false) const; \ - template \ - NAME##_cus_value_list value_list(cchar *d, Manip m,\ - NAME##_enum i1, NAME##_enum i2 = NAME##_NULL, NAME##_enum i3 = NAME##_NULL, NAME##_enum i4 = NAME##_NULL, NAME##_enum i5 = NAME##_NULL, NAME##_enum i6 = NAME##_NULL, NAME##_enum i7 = NAME##_NULL, NAME##_enum i8 = NAME##_NULL, NAME##_enum i9 = NAME##_NULL, NAME##_enum i10 = NAME##_NULL, NAME##_enum i11 = NAME##_NULL, NAME##_enum i12 = NAME##_NULL, NAME##_enum i13 = NAME##_NULL, NAME##_enum i14 = NAME##_NULL, NAME##_enum i15 = NAME##_NULL, NAME##_enum i16 = NAME##_NULL, NAME##_enum i17 = NAME##_NULL, NAME##_enum i18 = NAME##_NULL, NAME##_enum i19 = NAME##_NULL, NAME##_enum i20 = NAME##_NULL) const; \ - template \ - NAME##_cus_value_list value_list(cchar *d, Manip m, \ - std::vector *i) const;\ - template \ - NAME##_cus_value_list value_list(cchar *d, Manip m, \ - sql_cmp_type sc) const;\ - /* cus field */\ - NAME##_cus_field_list field_list(bool i1, bool i2 = false, bool i3 = false, bool i4 = false, bool i5 = false, bool i6 = false, bool i7 = false, bool i8 = false, bool i9 = false, bool i10 = false, bool i11 = false, bool i12 = false, bool i13 = false, bool i14 = false, bool i15 = false, bool i16 = false, bool i17 = false, bool i18 = false, bool i19 = false, bool i20 = false) const {\ - return field_list(",", do_nothing, i1, i2, i3, i4, i5, i6, i7, i8, i9, i10, i11, i12, i13, i14, i15, i16, i17, i18, i19, i20);\ - }\ - NAME##_cus_field_list field_list(NAME##_enum i1, NAME##_enum i2 = NAME##_NULL, NAME##_enum i3 = NAME##_NULL, NAME##_enum i4 = NAME##_NULL, NAME##_enum i5 = NAME##_NULL, NAME##_enum i6 = NAME##_NULL, NAME##_enum i7 = NAME##_NULL, NAME##_enum i8 = NAME##_NULL, NAME##_enum i9 = NAME##_NULL, NAME##_enum i10 = NAME##_NULL, NAME##_enum i11 = NAME##_NULL, NAME##_enum i12 = NAME##_NULL, NAME##_enum i13 = NAME##_NULL, NAME##_enum i14 = NAME##_NULL, NAME##_enum i15 = NAME##_NULL, NAME##_enum i16 = NAME##_NULL, NAME##_enum i17 = NAME##_NULL, NAME##_enum i18 = NAME##_NULL, NAME##_enum i19 = NAME##_NULL, NAME##_enum i20 = NAME##_NULL) const {\ - return field_list(",", do_nothing, i1, i2, i3, i4, i5, i6, i7, i8, i9, i10, i11, i12, i13, i14, i15, i16, i17, i18, i19, i20);\ - }\ - NAME##_cus_field_list field_list(std::vector *i) const {\ - return field_list(",", do_nothing, i);\ - }\ - NAME##_cus_field_list field_list(sql_cmp_type sc) const\ - {\ - return field_list(",", do_nothing, sc);\ - }\ - NAME##_cus_field_list field_list(cchar *d, \ - bool i1, bool i2 = false, bool i3 = false, bool i4 = false, bool i5 = false, bool i6 = false, bool i7 = false, bool i8 = false, bool i9 = false, bool i10 = false, bool i11 = false, bool i12 = false, bool i13 = false, bool i14 = false, bool i15 = false, bool i16 = false, bool i17 = false, bool i18 = false, bool i19 = false, bool i20 = false) const {\ - return field_list(d, do_nothing, i1, i2, i3, i4, i5, i6, i7, i8, i9, i10, i11, i12, i13, i14, i15, i16, i17, i18, i19, i20);\ - }\ - NAME##_cus_field_list field_list(cchar *d,\ - NAME##_enum i1, NAME##_enum i2 = NAME##_NULL, NAME##_enum i3 = NAME##_NULL, NAME##_enum i4 = NAME##_NULL, NAME##_enum i5 = NAME##_NULL, NAME##_enum i6 = NAME##_NULL, NAME##_enum i7 = NAME##_NULL, NAME##_enum i8 = NAME##_NULL, NAME##_enum i9 = NAME##_NULL, NAME##_enum i10 = NAME##_NULL, NAME##_enum i11 = NAME##_NULL, NAME##_enum i12 = NAME##_NULL, NAME##_enum i13 = NAME##_NULL, NAME##_enum i14 = NAME##_NULL, NAME##_enum i15 = NAME##_NULL, NAME##_enum i16 = NAME##_NULL, NAME##_enum i17 = NAME##_NULL, NAME##_enum i18 = NAME##_NULL, NAME##_enum i19 = NAME##_NULL, NAME##_enum i20 = NAME##_NULL) const {\ - return field_list(d, do_nothing, i1, i2, i3, i4, i5, i6, i7, i8, i9, i10, i11, i12, i13, i14, i15, i16, i17, i18, i19, i20);\ - }\ - NAME##_cus_field_list field_list(cchar *d, \ - std::vector *i) const {\ - return field_list(d, do_nothing, i);\ - }\ - NAME##_cus_field_list field_list(cchar *d, \ - sql_cmp_type sc) const {\ - return field_list(d, do_nothing, sc);\ - }\ - template \ - NAME##_cus_field_list field_list(cchar *d, Manip m,\ - bool i1, bool i2 = false, bool i3 = false, bool i4 = false, bool i5 = false, bool i6 = false, bool i7 = false, bool i8 = false, bool i9 = false, bool i10 = false, bool i11 = false, bool i12 = false, bool i13 = false, bool i14 = false, bool i15 = false, bool i16 = false, bool i17 = false, bool i18 = false, bool i19 = false, bool i20 = false) const; \ - template \ - NAME##_cus_field_list field_list(cchar *d, Manip m,\ - NAME##_enum i1, NAME##_enum i2 = NAME##_NULL, NAME##_enum i3 = NAME##_NULL, NAME##_enum i4 = NAME##_NULL, NAME##_enum i5 = NAME##_NULL, NAME##_enum i6 = NAME##_NULL, NAME##_enum i7 = NAME##_NULL, NAME##_enum i8 = NAME##_NULL, NAME##_enum i9 = NAME##_NULL, NAME##_enum i10 = NAME##_NULL, NAME##_enum i11 = NAME##_NULL, NAME##_enum i12 = NAME##_NULL, NAME##_enum i13 = NAME##_NULL, NAME##_enum i14 = NAME##_NULL, NAME##_enum i15 = NAME##_NULL, NAME##_enum i16 = NAME##_NULL, NAME##_enum i17 = NAME##_NULL, NAME##_enum i18 = NAME##_NULL, NAME##_enum i19 = NAME##_NULL, NAME##_enum i20 = NAME##_NULL) const; \ - template \ - NAME##_cus_field_list field_list(cchar *d, Manip m,\ - std::vector *i) const;\ - template \ - NAME##_cus_field_list field_list(cchar *d, Manip m, \ - sql_cmp_type sc) const;\ - /* cus equal */\ - NAME##_cus_equal_list equal_list(bool i1, bool i2 = false, bool i3 = false, bool i4 = false, bool i5 = false, bool i6 = false, bool i7 = false, bool i8 = false, bool i9 = false, bool i10 = false, bool i11 = false, bool i12 = false, bool i13 = false, bool i14 = false, bool i15 = false, bool i16 = false, bool i17 = false, bool i18 = false, bool i19 = false, bool i20 = false) const {\ - return equal_list(",", " = ", quote, i1, i2, i3, i4, i5, i6, i7, i8, i9, i10, i11, i12, i13, i14, i15, i16, i17, i18, i19, i20);\ - }\ - NAME##_cus_equal_list equal_list(NAME##_enum i1, NAME##_enum i2 = NAME##_NULL, NAME##_enum i3 = NAME##_NULL, NAME##_enum i4 = NAME##_NULL, NAME##_enum i5 = NAME##_NULL, NAME##_enum i6 = NAME##_NULL, NAME##_enum i7 = NAME##_NULL, NAME##_enum i8 = NAME##_NULL, NAME##_enum i9 = NAME##_NULL, NAME##_enum i10 = NAME##_NULL, NAME##_enum i11 = NAME##_NULL, NAME##_enum i12 = NAME##_NULL, NAME##_enum i13 = NAME##_NULL, NAME##_enum i14 = NAME##_NULL, NAME##_enum i15 = NAME##_NULL, NAME##_enum i16 = NAME##_NULL, NAME##_enum i17 = NAME##_NULL, NAME##_enum i18 = NAME##_NULL, NAME##_enum i19 = NAME##_NULL, NAME##_enum i20 = NAME##_NULL) const {\ - return equal_list(",", " = ", quote, i1, i2, i3, i4, i5, i6, i7, i8, i9, i10, i11, i12, i13, i14, i15, i16, i17, i18, i19, i20);\ - }\ - NAME##_cus_equal_list equal_list(std::vector *i) const {\ - return equal_list(",", " = ", quote, i);\ - }\ - NAME##_cus_equal_list equal_list(sql_cmp_type sc) const {\ - return equal_list(",", " = ", quote, sc);\ - }\ - NAME##_cus_equal_list equal_list(cchar *d, bool i1, bool i2 = false, bool i3 = false, bool i4 = false, bool i5 = false, bool i6 = false, bool i7 = false, bool i8 = false, bool i9 = false, bool i10 = false, bool i11 = false, bool i12 = false, bool i13 = false, bool i14 = false, bool i15 = false, bool i16 = false, bool i17 = false, bool i18 = false, bool i19 = false, bool i20 = false) const {\ - return equal_list(d, " = ", quote, i1, i2, i3, i4, i5, i6, i7, i8, i9, i10, i11, i12, i13, i14, i15, i16, i17, i18, i19, i20);\ - }\ - NAME##_cus_equal_list equal_list(cchar *d, NAME##_enum i1, NAME##_enum i2 = NAME##_NULL, NAME##_enum i3 = NAME##_NULL, NAME##_enum i4 = NAME##_NULL, NAME##_enum i5 = NAME##_NULL, NAME##_enum i6 = NAME##_NULL, NAME##_enum i7 = NAME##_NULL, NAME##_enum i8 = NAME##_NULL, NAME##_enum i9 = NAME##_NULL, NAME##_enum i10 = NAME##_NULL, NAME##_enum i11 = NAME##_NULL, NAME##_enum i12 = NAME##_NULL, NAME##_enum i13 = NAME##_NULL, NAME##_enum i14 = NAME##_NULL, NAME##_enum i15 = NAME##_NULL, NAME##_enum i16 = NAME##_NULL, NAME##_enum i17 = NAME##_NULL, NAME##_enum i18 = NAME##_NULL, NAME##_enum i19 = NAME##_NULL, NAME##_enum i20 = NAME##_NULL) const {\ - return equal_list(d, " = ", quote, i1, i2, i3, i4, i5, i6, i7, i8, i9, i10, i11, i12, i13, i14, i15, i16, i17, i18, i19, i20);\ - }\ - NAME##_cus_equal_list equal_list(cchar *d, \ - std::vector *i) const {\ - return equal_list(d, " = ", quote, i);\ - }\ - NAME##_cus_equal_list equal_list(cchar *d, \ - sql_cmp_type sc) const {\ - return equal_list(d, " = ", quote, sc);\ - }\ - NAME##_cus_equal_list equal_list(cchar *d, cchar *c,\ - bool i1, bool i2 = false, bool i3 = false, bool i4 = false, bool i5 = false, bool i6 = false, bool i7 = false, bool i8 = false, bool i9 = false, bool i10 = false, bool i11 = false, bool i12 = false, bool i13 = false, bool i14 = false, bool i15 = false, bool i16 = false, bool i17 = false, bool i18 = false, bool i19 = false, bool i20 = false) const {\ - return equal_list(d, c, quote, i1, i2, i3, i4, i5, i6, i7, i8, i9, i10, i11, i12, i13, i14, i15, i16, i17, i18, i19, i20);\ - }\ - NAME##_cus_equal_list equal_list(cchar *d, cchar *c,\ - NAME##_enum i1, NAME##_enum i2 = NAME##_NULL, NAME##_enum i3 = NAME##_NULL, NAME##_enum i4 = NAME##_NULL, NAME##_enum i5 = NAME##_NULL, NAME##_enum i6 = NAME##_NULL, NAME##_enum i7 = NAME##_NULL, NAME##_enum i8 = NAME##_NULL, NAME##_enum i9 = NAME##_NULL, NAME##_enum i10 = NAME##_NULL, NAME##_enum i11 = NAME##_NULL, NAME##_enum i12 = NAME##_NULL, NAME##_enum i13 = NAME##_NULL, NAME##_enum i14 = NAME##_NULL, NAME##_enum i15 = NAME##_NULL, NAME##_enum i16 = NAME##_NULL, NAME##_enum i17 = NAME##_NULL, NAME##_enum i18 = NAME##_NULL, NAME##_enum i19 = NAME##_NULL, NAME##_enum i20 = NAME##_NULL) const {\ - return equal_list(d, c, quote, i1, i2, i3, i4, i5, i6, i7, i8, i9, i10, i11, i12, i13, i14, i15, i16, i17, i18, i19, i20);\ - }\ - NAME##_cus_equal_list equal_list(cchar *d, cchar *c,\ - std::vector *i) const {\ - return equal_list(d, c, quote, i);\ - }\ - NAME##_cus_equal_list equal_list(cchar *d, cchar *c,\ - sql_cmp_type sc) const {\ - return equal_list(d, c, quote, sc);\ - }\ - template \ - NAME##_cus_equal_list equal_list(cchar *d, cchar *c, Manip m, \ - bool i1, bool i2 = false, bool i3 = false, bool i4 = false, bool i5 = false, bool i6 = false, bool i7 = false, bool i8 = false, bool i9 = false, bool i10 = false, bool i11 = false, bool i12 = false, bool i13 = false, bool i14 = false, bool i15 = false, bool i16 = false, bool i17 = false, bool i18 = false, bool i19 = false, bool i20 = false) const; \ - template \ - NAME##_cus_equal_list equal_list(cchar *d, cchar *c, Manip m, \ - NAME##_enum i1, NAME##_enum i2 = NAME##_NULL, NAME##_enum i3 = NAME##_NULL, NAME##_enum i4 = NAME##_NULL, NAME##_enum i5 = NAME##_NULL, NAME##_enum i6 = NAME##_NULL, NAME##_enum i7 = NAME##_NULL, NAME##_enum i8 = NAME##_NULL, NAME##_enum i9 = NAME##_NULL, NAME##_enum i10 = NAME##_NULL, NAME##_enum i11 = NAME##_NULL, NAME##_enum i12 = NAME##_NULL, NAME##_enum i13 = NAME##_NULL, NAME##_enum i14 = NAME##_NULL, NAME##_enum i15 = NAME##_NULL, NAME##_enum i16 = NAME##_NULL, NAME##_enum i17 = NAME##_NULL, NAME##_enum i18 = NAME##_NULL, NAME##_enum i19 = NAME##_NULL, NAME##_enum i20 = NAME##_NULL) const; \ - template \ - NAME##_cus_equal_list equal_list(cchar *d, cchar *c, Manip m, \ - std::vector *i) const;\ - template \ - NAME##_cus_equal_list equal_list(cchar *d, cchar *c, Manip m, \ - sql_cmp_type sc) const;\ - }; \ - const char *NAME::names[] = { \ - N1 ,\ - N2 ,\ - N3 ,\ - N4 ,\ - N5 ,\ - N6 ,\ - N7 ,\ - N8 ,\ - N9 ,\ - N10 ,\ - N11 ,\ - N12 ,\ - N13 ,\ - N14 ,\ - N15 ,\ - N16 ,\ - N17 ,\ - N18 ,\ - N19 ,\ - N20 \ - }; \ - const char *NAME::_table = #NAME ; \ - template \ - NAME##_cus_value_list::NAME##_cus_value_list\ - (const NAME *o, cchar *d, Manip m, bool i1, bool i2, bool i3, bool i4, bool i5, bool i6, bool i7, bool i8, bool i9, bool i10, bool i11, bool i12, bool i13, bool i14, bool i15, bool i16, bool i17, bool i18, bool i19, bool i20) \ - { \ - delem = d;\ - manip = m;\ - del_vector = true;\ - obj = o; \ - include = new std::vector(20, false);\ - if (i1) (*include)[0]=true;\ - if (i2) (*include)[1]=true;\ - if (i3) (*include)[2]=true;\ - if (i4) (*include)[3]=true;\ - if (i5) (*include)[4]=true;\ - if (i6) (*include)[5]=true;\ - if (i7) (*include)[6]=true;\ - if (i8) (*include)[7]=true;\ - if (i9) (*include)[8]=true;\ - if (i10) (*include)[9]=true;\ - if (i11) (*include)[10]=true;\ - if (i12) (*include)[11]=true;\ - if (i13) (*include)[12]=true;\ - if (i14) (*include)[13]=true;\ - if (i15) (*include)[14]=true;\ - if (i16) (*include)[15]=true;\ - if (i17) (*include)[16]=true;\ - if (i18) (*include)[17]=true;\ - if (i19) (*include)[18]=true;\ - if (i20) (*include)[19]=true;\ - } \ - template \ - NAME##_cus_value_list::NAME##_cus_value_list\ - (const NAME *o, cchar *d, Manip m, NAME##_enum i1, NAME##_enum i2, NAME##_enum i3, NAME##_enum i4, NAME##_enum i5, NAME##_enum i6, NAME##_enum i7, NAME##_enum i8, NAME##_enum i9, NAME##_enum i10, NAME##_enum i11, NAME##_enum i12, NAME##_enum i13, NAME##_enum i14, NAME##_enum i15, NAME##_enum i16, NAME##_enum i17, NAME##_enum i18, NAME##_enum i19, NAME##_enum i20) { \ - delem = d;\ - manip = m;\ - del_vector = true; \ - obj = o; \ - include = new std::vector(20, false); \ - if (i1 == NAME##_NULL) return;\ - (*include)[i1]=true;\ - if (i2 == NAME##_NULL) return;\ - (*include)[i2]=true;\ - if (i3 == NAME##_NULL) return;\ - (*include)[i3]=true;\ - if (i4 == NAME##_NULL) return;\ - (*include)[i4]=true;\ - if (i5 == NAME##_NULL) return;\ - (*include)[i5]=true;\ - if (i6 == NAME##_NULL) return;\ - (*include)[i6]=true;\ - if (i7 == NAME##_NULL) return;\ - (*include)[i7]=true;\ - if (i8 == NAME##_NULL) return;\ - (*include)[i8]=true;\ - if (i9 == NAME##_NULL) return;\ - (*include)[i9]=true;\ - if (i10 == NAME##_NULL) return;\ - (*include)[i10]=true;\ - if (i11 == NAME##_NULL) return;\ - (*include)[i11]=true;\ - if (i12 == NAME##_NULL) return;\ - (*include)[i12]=true;\ - if (i13 == NAME##_NULL) return;\ - (*include)[i13]=true;\ - if (i14 == NAME##_NULL) return;\ - (*include)[i14]=true;\ - if (i15 == NAME##_NULL) return;\ - (*include)[i15]=true;\ - if (i16 == NAME##_NULL) return;\ - (*include)[i16]=true;\ - if (i17 == NAME##_NULL) return;\ - (*include)[i17]=true;\ - if (i18 == NAME##_NULL) return;\ - (*include)[i18]=true;\ - if (i19 == NAME##_NULL) return;\ - (*include)[i19]=true;\ - if (i20 == NAME##_NULL) return;\ - (*include)[i20]=true;\ - }\ - template \ - NAME##_cus_field_list::NAME##_cus_field_list\ - (const NAME *o, cchar *d, Manip m, bool i1, bool i2, bool i3, bool i4, bool i5, bool i6, bool i7, bool i8, bool i9, bool i10, bool i11, bool i12, bool i13, bool i14, bool i15, bool i16, bool i17, bool i18, bool i19, bool i20) {\ - delem = d;\ - manip = m;\ - del_vector = true; \ - obj = o; \ - include = new std::vector(20, false); \ - if (i1) (*include)[0]=true;\ - if (i2) (*include)[1]=true;\ - if (i3) (*include)[2]=true;\ - if (i4) (*include)[3]=true;\ - if (i5) (*include)[4]=true;\ - if (i6) (*include)[5]=true;\ - if (i7) (*include)[6]=true;\ - if (i8) (*include)[7]=true;\ - if (i9) (*include)[8]=true;\ - if (i10) (*include)[9]=true;\ - if (i11) (*include)[10]=true;\ - if (i12) (*include)[11]=true;\ - if (i13) (*include)[12]=true;\ - if (i14) (*include)[13]=true;\ - if (i15) (*include)[14]=true;\ - if (i16) (*include)[15]=true;\ - if (i17) (*include)[16]=true;\ - if (i18) (*include)[17]=true;\ - if (i19) (*include)[18]=true;\ - if (i20) (*include)[19]=true;\ - } \ - template \ - NAME##_cus_field_list::NAME##_cus_field_list\ - (const NAME *o, cchar *d, Manip m, NAME##_enum i1, NAME##_enum i2, NAME##_enum i3, NAME##_enum i4, NAME##_enum i5, NAME##_enum i6, NAME##_enum i7, NAME##_enum i8, NAME##_enum i9, NAME##_enum i10, NAME##_enum i11, NAME##_enum i12, NAME##_enum i13, NAME##_enum i14, NAME##_enum i15, NAME##_enum i16, NAME##_enum i17, NAME##_enum i18, NAME##_enum i19, NAME##_enum i20) { \ - delem = d;\ - manip = m;\ - del_vector = true; \ - obj = o; \ - include = new std::vector(20, false); \ - if (i1 == NAME##_NULL) return;\ - (*include)[i1]=true;\ - if (i2 == NAME##_NULL) return;\ - (*include)[i2]=true;\ - if (i3 == NAME##_NULL) return;\ - (*include)[i3]=true;\ - if (i4 == NAME##_NULL) return;\ - (*include)[i4]=true;\ - if (i5 == NAME##_NULL) return;\ - (*include)[i5]=true;\ - if (i6 == NAME##_NULL) return;\ - (*include)[i6]=true;\ - if (i7 == NAME##_NULL) return;\ - (*include)[i7]=true;\ - if (i8 == NAME##_NULL) return;\ - (*include)[i8]=true;\ - if (i9 == NAME##_NULL) return;\ - (*include)[i9]=true;\ - if (i10 == NAME##_NULL) return;\ - (*include)[i10]=true;\ - if (i11 == NAME##_NULL) return;\ - (*include)[i11]=true;\ - if (i12 == NAME##_NULL) return;\ - (*include)[i12]=true;\ - if (i13 == NAME##_NULL) return;\ - (*include)[i13]=true;\ - if (i14 == NAME##_NULL) return;\ - (*include)[i14]=true;\ - if (i15 == NAME##_NULL) return;\ - (*include)[i15]=true;\ - if (i16 == NAME##_NULL) return;\ - (*include)[i16]=true;\ - if (i17 == NAME##_NULL) return;\ - (*include)[i17]=true;\ - if (i18 == NAME##_NULL) return;\ - (*include)[i18]=true;\ - if (i19 == NAME##_NULL) return;\ - (*include)[i19]=true;\ - if (i20 == NAME##_NULL) return;\ - (*include)[i20]=true;\ - }\ - template \ - NAME##_cus_equal_list::NAME##_cus_equal_list\ - (const NAME *o, cchar *d, cchar *c, Manip m, bool i1, bool i2, bool i3, bool i4, bool i5, bool i6, bool i7, bool i8, bool i9, bool i10, bool i11, bool i12, bool i13, bool i14, bool i15, bool i16, bool i17, bool i18, bool i19, bool i20) { \ - delem = d;\ - comp = c;\ - manip = m;\ - del_vector = true; \ - obj = o; \ - include = new std::vector(20, false); \ - if (i1) (*include)[0]=true;\ - if (i2) (*include)[1]=true;\ - if (i3) (*include)[2]=true;\ - if (i4) (*include)[3]=true;\ - if (i5) (*include)[4]=true;\ - if (i6) (*include)[5]=true;\ - if (i7) (*include)[6]=true;\ - if (i8) (*include)[7]=true;\ - if (i9) (*include)[8]=true;\ - if (i10) (*include)[9]=true;\ - if (i11) (*include)[10]=true;\ - if (i12) (*include)[11]=true;\ - if (i13) (*include)[12]=true;\ - if (i14) (*include)[13]=true;\ - if (i15) (*include)[14]=true;\ - if (i16) (*include)[15]=true;\ - if (i17) (*include)[16]=true;\ - if (i18) (*include)[17]=true;\ - if (i19) (*include)[18]=true;\ - if (i20) (*include)[19]=true;\ - } \ - template \ - NAME##_cus_equal_list::NAME##_cus_equal_list\ - (const NAME *o, cchar *d, cchar *c, Manip m, NAME##_enum i1, NAME##_enum i2, NAME##_enum i3, NAME##_enum i4, NAME##_enum i5, NAME##_enum i6, NAME##_enum i7, NAME##_enum i8, NAME##_enum i9, NAME##_enum i10, NAME##_enum i11, NAME##_enum i12, NAME##_enum i13, NAME##_enum i14, NAME##_enum i15, NAME##_enum i16, NAME##_enum i17, NAME##_enum i18, NAME##_enum i19, NAME##_enum i20) { \ - delem = d;\ - comp = c;\ - manip = m;\ - del_vector = true; \ - obj = o; \ - include = new std::vector(20, false); \ - if (i1 == NAME##_NULL) return;\ - (*include)[i1]=true;\ - if (i2 == NAME##_NULL) return;\ - (*include)[i2]=true;\ - if (i3 == NAME##_NULL) return;\ - (*include)[i3]=true;\ - if (i4 == NAME##_NULL) return;\ - (*include)[i4]=true;\ - if (i5 == NAME##_NULL) return;\ - (*include)[i5]=true;\ - if (i6 == NAME##_NULL) return;\ - (*include)[i6]=true;\ - if (i7 == NAME##_NULL) return;\ - (*include)[i7]=true;\ - if (i8 == NAME##_NULL) return;\ - (*include)[i8]=true;\ - if (i9 == NAME##_NULL) return;\ - (*include)[i9]=true;\ - if (i10 == NAME##_NULL) return;\ - (*include)[i10]=true;\ - if (i11 == NAME##_NULL) return;\ - (*include)[i11]=true;\ - if (i12 == NAME##_NULL) return;\ - (*include)[i12]=true;\ - if (i13 == NAME##_NULL) return;\ - (*include)[i13]=true;\ - if (i14 == NAME##_NULL) return;\ - (*include)[i14]=true;\ - if (i15 == NAME##_NULL) return;\ - (*include)[i15]=true;\ - if (i16 == NAME##_NULL) return;\ - (*include)[i16]=true;\ - if (i17 == NAME##_NULL) return;\ - (*include)[i17]=true;\ - if (i18 == NAME##_NULL) return;\ - (*include)[i18]=true;\ - if (i19 == NAME##_NULL) return;\ - (*include)[i19]=true;\ - if (i20 == NAME##_NULL) return;\ - (*include)[i20]=true;\ - }\ - template \ - std::ostream& operator << (std::ostream& s, const NAME##_value_list& obj) { \ - s << obj.manip << obj.obj->I1 << obj.delem;\ - s << obj.manip << obj.obj->I2 << obj.delem;\ - s << obj.manip << obj.obj->I3 << obj.delem;\ - s << obj.manip << obj.obj->I4 << obj.delem;\ - s << obj.manip << obj.obj->I5 << obj.delem;\ - s << obj.manip << obj.obj->I6 << obj.delem;\ - s << obj.manip << obj.obj->I7 << obj.delem;\ - s << obj.manip << obj.obj->I8 << obj.delem;\ - s << obj.manip << obj.obj->I9 << obj.delem;\ - s << obj.manip << obj.obj->I10 << obj.delem;\ - s << obj.manip << obj.obj->I11 << obj.delem;\ - s << obj.manip << obj.obj->I12 << obj.delem;\ - s << obj.manip << obj.obj->I13 << obj.delem;\ - s << obj.manip << obj.obj->I14 << obj.delem;\ - s << obj.manip << obj.obj->I15 << obj.delem;\ - s << obj.manip << obj.obj->I16 << obj.delem;\ - s << obj.manip << obj.obj->I17 << obj.delem;\ - s << obj.manip << obj.obj->I18 << obj.delem;\ - s << obj.manip << obj.obj->I19 << obj.delem;\ - s << obj.manip << obj.obj->I20; \ - return s; \ - } \ - template \ - std::ostream& operator << (std::ostream& s, const NAME##_field_list& obj) { \ - s << obj.manip << obj.obj->names[0] << obj.delem;\ - s << obj.manip << obj.obj->names[1] << obj.delem;\ - s << obj.manip << obj.obj->names[2] << obj.delem;\ - s << obj.manip << obj.obj->names[3] << obj.delem;\ - s << obj.manip << obj.obj->names[4] << obj.delem;\ - s << obj.manip << obj.obj->names[5] << obj.delem;\ - s << obj.manip << obj.obj->names[6] << obj.delem;\ - s << obj.manip << obj.obj->names[7] << obj.delem;\ - s << obj.manip << obj.obj->names[8] << obj.delem;\ - s << obj.manip << obj.obj->names[9] << obj.delem;\ - s << obj.manip << obj.obj->names[10] << obj.delem;\ - s << obj.manip << obj.obj->names[11] << obj.delem;\ - s << obj.manip << obj.obj->names[12] << obj.delem;\ - s << obj.manip << obj.obj->names[13] << obj.delem;\ - s << obj.manip << obj.obj->names[14] << obj.delem;\ - s << obj.manip << obj.obj->names[15] << obj.delem;\ - s << obj.manip << obj.obj->names[16] << obj.delem;\ - s << obj.manip << obj.obj->names[17] << obj.delem;\ - s << obj.manip << obj.obj->names[18] << obj.delem;\ - s << obj.manip << obj.obj->names[19]; \ - return s; \ - } \ - template \ - std::ostream& operator << (std::ostream& s, const NAME##_equal_list& obj) { \ - s << obj.obj->names[0] << obj.comp << obj.manip << obj.obj->I1 << obj.delem;\ - s << obj.obj->names[1] << obj.comp << obj.manip << obj.obj->I2 << obj.delem;\ - s << obj.obj->names[2] << obj.comp << obj.manip << obj.obj->I3 << obj.delem;\ - s << obj.obj->names[3] << obj.comp << obj.manip << obj.obj->I4 << obj.delem;\ - s << obj.obj->names[4] << obj.comp << obj.manip << obj.obj->I5 << obj.delem;\ - s << obj.obj->names[5] << obj.comp << obj.manip << obj.obj->I6 << obj.delem;\ - s << obj.obj->names[6] << obj.comp << obj.manip << obj.obj->I7 << obj.delem;\ - s << obj.obj->names[7] << obj.comp << obj.manip << obj.obj->I8 << obj.delem;\ - s << obj.obj->names[8] << obj.comp << obj.manip << obj.obj->I9 << obj.delem;\ - s << obj.obj->names[9] << obj.comp << obj.manip << obj.obj->I10 << obj.delem;\ - s << obj.obj->names[10] << obj.comp << obj.manip << obj.obj->I11 << obj.delem;\ - s << obj.obj->names[11] << obj.comp << obj.manip << obj.obj->I12 << obj.delem;\ - s << obj.obj->names[12] << obj.comp << obj.manip << obj.obj->I13 << obj.delem;\ - s << obj.obj->names[13] << obj.comp << obj.manip << obj.obj->I14 << obj.delem;\ - s << obj.obj->names[14] << obj.comp << obj.manip << obj.obj->I15 << obj.delem;\ - s << obj.obj->names[15] << obj.comp << obj.manip << obj.obj->I16 << obj.delem;\ - s << obj.obj->names[16] << obj.comp << obj.manip << obj.obj->I17 << obj.delem;\ - s << obj.obj->names[17] << obj.comp << obj.manip << obj.obj->I18 << obj.delem;\ - s << obj.obj->names[18] << obj.comp << obj.manip << obj.obj->I19 << obj.delem;\ - s << obj.obj->names[19] << obj.comp << obj.manip << obj.obj->I20; \ - return s; \ - } \ - template \ - std::ostream& operator << (std::ostream& s, const NAME##_cus_value_list& obj) { \ - bool before = false; \ - if ((*obj.include)[0]) { \ - s << obj.manip << obj.obj->I1;\ - before = true; \ - } \ - if ((*obj.include)[1]) { \ - if (before) s << obj.delem;\ - s << obj.manip << obj.obj->I2;\ - before = true; \ - } \ - if ((*obj.include)[2]) { \ - if (before) s << obj.delem;\ - s << obj.manip << obj.obj->I3;\ - before = true; \ - } \ - if ((*obj.include)[3]) { \ - if (before) s << obj.delem;\ - s << obj.manip << obj.obj->I4;\ - before = true; \ - } \ - if ((*obj.include)[4]) { \ - if (before) s << obj.delem;\ - s << obj.manip << obj.obj->I5;\ - before = true; \ - } \ - if ((*obj.include)[5]) { \ - if (before) s << obj.delem;\ - s << obj.manip << obj.obj->I6;\ - before = true; \ - } \ - if ((*obj.include)[6]) { \ - if (before) s << obj.delem;\ - s << obj.manip << obj.obj->I7;\ - before = true; \ - } \ - if ((*obj.include)[7]) { \ - if (before) s << obj.delem;\ - s << obj.manip << obj.obj->I8;\ - before = true; \ - } \ - if ((*obj.include)[8]) { \ - if (before) s << obj.delem;\ - s << obj.manip << obj.obj->I9;\ - before = true; \ - } \ - if ((*obj.include)[9]) { \ - if (before) s << obj.delem;\ - s << obj.manip << obj.obj->I10;\ - before = true; \ - } \ - if ((*obj.include)[10]) { \ - if (before) s << obj.delem;\ - s << obj.manip << obj.obj->I11;\ - before = true; \ - } \ - if ((*obj.include)[11]) { \ - if (before) s << obj.delem;\ - s << obj.manip << obj.obj->I12;\ - before = true; \ - } \ - if ((*obj.include)[12]) { \ - if (before) s << obj.delem;\ - s << obj.manip << obj.obj->I13;\ - before = true; \ - } \ - if ((*obj.include)[13]) { \ - if (before) s << obj.delem;\ - s << obj.manip << obj.obj->I14;\ - before = true; \ - } \ - if ((*obj.include)[14]) { \ - if (before) s << obj.delem;\ - s << obj.manip << obj.obj->I15;\ - before = true; \ - } \ - if ((*obj.include)[15]) { \ - if (before) s << obj.delem;\ - s << obj.manip << obj.obj->I16;\ - before = true; \ - } \ - if ((*obj.include)[16]) { \ - if (before) s << obj.delem;\ - s << obj.manip << obj.obj->I17;\ - before = true; \ - } \ - if ((*obj.include)[17]) { \ - if (before) s << obj.delem;\ - s << obj.manip << obj.obj->I18;\ - before = true; \ - } \ - if ((*obj.include)[18]) { \ - if (before) s << obj.delem;\ - s << obj.manip << obj.obj->I19;\ - before = true; \ - } \ - if ((*obj.include)[19]) { \ - if (before) s << obj.delem;\ - s << obj.manip << obj.obj->I20;\ - } \ - return s; \ - } \ - template \ - std::ostream& operator << (std::ostream& s, const NAME##_cus_field_list& obj) { \ - bool before = false; \ - if ((*obj.include)[0]) { \ - s << obj.manip << obj.obj->names[0];\ - before = true; \ - } \ - if ((*obj.include)[1]) { \ - if (before) s << obj.delem;\ - s << obj.manip << obj.obj->names[1];\ - before = true; \ - } \ - if ((*obj.include)[2]) { \ - if (before) s << obj.delem;\ - s << obj.manip << obj.obj->names[2];\ - before = true; \ - } \ - if ((*obj.include)[3]) { \ - if (before) s << obj.delem;\ - s << obj.manip << obj.obj->names[3];\ - before = true; \ - } \ - if ((*obj.include)[4]) { \ - if (before) s << obj.delem;\ - s << obj.manip << obj.obj->names[4];\ - before = true; \ - } \ - if ((*obj.include)[5]) { \ - if (before) s << obj.delem;\ - s << obj.manip << obj.obj->names[5];\ - before = true; \ - } \ - if ((*obj.include)[6]) { \ - if (before) s << obj.delem;\ - s << obj.manip << obj.obj->names[6];\ - before = true; \ - } \ - if ((*obj.include)[7]) { \ - if (before) s << obj.delem;\ - s << obj.manip << obj.obj->names[7];\ - before = true; \ - } \ - if ((*obj.include)[8]) { \ - if (before) s << obj.delem;\ - s << obj.manip << obj.obj->names[8];\ - before = true; \ - } \ - if ((*obj.include)[9]) { \ - if (before) s << obj.delem;\ - s << obj.manip << obj.obj->names[9];\ - before = true; \ - } \ - if ((*obj.include)[10]) { \ - if (before) s << obj.delem;\ - s << obj.manip << obj.obj->names[10];\ - before = true; \ - } \ - if ((*obj.include)[11]) { \ - if (before) s << obj.delem;\ - s << obj.manip << obj.obj->names[11];\ - before = true; \ - } \ - if ((*obj.include)[12]) { \ - if (before) s << obj.delem;\ - s << obj.manip << obj.obj->names[12];\ - before = true; \ - } \ - if ((*obj.include)[13]) { \ - if (before) s << obj.delem;\ - s << obj.manip << obj.obj->names[13];\ - before = true; \ - } \ - if ((*obj.include)[14]) { \ - if (before) s << obj.delem;\ - s << obj.manip << obj.obj->names[14];\ - before = true; \ - } \ - if ((*obj.include)[15]) { \ - if (before) s << obj.delem;\ - s << obj.manip << obj.obj->names[15];\ - before = true; \ - } \ - if ((*obj.include)[16]) { \ - if (before) s << obj.delem;\ - s << obj.manip << obj.obj->names[16];\ - before = true; \ - } \ - if ((*obj.include)[17]) { \ - if (before) s << obj.delem;\ - s << obj.manip << obj.obj->names[17];\ - before = true; \ - } \ - if ((*obj.include)[18]) { \ - if (before) s << obj.delem;\ - s << obj.manip << obj.obj->names[18];\ - before = true; \ - } \ - if ((*obj.include)[19]) { \ - if (before) s << obj.delem;\ - s << obj.manip << obj.obj->names[19];\ - } \ - return s; \ - } \ - template \ - std::ostream& operator << (std::ostream& s, const NAME##_cus_equal_list& obj) { \ - bool before = false; \ - if ((*obj.include)[0]) { \ - s << obj.obj->names[0] << obj.comp << obj.manip << obj.obj->I1;\ - before = true; \ - } \ - if ((*obj.include)[1]) { \ - if (before) s << obj.delem;\ - s << obj.obj->names[1] << obj.comp << obj.manip << obj.obj->I2;\ - before = true; \ - } \ - if ((*obj.include)[2]) { \ - if (before) s << obj.delem;\ - s << obj.obj->names[2] << obj.comp << obj.manip << obj.obj->I3;\ - before = true; \ - } \ - if ((*obj.include)[3]) { \ - if (before) s << obj.delem;\ - s << obj.obj->names[3] << obj.comp << obj.manip << obj.obj->I4;\ - before = true; \ - } \ - if ((*obj.include)[4]) { \ - if (before) s << obj.delem;\ - s << obj.obj->names[4] << obj.comp << obj.manip << obj.obj->I5;\ - before = true; \ - } \ - if ((*obj.include)[5]) { \ - if (before) s << obj.delem;\ - s << obj.obj->names[5] << obj.comp << obj.manip << obj.obj->I6;\ - before = true; \ - } \ - if ((*obj.include)[6]) { \ - if (before) s << obj.delem;\ - s << obj.obj->names[6] << obj.comp << obj.manip << obj.obj->I7;\ - before = true; \ - } \ - if ((*obj.include)[7]) { \ - if (before) s << obj.delem;\ - s << obj.obj->names[7] << obj.comp << obj.manip << obj.obj->I8;\ - before = true; \ - } \ - if ((*obj.include)[8]) { \ - if (before) s << obj.delem;\ - s << obj.obj->names[8] << obj.comp << obj.manip << obj.obj->I9;\ - before = true; \ - } \ - if ((*obj.include)[9]) { \ - if (before) s << obj.delem;\ - s << obj.obj->names[9] << obj.comp << obj.manip << obj.obj->I10;\ - before = true; \ - } \ - if ((*obj.include)[10]) { \ - if (before) s << obj.delem;\ - s << obj.obj->names[10] << obj.comp << obj.manip << obj.obj->I11;\ - before = true; \ - } \ - if ((*obj.include)[11]) { \ - if (before) s << obj.delem;\ - s << obj.obj->names[11] << obj.comp << obj.manip << obj.obj->I12;\ - before = true; \ - } \ - if ((*obj.include)[12]) { \ - if (before) s << obj.delem;\ - s << obj.obj->names[12] << obj.comp << obj.manip << obj.obj->I13;\ - before = true; \ - } \ - if ((*obj.include)[13]) { \ - if (before) s << obj.delem;\ - s << obj.obj->names[13] << obj.comp << obj.manip << obj.obj->I14;\ - before = true; \ - } \ - if ((*obj.include)[14]) { \ - if (before) s << obj.delem;\ - s << obj.obj->names[14] << obj.comp << obj.manip << obj.obj->I15;\ - before = true; \ - } \ - if ((*obj.include)[15]) { \ - if (before) s << obj.delem;\ - s << obj.obj->names[15] << obj.comp << obj.manip << obj.obj->I16;\ - before = true; \ - } \ - if ((*obj.include)[16]) { \ - if (before) s << obj.delem;\ - s << obj.obj->names[16] << obj.comp << obj.manip << obj.obj->I17;\ - before = true; \ - } \ - if ((*obj.include)[17]) { \ - if (before) s << obj.delem;\ - s << obj.obj->names[17] << obj.comp << obj.manip << obj.obj->I18;\ - before = true; \ - } \ - if ((*obj.include)[18]) { \ - if (before) s << obj.delem;\ - s << obj.obj->names[18] << obj.comp << obj.manip << obj.obj->I19;\ - before = true; \ - } \ - if ((*obj.include)[19]) { \ - if (before) s << obj.delem;\ - s << obj.obj->names[19] << obj.comp << obj.manip << obj.obj->I20;\ - } \ - return s; \ - } \ - template \ - inline NAME##_value_list NAME::value_list(cchar *d, Manip m) const { \ - return NAME##_value_list (this, d, m); \ - } \ - template \ - inline NAME##_field_list NAME::field_list(cchar *d, Manip m) const { \ - return NAME##_field_list (this, d, m); \ - } \ - template \ - inline NAME##_equal_list NAME::equal_list(cchar *d, cchar *c, Manip m) const { \ - return NAME##_equal_list (this, d, c, m); \ - } \ - template \ - inline NAME##_cus_value_list NAME::value_list(cchar *d, Manip m,\ - bool i1, bool i2, bool i3, bool i4, bool i5, bool i6, bool i7, bool i8, bool i9, bool i10, bool i11, bool i12, bool i13, bool i14, bool i15, bool i16, bool i17, bool i18, bool i19, bool i20) const {\ - return NAME##_cus_value_list (this, d, m, i1, i2, i3, i4, i5, i6, i7, i8, i9, i10, i11, i12, i13, i14, i15, i16, i17, i18, i19, i20); \ - } \ - template \ - inline NAME##_cus_field_list NAME::field_list(cchar *d, Manip m,\ - bool i1, bool i2, bool i3, bool i4, bool i5, bool i6, bool i7, bool i8, bool i9, bool i10, bool i11, bool i12, bool i13, bool i14, bool i15, bool i16, bool i17, bool i18, bool i19, bool i20) const { \ - return NAME##_cus_field_list (this, d, m, i1, i2, i3, i4, i5, i6, i7, i8, i9, i10, i11, i12, i13, i14, i15, i16, i17, i18, i19, i20); \ - } \ - template \ - inline NAME##_cus_equal_list NAME::equal_list(cchar *d, cchar *c, Manip m,\ - bool i1, bool i2, bool i3, bool i4, bool i5, bool i6, bool i7, bool i8, bool i9, bool i10, bool i11, bool i12, bool i13, bool i14, bool i15, bool i16, bool i17, bool i18, bool i19, bool i20) const { \ - return NAME##_cus_equal_list (this, d, c, m, i1, i2, i3, i4, i5, i6, i7, i8, i9, i10, i11, i12, i13, i14, i15, i16, i17, i18, i19, i20); \ - } \ - template \ - inline NAME##_cus_value_list NAME::value_list(cchar *d, Manip m,\ - NAME##_enum i1, NAME##_enum i2, NAME##_enum i3, NAME##_enum i4, NAME##_enum i5, NAME##_enum i6, NAME##_enum i7, NAME##_enum i8, NAME##_enum i9, NAME##_enum i10, NAME##_enum i11, NAME##_enum i12, NAME##_enum i13, NAME##_enum i14, NAME##_enum i15, NAME##_enum i16, NAME##_enum i17, NAME##_enum i18, NAME##_enum i19, NAME##_enum i20) const { \ - return NAME##_cus_value_list (this, d, m, i1, i2, i3, i4, i5, i6, i7, i8, i9, i10, i11, i12, i13, i14, i15, i16, i17, i18, i19, i20); \ - } \ - template \ - inline NAME##_cus_field_list NAME::field_list(cchar *d, Manip m,\ - NAME##_enum i1, NAME##_enum i2, NAME##_enum i3, NAME##_enum i4, NAME##_enum i5, NAME##_enum i6, NAME##_enum i7, NAME##_enum i8, NAME##_enum i9, NAME##_enum i10, NAME##_enum i11, NAME##_enum i12, NAME##_enum i13, NAME##_enum i14, NAME##_enum i15, NAME##_enum i16, NAME##_enum i17, NAME##_enum i18, NAME##_enum i19, NAME##_enum i20) const {\ - return NAME##_cus_field_list (this, d, m, i1, i2, i3, i4, i5, i6, i7, i8, i9, i10, i11, i12, i13, i14, i15, i16, i17, i18, i19, i20); \ - } \ - template \ - inline NAME##_cus_equal_list NAME::equal_list(cchar *d, cchar *c, Manip m, \ - NAME##_enum i1, NAME##_enum i2, NAME##_enum i3, NAME##_enum i4, NAME##_enum i5, NAME##_enum i6, NAME##_enum i7, NAME##_enum i8, NAME##_enum i9, NAME##_enum i10, NAME##_enum i11, NAME##_enum i12, NAME##_enum i13, NAME##_enum i14, NAME##_enum i15, NAME##_enum i16, NAME##_enum i17, NAME##_enum i18, NAME##_enum i19, NAME##_enum i20) const { \ - return NAME##_cus_equal_list (this, d, c, m, i1, i2, i3, i4, i5, i6, i7, i8, i9, i10, i11, i12, i13, i14, i15, i16, i17, i18, i19, i20); \ - } \ - template \ - inline NAME##_cus_value_list NAME::value_list(cchar *d, Manip m,\ - std::vector *i) const {\ - return NAME##_cus_value_list (this, d, m, i);\ - }\ - template \ - inline NAME##_cus_field_list NAME::field_list(cchar *d, Manip m,\ - std::vector *i) const {\ - return NAME##_cus_field_list (this, d, m, i);\ - }\ - template \ - inline NAME##_cus_equal_list NAME::equal_list(cchar *d, cchar *c, Manip m,\ - std::vector *i) const {\ - return NAME##_cus_equal_list (this, d, c, m, i);\ - }\ - template \ - inline NAME##_cus_value_list \ - NAME::value_list(cchar *d, Manip m, sql_cmp_type /*sc*/) const {\ - sql_compare_type_def_##CMP (NAME, value, NUM);\ - }\ - template \ - inline NAME##_cus_field_list \ - NAME::field_list(cchar *d, Manip m, sql_cmp_type /*sc*/) const {\ - sql_compare_type_def_##CMP (NAME, field, NUM);\ - }\ - template \ - inline NAME##_cus_equal_list \ - NAME::equal_list(cchar *d, cchar *c, Manip m, sql_cmp_type /*sc*/) const {\ - sql_compare_type_defe_##CMP (NAME, equal, NUM);\ - }\ - template \ - void populate_##NAME (NAME *s, const Row &row) { \ - s->I1 = static_cast(row.at(O1));\ - s->I2 = static_cast(row.at(O2));\ - s->I3 = static_cast(row.at(O3));\ - s->I4 = static_cast(row.at(O4));\ - s->I5 = static_cast(row.at(O5));\ - s->I6 = static_cast(row.at(O6));\ - s->I7 = static_cast(row.at(O7));\ - s->I8 = static_cast(row.at(O8));\ - s->I9 = static_cast(row.at(O9));\ - s->I10 = static_cast(row.at(O10));\ - s->I11 = static_cast(row.at(O11));\ - s->I12 = static_cast(row.at(O12));\ - s->I13 = static_cast(row.at(O13));\ - s->I14 = static_cast(row.at(O14));\ - s->I15 = static_cast(row.at(O15));\ - s->I16 = static_cast(row.at(O16));\ - s->I17 = static_cast(row.at(O17));\ - s->I18 = static_cast(row.at(O18));\ - s->I19 = static_cast(row.at(O19));\ - s->I20 = static_cast(row.at(O20));\ - } \ - inline NAME::NAME (const Row &row) \ - {populate_##NAME(this, row);}\ - inline void NAME::set (const Row &row)\ - {populate_##NAME(this, row);}\ - sql_COMPARE__##CMP(NAME, I1, I2, I3, I4, I5, I6, I7, I8, I9, I10, I11, I12, I13, I14, I15, I16, I17, I18, I19, I20, 0, 0, 0, 0, 0 ) - -#define sql_create_basic_20(NAME, CMP, CONTR, T1, I1, T2, I2, T3, I3, T4, I4, T5, I5, T6, I6, T7, I7, T8, I8, T9, I9, T10, I10, T11, I11, T12, I12, T13, I13, T14, I14, T15, I15, T16, I16, T17, I17, T18, I18, T19, I19, T20, I20) \ - sql_create_basic_c_order_20(NAME, CMP, CONTR, T1, I1, 0, T2, I2, 1, T3, I3, 2, T4, I4, 3, T5, I5, 4, T6, I6, 5, T7, I7, 6, T8, I8, 7, T9, I9, 8, T10, I10, 9, T11, I11, 10, T12, I12, 11, T13, I13, 12, T14, I14, 13, T15, I15, 14, T16, I16, 15, T17, I17, 16, T18, I18, 17, T19, I19, 18, T20, I20, 19) - -#define sql_create_20(NAME, CMP, CONTR, T1, I1, T2, I2, T3, I3, T4, I4, T5, I5, T6, I6, T7, I7, T8, I8, T9, I9, T10, I10, T11, I11, T12, I12, T13, I13, T14, I14, T15, I15, T16, I16, T17, I17, T18, I18, T19, I19, T20, I20) \ - sql_create_complete_20(NAME, CMP, CONTR, T1, I1, #I1, 0, T2, I2, #I2, 1, T3, I3, #I3, 2, T4, I4, #I4, 3, T5, I5, #I5, 4, T6, I6, #I6, 5, T7, I7, #I7, 6, T8, I8, #I8, 7, T9, I9, #I9, 8, T10, I10, #I10, 9, T11, I11, #I11, 10, T12, I12, #I12, 11, T13, I13, #I13, 12, T14, I14, #I14, 13, T15, I15, #I15, 14, T16, I16, #I16, 15, T17, I17, #I17, 16, T18, I18, #I18, 17, T19, I19, #I19, 18, T20, I20, #I20, 19) \ - -#define sql_create_c_order_20(NAME, CMP, CONTR, T1, I1, O1, T2, I2, O2, T3, I3, O3, T4, I4, O4, T5, I5, O5, T6, I6, O6, T7, I7, O7, T8, I8, O8, T9, I9, O9, T10, I10, O10, T11, I11, O11, T12, I12, O12, T13, I13, O13, T14, I14, O14, T15, I15, O15, T16, I16, O16, T17, I17, O17, T18, I18, O18, T19, I19, O19, T20, I20, O20) \ - sql_create_complete_20(NAME, CMP, CONTR, T1, I1, #I1, O1, T2, I2, #I2, O2, T3, I3, #I3, O3, T4, I4, #I4, O4, T5, I5, #I5, O5, T6, I6, #I6, O6, T7, I7, #I7, O7, T8, I8, #I8, O8, T9, I9, #I9, O9, T10, I10, #I10, O10, T11, I11, #I11, O11, T12, I12, #I12, O12, T13, I13, #I13, O13, T14, I14, #I14, O14, T15, I15, #I15, O15, T16, I16, #I16, O16, T17, I17, #I17, O17, T18, I18, #I18, O18, T19, I19, #I19, O19, T20, I20, #I20, O20) - -#define sql_create_c_names_20(NAME, CMP, CONTR, T1, I1, N1, T2, I2, N2, T3, I3, N3, T4, I4, N4, T5, I5, N5, T6, I6, N6, T7, I7, N7, T8, I8, N8, T9, I9, N9, T10, I10, N10, T11, I11, N11, T12, I12, N12, T13, I13, N13, T14, I14, N14, T15, I15, N15, T16, I16, N16, T17, I17, N17, T18, I18, N18, T19, I19, N19, T20, I20, N20) \ - sql_create_complete_20(NAME, CMP, CONTR, T1, I1, N1, 0, T2, I2, N2, 1, T3, I3, N3, 2, T4, I4, N4, 3, T5, I5, N5, 4, T6, I6, N6, 5, T7, I7, N7, 6, T8, I8, N8, 7, T9, I9, N9, 8, T10, I10, N10, 9, T11, I11, N11, 10, T12, I12, N12, 11, T13, I13, N13, 12, T14, I14, N14, 13, T15, I15, N15, 14, T16, I16, N16, 15, T17, I17, N17, 16, T18, I18, N18, 17, T19, I19, N19, 18, T20, I20, N20, 19) - -// --------------------------------------------------- -// End Create 20 -// --------------------------------------------------- - -// --------------------------------------------------- -// Begin Create 21 -// --------------------------------------------------- -#define sql_create_basic_c_order_21(NAME, CMP, CONTR, T1, I1, O1, T2, I2, O2, T3, I3, O3, T4, I4, O4, T5, I5, O5, T6, I6, O6, T7, I7, O7, T8, I8, O8, T9, I9, O9, T10, I10, O10, T11, I11, O11, T12, I12, O12, T13, I13, O13, T14, I14, O14, T15, I15, O15, T16, I16, O16, T17, I17, O17, T18, I18, O18, T19, I19, O19, T20, I20, O20, T21, I21, O21)\ - struct NAME; \ - template int sql_compare_##NAME (const NAME &, const NAME &);\ - struct NAME { \ - T1 I1;\ - T2 I2;\ - T3 I3;\ - T4 I4;\ - T5 I5;\ - T6 I6;\ - T7 I7;\ - T8 I8;\ - T9 I9;\ - T10 I10;\ - T11 I11;\ - T12 I12;\ - T13 I13;\ - T14 I14;\ - T15 I15;\ - T16 I16;\ - T17 I17;\ - T18 I18;\ - T19 I19;\ - T20 I20;\ - T21 I21; \ - NAME () {} \ - NAME (const Row &row);\ - sql_compare_define_##CMP(NAME, T1, I1, T2, I2, T3, I3, T4, I4, T5, I5, T6, I6, T7, I7, T8, I8, T9, I9, T10, I10, T11, I11, T12, I12, T13, I13, T14, I14, T15, I15, T16, I16, T17, I17, T18, I18, T19, I19, T20, I20, T21, I21, 0, 0, 0, 0, 0, 0, 0, 0)\ - }; \ - template \ - void populate_##NAME (NAME *s, const Row &row) { \ - s->I1 = static_cast(row.at(O1));\ - s->I2 = static_cast(row.at(O2));\ - s->I3 = static_cast(row.at(O3));\ - s->I4 = static_cast(row.at(O4));\ - s->I5 = static_cast(row.at(O5));\ - s->I6 = static_cast(row.at(O6));\ - s->I7 = static_cast(row.at(O7));\ - s->I8 = static_cast(row.at(O8));\ - s->I9 = static_cast(row.at(O9));\ - s->I10 = static_cast(row.at(O10));\ - s->I11 = static_cast(row.at(O11));\ - s->I12 = static_cast(row.at(O12));\ - s->I13 = static_cast(row.at(O13));\ - s->I14 = static_cast(row.at(O14));\ - s->I15 = static_cast(row.at(O15));\ - s->I16 = static_cast(row.at(O16));\ - s->I17 = static_cast(row.at(O17));\ - s->I18 = static_cast(row.at(O18));\ - s->I19 = static_cast(row.at(O19));\ - s->I20 = static_cast(row.at(O20));\ - s->I21 = static_cast(row.at(O21)); \ - } \ - inline NAME::NAME (const Row &row) \ - {populate_##NAME(this, row);} \ - sql_COMPARE__##CMP(NAME, I1, I2, I3, I4, I5, I6, I7, I8, I9, I10, I11, I12, I13, I14, I15, I16, I17, I18, I19, I20, I21, 0, 0, 0, 0 ) - -#define sql_create_complete_21(NAME, CMP, CONTR, T1, I1, N1, O1, T2, I2, N2, O2, T3, I3, N3, O3, T4, I4, N4, O4, T5, I5, N5, O5, T6, I6, N6, O6, T7, I7, N7, O7, T8, I8, N8, O8, T9, I9, N9, O9, T10, I10, N10, O10, T11, I11, N11, O11, T12, I12, N12, O12, T13, I13, N13, O13, T14, I14, N14, O14, T15, I15, N15, O15, T16, I16, N16, O16, T17, I17, N17, O17, T18, I18, N18, O18, T19, I19, N19, O19, T20, I20, N20, O20, T21, I21, N21, O21) \ - struct NAME; \ - enum NAME##_enum { \ - NAME##_##I1,\ - NAME##_##I2,\ - NAME##_##I3,\ - NAME##_##I4,\ - NAME##_##I5,\ - NAME##_##I6,\ - NAME##_##I7,\ - NAME##_##I8,\ - NAME##_##I9,\ - NAME##_##I10,\ - NAME##_##I11,\ - NAME##_##I12,\ - NAME##_##I13,\ - NAME##_##I14,\ - NAME##_##I15,\ - NAME##_##I16,\ - NAME##_##I17,\ - NAME##_##I18,\ - NAME##_##I19,\ - NAME##_##I20,\ - NAME##_##I21 \ - ,NAME##_NULL \ - }; \ - template \ - class NAME##_value_list { \ - /*friend std::ostream& operator << <> (std::ostream&, const NAME##_value_list&); */\ - public: \ - const NAME *obj;\ - cchar *delem;\ - Manip manip;\ - public: \ - NAME##_value_list (const NAME *o, cchar *d, Manip m) \ - : obj(o), delem(d), manip(m) {} \ - };\ - template \ - class NAME##_##field_list {\ - /* friend std::ostream& operator << <> (std::ostream&, const NAME##_field_list&); */\ - public: \ - const NAME *obj; \ - cchar *delem;\ - Manip manip;\ - public: \ - NAME##_field_list (const NAME *o, cchar *d, Manip m) \ - : obj(o), delem(d), manip(m) {} \ - };\ - template \ - class NAME##_equal_list { \ - /* friend std::ostream& operator << <> (std::ostream&, const NAME##_equal_list&); */\ - public: \ - const NAME *obj;\ - cchar *delem;\ - cchar *comp;\ - Manip manip;\ - public: \ - NAME##_equal_list (const NAME *o, cchar *d, cchar *c, Manip m) \ - : obj(o), delem(d), comp(c), manip(m) {}\ - };\ - template \ - class NAME##_cus_value_list {\ - /* friend std::ostream& operator << <> (std::ostream&, \ - const NAME##_cus_value_list&); */\ - public:\ - const NAME *obj;\ - std::vector *include;\ - bool del_vector;\ - cchar *delem;\ - Manip manip;\ - public: \ - ~NAME##_cus_value_list () {if (del_vector) delete include;} \ - NAME##_cus_value_list (const NAME *o, cchar *d, Manip m, bool i1, bool i2, bool i3, bool i4, bool i5, bool i6, bool i7, bool i8, bool i9, bool i10, bool i11, bool i12, bool i13, bool i14, bool i15, bool i16, bool i17, bool i18, bool i19, bool i20, bool i21);\ - NAME##_cus_value_list (const NAME *o, cchar *d, Manip m, NAME##_enum i1, NAME##_enum i2, NAME##_enum i3, NAME##_enum i4, NAME##_enum i5, NAME##_enum i6, NAME##_enum i7, NAME##_enum i8, NAME##_enum i9, NAME##_enum i10, NAME##_enum i11, NAME##_enum i12, NAME##_enum i13, NAME##_enum i14, NAME##_enum i15, NAME##_enum i16, NAME##_enum i17, NAME##_enum i18, NAME##_enum i19, NAME##_enum i20, NAME##_enum i21); \ - NAME##_cus_value_list (const NAME *o, cchar *d, Manip m ,std::vector* i)\ - : obj(o), include(i), del_vector(false), delem(d), manip(m) {}\ - };\ - template \ - class NAME##_cus_field_list { \ - /* friend std::ostream& operator << <> (std::ostream&, \ - const NAME##_cus_field_list&); */\ - public:\ - const NAME *obj; \ - std::vector *include; \ - bool del_vector; \ - cchar *delem;\ - Manip manip;\ - public: \ - ~NAME##_cus_field_list () {if (del_vector) delete include;} \ - NAME##_cus_field_list (const NAME *o, cchar *d, Manip m, bool i1, bool i2, bool i3, bool i4, bool i5, bool i6, bool i7, bool i8, bool i9, bool i10, bool i11, bool i12, bool i13, bool i14, bool i15, bool i16, bool i17, bool i18, bool i19, bool i20, bool i21); \ - NAME##_cus_field_list (const NAME *o, cchar *d, Manip m, NAME##_enum i1, NAME##_enum i2, NAME##_enum i3, NAME##_enum i4, NAME##_enum i5, NAME##_enum i6, NAME##_enum i7, NAME##_enum i8, NAME##_enum i9, NAME##_enum i10, NAME##_enum i11, NAME##_enum i12, NAME##_enum i13, NAME##_enum i14, NAME##_enum i15, NAME##_enum i16, NAME##_enum i17, NAME##_enum i18, NAME##_enum i19, NAME##_enum i20, NAME##_enum i21); \ - NAME##_cus_field_list (const NAME *o, cchar *d, Manip m, std::vector *i) \ - : obj(o), include(i), del_vector(false), delem(d), manip(m) {}\ - };\ - template \ - class NAME##_cus_equal_list {\ - /* friend std::ostream& operator << <> (std::ostream&, \ - const NAME##_cus_equal_list&); */\ - public:\ - const NAME *obj;\ - std::vector *include;\ - bool del_vector;\ - cchar *delem;\ - cchar *comp;\ - Manip manip;\ - public:\ - ~NAME##_##cus_equal_list () {if (del_vector) delete include;}\ - NAME##_##cus_equal_list (const NAME *o, cchar *d, cchar *c, Manip m, bool i1, bool i2, bool i3, bool i4, bool i5, bool i6, bool i7, bool i8, bool i9, bool i10, bool i11, bool i12, bool i13, bool i14, bool i15, bool i16, bool i17, bool i18, bool i19, bool i20, bool i21); \ - NAME##_##cus_equal_list (const NAME *o, cchar *d, cchar *c, Manip m, NAME##_enum i1, NAME##_enum i2, NAME##_enum i3, NAME##_enum i4, NAME##_enum i5, NAME##_enum i6, NAME##_enum i7, NAME##_enum i8, NAME##_enum i9, NAME##_enum i10, NAME##_enum i11, NAME##_enum i12, NAME##_enum i13, NAME##_enum i14, NAME##_enum i15, NAME##_enum i16, NAME##_enum i17, NAME##_enum i18, NAME##_enum i19, NAME##_enum i20, NAME##_enum i21); \ - NAME##_##cus_equal_list (const NAME *o, cchar *d, cchar *c, Manip m, std::vector *i) \ - : obj(o), include(i), del_vector(false), delem(d), comp(c), manip(m) {}\ - };\ - template int sql_compare_##NAME (const NAME &, const NAME &);\ - struct NAME { \ - T1 I1;\ - T2 I2;\ - T3 I3;\ - T4 I4;\ - T5 I5;\ - T6 I6;\ - T7 I7;\ - T8 I8;\ - T9 I9;\ - T10 I10;\ - T11 I11;\ - T12 I12;\ - T13 I13;\ - T14 I14;\ - T15 I15;\ - T16 I16;\ - T17 I17;\ - T18 I18;\ - T19 I19;\ - T20 I20;\ - T21 I21; \ - NAME () {} \ - NAME (const Row &row);\ - void set (const Row &row);\ - sql_compare_define_##CMP(NAME, T1, I1, T2, I2, T3, I3, T4, I4, T5, I5, T6, I6, T7, I7, T8, I8, T9, I9, T10, I10, T11, I11, T12, I12, T13, I13, T14, I14, T15, I15, T16, I16, T17, I17, T18, I18, T19, I19, T20, I20, T21, I21, 0, 0, 0, 0, 0, 0, 0, 0)\ - sql_construct_define_##CONTR(NAME, T1, I1, T2, I2, T3, I3, T4, I4, T5, I5, T6, I6, T7, I7, T8, I8, T9, I9, T10, I10, T11, I11, T12, I12, T13, I13, T14, I14, T15, I15, T16, I16, T17, I17, T18, I18, T19, I19, T20, I20, T21, I21, 0, 0, 0, 0, 0, 0, 0, 0)\ - static const char *names[];\ - static const char *_table;\ - static const char *& table() {return _table;}\ - NAME##_value_list value_list() const {\ - return value_list(",", quote);}\ - NAME##_value_list value_list(cchar *d) const {\ - return value_list(d, quote);}\ - template \ - NAME##_value_list value_list(cchar *d, Manip m) const; \ - NAME##_field_list field_list() const {\ - return field_list(",", do_nothing);}\ - NAME##_field_list field_list(cchar *d) const {\ - return field_list(d, do_nothing);}\ - template \ - NAME##_field_list field_list(cchar *d, Manip m) const; \ - NAME##_equal_list equal_list(cchar *d = ",", \ - cchar *c = " = ") const{\ - return equal_list(d, c, quote);}\ - template \ - NAME##_equal_list equal_list(cchar *d, cchar *c, Manip m) const; \ - /* cus_data */\ - NAME##_cus_value_list value_list(bool i1, bool i2 = false, bool i3 = false, bool i4 = false, bool i5 = false, bool i6 = false, bool i7 = false, bool i8 = false, bool i9 = false, bool i10 = false, bool i11 = false, bool i12 = false, bool i13 = false, bool i14 = false, bool i15 = false, bool i16 = false, bool i17 = false, bool i18 = false, bool i19 = false, bool i20 = false, bool i21 = false) const {\ - return value_list(",", quote, i1, i2, i3, i4, i5, i6, i7, i8, i9, i10, i11, i12, i13, i14, i15, i16, i17, i18, i19, i20, i21);\ - }\ - NAME##_cus_value_list value_list(NAME##_enum i1, NAME##_enum i2 = NAME##_NULL, NAME##_enum i3 = NAME##_NULL, NAME##_enum i4 = NAME##_NULL, NAME##_enum i5 = NAME##_NULL, NAME##_enum i6 = NAME##_NULL, NAME##_enum i7 = NAME##_NULL, NAME##_enum i8 = NAME##_NULL, NAME##_enum i9 = NAME##_NULL, NAME##_enum i10 = NAME##_NULL, NAME##_enum i11 = NAME##_NULL, NAME##_enum i12 = NAME##_NULL, NAME##_enum i13 = NAME##_NULL, NAME##_enum i14 = NAME##_NULL, NAME##_enum i15 = NAME##_NULL, NAME##_enum i16 = NAME##_NULL, NAME##_enum i17 = NAME##_NULL, NAME##_enum i18 = NAME##_NULL, NAME##_enum i19 = NAME##_NULL, NAME##_enum i20 = NAME##_NULL, NAME##_enum i21 = NAME##_NULL) const {\ - return value_list(",", quote, i1, i2, i3, i4, i5, i6, i7, i8, i9, i10, i11, i12, i13, i14, i15, i16, i17, i18, i19, i20, i21);\ - }\ - NAME##_cus_value_list value_list(std::vector *i) const {\ - return value_list(",", quote, i);\ - }\ - NAME##_cus_value_list value_list(sql_cmp_type sc) const {\ - return value_list(",", quote, sc);\ - }\ - NAME##_cus_value_list value_list(cchar *d, bool i1, bool i2 = false, bool i3 = false, bool i4 = false, bool i5 = false, bool i6 = false, bool i7 = false, bool i8 = false, bool i9 = false, bool i10 = false, bool i11 = false, bool i12 = false, bool i13 = false, bool i14 = false, bool i15 = false, bool i16 = false, bool i17 = false, bool i18 = false, bool i19 = false, bool i20 = false, bool i21 = false) const {\ - return value_list(d, quote, i1, i2, i3, i4, i5, i6, i7, i8, i9, i10, i11, i12, i13, i14, i15, i16, i17, i18, i19, i20, i21);\ - }\ - NAME##_cus_value_list value_list(cchar *d, NAME##_enum i1, NAME##_enum i2 = NAME##_NULL, NAME##_enum i3 = NAME##_NULL, NAME##_enum i4 = NAME##_NULL, NAME##_enum i5 = NAME##_NULL, NAME##_enum i6 = NAME##_NULL, NAME##_enum i7 = NAME##_NULL, NAME##_enum i8 = NAME##_NULL, NAME##_enum i9 = NAME##_NULL, NAME##_enum i10 = NAME##_NULL, NAME##_enum i11 = NAME##_NULL, NAME##_enum i12 = NAME##_NULL, NAME##_enum i13 = NAME##_NULL, NAME##_enum i14 = NAME##_NULL, NAME##_enum i15 = NAME##_NULL, NAME##_enum i16 = NAME##_NULL, NAME##_enum i17 = NAME##_NULL, NAME##_enum i18 = NAME##_NULL, NAME##_enum i19 = NAME##_NULL, NAME##_enum i20 = NAME##_NULL, NAME##_enum i21 = NAME##_NULL) const {\ - return value_list(d, quote, i1, i2, i3, i4, i5, i6, i7, i8, i9, i10, i11, i12, i13, i14, i15, i16, i17, i18, i19, i20, i21);\ - }\ - NAME##_cus_value_list value_list(cchar *d, \ - std::vector *i) const {\ - return value_list(d, quote, i);\ - }\ - NAME##_cus_value_list value_list(cchar *d, \ - sql_cmp_type sc) const {\ - return value_list(d, quote, sc);\ - }\ - template \ - NAME##_cus_value_list value_list(cchar *d, Manip m,\ - bool i1, bool i2 = false, bool i3 = false, bool i4 = false, bool i5 = false, bool i6 = false, bool i7 = false, bool i8 = false, bool i9 = false, bool i10 = false, bool i11 = false, bool i12 = false, bool i13 = false, bool i14 = false, bool i15 = false, bool i16 = false, bool i17 = false, bool i18 = false, bool i19 = false, bool i20 = false, bool i21 = false) const; \ - template \ - NAME##_cus_value_list value_list(cchar *d, Manip m,\ - NAME##_enum i1, NAME##_enum i2 = NAME##_NULL, NAME##_enum i3 = NAME##_NULL, NAME##_enum i4 = NAME##_NULL, NAME##_enum i5 = NAME##_NULL, NAME##_enum i6 = NAME##_NULL, NAME##_enum i7 = NAME##_NULL, NAME##_enum i8 = NAME##_NULL, NAME##_enum i9 = NAME##_NULL, NAME##_enum i10 = NAME##_NULL, NAME##_enum i11 = NAME##_NULL, NAME##_enum i12 = NAME##_NULL, NAME##_enum i13 = NAME##_NULL, NAME##_enum i14 = NAME##_NULL, NAME##_enum i15 = NAME##_NULL, NAME##_enum i16 = NAME##_NULL, NAME##_enum i17 = NAME##_NULL, NAME##_enum i18 = NAME##_NULL, NAME##_enum i19 = NAME##_NULL, NAME##_enum i20 = NAME##_NULL, NAME##_enum i21 = NAME##_NULL) const; \ - template \ - NAME##_cus_value_list value_list(cchar *d, Manip m, \ - std::vector *i) const;\ - template \ - NAME##_cus_value_list value_list(cchar *d, Manip m, \ - sql_cmp_type sc) const;\ - /* cus field */\ - NAME##_cus_field_list field_list(bool i1, bool i2 = false, bool i3 = false, bool i4 = false, bool i5 = false, bool i6 = false, bool i7 = false, bool i8 = false, bool i9 = false, bool i10 = false, bool i11 = false, bool i12 = false, bool i13 = false, bool i14 = false, bool i15 = false, bool i16 = false, bool i17 = false, bool i18 = false, bool i19 = false, bool i20 = false, bool i21 = false) const {\ - return field_list(",", do_nothing, i1, i2, i3, i4, i5, i6, i7, i8, i9, i10, i11, i12, i13, i14, i15, i16, i17, i18, i19, i20, i21);\ - }\ - NAME##_cus_field_list field_list(NAME##_enum i1, NAME##_enum i2 = NAME##_NULL, NAME##_enum i3 = NAME##_NULL, NAME##_enum i4 = NAME##_NULL, NAME##_enum i5 = NAME##_NULL, NAME##_enum i6 = NAME##_NULL, NAME##_enum i7 = NAME##_NULL, NAME##_enum i8 = NAME##_NULL, NAME##_enum i9 = NAME##_NULL, NAME##_enum i10 = NAME##_NULL, NAME##_enum i11 = NAME##_NULL, NAME##_enum i12 = NAME##_NULL, NAME##_enum i13 = NAME##_NULL, NAME##_enum i14 = NAME##_NULL, NAME##_enum i15 = NAME##_NULL, NAME##_enum i16 = NAME##_NULL, NAME##_enum i17 = NAME##_NULL, NAME##_enum i18 = NAME##_NULL, NAME##_enum i19 = NAME##_NULL, NAME##_enum i20 = NAME##_NULL, NAME##_enum i21 = NAME##_NULL) const {\ - return field_list(",", do_nothing, i1, i2, i3, i4, i5, i6, i7, i8, i9, i10, i11, i12, i13, i14, i15, i16, i17, i18, i19, i20, i21);\ - }\ - NAME##_cus_field_list field_list(std::vector *i) const {\ - return field_list(",", do_nothing, i);\ - }\ - NAME##_cus_field_list field_list(sql_cmp_type sc) const\ - {\ - return field_list(",", do_nothing, sc);\ - }\ - NAME##_cus_field_list field_list(cchar *d, \ - bool i1, bool i2 = false, bool i3 = false, bool i4 = false, bool i5 = false, bool i6 = false, bool i7 = false, bool i8 = false, bool i9 = false, bool i10 = false, bool i11 = false, bool i12 = false, bool i13 = false, bool i14 = false, bool i15 = false, bool i16 = false, bool i17 = false, bool i18 = false, bool i19 = false, bool i20 = false, bool i21 = false) const {\ - return field_list(d, do_nothing, i1, i2, i3, i4, i5, i6, i7, i8, i9, i10, i11, i12, i13, i14, i15, i16, i17, i18, i19, i20, i21);\ - }\ - NAME##_cus_field_list field_list(cchar *d,\ - NAME##_enum i1, NAME##_enum i2 = NAME##_NULL, NAME##_enum i3 = NAME##_NULL, NAME##_enum i4 = NAME##_NULL, NAME##_enum i5 = NAME##_NULL, NAME##_enum i6 = NAME##_NULL, NAME##_enum i7 = NAME##_NULL, NAME##_enum i8 = NAME##_NULL, NAME##_enum i9 = NAME##_NULL, NAME##_enum i10 = NAME##_NULL, NAME##_enum i11 = NAME##_NULL, NAME##_enum i12 = NAME##_NULL, NAME##_enum i13 = NAME##_NULL, NAME##_enum i14 = NAME##_NULL, NAME##_enum i15 = NAME##_NULL, NAME##_enum i16 = NAME##_NULL, NAME##_enum i17 = NAME##_NULL, NAME##_enum i18 = NAME##_NULL, NAME##_enum i19 = NAME##_NULL, NAME##_enum i20 = NAME##_NULL, NAME##_enum i21 = NAME##_NULL) const {\ - return field_list(d, do_nothing, i1, i2, i3, i4, i5, i6, i7, i8, i9, i10, i11, i12, i13, i14, i15, i16, i17, i18, i19, i20, i21);\ - }\ - NAME##_cus_field_list field_list(cchar *d, \ - std::vector *i) const {\ - return field_list(d, do_nothing, i);\ - }\ - NAME##_cus_field_list field_list(cchar *d, \ - sql_cmp_type sc) const {\ - return field_list(d, do_nothing, sc);\ - }\ - template \ - NAME##_cus_field_list field_list(cchar *d, Manip m,\ - bool i1, bool i2 = false, bool i3 = false, bool i4 = false, bool i5 = false, bool i6 = false, bool i7 = false, bool i8 = false, bool i9 = false, bool i10 = false, bool i11 = false, bool i12 = false, bool i13 = false, bool i14 = false, bool i15 = false, bool i16 = false, bool i17 = false, bool i18 = false, bool i19 = false, bool i20 = false, bool i21 = false) const; \ - template \ - NAME##_cus_field_list field_list(cchar *d, Manip m,\ - NAME##_enum i1, NAME##_enum i2 = NAME##_NULL, NAME##_enum i3 = NAME##_NULL, NAME##_enum i4 = NAME##_NULL, NAME##_enum i5 = NAME##_NULL, NAME##_enum i6 = NAME##_NULL, NAME##_enum i7 = NAME##_NULL, NAME##_enum i8 = NAME##_NULL, NAME##_enum i9 = NAME##_NULL, NAME##_enum i10 = NAME##_NULL, NAME##_enum i11 = NAME##_NULL, NAME##_enum i12 = NAME##_NULL, NAME##_enum i13 = NAME##_NULL, NAME##_enum i14 = NAME##_NULL, NAME##_enum i15 = NAME##_NULL, NAME##_enum i16 = NAME##_NULL, NAME##_enum i17 = NAME##_NULL, NAME##_enum i18 = NAME##_NULL, NAME##_enum i19 = NAME##_NULL, NAME##_enum i20 = NAME##_NULL, NAME##_enum i21 = NAME##_NULL) const; \ - template \ - NAME##_cus_field_list field_list(cchar *d, Manip m,\ - std::vector *i) const;\ - template \ - NAME##_cus_field_list field_list(cchar *d, Manip m, \ - sql_cmp_type sc) const;\ - /* cus equal */\ - NAME##_cus_equal_list equal_list(bool i1, bool i2 = false, bool i3 = false, bool i4 = false, bool i5 = false, bool i6 = false, bool i7 = false, bool i8 = false, bool i9 = false, bool i10 = false, bool i11 = false, bool i12 = false, bool i13 = false, bool i14 = false, bool i15 = false, bool i16 = false, bool i17 = false, bool i18 = false, bool i19 = false, bool i20 = false, bool i21 = false) const {\ - return equal_list(",", " = ", quote, i1, i2, i3, i4, i5, i6, i7, i8, i9, i10, i11, i12, i13, i14, i15, i16, i17, i18, i19, i20, i21);\ - }\ - NAME##_cus_equal_list equal_list(NAME##_enum i1, NAME##_enum i2 = NAME##_NULL, NAME##_enum i3 = NAME##_NULL, NAME##_enum i4 = NAME##_NULL, NAME##_enum i5 = NAME##_NULL, NAME##_enum i6 = NAME##_NULL, NAME##_enum i7 = NAME##_NULL, NAME##_enum i8 = NAME##_NULL, NAME##_enum i9 = NAME##_NULL, NAME##_enum i10 = NAME##_NULL, NAME##_enum i11 = NAME##_NULL, NAME##_enum i12 = NAME##_NULL, NAME##_enum i13 = NAME##_NULL, NAME##_enum i14 = NAME##_NULL, NAME##_enum i15 = NAME##_NULL, NAME##_enum i16 = NAME##_NULL, NAME##_enum i17 = NAME##_NULL, NAME##_enum i18 = NAME##_NULL, NAME##_enum i19 = NAME##_NULL, NAME##_enum i20 = NAME##_NULL, NAME##_enum i21 = NAME##_NULL) const {\ - return equal_list(",", " = ", quote, i1, i2, i3, i4, i5, i6, i7, i8, i9, i10, i11, i12, i13, i14, i15, i16, i17, i18, i19, i20, i21);\ - }\ - NAME##_cus_equal_list equal_list(std::vector *i) const {\ - return equal_list(",", " = ", quote, i);\ - }\ - NAME##_cus_equal_list equal_list(sql_cmp_type sc) const {\ - return equal_list(",", " = ", quote, sc);\ - }\ - NAME##_cus_equal_list equal_list(cchar *d, bool i1, bool i2 = false, bool i3 = false, bool i4 = false, bool i5 = false, bool i6 = false, bool i7 = false, bool i8 = false, bool i9 = false, bool i10 = false, bool i11 = false, bool i12 = false, bool i13 = false, bool i14 = false, bool i15 = false, bool i16 = false, bool i17 = false, bool i18 = false, bool i19 = false, bool i20 = false, bool i21 = false) const {\ - return equal_list(d, " = ", quote, i1, i2, i3, i4, i5, i6, i7, i8, i9, i10, i11, i12, i13, i14, i15, i16, i17, i18, i19, i20, i21);\ - }\ - NAME##_cus_equal_list equal_list(cchar *d, NAME##_enum i1, NAME##_enum i2 = NAME##_NULL, NAME##_enum i3 = NAME##_NULL, NAME##_enum i4 = NAME##_NULL, NAME##_enum i5 = NAME##_NULL, NAME##_enum i6 = NAME##_NULL, NAME##_enum i7 = NAME##_NULL, NAME##_enum i8 = NAME##_NULL, NAME##_enum i9 = NAME##_NULL, NAME##_enum i10 = NAME##_NULL, NAME##_enum i11 = NAME##_NULL, NAME##_enum i12 = NAME##_NULL, NAME##_enum i13 = NAME##_NULL, NAME##_enum i14 = NAME##_NULL, NAME##_enum i15 = NAME##_NULL, NAME##_enum i16 = NAME##_NULL, NAME##_enum i17 = NAME##_NULL, NAME##_enum i18 = NAME##_NULL, NAME##_enum i19 = NAME##_NULL, NAME##_enum i20 = NAME##_NULL, NAME##_enum i21 = NAME##_NULL) const {\ - return equal_list(d, " = ", quote, i1, i2, i3, i4, i5, i6, i7, i8, i9, i10, i11, i12, i13, i14, i15, i16, i17, i18, i19, i20, i21);\ - }\ - NAME##_cus_equal_list equal_list(cchar *d, \ - std::vector *i) const {\ - return equal_list(d, " = ", quote, i);\ - }\ - NAME##_cus_equal_list equal_list(cchar *d, \ - sql_cmp_type sc) const {\ - return equal_list(d, " = ", quote, sc);\ - }\ - NAME##_cus_equal_list equal_list(cchar *d, cchar *c,\ - bool i1, bool i2 = false, bool i3 = false, bool i4 = false, bool i5 = false, bool i6 = false, bool i7 = false, bool i8 = false, bool i9 = false, bool i10 = false, bool i11 = false, bool i12 = false, bool i13 = false, bool i14 = false, bool i15 = false, bool i16 = false, bool i17 = false, bool i18 = false, bool i19 = false, bool i20 = false, bool i21 = false) const {\ - return equal_list(d, c, quote, i1, i2, i3, i4, i5, i6, i7, i8, i9, i10, i11, i12, i13, i14, i15, i16, i17, i18, i19, i20, i21);\ - }\ - NAME##_cus_equal_list equal_list(cchar *d, cchar *c,\ - NAME##_enum i1, NAME##_enum i2 = NAME##_NULL, NAME##_enum i3 = NAME##_NULL, NAME##_enum i4 = NAME##_NULL, NAME##_enum i5 = NAME##_NULL, NAME##_enum i6 = NAME##_NULL, NAME##_enum i7 = NAME##_NULL, NAME##_enum i8 = NAME##_NULL, NAME##_enum i9 = NAME##_NULL, NAME##_enum i10 = NAME##_NULL, NAME##_enum i11 = NAME##_NULL, NAME##_enum i12 = NAME##_NULL, NAME##_enum i13 = NAME##_NULL, NAME##_enum i14 = NAME##_NULL, NAME##_enum i15 = NAME##_NULL, NAME##_enum i16 = NAME##_NULL, NAME##_enum i17 = NAME##_NULL, NAME##_enum i18 = NAME##_NULL, NAME##_enum i19 = NAME##_NULL, NAME##_enum i20 = NAME##_NULL, NAME##_enum i21 = NAME##_NULL) const {\ - return equal_list(d, c, quote, i1, i2, i3, i4, i5, i6, i7, i8, i9, i10, i11, i12, i13, i14, i15, i16, i17, i18, i19, i20, i21);\ - }\ - NAME##_cus_equal_list equal_list(cchar *d, cchar *c,\ - std::vector *i) const {\ - return equal_list(d, c, quote, i);\ - }\ - NAME##_cus_equal_list equal_list(cchar *d, cchar *c,\ - sql_cmp_type sc) const {\ - return equal_list(d, c, quote, sc);\ - }\ - template \ - NAME##_cus_equal_list equal_list(cchar *d, cchar *c, Manip m, \ - bool i1, bool i2 = false, bool i3 = false, bool i4 = false, bool i5 = false, bool i6 = false, bool i7 = false, bool i8 = false, bool i9 = false, bool i10 = false, bool i11 = false, bool i12 = false, bool i13 = false, bool i14 = false, bool i15 = false, bool i16 = false, bool i17 = false, bool i18 = false, bool i19 = false, bool i20 = false, bool i21 = false) const; \ - template \ - NAME##_cus_equal_list equal_list(cchar *d, cchar *c, Manip m, \ - NAME##_enum i1, NAME##_enum i2 = NAME##_NULL, NAME##_enum i3 = NAME##_NULL, NAME##_enum i4 = NAME##_NULL, NAME##_enum i5 = NAME##_NULL, NAME##_enum i6 = NAME##_NULL, NAME##_enum i7 = NAME##_NULL, NAME##_enum i8 = NAME##_NULL, NAME##_enum i9 = NAME##_NULL, NAME##_enum i10 = NAME##_NULL, NAME##_enum i11 = NAME##_NULL, NAME##_enum i12 = NAME##_NULL, NAME##_enum i13 = NAME##_NULL, NAME##_enum i14 = NAME##_NULL, NAME##_enum i15 = NAME##_NULL, NAME##_enum i16 = NAME##_NULL, NAME##_enum i17 = NAME##_NULL, NAME##_enum i18 = NAME##_NULL, NAME##_enum i19 = NAME##_NULL, NAME##_enum i20 = NAME##_NULL, NAME##_enum i21 = NAME##_NULL) const; \ - template \ - NAME##_cus_equal_list equal_list(cchar *d, cchar *c, Manip m, \ - std::vector *i) const;\ - template \ - NAME##_cus_equal_list equal_list(cchar *d, cchar *c, Manip m, \ - sql_cmp_type sc) const;\ - }; \ - const char *NAME::names[] = { \ - N1 ,\ - N2 ,\ - N3 ,\ - N4 ,\ - N5 ,\ - N6 ,\ - N7 ,\ - N8 ,\ - N9 ,\ - N10 ,\ - N11 ,\ - N12 ,\ - N13 ,\ - N14 ,\ - N15 ,\ - N16 ,\ - N17 ,\ - N18 ,\ - N19 ,\ - N20 ,\ - N21 \ - }; \ - const char *NAME::_table = #NAME ; \ - template \ - NAME##_cus_value_list::NAME##_cus_value_list\ - (const NAME *o, cchar *d, Manip m, bool i1, bool i2, bool i3, bool i4, bool i5, bool i6, bool i7, bool i8, bool i9, bool i10, bool i11, bool i12, bool i13, bool i14, bool i15, bool i16, bool i17, bool i18, bool i19, bool i20, bool i21) \ - { \ - delem = d;\ - manip = m;\ - del_vector = true;\ - obj = o; \ - include = new std::vector(21, false);\ - if (i1) (*include)[0]=true;\ - if (i2) (*include)[1]=true;\ - if (i3) (*include)[2]=true;\ - if (i4) (*include)[3]=true;\ - if (i5) (*include)[4]=true;\ - if (i6) (*include)[5]=true;\ - if (i7) (*include)[6]=true;\ - if (i8) (*include)[7]=true;\ - if (i9) (*include)[8]=true;\ - if (i10) (*include)[9]=true;\ - if (i11) (*include)[10]=true;\ - if (i12) (*include)[11]=true;\ - if (i13) (*include)[12]=true;\ - if (i14) (*include)[13]=true;\ - if (i15) (*include)[14]=true;\ - if (i16) (*include)[15]=true;\ - if (i17) (*include)[16]=true;\ - if (i18) (*include)[17]=true;\ - if (i19) (*include)[18]=true;\ - if (i20) (*include)[19]=true;\ - if (i21) (*include)[20]=true;\ - } \ - template \ - NAME##_cus_value_list::NAME##_cus_value_list\ - (const NAME *o, cchar *d, Manip m, NAME##_enum i1, NAME##_enum i2, NAME##_enum i3, NAME##_enum i4, NAME##_enum i5, NAME##_enum i6, NAME##_enum i7, NAME##_enum i8, NAME##_enum i9, NAME##_enum i10, NAME##_enum i11, NAME##_enum i12, NAME##_enum i13, NAME##_enum i14, NAME##_enum i15, NAME##_enum i16, NAME##_enum i17, NAME##_enum i18, NAME##_enum i19, NAME##_enum i20, NAME##_enum i21) { \ - delem = d;\ - manip = m;\ - del_vector = true; \ - obj = o; \ - include = new std::vector(21, false); \ - if (i1 == NAME##_NULL) return;\ - (*include)[i1]=true;\ - if (i2 == NAME##_NULL) return;\ - (*include)[i2]=true;\ - if (i3 == NAME##_NULL) return;\ - (*include)[i3]=true;\ - if (i4 == NAME##_NULL) return;\ - (*include)[i4]=true;\ - if (i5 == NAME##_NULL) return;\ - (*include)[i5]=true;\ - if (i6 == NAME##_NULL) return;\ - (*include)[i6]=true;\ - if (i7 == NAME##_NULL) return;\ - (*include)[i7]=true;\ - if (i8 == NAME##_NULL) return;\ - (*include)[i8]=true;\ - if (i9 == NAME##_NULL) return;\ - (*include)[i9]=true;\ - if (i10 == NAME##_NULL) return;\ - (*include)[i10]=true;\ - if (i11 == NAME##_NULL) return;\ - (*include)[i11]=true;\ - if (i12 == NAME##_NULL) return;\ - (*include)[i12]=true;\ - if (i13 == NAME##_NULL) return;\ - (*include)[i13]=true;\ - if (i14 == NAME##_NULL) return;\ - (*include)[i14]=true;\ - if (i15 == NAME##_NULL) return;\ - (*include)[i15]=true;\ - if (i16 == NAME##_NULL) return;\ - (*include)[i16]=true;\ - if (i17 == NAME##_NULL) return;\ - (*include)[i17]=true;\ - if (i18 == NAME##_NULL) return;\ - (*include)[i18]=true;\ - if (i19 == NAME##_NULL) return;\ - (*include)[i19]=true;\ - if (i20 == NAME##_NULL) return;\ - (*include)[i20]=true;\ - if (i21 == NAME##_NULL) return;\ - (*include)[i21]=true;\ - }\ - template \ - NAME##_cus_field_list::NAME##_cus_field_list\ - (const NAME *o, cchar *d, Manip m, bool i1, bool i2, bool i3, bool i4, bool i5, bool i6, bool i7, bool i8, bool i9, bool i10, bool i11, bool i12, bool i13, bool i14, bool i15, bool i16, bool i17, bool i18, bool i19, bool i20, bool i21) {\ - delem = d;\ - manip = m;\ - del_vector = true; \ - obj = o; \ - include = new std::vector(21, false); \ - if (i1) (*include)[0]=true;\ - if (i2) (*include)[1]=true;\ - if (i3) (*include)[2]=true;\ - if (i4) (*include)[3]=true;\ - if (i5) (*include)[4]=true;\ - if (i6) (*include)[5]=true;\ - if (i7) (*include)[6]=true;\ - if (i8) (*include)[7]=true;\ - if (i9) (*include)[8]=true;\ - if (i10) (*include)[9]=true;\ - if (i11) (*include)[10]=true;\ - if (i12) (*include)[11]=true;\ - if (i13) (*include)[12]=true;\ - if (i14) (*include)[13]=true;\ - if (i15) (*include)[14]=true;\ - if (i16) (*include)[15]=true;\ - if (i17) (*include)[16]=true;\ - if (i18) (*include)[17]=true;\ - if (i19) (*include)[18]=true;\ - if (i20) (*include)[19]=true;\ - if (i21) (*include)[20]=true;\ - } \ - template \ - NAME##_cus_field_list::NAME##_cus_field_list\ - (const NAME *o, cchar *d, Manip m, NAME##_enum i1, NAME##_enum i2, NAME##_enum i3, NAME##_enum i4, NAME##_enum i5, NAME##_enum i6, NAME##_enum i7, NAME##_enum i8, NAME##_enum i9, NAME##_enum i10, NAME##_enum i11, NAME##_enum i12, NAME##_enum i13, NAME##_enum i14, NAME##_enum i15, NAME##_enum i16, NAME##_enum i17, NAME##_enum i18, NAME##_enum i19, NAME##_enum i20, NAME##_enum i21) { \ - delem = d;\ - manip = m;\ - del_vector = true; \ - obj = o; \ - include = new std::vector(21, false); \ - if (i1 == NAME##_NULL) return;\ - (*include)[i1]=true;\ - if (i2 == NAME##_NULL) return;\ - (*include)[i2]=true;\ - if (i3 == NAME##_NULL) return;\ - (*include)[i3]=true;\ - if (i4 == NAME##_NULL) return;\ - (*include)[i4]=true;\ - if (i5 == NAME##_NULL) return;\ - (*include)[i5]=true;\ - if (i6 == NAME##_NULL) return;\ - (*include)[i6]=true;\ - if (i7 == NAME##_NULL) return;\ - (*include)[i7]=true;\ - if (i8 == NAME##_NULL) return;\ - (*include)[i8]=true;\ - if (i9 == NAME##_NULL) return;\ - (*include)[i9]=true;\ - if (i10 == NAME##_NULL) return;\ - (*include)[i10]=true;\ - if (i11 == NAME##_NULL) return;\ - (*include)[i11]=true;\ - if (i12 == NAME##_NULL) return;\ - (*include)[i12]=true;\ - if (i13 == NAME##_NULL) return;\ - (*include)[i13]=true;\ - if (i14 == NAME##_NULL) return;\ - (*include)[i14]=true;\ - if (i15 == NAME##_NULL) return;\ - (*include)[i15]=true;\ - if (i16 == NAME##_NULL) return;\ - (*include)[i16]=true;\ - if (i17 == NAME##_NULL) return;\ - (*include)[i17]=true;\ - if (i18 == NAME##_NULL) return;\ - (*include)[i18]=true;\ - if (i19 == NAME##_NULL) return;\ - (*include)[i19]=true;\ - if (i20 == NAME##_NULL) return;\ - (*include)[i20]=true;\ - if (i21 == NAME##_NULL) return;\ - (*include)[i21]=true;\ - }\ - template \ - NAME##_cus_equal_list::NAME##_cus_equal_list\ - (const NAME *o, cchar *d, cchar *c, Manip m, bool i1, bool i2, bool i3, bool i4, bool i5, bool i6, bool i7, bool i8, bool i9, bool i10, bool i11, bool i12, bool i13, bool i14, bool i15, bool i16, bool i17, bool i18, bool i19, bool i20, bool i21) { \ - delem = d;\ - comp = c;\ - manip = m;\ - del_vector = true; \ - obj = o; \ - include = new std::vector(21, false); \ - if (i1) (*include)[0]=true;\ - if (i2) (*include)[1]=true;\ - if (i3) (*include)[2]=true;\ - if (i4) (*include)[3]=true;\ - if (i5) (*include)[4]=true;\ - if (i6) (*include)[5]=true;\ - if (i7) (*include)[6]=true;\ - if (i8) (*include)[7]=true;\ - if (i9) (*include)[8]=true;\ - if (i10) (*include)[9]=true;\ - if (i11) (*include)[10]=true;\ - if (i12) (*include)[11]=true;\ - if (i13) (*include)[12]=true;\ - if (i14) (*include)[13]=true;\ - if (i15) (*include)[14]=true;\ - if (i16) (*include)[15]=true;\ - if (i17) (*include)[16]=true;\ - if (i18) (*include)[17]=true;\ - if (i19) (*include)[18]=true;\ - if (i20) (*include)[19]=true;\ - if (i21) (*include)[20]=true;\ - } \ - template \ - NAME##_cus_equal_list::NAME##_cus_equal_list\ - (const NAME *o, cchar *d, cchar *c, Manip m, NAME##_enum i1, NAME##_enum i2, NAME##_enum i3, NAME##_enum i4, NAME##_enum i5, NAME##_enum i6, NAME##_enum i7, NAME##_enum i8, NAME##_enum i9, NAME##_enum i10, NAME##_enum i11, NAME##_enum i12, NAME##_enum i13, NAME##_enum i14, NAME##_enum i15, NAME##_enum i16, NAME##_enum i17, NAME##_enum i18, NAME##_enum i19, NAME##_enum i20, NAME##_enum i21) { \ - delem = d;\ - comp = c;\ - manip = m;\ - del_vector = true; \ - obj = o; \ - include = new std::vector(21, false); \ - if (i1 == NAME##_NULL) return;\ - (*include)[i1]=true;\ - if (i2 == NAME##_NULL) return;\ - (*include)[i2]=true;\ - if (i3 == NAME##_NULL) return;\ - (*include)[i3]=true;\ - if (i4 == NAME##_NULL) return;\ - (*include)[i4]=true;\ - if (i5 == NAME##_NULL) return;\ - (*include)[i5]=true;\ - if (i6 == NAME##_NULL) return;\ - (*include)[i6]=true;\ - if (i7 == NAME##_NULL) return;\ - (*include)[i7]=true;\ - if (i8 == NAME##_NULL) return;\ - (*include)[i8]=true;\ - if (i9 == NAME##_NULL) return;\ - (*include)[i9]=true;\ - if (i10 == NAME##_NULL) return;\ - (*include)[i10]=true;\ - if (i11 == NAME##_NULL) return;\ - (*include)[i11]=true;\ - if (i12 == NAME##_NULL) return;\ - (*include)[i12]=true;\ - if (i13 == NAME##_NULL) return;\ - (*include)[i13]=true;\ - if (i14 == NAME##_NULL) return;\ - (*include)[i14]=true;\ - if (i15 == NAME##_NULL) return;\ - (*include)[i15]=true;\ - if (i16 == NAME##_NULL) return;\ - (*include)[i16]=true;\ - if (i17 == NAME##_NULL) return;\ - (*include)[i17]=true;\ - if (i18 == NAME##_NULL) return;\ - (*include)[i18]=true;\ - if (i19 == NAME##_NULL) return;\ - (*include)[i19]=true;\ - if (i20 == NAME##_NULL) return;\ - (*include)[i20]=true;\ - if (i21 == NAME##_NULL) return;\ - (*include)[i21]=true;\ - }\ - template \ - std::ostream& operator << (std::ostream& s, const NAME##_value_list& obj) { \ - s << obj.manip << obj.obj->I1 << obj.delem;\ - s << obj.manip << obj.obj->I2 << obj.delem;\ - s << obj.manip << obj.obj->I3 << obj.delem;\ - s << obj.manip << obj.obj->I4 << obj.delem;\ - s << obj.manip << obj.obj->I5 << obj.delem;\ - s << obj.manip << obj.obj->I6 << obj.delem;\ - s << obj.manip << obj.obj->I7 << obj.delem;\ - s << obj.manip << obj.obj->I8 << obj.delem;\ - s << obj.manip << obj.obj->I9 << obj.delem;\ - s << obj.manip << obj.obj->I10 << obj.delem;\ - s << obj.manip << obj.obj->I11 << obj.delem;\ - s << obj.manip << obj.obj->I12 << obj.delem;\ - s << obj.manip << obj.obj->I13 << obj.delem;\ - s << obj.manip << obj.obj->I14 << obj.delem;\ - s << obj.manip << obj.obj->I15 << obj.delem;\ - s << obj.manip << obj.obj->I16 << obj.delem;\ - s << obj.manip << obj.obj->I17 << obj.delem;\ - s << obj.manip << obj.obj->I18 << obj.delem;\ - s << obj.manip << obj.obj->I19 << obj.delem;\ - s << obj.manip << obj.obj->I20 << obj.delem;\ - s << obj.manip << obj.obj->I21; \ - return s; \ - } \ - template \ - std::ostream& operator << (std::ostream& s, const NAME##_field_list& obj) { \ - s << obj.manip << obj.obj->names[0] << obj.delem;\ - s << obj.manip << obj.obj->names[1] << obj.delem;\ - s << obj.manip << obj.obj->names[2] << obj.delem;\ - s << obj.manip << obj.obj->names[3] << obj.delem;\ - s << obj.manip << obj.obj->names[4] << obj.delem;\ - s << obj.manip << obj.obj->names[5] << obj.delem;\ - s << obj.manip << obj.obj->names[6] << obj.delem;\ - s << obj.manip << obj.obj->names[7] << obj.delem;\ - s << obj.manip << obj.obj->names[8] << obj.delem;\ - s << obj.manip << obj.obj->names[9] << obj.delem;\ - s << obj.manip << obj.obj->names[10] << obj.delem;\ - s << obj.manip << obj.obj->names[11] << obj.delem;\ - s << obj.manip << obj.obj->names[12] << obj.delem;\ - s << obj.manip << obj.obj->names[13] << obj.delem;\ - s << obj.manip << obj.obj->names[14] << obj.delem;\ - s << obj.manip << obj.obj->names[15] << obj.delem;\ - s << obj.manip << obj.obj->names[16] << obj.delem;\ - s << obj.manip << obj.obj->names[17] << obj.delem;\ - s << obj.manip << obj.obj->names[18] << obj.delem;\ - s << obj.manip << obj.obj->names[19] << obj.delem;\ - s << obj.manip << obj.obj->names[20]; \ - return s; \ - } \ - template \ - std::ostream& operator << (std::ostream& s, const NAME##_equal_list& obj) { \ - s << obj.obj->names[0] << obj.comp << obj.manip << obj.obj->I1 << obj.delem;\ - s << obj.obj->names[1] << obj.comp << obj.manip << obj.obj->I2 << obj.delem;\ - s << obj.obj->names[2] << obj.comp << obj.manip << obj.obj->I3 << obj.delem;\ - s << obj.obj->names[3] << obj.comp << obj.manip << obj.obj->I4 << obj.delem;\ - s << obj.obj->names[4] << obj.comp << obj.manip << obj.obj->I5 << obj.delem;\ - s << obj.obj->names[5] << obj.comp << obj.manip << obj.obj->I6 << obj.delem;\ - s << obj.obj->names[6] << obj.comp << obj.manip << obj.obj->I7 << obj.delem;\ - s << obj.obj->names[7] << obj.comp << obj.manip << obj.obj->I8 << obj.delem;\ - s << obj.obj->names[8] << obj.comp << obj.manip << obj.obj->I9 << obj.delem;\ - s << obj.obj->names[9] << obj.comp << obj.manip << obj.obj->I10 << obj.delem;\ - s << obj.obj->names[10] << obj.comp << obj.manip << obj.obj->I11 << obj.delem;\ - s << obj.obj->names[11] << obj.comp << obj.manip << obj.obj->I12 << obj.delem;\ - s << obj.obj->names[12] << obj.comp << obj.manip << obj.obj->I13 << obj.delem;\ - s << obj.obj->names[13] << obj.comp << obj.manip << obj.obj->I14 << obj.delem;\ - s << obj.obj->names[14] << obj.comp << obj.manip << obj.obj->I15 << obj.delem;\ - s << obj.obj->names[15] << obj.comp << obj.manip << obj.obj->I16 << obj.delem;\ - s << obj.obj->names[16] << obj.comp << obj.manip << obj.obj->I17 << obj.delem;\ - s << obj.obj->names[17] << obj.comp << obj.manip << obj.obj->I18 << obj.delem;\ - s << obj.obj->names[18] << obj.comp << obj.manip << obj.obj->I19 << obj.delem;\ - s << obj.obj->names[19] << obj.comp << obj.manip << obj.obj->I20 << obj.delem;\ - s << obj.obj->names[20] << obj.comp << obj.manip << obj.obj->I21; \ - return s; \ - } \ - template \ - std::ostream& operator << (std::ostream& s, const NAME##_cus_value_list& obj) { \ - bool before = false; \ - if ((*obj.include)[0]) { \ - s << obj.manip << obj.obj->I1;\ - before = true; \ - } \ - if ((*obj.include)[1]) { \ - if (before) s << obj.delem;\ - s << obj.manip << obj.obj->I2;\ - before = true; \ - } \ - if ((*obj.include)[2]) { \ - if (before) s << obj.delem;\ - s << obj.manip << obj.obj->I3;\ - before = true; \ - } \ - if ((*obj.include)[3]) { \ - if (before) s << obj.delem;\ - s << obj.manip << obj.obj->I4;\ - before = true; \ - } \ - if ((*obj.include)[4]) { \ - if (before) s << obj.delem;\ - s << obj.manip << obj.obj->I5;\ - before = true; \ - } \ - if ((*obj.include)[5]) { \ - if (before) s << obj.delem;\ - s << obj.manip << obj.obj->I6;\ - before = true; \ - } \ - if ((*obj.include)[6]) { \ - if (before) s << obj.delem;\ - s << obj.manip << obj.obj->I7;\ - before = true; \ - } \ - if ((*obj.include)[7]) { \ - if (before) s << obj.delem;\ - s << obj.manip << obj.obj->I8;\ - before = true; \ - } \ - if ((*obj.include)[8]) { \ - if (before) s << obj.delem;\ - s << obj.manip << obj.obj->I9;\ - before = true; \ - } \ - if ((*obj.include)[9]) { \ - if (before) s << obj.delem;\ - s << obj.manip << obj.obj->I10;\ - before = true; \ - } \ - if ((*obj.include)[10]) { \ - if (before) s << obj.delem;\ - s << obj.manip << obj.obj->I11;\ - before = true; \ - } \ - if ((*obj.include)[11]) { \ - if (before) s << obj.delem;\ - s << obj.manip << obj.obj->I12;\ - before = true; \ - } \ - if ((*obj.include)[12]) { \ - if (before) s << obj.delem;\ - s << obj.manip << obj.obj->I13;\ - before = true; \ - } \ - if ((*obj.include)[13]) { \ - if (before) s << obj.delem;\ - s << obj.manip << obj.obj->I14;\ - before = true; \ - } \ - if ((*obj.include)[14]) { \ - if (before) s << obj.delem;\ - s << obj.manip << obj.obj->I15;\ - before = true; \ - } \ - if ((*obj.include)[15]) { \ - if (before) s << obj.delem;\ - s << obj.manip << obj.obj->I16;\ - before = true; \ - } \ - if ((*obj.include)[16]) { \ - if (before) s << obj.delem;\ - s << obj.manip << obj.obj->I17;\ - before = true; \ - } \ - if ((*obj.include)[17]) { \ - if (before) s << obj.delem;\ - s << obj.manip << obj.obj->I18;\ - before = true; \ - } \ - if ((*obj.include)[18]) { \ - if (before) s << obj.delem;\ - s << obj.manip << obj.obj->I19;\ - before = true; \ - } \ - if ((*obj.include)[19]) { \ - if (before) s << obj.delem;\ - s << obj.manip << obj.obj->I20;\ - before = true; \ - } \ - if ((*obj.include)[20]) { \ - if (before) s << obj.delem;\ - s << obj.manip << obj.obj->I21;\ - } \ - return s; \ - } \ - template \ - std::ostream& operator << (std::ostream& s, const NAME##_cus_field_list& obj) { \ - bool before = false; \ - if ((*obj.include)[0]) { \ - s << obj.manip << obj.obj->names[0];\ - before = true; \ - } \ - if ((*obj.include)[1]) { \ - if (before) s << obj.delem;\ - s << obj.manip << obj.obj->names[1];\ - before = true; \ - } \ - if ((*obj.include)[2]) { \ - if (before) s << obj.delem;\ - s << obj.manip << obj.obj->names[2];\ - before = true; \ - } \ - if ((*obj.include)[3]) { \ - if (before) s << obj.delem;\ - s << obj.manip << obj.obj->names[3];\ - before = true; \ - } \ - if ((*obj.include)[4]) { \ - if (before) s << obj.delem;\ - s << obj.manip << obj.obj->names[4];\ - before = true; \ - } \ - if ((*obj.include)[5]) { \ - if (before) s << obj.delem;\ - s << obj.manip << obj.obj->names[5];\ - before = true; \ - } \ - if ((*obj.include)[6]) { \ - if (before) s << obj.delem;\ - s << obj.manip << obj.obj->names[6];\ - before = true; \ - } \ - if ((*obj.include)[7]) { \ - if (before) s << obj.delem;\ - s << obj.manip << obj.obj->names[7];\ - before = true; \ - } \ - if ((*obj.include)[8]) { \ - if (before) s << obj.delem;\ - s << obj.manip << obj.obj->names[8];\ - before = true; \ - } \ - if ((*obj.include)[9]) { \ - if (before) s << obj.delem;\ - s << obj.manip << obj.obj->names[9];\ - before = true; \ - } \ - if ((*obj.include)[10]) { \ - if (before) s << obj.delem;\ - s << obj.manip << obj.obj->names[10];\ - before = true; \ - } \ - if ((*obj.include)[11]) { \ - if (before) s << obj.delem;\ - s << obj.manip << obj.obj->names[11];\ - before = true; \ - } \ - if ((*obj.include)[12]) { \ - if (before) s << obj.delem;\ - s << obj.manip << obj.obj->names[12];\ - before = true; \ - } \ - if ((*obj.include)[13]) { \ - if (before) s << obj.delem;\ - s << obj.manip << obj.obj->names[13];\ - before = true; \ - } \ - if ((*obj.include)[14]) { \ - if (before) s << obj.delem;\ - s << obj.manip << obj.obj->names[14];\ - before = true; \ - } \ - if ((*obj.include)[15]) { \ - if (before) s << obj.delem;\ - s << obj.manip << obj.obj->names[15];\ - before = true; \ - } \ - if ((*obj.include)[16]) { \ - if (before) s << obj.delem;\ - s << obj.manip << obj.obj->names[16];\ - before = true; \ - } \ - if ((*obj.include)[17]) { \ - if (before) s << obj.delem;\ - s << obj.manip << obj.obj->names[17];\ - before = true; \ - } \ - if ((*obj.include)[18]) { \ - if (before) s << obj.delem;\ - s << obj.manip << obj.obj->names[18];\ - before = true; \ - } \ - if ((*obj.include)[19]) { \ - if (before) s << obj.delem;\ - s << obj.manip << obj.obj->names[19];\ - before = true; \ - } \ - if ((*obj.include)[20]) { \ - if (before) s << obj.delem;\ - s << obj.manip << obj.obj->names[20];\ - } \ - return s; \ - } \ - template \ - std::ostream& operator << (std::ostream& s, const NAME##_cus_equal_list& obj) { \ - bool before = false; \ - if ((*obj.include)[0]) { \ - s << obj.obj->names[0] << obj.comp << obj.manip << obj.obj->I1;\ - before = true; \ - } \ - if ((*obj.include)[1]) { \ - if (before) s << obj.delem;\ - s << obj.obj->names[1] << obj.comp << obj.manip << obj.obj->I2;\ - before = true; \ - } \ - if ((*obj.include)[2]) { \ - if (before) s << obj.delem;\ - s << obj.obj->names[2] << obj.comp << obj.manip << obj.obj->I3;\ - before = true; \ - } \ - if ((*obj.include)[3]) { \ - if (before) s << obj.delem;\ - s << obj.obj->names[3] << obj.comp << obj.manip << obj.obj->I4;\ - before = true; \ - } \ - if ((*obj.include)[4]) { \ - if (before) s << obj.delem;\ - s << obj.obj->names[4] << obj.comp << obj.manip << obj.obj->I5;\ - before = true; \ - } \ - if ((*obj.include)[5]) { \ - if (before) s << obj.delem;\ - s << obj.obj->names[5] << obj.comp << obj.manip << obj.obj->I6;\ - before = true; \ - } \ - if ((*obj.include)[6]) { \ - if (before) s << obj.delem;\ - s << obj.obj->names[6] << obj.comp << obj.manip << obj.obj->I7;\ - before = true; \ - } \ - if ((*obj.include)[7]) { \ - if (before) s << obj.delem;\ - s << obj.obj->names[7] << obj.comp << obj.manip << obj.obj->I8;\ - before = true; \ - } \ - if ((*obj.include)[8]) { \ - if (before) s << obj.delem;\ - s << obj.obj->names[8] << obj.comp << obj.manip << obj.obj->I9;\ - before = true; \ - } \ - if ((*obj.include)[9]) { \ - if (before) s << obj.delem;\ - s << obj.obj->names[9] << obj.comp << obj.manip << obj.obj->I10;\ - before = true; \ - } \ - if ((*obj.include)[10]) { \ - if (before) s << obj.delem;\ - s << obj.obj->names[10] << obj.comp << obj.manip << obj.obj->I11;\ - before = true; \ - } \ - if ((*obj.include)[11]) { \ - if (before) s << obj.delem;\ - s << obj.obj->names[11] << obj.comp << obj.manip << obj.obj->I12;\ - before = true; \ - } \ - if ((*obj.include)[12]) { \ - if (before) s << obj.delem;\ - s << obj.obj->names[12] << obj.comp << obj.manip << obj.obj->I13;\ - before = true; \ - } \ - if ((*obj.include)[13]) { \ - if (before) s << obj.delem;\ - s << obj.obj->names[13] << obj.comp << obj.manip << obj.obj->I14;\ - before = true; \ - } \ - if ((*obj.include)[14]) { \ - if (before) s << obj.delem;\ - s << obj.obj->names[14] << obj.comp << obj.manip << obj.obj->I15;\ - before = true; \ - } \ - if ((*obj.include)[15]) { \ - if (before) s << obj.delem;\ - s << obj.obj->names[15] << obj.comp << obj.manip << obj.obj->I16;\ - before = true; \ - } \ - if ((*obj.include)[16]) { \ - if (before) s << obj.delem;\ - s << obj.obj->names[16] << obj.comp << obj.manip << obj.obj->I17;\ - before = true; \ - } \ - if ((*obj.include)[17]) { \ - if (before) s << obj.delem;\ - s << obj.obj->names[17] << obj.comp << obj.manip << obj.obj->I18;\ - before = true; \ - } \ - if ((*obj.include)[18]) { \ - if (before) s << obj.delem;\ - s << obj.obj->names[18] << obj.comp << obj.manip << obj.obj->I19;\ - before = true; \ - } \ - if ((*obj.include)[19]) { \ - if (before) s << obj.delem;\ - s << obj.obj->names[19] << obj.comp << obj.manip << obj.obj->I20;\ - before = true; \ - } \ - if ((*obj.include)[20]) { \ - if (before) s << obj.delem;\ - s << obj.obj->names[20] << obj.comp << obj.manip << obj.obj->I21;\ - } \ - return s; \ - } \ - template \ - inline NAME##_value_list NAME::value_list(cchar *d, Manip m) const { \ - return NAME##_value_list (this, d, m); \ - } \ - template \ - inline NAME##_field_list NAME::field_list(cchar *d, Manip m) const { \ - return NAME##_field_list (this, d, m); \ - } \ - template \ - inline NAME##_equal_list NAME::equal_list(cchar *d, cchar *c, Manip m) const { \ - return NAME##_equal_list (this, d, c, m); \ - } \ - template \ - inline NAME##_cus_value_list NAME::value_list(cchar *d, Manip m,\ - bool i1, bool i2, bool i3, bool i4, bool i5, bool i6, bool i7, bool i8, bool i9, bool i10, bool i11, bool i12, bool i13, bool i14, bool i15, bool i16, bool i17, bool i18, bool i19, bool i20, bool i21) const {\ - return NAME##_cus_value_list (this, d, m, i1, i2, i3, i4, i5, i6, i7, i8, i9, i10, i11, i12, i13, i14, i15, i16, i17, i18, i19, i20, i21); \ - } \ - template \ - inline NAME##_cus_field_list NAME::field_list(cchar *d, Manip m,\ - bool i1, bool i2, bool i3, bool i4, bool i5, bool i6, bool i7, bool i8, bool i9, bool i10, bool i11, bool i12, bool i13, bool i14, bool i15, bool i16, bool i17, bool i18, bool i19, bool i20, bool i21) const { \ - return NAME##_cus_field_list (this, d, m, i1, i2, i3, i4, i5, i6, i7, i8, i9, i10, i11, i12, i13, i14, i15, i16, i17, i18, i19, i20, i21); \ - } \ - template \ - inline NAME##_cus_equal_list NAME::equal_list(cchar *d, cchar *c, Manip m,\ - bool i1, bool i2, bool i3, bool i4, bool i5, bool i6, bool i7, bool i8, bool i9, bool i10, bool i11, bool i12, bool i13, bool i14, bool i15, bool i16, bool i17, bool i18, bool i19, bool i20, bool i21) const { \ - return NAME##_cus_equal_list (this, d, c, m, i1, i2, i3, i4, i5, i6, i7, i8, i9, i10, i11, i12, i13, i14, i15, i16, i17, i18, i19, i20, i21); \ - } \ - template \ - inline NAME##_cus_value_list NAME::value_list(cchar *d, Manip m,\ - NAME##_enum i1, NAME##_enum i2, NAME##_enum i3, NAME##_enum i4, NAME##_enum i5, NAME##_enum i6, NAME##_enum i7, NAME##_enum i8, NAME##_enum i9, NAME##_enum i10, NAME##_enum i11, NAME##_enum i12, NAME##_enum i13, NAME##_enum i14, NAME##_enum i15, NAME##_enum i16, NAME##_enum i17, NAME##_enum i18, NAME##_enum i19, NAME##_enum i20, NAME##_enum i21) const { \ - return NAME##_cus_value_list (this, d, m, i1, i2, i3, i4, i5, i6, i7, i8, i9, i10, i11, i12, i13, i14, i15, i16, i17, i18, i19, i20, i21); \ - } \ - template \ - inline NAME##_cus_field_list NAME::field_list(cchar *d, Manip m,\ - NAME##_enum i1, NAME##_enum i2, NAME##_enum i3, NAME##_enum i4, NAME##_enum i5, NAME##_enum i6, NAME##_enum i7, NAME##_enum i8, NAME##_enum i9, NAME##_enum i10, NAME##_enum i11, NAME##_enum i12, NAME##_enum i13, NAME##_enum i14, NAME##_enum i15, NAME##_enum i16, NAME##_enum i17, NAME##_enum i18, NAME##_enum i19, NAME##_enum i20, NAME##_enum i21) const {\ - return NAME##_cus_field_list (this, d, m, i1, i2, i3, i4, i5, i6, i7, i8, i9, i10, i11, i12, i13, i14, i15, i16, i17, i18, i19, i20, i21); \ - } \ - template \ - inline NAME##_cus_equal_list NAME::equal_list(cchar *d, cchar *c, Manip m, \ - NAME##_enum i1, NAME##_enum i2, NAME##_enum i3, NAME##_enum i4, NAME##_enum i5, NAME##_enum i6, NAME##_enum i7, NAME##_enum i8, NAME##_enum i9, NAME##_enum i10, NAME##_enum i11, NAME##_enum i12, NAME##_enum i13, NAME##_enum i14, NAME##_enum i15, NAME##_enum i16, NAME##_enum i17, NAME##_enum i18, NAME##_enum i19, NAME##_enum i20, NAME##_enum i21) const { \ - return NAME##_cus_equal_list (this, d, c, m, i1, i2, i3, i4, i5, i6, i7, i8, i9, i10, i11, i12, i13, i14, i15, i16, i17, i18, i19, i20, i21); \ - } \ - template \ - inline NAME##_cus_value_list NAME::value_list(cchar *d, Manip m,\ - std::vector *i) const {\ - return NAME##_cus_value_list (this, d, m, i);\ - }\ - template \ - inline NAME##_cus_field_list NAME::field_list(cchar *d, Manip m,\ - std::vector *i) const {\ - return NAME##_cus_field_list (this, d, m, i);\ - }\ - template \ - inline NAME##_cus_equal_list NAME::equal_list(cchar *d, cchar *c, Manip m,\ - std::vector *i) const {\ - return NAME##_cus_equal_list (this, d, c, m, i);\ - }\ - template \ - inline NAME##_cus_value_list \ - NAME::value_list(cchar *d, Manip m, sql_cmp_type /*sc*/) const {\ - sql_compare_type_def_##CMP (NAME, value, NUM);\ - }\ - template \ - inline NAME##_cus_field_list \ - NAME::field_list(cchar *d, Manip m, sql_cmp_type /*sc*/) const {\ - sql_compare_type_def_##CMP (NAME, field, NUM);\ - }\ - template \ - inline NAME##_cus_equal_list \ - NAME::equal_list(cchar *d, cchar *c, Manip m, sql_cmp_type /*sc*/) const {\ - sql_compare_type_defe_##CMP (NAME, equal, NUM);\ - }\ - template \ - void populate_##NAME (NAME *s, const Row &row) { \ - s->I1 = static_cast(row.at(O1));\ - s->I2 = static_cast(row.at(O2));\ - s->I3 = static_cast(row.at(O3));\ - s->I4 = static_cast(row.at(O4));\ - s->I5 = static_cast(row.at(O5));\ - s->I6 = static_cast(row.at(O6));\ - s->I7 = static_cast(row.at(O7));\ - s->I8 = static_cast(row.at(O8));\ - s->I9 = static_cast(row.at(O9));\ - s->I10 = static_cast(row.at(O10));\ - s->I11 = static_cast(row.at(O11));\ - s->I12 = static_cast(row.at(O12));\ - s->I13 = static_cast(row.at(O13));\ - s->I14 = static_cast(row.at(O14));\ - s->I15 = static_cast(row.at(O15));\ - s->I16 = static_cast(row.at(O16));\ - s->I17 = static_cast(row.at(O17));\ - s->I18 = static_cast(row.at(O18));\ - s->I19 = static_cast(row.at(O19));\ - s->I20 = static_cast(row.at(O20));\ - s->I21 = static_cast(row.at(O21));\ - } \ - inline NAME::NAME (const Row &row) \ - {populate_##NAME(this, row);}\ - inline void NAME::set (const Row &row)\ - {populate_##NAME(this, row);}\ - sql_COMPARE__##CMP(NAME, I1, I2, I3, I4, I5, I6, I7, I8, I9, I10, I11, I12, I13, I14, I15, I16, I17, I18, I19, I20, I21, 0, 0, 0, 0 ) - -#define sql_create_basic_21(NAME, CMP, CONTR, T1, I1, T2, I2, T3, I3, T4, I4, T5, I5, T6, I6, T7, I7, T8, I8, T9, I9, T10, I10, T11, I11, T12, I12, T13, I13, T14, I14, T15, I15, T16, I16, T17, I17, T18, I18, T19, I19, T20, I20, T21, I21) \ - sql_create_basic_c_order_21(NAME, CMP, CONTR, T1, I1, 0, T2, I2, 1, T3, I3, 2, T4, I4, 3, T5, I5, 4, T6, I6, 5, T7, I7, 6, T8, I8, 7, T9, I9, 8, T10, I10, 9, T11, I11, 10, T12, I12, 11, T13, I13, 12, T14, I14, 13, T15, I15, 14, T16, I16, 15, T17, I17, 16, T18, I18, 17, T19, I19, 18, T20, I20, 19, T21, I21, 20) - -#define sql_create_21(NAME, CMP, CONTR, T1, I1, T2, I2, T3, I3, T4, I4, T5, I5, T6, I6, T7, I7, T8, I8, T9, I9, T10, I10, T11, I11, T12, I12, T13, I13, T14, I14, T15, I15, T16, I16, T17, I17, T18, I18, T19, I19, T20, I20, T21, I21) \ - sql_create_complete_21(NAME, CMP, CONTR, T1, I1, #I1, 0, T2, I2, #I2, 1, T3, I3, #I3, 2, T4, I4, #I4, 3, T5, I5, #I5, 4, T6, I6, #I6, 5, T7, I7, #I7, 6, T8, I8, #I8, 7, T9, I9, #I9, 8, T10, I10, #I10, 9, T11, I11, #I11, 10, T12, I12, #I12, 11, T13, I13, #I13, 12, T14, I14, #I14, 13, T15, I15, #I15, 14, T16, I16, #I16, 15, T17, I17, #I17, 16, T18, I18, #I18, 17, T19, I19, #I19, 18, T20, I20, #I20, 19, T21, I21, #I21, 20) \ - -#define sql_create_c_order_21(NAME, CMP, CONTR, T1, I1, O1, T2, I2, O2, T3, I3, O3, T4, I4, O4, T5, I5, O5, T6, I6, O6, T7, I7, O7, T8, I8, O8, T9, I9, O9, T10, I10, O10, T11, I11, O11, T12, I12, O12, T13, I13, O13, T14, I14, O14, T15, I15, O15, T16, I16, O16, T17, I17, O17, T18, I18, O18, T19, I19, O19, T20, I20, O20, T21, I21, O21) \ - sql_create_complete_21(NAME, CMP, CONTR, T1, I1, #I1, O1, T2, I2, #I2, O2, T3, I3, #I3, O3, T4, I4, #I4, O4, T5, I5, #I5, O5, T6, I6, #I6, O6, T7, I7, #I7, O7, T8, I8, #I8, O8, T9, I9, #I9, O9, T10, I10, #I10, O10, T11, I11, #I11, O11, T12, I12, #I12, O12, T13, I13, #I13, O13, T14, I14, #I14, O14, T15, I15, #I15, O15, T16, I16, #I16, O16, T17, I17, #I17, O17, T18, I18, #I18, O18, T19, I19, #I19, O19, T20, I20, #I20, O20, T21, I21, #I21, O21) - -#define sql_create_c_names_21(NAME, CMP, CONTR, T1, I1, N1, T2, I2, N2, T3, I3, N3, T4, I4, N4, T5, I5, N5, T6, I6, N6, T7, I7, N7, T8, I8, N8, T9, I9, N9, T10, I10, N10, T11, I11, N11, T12, I12, N12, T13, I13, N13, T14, I14, N14, T15, I15, N15, T16, I16, N16, T17, I17, N17, T18, I18, N18, T19, I19, N19, T20, I20, N20, T21, I21, N21) \ - sql_create_complete_21(NAME, CMP, CONTR, T1, I1, N1, 0, T2, I2, N2, 1, T3, I3, N3, 2, T4, I4, N4, 3, T5, I5, N5, 4, T6, I6, N6, 5, T7, I7, N7, 6, T8, I8, N8, 7, T9, I9, N9, 8, T10, I10, N10, 9, T11, I11, N11, 10, T12, I12, N12, 11, T13, I13, N13, 12, T14, I14, N14, 13, T15, I15, N15, 14, T16, I16, N16, 15, T17, I17, N17, 16, T18, I18, N18, 17, T19, I19, N19, 18, T20, I20, N20, 19, T21, I21, N21, 20) - -// --------------------------------------------------- -// End Create 21 -// --------------------------------------------------- - -// --------------------------------------------------- -// Begin Create 22 -// --------------------------------------------------- -#define sql_create_basic_c_order_22(NAME, CMP, CONTR, T1, I1, O1, T2, I2, O2, T3, I3, O3, T4, I4, O4, T5, I5, O5, T6, I6, O6, T7, I7, O7, T8, I8, O8, T9, I9, O9, T10, I10, O10, T11, I11, O11, T12, I12, O12, T13, I13, O13, T14, I14, O14, T15, I15, O15, T16, I16, O16, T17, I17, O17, T18, I18, O18, T19, I19, O19, T20, I20, O20, T21, I21, O21, T22, I22, O22)\ - struct NAME; \ - template int sql_compare_##NAME (const NAME &, const NAME &);\ - struct NAME { \ - T1 I1;\ - T2 I2;\ - T3 I3;\ - T4 I4;\ - T5 I5;\ - T6 I6;\ - T7 I7;\ - T8 I8;\ - T9 I9;\ - T10 I10;\ - T11 I11;\ - T12 I12;\ - T13 I13;\ - T14 I14;\ - T15 I15;\ - T16 I16;\ - T17 I17;\ - T18 I18;\ - T19 I19;\ - T20 I20;\ - T21 I21;\ - T22 I22; \ - NAME () {} \ - NAME (const Row &row);\ - sql_compare_define_##CMP(NAME, T1, I1, T2, I2, T3, I3, T4, I4, T5, I5, T6, I6, T7, I7, T8, I8, T9, I9, T10, I10, T11, I11, T12, I12, T13, I13, T14, I14, T15, I15, T16, I16, T17, I17, T18, I18, T19, I19, T20, I20, T21, I21, T22, I22, 0, 0, 0, 0, 0, 0)\ - }; \ - template \ - void populate_##NAME (NAME *s, const Row &row) { \ - s->I1 = static_cast(row.at(O1));\ - s->I2 = static_cast(row.at(O2));\ - s->I3 = static_cast(row.at(O3));\ - s->I4 = static_cast(row.at(O4));\ - s->I5 = static_cast(row.at(O5));\ - s->I6 = static_cast(row.at(O6));\ - s->I7 = static_cast(row.at(O7));\ - s->I8 = static_cast(row.at(O8));\ - s->I9 = static_cast(row.at(O9));\ - s->I10 = static_cast(row.at(O10));\ - s->I11 = static_cast(row.at(O11));\ - s->I12 = static_cast(row.at(O12));\ - s->I13 = static_cast(row.at(O13));\ - s->I14 = static_cast(row.at(O14));\ - s->I15 = static_cast(row.at(O15));\ - s->I16 = static_cast(row.at(O16));\ - s->I17 = static_cast(row.at(O17));\ - s->I18 = static_cast(row.at(O18));\ - s->I19 = static_cast(row.at(O19));\ - s->I20 = static_cast(row.at(O20));\ - s->I21 = static_cast(row.at(O21));\ - s->I22 = static_cast(row.at(O22)); \ - } \ - inline NAME::NAME (const Row &row) \ - {populate_##NAME(this, row);} \ - sql_COMPARE__##CMP(NAME, I1, I2, I3, I4, I5, I6, I7, I8, I9, I10, I11, I12, I13, I14, I15, I16, I17, I18, I19, I20, I21, I22, 0, 0, 0 ) - -#define sql_create_complete_22(NAME, CMP, CONTR, T1, I1, N1, O1, T2, I2, N2, O2, T3, I3, N3, O3, T4, I4, N4, O4, T5, I5, N5, O5, T6, I6, N6, O6, T7, I7, N7, O7, T8, I8, N8, O8, T9, I9, N9, O9, T10, I10, N10, O10, T11, I11, N11, O11, T12, I12, N12, O12, T13, I13, N13, O13, T14, I14, N14, O14, T15, I15, N15, O15, T16, I16, N16, O16, T17, I17, N17, O17, T18, I18, N18, O18, T19, I19, N19, O19, T20, I20, N20, O20, T21, I21, N21, O21, T22, I22, N22, O22) \ - struct NAME; \ - enum NAME##_enum { \ - NAME##_##I1,\ - NAME##_##I2,\ - NAME##_##I3,\ - NAME##_##I4,\ - NAME##_##I5,\ - NAME##_##I6,\ - NAME##_##I7,\ - NAME##_##I8,\ - NAME##_##I9,\ - NAME##_##I10,\ - NAME##_##I11,\ - NAME##_##I12,\ - NAME##_##I13,\ - NAME##_##I14,\ - NAME##_##I15,\ - NAME##_##I16,\ - NAME##_##I17,\ - NAME##_##I18,\ - NAME##_##I19,\ - NAME##_##I20,\ - NAME##_##I21,\ - NAME##_##I22 \ - ,NAME##_NULL \ - }; \ - template \ - class NAME##_value_list { \ - /*friend std::ostream& operator << <> (std::ostream&, const NAME##_value_list&); */\ - public: \ - const NAME *obj;\ - cchar *delem;\ - Manip manip;\ - public: \ - NAME##_value_list (const NAME *o, cchar *d, Manip m) \ - : obj(o), delem(d), manip(m) {} \ - };\ - template \ - class NAME##_##field_list {\ - /* friend std::ostream& operator << <> (std::ostream&, const NAME##_field_list&); */\ - public: \ - const NAME *obj; \ - cchar *delem;\ - Manip manip;\ - public: \ - NAME##_field_list (const NAME *o, cchar *d, Manip m) \ - : obj(o), delem(d), manip(m) {} \ - };\ - template \ - class NAME##_equal_list { \ - /* friend std::ostream& operator << <> (std::ostream&, const NAME##_equal_list&); */\ - public: \ - const NAME *obj;\ - cchar *delem;\ - cchar *comp;\ - Manip manip;\ - public: \ - NAME##_equal_list (const NAME *o, cchar *d, cchar *c, Manip m) \ - : obj(o), delem(d), comp(c), manip(m) {}\ - };\ - template \ - class NAME##_cus_value_list {\ - /* friend std::ostream& operator << <> (std::ostream&, \ - const NAME##_cus_value_list&); */\ - public:\ - const NAME *obj;\ - std::vector *include;\ - bool del_vector;\ - cchar *delem;\ - Manip manip;\ - public: \ - ~NAME##_cus_value_list () {if (del_vector) delete include;} \ - NAME##_cus_value_list (const NAME *o, cchar *d, Manip m, bool i1, bool i2, bool i3, bool i4, bool i5, bool i6, bool i7, bool i8, bool i9, bool i10, bool i11, bool i12, bool i13, bool i14, bool i15, bool i16, bool i17, bool i18, bool i19, bool i20, bool i21, bool i22);\ - NAME##_cus_value_list (const NAME *o, cchar *d, Manip m, NAME##_enum i1, NAME##_enum i2, NAME##_enum i3, NAME##_enum i4, NAME##_enum i5, NAME##_enum i6, NAME##_enum i7, NAME##_enum i8, NAME##_enum i9, NAME##_enum i10, NAME##_enum i11, NAME##_enum i12, NAME##_enum i13, NAME##_enum i14, NAME##_enum i15, NAME##_enum i16, NAME##_enum i17, NAME##_enum i18, NAME##_enum i19, NAME##_enum i20, NAME##_enum i21, NAME##_enum i22); \ - NAME##_cus_value_list (const NAME *o, cchar *d, Manip m ,std::vector* i)\ - : obj(o), include(i), del_vector(false), delem(d), manip(m) {}\ - };\ - template \ - class NAME##_cus_field_list { \ - /* friend std::ostream& operator << <> (std::ostream&, \ - const NAME##_cus_field_list&); */\ - public:\ - const NAME *obj; \ - std::vector *include; \ - bool del_vector; \ - cchar *delem;\ - Manip manip;\ - public: \ - ~NAME##_cus_field_list () {if (del_vector) delete include;} \ - NAME##_cus_field_list (const NAME *o, cchar *d, Manip m, bool i1, bool i2, bool i3, bool i4, bool i5, bool i6, bool i7, bool i8, bool i9, bool i10, bool i11, bool i12, bool i13, bool i14, bool i15, bool i16, bool i17, bool i18, bool i19, bool i20, bool i21, bool i22); \ - NAME##_cus_field_list (const NAME *o, cchar *d, Manip m, NAME##_enum i1, NAME##_enum i2, NAME##_enum i3, NAME##_enum i4, NAME##_enum i5, NAME##_enum i6, NAME##_enum i7, NAME##_enum i8, NAME##_enum i9, NAME##_enum i10, NAME##_enum i11, NAME##_enum i12, NAME##_enum i13, NAME##_enum i14, NAME##_enum i15, NAME##_enum i16, NAME##_enum i17, NAME##_enum i18, NAME##_enum i19, NAME##_enum i20, NAME##_enum i21, NAME##_enum i22); \ - NAME##_cus_field_list (const NAME *o, cchar *d, Manip m, std::vector *i) \ - : obj(o), include(i), del_vector(false), delem(d), manip(m) {}\ - };\ - template \ - class NAME##_cus_equal_list {\ - /* friend std::ostream& operator << <> (std::ostream&, \ - const NAME##_cus_equal_list&); */\ - public:\ - const NAME *obj;\ - std::vector *include;\ - bool del_vector;\ - cchar *delem;\ - cchar *comp;\ - Manip manip;\ - public:\ - ~NAME##_##cus_equal_list () {if (del_vector) delete include;}\ - NAME##_##cus_equal_list (const NAME *o, cchar *d, cchar *c, Manip m, bool i1, bool i2, bool i3, bool i4, bool i5, bool i6, bool i7, bool i8, bool i9, bool i10, bool i11, bool i12, bool i13, bool i14, bool i15, bool i16, bool i17, bool i18, bool i19, bool i20, bool i21, bool i22); \ - NAME##_##cus_equal_list (const NAME *o, cchar *d, cchar *c, Manip m, NAME##_enum i1, NAME##_enum i2, NAME##_enum i3, NAME##_enum i4, NAME##_enum i5, NAME##_enum i6, NAME##_enum i7, NAME##_enum i8, NAME##_enum i9, NAME##_enum i10, NAME##_enum i11, NAME##_enum i12, NAME##_enum i13, NAME##_enum i14, NAME##_enum i15, NAME##_enum i16, NAME##_enum i17, NAME##_enum i18, NAME##_enum i19, NAME##_enum i20, NAME##_enum i21, NAME##_enum i22); \ - NAME##_##cus_equal_list (const NAME *o, cchar *d, cchar *c, Manip m, std::vector *i) \ - : obj(o), include(i), del_vector(false), delem(d), comp(c), manip(m) {}\ - };\ - template int sql_compare_##NAME (const NAME &, const NAME &);\ - struct NAME { \ - T1 I1;\ - T2 I2;\ - T3 I3;\ - T4 I4;\ - T5 I5;\ - T6 I6;\ - T7 I7;\ - T8 I8;\ - T9 I9;\ - T10 I10;\ - T11 I11;\ - T12 I12;\ - T13 I13;\ - T14 I14;\ - T15 I15;\ - T16 I16;\ - T17 I17;\ - T18 I18;\ - T19 I19;\ - T20 I20;\ - T21 I21;\ - T22 I22; \ - NAME () {} \ - NAME (const Row &row);\ - void set (const Row &row);\ - sql_compare_define_##CMP(NAME, T1, I1, T2, I2, T3, I3, T4, I4, T5, I5, T6, I6, T7, I7, T8, I8, T9, I9, T10, I10, T11, I11, T12, I12, T13, I13, T14, I14, T15, I15, T16, I16, T17, I17, T18, I18, T19, I19, T20, I20, T21, I21, T22, I22, 0, 0, 0, 0, 0, 0)\ - sql_construct_define_##CONTR(NAME, T1, I1, T2, I2, T3, I3, T4, I4, T5, I5, T6, I6, T7, I7, T8, I8, T9, I9, T10, I10, T11, I11, T12, I12, T13, I13, T14, I14, T15, I15, T16, I16, T17, I17, T18, I18, T19, I19, T20, I20, T21, I21, T22, I22, 0, 0, 0, 0, 0, 0)\ - static const char *names[];\ - static const char *_table;\ - static const char *& table() {return _table;}\ - NAME##_value_list value_list() const {\ - return value_list(",", quote);}\ - NAME##_value_list value_list(cchar *d) const {\ - return value_list(d, quote);}\ - template \ - NAME##_value_list value_list(cchar *d, Manip m) const; \ - NAME##_field_list field_list() const {\ - return field_list(",", do_nothing);}\ - NAME##_field_list field_list(cchar *d) const {\ - return field_list(d, do_nothing);}\ - template \ - NAME##_field_list field_list(cchar *d, Manip m) const; \ - NAME##_equal_list equal_list(cchar *d = ",", \ - cchar *c = " = ") const{\ - return equal_list(d, c, quote);}\ - template \ - NAME##_equal_list equal_list(cchar *d, cchar *c, Manip m) const; \ - /* cus_data */\ - NAME##_cus_value_list value_list(bool i1, bool i2 = false, bool i3 = false, bool i4 = false, bool i5 = false, bool i6 = false, bool i7 = false, bool i8 = false, bool i9 = false, bool i10 = false, bool i11 = false, bool i12 = false, bool i13 = false, bool i14 = false, bool i15 = false, bool i16 = false, bool i17 = false, bool i18 = false, bool i19 = false, bool i20 = false, bool i21 = false, bool i22 = false) const {\ - return value_list(",", quote, i1, i2, i3, i4, i5, i6, i7, i8, i9, i10, i11, i12, i13, i14, i15, i16, i17, i18, i19, i20, i21, i22);\ - }\ - NAME##_cus_value_list value_list(NAME##_enum i1, NAME##_enum i2 = NAME##_NULL, NAME##_enum i3 = NAME##_NULL, NAME##_enum i4 = NAME##_NULL, NAME##_enum i5 = NAME##_NULL, NAME##_enum i6 = NAME##_NULL, NAME##_enum i7 = NAME##_NULL, NAME##_enum i8 = NAME##_NULL, NAME##_enum i9 = NAME##_NULL, NAME##_enum i10 = NAME##_NULL, NAME##_enum i11 = NAME##_NULL, NAME##_enum i12 = NAME##_NULL, NAME##_enum i13 = NAME##_NULL, NAME##_enum i14 = NAME##_NULL, NAME##_enum i15 = NAME##_NULL, NAME##_enum i16 = NAME##_NULL, NAME##_enum i17 = NAME##_NULL, NAME##_enum i18 = NAME##_NULL, NAME##_enum i19 = NAME##_NULL, NAME##_enum i20 = NAME##_NULL, NAME##_enum i21 = NAME##_NULL, NAME##_enum i22 = NAME##_NULL) const {\ - return value_list(",", quote, i1, i2, i3, i4, i5, i6, i7, i8, i9, i10, i11, i12, i13, i14, i15, i16, i17, i18, i19, i20, i21, i22);\ - }\ - NAME##_cus_value_list value_list(std::vector *i) const {\ - return value_list(",", quote, i);\ - }\ - NAME##_cus_value_list value_list(sql_cmp_type sc) const {\ - return value_list(",", quote, sc);\ - }\ - NAME##_cus_value_list value_list(cchar *d, bool i1, bool i2 = false, bool i3 = false, bool i4 = false, bool i5 = false, bool i6 = false, bool i7 = false, bool i8 = false, bool i9 = false, bool i10 = false, bool i11 = false, bool i12 = false, bool i13 = false, bool i14 = false, bool i15 = false, bool i16 = false, bool i17 = false, bool i18 = false, bool i19 = false, bool i20 = false, bool i21 = false, bool i22 = false) const {\ - return value_list(d, quote, i1, i2, i3, i4, i5, i6, i7, i8, i9, i10, i11, i12, i13, i14, i15, i16, i17, i18, i19, i20, i21, i22);\ - }\ - NAME##_cus_value_list value_list(cchar *d, NAME##_enum i1, NAME##_enum i2 = NAME##_NULL, NAME##_enum i3 = NAME##_NULL, NAME##_enum i4 = NAME##_NULL, NAME##_enum i5 = NAME##_NULL, NAME##_enum i6 = NAME##_NULL, NAME##_enum i7 = NAME##_NULL, NAME##_enum i8 = NAME##_NULL, NAME##_enum i9 = NAME##_NULL, NAME##_enum i10 = NAME##_NULL, NAME##_enum i11 = NAME##_NULL, NAME##_enum i12 = NAME##_NULL, NAME##_enum i13 = NAME##_NULL, NAME##_enum i14 = NAME##_NULL, NAME##_enum i15 = NAME##_NULL, NAME##_enum i16 = NAME##_NULL, NAME##_enum i17 = NAME##_NULL, NAME##_enum i18 = NAME##_NULL, NAME##_enum i19 = NAME##_NULL, NAME##_enum i20 = NAME##_NULL, NAME##_enum i21 = NAME##_NULL, NAME##_enum i22 = NAME##_NULL) const {\ - return value_list(d, quote, i1, i2, i3, i4, i5, i6, i7, i8, i9, i10, i11, i12, i13, i14, i15, i16, i17, i18, i19, i20, i21, i22);\ - }\ - NAME##_cus_value_list value_list(cchar *d, \ - std::vector *i) const {\ - return value_list(d, quote, i);\ - }\ - NAME##_cus_value_list value_list(cchar *d, \ - sql_cmp_type sc) const {\ - return value_list(d, quote, sc);\ - }\ - template \ - NAME##_cus_value_list value_list(cchar *d, Manip m,\ - bool i1, bool i2 = false, bool i3 = false, bool i4 = false, bool i5 = false, bool i6 = false, bool i7 = false, bool i8 = false, bool i9 = false, bool i10 = false, bool i11 = false, bool i12 = false, bool i13 = false, bool i14 = false, bool i15 = false, bool i16 = false, bool i17 = false, bool i18 = false, bool i19 = false, bool i20 = false, bool i21 = false, bool i22 = false) const; \ - template \ - NAME##_cus_value_list value_list(cchar *d, Manip m,\ - NAME##_enum i1, NAME##_enum i2 = NAME##_NULL, NAME##_enum i3 = NAME##_NULL, NAME##_enum i4 = NAME##_NULL, NAME##_enum i5 = NAME##_NULL, NAME##_enum i6 = NAME##_NULL, NAME##_enum i7 = NAME##_NULL, NAME##_enum i8 = NAME##_NULL, NAME##_enum i9 = NAME##_NULL, NAME##_enum i10 = NAME##_NULL, NAME##_enum i11 = NAME##_NULL, NAME##_enum i12 = NAME##_NULL, NAME##_enum i13 = NAME##_NULL, NAME##_enum i14 = NAME##_NULL, NAME##_enum i15 = NAME##_NULL, NAME##_enum i16 = NAME##_NULL, NAME##_enum i17 = NAME##_NULL, NAME##_enum i18 = NAME##_NULL, NAME##_enum i19 = NAME##_NULL, NAME##_enum i20 = NAME##_NULL, NAME##_enum i21 = NAME##_NULL, NAME##_enum i22 = NAME##_NULL) const; \ - template \ - NAME##_cus_value_list value_list(cchar *d, Manip m, \ - std::vector *i) const;\ - template \ - NAME##_cus_value_list value_list(cchar *d, Manip m, \ - sql_cmp_type sc) const;\ - /* cus field */\ - NAME##_cus_field_list field_list(bool i1, bool i2 = false, bool i3 = false, bool i4 = false, bool i5 = false, bool i6 = false, bool i7 = false, bool i8 = false, bool i9 = false, bool i10 = false, bool i11 = false, bool i12 = false, bool i13 = false, bool i14 = false, bool i15 = false, bool i16 = false, bool i17 = false, bool i18 = false, bool i19 = false, bool i20 = false, bool i21 = false, bool i22 = false) const {\ - return field_list(",", do_nothing, i1, i2, i3, i4, i5, i6, i7, i8, i9, i10, i11, i12, i13, i14, i15, i16, i17, i18, i19, i20, i21, i22);\ - }\ - NAME##_cus_field_list field_list(NAME##_enum i1, NAME##_enum i2 = NAME##_NULL, NAME##_enum i3 = NAME##_NULL, NAME##_enum i4 = NAME##_NULL, NAME##_enum i5 = NAME##_NULL, NAME##_enum i6 = NAME##_NULL, NAME##_enum i7 = NAME##_NULL, NAME##_enum i8 = NAME##_NULL, NAME##_enum i9 = NAME##_NULL, NAME##_enum i10 = NAME##_NULL, NAME##_enum i11 = NAME##_NULL, NAME##_enum i12 = NAME##_NULL, NAME##_enum i13 = NAME##_NULL, NAME##_enum i14 = NAME##_NULL, NAME##_enum i15 = NAME##_NULL, NAME##_enum i16 = NAME##_NULL, NAME##_enum i17 = NAME##_NULL, NAME##_enum i18 = NAME##_NULL, NAME##_enum i19 = NAME##_NULL, NAME##_enum i20 = NAME##_NULL, NAME##_enum i21 = NAME##_NULL, NAME##_enum i22 = NAME##_NULL) const {\ - return field_list(",", do_nothing, i1, i2, i3, i4, i5, i6, i7, i8, i9, i10, i11, i12, i13, i14, i15, i16, i17, i18, i19, i20, i21, i22);\ - }\ - NAME##_cus_field_list field_list(std::vector *i) const {\ - return field_list(",", do_nothing, i);\ - }\ - NAME##_cus_field_list field_list(sql_cmp_type sc) const\ - {\ - return field_list(",", do_nothing, sc);\ - }\ - NAME##_cus_field_list field_list(cchar *d, \ - bool i1, bool i2 = false, bool i3 = false, bool i4 = false, bool i5 = false, bool i6 = false, bool i7 = false, bool i8 = false, bool i9 = false, bool i10 = false, bool i11 = false, bool i12 = false, bool i13 = false, bool i14 = false, bool i15 = false, bool i16 = false, bool i17 = false, bool i18 = false, bool i19 = false, bool i20 = false, bool i21 = false, bool i22 = false) const {\ - return field_list(d, do_nothing, i1, i2, i3, i4, i5, i6, i7, i8, i9, i10, i11, i12, i13, i14, i15, i16, i17, i18, i19, i20, i21, i22);\ - }\ - NAME##_cus_field_list field_list(cchar *d,\ - NAME##_enum i1, NAME##_enum i2 = NAME##_NULL, NAME##_enum i3 = NAME##_NULL, NAME##_enum i4 = NAME##_NULL, NAME##_enum i5 = NAME##_NULL, NAME##_enum i6 = NAME##_NULL, NAME##_enum i7 = NAME##_NULL, NAME##_enum i8 = NAME##_NULL, NAME##_enum i9 = NAME##_NULL, NAME##_enum i10 = NAME##_NULL, NAME##_enum i11 = NAME##_NULL, NAME##_enum i12 = NAME##_NULL, NAME##_enum i13 = NAME##_NULL, NAME##_enum i14 = NAME##_NULL, NAME##_enum i15 = NAME##_NULL, NAME##_enum i16 = NAME##_NULL, NAME##_enum i17 = NAME##_NULL, NAME##_enum i18 = NAME##_NULL, NAME##_enum i19 = NAME##_NULL, NAME##_enum i20 = NAME##_NULL, NAME##_enum i21 = NAME##_NULL, NAME##_enum i22 = NAME##_NULL) const {\ - return field_list(d, do_nothing, i1, i2, i3, i4, i5, i6, i7, i8, i9, i10, i11, i12, i13, i14, i15, i16, i17, i18, i19, i20, i21, i22);\ - }\ - NAME##_cus_field_list field_list(cchar *d, \ - std::vector *i) const {\ - return field_list(d, do_nothing, i);\ - }\ - NAME##_cus_field_list field_list(cchar *d, \ - sql_cmp_type sc) const {\ - return field_list(d, do_nothing, sc);\ - }\ - template \ - NAME##_cus_field_list field_list(cchar *d, Manip m,\ - bool i1, bool i2 = false, bool i3 = false, bool i4 = false, bool i5 = false, bool i6 = false, bool i7 = false, bool i8 = false, bool i9 = false, bool i10 = false, bool i11 = false, bool i12 = false, bool i13 = false, bool i14 = false, bool i15 = false, bool i16 = false, bool i17 = false, bool i18 = false, bool i19 = false, bool i20 = false, bool i21 = false, bool i22 = false) const; \ - template \ - NAME##_cus_field_list field_list(cchar *d, Manip m,\ - NAME##_enum i1, NAME##_enum i2 = NAME##_NULL, NAME##_enum i3 = NAME##_NULL, NAME##_enum i4 = NAME##_NULL, NAME##_enum i5 = NAME##_NULL, NAME##_enum i6 = NAME##_NULL, NAME##_enum i7 = NAME##_NULL, NAME##_enum i8 = NAME##_NULL, NAME##_enum i9 = NAME##_NULL, NAME##_enum i10 = NAME##_NULL, NAME##_enum i11 = NAME##_NULL, NAME##_enum i12 = NAME##_NULL, NAME##_enum i13 = NAME##_NULL, NAME##_enum i14 = NAME##_NULL, NAME##_enum i15 = NAME##_NULL, NAME##_enum i16 = NAME##_NULL, NAME##_enum i17 = NAME##_NULL, NAME##_enum i18 = NAME##_NULL, NAME##_enum i19 = NAME##_NULL, NAME##_enum i20 = NAME##_NULL, NAME##_enum i21 = NAME##_NULL, NAME##_enum i22 = NAME##_NULL) const; \ - template \ - NAME##_cus_field_list field_list(cchar *d, Manip m,\ - std::vector *i) const;\ - template \ - NAME##_cus_field_list field_list(cchar *d, Manip m, \ - sql_cmp_type sc) const;\ - /* cus equal */\ - NAME##_cus_equal_list equal_list(bool i1, bool i2 = false, bool i3 = false, bool i4 = false, bool i5 = false, bool i6 = false, bool i7 = false, bool i8 = false, bool i9 = false, bool i10 = false, bool i11 = false, bool i12 = false, bool i13 = false, bool i14 = false, bool i15 = false, bool i16 = false, bool i17 = false, bool i18 = false, bool i19 = false, bool i20 = false, bool i21 = false, bool i22 = false) const {\ - return equal_list(",", " = ", quote, i1, i2, i3, i4, i5, i6, i7, i8, i9, i10, i11, i12, i13, i14, i15, i16, i17, i18, i19, i20, i21, i22);\ - }\ - NAME##_cus_equal_list equal_list(NAME##_enum i1, NAME##_enum i2 = NAME##_NULL, NAME##_enum i3 = NAME##_NULL, NAME##_enum i4 = NAME##_NULL, NAME##_enum i5 = NAME##_NULL, NAME##_enum i6 = NAME##_NULL, NAME##_enum i7 = NAME##_NULL, NAME##_enum i8 = NAME##_NULL, NAME##_enum i9 = NAME##_NULL, NAME##_enum i10 = NAME##_NULL, NAME##_enum i11 = NAME##_NULL, NAME##_enum i12 = NAME##_NULL, NAME##_enum i13 = NAME##_NULL, NAME##_enum i14 = NAME##_NULL, NAME##_enum i15 = NAME##_NULL, NAME##_enum i16 = NAME##_NULL, NAME##_enum i17 = NAME##_NULL, NAME##_enum i18 = NAME##_NULL, NAME##_enum i19 = NAME##_NULL, NAME##_enum i20 = NAME##_NULL, NAME##_enum i21 = NAME##_NULL, NAME##_enum i22 = NAME##_NULL) const {\ - return equal_list(",", " = ", quote, i1, i2, i3, i4, i5, i6, i7, i8, i9, i10, i11, i12, i13, i14, i15, i16, i17, i18, i19, i20, i21, i22);\ - }\ - NAME##_cus_equal_list equal_list(std::vector *i) const {\ - return equal_list(",", " = ", quote, i);\ - }\ - NAME##_cus_equal_list equal_list(sql_cmp_type sc) const {\ - return equal_list(",", " = ", quote, sc);\ - }\ - NAME##_cus_equal_list equal_list(cchar *d, bool i1, bool i2 = false, bool i3 = false, bool i4 = false, bool i5 = false, bool i6 = false, bool i7 = false, bool i8 = false, bool i9 = false, bool i10 = false, bool i11 = false, bool i12 = false, bool i13 = false, bool i14 = false, bool i15 = false, bool i16 = false, bool i17 = false, bool i18 = false, bool i19 = false, bool i20 = false, bool i21 = false, bool i22 = false) const {\ - return equal_list(d, " = ", quote, i1, i2, i3, i4, i5, i6, i7, i8, i9, i10, i11, i12, i13, i14, i15, i16, i17, i18, i19, i20, i21, i22);\ - }\ - NAME##_cus_equal_list equal_list(cchar *d, NAME##_enum i1, NAME##_enum i2 = NAME##_NULL, NAME##_enum i3 = NAME##_NULL, NAME##_enum i4 = NAME##_NULL, NAME##_enum i5 = NAME##_NULL, NAME##_enum i6 = NAME##_NULL, NAME##_enum i7 = NAME##_NULL, NAME##_enum i8 = NAME##_NULL, NAME##_enum i9 = NAME##_NULL, NAME##_enum i10 = NAME##_NULL, NAME##_enum i11 = NAME##_NULL, NAME##_enum i12 = NAME##_NULL, NAME##_enum i13 = NAME##_NULL, NAME##_enum i14 = NAME##_NULL, NAME##_enum i15 = NAME##_NULL, NAME##_enum i16 = NAME##_NULL, NAME##_enum i17 = NAME##_NULL, NAME##_enum i18 = NAME##_NULL, NAME##_enum i19 = NAME##_NULL, NAME##_enum i20 = NAME##_NULL, NAME##_enum i21 = NAME##_NULL, NAME##_enum i22 = NAME##_NULL) const {\ - return equal_list(d, " = ", quote, i1, i2, i3, i4, i5, i6, i7, i8, i9, i10, i11, i12, i13, i14, i15, i16, i17, i18, i19, i20, i21, i22);\ - }\ - NAME##_cus_equal_list equal_list(cchar *d, \ - std::vector *i) const {\ - return equal_list(d, " = ", quote, i);\ - }\ - NAME##_cus_equal_list equal_list(cchar *d, \ - sql_cmp_type sc) const {\ - return equal_list(d, " = ", quote, sc);\ - }\ - NAME##_cus_equal_list equal_list(cchar *d, cchar *c,\ - bool i1, bool i2 = false, bool i3 = false, bool i4 = false, bool i5 = false, bool i6 = false, bool i7 = false, bool i8 = false, bool i9 = false, bool i10 = false, bool i11 = false, bool i12 = false, bool i13 = false, bool i14 = false, bool i15 = false, bool i16 = false, bool i17 = false, bool i18 = false, bool i19 = false, bool i20 = false, bool i21 = false, bool i22 = false) const {\ - return equal_list(d, c, quote, i1, i2, i3, i4, i5, i6, i7, i8, i9, i10, i11, i12, i13, i14, i15, i16, i17, i18, i19, i20, i21, i22);\ - }\ - NAME##_cus_equal_list equal_list(cchar *d, cchar *c,\ - NAME##_enum i1, NAME##_enum i2 = NAME##_NULL, NAME##_enum i3 = NAME##_NULL, NAME##_enum i4 = NAME##_NULL, NAME##_enum i5 = NAME##_NULL, NAME##_enum i6 = NAME##_NULL, NAME##_enum i7 = NAME##_NULL, NAME##_enum i8 = NAME##_NULL, NAME##_enum i9 = NAME##_NULL, NAME##_enum i10 = NAME##_NULL, NAME##_enum i11 = NAME##_NULL, NAME##_enum i12 = NAME##_NULL, NAME##_enum i13 = NAME##_NULL, NAME##_enum i14 = NAME##_NULL, NAME##_enum i15 = NAME##_NULL, NAME##_enum i16 = NAME##_NULL, NAME##_enum i17 = NAME##_NULL, NAME##_enum i18 = NAME##_NULL, NAME##_enum i19 = NAME##_NULL, NAME##_enum i20 = NAME##_NULL, NAME##_enum i21 = NAME##_NULL, NAME##_enum i22 = NAME##_NULL) const {\ - return equal_list(d, c, quote, i1, i2, i3, i4, i5, i6, i7, i8, i9, i10, i11, i12, i13, i14, i15, i16, i17, i18, i19, i20, i21, i22);\ - }\ - NAME##_cus_equal_list equal_list(cchar *d, cchar *c,\ - std::vector *i) const {\ - return equal_list(d, c, quote, i);\ - }\ - NAME##_cus_equal_list equal_list(cchar *d, cchar *c,\ - sql_cmp_type sc) const {\ - return equal_list(d, c, quote, sc);\ - }\ - template \ - NAME##_cus_equal_list equal_list(cchar *d, cchar *c, Manip m, \ - bool i1, bool i2 = false, bool i3 = false, bool i4 = false, bool i5 = false, bool i6 = false, bool i7 = false, bool i8 = false, bool i9 = false, bool i10 = false, bool i11 = false, bool i12 = false, bool i13 = false, bool i14 = false, bool i15 = false, bool i16 = false, bool i17 = false, bool i18 = false, bool i19 = false, bool i20 = false, bool i21 = false, bool i22 = false) const; \ - template \ - NAME##_cus_equal_list equal_list(cchar *d, cchar *c, Manip m, \ - NAME##_enum i1, NAME##_enum i2 = NAME##_NULL, NAME##_enum i3 = NAME##_NULL, NAME##_enum i4 = NAME##_NULL, NAME##_enum i5 = NAME##_NULL, NAME##_enum i6 = NAME##_NULL, NAME##_enum i7 = NAME##_NULL, NAME##_enum i8 = NAME##_NULL, NAME##_enum i9 = NAME##_NULL, NAME##_enum i10 = NAME##_NULL, NAME##_enum i11 = NAME##_NULL, NAME##_enum i12 = NAME##_NULL, NAME##_enum i13 = NAME##_NULL, NAME##_enum i14 = NAME##_NULL, NAME##_enum i15 = NAME##_NULL, NAME##_enum i16 = NAME##_NULL, NAME##_enum i17 = NAME##_NULL, NAME##_enum i18 = NAME##_NULL, NAME##_enum i19 = NAME##_NULL, NAME##_enum i20 = NAME##_NULL, NAME##_enum i21 = NAME##_NULL, NAME##_enum i22 = NAME##_NULL) const; \ - template \ - NAME##_cus_equal_list equal_list(cchar *d, cchar *c, Manip m, \ - std::vector *i) const;\ - template \ - NAME##_cus_equal_list equal_list(cchar *d, cchar *c, Manip m, \ - sql_cmp_type sc) const;\ - }; \ - const char *NAME::names[] = { \ - N1 ,\ - N2 ,\ - N3 ,\ - N4 ,\ - N5 ,\ - N6 ,\ - N7 ,\ - N8 ,\ - N9 ,\ - N10 ,\ - N11 ,\ - N12 ,\ - N13 ,\ - N14 ,\ - N15 ,\ - N16 ,\ - N17 ,\ - N18 ,\ - N19 ,\ - N20 ,\ - N21 ,\ - N22 \ - }; \ - const char *NAME::_table = #NAME ; \ - template \ - NAME##_cus_value_list::NAME##_cus_value_list\ - (const NAME *o, cchar *d, Manip m, bool i1, bool i2, bool i3, bool i4, bool i5, bool i6, bool i7, bool i8, bool i9, bool i10, bool i11, bool i12, bool i13, bool i14, bool i15, bool i16, bool i17, bool i18, bool i19, bool i20, bool i21, bool i22) \ - { \ - delem = d;\ - manip = m;\ - del_vector = true;\ - obj = o; \ - include = new std::vector(22, false);\ - if (i1) (*include)[0]=true;\ - if (i2) (*include)[1]=true;\ - if (i3) (*include)[2]=true;\ - if (i4) (*include)[3]=true;\ - if (i5) (*include)[4]=true;\ - if (i6) (*include)[5]=true;\ - if (i7) (*include)[6]=true;\ - if (i8) (*include)[7]=true;\ - if (i9) (*include)[8]=true;\ - if (i10) (*include)[9]=true;\ - if (i11) (*include)[10]=true;\ - if (i12) (*include)[11]=true;\ - if (i13) (*include)[12]=true;\ - if (i14) (*include)[13]=true;\ - if (i15) (*include)[14]=true;\ - if (i16) (*include)[15]=true;\ - if (i17) (*include)[16]=true;\ - if (i18) (*include)[17]=true;\ - if (i19) (*include)[18]=true;\ - if (i20) (*include)[19]=true;\ - if (i21) (*include)[20]=true;\ - if (i22) (*include)[21]=true;\ - } \ - template \ - NAME##_cus_value_list::NAME##_cus_value_list\ - (const NAME *o, cchar *d, Manip m, NAME##_enum i1, NAME##_enum i2, NAME##_enum i3, NAME##_enum i4, NAME##_enum i5, NAME##_enum i6, NAME##_enum i7, NAME##_enum i8, NAME##_enum i9, NAME##_enum i10, NAME##_enum i11, NAME##_enum i12, NAME##_enum i13, NAME##_enum i14, NAME##_enum i15, NAME##_enum i16, NAME##_enum i17, NAME##_enum i18, NAME##_enum i19, NAME##_enum i20, NAME##_enum i21, NAME##_enum i22) { \ - delem = d;\ - manip = m;\ - del_vector = true; \ - obj = o; \ - include = new std::vector(22, false); \ - if (i1 == NAME##_NULL) return;\ - (*include)[i1]=true;\ - if (i2 == NAME##_NULL) return;\ - (*include)[i2]=true;\ - if (i3 == NAME##_NULL) return;\ - (*include)[i3]=true;\ - if (i4 == NAME##_NULL) return;\ - (*include)[i4]=true;\ - if (i5 == NAME##_NULL) return;\ - (*include)[i5]=true;\ - if (i6 == NAME##_NULL) return;\ - (*include)[i6]=true;\ - if (i7 == NAME##_NULL) return;\ - (*include)[i7]=true;\ - if (i8 == NAME##_NULL) return;\ - (*include)[i8]=true;\ - if (i9 == NAME##_NULL) return;\ - (*include)[i9]=true;\ - if (i10 == NAME##_NULL) return;\ - (*include)[i10]=true;\ - if (i11 == NAME##_NULL) return;\ - (*include)[i11]=true;\ - if (i12 == NAME##_NULL) return;\ - (*include)[i12]=true;\ - if (i13 == NAME##_NULL) return;\ - (*include)[i13]=true;\ - if (i14 == NAME##_NULL) return;\ - (*include)[i14]=true;\ - if (i15 == NAME##_NULL) return;\ - (*include)[i15]=true;\ - if (i16 == NAME##_NULL) return;\ - (*include)[i16]=true;\ - if (i17 == NAME##_NULL) return;\ - (*include)[i17]=true;\ - if (i18 == NAME##_NULL) return;\ - (*include)[i18]=true;\ - if (i19 == NAME##_NULL) return;\ - (*include)[i19]=true;\ - if (i20 == NAME##_NULL) return;\ - (*include)[i20]=true;\ - if (i21 == NAME##_NULL) return;\ - (*include)[i21]=true;\ - if (i22 == NAME##_NULL) return;\ - (*include)[i22]=true;\ - }\ - template \ - NAME##_cus_field_list::NAME##_cus_field_list\ - (const NAME *o, cchar *d, Manip m, bool i1, bool i2, bool i3, bool i4, bool i5, bool i6, bool i7, bool i8, bool i9, bool i10, bool i11, bool i12, bool i13, bool i14, bool i15, bool i16, bool i17, bool i18, bool i19, bool i20, bool i21, bool i22) {\ - delem = d;\ - manip = m;\ - del_vector = true; \ - obj = o; \ - include = new std::vector(22, false); \ - if (i1) (*include)[0]=true;\ - if (i2) (*include)[1]=true;\ - if (i3) (*include)[2]=true;\ - if (i4) (*include)[3]=true;\ - if (i5) (*include)[4]=true;\ - if (i6) (*include)[5]=true;\ - if (i7) (*include)[6]=true;\ - if (i8) (*include)[7]=true;\ - if (i9) (*include)[8]=true;\ - if (i10) (*include)[9]=true;\ - if (i11) (*include)[10]=true;\ - if (i12) (*include)[11]=true;\ - if (i13) (*include)[12]=true;\ - if (i14) (*include)[13]=true;\ - if (i15) (*include)[14]=true;\ - if (i16) (*include)[15]=true;\ - if (i17) (*include)[16]=true;\ - if (i18) (*include)[17]=true;\ - if (i19) (*include)[18]=true;\ - if (i20) (*include)[19]=true;\ - if (i21) (*include)[20]=true;\ - if (i22) (*include)[21]=true;\ - } \ - template \ - NAME##_cus_field_list::NAME##_cus_field_list\ - (const NAME *o, cchar *d, Manip m, NAME##_enum i1, NAME##_enum i2, NAME##_enum i3, NAME##_enum i4, NAME##_enum i5, NAME##_enum i6, NAME##_enum i7, NAME##_enum i8, NAME##_enum i9, NAME##_enum i10, NAME##_enum i11, NAME##_enum i12, NAME##_enum i13, NAME##_enum i14, NAME##_enum i15, NAME##_enum i16, NAME##_enum i17, NAME##_enum i18, NAME##_enum i19, NAME##_enum i20, NAME##_enum i21, NAME##_enum i22) { \ - delem = d;\ - manip = m;\ - del_vector = true; \ - obj = o; \ - include = new std::vector(22, false); \ - if (i1 == NAME##_NULL) return;\ - (*include)[i1]=true;\ - if (i2 == NAME##_NULL) return;\ - (*include)[i2]=true;\ - if (i3 == NAME##_NULL) return;\ - (*include)[i3]=true;\ - if (i4 == NAME##_NULL) return;\ - (*include)[i4]=true;\ - if (i5 == NAME##_NULL) return;\ - (*include)[i5]=true;\ - if (i6 == NAME##_NULL) return;\ - (*include)[i6]=true;\ - if (i7 == NAME##_NULL) return;\ - (*include)[i7]=true;\ - if (i8 == NAME##_NULL) return;\ - (*include)[i8]=true;\ - if (i9 == NAME##_NULL) return;\ - (*include)[i9]=true;\ - if (i10 == NAME##_NULL) return;\ - (*include)[i10]=true;\ - if (i11 == NAME##_NULL) return;\ - (*include)[i11]=true;\ - if (i12 == NAME##_NULL) return;\ - (*include)[i12]=true;\ - if (i13 == NAME##_NULL) return;\ - (*include)[i13]=true;\ - if (i14 == NAME##_NULL) return;\ - (*include)[i14]=true;\ - if (i15 == NAME##_NULL) return;\ - (*include)[i15]=true;\ - if (i16 == NAME##_NULL) return;\ - (*include)[i16]=true;\ - if (i17 == NAME##_NULL) return;\ - (*include)[i17]=true;\ - if (i18 == NAME##_NULL) return;\ - (*include)[i18]=true;\ - if (i19 == NAME##_NULL) return;\ - (*include)[i19]=true;\ - if (i20 == NAME##_NULL) return;\ - (*include)[i20]=true;\ - if (i21 == NAME##_NULL) return;\ - (*include)[i21]=true;\ - if (i22 == NAME##_NULL) return;\ - (*include)[i22]=true;\ - }\ - template \ - NAME##_cus_equal_list::NAME##_cus_equal_list\ - (const NAME *o, cchar *d, cchar *c, Manip m, bool i1, bool i2, bool i3, bool i4, bool i5, bool i6, bool i7, bool i8, bool i9, bool i10, bool i11, bool i12, bool i13, bool i14, bool i15, bool i16, bool i17, bool i18, bool i19, bool i20, bool i21, bool i22) { \ - delem = d;\ - comp = c;\ - manip = m;\ - del_vector = true; \ - obj = o; \ - include = new std::vector(22, false); \ - if (i1) (*include)[0]=true;\ - if (i2) (*include)[1]=true;\ - if (i3) (*include)[2]=true;\ - if (i4) (*include)[3]=true;\ - if (i5) (*include)[4]=true;\ - if (i6) (*include)[5]=true;\ - if (i7) (*include)[6]=true;\ - if (i8) (*include)[7]=true;\ - if (i9) (*include)[8]=true;\ - if (i10) (*include)[9]=true;\ - if (i11) (*include)[10]=true;\ - if (i12) (*include)[11]=true;\ - if (i13) (*include)[12]=true;\ - if (i14) (*include)[13]=true;\ - if (i15) (*include)[14]=true;\ - if (i16) (*include)[15]=true;\ - if (i17) (*include)[16]=true;\ - if (i18) (*include)[17]=true;\ - if (i19) (*include)[18]=true;\ - if (i20) (*include)[19]=true;\ - if (i21) (*include)[20]=true;\ - if (i22) (*include)[21]=true;\ - } \ - template \ - NAME##_cus_equal_list::NAME##_cus_equal_list\ - (const NAME *o, cchar *d, cchar *c, Manip m, NAME##_enum i1, NAME##_enum i2, NAME##_enum i3, NAME##_enum i4, NAME##_enum i5, NAME##_enum i6, NAME##_enum i7, NAME##_enum i8, NAME##_enum i9, NAME##_enum i10, NAME##_enum i11, NAME##_enum i12, NAME##_enum i13, NAME##_enum i14, NAME##_enum i15, NAME##_enum i16, NAME##_enum i17, NAME##_enum i18, NAME##_enum i19, NAME##_enum i20, NAME##_enum i21, NAME##_enum i22) { \ - delem = d;\ - comp = c;\ - manip = m;\ - del_vector = true; \ - obj = o; \ - include = new std::vector(22, false); \ - if (i1 == NAME##_NULL) return;\ - (*include)[i1]=true;\ - if (i2 == NAME##_NULL) return;\ - (*include)[i2]=true;\ - if (i3 == NAME##_NULL) return;\ - (*include)[i3]=true;\ - if (i4 == NAME##_NULL) return;\ - (*include)[i4]=true;\ - if (i5 == NAME##_NULL) return;\ - (*include)[i5]=true;\ - if (i6 == NAME##_NULL) return;\ - (*include)[i6]=true;\ - if (i7 == NAME##_NULL) return;\ - (*include)[i7]=true;\ - if (i8 == NAME##_NULL) return;\ - (*include)[i8]=true;\ - if (i9 == NAME##_NULL) return;\ - (*include)[i9]=true;\ - if (i10 == NAME##_NULL) return;\ - (*include)[i10]=true;\ - if (i11 == NAME##_NULL) return;\ - (*include)[i11]=true;\ - if (i12 == NAME##_NULL) return;\ - (*include)[i12]=true;\ - if (i13 == NAME##_NULL) return;\ - (*include)[i13]=true;\ - if (i14 == NAME##_NULL) return;\ - (*include)[i14]=true;\ - if (i15 == NAME##_NULL) return;\ - (*include)[i15]=true;\ - if (i16 == NAME##_NULL) return;\ - (*include)[i16]=true;\ - if (i17 == NAME##_NULL) return;\ - (*include)[i17]=true;\ - if (i18 == NAME##_NULL) return;\ - (*include)[i18]=true;\ - if (i19 == NAME##_NULL) return;\ - (*include)[i19]=true;\ - if (i20 == NAME##_NULL) return;\ - (*include)[i20]=true;\ - if (i21 == NAME##_NULL) return;\ - (*include)[i21]=true;\ - if (i22 == NAME##_NULL) return;\ - (*include)[i22]=true;\ - }\ - template \ - std::ostream& operator << (std::ostream& s, const NAME##_value_list& obj) { \ - s << obj.manip << obj.obj->I1 << obj.delem;\ - s << obj.manip << obj.obj->I2 << obj.delem;\ - s << obj.manip << obj.obj->I3 << obj.delem;\ - s << obj.manip << obj.obj->I4 << obj.delem;\ - s << obj.manip << obj.obj->I5 << obj.delem;\ - s << obj.manip << obj.obj->I6 << obj.delem;\ - s << obj.manip << obj.obj->I7 << obj.delem;\ - s << obj.manip << obj.obj->I8 << obj.delem;\ - s << obj.manip << obj.obj->I9 << obj.delem;\ - s << obj.manip << obj.obj->I10 << obj.delem;\ - s << obj.manip << obj.obj->I11 << obj.delem;\ - s << obj.manip << obj.obj->I12 << obj.delem;\ - s << obj.manip << obj.obj->I13 << obj.delem;\ - s << obj.manip << obj.obj->I14 << obj.delem;\ - s << obj.manip << obj.obj->I15 << obj.delem;\ - s << obj.manip << obj.obj->I16 << obj.delem;\ - s << obj.manip << obj.obj->I17 << obj.delem;\ - s << obj.manip << obj.obj->I18 << obj.delem;\ - s << obj.manip << obj.obj->I19 << obj.delem;\ - s << obj.manip << obj.obj->I20 << obj.delem;\ - s << obj.manip << obj.obj->I21 << obj.delem;\ - s << obj.manip << obj.obj->I22; \ - return s; \ - } \ - template \ - std::ostream& operator << (std::ostream& s, const NAME##_field_list& obj) { \ - s << obj.manip << obj.obj->names[0] << obj.delem;\ - s << obj.manip << obj.obj->names[1] << obj.delem;\ - s << obj.manip << obj.obj->names[2] << obj.delem;\ - s << obj.manip << obj.obj->names[3] << obj.delem;\ - s << obj.manip << obj.obj->names[4] << obj.delem;\ - s << obj.manip << obj.obj->names[5] << obj.delem;\ - s << obj.manip << obj.obj->names[6] << obj.delem;\ - s << obj.manip << obj.obj->names[7] << obj.delem;\ - s << obj.manip << obj.obj->names[8] << obj.delem;\ - s << obj.manip << obj.obj->names[9] << obj.delem;\ - s << obj.manip << obj.obj->names[10] << obj.delem;\ - s << obj.manip << obj.obj->names[11] << obj.delem;\ - s << obj.manip << obj.obj->names[12] << obj.delem;\ - s << obj.manip << obj.obj->names[13] << obj.delem;\ - s << obj.manip << obj.obj->names[14] << obj.delem;\ - s << obj.manip << obj.obj->names[15] << obj.delem;\ - s << obj.manip << obj.obj->names[16] << obj.delem;\ - s << obj.manip << obj.obj->names[17] << obj.delem;\ - s << obj.manip << obj.obj->names[18] << obj.delem;\ - s << obj.manip << obj.obj->names[19] << obj.delem;\ - s << obj.manip << obj.obj->names[20] << obj.delem;\ - s << obj.manip << obj.obj->names[21]; \ - return s; \ - } \ - template \ - std::ostream& operator << (std::ostream& s, const NAME##_equal_list& obj) { \ - s << obj.obj->names[0] << obj.comp << obj.manip << obj.obj->I1 << obj.delem;\ - s << obj.obj->names[1] << obj.comp << obj.manip << obj.obj->I2 << obj.delem;\ - s << obj.obj->names[2] << obj.comp << obj.manip << obj.obj->I3 << obj.delem;\ - s << obj.obj->names[3] << obj.comp << obj.manip << obj.obj->I4 << obj.delem;\ - s << obj.obj->names[4] << obj.comp << obj.manip << obj.obj->I5 << obj.delem;\ - s << obj.obj->names[5] << obj.comp << obj.manip << obj.obj->I6 << obj.delem;\ - s << obj.obj->names[6] << obj.comp << obj.manip << obj.obj->I7 << obj.delem;\ - s << obj.obj->names[7] << obj.comp << obj.manip << obj.obj->I8 << obj.delem;\ - s << obj.obj->names[8] << obj.comp << obj.manip << obj.obj->I9 << obj.delem;\ - s << obj.obj->names[9] << obj.comp << obj.manip << obj.obj->I10 << obj.delem;\ - s << obj.obj->names[10] << obj.comp << obj.manip << obj.obj->I11 << obj.delem;\ - s << obj.obj->names[11] << obj.comp << obj.manip << obj.obj->I12 << obj.delem;\ - s << obj.obj->names[12] << obj.comp << obj.manip << obj.obj->I13 << obj.delem;\ - s << obj.obj->names[13] << obj.comp << obj.manip << obj.obj->I14 << obj.delem;\ - s << obj.obj->names[14] << obj.comp << obj.manip << obj.obj->I15 << obj.delem;\ - s << obj.obj->names[15] << obj.comp << obj.manip << obj.obj->I16 << obj.delem;\ - s << obj.obj->names[16] << obj.comp << obj.manip << obj.obj->I17 << obj.delem;\ - s << obj.obj->names[17] << obj.comp << obj.manip << obj.obj->I18 << obj.delem;\ - s << obj.obj->names[18] << obj.comp << obj.manip << obj.obj->I19 << obj.delem;\ - s << obj.obj->names[19] << obj.comp << obj.manip << obj.obj->I20 << obj.delem;\ - s << obj.obj->names[20] << obj.comp << obj.manip << obj.obj->I21 << obj.delem;\ - s << obj.obj->names[21] << obj.comp << obj.manip << obj.obj->I22; \ - return s; \ - } \ - template \ - std::ostream& operator << (std::ostream& s, const NAME##_cus_value_list& obj) { \ - bool before = false; \ - if ((*obj.include)[0]) { \ - s << obj.manip << obj.obj->I1;\ - before = true; \ - } \ - if ((*obj.include)[1]) { \ - if (before) s << obj.delem;\ - s << obj.manip << obj.obj->I2;\ - before = true; \ - } \ - if ((*obj.include)[2]) { \ - if (before) s << obj.delem;\ - s << obj.manip << obj.obj->I3;\ - before = true; \ - } \ - if ((*obj.include)[3]) { \ - if (before) s << obj.delem;\ - s << obj.manip << obj.obj->I4;\ - before = true; \ - } \ - if ((*obj.include)[4]) { \ - if (before) s << obj.delem;\ - s << obj.manip << obj.obj->I5;\ - before = true; \ - } \ - if ((*obj.include)[5]) { \ - if (before) s << obj.delem;\ - s << obj.manip << obj.obj->I6;\ - before = true; \ - } \ - if ((*obj.include)[6]) { \ - if (before) s << obj.delem;\ - s << obj.manip << obj.obj->I7;\ - before = true; \ - } \ - if ((*obj.include)[7]) { \ - if (before) s << obj.delem;\ - s << obj.manip << obj.obj->I8;\ - before = true; \ - } \ - if ((*obj.include)[8]) { \ - if (before) s << obj.delem;\ - s << obj.manip << obj.obj->I9;\ - before = true; \ - } \ - if ((*obj.include)[9]) { \ - if (before) s << obj.delem;\ - s << obj.manip << obj.obj->I10;\ - before = true; \ - } \ - if ((*obj.include)[10]) { \ - if (before) s << obj.delem;\ - s << obj.manip << obj.obj->I11;\ - before = true; \ - } \ - if ((*obj.include)[11]) { \ - if (before) s << obj.delem;\ - s << obj.manip << obj.obj->I12;\ - before = true; \ - } \ - if ((*obj.include)[12]) { \ - if (before) s << obj.delem;\ - s << obj.manip << obj.obj->I13;\ - before = true; \ - } \ - if ((*obj.include)[13]) { \ - if (before) s << obj.delem;\ - s << obj.manip << obj.obj->I14;\ - before = true; \ - } \ - if ((*obj.include)[14]) { \ - if (before) s << obj.delem;\ - s << obj.manip << obj.obj->I15;\ - before = true; \ - } \ - if ((*obj.include)[15]) { \ - if (before) s << obj.delem;\ - s << obj.manip << obj.obj->I16;\ - before = true; \ - } \ - if ((*obj.include)[16]) { \ - if (before) s << obj.delem;\ - s << obj.manip << obj.obj->I17;\ - before = true; \ - } \ - if ((*obj.include)[17]) { \ - if (before) s << obj.delem;\ - s << obj.manip << obj.obj->I18;\ - before = true; \ - } \ - if ((*obj.include)[18]) { \ - if (before) s << obj.delem;\ - s << obj.manip << obj.obj->I19;\ - before = true; \ - } \ - if ((*obj.include)[19]) { \ - if (before) s << obj.delem;\ - s << obj.manip << obj.obj->I20;\ - before = true; \ - } \ - if ((*obj.include)[20]) { \ - if (before) s << obj.delem;\ - s << obj.manip << obj.obj->I21;\ - before = true; \ - } \ - if ((*obj.include)[21]) { \ - if (before) s << obj.delem;\ - s << obj.manip << obj.obj->I22;\ - } \ - return s; \ - } \ - template \ - std::ostream& operator << (std::ostream& s, const NAME##_cus_field_list& obj) { \ - bool before = false; \ - if ((*obj.include)[0]) { \ - s << obj.manip << obj.obj->names[0];\ - before = true; \ - } \ - if ((*obj.include)[1]) { \ - if (before) s << obj.delem;\ - s << obj.manip << obj.obj->names[1];\ - before = true; \ - } \ - if ((*obj.include)[2]) { \ - if (before) s << obj.delem;\ - s << obj.manip << obj.obj->names[2];\ - before = true; \ - } \ - if ((*obj.include)[3]) { \ - if (before) s << obj.delem;\ - s << obj.manip << obj.obj->names[3];\ - before = true; \ - } \ - if ((*obj.include)[4]) { \ - if (before) s << obj.delem;\ - s << obj.manip << obj.obj->names[4];\ - before = true; \ - } \ - if ((*obj.include)[5]) { \ - if (before) s << obj.delem;\ - s << obj.manip << obj.obj->names[5];\ - before = true; \ - } \ - if ((*obj.include)[6]) { \ - if (before) s << obj.delem;\ - s << obj.manip << obj.obj->names[6];\ - before = true; \ - } \ - if ((*obj.include)[7]) { \ - if (before) s << obj.delem;\ - s << obj.manip << obj.obj->names[7];\ - before = true; \ - } \ - if ((*obj.include)[8]) { \ - if (before) s << obj.delem;\ - s << obj.manip << obj.obj->names[8];\ - before = true; \ - } \ - if ((*obj.include)[9]) { \ - if (before) s << obj.delem;\ - s << obj.manip << obj.obj->names[9];\ - before = true; \ - } \ - if ((*obj.include)[10]) { \ - if (before) s << obj.delem;\ - s << obj.manip << obj.obj->names[10];\ - before = true; \ - } \ - if ((*obj.include)[11]) { \ - if (before) s << obj.delem;\ - s << obj.manip << obj.obj->names[11];\ - before = true; \ - } \ - if ((*obj.include)[12]) { \ - if (before) s << obj.delem;\ - s << obj.manip << obj.obj->names[12];\ - before = true; \ - } \ - if ((*obj.include)[13]) { \ - if (before) s << obj.delem;\ - s << obj.manip << obj.obj->names[13];\ - before = true; \ - } \ - if ((*obj.include)[14]) { \ - if (before) s << obj.delem;\ - s << obj.manip << obj.obj->names[14];\ - before = true; \ - } \ - if ((*obj.include)[15]) { \ - if (before) s << obj.delem;\ - s << obj.manip << obj.obj->names[15];\ - before = true; \ - } \ - if ((*obj.include)[16]) { \ - if (before) s << obj.delem;\ - s << obj.manip << obj.obj->names[16];\ - before = true; \ - } \ - if ((*obj.include)[17]) { \ - if (before) s << obj.delem;\ - s << obj.manip << obj.obj->names[17];\ - before = true; \ - } \ - if ((*obj.include)[18]) { \ - if (before) s << obj.delem;\ - s << obj.manip << obj.obj->names[18];\ - before = true; \ - } \ - if ((*obj.include)[19]) { \ - if (before) s << obj.delem;\ - s << obj.manip << obj.obj->names[19];\ - before = true; \ - } \ - if ((*obj.include)[20]) { \ - if (before) s << obj.delem;\ - s << obj.manip << obj.obj->names[20];\ - before = true; \ - } \ - if ((*obj.include)[21]) { \ - if (before) s << obj.delem;\ - s << obj.manip << obj.obj->names[21];\ - } \ - return s; \ - } \ - template \ - std::ostream& operator << (std::ostream& s, const NAME##_cus_equal_list& obj) { \ - bool before = false; \ - if ((*obj.include)[0]) { \ - s << obj.obj->names[0] << obj.comp << obj.manip << obj.obj->I1;\ - before = true; \ - } \ - if ((*obj.include)[1]) { \ - if (before) s << obj.delem;\ - s << obj.obj->names[1] << obj.comp << obj.manip << obj.obj->I2;\ - before = true; \ - } \ - if ((*obj.include)[2]) { \ - if (before) s << obj.delem;\ - s << obj.obj->names[2] << obj.comp << obj.manip << obj.obj->I3;\ - before = true; \ - } \ - if ((*obj.include)[3]) { \ - if (before) s << obj.delem;\ - s << obj.obj->names[3] << obj.comp << obj.manip << obj.obj->I4;\ - before = true; \ - } \ - if ((*obj.include)[4]) { \ - if (before) s << obj.delem;\ - s << obj.obj->names[4] << obj.comp << obj.manip << obj.obj->I5;\ - before = true; \ - } \ - if ((*obj.include)[5]) { \ - if (before) s << obj.delem;\ - s << obj.obj->names[5] << obj.comp << obj.manip << obj.obj->I6;\ - before = true; \ - } \ - if ((*obj.include)[6]) { \ - if (before) s << obj.delem;\ - s << obj.obj->names[6] << obj.comp << obj.manip << obj.obj->I7;\ - before = true; \ - } \ - if ((*obj.include)[7]) { \ - if (before) s << obj.delem;\ - s << obj.obj->names[7] << obj.comp << obj.manip << obj.obj->I8;\ - before = true; \ - } \ - if ((*obj.include)[8]) { \ - if (before) s << obj.delem;\ - s << obj.obj->names[8] << obj.comp << obj.manip << obj.obj->I9;\ - before = true; \ - } \ - if ((*obj.include)[9]) { \ - if (before) s << obj.delem;\ - s << obj.obj->names[9] << obj.comp << obj.manip << obj.obj->I10;\ - before = true; \ - } \ - if ((*obj.include)[10]) { \ - if (before) s << obj.delem;\ - s << obj.obj->names[10] << obj.comp << obj.manip << obj.obj->I11;\ - before = true; \ - } \ - if ((*obj.include)[11]) { \ - if (before) s << obj.delem;\ - s << obj.obj->names[11] << obj.comp << obj.manip << obj.obj->I12;\ - before = true; \ - } \ - if ((*obj.include)[12]) { \ - if (before) s << obj.delem;\ - s << obj.obj->names[12] << obj.comp << obj.manip << obj.obj->I13;\ - before = true; \ - } \ - if ((*obj.include)[13]) { \ - if (before) s << obj.delem;\ - s << obj.obj->names[13] << obj.comp << obj.manip << obj.obj->I14;\ - before = true; \ - } \ - if ((*obj.include)[14]) { \ - if (before) s << obj.delem;\ - s << obj.obj->names[14] << obj.comp << obj.manip << obj.obj->I15;\ - before = true; \ - } \ - if ((*obj.include)[15]) { \ - if (before) s << obj.delem;\ - s << obj.obj->names[15] << obj.comp << obj.manip << obj.obj->I16;\ - before = true; \ - } \ - if ((*obj.include)[16]) { \ - if (before) s << obj.delem;\ - s << obj.obj->names[16] << obj.comp << obj.manip << obj.obj->I17;\ - before = true; \ - } \ - if ((*obj.include)[17]) { \ - if (before) s << obj.delem;\ - s << obj.obj->names[17] << obj.comp << obj.manip << obj.obj->I18;\ - before = true; \ - } \ - if ((*obj.include)[18]) { \ - if (before) s << obj.delem;\ - s << obj.obj->names[18] << obj.comp << obj.manip << obj.obj->I19;\ - before = true; \ - } \ - if ((*obj.include)[19]) { \ - if (before) s << obj.delem;\ - s << obj.obj->names[19] << obj.comp << obj.manip << obj.obj->I20;\ - before = true; \ - } \ - if ((*obj.include)[20]) { \ - if (before) s << obj.delem;\ - s << obj.obj->names[20] << obj.comp << obj.manip << obj.obj->I21;\ - before = true; \ - } \ - if ((*obj.include)[21]) { \ - if (before) s << obj.delem;\ - s << obj.obj->names[21] << obj.comp << obj.manip << obj.obj->I22;\ - } \ - return s; \ - } \ - template \ - inline NAME##_value_list NAME::value_list(cchar *d, Manip m) const { \ - return NAME##_value_list (this, d, m); \ - } \ - template \ - inline NAME##_field_list NAME::field_list(cchar *d, Manip m) const { \ - return NAME##_field_list (this, d, m); \ - } \ - template \ - inline NAME##_equal_list NAME::equal_list(cchar *d, cchar *c, Manip m) const { \ - return NAME##_equal_list (this, d, c, m); \ - } \ - template \ - inline NAME##_cus_value_list NAME::value_list(cchar *d, Manip m,\ - bool i1, bool i2, bool i3, bool i4, bool i5, bool i6, bool i7, bool i8, bool i9, bool i10, bool i11, bool i12, bool i13, bool i14, bool i15, bool i16, bool i17, bool i18, bool i19, bool i20, bool i21, bool i22) const {\ - return NAME##_cus_value_list (this, d, m, i1, i2, i3, i4, i5, i6, i7, i8, i9, i10, i11, i12, i13, i14, i15, i16, i17, i18, i19, i20, i21, i22); \ - } \ - template \ - inline NAME##_cus_field_list NAME::field_list(cchar *d, Manip m,\ - bool i1, bool i2, bool i3, bool i4, bool i5, bool i6, bool i7, bool i8, bool i9, bool i10, bool i11, bool i12, bool i13, bool i14, bool i15, bool i16, bool i17, bool i18, bool i19, bool i20, bool i21, bool i22) const { \ - return NAME##_cus_field_list (this, d, m, i1, i2, i3, i4, i5, i6, i7, i8, i9, i10, i11, i12, i13, i14, i15, i16, i17, i18, i19, i20, i21, i22); \ - } \ - template \ - inline NAME##_cus_equal_list NAME::equal_list(cchar *d, cchar *c, Manip m,\ - bool i1, bool i2, bool i3, bool i4, bool i5, bool i6, bool i7, bool i8, bool i9, bool i10, bool i11, bool i12, bool i13, bool i14, bool i15, bool i16, bool i17, bool i18, bool i19, bool i20, bool i21, bool i22) const { \ - return NAME##_cus_equal_list (this, d, c, m, i1, i2, i3, i4, i5, i6, i7, i8, i9, i10, i11, i12, i13, i14, i15, i16, i17, i18, i19, i20, i21, i22); \ - } \ - template \ - inline NAME##_cus_value_list NAME::value_list(cchar *d, Manip m,\ - NAME##_enum i1, NAME##_enum i2, NAME##_enum i3, NAME##_enum i4, NAME##_enum i5, NAME##_enum i6, NAME##_enum i7, NAME##_enum i8, NAME##_enum i9, NAME##_enum i10, NAME##_enum i11, NAME##_enum i12, NAME##_enum i13, NAME##_enum i14, NAME##_enum i15, NAME##_enum i16, NAME##_enum i17, NAME##_enum i18, NAME##_enum i19, NAME##_enum i20, NAME##_enum i21, NAME##_enum i22) const { \ - return NAME##_cus_value_list (this, d, m, i1, i2, i3, i4, i5, i6, i7, i8, i9, i10, i11, i12, i13, i14, i15, i16, i17, i18, i19, i20, i21, i22); \ - } \ - template \ - inline NAME##_cus_field_list NAME::field_list(cchar *d, Manip m,\ - NAME##_enum i1, NAME##_enum i2, NAME##_enum i3, NAME##_enum i4, NAME##_enum i5, NAME##_enum i6, NAME##_enum i7, NAME##_enum i8, NAME##_enum i9, NAME##_enum i10, NAME##_enum i11, NAME##_enum i12, NAME##_enum i13, NAME##_enum i14, NAME##_enum i15, NAME##_enum i16, NAME##_enum i17, NAME##_enum i18, NAME##_enum i19, NAME##_enum i20, NAME##_enum i21, NAME##_enum i22) const {\ - return NAME##_cus_field_list (this, d, m, i1, i2, i3, i4, i5, i6, i7, i8, i9, i10, i11, i12, i13, i14, i15, i16, i17, i18, i19, i20, i21, i22); \ - } \ - template \ - inline NAME##_cus_equal_list NAME::equal_list(cchar *d, cchar *c, Manip m, \ - NAME##_enum i1, NAME##_enum i2, NAME##_enum i3, NAME##_enum i4, NAME##_enum i5, NAME##_enum i6, NAME##_enum i7, NAME##_enum i8, NAME##_enum i9, NAME##_enum i10, NAME##_enum i11, NAME##_enum i12, NAME##_enum i13, NAME##_enum i14, NAME##_enum i15, NAME##_enum i16, NAME##_enum i17, NAME##_enum i18, NAME##_enum i19, NAME##_enum i20, NAME##_enum i21, NAME##_enum i22) const { \ - return NAME##_cus_equal_list (this, d, c, m, i1, i2, i3, i4, i5, i6, i7, i8, i9, i10, i11, i12, i13, i14, i15, i16, i17, i18, i19, i20, i21, i22); \ - } \ - template \ - inline NAME##_cus_value_list NAME::value_list(cchar *d, Manip m,\ - std::vector *i) const {\ - return NAME##_cus_value_list (this, d, m, i);\ - }\ - template \ - inline NAME##_cus_field_list NAME::field_list(cchar *d, Manip m,\ - std::vector *i) const {\ - return NAME##_cus_field_list (this, d, m, i);\ - }\ - template \ - inline NAME##_cus_equal_list NAME::equal_list(cchar *d, cchar *c, Manip m,\ - std::vector *i) const {\ - return NAME##_cus_equal_list (this, d, c, m, i);\ - }\ - template \ - inline NAME##_cus_value_list \ - NAME::value_list(cchar *d, Manip m, sql_cmp_type /*sc*/) const {\ - sql_compare_type_def_##CMP (NAME, value, NUM);\ - }\ - template \ - inline NAME##_cus_field_list \ - NAME::field_list(cchar *d, Manip m, sql_cmp_type /*sc*/) const {\ - sql_compare_type_def_##CMP (NAME, field, NUM);\ - }\ - template \ - inline NAME##_cus_equal_list \ - NAME::equal_list(cchar *d, cchar *c, Manip m, sql_cmp_type /*sc*/) const {\ - sql_compare_type_defe_##CMP (NAME, equal, NUM);\ - }\ - template \ - void populate_##NAME (NAME *s, const Row &row) { \ - s->I1 = static_cast(row.at(O1));\ - s->I2 = static_cast(row.at(O2));\ - s->I3 = static_cast(row.at(O3));\ - s->I4 = static_cast(row.at(O4));\ - s->I5 = static_cast(row.at(O5));\ - s->I6 = static_cast(row.at(O6));\ - s->I7 = static_cast(row.at(O7));\ - s->I8 = static_cast(row.at(O8));\ - s->I9 = static_cast(row.at(O9));\ - s->I10 = static_cast(row.at(O10));\ - s->I11 = static_cast(row.at(O11));\ - s->I12 = static_cast(row.at(O12));\ - s->I13 = static_cast(row.at(O13));\ - s->I14 = static_cast(row.at(O14));\ - s->I15 = static_cast(row.at(O15));\ - s->I16 = static_cast(row.at(O16));\ - s->I17 = static_cast(row.at(O17));\ - s->I18 = static_cast(row.at(O18));\ - s->I19 = static_cast(row.at(O19));\ - s->I20 = static_cast(row.at(O20));\ - s->I21 = static_cast(row.at(O21));\ - s->I22 = static_cast(row.at(O22));\ - } \ - inline NAME::NAME (const Row &row) \ - {populate_##NAME(this, row);}\ - inline void NAME::set (const Row &row)\ - {populate_##NAME(this, row);}\ - sql_COMPARE__##CMP(NAME, I1, I2, I3, I4, I5, I6, I7, I8, I9, I10, I11, I12, I13, I14, I15, I16, I17, I18, I19, I20, I21, I22, 0, 0, 0 ) - -#define sql_create_basic_22(NAME, CMP, CONTR, T1, I1, T2, I2, T3, I3, T4, I4, T5, I5, T6, I6, T7, I7, T8, I8, T9, I9, T10, I10, T11, I11, T12, I12, T13, I13, T14, I14, T15, I15, T16, I16, T17, I17, T18, I18, T19, I19, T20, I20, T21, I21, T22, I22) \ - sql_create_basic_c_order_22(NAME, CMP, CONTR, T1, I1, 0, T2, I2, 1, T3, I3, 2, T4, I4, 3, T5, I5, 4, T6, I6, 5, T7, I7, 6, T8, I8, 7, T9, I9, 8, T10, I10, 9, T11, I11, 10, T12, I12, 11, T13, I13, 12, T14, I14, 13, T15, I15, 14, T16, I16, 15, T17, I17, 16, T18, I18, 17, T19, I19, 18, T20, I20, 19, T21, I21, 20, T22, I22, 21) - -#define sql_create_22(NAME, CMP, CONTR, T1, I1, T2, I2, T3, I3, T4, I4, T5, I5, T6, I6, T7, I7, T8, I8, T9, I9, T10, I10, T11, I11, T12, I12, T13, I13, T14, I14, T15, I15, T16, I16, T17, I17, T18, I18, T19, I19, T20, I20, T21, I21, T22, I22) \ - sql_create_complete_22(NAME, CMP, CONTR, T1, I1, #I1, 0, T2, I2, #I2, 1, T3, I3, #I3, 2, T4, I4, #I4, 3, T5, I5, #I5, 4, T6, I6, #I6, 5, T7, I7, #I7, 6, T8, I8, #I8, 7, T9, I9, #I9, 8, T10, I10, #I10, 9, T11, I11, #I11, 10, T12, I12, #I12, 11, T13, I13, #I13, 12, T14, I14, #I14, 13, T15, I15, #I15, 14, T16, I16, #I16, 15, T17, I17, #I17, 16, T18, I18, #I18, 17, T19, I19, #I19, 18, T20, I20, #I20, 19, T21, I21, #I21, 20, T22, I22, #I22, 21) \ - -#define sql_create_c_order_22(NAME, CMP, CONTR, T1, I1, O1, T2, I2, O2, T3, I3, O3, T4, I4, O4, T5, I5, O5, T6, I6, O6, T7, I7, O7, T8, I8, O8, T9, I9, O9, T10, I10, O10, T11, I11, O11, T12, I12, O12, T13, I13, O13, T14, I14, O14, T15, I15, O15, T16, I16, O16, T17, I17, O17, T18, I18, O18, T19, I19, O19, T20, I20, O20, T21, I21, O21, T22, I22, O22) \ - sql_create_complete_22(NAME, CMP, CONTR, T1, I1, #I1, O1, T2, I2, #I2, O2, T3, I3, #I3, O3, T4, I4, #I4, O4, T5, I5, #I5, O5, T6, I6, #I6, O6, T7, I7, #I7, O7, T8, I8, #I8, O8, T9, I9, #I9, O9, T10, I10, #I10, O10, T11, I11, #I11, O11, T12, I12, #I12, O12, T13, I13, #I13, O13, T14, I14, #I14, O14, T15, I15, #I15, O15, T16, I16, #I16, O16, T17, I17, #I17, O17, T18, I18, #I18, O18, T19, I19, #I19, O19, T20, I20, #I20, O20, T21, I21, #I21, O21, T22, I22, #I22, O22) - -#define sql_create_c_names_22(NAME, CMP, CONTR, T1, I1, N1, T2, I2, N2, T3, I3, N3, T4, I4, N4, T5, I5, N5, T6, I6, N6, T7, I7, N7, T8, I8, N8, T9, I9, N9, T10, I10, N10, T11, I11, N11, T12, I12, N12, T13, I13, N13, T14, I14, N14, T15, I15, N15, T16, I16, N16, T17, I17, N17, T18, I18, N18, T19, I19, N19, T20, I20, N20, T21, I21, N21, T22, I22, N22) \ - sql_create_complete_22(NAME, CMP, CONTR, T1, I1, N1, 0, T2, I2, N2, 1, T3, I3, N3, 2, T4, I4, N4, 3, T5, I5, N5, 4, T6, I6, N6, 5, T7, I7, N7, 6, T8, I8, N8, 7, T9, I9, N9, 8, T10, I10, N10, 9, T11, I11, N11, 10, T12, I12, N12, 11, T13, I13, N13, 12, T14, I14, N14, 13, T15, I15, N15, 14, T16, I16, N16, 15, T17, I17, N17, 16, T18, I18, N18, 17, T19, I19, N19, 18, T20, I20, N20, 19, T21, I21, N21, 20, T22, I22, N22, 21) - -// --------------------------------------------------- -// End Create 22 -// --------------------------------------------------- - -// --------------------------------------------------- -// Begin Create 23 -// --------------------------------------------------- -#define sql_create_basic_c_order_23(NAME, CMP, CONTR, T1, I1, O1, T2, I2, O2, T3, I3, O3, T4, I4, O4, T5, I5, O5, T6, I6, O6, T7, I7, O7, T8, I8, O8, T9, I9, O9, T10, I10, O10, T11, I11, O11, T12, I12, O12, T13, I13, O13, T14, I14, O14, T15, I15, O15, T16, I16, O16, T17, I17, O17, T18, I18, O18, T19, I19, O19, T20, I20, O20, T21, I21, O21, T22, I22, O22, T23, I23, O23)\ - struct NAME; \ - template int sql_compare_##NAME (const NAME &, const NAME &);\ - struct NAME { \ - T1 I1;\ - T2 I2;\ - T3 I3;\ - T4 I4;\ - T5 I5;\ - T6 I6;\ - T7 I7;\ - T8 I8;\ - T9 I9;\ - T10 I10;\ - T11 I11;\ - T12 I12;\ - T13 I13;\ - T14 I14;\ - T15 I15;\ - T16 I16;\ - T17 I17;\ - T18 I18;\ - T19 I19;\ - T20 I20;\ - T21 I21;\ - T22 I22;\ - T23 I23; \ - NAME () {} \ - NAME (const Row &row);\ - sql_compare_define_##CMP(NAME, T1, I1, T2, I2, T3, I3, T4, I4, T5, I5, T6, I6, T7, I7, T8, I8, T9, I9, T10, I10, T11, I11, T12, I12, T13, I13, T14, I14, T15, I15, T16, I16, T17, I17, T18, I18, T19, I19, T20, I20, T21, I21, T22, I22, T23, I23, 0, 0, 0, 0)\ - }; \ - template \ - void populate_##NAME (NAME *s, const Row &row) { \ - s->I1 = static_cast(row.at(O1));\ - s->I2 = static_cast(row.at(O2));\ - s->I3 = static_cast(row.at(O3));\ - s->I4 = static_cast(row.at(O4));\ - s->I5 = static_cast(row.at(O5));\ - s->I6 = static_cast(row.at(O6));\ - s->I7 = static_cast(row.at(O7));\ - s->I8 = static_cast(row.at(O8));\ - s->I9 = static_cast(row.at(O9));\ - s->I10 = static_cast(row.at(O10));\ - s->I11 = static_cast(row.at(O11));\ - s->I12 = static_cast(row.at(O12));\ - s->I13 = static_cast(row.at(O13));\ - s->I14 = static_cast(row.at(O14));\ - s->I15 = static_cast(row.at(O15));\ - s->I16 = static_cast(row.at(O16));\ - s->I17 = static_cast(row.at(O17));\ - s->I18 = static_cast(row.at(O18));\ - s->I19 = static_cast(row.at(O19));\ - s->I20 = static_cast(row.at(O20));\ - s->I21 = static_cast(row.at(O21));\ - s->I22 = static_cast(row.at(O22));\ - s->I23 = static_cast(row.at(O23)); \ - } \ - inline NAME::NAME (const Row &row) \ - {populate_##NAME(this, row);} \ - sql_COMPARE__##CMP(NAME, I1, I2, I3, I4, I5, I6, I7, I8, I9, I10, I11, I12, I13, I14, I15, I16, I17, I18, I19, I20, I21, I22, I23, 0, 0 ) - -#define sql_create_complete_23(NAME, CMP, CONTR, T1, I1, N1, O1, T2, I2, N2, O2, T3, I3, N3, O3, T4, I4, N4, O4, T5, I5, N5, O5, T6, I6, N6, O6, T7, I7, N7, O7, T8, I8, N8, O8, T9, I9, N9, O9, T10, I10, N10, O10, T11, I11, N11, O11, T12, I12, N12, O12, T13, I13, N13, O13, T14, I14, N14, O14, T15, I15, N15, O15, T16, I16, N16, O16, T17, I17, N17, O17, T18, I18, N18, O18, T19, I19, N19, O19, T20, I20, N20, O20, T21, I21, N21, O21, T22, I22, N22, O22, T23, I23, N23, O23) \ - struct NAME; \ - enum NAME##_enum { \ - NAME##_##I1,\ - NAME##_##I2,\ - NAME##_##I3,\ - NAME##_##I4,\ - NAME##_##I5,\ - NAME##_##I6,\ - NAME##_##I7,\ - NAME##_##I8,\ - NAME##_##I9,\ - NAME##_##I10,\ - NAME##_##I11,\ - NAME##_##I12,\ - NAME##_##I13,\ - NAME##_##I14,\ - NAME##_##I15,\ - NAME##_##I16,\ - NAME##_##I17,\ - NAME##_##I18,\ - NAME##_##I19,\ - NAME##_##I20,\ - NAME##_##I21,\ - NAME##_##I22,\ - NAME##_##I23 \ - ,NAME##_NULL \ - }; \ - template \ - class NAME##_value_list { \ - /*friend std::ostream& operator << <> (std::ostream&, const NAME##_value_list&); */\ - public: \ - const NAME *obj;\ - cchar *delem;\ - Manip manip;\ - public: \ - NAME##_value_list (const NAME *o, cchar *d, Manip m) \ - : obj(o), delem(d), manip(m) {} \ - };\ - template \ - class NAME##_##field_list {\ - /* friend std::ostream& operator << <> (std::ostream&, const NAME##_field_list&); */\ - public: \ - const NAME *obj; \ - cchar *delem;\ - Manip manip;\ - public: \ - NAME##_field_list (const NAME *o, cchar *d, Manip m) \ - : obj(o), delem(d), manip(m) {} \ - };\ - template \ - class NAME##_equal_list { \ - /* friend std::ostream& operator << <> (std::ostream&, const NAME##_equal_list&); */\ - public: \ - const NAME *obj;\ - cchar *delem;\ - cchar *comp;\ - Manip manip;\ - public: \ - NAME##_equal_list (const NAME *o, cchar *d, cchar *c, Manip m) \ - : obj(o), delem(d), comp(c), manip(m) {}\ - };\ - template \ - class NAME##_cus_value_list {\ - /* friend std::ostream& operator << <> (std::ostream&, \ - const NAME##_cus_value_list&); */\ - public:\ - const NAME *obj;\ - std::vector *include;\ - bool del_vector;\ - cchar *delem;\ - Manip manip;\ - public: \ - ~NAME##_cus_value_list () {if (del_vector) delete include;} \ - NAME##_cus_value_list (const NAME *o, cchar *d, Manip m, bool i1, bool i2, bool i3, bool i4, bool i5, bool i6, bool i7, bool i8, bool i9, bool i10, bool i11, bool i12, bool i13, bool i14, bool i15, bool i16, bool i17, bool i18, bool i19, bool i20, bool i21, bool i22, bool i23);\ - NAME##_cus_value_list (const NAME *o, cchar *d, Manip m, NAME##_enum i1, NAME##_enum i2, NAME##_enum i3, NAME##_enum i4, NAME##_enum i5, NAME##_enum i6, NAME##_enum i7, NAME##_enum i8, NAME##_enum i9, NAME##_enum i10, NAME##_enum i11, NAME##_enum i12, NAME##_enum i13, NAME##_enum i14, NAME##_enum i15, NAME##_enum i16, NAME##_enum i17, NAME##_enum i18, NAME##_enum i19, NAME##_enum i20, NAME##_enum i21, NAME##_enum i22, NAME##_enum i23); \ - NAME##_cus_value_list (const NAME *o, cchar *d, Manip m ,std::vector* i)\ - : obj(o), include(i), del_vector(false), delem(d), manip(m) {}\ - };\ - template \ - class NAME##_cus_field_list { \ - /* friend std::ostream& operator << <> (std::ostream&, \ - const NAME##_cus_field_list&); */\ - public:\ - const NAME *obj; \ - std::vector *include; \ - bool del_vector; \ - cchar *delem;\ - Manip manip;\ - public: \ - ~NAME##_cus_field_list () {if (del_vector) delete include;} \ - NAME##_cus_field_list (const NAME *o, cchar *d, Manip m, bool i1, bool i2, bool i3, bool i4, bool i5, bool i6, bool i7, bool i8, bool i9, bool i10, bool i11, bool i12, bool i13, bool i14, bool i15, bool i16, bool i17, bool i18, bool i19, bool i20, bool i21, bool i22, bool i23); \ - NAME##_cus_field_list (const NAME *o, cchar *d, Manip m, NAME##_enum i1, NAME##_enum i2, NAME##_enum i3, NAME##_enum i4, NAME##_enum i5, NAME##_enum i6, NAME##_enum i7, NAME##_enum i8, NAME##_enum i9, NAME##_enum i10, NAME##_enum i11, NAME##_enum i12, NAME##_enum i13, NAME##_enum i14, NAME##_enum i15, NAME##_enum i16, NAME##_enum i17, NAME##_enum i18, NAME##_enum i19, NAME##_enum i20, NAME##_enum i21, NAME##_enum i22, NAME##_enum i23); \ - NAME##_cus_field_list (const NAME *o, cchar *d, Manip m, std::vector *i) \ - : obj(o), include(i), del_vector(false), delem(d), manip(m) {}\ - };\ - template \ - class NAME##_cus_equal_list {\ - /* friend std::ostream& operator << <> (std::ostream&, \ - const NAME##_cus_equal_list&); */\ - public:\ - const NAME *obj;\ - std::vector *include;\ - bool del_vector;\ - cchar *delem;\ - cchar *comp;\ - Manip manip;\ - public:\ - ~NAME##_##cus_equal_list () {if (del_vector) delete include;}\ - NAME##_##cus_equal_list (const NAME *o, cchar *d, cchar *c, Manip m, bool i1, bool i2, bool i3, bool i4, bool i5, bool i6, bool i7, bool i8, bool i9, bool i10, bool i11, bool i12, bool i13, bool i14, bool i15, bool i16, bool i17, bool i18, bool i19, bool i20, bool i21, bool i22, bool i23); \ - NAME##_##cus_equal_list (const NAME *o, cchar *d, cchar *c, Manip m, NAME##_enum i1, NAME##_enum i2, NAME##_enum i3, NAME##_enum i4, NAME##_enum i5, NAME##_enum i6, NAME##_enum i7, NAME##_enum i8, NAME##_enum i9, NAME##_enum i10, NAME##_enum i11, NAME##_enum i12, NAME##_enum i13, NAME##_enum i14, NAME##_enum i15, NAME##_enum i16, NAME##_enum i17, NAME##_enum i18, NAME##_enum i19, NAME##_enum i20, NAME##_enum i21, NAME##_enum i22, NAME##_enum i23); \ - NAME##_##cus_equal_list (const NAME *o, cchar *d, cchar *c, Manip m, std::vector *i) \ - : obj(o), include(i), del_vector(false), delem(d), comp(c), manip(m) {}\ - };\ - template int sql_compare_##NAME (const NAME &, const NAME &);\ - struct NAME { \ - T1 I1;\ - T2 I2;\ - T3 I3;\ - T4 I4;\ - T5 I5;\ - T6 I6;\ - T7 I7;\ - T8 I8;\ - T9 I9;\ - T10 I10;\ - T11 I11;\ - T12 I12;\ - T13 I13;\ - T14 I14;\ - T15 I15;\ - T16 I16;\ - T17 I17;\ - T18 I18;\ - T19 I19;\ - T20 I20;\ - T21 I21;\ - T22 I22;\ - T23 I23; \ - NAME () {} \ - NAME (const Row &row);\ - void set (const Row &row);\ - sql_compare_define_##CMP(NAME, T1, I1, T2, I2, T3, I3, T4, I4, T5, I5, T6, I6, T7, I7, T8, I8, T9, I9, T10, I10, T11, I11, T12, I12, T13, I13, T14, I14, T15, I15, T16, I16, T17, I17, T18, I18, T19, I19, T20, I20, T21, I21, T22, I22, T23, I23, 0, 0, 0, 0)\ - sql_construct_define_##CONTR(NAME, T1, I1, T2, I2, T3, I3, T4, I4, T5, I5, T6, I6, T7, I7, T8, I8, T9, I9, T10, I10, T11, I11, T12, I12, T13, I13, T14, I14, T15, I15, T16, I16, T17, I17, T18, I18, T19, I19, T20, I20, T21, I21, T22, I22, T23, I23, 0, 0, 0, 0)\ - static const char *names[];\ - static const char *_table;\ - static const char *& table() {return _table;}\ - NAME##_value_list value_list() const {\ - return value_list(",", quote);}\ - NAME##_value_list value_list(cchar *d) const {\ - return value_list(d, quote);}\ - template \ - NAME##_value_list value_list(cchar *d, Manip m) const; \ - NAME##_field_list field_list() const {\ - return field_list(",", do_nothing);}\ - NAME##_field_list field_list(cchar *d) const {\ - return field_list(d, do_nothing);}\ - template \ - NAME##_field_list field_list(cchar *d, Manip m) const; \ - NAME##_equal_list equal_list(cchar *d = ",", \ - cchar *c = " = ") const{\ - return equal_list(d, c, quote);}\ - template \ - NAME##_equal_list equal_list(cchar *d, cchar *c, Manip m) const; \ - /* cus_data */\ - NAME##_cus_value_list value_list(bool i1, bool i2 = false, bool i3 = false, bool i4 = false, bool i5 = false, bool i6 = false, bool i7 = false, bool i8 = false, bool i9 = false, bool i10 = false, bool i11 = false, bool i12 = false, bool i13 = false, bool i14 = false, bool i15 = false, bool i16 = false, bool i17 = false, bool i18 = false, bool i19 = false, bool i20 = false, bool i21 = false, bool i22 = false, bool i23 = false) const {\ - return value_list(",", quote, i1, i2, i3, i4, i5, i6, i7, i8, i9, i10, i11, i12, i13, i14, i15, i16, i17, i18, i19, i20, i21, i22, i23);\ - }\ - NAME##_cus_value_list value_list(NAME##_enum i1, NAME##_enum i2 = NAME##_NULL, NAME##_enum i3 = NAME##_NULL, NAME##_enum i4 = NAME##_NULL, NAME##_enum i5 = NAME##_NULL, NAME##_enum i6 = NAME##_NULL, NAME##_enum i7 = NAME##_NULL, NAME##_enum i8 = NAME##_NULL, NAME##_enum i9 = NAME##_NULL, NAME##_enum i10 = NAME##_NULL, NAME##_enum i11 = NAME##_NULL, NAME##_enum i12 = NAME##_NULL, NAME##_enum i13 = NAME##_NULL, NAME##_enum i14 = NAME##_NULL, NAME##_enum i15 = NAME##_NULL, NAME##_enum i16 = NAME##_NULL, NAME##_enum i17 = NAME##_NULL, NAME##_enum i18 = NAME##_NULL, NAME##_enum i19 = NAME##_NULL, NAME##_enum i20 = NAME##_NULL, NAME##_enum i21 = NAME##_NULL, NAME##_enum i22 = NAME##_NULL, NAME##_enum i23 = NAME##_NULL) const {\ - return value_list(",", quote, i1, i2, i3, i4, i5, i6, i7, i8, i9, i10, i11, i12, i13, i14, i15, i16, i17, i18, i19, i20, i21, i22, i23);\ - }\ - NAME##_cus_value_list value_list(std::vector *i) const {\ - return value_list(",", quote, i);\ - }\ - NAME##_cus_value_list value_list(sql_cmp_type sc) const {\ - return value_list(",", quote, sc);\ - }\ - NAME##_cus_value_list value_list(cchar *d, bool i1, bool i2 = false, bool i3 = false, bool i4 = false, bool i5 = false, bool i6 = false, bool i7 = false, bool i8 = false, bool i9 = false, bool i10 = false, bool i11 = false, bool i12 = false, bool i13 = false, bool i14 = false, bool i15 = false, bool i16 = false, bool i17 = false, bool i18 = false, bool i19 = false, bool i20 = false, bool i21 = false, bool i22 = false, bool i23 = false) const {\ - return value_list(d, quote, i1, i2, i3, i4, i5, i6, i7, i8, i9, i10, i11, i12, i13, i14, i15, i16, i17, i18, i19, i20, i21, i22, i23);\ - }\ - NAME##_cus_value_list value_list(cchar *d, NAME##_enum i1, NAME##_enum i2 = NAME##_NULL, NAME##_enum i3 = NAME##_NULL, NAME##_enum i4 = NAME##_NULL, NAME##_enum i5 = NAME##_NULL, NAME##_enum i6 = NAME##_NULL, NAME##_enum i7 = NAME##_NULL, NAME##_enum i8 = NAME##_NULL, NAME##_enum i9 = NAME##_NULL, NAME##_enum i10 = NAME##_NULL, NAME##_enum i11 = NAME##_NULL, NAME##_enum i12 = NAME##_NULL, NAME##_enum i13 = NAME##_NULL, NAME##_enum i14 = NAME##_NULL, NAME##_enum i15 = NAME##_NULL, NAME##_enum i16 = NAME##_NULL, NAME##_enum i17 = NAME##_NULL, NAME##_enum i18 = NAME##_NULL, NAME##_enum i19 = NAME##_NULL, NAME##_enum i20 = NAME##_NULL, NAME##_enum i21 = NAME##_NULL, NAME##_enum i22 = NAME##_NULL, NAME##_enum i23 = NAME##_NULL) const {\ - return value_list(d, quote, i1, i2, i3, i4, i5, i6, i7, i8, i9, i10, i11, i12, i13, i14, i15, i16, i17, i18, i19, i20, i21, i22, i23);\ - }\ - NAME##_cus_value_list value_list(cchar *d, \ - std::vector *i) const {\ - return value_list(d, quote, i);\ - }\ - NAME##_cus_value_list value_list(cchar *d, \ - sql_cmp_type sc) const {\ - return value_list(d, quote, sc);\ - }\ - template \ - NAME##_cus_value_list value_list(cchar *d, Manip m,\ - bool i1, bool i2 = false, bool i3 = false, bool i4 = false, bool i5 = false, bool i6 = false, bool i7 = false, bool i8 = false, bool i9 = false, bool i10 = false, bool i11 = false, bool i12 = false, bool i13 = false, bool i14 = false, bool i15 = false, bool i16 = false, bool i17 = false, bool i18 = false, bool i19 = false, bool i20 = false, bool i21 = false, bool i22 = false, bool i23 = false) const; \ - template \ - NAME##_cus_value_list value_list(cchar *d, Manip m,\ - NAME##_enum i1, NAME##_enum i2 = NAME##_NULL, NAME##_enum i3 = NAME##_NULL, NAME##_enum i4 = NAME##_NULL, NAME##_enum i5 = NAME##_NULL, NAME##_enum i6 = NAME##_NULL, NAME##_enum i7 = NAME##_NULL, NAME##_enum i8 = NAME##_NULL, NAME##_enum i9 = NAME##_NULL, NAME##_enum i10 = NAME##_NULL, NAME##_enum i11 = NAME##_NULL, NAME##_enum i12 = NAME##_NULL, NAME##_enum i13 = NAME##_NULL, NAME##_enum i14 = NAME##_NULL, NAME##_enum i15 = NAME##_NULL, NAME##_enum i16 = NAME##_NULL, NAME##_enum i17 = NAME##_NULL, NAME##_enum i18 = NAME##_NULL, NAME##_enum i19 = NAME##_NULL, NAME##_enum i20 = NAME##_NULL, NAME##_enum i21 = NAME##_NULL, NAME##_enum i22 = NAME##_NULL, NAME##_enum i23 = NAME##_NULL) const; \ - template \ - NAME##_cus_value_list value_list(cchar *d, Manip m, \ - std::vector *i) const;\ - template \ - NAME##_cus_value_list value_list(cchar *d, Manip m, \ - sql_cmp_type sc) const;\ - /* cus field */\ - NAME##_cus_field_list field_list(bool i1, bool i2 = false, bool i3 = false, bool i4 = false, bool i5 = false, bool i6 = false, bool i7 = false, bool i8 = false, bool i9 = false, bool i10 = false, bool i11 = false, bool i12 = false, bool i13 = false, bool i14 = false, bool i15 = false, bool i16 = false, bool i17 = false, bool i18 = false, bool i19 = false, bool i20 = false, bool i21 = false, bool i22 = false, bool i23 = false) const {\ - return field_list(",", do_nothing, i1, i2, i3, i4, i5, i6, i7, i8, i9, i10, i11, i12, i13, i14, i15, i16, i17, i18, i19, i20, i21, i22, i23);\ - }\ - NAME##_cus_field_list field_list(NAME##_enum i1, NAME##_enum i2 = NAME##_NULL, NAME##_enum i3 = NAME##_NULL, NAME##_enum i4 = NAME##_NULL, NAME##_enum i5 = NAME##_NULL, NAME##_enum i6 = NAME##_NULL, NAME##_enum i7 = NAME##_NULL, NAME##_enum i8 = NAME##_NULL, NAME##_enum i9 = NAME##_NULL, NAME##_enum i10 = NAME##_NULL, NAME##_enum i11 = NAME##_NULL, NAME##_enum i12 = NAME##_NULL, NAME##_enum i13 = NAME##_NULL, NAME##_enum i14 = NAME##_NULL, NAME##_enum i15 = NAME##_NULL, NAME##_enum i16 = NAME##_NULL, NAME##_enum i17 = NAME##_NULL, NAME##_enum i18 = NAME##_NULL, NAME##_enum i19 = NAME##_NULL, NAME##_enum i20 = NAME##_NULL, NAME##_enum i21 = NAME##_NULL, NAME##_enum i22 = NAME##_NULL, NAME##_enum i23 = NAME##_NULL) const {\ - return field_list(",", do_nothing, i1, i2, i3, i4, i5, i6, i7, i8, i9, i10, i11, i12, i13, i14, i15, i16, i17, i18, i19, i20, i21, i22, i23);\ - }\ - NAME##_cus_field_list field_list(std::vector *i) const {\ - return field_list(",", do_nothing, i);\ - }\ - NAME##_cus_field_list field_list(sql_cmp_type sc) const\ - {\ - return field_list(",", do_nothing, sc);\ - }\ - NAME##_cus_field_list field_list(cchar *d, \ - bool i1, bool i2 = false, bool i3 = false, bool i4 = false, bool i5 = false, bool i6 = false, bool i7 = false, bool i8 = false, bool i9 = false, bool i10 = false, bool i11 = false, bool i12 = false, bool i13 = false, bool i14 = false, bool i15 = false, bool i16 = false, bool i17 = false, bool i18 = false, bool i19 = false, bool i20 = false, bool i21 = false, bool i22 = false, bool i23 = false) const {\ - return field_list(d, do_nothing, i1, i2, i3, i4, i5, i6, i7, i8, i9, i10, i11, i12, i13, i14, i15, i16, i17, i18, i19, i20, i21, i22, i23);\ - }\ - NAME##_cus_field_list field_list(cchar *d,\ - NAME##_enum i1, NAME##_enum i2 = NAME##_NULL, NAME##_enum i3 = NAME##_NULL, NAME##_enum i4 = NAME##_NULL, NAME##_enum i5 = NAME##_NULL, NAME##_enum i6 = NAME##_NULL, NAME##_enum i7 = NAME##_NULL, NAME##_enum i8 = NAME##_NULL, NAME##_enum i9 = NAME##_NULL, NAME##_enum i10 = NAME##_NULL, NAME##_enum i11 = NAME##_NULL, NAME##_enum i12 = NAME##_NULL, NAME##_enum i13 = NAME##_NULL, NAME##_enum i14 = NAME##_NULL, NAME##_enum i15 = NAME##_NULL, NAME##_enum i16 = NAME##_NULL, NAME##_enum i17 = NAME##_NULL, NAME##_enum i18 = NAME##_NULL, NAME##_enum i19 = NAME##_NULL, NAME##_enum i20 = NAME##_NULL, NAME##_enum i21 = NAME##_NULL, NAME##_enum i22 = NAME##_NULL, NAME##_enum i23 = NAME##_NULL) const {\ - return field_list(d, do_nothing, i1, i2, i3, i4, i5, i6, i7, i8, i9, i10, i11, i12, i13, i14, i15, i16, i17, i18, i19, i20, i21, i22, i23);\ - }\ - NAME##_cus_field_list field_list(cchar *d, \ - std::vector *i) const {\ - return field_list(d, do_nothing, i);\ - }\ - NAME##_cus_field_list field_list(cchar *d, \ - sql_cmp_type sc) const {\ - return field_list(d, do_nothing, sc);\ - }\ - template \ - NAME##_cus_field_list field_list(cchar *d, Manip m,\ - bool i1, bool i2 = false, bool i3 = false, bool i4 = false, bool i5 = false, bool i6 = false, bool i7 = false, bool i8 = false, bool i9 = false, bool i10 = false, bool i11 = false, bool i12 = false, bool i13 = false, bool i14 = false, bool i15 = false, bool i16 = false, bool i17 = false, bool i18 = false, bool i19 = false, bool i20 = false, bool i21 = false, bool i22 = false, bool i23 = false) const; \ - template \ - NAME##_cus_field_list field_list(cchar *d, Manip m,\ - NAME##_enum i1, NAME##_enum i2 = NAME##_NULL, NAME##_enum i3 = NAME##_NULL, NAME##_enum i4 = NAME##_NULL, NAME##_enum i5 = NAME##_NULL, NAME##_enum i6 = NAME##_NULL, NAME##_enum i7 = NAME##_NULL, NAME##_enum i8 = NAME##_NULL, NAME##_enum i9 = NAME##_NULL, NAME##_enum i10 = NAME##_NULL, NAME##_enum i11 = NAME##_NULL, NAME##_enum i12 = NAME##_NULL, NAME##_enum i13 = NAME##_NULL, NAME##_enum i14 = NAME##_NULL, NAME##_enum i15 = NAME##_NULL, NAME##_enum i16 = NAME##_NULL, NAME##_enum i17 = NAME##_NULL, NAME##_enum i18 = NAME##_NULL, NAME##_enum i19 = NAME##_NULL, NAME##_enum i20 = NAME##_NULL, NAME##_enum i21 = NAME##_NULL, NAME##_enum i22 = NAME##_NULL, NAME##_enum i23 = NAME##_NULL) const; \ - template \ - NAME##_cus_field_list field_list(cchar *d, Manip m,\ - std::vector *i) const;\ - template \ - NAME##_cus_field_list field_list(cchar *d, Manip m, \ - sql_cmp_type sc) const;\ - /* cus equal */\ - NAME##_cus_equal_list equal_list(bool i1, bool i2 = false, bool i3 = false, bool i4 = false, bool i5 = false, bool i6 = false, bool i7 = false, bool i8 = false, bool i9 = false, bool i10 = false, bool i11 = false, bool i12 = false, bool i13 = false, bool i14 = false, bool i15 = false, bool i16 = false, bool i17 = false, bool i18 = false, bool i19 = false, bool i20 = false, bool i21 = false, bool i22 = false, bool i23 = false) const {\ - return equal_list(",", " = ", quote, i1, i2, i3, i4, i5, i6, i7, i8, i9, i10, i11, i12, i13, i14, i15, i16, i17, i18, i19, i20, i21, i22, i23);\ - }\ - NAME##_cus_equal_list equal_list(NAME##_enum i1, NAME##_enum i2 = NAME##_NULL, NAME##_enum i3 = NAME##_NULL, NAME##_enum i4 = NAME##_NULL, NAME##_enum i5 = NAME##_NULL, NAME##_enum i6 = NAME##_NULL, NAME##_enum i7 = NAME##_NULL, NAME##_enum i8 = NAME##_NULL, NAME##_enum i9 = NAME##_NULL, NAME##_enum i10 = NAME##_NULL, NAME##_enum i11 = NAME##_NULL, NAME##_enum i12 = NAME##_NULL, NAME##_enum i13 = NAME##_NULL, NAME##_enum i14 = NAME##_NULL, NAME##_enum i15 = NAME##_NULL, NAME##_enum i16 = NAME##_NULL, NAME##_enum i17 = NAME##_NULL, NAME##_enum i18 = NAME##_NULL, NAME##_enum i19 = NAME##_NULL, NAME##_enum i20 = NAME##_NULL, NAME##_enum i21 = NAME##_NULL, NAME##_enum i22 = NAME##_NULL, NAME##_enum i23 = NAME##_NULL) const {\ - return equal_list(",", " = ", quote, i1, i2, i3, i4, i5, i6, i7, i8, i9, i10, i11, i12, i13, i14, i15, i16, i17, i18, i19, i20, i21, i22, i23);\ - }\ - NAME##_cus_equal_list equal_list(std::vector *i) const {\ - return equal_list(",", " = ", quote, i);\ - }\ - NAME##_cus_equal_list equal_list(sql_cmp_type sc) const {\ - return equal_list(",", " = ", quote, sc);\ - }\ - NAME##_cus_equal_list equal_list(cchar *d, bool i1, bool i2 = false, bool i3 = false, bool i4 = false, bool i5 = false, bool i6 = false, bool i7 = false, bool i8 = false, bool i9 = false, bool i10 = false, bool i11 = false, bool i12 = false, bool i13 = false, bool i14 = false, bool i15 = false, bool i16 = false, bool i17 = false, bool i18 = false, bool i19 = false, bool i20 = false, bool i21 = false, bool i22 = false, bool i23 = false) const {\ - return equal_list(d, " = ", quote, i1, i2, i3, i4, i5, i6, i7, i8, i9, i10, i11, i12, i13, i14, i15, i16, i17, i18, i19, i20, i21, i22, i23);\ - }\ - NAME##_cus_equal_list equal_list(cchar *d, NAME##_enum i1, NAME##_enum i2 = NAME##_NULL, NAME##_enum i3 = NAME##_NULL, NAME##_enum i4 = NAME##_NULL, NAME##_enum i5 = NAME##_NULL, NAME##_enum i6 = NAME##_NULL, NAME##_enum i7 = NAME##_NULL, NAME##_enum i8 = NAME##_NULL, NAME##_enum i9 = NAME##_NULL, NAME##_enum i10 = NAME##_NULL, NAME##_enum i11 = NAME##_NULL, NAME##_enum i12 = NAME##_NULL, NAME##_enum i13 = NAME##_NULL, NAME##_enum i14 = NAME##_NULL, NAME##_enum i15 = NAME##_NULL, NAME##_enum i16 = NAME##_NULL, NAME##_enum i17 = NAME##_NULL, NAME##_enum i18 = NAME##_NULL, NAME##_enum i19 = NAME##_NULL, NAME##_enum i20 = NAME##_NULL, NAME##_enum i21 = NAME##_NULL, NAME##_enum i22 = NAME##_NULL, NAME##_enum i23 = NAME##_NULL) const {\ - return equal_list(d, " = ", quote, i1, i2, i3, i4, i5, i6, i7, i8, i9, i10, i11, i12, i13, i14, i15, i16, i17, i18, i19, i20, i21, i22, i23);\ - }\ - NAME##_cus_equal_list equal_list(cchar *d, \ - std::vector *i) const {\ - return equal_list(d, " = ", quote, i);\ - }\ - NAME##_cus_equal_list equal_list(cchar *d, \ - sql_cmp_type sc) const {\ - return equal_list(d, " = ", quote, sc);\ - }\ - NAME##_cus_equal_list equal_list(cchar *d, cchar *c,\ - bool i1, bool i2 = false, bool i3 = false, bool i4 = false, bool i5 = false, bool i6 = false, bool i7 = false, bool i8 = false, bool i9 = false, bool i10 = false, bool i11 = false, bool i12 = false, bool i13 = false, bool i14 = false, bool i15 = false, bool i16 = false, bool i17 = false, bool i18 = false, bool i19 = false, bool i20 = false, bool i21 = false, bool i22 = false, bool i23 = false) const {\ - return equal_list(d, c, quote, i1, i2, i3, i4, i5, i6, i7, i8, i9, i10, i11, i12, i13, i14, i15, i16, i17, i18, i19, i20, i21, i22, i23);\ - }\ - NAME##_cus_equal_list equal_list(cchar *d, cchar *c,\ - NAME##_enum i1, NAME##_enum i2 = NAME##_NULL, NAME##_enum i3 = NAME##_NULL, NAME##_enum i4 = NAME##_NULL, NAME##_enum i5 = NAME##_NULL, NAME##_enum i6 = NAME##_NULL, NAME##_enum i7 = NAME##_NULL, NAME##_enum i8 = NAME##_NULL, NAME##_enum i9 = NAME##_NULL, NAME##_enum i10 = NAME##_NULL, NAME##_enum i11 = NAME##_NULL, NAME##_enum i12 = NAME##_NULL, NAME##_enum i13 = NAME##_NULL, NAME##_enum i14 = NAME##_NULL, NAME##_enum i15 = NAME##_NULL, NAME##_enum i16 = NAME##_NULL, NAME##_enum i17 = NAME##_NULL, NAME##_enum i18 = NAME##_NULL, NAME##_enum i19 = NAME##_NULL, NAME##_enum i20 = NAME##_NULL, NAME##_enum i21 = NAME##_NULL, NAME##_enum i22 = NAME##_NULL, NAME##_enum i23 = NAME##_NULL) const {\ - return equal_list(d, c, quote, i1, i2, i3, i4, i5, i6, i7, i8, i9, i10, i11, i12, i13, i14, i15, i16, i17, i18, i19, i20, i21, i22, i23);\ - }\ - NAME##_cus_equal_list equal_list(cchar *d, cchar *c,\ - std::vector *i) const {\ - return equal_list(d, c, quote, i);\ - }\ - NAME##_cus_equal_list equal_list(cchar *d, cchar *c,\ - sql_cmp_type sc) const {\ - return equal_list(d, c, quote, sc);\ - }\ - template \ - NAME##_cus_equal_list equal_list(cchar *d, cchar *c, Manip m, \ - bool i1, bool i2 = false, bool i3 = false, bool i4 = false, bool i5 = false, bool i6 = false, bool i7 = false, bool i8 = false, bool i9 = false, bool i10 = false, bool i11 = false, bool i12 = false, bool i13 = false, bool i14 = false, bool i15 = false, bool i16 = false, bool i17 = false, bool i18 = false, bool i19 = false, bool i20 = false, bool i21 = false, bool i22 = false, bool i23 = false) const; \ - template \ - NAME##_cus_equal_list equal_list(cchar *d, cchar *c, Manip m, \ - NAME##_enum i1, NAME##_enum i2 = NAME##_NULL, NAME##_enum i3 = NAME##_NULL, NAME##_enum i4 = NAME##_NULL, NAME##_enum i5 = NAME##_NULL, NAME##_enum i6 = NAME##_NULL, NAME##_enum i7 = NAME##_NULL, NAME##_enum i8 = NAME##_NULL, NAME##_enum i9 = NAME##_NULL, NAME##_enum i10 = NAME##_NULL, NAME##_enum i11 = NAME##_NULL, NAME##_enum i12 = NAME##_NULL, NAME##_enum i13 = NAME##_NULL, NAME##_enum i14 = NAME##_NULL, NAME##_enum i15 = NAME##_NULL, NAME##_enum i16 = NAME##_NULL, NAME##_enum i17 = NAME##_NULL, NAME##_enum i18 = NAME##_NULL, NAME##_enum i19 = NAME##_NULL, NAME##_enum i20 = NAME##_NULL, NAME##_enum i21 = NAME##_NULL, NAME##_enum i22 = NAME##_NULL, NAME##_enum i23 = NAME##_NULL) const; \ - template \ - NAME##_cus_equal_list equal_list(cchar *d, cchar *c, Manip m, \ - std::vector *i) const;\ - template \ - NAME##_cus_equal_list equal_list(cchar *d, cchar *c, Manip m, \ - sql_cmp_type sc) const;\ - }; \ - const char *NAME::names[] = { \ - N1 ,\ - N2 ,\ - N3 ,\ - N4 ,\ - N5 ,\ - N6 ,\ - N7 ,\ - N8 ,\ - N9 ,\ - N10 ,\ - N11 ,\ - N12 ,\ - N13 ,\ - N14 ,\ - N15 ,\ - N16 ,\ - N17 ,\ - N18 ,\ - N19 ,\ - N20 ,\ - N21 ,\ - N22 ,\ - N23 \ - }; \ - const char *NAME::_table = #NAME ; \ - template \ - NAME##_cus_value_list::NAME##_cus_value_list\ - (const NAME *o, cchar *d, Manip m, bool i1, bool i2, bool i3, bool i4, bool i5, bool i6, bool i7, bool i8, bool i9, bool i10, bool i11, bool i12, bool i13, bool i14, bool i15, bool i16, bool i17, bool i18, bool i19, bool i20, bool i21, bool i22, bool i23) \ - { \ - delem = d;\ - manip = m;\ - del_vector = true;\ - obj = o; \ - include = new std::vector(23, false);\ - if (i1) (*include)[0]=true;\ - if (i2) (*include)[1]=true;\ - if (i3) (*include)[2]=true;\ - if (i4) (*include)[3]=true;\ - if (i5) (*include)[4]=true;\ - if (i6) (*include)[5]=true;\ - if (i7) (*include)[6]=true;\ - if (i8) (*include)[7]=true;\ - if (i9) (*include)[8]=true;\ - if (i10) (*include)[9]=true;\ - if (i11) (*include)[10]=true;\ - if (i12) (*include)[11]=true;\ - if (i13) (*include)[12]=true;\ - if (i14) (*include)[13]=true;\ - if (i15) (*include)[14]=true;\ - if (i16) (*include)[15]=true;\ - if (i17) (*include)[16]=true;\ - if (i18) (*include)[17]=true;\ - if (i19) (*include)[18]=true;\ - if (i20) (*include)[19]=true;\ - if (i21) (*include)[20]=true;\ - if (i22) (*include)[21]=true;\ - if (i23) (*include)[22]=true;\ - } \ - template \ - NAME##_cus_value_list::NAME##_cus_value_list\ - (const NAME *o, cchar *d, Manip m, NAME##_enum i1, NAME##_enum i2, NAME##_enum i3, NAME##_enum i4, NAME##_enum i5, NAME##_enum i6, NAME##_enum i7, NAME##_enum i8, NAME##_enum i9, NAME##_enum i10, NAME##_enum i11, NAME##_enum i12, NAME##_enum i13, NAME##_enum i14, NAME##_enum i15, NAME##_enum i16, NAME##_enum i17, NAME##_enum i18, NAME##_enum i19, NAME##_enum i20, NAME##_enum i21, NAME##_enum i22, NAME##_enum i23) { \ - delem = d;\ - manip = m;\ - del_vector = true; \ - obj = o; \ - include = new std::vector(23, false); \ - if (i1 == NAME##_NULL) return;\ - (*include)[i1]=true;\ - if (i2 == NAME##_NULL) return;\ - (*include)[i2]=true;\ - if (i3 == NAME##_NULL) return;\ - (*include)[i3]=true;\ - if (i4 == NAME##_NULL) return;\ - (*include)[i4]=true;\ - if (i5 == NAME##_NULL) return;\ - (*include)[i5]=true;\ - if (i6 == NAME##_NULL) return;\ - (*include)[i6]=true;\ - if (i7 == NAME##_NULL) return;\ - (*include)[i7]=true;\ - if (i8 == NAME##_NULL) return;\ - (*include)[i8]=true;\ - if (i9 == NAME##_NULL) return;\ - (*include)[i9]=true;\ - if (i10 == NAME##_NULL) return;\ - (*include)[i10]=true;\ - if (i11 == NAME##_NULL) return;\ - (*include)[i11]=true;\ - if (i12 == NAME##_NULL) return;\ - (*include)[i12]=true;\ - if (i13 == NAME##_NULL) return;\ - (*include)[i13]=true;\ - if (i14 == NAME##_NULL) return;\ - (*include)[i14]=true;\ - if (i15 == NAME##_NULL) return;\ - (*include)[i15]=true;\ - if (i16 == NAME##_NULL) return;\ - (*include)[i16]=true;\ - if (i17 == NAME##_NULL) return;\ - (*include)[i17]=true;\ - if (i18 == NAME##_NULL) return;\ - (*include)[i18]=true;\ - if (i19 == NAME##_NULL) return;\ - (*include)[i19]=true;\ - if (i20 == NAME##_NULL) return;\ - (*include)[i20]=true;\ - if (i21 == NAME##_NULL) return;\ - (*include)[i21]=true;\ - if (i22 == NAME##_NULL) return;\ - (*include)[i22]=true;\ - if (i23 == NAME##_NULL) return;\ - (*include)[i23]=true;\ - }\ - template \ - NAME##_cus_field_list::NAME##_cus_field_list\ - (const NAME *o, cchar *d, Manip m, bool i1, bool i2, bool i3, bool i4, bool i5, bool i6, bool i7, bool i8, bool i9, bool i10, bool i11, bool i12, bool i13, bool i14, bool i15, bool i16, bool i17, bool i18, bool i19, bool i20, bool i21, bool i22, bool i23) {\ - delem = d;\ - manip = m;\ - del_vector = true; \ - obj = o; \ - include = new std::vector(23, false); \ - if (i1) (*include)[0]=true;\ - if (i2) (*include)[1]=true;\ - if (i3) (*include)[2]=true;\ - if (i4) (*include)[3]=true;\ - if (i5) (*include)[4]=true;\ - if (i6) (*include)[5]=true;\ - if (i7) (*include)[6]=true;\ - if (i8) (*include)[7]=true;\ - if (i9) (*include)[8]=true;\ - if (i10) (*include)[9]=true;\ - if (i11) (*include)[10]=true;\ - if (i12) (*include)[11]=true;\ - if (i13) (*include)[12]=true;\ - if (i14) (*include)[13]=true;\ - if (i15) (*include)[14]=true;\ - if (i16) (*include)[15]=true;\ - if (i17) (*include)[16]=true;\ - if (i18) (*include)[17]=true;\ - if (i19) (*include)[18]=true;\ - if (i20) (*include)[19]=true;\ - if (i21) (*include)[20]=true;\ - if (i22) (*include)[21]=true;\ - if (i23) (*include)[22]=true;\ - } \ - template \ - NAME##_cus_field_list::NAME##_cus_field_list\ - (const NAME *o, cchar *d, Manip m, NAME##_enum i1, NAME##_enum i2, NAME##_enum i3, NAME##_enum i4, NAME##_enum i5, NAME##_enum i6, NAME##_enum i7, NAME##_enum i8, NAME##_enum i9, NAME##_enum i10, NAME##_enum i11, NAME##_enum i12, NAME##_enum i13, NAME##_enum i14, NAME##_enum i15, NAME##_enum i16, NAME##_enum i17, NAME##_enum i18, NAME##_enum i19, NAME##_enum i20, NAME##_enum i21, NAME##_enum i22, NAME##_enum i23) { \ - delem = d;\ - manip = m;\ - del_vector = true; \ - obj = o; \ - include = new std::vector(23, false); \ - if (i1 == NAME##_NULL) return;\ - (*include)[i1]=true;\ - if (i2 == NAME##_NULL) return;\ - (*include)[i2]=true;\ - if (i3 == NAME##_NULL) return;\ - (*include)[i3]=true;\ - if (i4 == NAME##_NULL) return;\ - (*include)[i4]=true;\ - if (i5 == NAME##_NULL) return;\ - (*include)[i5]=true;\ - if (i6 == NAME##_NULL) return;\ - (*include)[i6]=true;\ - if (i7 == NAME##_NULL) return;\ - (*include)[i7]=true;\ - if (i8 == NAME##_NULL) return;\ - (*include)[i8]=true;\ - if (i9 == NAME##_NULL) return;\ - (*include)[i9]=true;\ - if (i10 == NAME##_NULL) return;\ - (*include)[i10]=true;\ - if (i11 == NAME##_NULL) return;\ - (*include)[i11]=true;\ - if (i12 == NAME##_NULL) return;\ - (*include)[i12]=true;\ - if (i13 == NAME##_NULL) return;\ - (*include)[i13]=true;\ - if (i14 == NAME##_NULL) return;\ - (*include)[i14]=true;\ - if (i15 == NAME##_NULL) return;\ - (*include)[i15]=true;\ - if (i16 == NAME##_NULL) return;\ - (*include)[i16]=true;\ - if (i17 == NAME##_NULL) return;\ - (*include)[i17]=true;\ - if (i18 == NAME##_NULL) return;\ - (*include)[i18]=true;\ - if (i19 == NAME##_NULL) return;\ - (*include)[i19]=true;\ - if (i20 == NAME##_NULL) return;\ - (*include)[i20]=true;\ - if (i21 == NAME##_NULL) return;\ - (*include)[i21]=true;\ - if (i22 == NAME##_NULL) return;\ - (*include)[i22]=true;\ - if (i23 == NAME##_NULL) return;\ - (*include)[i23]=true;\ - }\ - template \ - NAME##_cus_equal_list::NAME##_cus_equal_list\ - (const NAME *o, cchar *d, cchar *c, Manip m, bool i1, bool i2, bool i3, bool i4, bool i5, bool i6, bool i7, bool i8, bool i9, bool i10, bool i11, bool i12, bool i13, bool i14, bool i15, bool i16, bool i17, bool i18, bool i19, bool i20, bool i21, bool i22, bool i23) { \ - delem = d;\ - comp = c;\ - manip = m;\ - del_vector = true; \ - obj = o; \ - include = new std::vector(23, false); \ - if (i1) (*include)[0]=true;\ - if (i2) (*include)[1]=true;\ - if (i3) (*include)[2]=true;\ - if (i4) (*include)[3]=true;\ - if (i5) (*include)[4]=true;\ - if (i6) (*include)[5]=true;\ - if (i7) (*include)[6]=true;\ - if (i8) (*include)[7]=true;\ - if (i9) (*include)[8]=true;\ - if (i10) (*include)[9]=true;\ - if (i11) (*include)[10]=true;\ - if (i12) (*include)[11]=true;\ - if (i13) (*include)[12]=true;\ - if (i14) (*include)[13]=true;\ - if (i15) (*include)[14]=true;\ - if (i16) (*include)[15]=true;\ - if (i17) (*include)[16]=true;\ - if (i18) (*include)[17]=true;\ - if (i19) (*include)[18]=true;\ - if (i20) (*include)[19]=true;\ - if (i21) (*include)[20]=true;\ - if (i22) (*include)[21]=true;\ - if (i23) (*include)[22]=true;\ - } \ - template \ - NAME##_cus_equal_list::NAME##_cus_equal_list\ - (const NAME *o, cchar *d, cchar *c, Manip m, NAME##_enum i1, NAME##_enum i2, NAME##_enum i3, NAME##_enum i4, NAME##_enum i5, NAME##_enum i6, NAME##_enum i7, NAME##_enum i8, NAME##_enum i9, NAME##_enum i10, NAME##_enum i11, NAME##_enum i12, NAME##_enum i13, NAME##_enum i14, NAME##_enum i15, NAME##_enum i16, NAME##_enum i17, NAME##_enum i18, NAME##_enum i19, NAME##_enum i20, NAME##_enum i21, NAME##_enum i22, NAME##_enum i23) { \ - delem = d;\ - comp = c;\ - manip = m;\ - del_vector = true; \ - obj = o; \ - include = new std::vector(23, false); \ - if (i1 == NAME##_NULL) return;\ - (*include)[i1]=true;\ - if (i2 == NAME##_NULL) return;\ - (*include)[i2]=true;\ - if (i3 == NAME##_NULL) return;\ - (*include)[i3]=true;\ - if (i4 == NAME##_NULL) return;\ - (*include)[i4]=true;\ - if (i5 == NAME##_NULL) return;\ - (*include)[i5]=true;\ - if (i6 == NAME##_NULL) return;\ - (*include)[i6]=true;\ - if (i7 == NAME##_NULL) return;\ - (*include)[i7]=true;\ - if (i8 == NAME##_NULL) return;\ - (*include)[i8]=true;\ - if (i9 == NAME##_NULL) return;\ - (*include)[i9]=true;\ - if (i10 == NAME##_NULL) return;\ - (*include)[i10]=true;\ - if (i11 == NAME##_NULL) return;\ - (*include)[i11]=true;\ - if (i12 == NAME##_NULL) return;\ - (*include)[i12]=true;\ - if (i13 == NAME##_NULL) return;\ - (*include)[i13]=true;\ - if (i14 == NAME##_NULL) return;\ - (*include)[i14]=true;\ - if (i15 == NAME##_NULL) return;\ - (*include)[i15]=true;\ - if (i16 == NAME##_NULL) return;\ - (*include)[i16]=true;\ - if (i17 == NAME##_NULL) return;\ - (*include)[i17]=true;\ - if (i18 == NAME##_NULL) return;\ - (*include)[i18]=true;\ - if (i19 == NAME##_NULL) return;\ - (*include)[i19]=true;\ - if (i20 == NAME##_NULL) return;\ - (*include)[i20]=true;\ - if (i21 == NAME##_NULL) return;\ - (*include)[i21]=true;\ - if (i22 == NAME##_NULL) return;\ - (*include)[i22]=true;\ - if (i23 == NAME##_NULL) return;\ - (*include)[i23]=true;\ - }\ - template \ - std::ostream& operator << (std::ostream& s, const NAME##_value_list& obj) { \ - s << obj.manip << obj.obj->I1 << obj.delem;\ - s << obj.manip << obj.obj->I2 << obj.delem;\ - s << obj.manip << obj.obj->I3 << obj.delem;\ - s << obj.manip << obj.obj->I4 << obj.delem;\ - s << obj.manip << obj.obj->I5 << obj.delem;\ - s << obj.manip << obj.obj->I6 << obj.delem;\ - s << obj.manip << obj.obj->I7 << obj.delem;\ - s << obj.manip << obj.obj->I8 << obj.delem;\ - s << obj.manip << obj.obj->I9 << obj.delem;\ - s << obj.manip << obj.obj->I10 << obj.delem;\ - s << obj.manip << obj.obj->I11 << obj.delem;\ - s << obj.manip << obj.obj->I12 << obj.delem;\ - s << obj.manip << obj.obj->I13 << obj.delem;\ - s << obj.manip << obj.obj->I14 << obj.delem;\ - s << obj.manip << obj.obj->I15 << obj.delem;\ - s << obj.manip << obj.obj->I16 << obj.delem;\ - s << obj.manip << obj.obj->I17 << obj.delem;\ - s << obj.manip << obj.obj->I18 << obj.delem;\ - s << obj.manip << obj.obj->I19 << obj.delem;\ - s << obj.manip << obj.obj->I20 << obj.delem;\ - s << obj.manip << obj.obj->I21 << obj.delem;\ - s << obj.manip << obj.obj->I22 << obj.delem;\ - s << obj.manip << obj.obj->I23; \ - return s; \ - } \ - template \ - std::ostream& operator << (std::ostream& s, const NAME##_field_list& obj) { \ - s << obj.manip << obj.obj->names[0] << obj.delem;\ - s << obj.manip << obj.obj->names[1] << obj.delem;\ - s << obj.manip << obj.obj->names[2] << obj.delem;\ - s << obj.manip << obj.obj->names[3] << obj.delem;\ - s << obj.manip << obj.obj->names[4] << obj.delem;\ - s << obj.manip << obj.obj->names[5] << obj.delem;\ - s << obj.manip << obj.obj->names[6] << obj.delem;\ - s << obj.manip << obj.obj->names[7] << obj.delem;\ - s << obj.manip << obj.obj->names[8] << obj.delem;\ - s << obj.manip << obj.obj->names[9] << obj.delem;\ - s << obj.manip << obj.obj->names[10] << obj.delem;\ - s << obj.manip << obj.obj->names[11] << obj.delem;\ - s << obj.manip << obj.obj->names[12] << obj.delem;\ - s << obj.manip << obj.obj->names[13] << obj.delem;\ - s << obj.manip << obj.obj->names[14] << obj.delem;\ - s << obj.manip << obj.obj->names[15] << obj.delem;\ - s << obj.manip << obj.obj->names[16] << obj.delem;\ - s << obj.manip << obj.obj->names[17] << obj.delem;\ - s << obj.manip << obj.obj->names[18] << obj.delem;\ - s << obj.manip << obj.obj->names[19] << obj.delem;\ - s << obj.manip << obj.obj->names[20] << obj.delem;\ - s << obj.manip << obj.obj->names[21] << obj.delem;\ - s << obj.manip << obj.obj->names[22]; \ - return s; \ - } \ - template \ - std::ostream& operator << (std::ostream& s, const NAME##_equal_list& obj) { \ - s << obj.obj->names[0] << obj.comp << obj.manip << obj.obj->I1 << obj.delem;\ - s << obj.obj->names[1] << obj.comp << obj.manip << obj.obj->I2 << obj.delem;\ - s << obj.obj->names[2] << obj.comp << obj.manip << obj.obj->I3 << obj.delem;\ - s << obj.obj->names[3] << obj.comp << obj.manip << obj.obj->I4 << obj.delem;\ - s << obj.obj->names[4] << obj.comp << obj.manip << obj.obj->I5 << obj.delem;\ - s << obj.obj->names[5] << obj.comp << obj.manip << obj.obj->I6 << obj.delem;\ - s << obj.obj->names[6] << obj.comp << obj.manip << obj.obj->I7 << obj.delem;\ - s << obj.obj->names[7] << obj.comp << obj.manip << obj.obj->I8 << obj.delem;\ - s << obj.obj->names[8] << obj.comp << obj.manip << obj.obj->I9 << obj.delem;\ - s << obj.obj->names[9] << obj.comp << obj.manip << obj.obj->I10 << obj.delem;\ - s << obj.obj->names[10] << obj.comp << obj.manip << obj.obj->I11 << obj.delem;\ - s << obj.obj->names[11] << obj.comp << obj.manip << obj.obj->I12 << obj.delem;\ - s << obj.obj->names[12] << obj.comp << obj.manip << obj.obj->I13 << obj.delem;\ - s << obj.obj->names[13] << obj.comp << obj.manip << obj.obj->I14 << obj.delem;\ - s << obj.obj->names[14] << obj.comp << obj.manip << obj.obj->I15 << obj.delem;\ - s << obj.obj->names[15] << obj.comp << obj.manip << obj.obj->I16 << obj.delem;\ - s << obj.obj->names[16] << obj.comp << obj.manip << obj.obj->I17 << obj.delem;\ - s << obj.obj->names[17] << obj.comp << obj.manip << obj.obj->I18 << obj.delem;\ - s << obj.obj->names[18] << obj.comp << obj.manip << obj.obj->I19 << obj.delem;\ - s << obj.obj->names[19] << obj.comp << obj.manip << obj.obj->I20 << obj.delem;\ - s << obj.obj->names[20] << obj.comp << obj.manip << obj.obj->I21 << obj.delem;\ - s << obj.obj->names[21] << obj.comp << obj.manip << obj.obj->I22 << obj.delem;\ - s << obj.obj->names[22] << obj.comp << obj.manip << obj.obj->I23; \ - return s; \ - } \ - template \ - std::ostream& operator << (std::ostream& s, const NAME##_cus_value_list& obj) { \ - bool before = false; \ - if ((*obj.include)[0]) { \ - s << obj.manip << obj.obj->I1;\ - before = true; \ - } \ - if ((*obj.include)[1]) { \ - if (before) s << obj.delem;\ - s << obj.manip << obj.obj->I2;\ - before = true; \ - } \ - if ((*obj.include)[2]) { \ - if (before) s << obj.delem;\ - s << obj.manip << obj.obj->I3;\ - before = true; \ - } \ - if ((*obj.include)[3]) { \ - if (before) s << obj.delem;\ - s << obj.manip << obj.obj->I4;\ - before = true; \ - } \ - if ((*obj.include)[4]) { \ - if (before) s << obj.delem;\ - s << obj.manip << obj.obj->I5;\ - before = true; \ - } \ - if ((*obj.include)[5]) { \ - if (before) s << obj.delem;\ - s << obj.manip << obj.obj->I6;\ - before = true; \ - } \ - if ((*obj.include)[6]) { \ - if (before) s << obj.delem;\ - s << obj.manip << obj.obj->I7;\ - before = true; \ - } \ - if ((*obj.include)[7]) { \ - if (before) s << obj.delem;\ - s << obj.manip << obj.obj->I8;\ - before = true; \ - } \ - if ((*obj.include)[8]) { \ - if (before) s << obj.delem;\ - s << obj.manip << obj.obj->I9;\ - before = true; \ - } \ - if ((*obj.include)[9]) { \ - if (before) s << obj.delem;\ - s << obj.manip << obj.obj->I10;\ - before = true; \ - } \ - if ((*obj.include)[10]) { \ - if (before) s << obj.delem;\ - s << obj.manip << obj.obj->I11;\ - before = true; \ - } \ - if ((*obj.include)[11]) { \ - if (before) s << obj.delem;\ - s << obj.manip << obj.obj->I12;\ - before = true; \ - } \ - if ((*obj.include)[12]) { \ - if (before) s << obj.delem;\ - s << obj.manip << obj.obj->I13;\ - before = true; \ - } \ - if ((*obj.include)[13]) { \ - if (before) s << obj.delem;\ - s << obj.manip << obj.obj->I14;\ - before = true; \ - } \ - if ((*obj.include)[14]) { \ - if (before) s << obj.delem;\ - s << obj.manip << obj.obj->I15;\ - before = true; \ - } \ - if ((*obj.include)[15]) { \ - if (before) s << obj.delem;\ - s << obj.manip << obj.obj->I16;\ - before = true; \ - } \ - if ((*obj.include)[16]) { \ - if (before) s << obj.delem;\ - s << obj.manip << obj.obj->I17;\ - before = true; \ - } \ - if ((*obj.include)[17]) { \ - if (before) s << obj.delem;\ - s << obj.manip << obj.obj->I18;\ - before = true; \ - } \ - if ((*obj.include)[18]) { \ - if (before) s << obj.delem;\ - s << obj.manip << obj.obj->I19;\ - before = true; \ - } \ - if ((*obj.include)[19]) { \ - if (before) s << obj.delem;\ - s << obj.manip << obj.obj->I20;\ - before = true; \ - } \ - if ((*obj.include)[20]) { \ - if (before) s << obj.delem;\ - s << obj.manip << obj.obj->I21;\ - before = true; \ - } \ - if ((*obj.include)[21]) { \ - if (before) s << obj.delem;\ - s << obj.manip << obj.obj->I22;\ - before = true; \ - } \ - if ((*obj.include)[22]) { \ - if (before) s << obj.delem;\ - s << obj.manip << obj.obj->I23;\ - } \ - return s; \ - } \ - template \ - std::ostream& operator << (std::ostream& s, const NAME##_cus_field_list& obj) { \ - bool before = false; \ - if ((*obj.include)[0]) { \ - s << obj.manip << obj.obj->names[0];\ - before = true; \ - } \ - if ((*obj.include)[1]) { \ - if (before) s << obj.delem;\ - s << obj.manip << obj.obj->names[1];\ - before = true; \ - } \ - if ((*obj.include)[2]) { \ - if (before) s << obj.delem;\ - s << obj.manip << obj.obj->names[2];\ - before = true; \ - } \ - if ((*obj.include)[3]) { \ - if (before) s << obj.delem;\ - s << obj.manip << obj.obj->names[3];\ - before = true; \ - } \ - if ((*obj.include)[4]) { \ - if (before) s << obj.delem;\ - s << obj.manip << obj.obj->names[4];\ - before = true; \ - } \ - if ((*obj.include)[5]) { \ - if (before) s << obj.delem;\ - s << obj.manip << obj.obj->names[5];\ - before = true; \ - } \ - if ((*obj.include)[6]) { \ - if (before) s << obj.delem;\ - s << obj.manip << obj.obj->names[6];\ - before = true; \ - } \ - if ((*obj.include)[7]) { \ - if (before) s << obj.delem;\ - s << obj.manip << obj.obj->names[7];\ - before = true; \ - } \ - if ((*obj.include)[8]) { \ - if (before) s << obj.delem;\ - s << obj.manip << obj.obj->names[8];\ - before = true; \ - } \ - if ((*obj.include)[9]) { \ - if (before) s << obj.delem;\ - s << obj.manip << obj.obj->names[9];\ - before = true; \ - } \ - if ((*obj.include)[10]) { \ - if (before) s << obj.delem;\ - s << obj.manip << obj.obj->names[10];\ - before = true; \ - } \ - if ((*obj.include)[11]) { \ - if (before) s << obj.delem;\ - s << obj.manip << obj.obj->names[11];\ - before = true; \ - } \ - if ((*obj.include)[12]) { \ - if (before) s << obj.delem;\ - s << obj.manip << obj.obj->names[12];\ - before = true; \ - } \ - if ((*obj.include)[13]) { \ - if (before) s << obj.delem;\ - s << obj.manip << obj.obj->names[13];\ - before = true; \ - } \ - if ((*obj.include)[14]) { \ - if (before) s << obj.delem;\ - s << obj.manip << obj.obj->names[14];\ - before = true; \ - } \ - if ((*obj.include)[15]) { \ - if (before) s << obj.delem;\ - s << obj.manip << obj.obj->names[15];\ - before = true; \ - } \ - if ((*obj.include)[16]) { \ - if (before) s << obj.delem;\ - s << obj.manip << obj.obj->names[16];\ - before = true; \ - } \ - if ((*obj.include)[17]) { \ - if (before) s << obj.delem;\ - s << obj.manip << obj.obj->names[17];\ - before = true; \ - } \ - if ((*obj.include)[18]) { \ - if (before) s << obj.delem;\ - s << obj.manip << obj.obj->names[18];\ - before = true; \ - } \ - if ((*obj.include)[19]) { \ - if (before) s << obj.delem;\ - s << obj.manip << obj.obj->names[19];\ - before = true; \ - } \ - if ((*obj.include)[20]) { \ - if (before) s << obj.delem;\ - s << obj.manip << obj.obj->names[20];\ - before = true; \ - } \ - if ((*obj.include)[21]) { \ - if (before) s << obj.delem;\ - s << obj.manip << obj.obj->names[21];\ - before = true; \ - } \ - if ((*obj.include)[22]) { \ - if (before) s << obj.delem;\ - s << obj.manip << obj.obj->names[22];\ - } \ - return s; \ - } \ - template \ - std::ostream& operator << (std::ostream& s, const NAME##_cus_equal_list& obj) { \ - bool before = false; \ - if ((*obj.include)[0]) { \ - s << obj.obj->names[0] << obj.comp << obj.manip << obj.obj->I1;\ - before = true; \ - } \ - if ((*obj.include)[1]) { \ - if (before) s << obj.delem;\ - s << obj.obj->names[1] << obj.comp << obj.manip << obj.obj->I2;\ - before = true; \ - } \ - if ((*obj.include)[2]) { \ - if (before) s << obj.delem;\ - s << obj.obj->names[2] << obj.comp << obj.manip << obj.obj->I3;\ - before = true; \ - } \ - if ((*obj.include)[3]) { \ - if (before) s << obj.delem;\ - s << obj.obj->names[3] << obj.comp << obj.manip << obj.obj->I4;\ - before = true; \ - } \ - if ((*obj.include)[4]) { \ - if (before) s << obj.delem;\ - s << obj.obj->names[4] << obj.comp << obj.manip << obj.obj->I5;\ - before = true; \ - } \ - if ((*obj.include)[5]) { \ - if (before) s << obj.delem;\ - s << obj.obj->names[5] << obj.comp << obj.manip << obj.obj->I6;\ - before = true; \ - } \ - if ((*obj.include)[6]) { \ - if (before) s << obj.delem;\ - s << obj.obj->names[6] << obj.comp << obj.manip << obj.obj->I7;\ - before = true; \ - } \ - if ((*obj.include)[7]) { \ - if (before) s << obj.delem;\ - s << obj.obj->names[7] << obj.comp << obj.manip << obj.obj->I8;\ - before = true; \ - } \ - if ((*obj.include)[8]) { \ - if (before) s << obj.delem;\ - s << obj.obj->names[8] << obj.comp << obj.manip << obj.obj->I9;\ - before = true; \ - } \ - if ((*obj.include)[9]) { \ - if (before) s << obj.delem;\ - s << obj.obj->names[9] << obj.comp << obj.manip << obj.obj->I10;\ - before = true; \ - } \ - if ((*obj.include)[10]) { \ - if (before) s << obj.delem;\ - s << obj.obj->names[10] << obj.comp << obj.manip << obj.obj->I11;\ - before = true; \ - } \ - if ((*obj.include)[11]) { \ - if (before) s << obj.delem;\ - s << obj.obj->names[11] << obj.comp << obj.manip << obj.obj->I12;\ - before = true; \ - } \ - if ((*obj.include)[12]) { \ - if (before) s << obj.delem;\ - s << obj.obj->names[12] << obj.comp << obj.manip << obj.obj->I13;\ - before = true; \ - } \ - if ((*obj.include)[13]) { \ - if (before) s << obj.delem;\ - s << obj.obj->names[13] << obj.comp << obj.manip << obj.obj->I14;\ - before = true; \ - } \ - if ((*obj.include)[14]) { \ - if (before) s << obj.delem;\ - s << obj.obj->names[14] << obj.comp << obj.manip << obj.obj->I15;\ - before = true; \ - } \ - if ((*obj.include)[15]) { \ - if (before) s << obj.delem;\ - s << obj.obj->names[15] << obj.comp << obj.manip << obj.obj->I16;\ - before = true; \ - } \ - if ((*obj.include)[16]) { \ - if (before) s << obj.delem;\ - s << obj.obj->names[16] << obj.comp << obj.manip << obj.obj->I17;\ - before = true; \ - } \ - if ((*obj.include)[17]) { \ - if (before) s << obj.delem;\ - s << obj.obj->names[17] << obj.comp << obj.manip << obj.obj->I18;\ - before = true; \ - } \ - if ((*obj.include)[18]) { \ - if (before) s << obj.delem;\ - s << obj.obj->names[18] << obj.comp << obj.manip << obj.obj->I19;\ - before = true; \ - } \ - if ((*obj.include)[19]) { \ - if (before) s << obj.delem;\ - s << obj.obj->names[19] << obj.comp << obj.manip << obj.obj->I20;\ - before = true; \ - } \ - if ((*obj.include)[20]) { \ - if (before) s << obj.delem;\ - s << obj.obj->names[20] << obj.comp << obj.manip << obj.obj->I21;\ - before = true; \ - } \ - if ((*obj.include)[21]) { \ - if (before) s << obj.delem;\ - s << obj.obj->names[21] << obj.comp << obj.manip << obj.obj->I22;\ - before = true; \ - } \ - if ((*obj.include)[22]) { \ - if (before) s << obj.delem;\ - s << obj.obj->names[22] << obj.comp << obj.manip << obj.obj->I23;\ - } \ - return s; \ - } \ - template \ - inline NAME##_value_list NAME::value_list(cchar *d, Manip m) const { \ - return NAME##_value_list (this, d, m); \ - } \ - template \ - inline NAME##_field_list NAME::field_list(cchar *d, Manip m) const { \ - return NAME##_field_list (this, d, m); \ - } \ - template \ - inline NAME##_equal_list NAME::equal_list(cchar *d, cchar *c, Manip m) const { \ - return NAME##_equal_list (this, d, c, m); \ - } \ - template \ - inline NAME##_cus_value_list NAME::value_list(cchar *d, Manip m,\ - bool i1, bool i2, bool i3, bool i4, bool i5, bool i6, bool i7, bool i8, bool i9, bool i10, bool i11, bool i12, bool i13, bool i14, bool i15, bool i16, bool i17, bool i18, bool i19, bool i20, bool i21, bool i22, bool i23) const {\ - return NAME##_cus_value_list (this, d, m, i1, i2, i3, i4, i5, i6, i7, i8, i9, i10, i11, i12, i13, i14, i15, i16, i17, i18, i19, i20, i21, i22, i23); \ - } \ - template \ - inline NAME##_cus_field_list NAME::field_list(cchar *d, Manip m,\ - bool i1, bool i2, bool i3, bool i4, bool i5, bool i6, bool i7, bool i8, bool i9, bool i10, bool i11, bool i12, bool i13, bool i14, bool i15, bool i16, bool i17, bool i18, bool i19, bool i20, bool i21, bool i22, bool i23) const { \ - return NAME##_cus_field_list (this, d, m, i1, i2, i3, i4, i5, i6, i7, i8, i9, i10, i11, i12, i13, i14, i15, i16, i17, i18, i19, i20, i21, i22, i23); \ - } \ - template \ - inline NAME##_cus_equal_list NAME::equal_list(cchar *d, cchar *c, Manip m,\ - bool i1, bool i2, bool i3, bool i4, bool i5, bool i6, bool i7, bool i8, bool i9, bool i10, bool i11, bool i12, bool i13, bool i14, bool i15, bool i16, bool i17, bool i18, bool i19, bool i20, bool i21, bool i22, bool i23) const { \ - return NAME##_cus_equal_list (this, d, c, m, i1, i2, i3, i4, i5, i6, i7, i8, i9, i10, i11, i12, i13, i14, i15, i16, i17, i18, i19, i20, i21, i22, i23); \ - } \ - template \ - inline NAME##_cus_value_list NAME::value_list(cchar *d, Manip m,\ - NAME##_enum i1, NAME##_enum i2, NAME##_enum i3, NAME##_enum i4, NAME##_enum i5, NAME##_enum i6, NAME##_enum i7, NAME##_enum i8, NAME##_enum i9, NAME##_enum i10, NAME##_enum i11, NAME##_enum i12, NAME##_enum i13, NAME##_enum i14, NAME##_enum i15, NAME##_enum i16, NAME##_enum i17, NAME##_enum i18, NAME##_enum i19, NAME##_enum i20, NAME##_enum i21, NAME##_enum i22, NAME##_enum i23) const { \ - return NAME##_cus_value_list (this, d, m, i1, i2, i3, i4, i5, i6, i7, i8, i9, i10, i11, i12, i13, i14, i15, i16, i17, i18, i19, i20, i21, i22, i23); \ - } \ - template \ - inline NAME##_cus_field_list NAME::field_list(cchar *d, Manip m,\ - NAME##_enum i1, NAME##_enum i2, NAME##_enum i3, NAME##_enum i4, NAME##_enum i5, NAME##_enum i6, NAME##_enum i7, NAME##_enum i8, NAME##_enum i9, NAME##_enum i10, NAME##_enum i11, NAME##_enum i12, NAME##_enum i13, NAME##_enum i14, NAME##_enum i15, NAME##_enum i16, NAME##_enum i17, NAME##_enum i18, NAME##_enum i19, NAME##_enum i20, NAME##_enum i21, NAME##_enum i22, NAME##_enum i23) const {\ - return NAME##_cus_field_list (this, d, m, i1, i2, i3, i4, i5, i6, i7, i8, i9, i10, i11, i12, i13, i14, i15, i16, i17, i18, i19, i20, i21, i22, i23); \ - } \ - template \ - inline NAME##_cus_equal_list NAME::equal_list(cchar *d, cchar *c, Manip m, \ - NAME##_enum i1, NAME##_enum i2, NAME##_enum i3, NAME##_enum i4, NAME##_enum i5, NAME##_enum i6, NAME##_enum i7, NAME##_enum i8, NAME##_enum i9, NAME##_enum i10, NAME##_enum i11, NAME##_enum i12, NAME##_enum i13, NAME##_enum i14, NAME##_enum i15, NAME##_enum i16, NAME##_enum i17, NAME##_enum i18, NAME##_enum i19, NAME##_enum i20, NAME##_enum i21, NAME##_enum i22, NAME##_enum i23) const { \ - return NAME##_cus_equal_list (this, d, c, m, i1, i2, i3, i4, i5, i6, i7, i8, i9, i10, i11, i12, i13, i14, i15, i16, i17, i18, i19, i20, i21, i22, i23); \ - } \ - template \ - inline NAME##_cus_value_list NAME::value_list(cchar *d, Manip m,\ - std::vector *i) const {\ - return NAME##_cus_value_list (this, d, m, i);\ - }\ - template \ - inline NAME##_cus_field_list NAME::field_list(cchar *d, Manip m,\ - std::vector *i) const {\ - return NAME##_cus_field_list (this, d, m, i);\ - }\ - template \ - inline NAME##_cus_equal_list NAME::equal_list(cchar *d, cchar *c, Manip m,\ - std::vector *i) const {\ - return NAME##_cus_equal_list (this, d, c, m, i);\ - }\ - template \ - inline NAME##_cus_value_list \ - NAME::value_list(cchar *d, Manip m, sql_cmp_type /*sc*/) const {\ - sql_compare_type_def_##CMP (NAME, value, NUM);\ - }\ - template \ - inline NAME##_cus_field_list \ - NAME::field_list(cchar *d, Manip m, sql_cmp_type /*sc*/) const {\ - sql_compare_type_def_##CMP (NAME, field, NUM);\ - }\ - template \ - inline NAME##_cus_equal_list \ - NAME::equal_list(cchar *d, cchar *c, Manip m, sql_cmp_type /*sc*/) const {\ - sql_compare_type_defe_##CMP (NAME, equal, NUM);\ - }\ - template \ - void populate_##NAME (NAME *s, const Row &row) { \ - s->I1 = static_cast(row.at(O1));\ - s->I2 = static_cast(row.at(O2));\ - s->I3 = static_cast(row.at(O3));\ - s->I4 = static_cast(row.at(O4));\ - s->I5 = static_cast(row.at(O5));\ - s->I6 = static_cast(row.at(O6));\ - s->I7 = static_cast(row.at(O7));\ - s->I8 = static_cast(row.at(O8));\ - s->I9 = static_cast(row.at(O9));\ - s->I10 = static_cast(row.at(O10));\ - s->I11 = static_cast(row.at(O11));\ - s->I12 = static_cast(row.at(O12));\ - s->I13 = static_cast(row.at(O13));\ - s->I14 = static_cast(row.at(O14));\ - s->I15 = static_cast(row.at(O15));\ - s->I16 = static_cast(row.at(O16));\ - s->I17 = static_cast(row.at(O17));\ - s->I18 = static_cast(row.at(O18));\ - s->I19 = static_cast(row.at(O19));\ - s->I20 = static_cast(row.at(O20));\ - s->I21 = static_cast(row.at(O21));\ - s->I22 = static_cast(row.at(O22));\ - s->I23 = static_cast(row.at(O23));\ - } \ - inline NAME::NAME (const Row &row) \ - {populate_##NAME(this, row);}\ - inline void NAME::set (const Row &row)\ - {populate_##NAME(this, row);}\ - sql_COMPARE__##CMP(NAME, I1, I2, I3, I4, I5, I6, I7, I8, I9, I10, I11, I12, I13, I14, I15, I16, I17, I18, I19, I20, I21, I22, I23, 0, 0 ) - -#define sql_create_basic_23(NAME, CMP, CONTR, T1, I1, T2, I2, T3, I3, T4, I4, T5, I5, T6, I6, T7, I7, T8, I8, T9, I9, T10, I10, T11, I11, T12, I12, T13, I13, T14, I14, T15, I15, T16, I16, T17, I17, T18, I18, T19, I19, T20, I20, T21, I21, T22, I22, T23, I23) \ - sql_create_basic_c_order_23(NAME, CMP, CONTR, T1, I1, 0, T2, I2, 1, T3, I3, 2, T4, I4, 3, T5, I5, 4, T6, I6, 5, T7, I7, 6, T8, I8, 7, T9, I9, 8, T10, I10, 9, T11, I11, 10, T12, I12, 11, T13, I13, 12, T14, I14, 13, T15, I15, 14, T16, I16, 15, T17, I17, 16, T18, I18, 17, T19, I19, 18, T20, I20, 19, T21, I21, 20, T22, I22, 21, T23, I23, 22) - -#define sql_create_23(NAME, CMP, CONTR, T1, I1, T2, I2, T3, I3, T4, I4, T5, I5, T6, I6, T7, I7, T8, I8, T9, I9, T10, I10, T11, I11, T12, I12, T13, I13, T14, I14, T15, I15, T16, I16, T17, I17, T18, I18, T19, I19, T20, I20, T21, I21, T22, I22, T23, I23) \ - sql_create_complete_23(NAME, CMP, CONTR, T1, I1, #I1, 0, T2, I2, #I2, 1, T3, I3, #I3, 2, T4, I4, #I4, 3, T5, I5, #I5, 4, T6, I6, #I6, 5, T7, I7, #I7, 6, T8, I8, #I8, 7, T9, I9, #I9, 8, T10, I10, #I10, 9, T11, I11, #I11, 10, T12, I12, #I12, 11, T13, I13, #I13, 12, T14, I14, #I14, 13, T15, I15, #I15, 14, T16, I16, #I16, 15, T17, I17, #I17, 16, T18, I18, #I18, 17, T19, I19, #I19, 18, T20, I20, #I20, 19, T21, I21, #I21, 20, T22, I22, #I22, 21, T23, I23, #I23, 22) \ - -#define sql_create_c_order_23(NAME, CMP, CONTR, T1, I1, O1, T2, I2, O2, T3, I3, O3, T4, I4, O4, T5, I5, O5, T6, I6, O6, T7, I7, O7, T8, I8, O8, T9, I9, O9, T10, I10, O10, T11, I11, O11, T12, I12, O12, T13, I13, O13, T14, I14, O14, T15, I15, O15, T16, I16, O16, T17, I17, O17, T18, I18, O18, T19, I19, O19, T20, I20, O20, T21, I21, O21, T22, I22, O22, T23, I23, O23) \ - sql_create_complete_23(NAME, CMP, CONTR, T1, I1, #I1, O1, T2, I2, #I2, O2, T3, I3, #I3, O3, T4, I4, #I4, O4, T5, I5, #I5, O5, T6, I6, #I6, O6, T7, I7, #I7, O7, T8, I8, #I8, O8, T9, I9, #I9, O9, T10, I10, #I10, O10, T11, I11, #I11, O11, T12, I12, #I12, O12, T13, I13, #I13, O13, T14, I14, #I14, O14, T15, I15, #I15, O15, T16, I16, #I16, O16, T17, I17, #I17, O17, T18, I18, #I18, O18, T19, I19, #I19, O19, T20, I20, #I20, O20, T21, I21, #I21, O21, T22, I22, #I22, O22, T23, I23, #I23, O23) - -#define sql_create_c_names_23(NAME, CMP, CONTR, T1, I1, N1, T2, I2, N2, T3, I3, N3, T4, I4, N4, T5, I5, N5, T6, I6, N6, T7, I7, N7, T8, I8, N8, T9, I9, N9, T10, I10, N10, T11, I11, N11, T12, I12, N12, T13, I13, N13, T14, I14, N14, T15, I15, N15, T16, I16, N16, T17, I17, N17, T18, I18, N18, T19, I19, N19, T20, I20, N20, T21, I21, N21, T22, I22, N22, T23, I23, N23) \ - sql_create_complete_23(NAME, CMP, CONTR, T1, I1, N1, 0, T2, I2, N2, 1, T3, I3, N3, 2, T4, I4, N4, 3, T5, I5, N5, 4, T6, I6, N6, 5, T7, I7, N7, 6, T8, I8, N8, 7, T9, I9, N9, 8, T10, I10, N10, 9, T11, I11, N11, 10, T12, I12, N12, 11, T13, I13, N13, 12, T14, I14, N14, 13, T15, I15, N15, 14, T16, I16, N16, 15, T17, I17, N17, 16, T18, I18, N18, 17, T19, I19, N19, 18, T20, I20, N20, 19, T21, I21, N21, 20, T22, I22, N22, 21, T23, I23, N23, 22) - -// --------------------------------------------------- -// End Create 23 -// --------------------------------------------------- - -// --------------------------------------------------- -// Begin Create 24 -// --------------------------------------------------- -#define sql_create_basic_c_order_24(NAME, CMP, CONTR, T1, I1, O1, T2, I2, O2, T3, I3, O3, T4, I4, O4, T5, I5, O5, T6, I6, O6, T7, I7, O7, T8, I8, O8, T9, I9, O9, T10, I10, O10, T11, I11, O11, T12, I12, O12, T13, I13, O13, T14, I14, O14, T15, I15, O15, T16, I16, O16, T17, I17, O17, T18, I18, O18, T19, I19, O19, T20, I20, O20, T21, I21, O21, T22, I22, O22, T23, I23, O23, T24, I24, O24)\ - struct NAME; \ - template int sql_compare_##NAME (const NAME &, const NAME &);\ - struct NAME { \ - T1 I1;\ - T2 I2;\ - T3 I3;\ - T4 I4;\ - T5 I5;\ - T6 I6;\ - T7 I7;\ - T8 I8;\ - T9 I9;\ - T10 I10;\ - T11 I11;\ - T12 I12;\ - T13 I13;\ - T14 I14;\ - T15 I15;\ - T16 I16;\ - T17 I17;\ - T18 I18;\ - T19 I19;\ - T20 I20;\ - T21 I21;\ - T22 I22;\ - T23 I23;\ - T24 I24; \ - NAME () {} \ - NAME (const Row &row);\ - sql_compare_define_##CMP(NAME, T1, I1, T2, I2, T3, I3, T4, I4, T5, I5, T6, I6, T7, I7, T8, I8, T9, I9, T10, I10, T11, I11, T12, I12, T13, I13, T14, I14, T15, I15, T16, I16, T17, I17, T18, I18, T19, I19, T20, I20, T21, I21, T22, I22, T23, I23, T24, I24, 0, 0)\ - }; \ - template \ - void populate_##NAME (NAME *s, const Row &row) { \ - s->I1 = static_cast(row.at(O1));\ - s->I2 = static_cast(row.at(O2));\ - s->I3 = static_cast(row.at(O3));\ - s->I4 = static_cast(row.at(O4));\ - s->I5 = static_cast(row.at(O5));\ - s->I6 = static_cast(row.at(O6));\ - s->I7 = static_cast(row.at(O7));\ - s->I8 = static_cast(row.at(O8));\ - s->I9 = static_cast(row.at(O9));\ - s->I10 = static_cast(row.at(O10));\ - s->I11 = static_cast(row.at(O11));\ - s->I12 = static_cast(row.at(O12));\ - s->I13 = static_cast(row.at(O13));\ - s->I14 = static_cast(row.at(O14));\ - s->I15 = static_cast(row.at(O15));\ - s->I16 = static_cast(row.at(O16));\ - s->I17 = static_cast(row.at(O17));\ - s->I18 = static_cast(row.at(O18));\ - s->I19 = static_cast(row.at(O19));\ - s->I20 = static_cast(row.at(O20));\ - s->I21 = static_cast(row.at(O21));\ - s->I22 = static_cast(row.at(O22));\ - s->I23 = static_cast(row.at(O23));\ - s->I24 = static_cast(row.at(O24)); \ - } \ - inline NAME::NAME (const Row &row) \ - {populate_##NAME(this, row);} \ - sql_COMPARE__##CMP(NAME, I1, I2, I3, I4, I5, I6, I7, I8, I9, I10, I11, I12, I13, I14, I15, I16, I17, I18, I19, I20, I21, I22, I23, I24, 0 ) - -#define sql_create_complete_24(NAME, CMP, CONTR, T1, I1, N1, O1, T2, I2, N2, O2, T3, I3, N3, O3, T4, I4, N4, O4, T5, I5, N5, O5, T6, I6, N6, O6, T7, I7, N7, O7, T8, I8, N8, O8, T9, I9, N9, O9, T10, I10, N10, O10, T11, I11, N11, O11, T12, I12, N12, O12, T13, I13, N13, O13, T14, I14, N14, O14, T15, I15, N15, O15, T16, I16, N16, O16, T17, I17, N17, O17, T18, I18, N18, O18, T19, I19, N19, O19, T20, I20, N20, O20, T21, I21, N21, O21, T22, I22, N22, O22, T23, I23, N23, O23, T24, I24, N24, O24) \ - struct NAME; \ - enum NAME##_enum { \ - NAME##_##I1,\ - NAME##_##I2,\ - NAME##_##I3,\ - NAME##_##I4,\ - NAME##_##I5,\ - NAME##_##I6,\ - NAME##_##I7,\ - NAME##_##I8,\ - NAME##_##I9,\ - NAME##_##I10,\ - NAME##_##I11,\ - NAME##_##I12,\ - NAME##_##I13,\ - NAME##_##I14,\ - NAME##_##I15,\ - NAME##_##I16,\ - NAME##_##I17,\ - NAME##_##I18,\ - NAME##_##I19,\ - NAME##_##I20,\ - NAME##_##I21,\ - NAME##_##I22,\ - NAME##_##I23,\ - NAME##_##I24 \ - ,NAME##_NULL \ - }; \ - template \ - class NAME##_value_list { \ - /*friend std::ostream& operator << <> (std::ostream&, const NAME##_value_list&); */\ - public: \ - const NAME *obj;\ - cchar *delem;\ - Manip manip;\ - public: \ - NAME##_value_list (const NAME *o, cchar *d, Manip m) \ - : obj(o), delem(d), manip(m) {} \ - };\ - template \ - class NAME##_##field_list {\ - /* friend std::ostream& operator << <> (std::ostream&, const NAME##_field_list&); */\ - public: \ - const NAME *obj; \ - cchar *delem;\ - Manip manip;\ - public: \ - NAME##_field_list (const NAME *o, cchar *d, Manip m) \ - : obj(o), delem(d), manip(m) {} \ - };\ - template \ - class NAME##_equal_list { \ - /* friend std::ostream& operator << <> (std::ostream&, const NAME##_equal_list&); */\ - public: \ - const NAME *obj;\ - cchar *delem;\ - cchar *comp;\ - Manip manip;\ - public: \ - NAME##_equal_list (const NAME *o, cchar *d, cchar *c, Manip m) \ - : obj(o), delem(d), comp(c), manip(m) {}\ - };\ - template \ - class NAME##_cus_value_list {\ - /* friend std::ostream& operator << <> (std::ostream&, \ - const NAME##_cus_value_list&); */\ - public:\ - const NAME *obj;\ - std::vector *include;\ - bool del_vector;\ - cchar *delem;\ - Manip manip;\ - public: \ - ~NAME##_cus_value_list () {if (del_vector) delete include;} \ - NAME##_cus_value_list (const NAME *o, cchar *d, Manip m, bool i1, bool i2, bool i3, bool i4, bool i5, bool i6, bool i7, bool i8, bool i9, bool i10, bool i11, bool i12, bool i13, bool i14, bool i15, bool i16, bool i17, bool i18, bool i19, bool i20, bool i21, bool i22, bool i23, bool i24);\ - NAME##_cus_value_list (const NAME *o, cchar *d, Manip m, NAME##_enum i1, NAME##_enum i2, NAME##_enum i3, NAME##_enum i4, NAME##_enum i5, NAME##_enum i6, NAME##_enum i7, NAME##_enum i8, NAME##_enum i9, NAME##_enum i10, NAME##_enum i11, NAME##_enum i12, NAME##_enum i13, NAME##_enum i14, NAME##_enum i15, NAME##_enum i16, NAME##_enum i17, NAME##_enum i18, NAME##_enum i19, NAME##_enum i20, NAME##_enum i21, NAME##_enum i22, NAME##_enum i23, NAME##_enum i24); \ - NAME##_cus_value_list (const NAME *o, cchar *d, Manip m ,std::vector* i)\ - : obj(o), include(i), del_vector(false), delem(d), manip(m) {}\ - };\ - template \ - class NAME##_cus_field_list { \ - /* friend std::ostream& operator << <> (std::ostream&, \ - const NAME##_cus_field_list&); */\ - public:\ - const NAME *obj; \ - std::vector *include; \ - bool del_vector; \ - cchar *delem;\ - Manip manip;\ - public: \ - ~NAME##_cus_field_list () {if (del_vector) delete include;} \ - NAME##_cus_field_list (const NAME *o, cchar *d, Manip m, bool i1, bool i2, bool i3, bool i4, bool i5, bool i6, bool i7, bool i8, bool i9, bool i10, bool i11, bool i12, bool i13, bool i14, bool i15, bool i16, bool i17, bool i18, bool i19, bool i20, bool i21, bool i22, bool i23, bool i24); \ - NAME##_cus_field_list (const NAME *o, cchar *d, Manip m, NAME##_enum i1, NAME##_enum i2, NAME##_enum i3, NAME##_enum i4, NAME##_enum i5, NAME##_enum i6, NAME##_enum i7, NAME##_enum i8, NAME##_enum i9, NAME##_enum i10, NAME##_enum i11, NAME##_enum i12, NAME##_enum i13, NAME##_enum i14, NAME##_enum i15, NAME##_enum i16, NAME##_enum i17, NAME##_enum i18, NAME##_enum i19, NAME##_enum i20, NAME##_enum i21, NAME##_enum i22, NAME##_enum i23, NAME##_enum i24); \ - NAME##_cus_field_list (const NAME *o, cchar *d, Manip m, std::vector *i) \ - : obj(o), include(i), del_vector(false), delem(d), manip(m) {}\ - };\ - template \ - class NAME##_cus_equal_list {\ - /* friend std::ostream& operator << <> (std::ostream&, \ - const NAME##_cus_equal_list&); */\ - public:\ - const NAME *obj;\ - std::vector *include;\ - bool del_vector;\ - cchar *delem;\ - cchar *comp;\ - Manip manip;\ - public:\ - ~NAME##_##cus_equal_list () {if (del_vector) delete include;}\ - NAME##_##cus_equal_list (const NAME *o, cchar *d, cchar *c, Manip m, bool i1, bool i2, bool i3, bool i4, bool i5, bool i6, bool i7, bool i8, bool i9, bool i10, bool i11, bool i12, bool i13, bool i14, bool i15, bool i16, bool i17, bool i18, bool i19, bool i20, bool i21, bool i22, bool i23, bool i24); \ - NAME##_##cus_equal_list (const NAME *o, cchar *d, cchar *c, Manip m, NAME##_enum i1, NAME##_enum i2, NAME##_enum i3, NAME##_enum i4, NAME##_enum i5, NAME##_enum i6, NAME##_enum i7, NAME##_enum i8, NAME##_enum i9, NAME##_enum i10, NAME##_enum i11, NAME##_enum i12, NAME##_enum i13, NAME##_enum i14, NAME##_enum i15, NAME##_enum i16, NAME##_enum i17, NAME##_enum i18, NAME##_enum i19, NAME##_enum i20, NAME##_enum i21, NAME##_enum i22, NAME##_enum i23, NAME##_enum i24); \ - NAME##_##cus_equal_list (const NAME *o, cchar *d, cchar *c, Manip m, std::vector *i) \ - : obj(o), include(i), del_vector(false), delem(d), comp(c), manip(m) {}\ - };\ - template int sql_compare_##NAME (const NAME &, const NAME &);\ - struct NAME { \ - T1 I1;\ - T2 I2;\ - T3 I3;\ - T4 I4;\ - T5 I5;\ - T6 I6;\ - T7 I7;\ - T8 I8;\ - T9 I9;\ - T10 I10;\ - T11 I11;\ - T12 I12;\ - T13 I13;\ - T14 I14;\ - T15 I15;\ - T16 I16;\ - T17 I17;\ - T18 I18;\ - T19 I19;\ - T20 I20;\ - T21 I21;\ - T22 I22;\ - T23 I23;\ - T24 I24; \ - NAME () {} \ - NAME (const Row &row);\ - void set (const Row &row);\ - sql_compare_define_##CMP(NAME, T1, I1, T2, I2, T3, I3, T4, I4, T5, I5, T6, I6, T7, I7, T8, I8, T9, I9, T10, I10, T11, I11, T12, I12, T13, I13, T14, I14, T15, I15, T16, I16, T17, I17, T18, I18, T19, I19, T20, I20, T21, I21, T22, I22, T23, I23, T24, I24, 0, 0)\ - sql_construct_define_##CONTR(NAME, T1, I1, T2, I2, T3, I3, T4, I4, T5, I5, T6, I6, T7, I7, T8, I8, T9, I9, T10, I10, T11, I11, T12, I12, T13, I13, T14, I14, T15, I15, T16, I16, T17, I17, T18, I18, T19, I19, T20, I20, T21, I21, T22, I22, T23, I23, T24, I24, 0, 0)\ - static const char *names[];\ - static const char *_table;\ - static const char *& table() {return _table;}\ - NAME##_value_list value_list() const {\ - return value_list(",", quote);}\ - NAME##_value_list value_list(cchar *d) const {\ - return value_list(d, quote);}\ - template \ - NAME##_value_list value_list(cchar *d, Manip m) const; \ - NAME##_field_list field_list() const {\ - return field_list(",", do_nothing);}\ - NAME##_field_list field_list(cchar *d) const {\ - return field_list(d, do_nothing);}\ - template \ - NAME##_field_list field_list(cchar *d, Manip m) const; \ - NAME##_equal_list equal_list(cchar *d = ",", \ - cchar *c = " = ") const{\ - return equal_list(d, c, quote);}\ - template \ - NAME##_equal_list equal_list(cchar *d, cchar *c, Manip m) const; \ - /* cus_data */\ - NAME##_cus_value_list value_list(bool i1, bool i2 = false, bool i3 = false, bool i4 = false, bool i5 = false, bool i6 = false, bool i7 = false, bool i8 = false, bool i9 = false, bool i10 = false, bool i11 = false, bool i12 = false, bool i13 = false, bool i14 = false, bool i15 = false, bool i16 = false, bool i17 = false, bool i18 = false, bool i19 = false, bool i20 = false, bool i21 = false, bool i22 = false, bool i23 = false, bool i24 = false) const {\ - return value_list(",", quote, i1, i2, i3, i4, i5, i6, i7, i8, i9, i10, i11, i12, i13, i14, i15, i16, i17, i18, i19, i20, i21, i22, i23, i24);\ - }\ - NAME##_cus_value_list value_list(NAME##_enum i1, NAME##_enum i2 = NAME##_NULL, NAME##_enum i3 = NAME##_NULL, NAME##_enum i4 = NAME##_NULL, NAME##_enum i5 = NAME##_NULL, NAME##_enum i6 = NAME##_NULL, NAME##_enum i7 = NAME##_NULL, NAME##_enum i8 = NAME##_NULL, NAME##_enum i9 = NAME##_NULL, NAME##_enum i10 = NAME##_NULL, NAME##_enum i11 = NAME##_NULL, NAME##_enum i12 = NAME##_NULL, NAME##_enum i13 = NAME##_NULL, NAME##_enum i14 = NAME##_NULL, NAME##_enum i15 = NAME##_NULL, NAME##_enum i16 = NAME##_NULL, NAME##_enum i17 = NAME##_NULL, NAME##_enum i18 = NAME##_NULL, NAME##_enum i19 = NAME##_NULL, NAME##_enum i20 = NAME##_NULL, NAME##_enum i21 = NAME##_NULL, NAME##_enum i22 = NAME##_NULL, NAME##_enum i23 = NAME##_NULL, NAME##_enum i24 = NAME##_NULL) const {\ - return value_list(",", quote, i1, i2, i3, i4, i5, i6, i7, i8, i9, i10, i11, i12, i13, i14, i15, i16, i17, i18, i19, i20, i21, i22, i23, i24);\ - }\ - NAME##_cus_value_list value_list(std::vector *i) const {\ - return value_list(",", quote, i);\ - }\ - NAME##_cus_value_list value_list(sql_cmp_type sc) const {\ - return value_list(",", quote, sc);\ - }\ - NAME##_cus_value_list value_list(cchar *d, bool i1, bool i2 = false, bool i3 = false, bool i4 = false, bool i5 = false, bool i6 = false, bool i7 = false, bool i8 = false, bool i9 = false, bool i10 = false, bool i11 = false, bool i12 = false, bool i13 = false, bool i14 = false, bool i15 = false, bool i16 = false, bool i17 = false, bool i18 = false, bool i19 = false, bool i20 = false, bool i21 = false, bool i22 = false, bool i23 = false, bool i24 = false) const {\ - return value_list(d, quote, i1, i2, i3, i4, i5, i6, i7, i8, i9, i10, i11, i12, i13, i14, i15, i16, i17, i18, i19, i20, i21, i22, i23, i24);\ - }\ - NAME##_cus_value_list value_list(cchar *d, NAME##_enum i1, NAME##_enum i2 = NAME##_NULL, NAME##_enum i3 = NAME##_NULL, NAME##_enum i4 = NAME##_NULL, NAME##_enum i5 = NAME##_NULL, NAME##_enum i6 = NAME##_NULL, NAME##_enum i7 = NAME##_NULL, NAME##_enum i8 = NAME##_NULL, NAME##_enum i9 = NAME##_NULL, NAME##_enum i10 = NAME##_NULL, NAME##_enum i11 = NAME##_NULL, NAME##_enum i12 = NAME##_NULL, NAME##_enum i13 = NAME##_NULL, NAME##_enum i14 = NAME##_NULL, NAME##_enum i15 = NAME##_NULL, NAME##_enum i16 = NAME##_NULL, NAME##_enum i17 = NAME##_NULL, NAME##_enum i18 = NAME##_NULL, NAME##_enum i19 = NAME##_NULL, NAME##_enum i20 = NAME##_NULL, NAME##_enum i21 = NAME##_NULL, NAME##_enum i22 = NAME##_NULL, NAME##_enum i23 = NAME##_NULL, NAME##_enum i24 = NAME##_NULL) const {\ - return value_list(d, quote, i1, i2, i3, i4, i5, i6, i7, i8, i9, i10, i11, i12, i13, i14, i15, i16, i17, i18, i19, i20, i21, i22, i23, i24);\ - }\ - NAME##_cus_value_list value_list(cchar *d, \ - std::vector *i) const {\ - return value_list(d, quote, i);\ - }\ - NAME##_cus_value_list value_list(cchar *d, \ - sql_cmp_type sc) const {\ - return value_list(d, quote, sc);\ - }\ - template \ - NAME##_cus_value_list value_list(cchar *d, Manip m,\ - bool i1, bool i2 = false, bool i3 = false, bool i4 = false, bool i5 = false, bool i6 = false, bool i7 = false, bool i8 = false, bool i9 = false, bool i10 = false, bool i11 = false, bool i12 = false, bool i13 = false, bool i14 = false, bool i15 = false, bool i16 = false, bool i17 = false, bool i18 = false, bool i19 = false, bool i20 = false, bool i21 = false, bool i22 = false, bool i23 = false, bool i24 = false) const; \ - template \ - NAME##_cus_value_list value_list(cchar *d, Manip m,\ - NAME##_enum i1, NAME##_enum i2 = NAME##_NULL, NAME##_enum i3 = NAME##_NULL, NAME##_enum i4 = NAME##_NULL, NAME##_enum i5 = NAME##_NULL, NAME##_enum i6 = NAME##_NULL, NAME##_enum i7 = NAME##_NULL, NAME##_enum i8 = NAME##_NULL, NAME##_enum i9 = NAME##_NULL, NAME##_enum i10 = NAME##_NULL, NAME##_enum i11 = NAME##_NULL, NAME##_enum i12 = NAME##_NULL, NAME##_enum i13 = NAME##_NULL, NAME##_enum i14 = NAME##_NULL, NAME##_enum i15 = NAME##_NULL, NAME##_enum i16 = NAME##_NULL, NAME##_enum i17 = NAME##_NULL, NAME##_enum i18 = NAME##_NULL, NAME##_enum i19 = NAME##_NULL, NAME##_enum i20 = NAME##_NULL, NAME##_enum i21 = NAME##_NULL, NAME##_enum i22 = NAME##_NULL, NAME##_enum i23 = NAME##_NULL, NAME##_enum i24 = NAME##_NULL) const; \ - template \ - NAME##_cus_value_list value_list(cchar *d, Manip m, \ - std::vector *i) const;\ - template \ - NAME##_cus_value_list value_list(cchar *d, Manip m, \ - sql_cmp_type sc) const;\ - /* cus field */\ - NAME##_cus_field_list field_list(bool i1, bool i2 = false, bool i3 = false, bool i4 = false, bool i5 = false, bool i6 = false, bool i7 = false, bool i8 = false, bool i9 = false, bool i10 = false, bool i11 = false, bool i12 = false, bool i13 = false, bool i14 = false, bool i15 = false, bool i16 = false, bool i17 = false, bool i18 = false, bool i19 = false, bool i20 = false, bool i21 = false, bool i22 = false, bool i23 = false, bool i24 = false) const {\ - return field_list(",", do_nothing, i1, i2, i3, i4, i5, i6, i7, i8, i9, i10, i11, i12, i13, i14, i15, i16, i17, i18, i19, i20, i21, i22, i23, i24);\ - }\ - NAME##_cus_field_list field_list(NAME##_enum i1, NAME##_enum i2 = NAME##_NULL, NAME##_enum i3 = NAME##_NULL, NAME##_enum i4 = NAME##_NULL, NAME##_enum i5 = NAME##_NULL, NAME##_enum i6 = NAME##_NULL, NAME##_enum i7 = NAME##_NULL, NAME##_enum i8 = NAME##_NULL, NAME##_enum i9 = NAME##_NULL, NAME##_enum i10 = NAME##_NULL, NAME##_enum i11 = NAME##_NULL, NAME##_enum i12 = NAME##_NULL, NAME##_enum i13 = NAME##_NULL, NAME##_enum i14 = NAME##_NULL, NAME##_enum i15 = NAME##_NULL, NAME##_enum i16 = NAME##_NULL, NAME##_enum i17 = NAME##_NULL, NAME##_enum i18 = NAME##_NULL, NAME##_enum i19 = NAME##_NULL, NAME##_enum i20 = NAME##_NULL, NAME##_enum i21 = NAME##_NULL, NAME##_enum i22 = NAME##_NULL, NAME##_enum i23 = NAME##_NULL, NAME##_enum i24 = NAME##_NULL) const {\ - return field_list(",", do_nothing, i1, i2, i3, i4, i5, i6, i7, i8, i9, i10, i11, i12, i13, i14, i15, i16, i17, i18, i19, i20, i21, i22, i23, i24);\ - }\ - NAME##_cus_field_list field_list(std::vector *i) const {\ - return field_list(",", do_nothing, i);\ - }\ - NAME##_cus_field_list field_list(sql_cmp_type sc) const\ - {\ - return field_list(",", do_nothing, sc);\ - }\ - NAME##_cus_field_list field_list(cchar *d, \ - bool i1, bool i2 = false, bool i3 = false, bool i4 = false, bool i5 = false, bool i6 = false, bool i7 = false, bool i8 = false, bool i9 = false, bool i10 = false, bool i11 = false, bool i12 = false, bool i13 = false, bool i14 = false, bool i15 = false, bool i16 = false, bool i17 = false, bool i18 = false, bool i19 = false, bool i20 = false, bool i21 = false, bool i22 = false, bool i23 = false, bool i24 = false) const {\ - return field_list(d, do_nothing, i1, i2, i3, i4, i5, i6, i7, i8, i9, i10, i11, i12, i13, i14, i15, i16, i17, i18, i19, i20, i21, i22, i23, i24);\ - }\ - NAME##_cus_field_list field_list(cchar *d,\ - NAME##_enum i1, NAME##_enum i2 = NAME##_NULL, NAME##_enum i3 = NAME##_NULL, NAME##_enum i4 = NAME##_NULL, NAME##_enum i5 = NAME##_NULL, NAME##_enum i6 = NAME##_NULL, NAME##_enum i7 = NAME##_NULL, NAME##_enum i8 = NAME##_NULL, NAME##_enum i9 = NAME##_NULL, NAME##_enum i10 = NAME##_NULL, NAME##_enum i11 = NAME##_NULL, NAME##_enum i12 = NAME##_NULL, NAME##_enum i13 = NAME##_NULL, NAME##_enum i14 = NAME##_NULL, NAME##_enum i15 = NAME##_NULL, NAME##_enum i16 = NAME##_NULL, NAME##_enum i17 = NAME##_NULL, NAME##_enum i18 = NAME##_NULL, NAME##_enum i19 = NAME##_NULL, NAME##_enum i20 = NAME##_NULL, NAME##_enum i21 = NAME##_NULL, NAME##_enum i22 = NAME##_NULL, NAME##_enum i23 = NAME##_NULL, NAME##_enum i24 = NAME##_NULL) const {\ - return field_list(d, do_nothing, i1, i2, i3, i4, i5, i6, i7, i8, i9, i10, i11, i12, i13, i14, i15, i16, i17, i18, i19, i20, i21, i22, i23, i24);\ - }\ - NAME##_cus_field_list field_list(cchar *d, \ - std::vector *i) const {\ - return field_list(d, do_nothing, i);\ - }\ - NAME##_cus_field_list field_list(cchar *d, \ - sql_cmp_type sc) const {\ - return field_list(d, do_nothing, sc);\ - }\ - template \ - NAME##_cus_field_list field_list(cchar *d, Manip m,\ - bool i1, bool i2 = false, bool i3 = false, bool i4 = false, bool i5 = false, bool i6 = false, bool i7 = false, bool i8 = false, bool i9 = false, bool i10 = false, bool i11 = false, bool i12 = false, bool i13 = false, bool i14 = false, bool i15 = false, bool i16 = false, bool i17 = false, bool i18 = false, bool i19 = false, bool i20 = false, bool i21 = false, bool i22 = false, bool i23 = false, bool i24 = false) const; \ - template \ - NAME##_cus_field_list field_list(cchar *d, Manip m,\ - NAME##_enum i1, NAME##_enum i2 = NAME##_NULL, NAME##_enum i3 = NAME##_NULL, NAME##_enum i4 = NAME##_NULL, NAME##_enum i5 = NAME##_NULL, NAME##_enum i6 = NAME##_NULL, NAME##_enum i7 = NAME##_NULL, NAME##_enum i8 = NAME##_NULL, NAME##_enum i9 = NAME##_NULL, NAME##_enum i10 = NAME##_NULL, NAME##_enum i11 = NAME##_NULL, NAME##_enum i12 = NAME##_NULL, NAME##_enum i13 = NAME##_NULL, NAME##_enum i14 = NAME##_NULL, NAME##_enum i15 = NAME##_NULL, NAME##_enum i16 = NAME##_NULL, NAME##_enum i17 = NAME##_NULL, NAME##_enum i18 = NAME##_NULL, NAME##_enum i19 = NAME##_NULL, NAME##_enum i20 = NAME##_NULL, NAME##_enum i21 = NAME##_NULL, NAME##_enum i22 = NAME##_NULL, NAME##_enum i23 = NAME##_NULL, NAME##_enum i24 = NAME##_NULL) const; \ - template \ - NAME##_cus_field_list field_list(cchar *d, Manip m,\ - std::vector *i) const;\ - template \ - NAME##_cus_field_list field_list(cchar *d, Manip m, \ - sql_cmp_type sc) const;\ - /* cus equal */\ - NAME##_cus_equal_list equal_list(bool i1, bool i2 = false, bool i3 = false, bool i4 = false, bool i5 = false, bool i6 = false, bool i7 = false, bool i8 = false, bool i9 = false, bool i10 = false, bool i11 = false, bool i12 = false, bool i13 = false, bool i14 = false, bool i15 = false, bool i16 = false, bool i17 = false, bool i18 = false, bool i19 = false, bool i20 = false, bool i21 = false, bool i22 = false, bool i23 = false, bool i24 = false) const {\ - return equal_list(",", " = ", quote, i1, i2, i3, i4, i5, i6, i7, i8, i9, i10, i11, i12, i13, i14, i15, i16, i17, i18, i19, i20, i21, i22, i23, i24);\ - }\ - NAME##_cus_equal_list equal_list(NAME##_enum i1, NAME##_enum i2 = NAME##_NULL, NAME##_enum i3 = NAME##_NULL, NAME##_enum i4 = NAME##_NULL, NAME##_enum i5 = NAME##_NULL, NAME##_enum i6 = NAME##_NULL, NAME##_enum i7 = NAME##_NULL, NAME##_enum i8 = NAME##_NULL, NAME##_enum i9 = NAME##_NULL, NAME##_enum i10 = NAME##_NULL, NAME##_enum i11 = NAME##_NULL, NAME##_enum i12 = NAME##_NULL, NAME##_enum i13 = NAME##_NULL, NAME##_enum i14 = NAME##_NULL, NAME##_enum i15 = NAME##_NULL, NAME##_enum i16 = NAME##_NULL, NAME##_enum i17 = NAME##_NULL, NAME##_enum i18 = NAME##_NULL, NAME##_enum i19 = NAME##_NULL, NAME##_enum i20 = NAME##_NULL, NAME##_enum i21 = NAME##_NULL, NAME##_enum i22 = NAME##_NULL, NAME##_enum i23 = NAME##_NULL, NAME##_enum i24 = NAME##_NULL) const {\ - return equal_list(",", " = ", quote, i1, i2, i3, i4, i5, i6, i7, i8, i9, i10, i11, i12, i13, i14, i15, i16, i17, i18, i19, i20, i21, i22, i23, i24);\ - }\ - NAME##_cus_equal_list equal_list(std::vector *i) const {\ - return equal_list(",", " = ", quote, i);\ - }\ - NAME##_cus_equal_list equal_list(sql_cmp_type sc) const {\ - return equal_list(",", " = ", quote, sc);\ - }\ - NAME##_cus_equal_list equal_list(cchar *d, bool i1, bool i2 = false, bool i3 = false, bool i4 = false, bool i5 = false, bool i6 = false, bool i7 = false, bool i8 = false, bool i9 = false, bool i10 = false, bool i11 = false, bool i12 = false, bool i13 = false, bool i14 = false, bool i15 = false, bool i16 = false, bool i17 = false, bool i18 = false, bool i19 = false, bool i20 = false, bool i21 = false, bool i22 = false, bool i23 = false, bool i24 = false) const {\ - return equal_list(d, " = ", quote, i1, i2, i3, i4, i5, i6, i7, i8, i9, i10, i11, i12, i13, i14, i15, i16, i17, i18, i19, i20, i21, i22, i23, i24);\ - }\ - NAME##_cus_equal_list equal_list(cchar *d, NAME##_enum i1, NAME##_enum i2 = NAME##_NULL, NAME##_enum i3 = NAME##_NULL, NAME##_enum i4 = NAME##_NULL, NAME##_enum i5 = NAME##_NULL, NAME##_enum i6 = NAME##_NULL, NAME##_enum i7 = NAME##_NULL, NAME##_enum i8 = NAME##_NULL, NAME##_enum i9 = NAME##_NULL, NAME##_enum i10 = NAME##_NULL, NAME##_enum i11 = NAME##_NULL, NAME##_enum i12 = NAME##_NULL, NAME##_enum i13 = NAME##_NULL, NAME##_enum i14 = NAME##_NULL, NAME##_enum i15 = NAME##_NULL, NAME##_enum i16 = NAME##_NULL, NAME##_enum i17 = NAME##_NULL, NAME##_enum i18 = NAME##_NULL, NAME##_enum i19 = NAME##_NULL, NAME##_enum i20 = NAME##_NULL, NAME##_enum i21 = NAME##_NULL, NAME##_enum i22 = NAME##_NULL, NAME##_enum i23 = NAME##_NULL, NAME##_enum i24 = NAME##_NULL) const {\ - return equal_list(d, " = ", quote, i1, i2, i3, i4, i5, i6, i7, i8, i9, i10, i11, i12, i13, i14, i15, i16, i17, i18, i19, i20, i21, i22, i23, i24);\ - }\ - NAME##_cus_equal_list equal_list(cchar *d, \ - std::vector *i) const {\ - return equal_list(d, " = ", quote, i);\ - }\ - NAME##_cus_equal_list equal_list(cchar *d, \ - sql_cmp_type sc) const {\ - return equal_list(d, " = ", quote, sc);\ - }\ - NAME##_cus_equal_list equal_list(cchar *d, cchar *c,\ - bool i1, bool i2 = false, bool i3 = false, bool i4 = false, bool i5 = false, bool i6 = false, bool i7 = false, bool i8 = false, bool i9 = false, bool i10 = false, bool i11 = false, bool i12 = false, bool i13 = false, bool i14 = false, bool i15 = false, bool i16 = false, bool i17 = false, bool i18 = false, bool i19 = false, bool i20 = false, bool i21 = false, bool i22 = false, bool i23 = false, bool i24 = false) const {\ - return equal_list(d, c, quote, i1, i2, i3, i4, i5, i6, i7, i8, i9, i10, i11, i12, i13, i14, i15, i16, i17, i18, i19, i20, i21, i22, i23, i24);\ - }\ - NAME##_cus_equal_list equal_list(cchar *d, cchar *c,\ - NAME##_enum i1, NAME##_enum i2 = NAME##_NULL, NAME##_enum i3 = NAME##_NULL, NAME##_enum i4 = NAME##_NULL, NAME##_enum i5 = NAME##_NULL, NAME##_enum i6 = NAME##_NULL, NAME##_enum i7 = NAME##_NULL, NAME##_enum i8 = NAME##_NULL, NAME##_enum i9 = NAME##_NULL, NAME##_enum i10 = NAME##_NULL, NAME##_enum i11 = NAME##_NULL, NAME##_enum i12 = NAME##_NULL, NAME##_enum i13 = NAME##_NULL, NAME##_enum i14 = NAME##_NULL, NAME##_enum i15 = NAME##_NULL, NAME##_enum i16 = NAME##_NULL, NAME##_enum i17 = NAME##_NULL, NAME##_enum i18 = NAME##_NULL, NAME##_enum i19 = NAME##_NULL, NAME##_enum i20 = NAME##_NULL, NAME##_enum i21 = NAME##_NULL, NAME##_enum i22 = NAME##_NULL, NAME##_enum i23 = NAME##_NULL, NAME##_enum i24 = NAME##_NULL) const {\ - return equal_list(d, c, quote, i1, i2, i3, i4, i5, i6, i7, i8, i9, i10, i11, i12, i13, i14, i15, i16, i17, i18, i19, i20, i21, i22, i23, i24);\ - }\ - NAME##_cus_equal_list equal_list(cchar *d, cchar *c,\ - std::vector *i) const {\ - return equal_list(d, c, quote, i);\ - }\ - NAME##_cus_equal_list equal_list(cchar *d, cchar *c,\ - sql_cmp_type sc) const {\ - return equal_list(d, c, quote, sc);\ - }\ - template \ - NAME##_cus_equal_list equal_list(cchar *d, cchar *c, Manip m, \ - bool i1, bool i2 = false, bool i3 = false, bool i4 = false, bool i5 = false, bool i6 = false, bool i7 = false, bool i8 = false, bool i9 = false, bool i10 = false, bool i11 = false, bool i12 = false, bool i13 = false, bool i14 = false, bool i15 = false, bool i16 = false, bool i17 = false, bool i18 = false, bool i19 = false, bool i20 = false, bool i21 = false, bool i22 = false, bool i23 = false, bool i24 = false) const; \ - template \ - NAME##_cus_equal_list equal_list(cchar *d, cchar *c, Manip m, \ - NAME##_enum i1, NAME##_enum i2 = NAME##_NULL, NAME##_enum i3 = NAME##_NULL, NAME##_enum i4 = NAME##_NULL, NAME##_enum i5 = NAME##_NULL, NAME##_enum i6 = NAME##_NULL, NAME##_enum i7 = NAME##_NULL, NAME##_enum i8 = NAME##_NULL, NAME##_enum i9 = NAME##_NULL, NAME##_enum i10 = NAME##_NULL, NAME##_enum i11 = NAME##_NULL, NAME##_enum i12 = NAME##_NULL, NAME##_enum i13 = NAME##_NULL, NAME##_enum i14 = NAME##_NULL, NAME##_enum i15 = NAME##_NULL, NAME##_enum i16 = NAME##_NULL, NAME##_enum i17 = NAME##_NULL, NAME##_enum i18 = NAME##_NULL, NAME##_enum i19 = NAME##_NULL, NAME##_enum i20 = NAME##_NULL, NAME##_enum i21 = NAME##_NULL, NAME##_enum i22 = NAME##_NULL, NAME##_enum i23 = NAME##_NULL, NAME##_enum i24 = NAME##_NULL) const; \ - template \ - NAME##_cus_equal_list equal_list(cchar *d, cchar *c, Manip m, \ - std::vector *i) const;\ - template \ - NAME##_cus_equal_list equal_list(cchar *d, cchar *c, Manip m, \ - sql_cmp_type sc) const;\ - }; \ - const char *NAME::names[] = { \ - N1 ,\ - N2 ,\ - N3 ,\ - N4 ,\ - N5 ,\ - N6 ,\ - N7 ,\ - N8 ,\ - N9 ,\ - N10 ,\ - N11 ,\ - N12 ,\ - N13 ,\ - N14 ,\ - N15 ,\ - N16 ,\ - N17 ,\ - N18 ,\ - N19 ,\ - N20 ,\ - N21 ,\ - N22 ,\ - N23 ,\ - N24 \ - }; \ - const char *NAME::_table = #NAME ; \ - template \ - NAME##_cus_value_list::NAME##_cus_value_list\ - (const NAME *o, cchar *d, Manip m, bool i1, bool i2, bool i3, bool i4, bool i5, bool i6, bool i7, bool i8, bool i9, bool i10, bool i11, bool i12, bool i13, bool i14, bool i15, bool i16, bool i17, bool i18, bool i19, bool i20, bool i21, bool i22, bool i23, bool i24) \ - { \ - delem = d;\ - manip = m;\ - del_vector = true;\ - obj = o; \ - include = new std::vector(24, false);\ - if (i1) (*include)[0]=true;\ - if (i2) (*include)[1]=true;\ - if (i3) (*include)[2]=true;\ - if (i4) (*include)[3]=true;\ - if (i5) (*include)[4]=true;\ - if (i6) (*include)[5]=true;\ - if (i7) (*include)[6]=true;\ - if (i8) (*include)[7]=true;\ - if (i9) (*include)[8]=true;\ - if (i10) (*include)[9]=true;\ - if (i11) (*include)[10]=true;\ - if (i12) (*include)[11]=true;\ - if (i13) (*include)[12]=true;\ - if (i14) (*include)[13]=true;\ - if (i15) (*include)[14]=true;\ - if (i16) (*include)[15]=true;\ - if (i17) (*include)[16]=true;\ - if (i18) (*include)[17]=true;\ - if (i19) (*include)[18]=true;\ - if (i20) (*include)[19]=true;\ - if (i21) (*include)[20]=true;\ - if (i22) (*include)[21]=true;\ - if (i23) (*include)[22]=true;\ - if (i24) (*include)[23]=true;\ - } \ - template \ - NAME##_cus_value_list::NAME##_cus_value_list\ - (const NAME *o, cchar *d, Manip m, NAME##_enum i1, NAME##_enum i2, NAME##_enum i3, NAME##_enum i4, NAME##_enum i5, NAME##_enum i6, NAME##_enum i7, NAME##_enum i8, NAME##_enum i9, NAME##_enum i10, NAME##_enum i11, NAME##_enum i12, NAME##_enum i13, NAME##_enum i14, NAME##_enum i15, NAME##_enum i16, NAME##_enum i17, NAME##_enum i18, NAME##_enum i19, NAME##_enum i20, NAME##_enum i21, NAME##_enum i22, NAME##_enum i23, NAME##_enum i24) { \ - delem = d;\ - manip = m;\ - del_vector = true; \ - obj = o; \ - include = new std::vector(24, false); \ - if (i1 == NAME##_NULL) return;\ - (*include)[i1]=true;\ - if (i2 == NAME##_NULL) return;\ - (*include)[i2]=true;\ - if (i3 == NAME##_NULL) return;\ - (*include)[i3]=true;\ - if (i4 == NAME##_NULL) return;\ - (*include)[i4]=true;\ - if (i5 == NAME##_NULL) return;\ - (*include)[i5]=true;\ - if (i6 == NAME##_NULL) return;\ - (*include)[i6]=true;\ - if (i7 == NAME##_NULL) return;\ - (*include)[i7]=true;\ - if (i8 == NAME##_NULL) return;\ - (*include)[i8]=true;\ - if (i9 == NAME##_NULL) return;\ - (*include)[i9]=true;\ - if (i10 == NAME##_NULL) return;\ - (*include)[i10]=true;\ - if (i11 == NAME##_NULL) return;\ - (*include)[i11]=true;\ - if (i12 == NAME##_NULL) return;\ - (*include)[i12]=true;\ - if (i13 == NAME##_NULL) return;\ - (*include)[i13]=true;\ - if (i14 == NAME##_NULL) return;\ - (*include)[i14]=true;\ - if (i15 == NAME##_NULL) return;\ - (*include)[i15]=true;\ - if (i16 == NAME##_NULL) return;\ - (*include)[i16]=true;\ - if (i17 == NAME##_NULL) return;\ - (*include)[i17]=true;\ - if (i18 == NAME##_NULL) return;\ - (*include)[i18]=true;\ - if (i19 == NAME##_NULL) return;\ - (*include)[i19]=true;\ - if (i20 == NAME##_NULL) return;\ - (*include)[i20]=true;\ - if (i21 == NAME##_NULL) return;\ - (*include)[i21]=true;\ - if (i22 == NAME##_NULL) return;\ - (*include)[i22]=true;\ - if (i23 == NAME##_NULL) return;\ - (*include)[i23]=true;\ - if (i24 == NAME##_NULL) return;\ - (*include)[i24]=true;\ - }\ - template \ - NAME##_cus_field_list::NAME##_cus_field_list\ - (const NAME *o, cchar *d, Manip m, bool i1, bool i2, bool i3, bool i4, bool i5, bool i6, bool i7, bool i8, bool i9, bool i10, bool i11, bool i12, bool i13, bool i14, bool i15, bool i16, bool i17, bool i18, bool i19, bool i20, bool i21, bool i22, bool i23, bool i24) {\ - delem = d;\ - manip = m;\ - del_vector = true; \ - obj = o; \ - include = new std::vector(24, false); \ - if (i1) (*include)[0]=true;\ - if (i2) (*include)[1]=true;\ - if (i3) (*include)[2]=true;\ - if (i4) (*include)[3]=true;\ - if (i5) (*include)[4]=true;\ - if (i6) (*include)[5]=true;\ - if (i7) (*include)[6]=true;\ - if (i8) (*include)[7]=true;\ - if (i9) (*include)[8]=true;\ - if (i10) (*include)[9]=true;\ - if (i11) (*include)[10]=true;\ - if (i12) (*include)[11]=true;\ - if (i13) (*include)[12]=true;\ - if (i14) (*include)[13]=true;\ - if (i15) (*include)[14]=true;\ - if (i16) (*include)[15]=true;\ - if (i17) (*include)[16]=true;\ - if (i18) (*include)[17]=true;\ - if (i19) (*include)[18]=true;\ - if (i20) (*include)[19]=true;\ - if (i21) (*include)[20]=true;\ - if (i22) (*include)[21]=true;\ - if (i23) (*include)[22]=true;\ - if (i24) (*include)[23]=true;\ - } \ - template \ - NAME##_cus_field_list::NAME##_cus_field_list\ - (const NAME *o, cchar *d, Manip m, NAME##_enum i1, NAME##_enum i2, NAME##_enum i3, NAME##_enum i4, NAME##_enum i5, NAME##_enum i6, NAME##_enum i7, NAME##_enum i8, NAME##_enum i9, NAME##_enum i10, NAME##_enum i11, NAME##_enum i12, NAME##_enum i13, NAME##_enum i14, NAME##_enum i15, NAME##_enum i16, NAME##_enum i17, NAME##_enum i18, NAME##_enum i19, NAME##_enum i20, NAME##_enum i21, NAME##_enum i22, NAME##_enum i23, NAME##_enum i24) { \ - delem = d;\ - manip = m;\ - del_vector = true; \ - obj = o; \ - include = new std::vector(24, false); \ - if (i1 == NAME##_NULL) return;\ - (*include)[i1]=true;\ - if (i2 == NAME##_NULL) return;\ - (*include)[i2]=true;\ - if (i3 == NAME##_NULL) return;\ - (*include)[i3]=true;\ - if (i4 == NAME##_NULL) return;\ - (*include)[i4]=true;\ - if (i5 == NAME##_NULL) return;\ - (*include)[i5]=true;\ - if (i6 == NAME##_NULL) return;\ - (*include)[i6]=true;\ - if (i7 == NAME##_NULL) return;\ - (*include)[i7]=true;\ - if (i8 == NAME##_NULL) return;\ - (*include)[i8]=true;\ - if (i9 == NAME##_NULL) return;\ - (*include)[i9]=true;\ - if (i10 == NAME##_NULL) return;\ - (*include)[i10]=true;\ - if (i11 == NAME##_NULL) return;\ - (*include)[i11]=true;\ - if (i12 == NAME##_NULL) return;\ - (*include)[i12]=true;\ - if (i13 == NAME##_NULL) return;\ - (*include)[i13]=true;\ - if (i14 == NAME##_NULL) return;\ - (*include)[i14]=true;\ - if (i15 == NAME##_NULL) return;\ - (*include)[i15]=true;\ - if (i16 == NAME##_NULL) return;\ - (*include)[i16]=true;\ - if (i17 == NAME##_NULL) return;\ - (*include)[i17]=true;\ - if (i18 == NAME##_NULL) return;\ - (*include)[i18]=true;\ - if (i19 == NAME##_NULL) return;\ - (*include)[i19]=true;\ - if (i20 == NAME##_NULL) return;\ - (*include)[i20]=true;\ - if (i21 == NAME##_NULL) return;\ - (*include)[i21]=true;\ - if (i22 == NAME##_NULL) return;\ - (*include)[i22]=true;\ - if (i23 == NAME##_NULL) return;\ - (*include)[i23]=true;\ - if (i24 == NAME##_NULL) return;\ - (*include)[i24]=true;\ - }\ - template \ - NAME##_cus_equal_list::NAME##_cus_equal_list\ - (const NAME *o, cchar *d, cchar *c, Manip m, bool i1, bool i2, bool i3, bool i4, bool i5, bool i6, bool i7, bool i8, bool i9, bool i10, bool i11, bool i12, bool i13, bool i14, bool i15, bool i16, bool i17, bool i18, bool i19, bool i20, bool i21, bool i22, bool i23, bool i24) { \ - delem = d;\ - comp = c;\ - manip = m;\ - del_vector = true; \ - obj = o; \ - include = new std::vector(24, false); \ - if (i1) (*include)[0]=true;\ - if (i2) (*include)[1]=true;\ - if (i3) (*include)[2]=true;\ - if (i4) (*include)[3]=true;\ - if (i5) (*include)[4]=true;\ - if (i6) (*include)[5]=true;\ - if (i7) (*include)[6]=true;\ - if (i8) (*include)[7]=true;\ - if (i9) (*include)[8]=true;\ - if (i10) (*include)[9]=true;\ - if (i11) (*include)[10]=true;\ - if (i12) (*include)[11]=true;\ - if (i13) (*include)[12]=true;\ - if (i14) (*include)[13]=true;\ - if (i15) (*include)[14]=true;\ - if (i16) (*include)[15]=true;\ - if (i17) (*include)[16]=true;\ - if (i18) (*include)[17]=true;\ - if (i19) (*include)[18]=true;\ - if (i20) (*include)[19]=true;\ - if (i21) (*include)[20]=true;\ - if (i22) (*include)[21]=true;\ - if (i23) (*include)[22]=true;\ - if (i24) (*include)[23]=true;\ - } \ - template \ - NAME##_cus_equal_list::NAME##_cus_equal_list\ - (const NAME *o, cchar *d, cchar *c, Manip m, NAME##_enum i1, NAME##_enum i2, NAME##_enum i3, NAME##_enum i4, NAME##_enum i5, NAME##_enum i6, NAME##_enum i7, NAME##_enum i8, NAME##_enum i9, NAME##_enum i10, NAME##_enum i11, NAME##_enum i12, NAME##_enum i13, NAME##_enum i14, NAME##_enum i15, NAME##_enum i16, NAME##_enum i17, NAME##_enum i18, NAME##_enum i19, NAME##_enum i20, NAME##_enum i21, NAME##_enum i22, NAME##_enum i23, NAME##_enum i24) { \ - delem = d;\ - comp = c;\ - manip = m;\ - del_vector = true; \ - obj = o; \ - include = new std::vector(24, false); \ - if (i1 == NAME##_NULL) return;\ - (*include)[i1]=true;\ - if (i2 == NAME##_NULL) return;\ - (*include)[i2]=true;\ - if (i3 == NAME##_NULL) return;\ - (*include)[i3]=true;\ - if (i4 == NAME##_NULL) return;\ - (*include)[i4]=true;\ - if (i5 == NAME##_NULL) return;\ - (*include)[i5]=true;\ - if (i6 == NAME##_NULL) return;\ - (*include)[i6]=true;\ - if (i7 == NAME##_NULL) return;\ - (*include)[i7]=true;\ - if (i8 == NAME##_NULL) return;\ - (*include)[i8]=true;\ - if (i9 == NAME##_NULL) return;\ - (*include)[i9]=true;\ - if (i10 == NAME##_NULL) return;\ - (*include)[i10]=true;\ - if (i11 == NAME##_NULL) return;\ - (*include)[i11]=true;\ - if (i12 == NAME##_NULL) return;\ - (*include)[i12]=true;\ - if (i13 == NAME##_NULL) return;\ - (*include)[i13]=true;\ - if (i14 == NAME##_NULL) return;\ - (*include)[i14]=true;\ - if (i15 == NAME##_NULL) return;\ - (*include)[i15]=true;\ - if (i16 == NAME##_NULL) return;\ - (*include)[i16]=true;\ - if (i17 == NAME##_NULL) return;\ - (*include)[i17]=true;\ - if (i18 == NAME##_NULL) return;\ - (*include)[i18]=true;\ - if (i19 == NAME##_NULL) return;\ - (*include)[i19]=true;\ - if (i20 == NAME##_NULL) return;\ - (*include)[i20]=true;\ - if (i21 == NAME##_NULL) return;\ - (*include)[i21]=true;\ - if (i22 == NAME##_NULL) return;\ - (*include)[i22]=true;\ - if (i23 == NAME##_NULL) return;\ - (*include)[i23]=true;\ - if (i24 == NAME##_NULL) return;\ - (*include)[i24]=true;\ - }\ - template \ - std::ostream& operator << (std::ostream& s, const NAME##_value_list& obj) { \ - s << obj.manip << obj.obj->I1 << obj.delem;\ - s << obj.manip << obj.obj->I2 << obj.delem;\ - s << obj.manip << obj.obj->I3 << obj.delem;\ - s << obj.manip << obj.obj->I4 << obj.delem;\ - s << obj.manip << obj.obj->I5 << obj.delem;\ - s << obj.manip << obj.obj->I6 << obj.delem;\ - s << obj.manip << obj.obj->I7 << obj.delem;\ - s << obj.manip << obj.obj->I8 << obj.delem;\ - s << obj.manip << obj.obj->I9 << obj.delem;\ - s << obj.manip << obj.obj->I10 << obj.delem;\ - s << obj.manip << obj.obj->I11 << obj.delem;\ - s << obj.manip << obj.obj->I12 << obj.delem;\ - s << obj.manip << obj.obj->I13 << obj.delem;\ - s << obj.manip << obj.obj->I14 << obj.delem;\ - s << obj.manip << obj.obj->I15 << obj.delem;\ - s << obj.manip << obj.obj->I16 << obj.delem;\ - s << obj.manip << obj.obj->I17 << obj.delem;\ - s << obj.manip << obj.obj->I18 << obj.delem;\ - s << obj.manip << obj.obj->I19 << obj.delem;\ - s << obj.manip << obj.obj->I20 << obj.delem;\ - s << obj.manip << obj.obj->I21 << obj.delem;\ - s << obj.manip << obj.obj->I22 << obj.delem;\ - s << obj.manip << obj.obj->I23 << obj.delem;\ - s << obj.manip << obj.obj->I24; \ - return s; \ - } \ - template \ - std::ostream& operator << (std::ostream& s, const NAME##_field_list& obj) { \ - s << obj.manip << obj.obj->names[0] << obj.delem;\ - s << obj.manip << obj.obj->names[1] << obj.delem;\ - s << obj.manip << obj.obj->names[2] << obj.delem;\ - s << obj.manip << obj.obj->names[3] << obj.delem;\ - s << obj.manip << obj.obj->names[4] << obj.delem;\ - s << obj.manip << obj.obj->names[5] << obj.delem;\ - s << obj.manip << obj.obj->names[6] << obj.delem;\ - s << obj.manip << obj.obj->names[7] << obj.delem;\ - s << obj.manip << obj.obj->names[8] << obj.delem;\ - s << obj.manip << obj.obj->names[9] << obj.delem;\ - s << obj.manip << obj.obj->names[10] << obj.delem;\ - s << obj.manip << obj.obj->names[11] << obj.delem;\ - s << obj.manip << obj.obj->names[12] << obj.delem;\ - s << obj.manip << obj.obj->names[13] << obj.delem;\ - s << obj.manip << obj.obj->names[14] << obj.delem;\ - s << obj.manip << obj.obj->names[15] << obj.delem;\ - s << obj.manip << obj.obj->names[16] << obj.delem;\ - s << obj.manip << obj.obj->names[17] << obj.delem;\ - s << obj.manip << obj.obj->names[18] << obj.delem;\ - s << obj.manip << obj.obj->names[19] << obj.delem;\ - s << obj.manip << obj.obj->names[20] << obj.delem;\ - s << obj.manip << obj.obj->names[21] << obj.delem;\ - s << obj.manip << obj.obj->names[22] << obj.delem;\ - s << obj.manip << obj.obj->names[23]; \ - return s; \ - } \ - template \ - std::ostream& operator << (std::ostream& s, const NAME##_equal_list& obj) { \ - s << obj.obj->names[0] << obj.comp << obj.manip << obj.obj->I1 << obj.delem;\ - s << obj.obj->names[1] << obj.comp << obj.manip << obj.obj->I2 << obj.delem;\ - s << obj.obj->names[2] << obj.comp << obj.manip << obj.obj->I3 << obj.delem;\ - s << obj.obj->names[3] << obj.comp << obj.manip << obj.obj->I4 << obj.delem;\ - s << obj.obj->names[4] << obj.comp << obj.manip << obj.obj->I5 << obj.delem;\ - s << obj.obj->names[5] << obj.comp << obj.manip << obj.obj->I6 << obj.delem;\ - s << obj.obj->names[6] << obj.comp << obj.manip << obj.obj->I7 << obj.delem;\ - s << obj.obj->names[7] << obj.comp << obj.manip << obj.obj->I8 << obj.delem;\ - s << obj.obj->names[8] << obj.comp << obj.manip << obj.obj->I9 << obj.delem;\ - s << obj.obj->names[9] << obj.comp << obj.manip << obj.obj->I10 << obj.delem;\ - s << obj.obj->names[10] << obj.comp << obj.manip << obj.obj->I11 << obj.delem;\ - s << obj.obj->names[11] << obj.comp << obj.manip << obj.obj->I12 << obj.delem;\ - s << obj.obj->names[12] << obj.comp << obj.manip << obj.obj->I13 << obj.delem;\ - s << obj.obj->names[13] << obj.comp << obj.manip << obj.obj->I14 << obj.delem;\ - s << obj.obj->names[14] << obj.comp << obj.manip << obj.obj->I15 << obj.delem;\ - s << obj.obj->names[15] << obj.comp << obj.manip << obj.obj->I16 << obj.delem;\ - s << obj.obj->names[16] << obj.comp << obj.manip << obj.obj->I17 << obj.delem;\ - s << obj.obj->names[17] << obj.comp << obj.manip << obj.obj->I18 << obj.delem;\ - s << obj.obj->names[18] << obj.comp << obj.manip << obj.obj->I19 << obj.delem;\ - s << obj.obj->names[19] << obj.comp << obj.manip << obj.obj->I20 << obj.delem;\ - s << obj.obj->names[20] << obj.comp << obj.manip << obj.obj->I21 << obj.delem;\ - s << obj.obj->names[21] << obj.comp << obj.manip << obj.obj->I22 << obj.delem;\ - s << obj.obj->names[22] << obj.comp << obj.manip << obj.obj->I23 << obj.delem;\ - s << obj.obj->names[23] << obj.comp << obj.manip << obj.obj->I24; \ - return s; \ - } \ - template \ - std::ostream& operator << (std::ostream& s, const NAME##_cus_value_list& obj) { \ - bool before = false; \ - if ((*obj.include)[0]) { \ - s << obj.manip << obj.obj->I1;\ - before = true; \ - } \ - if ((*obj.include)[1]) { \ - if (before) s << obj.delem;\ - s << obj.manip << obj.obj->I2;\ - before = true; \ - } \ - if ((*obj.include)[2]) { \ - if (before) s << obj.delem;\ - s << obj.manip << obj.obj->I3;\ - before = true; \ - } \ - if ((*obj.include)[3]) { \ - if (before) s << obj.delem;\ - s << obj.manip << obj.obj->I4;\ - before = true; \ - } \ - if ((*obj.include)[4]) { \ - if (before) s << obj.delem;\ - s << obj.manip << obj.obj->I5;\ - before = true; \ - } \ - if ((*obj.include)[5]) { \ - if (before) s << obj.delem;\ - s << obj.manip << obj.obj->I6;\ - before = true; \ - } \ - if ((*obj.include)[6]) { \ - if (before) s << obj.delem;\ - s << obj.manip << obj.obj->I7;\ - before = true; \ - } \ - if ((*obj.include)[7]) { \ - if (before) s << obj.delem;\ - s << obj.manip << obj.obj->I8;\ - before = true; \ - } \ - if ((*obj.include)[8]) { \ - if (before) s << obj.delem;\ - s << obj.manip << obj.obj->I9;\ - before = true; \ - } \ - if ((*obj.include)[9]) { \ - if (before) s << obj.delem;\ - s << obj.manip << obj.obj->I10;\ - before = true; \ - } \ - if ((*obj.include)[10]) { \ - if (before) s << obj.delem;\ - s << obj.manip << obj.obj->I11;\ - before = true; \ - } \ - if ((*obj.include)[11]) { \ - if (before) s << obj.delem;\ - s << obj.manip << obj.obj->I12;\ - before = true; \ - } \ - if ((*obj.include)[12]) { \ - if (before) s << obj.delem;\ - s << obj.manip << obj.obj->I13;\ - before = true; \ - } \ - if ((*obj.include)[13]) { \ - if (before) s << obj.delem;\ - s << obj.manip << obj.obj->I14;\ - before = true; \ - } \ - if ((*obj.include)[14]) { \ - if (before) s << obj.delem;\ - s << obj.manip << obj.obj->I15;\ - before = true; \ - } \ - if ((*obj.include)[15]) { \ - if (before) s << obj.delem;\ - s << obj.manip << obj.obj->I16;\ - before = true; \ - } \ - if ((*obj.include)[16]) { \ - if (before) s << obj.delem;\ - s << obj.manip << obj.obj->I17;\ - before = true; \ - } \ - if ((*obj.include)[17]) { \ - if (before) s << obj.delem;\ - s << obj.manip << obj.obj->I18;\ - before = true; \ - } \ - if ((*obj.include)[18]) { \ - if (before) s << obj.delem;\ - s << obj.manip << obj.obj->I19;\ - before = true; \ - } \ - if ((*obj.include)[19]) { \ - if (before) s << obj.delem;\ - s << obj.manip << obj.obj->I20;\ - before = true; \ - } \ - if ((*obj.include)[20]) { \ - if (before) s << obj.delem;\ - s << obj.manip << obj.obj->I21;\ - before = true; \ - } \ - if ((*obj.include)[21]) { \ - if (before) s << obj.delem;\ - s << obj.manip << obj.obj->I22;\ - before = true; \ - } \ - if ((*obj.include)[22]) { \ - if (before) s << obj.delem;\ - s << obj.manip << obj.obj->I23;\ - before = true; \ - } \ - if ((*obj.include)[23]) { \ - if (before) s << obj.delem;\ - s << obj.manip << obj.obj->I24;\ - } \ - return s; \ - } \ - template \ - std::ostream& operator << (std::ostream& s, const NAME##_cus_field_list& obj) { \ - bool before = false; \ - if ((*obj.include)[0]) { \ - s << obj.manip << obj.obj->names[0];\ - before = true; \ - } \ - if ((*obj.include)[1]) { \ - if (before) s << obj.delem;\ - s << obj.manip << obj.obj->names[1];\ - before = true; \ - } \ - if ((*obj.include)[2]) { \ - if (before) s << obj.delem;\ - s << obj.manip << obj.obj->names[2];\ - before = true; \ - } \ - if ((*obj.include)[3]) { \ - if (before) s << obj.delem;\ - s << obj.manip << obj.obj->names[3];\ - before = true; \ - } \ - if ((*obj.include)[4]) { \ - if (before) s << obj.delem;\ - s << obj.manip << obj.obj->names[4];\ - before = true; \ - } \ - if ((*obj.include)[5]) { \ - if (before) s << obj.delem;\ - s << obj.manip << obj.obj->names[5];\ - before = true; \ - } \ - if ((*obj.include)[6]) { \ - if (before) s << obj.delem;\ - s << obj.manip << obj.obj->names[6];\ - before = true; \ - } \ - if ((*obj.include)[7]) { \ - if (before) s << obj.delem;\ - s << obj.manip << obj.obj->names[7];\ - before = true; \ - } \ - if ((*obj.include)[8]) { \ - if (before) s << obj.delem;\ - s << obj.manip << obj.obj->names[8];\ - before = true; \ - } \ - if ((*obj.include)[9]) { \ - if (before) s << obj.delem;\ - s << obj.manip << obj.obj->names[9];\ - before = true; \ - } \ - if ((*obj.include)[10]) { \ - if (before) s << obj.delem;\ - s << obj.manip << obj.obj->names[10];\ - before = true; \ - } \ - if ((*obj.include)[11]) { \ - if (before) s << obj.delem;\ - s << obj.manip << obj.obj->names[11];\ - before = true; \ - } \ - if ((*obj.include)[12]) { \ - if (before) s << obj.delem;\ - s << obj.manip << obj.obj->names[12];\ - before = true; \ - } \ - if ((*obj.include)[13]) { \ - if (before) s << obj.delem;\ - s << obj.manip << obj.obj->names[13];\ - before = true; \ - } \ - if ((*obj.include)[14]) { \ - if (before) s << obj.delem;\ - s << obj.manip << obj.obj->names[14];\ - before = true; \ - } \ - if ((*obj.include)[15]) { \ - if (before) s << obj.delem;\ - s << obj.manip << obj.obj->names[15];\ - before = true; \ - } \ - if ((*obj.include)[16]) { \ - if (before) s << obj.delem;\ - s << obj.manip << obj.obj->names[16];\ - before = true; \ - } \ - if ((*obj.include)[17]) { \ - if (before) s << obj.delem;\ - s << obj.manip << obj.obj->names[17];\ - before = true; \ - } \ - if ((*obj.include)[18]) { \ - if (before) s << obj.delem;\ - s << obj.manip << obj.obj->names[18];\ - before = true; \ - } \ - if ((*obj.include)[19]) { \ - if (before) s << obj.delem;\ - s << obj.manip << obj.obj->names[19];\ - before = true; \ - } \ - if ((*obj.include)[20]) { \ - if (before) s << obj.delem;\ - s << obj.manip << obj.obj->names[20];\ - before = true; \ - } \ - if ((*obj.include)[21]) { \ - if (before) s << obj.delem;\ - s << obj.manip << obj.obj->names[21];\ - before = true; \ - } \ - if ((*obj.include)[22]) { \ - if (before) s << obj.delem;\ - s << obj.manip << obj.obj->names[22];\ - before = true; \ - } \ - if ((*obj.include)[23]) { \ - if (before) s << obj.delem;\ - s << obj.manip << obj.obj->names[23];\ - } \ - return s; \ - } \ - template \ - std::ostream& operator << (std::ostream& s, const NAME##_cus_equal_list& obj) { \ - bool before = false; \ - if ((*obj.include)[0]) { \ - s << obj.obj->names[0] << obj.comp << obj.manip << obj.obj->I1;\ - before = true; \ - } \ - if ((*obj.include)[1]) { \ - if (before) s << obj.delem;\ - s << obj.obj->names[1] << obj.comp << obj.manip << obj.obj->I2;\ - before = true; \ - } \ - if ((*obj.include)[2]) { \ - if (before) s << obj.delem;\ - s << obj.obj->names[2] << obj.comp << obj.manip << obj.obj->I3;\ - before = true; \ - } \ - if ((*obj.include)[3]) { \ - if (before) s << obj.delem;\ - s << obj.obj->names[3] << obj.comp << obj.manip << obj.obj->I4;\ - before = true; \ - } \ - if ((*obj.include)[4]) { \ - if (before) s << obj.delem;\ - s << obj.obj->names[4] << obj.comp << obj.manip << obj.obj->I5;\ - before = true; \ - } \ - if ((*obj.include)[5]) { \ - if (before) s << obj.delem;\ - s << obj.obj->names[5] << obj.comp << obj.manip << obj.obj->I6;\ - before = true; \ - } \ - if ((*obj.include)[6]) { \ - if (before) s << obj.delem;\ - s << obj.obj->names[6] << obj.comp << obj.manip << obj.obj->I7;\ - before = true; \ - } \ - if ((*obj.include)[7]) { \ - if (before) s << obj.delem;\ - s << obj.obj->names[7] << obj.comp << obj.manip << obj.obj->I8;\ - before = true; \ - } \ - if ((*obj.include)[8]) { \ - if (before) s << obj.delem;\ - s << obj.obj->names[8] << obj.comp << obj.manip << obj.obj->I9;\ - before = true; \ - } \ - if ((*obj.include)[9]) { \ - if (before) s << obj.delem;\ - s << obj.obj->names[9] << obj.comp << obj.manip << obj.obj->I10;\ - before = true; \ - } \ - if ((*obj.include)[10]) { \ - if (before) s << obj.delem;\ - s << obj.obj->names[10] << obj.comp << obj.manip << obj.obj->I11;\ - before = true; \ - } \ - if ((*obj.include)[11]) { \ - if (before) s << obj.delem;\ - s << obj.obj->names[11] << obj.comp << obj.manip << obj.obj->I12;\ - before = true; \ - } \ - if ((*obj.include)[12]) { \ - if (before) s << obj.delem;\ - s << obj.obj->names[12] << obj.comp << obj.manip << obj.obj->I13;\ - before = true; \ - } \ - if ((*obj.include)[13]) { \ - if (before) s << obj.delem;\ - s << obj.obj->names[13] << obj.comp << obj.manip << obj.obj->I14;\ - before = true; \ - } \ - if ((*obj.include)[14]) { \ - if (before) s << obj.delem;\ - s << obj.obj->names[14] << obj.comp << obj.manip << obj.obj->I15;\ - before = true; \ - } \ - if ((*obj.include)[15]) { \ - if (before) s << obj.delem;\ - s << obj.obj->names[15] << obj.comp << obj.manip << obj.obj->I16;\ - before = true; \ - } \ - if ((*obj.include)[16]) { \ - if (before) s << obj.delem;\ - s << obj.obj->names[16] << obj.comp << obj.manip << obj.obj->I17;\ - before = true; \ - } \ - if ((*obj.include)[17]) { \ - if (before) s << obj.delem;\ - s << obj.obj->names[17] << obj.comp << obj.manip << obj.obj->I18;\ - before = true; \ - } \ - if ((*obj.include)[18]) { \ - if (before) s << obj.delem;\ - s << obj.obj->names[18] << obj.comp << obj.manip << obj.obj->I19;\ - before = true; \ - } \ - if ((*obj.include)[19]) { \ - if (before) s << obj.delem;\ - s << obj.obj->names[19] << obj.comp << obj.manip << obj.obj->I20;\ - before = true; \ - } \ - if ((*obj.include)[20]) { \ - if (before) s << obj.delem;\ - s << obj.obj->names[20] << obj.comp << obj.manip << obj.obj->I21;\ - before = true; \ - } \ - if ((*obj.include)[21]) { \ - if (before) s << obj.delem;\ - s << obj.obj->names[21] << obj.comp << obj.manip << obj.obj->I22;\ - before = true; \ - } \ - if ((*obj.include)[22]) { \ - if (before) s << obj.delem;\ - s << obj.obj->names[22] << obj.comp << obj.manip << obj.obj->I23;\ - before = true; \ - } \ - if ((*obj.include)[23]) { \ - if (before) s << obj.delem;\ - s << obj.obj->names[23] << obj.comp << obj.manip << obj.obj->I24;\ - } \ - return s; \ - } \ - template \ - inline NAME##_value_list NAME::value_list(cchar *d, Manip m) const { \ - return NAME##_value_list (this, d, m); \ - } \ - template \ - inline NAME##_field_list NAME::field_list(cchar *d, Manip m) const { \ - return NAME##_field_list (this, d, m); \ - } \ - template \ - inline NAME##_equal_list NAME::equal_list(cchar *d, cchar *c, Manip m) const { \ - return NAME##_equal_list (this, d, c, m); \ - } \ - template \ - inline NAME##_cus_value_list NAME::value_list(cchar *d, Manip m,\ - bool i1, bool i2, bool i3, bool i4, bool i5, bool i6, bool i7, bool i8, bool i9, bool i10, bool i11, bool i12, bool i13, bool i14, bool i15, bool i16, bool i17, bool i18, bool i19, bool i20, bool i21, bool i22, bool i23, bool i24) const {\ - return NAME##_cus_value_list (this, d, m, i1, i2, i3, i4, i5, i6, i7, i8, i9, i10, i11, i12, i13, i14, i15, i16, i17, i18, i19, i20, i21, i22, i23, i24); \ - } \ - template \ - inline NAME##_cus_field_list NAME::field_list(cchar *d, Manip m,\ - bool i1, bool i2, bool i3, bool i4, bool i5, bool i6, bool i7, bool i8, bool i9, bool i10, bool i11, bool i12, bool i13, bool i14, bool i15, bool i16, bool i17, bool i18, bool i19, bool i20, bool i21, bool i22, bool i23, bool i24) const { \ - return NAME##_cus_field_list (this, d, m, i1, i2, i3, i4, i5, i6, i7, i8, i9, i10, i11, i12, i13, i14, i15, i16, i17, i18, i19, i20, i21, i22, i23, i24); \ - } \ - template \ - inline NAME##_cus_equal_list NAME::equal_list(cchar *d, cchar *c, Manip m,\ - bool i1, bool i2, bool i3, bool i4, bool i5, bool i6, bool i7, bool i8, bool i9, bool i10, bool i11, bool i12, bool i13, bool i14, bool i15, bool i16, bool i17, bool i18, bool i19, bool i20, bool i21, bool i22, bool i23, bool i24) const { \ - return NAME##_cus_equal_list (this, d, c, m, i1, i2, i3, i4, i5, i6, i7, i8, i9, i10, i11, i12, i13, i14, i15, i16, i17, i18, i19, i20, i21, i22, i23, i24); \ - } \ - template \ - inline NAME##_cus_value_list NAME::value_list(cchar *d, Manip m,\ - NAME##_enum i1, NAME##_enum i2, NAME##_enum i3, NAME##_enum i4, NAME##_enum i5, NAME##_enum i6, NAME##_enum i7, NAME##_enum i8, NAME##_enum i9, NAME##_enum i10, NAME##_enum i11, NAME##_enum i12, NAME##_enum i13, NAME##_enum i14, NAME##_enum i15, NAME##_enum i16, NAME##_enum i17, NAME##_enum i18, NAME##_enum i19, NAME##_enum i20, NAME##_enum i21, NAME##_enum i22, NAME##_enum i23, NAME##_enum i24) const { \ - return NAME##_cus_value_list (this, d, m, i1, i2, i3, i4, i5, i6, i7, i8, i9, i10, i11, i12, i13, i14, i15, i16, i17, i18, i19, i20, i21, i22, i23, i24); \ - } \ - template \ - inline NAME##_cus_field_list NAME::field_list(cchar *d, Manip m,\ - NAME##_enum i1, NAME##_enum i2, NAME##_enum i3, NAME##_enum i4, NAME##_enum i5, NAME##_enum i6, NAME##_enum i7, NAME##_enum i8, NAME##_enum i9, NAME##_enum i10, NAME##_enum i11, NAME##_enum i12, NAME##_enum i13, NAME##_enum i14, NAME##_enum i15, NAME##_enum i16, NAME##_enum i17, NAME##_enum i18, NAME##_enum i19, NAME##_enum i20, NAME##_enum i21, NAME##_enum i22, NAME##_enum i23, NAME##_enum i24) const {\ - return NAME##_cus_field_list (this, d, m, i1, i2, i3, i4, i5, i6, i7, i8, i9, i10, i11, i12, i13, i14, i15, i16, i17, i18, i19, i20, i21, i22, i23, i24); \ - } \ - template \ - inline NAME##_cus_equal_list NAME::equal_list(cchar *d, cchar *c, Manip m, \ - NAME##_enum i1, NAME##_enum i2, NAME##_enum i3, NAME##_enum i4, NAME##_enum i5, NAME##_enum i6, NAME##_enum i7, NAME##_enum i8, NAME##_enum i9, NAME##_enum i10, NAME##_enum i11, NAME##_enum i12, NAME##_enum i13, NAME##_enum i14, NAME##_enum i15, NAME##_enum i16, NAME##_enum i17, NAME##_enum i18, NAME##_enum i19, NAME##_enum i20, NAME##_enum i21, NAME##_enum i22, NAME##_enum i23, NAME##_enum i24) const { \ - return NAME##_cus_equal_list (this, d, c, m, i1, i2, i3, i4, i5, i6, i7, i8, i9, i10, i11, i12, i13, i14, i15, i16, i17, i18, i19, i20, i21, i22, i23, i24); \ - } \ - template \ - inline NAME##_cus_value_list NAME::value_list(cchar *d, Manip m,\ - std::vector *i) const {\ - return NAME##_cus_value_list (this, d, m, i);\ - }\ - template \ - inline NAME##_cus_field_list NAME::field_list(cchar *d, Manip m,\ - std::vector *i) const {\ - return NAME##_cus_field_list (this, d, m, i);\ - }\ - template \ - inline NAME##_cus_equal_list NAME::equal_list(cchar *d, cchar *c, Manip m,\ - std::vector *i) const {\ - return NAME##_cus_equal_list (this, d, c, m, i);\ - }\ - template \ - inline NAME##_cus_value_list \ - NAME::value_list(cchar *d, Manip m, sql_cmp_type /*sc*/) const {\ - sql_compare_type_def_##CMP (NAME, value, NUM);\ - }\ - template \ - inline NAME##_cus_field_list \ - NAME::field_list(cchar *d, Manip m, sql_cmp_type /*sc*/) const {\ - sql_compare_type_def_##CMP (NAME, field, NUM);\ - }\ - template \ - inline NAME##_cus_equal_list \ - NAME::equal_list(cchar *d, cchar *c, Manip m, sql_cmp_type /*sc*/) const {\ - sql_compare_type_defe_##CMP (NAME, equal, NUM);\ - }\ - template \ - void populate_##NAME (NAME *s, const Row &row) { \ - s->I1 = static_cast(row.at(O1));\ - s->I2 = static_cast(row.at(O2));\ - s->I3 = static_cast(row.at(O3));\ - s->I4 = static_cast(row.at(O4));\ - s->I5 = static_cast(row.at(O5));\ - s->I6 = static_cast(row.at(O6));\ - s->I7 = static_cast(row.at(O7));\ - s->I8 = static_cast(row.at(O8));\ - s->I9 = static_cast(row.at(O9));\ - s->I10 = static_cast(row.at(O10));\ - s->I11 = static_cast(row.at(O11));\ - s->I12 = static_cast(row.at(O12));\ - s->I13 = static_cast(row.at(O13));\ - s->I14 = static_cast(row.at(O14));\ - s->I15 = static_cast(row.at(O15));\ - s->I16 = static_cast(row.at(O16));\ - s->I17 = static_cast(row.at(O17));\ - s->I18 = static_cast(row.at(O18));\ - s->I19 = static_cast(row.at(O19));\ - s->I20 = static_cast(row.at(O20));\ - s->I21 = static_cast(row.at(O21));\ - s->I22 = static_cast(row.at(O22));\ - s->I23 = static_cast(row.at(O23));\ - s->I24 = static_cast(row.at(O24));\ - } \ - inline NAME::NAME (const Row &row) \ - {populate_##NAME(this, row);}\ - inline void NAME::set (const Row &row)\ - {populate_##NAME(this, row);}\ - sql_COMPARE__##CMP(NAME, I1, I2, I3, I4, I5, I6, I7, I8, I9, I10, I11, I12, I13, I14, I15, I16, I17, I18, I19, I20, I21, I22, I23, I24, 0 ) - -#define sql_create_basic_24(NAME, CMP, CONTR, T1, I1, T2, I2, T3, I3, T4, I4, T5, I5, T6, I6, T7, I7, T8, I8, T9, I9, T10, I10, T11, I11, T12, I12, T13, I13, T14, I14, T15, I15, T16, I16, T17, I17, T18, I18, T19, I19, T20, I20, T21, I21, T22, I22, T23, I23, T24, I24) \ - sql_create_basic_c_order_24(NAME, CMP, CONTR, T1, I1, 0, T2, I2, 1, T3, I3, 2, T4, I4, 3, T5, I5, 4, T6, I6, 5, T7, I7, 6, T8, I8, 7, T9, I9, 8, T10, I10, 9, T11, I11, 10, T12, I12, 11, T13, I13, 12, T14, I14, 13, T15, I15, 14, T16, I16, 15, T17, I17, 16, T18, I18, 17, T19, I19, 18, T20, I20, 19, T21, I21, 20, T22, I22, 21, T23, I23, 22, T24, I24, 23) - -#define sql_create_24(NAME, CMP, CONTR, T1, I1, T2, I2, T3, I3, T4, I4, T5, I5, T6, I6, T7, I7, T8, I8, T9, I9, T10, I10, T11, I11, T12, I12, T13, I13, T14, I14, T15, I15, T16, I16, T17, I17, T18, I18, T19, I19, T20, I20, T21, I21, T22, I22, T23, I23, T24, I24) \ - sql_create_complete_24(NAME, CMP, CONTR, T1, I1, #I1, 0, T2, I2, #I2, 1, T3, I3, #I3, 2, T4, I4, #I4, 3, T5, I5, #I5, 4, T6, I6, #I6, 5, T7, I7, #I7, 6, T8, I8, #I8, 7, T9, I9, #I9, 8, T10, I10, #I10, 9, T11, I11, #I11, 10, T12, I12, #I12, 11, T13, I13, #I13, 12, T14, I14, #I14, 13, T15, I15, #I15, 14, T16, I16, #I16, 15, T17, I17, #I17, 16, T18, I18, #I18, 17, T19, I19, #I19, 18, T20, I20, #I20, 19, T21, I21, #I21, 20, T22, I22, #I22, 21, T23, I23, #I23, 22, T24, I24, #I24, 23) \ - -#define sql_create_c_order_24(NAME, CMP, CONTR, T1, I1, O1, T2, I2, O2, T3, I3, O3, T4, I4, O4, T5, I5, O5, T6, I6, O6, T7, I7, O7, T8, I8, O8, T9, I9, O9, T10, I10, O10, T11, I11, O11, T12, I12, O12, T13, I13, O13, T14, I14, O14, T15, I15, O15, T16, I16, O16, T17, I17, O17, T18, I18, O18, T19, I19, O19, T20, I20, O20, T21, I21, O21, T22, I22, O22, T23, I23, O23, T24, I24, O24) \ - sql_create_complete_24(NAME, CMP, CONTR, T1, I1, #I1, O1, T2, I2, #I2, O2, T3, I3, #I3, O3, T4, I4, #I4, O4, T5, I5, #I5, O5, T6, I6, #I6, O6, T7, I7, #I7, O7, T8, I8, #I8, O8, T9, I9, #I9, O9, T10, I10, #I10, O10, T11, I11, #I11, O11, T12, I12, #I12, O12, T13, I13, #I13, O13, T14, I14, #I14, O14, T15, I15, #I15, O15, T16, I16, #I16, O16, T17, I17, #I17, O17, T18, I18, #I18, O18, T19, I19, #I19, O19, T20, I20, #I20, O20, T21, I21, #I21, O21, T22, I22, #I22, O22, T23, I23, #I23, O23, T24, I24, #I24, O24) - -#define sql_create_c_names_24(NAME, CMP, CONTR, T1, I1, N1, T2, I2, N2, T3, I3, N3, T4, I4, N4, T5, I5, N5, T6, I6, N6, T7, I7, N7, T8, I8, N8, T9, I9, N9, T10, I10, N10, T11, I11, N11, T12, I12, N12, T13, I13, N13, T14, I14, N14, T15, I15, N15, T16, I16, N16, T17, I17, N17, T18, I18, N18, T19, I19, N19, T20, I20, N20, T21, I21, N21, T22, I22, N22, T23, I23, N23, T24, I24, N24) \ - sql_create_complete_24(NAME, CMP, CONTR, T1, I1, N1, 0, T2, I2, N2, 1, T3, I3, N3, 2, T4, I4, N4, 3, T5, I5, N5, 4, T6, I6, N6, 5, T7, I7, N7, 6, T8, I8, N8, 7, T9, I9, N9, 8, T10, I10, N10, 9, T11, I11, N11, 10, T12, I12, N12, 11, T13, I13, N13, 12, T14, I14, N14, 13, T15, I15, N15, 14, T16, I16, N16, 15, T17, I17, N17, 16, T18, I18, N18, 17, T19, I19, N19, 18, T20, I20, N20, 19, T21, I21, N21, 20, T22, I22, N22, 21, T23, I23, N23, 22, T24, I24, N24, 23) - -// --------------------------------------------------- -// End Create 24 -// --------------------------------------------------- - -// --------------------------------------------------- -// Begin Create 25 -// --------------------------------------------------- -#define sql_create_basic_c_order_25(NAME, CMP, CONTR, T1, I1, O1, T2, I2, O2, T3, I3, O3, T4, I4, O4, T5, I5, O5, T6, I6, O6, T7, I7, O7, T8, I8, O8, T9, I9, O9, T10, I10, O10, T11, I11, O11, T12, I12, O12, T13, I13, O13, T14, I14, O14, T15, I15, O15, T16, I16, O16, T17, I17, O17, T18, I18, O18, T19, I19, O19, T20, I20, O20, T21, I21, O21, T22, I22, O22, T23, I23, O23, T24, I24, O24, T25, I25, O25)\ - struct NAME; \ - template int sql_compare_##NAME (const NAME &, const NAME &);\ - struct NAME { \ - T1 I1;\ - T2 I2;\ - T3 I3;\ - T4 I4;\ - T5 I5;\ - T6 I6;\ - T7 I7;\ - T8 I8;\ - T9 I9;\ - T10 I10;\ - T11 I11;\ - T12 I12;\ - T13 I13;\ - T14 I14;\ - T15 I15;\ - T16 I16;\ - T17 I17;\ - T18 I18;\ - T19 I19;\ - T20 I20;\ - T21 I21;\ - T22 I22;\ - T23 I23;\ - T24 I24;\ - T25 I25; \ - NAME () {} \ - NAME (const Row &row);\ - sql_compare_define_##CMP(NAME, T1, I1, T2, I2, T3, I3, T4, I4, T5, I5, T6, I6, T7, I7, T8, I8, T9, I9, T10, I10, T11, I11, T12, I12, T13, I13, T14, I14, T15, I15, T16, I16, T17, I17, T18, I18, T19, I19, T20, I20, T21, I21, T22, I22, T23, I23, T24, I24, T25, I25)\ - }; \ - template \ - void populate_##NAME (NAME *s, const Row &row) { \ - s->I1 = static_cast(row.at(O1));\ - s->I2 = static_cast(row.at(O2));\ - s->I3 = static_cast(row.at(O3));\ - s->I4 = static_cast(row.at(O4));\ - s->I5 = static_cast(row.at(O5));\ - s->I6 = static_cast(row.at(O6));\ - s->I7 = static_cast(row.at(O7));\ - s->I8 = static_cast(row.at(O8));\ - s->I9 = static_cast(row.at(O9));\ - s->I10 = static_cast(row.at(O10));\ - s->I11 = static_cast(row.at(O11));\ - s->I12 = static_cast(row.at(O12));\ - s->I13 = static_cast(row.at(O13));\ - s->I14 = static_cast(row.at(O14));\ - s->I15 = static_cast(row.at(O15));\ - s->I16 = static_cast(row.at(O16));\ - s->I17 = static_cast(row.at(O17));\ - s->I18 = static_cast(row.at(O18));\ - s->I19 = static_cast(row.at(O19));\ - s->I20 = static_cast(row.at(O20));\ - s->I21 = static_cast(row.at(O21));\ - s->I22 = static_cast(row.at(O22));\ - s->I23 = static_cast(row.at(O23));\ - s->I24 = static_cast(row.at(O24));\ - s->I25 = static_cast(row.at(O25)); \ - } \ - inline NAME::NAME (const Row &row) \ - {populate_##NAME(this, row);} \ - sql_COMPARE__##CMP(NAME, I1, I2, I3, I4, I5, I6, I7, I8, I9, I10, I11, I12, I13, I14, I15, I16, I17, I18, I19, I20, I21, I22, I23, I24, I25 ) - -#define sql_create_complete_25(NAME, CMP, CONTR, T1, I1, N1, O1, T2, I2, N2, O2, T3, I3, N3, O3, T4, I4, N4, O4, T5, I5, N5, O5, T6, I6, N6, O6, T7, I7, N7, O7, T8, I8, N8, O8, T9, I9, N9, O9, T10, I10, N10, O10, T11, I11, N11, O11, T12, I12, N12, O12, T13, I13, N13, O13, T14, I14, N14, O14, T15, I15, N15, O15, T16, I16, N16, O16, T17, I17, N17, O17, T18, I18, N18, O18, T19, I19, N19, O19, T20, I20, N20, O20, T21, I21, N21, O21, T22, I22, N22, O22, T23, I23, N23, O23, T24, I24, N24, O24, T25, I25, N25, O25) \ - struct NAME; \ - enum NAME##_enum { \ - NAME##_##I1,\ - NAME##_##I2,\ - NAME##_##I3,\ - NAME##_##I4,\ - NAME##_##I5,\ - NAME##_##I6,\ - NAME##_##I7,\ - NAME##_##I8,\ - NAME##_##I9,\ - NAME##_##I10,\ - NAME##_##I11,\ - NAME##_##I12,\ - NAME##_##I13,\ - NAME##_##I14,\ - NAME##_##I15,\ - NAME##_##I16,\ - NAME##_##I17,\ - NAME##_##I18,\ - NAME##_##I19,\ - NAME##_##I20,\ - NAME##_##I21,\ - NAME##_##I22,\ - NAME##_##I23,\ - NAME##_##I24,\ - NAME##_##I25 \ - ,NAME##_NULL \ - }; \ - template \ - class NAME##_value_list { \ - /*friend std::ostream& operator << <> (std::ostream&, const NAME##_value_list&); */\ - public: \ - const NAME *obj;\ - cchar *delem;\ - Manip manip;\ - public: \ - NAME##_value_list (const NAME *o, cchar *d, Manip m) \ - : obj(o), delem(d), manip(m) {} \ - };\ - template \ - class NAME##_##field_list {\ - /* friend std::ostream& operator << <> (std::ostream&, const NAME##_field_list&); */\ - public: \ - const NAME *obj; \ - cchar *delem;\ - Manip manip;\ - public: \ - NAME##_field_list (const NAME *o, cchar *d, Manip m) \ - : obj(o), delem(d), manip(m) {} \ - };\ - template \ - class NAME##_equal_list { \ - /* friend std::ostream& operator << <> (std::ostream&, const NAME##_equal_list&); */\ - public: \ - const NAME *obj;\ - cchar *delem;\ - cchar *comp;\ - Manip manip;\ - public: \ - NAME##_equal_list (const NAME *o, cchar *d, cchar *c, Manip m) \ - : obj(o), delem(d), comp(c), manip(m) {}\ - };\ - template \ - class NAME##_cus_value_list {\ - /* friend std::ostream& operator << <> (std::ostream&, \ - const NAME##_cus_value_list&); */\ - public:\ - const NAME *obj;\ - std::vector *include;\ - bool del_vector;\ - cchar *delem;\ - Manip manip;\ - public: \ - ~NAME##_cus_value_list () {if (del_vector) delete include;} \ - NAME##_cus_value_list (const NAME *o, cchar *d, Manip m, bool i1, bool i2, bool i3, bool i4, bool i5, bool i6, bool i7, bool i8, bool i9, bool i10, bool i11, bool i12, bool i13, bool i14, bool i15, bool i16, bool i17, bool i18, bool i19, bool i20, bool i21, bool i22, bool i23, bool i24, bool i25);\ - NAME##_cus_value_list (const NAME *o, cchar *d, Manip m, NAME##_enum i1, NAME##_enum i2, NAME##_enum i3, NAME##_enum i4, NAME##_enum i5, NAME##_enum i6, NAME##_enum i7, NAME##_enum i8, NAME##_enum i9, NAME##_enum i10, NAME##_enum i11, NAME##_enum i12, NAME##_enum i13, NAME##_enum i14, NAME##_enum i15, NAME##_enum i16, NAME##_enum i17, NAME##_enum i18, NAME##_enum i19, NAME##_enum i20, NAME##_enum i21, NAME##_enum i22, NAME##_enum i23, NAME##_enum i24, NAME##_enum i25); \ - NAME##_cus_value_list (const NAME *o, cchar *d, Manip m ,std::vector* i)\ - : obj(o), include(i), del_vector(false), delem(d), manip(m) {}\ - };\ - template \ - class NAME##_cus_field_list { \ - /* friend std::ostream& operator << <> (std::ostream&, \ - const NAME##_cus_field_list&); */\ - public:\ - const NAME *obj; \ - std::vector *include; \ - bool del_vector; \ - cchar *delem;\ - Manip manip;\ - public: \ - ~NAME##_cus_field_list () {if (del_vector) delete include;} \ - NAME##_cus_field_list (const NAME *o, cchar *d, Manip m, bool i1, bool i2, bool i3, bool i4, bool i5, bool i6, bool i7, bool i8, bool i9, bool i10, bool i11, bool i12, bool i13, bool i14, bool i15, bool i16, bool i17, bool i18, bool i19, bool i20, bool i21, bool i22, bool i23, bool i24, bool i25); \ - NAME##_cus_field_list (const NAME *o, cchar *d, Manip m, NAME##_enum i1, NAME##_enum i2, NAME##_enum i3, NAME##_enum i4, NAME##_enum i5, NAME##_enum i6, NAME##_enum i7, NAME##_enum i8, NAME##_enum i9, NAME##_enum i10, NAME##_enum i11, NAME##_enum i12, NAME##_enum i13, NAME##_enum i14, NAME##_enum i15, NAME##_enum i16, NAME##_enum i17, NAME##_enum i18, NAME##_enum i19, NAME##_enum i20, NAME##_enum i21, NAME##_enum i22, NAME##_enum i23, NAME##_enum i24, NAME##_enum i25); \ - NAME##_cus_field_list (const NAME *o, cchar *d, Manip m, std::vector *i) \ - : obj(o), include(i), del_vector(false), delem(d), manip(m) {}\ - };\ - template \ - class NAME##_cus_equal_list {\ - /* friend std::ostream& operator << <> (std::ostream&, \ - const NAME##_cus_equal_list&); */\ - public:\ - const NAME *obj;\ - std::vector *include;\ - bool del_vector;\ - cchar *delem;\ - cchar *comp;\ - Manip manip;\ - public:\ - ~NAME##_##cus_equal_list () {if (del_vector) delete include;}\ - NAME##_##cus_equal_list (const NAME *o, cchar *d, cchar *c, Manip m, bool i1, bool i2, bool i3, bool i4, bool i5, bool i6, bool i7, bool i8, bool i9, bool i10, bool i11, bool i12, bool i13, bool i14, bool i15, bool i16, bool i17, bool i18, bool i19, bool i20, bool i21, bool i22, bool i23, bool i24, bool i25); \ - NAME##_##cus_equal_list (const NAME *o, cchar *d, cchar *c, Manip m, NAME##_enum i1, NAME##_enum i2, NAME##_enum i3, NAME##_enum i4, NAME##_enum i5, NAME##_enum i6, NAME##_enum i7, NAME##_enum i8, NAME##_enum i9, NAME##_enum i10, NAME##_enum i11, NAME##_enum i12, NAME##_enum i13, NAME##_enum i14, NAME##_enum i15, NAME##_enum i16, NAME##_enum i17, NAME##_enum i18, NAME##_enum i19, NAME##_enum i20, NAME##_enum i21, NAME##_enum i22, NAME##_enum i23, NAME##_enum i24, NAME##_enum i25); \ - NAME##_##cus_equal_list (const NAME *o, cchar *d, cchar *c, Manip m, std::vector *i) \ - : obj(o), include(i), del_vector(false), delem(d), comp(c), manip(m) {}\ - };\ - template int sql_compare_##NAME (const NAME &, const NAME &);\ - struct NAME { \ - T1 I1;\ - T2 I2;\ - T3 I3;\ - T4 I4;\ - T5 I5;\ - T6 I6;\ - T7 I7;\ - T8 I8;\ - T9 I9;\ - T10 I10;\ - T11 I11;\ - T12 I12;\ - T13 I13;\ - T14 I14;\ - T15 I15;\ - T16 I16;\ - T17 I17;\ - T18 I18;\ - T19 I19;\ - T20 I20;\ - T21 I21;\ - T22 I22;\ - T23 I23;\ - T24 I24;\ - T25 I25; \ - NAME () {} \ - NAME (const Row &row);\ - void set (const Row &row);\ - sql_compare_define_##CMP(NAME, T1, I1, T2, I2, T3, I3, T4, I4, T5, I5, T6, I6, T7, I7, T8, I8, T9, I9, T10, I10, T11, I11, T12, I12, T13, I13, T14, I14, T15, I15, T16, I16, T17, I17, T18, I18, T19, I19, T20, I20, T21, I21, T22, I22, T23, I23, T24, I24, T25, I25)\ - sql_construct_define_##CONTR(NAME, T1, I1, T2, I2, T3, I3, T4, I4, T5, I5, T6, I6, T7, I7, T8, I8, T9, I9, T10, I10, T11, I11, T12, I12, T13, I13, T14, I14, T15, I15, T16, I16, T17, I17, T18, I18, T19, I19, T20, I20, T21, I21, T22, I22, T23, I23, T24, I24, T25, I25)\ - static const char *names[];\ - static const char *_table;\ - static const char *& table() {return _table;}\ - NAME##_value_list value_list() const {\ - return value_list(",", quote);}\ - NAME##_value_list value_list(cchar *d) const {\ - return value_list(d, quote);}\ - template \ - NAME##_value_list value_list(cchar *d, Manip m) const; \ - NAME##_field_list field_list() const {\ - return field_list(",", do_nothing);}\ - NAME##_field_list field_list(cchar *d) const {\ - return field_list(d, do_nothing);}\ - template \ - NAME##_field_list field_list(cchar *d, Manip m) const; \ - NAME##_equal_list equal_list(cchar *d = ",", \ - cchar *c = " = ") const{\ - return equal_list(d, c, quote);}\ - template \ - NAME##_equal_list equal_list(cchar *d, cchar *c, Manip m) const; \ - /* cus_data */\ - NAME##_cus_value_list value_list(bool i1, bool i2 = false, bool i3 = false, bool i4 = false, bool i5 = false, bool i6 = false, bool i7 = false, bool i8 = false, bool i9 = false, bool i10 = false, bool i11 = false, bool i12 = false, bool i13 = false, bool i14 = false, bool i15 = false, bool i16 = false, bool i17 = false, bool i18 = false, bool i19 = false, bool i20 = false, bool i21 = false, bool i22 = false, bool i23 = false, bool i24 = false, bool i25 = false) const {\ - return value_list(",", quote, i1, i2, i3, i4, i5, i6, i7, i8, i9, i10, i11, i12, i13, i14, i15, i16, i17, i18, i19, i20, i21, i22, i23, i24, i25);\ - }\ - NAME##_cus_value_list value_list(NAME##_enum i1, NAME##_enum i2 = NAME##_NULL, NAME##_enum i3 = NAME##_NULL, NAME##_enum i4 = NAME##_NULL, NAME##_enum i5 = NAME##_NULL, NAME##_enum i6 = NAME##_NULL, NAME##_enum i7 = NAME##_NULL, NAME##_enum i8 = NAME##_NULL, NAME##_enum i9 = NAME##_NULL, NAME##_enum i10 = NAME##_NULL, NAME##_enum i11 = NAME##_NULL, NAME##_enum i12 = NAME##_NULL, NAME##_enum i13 = NAME##_NULL, NAME##_enum i14 = NAME##_NULL, NAME##_enum i15 = NAME##_NULL, NAME##_enum i16 = NAME##_NULL, NAME##_enum i17 = NAME##_NULL, NAME##_enum i18 = NAME##_NULL, NAME##_enum i19 = NAME##_NULL, NAME##_enum i20 = NAME##_NULL, NAME##_enum i21 = NAME##_NULL, NAME##_enum i22 = NAME##_NULL, NAME##_enum i23 = NAME##_NULL, NAME##_enum i24 = NAME##_NULL, NAME##_enum i25 = NAME##_NULL) const {\ - return value_list(",", quote, i1, i2, i3, i4, i5, i6, i7, i8, i9, i10, i11, i12, i13, i14, i15, i16, i17, i18, i19, i20, i21, i22, i23, i24, i25);\ - }\ - NAME##_cus_value_list value_list(std::vector *i) const {\ - return value_list(",", quote, i);\ - }\ - NAME##_cus_value_list value_list(sql_cmp_type sc) const {\ - return value_list(",", quote, sc);\ - }\ - NAME##_cus_value_list value_list(cchar *d, bool i1, bool i2 = false, bool i3 = false, bool i4 = false, bool i5 = false, bool i6 = false, bool i7 = false, bool i8 = false, bool i9 = false, bool i10 = false, bool i11 = false, bool i12 = false, bool i13 = false, bool i14 = false, bool i15 = false, bool i16 = false, bool i17 = false, bool i18 = false, bool i19 = false, bool i20 = false, bool i21 = false, bool i22 = false, bool i23 = false, bool i24 = false, bool i25 = false) const {\ - return value_list(d, quote, i1, i2, i3, i4, i5, i6, i7, i8, i9, i10, i11, i12, i13, i14, i15, i16, i17, i18, i19, i20, i21, i22, i23, i24, i25);\ - }\ - NAME##_cus_value_list value_list(cchar *d, NAME##_enum i1, NAME##_enum i2 = NAME##_NULL, NAME##_enum i3 = NAME##_NULL, NAME##_enum i4 = NAME##_NULL, NAME##_enum i5 = NAME##_NULL, NAME##_enum i6 = NAME##_NULL, NAME##_enum i7 = NAME##_NULL, NAME##_enum i8 = NAME##_NULL, NAME##_enum i9 = NAME##_NULL, NAME##_enum i10 = NAME##_NULL, NAME##_enum i11 = NAME##_NULL, NAME##_enum i12 = NAME##_NULL, NAME##_enum i13 = NAME##_NULL, NAME##_enum i14 = NAME##_NULL, NAME##_enum i15 = NAME##_NULL, NAME##_enum i16 = NAME##_NULL, NAME##_enum i17 = NAME##_NULL, NAME##_enum i18 = NAME##_NULL, NAME##_enum i19 = NAME##_NULL, NAME##_enum i20 = NAME##_NULL, NAME##_enum i21 = NAME##_NULL, NAME##_enum i22 = NAME##_NULL, NAME##_enum i23 = NAME##_NULL, NAME##_enum i24 = NAME##_NULL, NAME##_enum i25 = NAME##_NULL) const {\ - return value_list(d, quote, i1, i2, i3, i4, i5, i6, i7, i8, i9, i10, i11, i12, i13, i14, i15, i16, i17, i18, i19, i20, i21, i22, i23, i24, i25);\ - }\ - NAME##_cus_value_list value_list(cchar *d, \ - std::vector *i) const {\ - return value_list(d, quote, i);\ - }\ - NAME##_cus_value_list value_list(cchar *d, \ - sql_cmp_type sc) const {\ - return value_list(d, quote, sc);\ - }\ - template \ - NAME##_cus_value_list value_list(cchar *d, Manip m,\ - bool i1, bool i2 = false, bool i3 = false, bool i4 = false, bool i5 = false, bool i6 = false, bool i7 = false, bool i8 = false, bool i9 = false, bool i10 = false, bool i11 = false, bool i12 = false, bool i13 = false, bool i14 = false, bool i15 = false, bool i16 = false, bool i17 = false, bool i18 = false, bool i19 = false, bool i20 = false, bool i21 = false, bool i22 = false, bool i23 = false, bool i24 = false, bool i25 = false) const; \ - template \ - NAME##_cus_value_list value_list(cchar *d, Manip m,\ - NAME##_enum i1, NAME##_enum i2 = NAME##_NULL, NAME##_enum i3 = NAME##_NULL, NAME##_enum i4 = NAME##_NULL, NAME##_enum i5 = NAME##_NULL, NAME##_enum i6 = NAME##_NULL, NAME##_enum i7 = NAME##_NULL, NAME##_enum i8 = NAME##_NULL, NAME##_enum i9 = NAME##_NULL, NAME##_enum i10 = NAME##_NULL, NAME##_enum i11 = NAME##_NULL, NAME##_enum i12 = NAME##_NULL, NAME##_enum i13 = NAME##_NULL, NAME##_enum i14 = NAME##_NULL, NAME##_enum i15 = NAME##_NULL, NAME##_enum i16 = NAME##_NULL, NAME##_enum i17 = NAME##_NULL, NAME##_enum i18 = NAME##_NULL, NAME##_enum i19 = NAME##_NULL, NAME##_enum i20 = NAME##_NULL, NAME##_enum i21 = NAME##_NULL, NAME##_enum i22 = NAME##_NULL, NAME##_enum i23 = NAME##_NULL, NAME##_enum i24 = NAME##_NULL, NAME##_enum i25 = NAME##_NULL) const; \ - template \ - NAME##_cus_value_list value_list(cchar *d, Manip m, \ - std::vector *i) const;\ - template \ - NAME##_cus_value_list value_list(cchar *d, Manip m, \ - sql_cmp_type sc) const;\ - /* cus field */\ - NAME##_cus_field_list field_list(bool i1, bool i2 = false, bool i3 = false, bool i4 = false, bool i5 = false, bool i6 = false, bool i7 = false, bool i8 = false, bool i9 = false, bool i10 = false, bool i11 = false, bool i12 = false, bool i13 = false, bool i14 = false, bool i15 = false, bool i16 = false, bool i17 = false, bool i18 = false, bool i19 = false, bool i20 = false, bool i21 = false, bool i22 = false, bool i23 = false, bool i24 = false, bool i25 = false) const {\ - return field_list(",", do_nothing, i1, i2, i3, i4, i5, i6, i7, i8, i9, i10, i11, i12, i13, i14, i15, i16, i17, i18, i19, i20, i21, i22, i23, i24, i25);\ - }\ - NAME##_cus_field_list field_list(NAME##_enum i1, NAME##_enum i2 = NAME##_NULL, NAME##_enum i3 = NAME##_NULL, NAME##_enum i4 = NAME##_NULL, NAME##_enum i5 = NAME##_NULL, NAME##_enum i6 = NAME##_NULL, NAME##_enum i7 = NAME##_NULL, NAME##_enum i8 = NAME##_NULL, NAME##_enum i9 = NAME##_NULL, NAME##_enum i10 = NAME##_NULL, NAME##_enum i11 = NAME##_NULL, NAME##_enum i12 = NAME##_NULL, NAME##_enum i13 = NAME##_NULL, NAME##_enum i14 = NAME##_NULL, NAME##_enum i15 = NAME##_NULL, NAME##_enum i16 = NAME##_NULL, NAME##_enum i17 = NAME##_NULL, NAME##_enum i18 = NAME##_NULL, NAME##_enum i19 = NAME##_NULL, NAME##_enum i20 = NAME##_NULL, NAME##_enum i21 = NAME##_NULL, NAME##_enum i22 = NAME##_NULL, NAME##_enum i23 = NAME##_NULL, NAME##_enum i24 = NAME##_NULL, NAME##_enum i25 = NAME##_NULL) const {\ - return field_list(",", do_nothing, i1, i2, i3, i4, i5, i6, i7, i8, i9, i10, i11, i12, i13, i14, i15, i16, i17, i18, i19, i20, i21, i22, i23, i24, i25);\ - }\ - NAME##_cus_field_list field_list(std::vector *i) const {\ - return field_list(",", do_nothing, i);\ - }\ - NAME##_cus_field_list field_list(sql_cmp_type sc) const\ - {\ - return field_list(",", do_nothing, sc);\ - }\ - NAME##_cus_field_list field_list(cchar *d, \ - bool i1, bool i2 = false, bool i3 = false, bool i4 = false, bool i5 = false, bool i6 = false, bool i7 = false, bool i8 = false, bool i9 = false, bool i10 = false, bool i11 = false, bool i12 = false, bool i13 = false, bool i14 = false, bool i15 = false, bool i16 = false, bool i17 = false, bool i18 = false, bool i19 = false, bool i20 = false, bool i21 = false, bool i22 = false, bool i23 = false, bool i24 = false, bool i25 = false) const {\ - return field_list(d, do_nothing, i1, i2, i3, i4, i5, i6, i7, i8, i9, i10, i11, i12, i13, i14, i15, i16, i17, i18, i19, i20, i21, i22, i23, i24, i25);\ - }\ - NAME##_cus_field_list field_list(cchar *d,\ - NAME##_enum i1, NAME##_enum i2 = NAME##_NULL, NAME##_enum i3 = NAME##_NULL, NAME##_enum i4 = NAME##_NULL, NAME##_enum i5 = NAME##_NULL, NAME##_enum i6 = NAME##_NULL, NAME##_enum i7 = NAME##_NULL, NAME##_enum i8 = NAME##_NULL, NAME##_enum i9 = NAME##_NULL, NAME##_enum i10 = NAME##_NULL, NAME##_enum i11 = NAME##_NULL, NAME##_enum i12 = NAME##_NULL, NAME##_enum i13 = NAME##_NULL, NAME##_enum i14 = NAME##_NULL, NAME##_enum i15 = NAME##_NULL, NAME##_enum i16 = NAME##_NULL, NAME##_enum i17 = NAME##_NULL, NAME##_enum i18 = NAME##_NULL, NAME##_enum i19 = NAME##_NULL, NAME##_enum i20 = NAME##_NULL, NAME##_enum i21 = NAME##_NULL, NAME##_enum i22 = NAME##_NULL, NAME##_enum i23 = NAME##_NULL, NAME##_enum i24 = NAME##_NULL, NAME##_enum i25 = NAME##_NULL) const {\ - return field_list(d, do_nothing, i1, i2, i3, i4, i5, i6, i7, i8, i9, i10, i11, i12, i13, i14, i15, i16, i17, i18, i19, i20, i21, i22, i23, i24, i25);\ - }\ - NAME##_cus_field_list field_list(cchar *d, \ - std::vector *i) const {\ - return field_list(d, do_nothing, i);\ - }\ - NAME##_cus_field_list field_list(cchar *d, \ - sql_cmp_type sc) const {\ - return field_list(d, do_nothing, sc);\ - }\ - template \ - NAME##_cus_field_list field_list(cchar *d, Manip m,\ - bool i1, bool i2 = false, bool i3 = false, bool i4 = false, bool i5 = false, bool i6 = false, bool i7 = false, bool i8 = false, bool i9 = false, bool i10 = false, bool i11 = false, bool i12 = false, bool i13 = false, bool i14 = false, bool i15 = false, bool i16 = false, bool i17 = false, bool i18 = false, bool i19 = false, bool i20 = false, bool i21 = false, bool i22 = false, bool i23 = false, bool i24 = false, bool i25 = false) const; \ - template \ - NAME##_cus_field_list field_list(cchar *d, Manip m,\ - NAME##_enum i1, NAME##_enum i2 = NAME##_NULL, NAME##_enum i3 = NAME##_NULL, NAME##_enum i4 = NAME##_NULL, NAME##_enum i5 = NAME##_NULL, NAME##_enum i6 = NAME##_NULL, NAME##_enum i7 = NAME##_NULL, NAME##_enum i8 = NAME##_NULL, NAME##_enum i9 = NAME##_NULL, NAME##_enum i10 = NAME##_NULL, NAME##_enum i11 = NAME##_NULL, NAME##_enum i12 = NAME##_NULL, NAME##_enum i13 = NAME##_NULL, NAME##_enum i14 = NAME##_NULL, NAME##_enum i15 = NAME##_NULL, NAME##_enum i16 = NAME##_NULL, NAME##_enum i17 = NAME##_NULL, NAME##_enum i18 = NAME##_NULL, NAME##_enum i19 = NAME##_NULL, NAME##_enum i20 = NAME##_NULL, NAME##_enum i21 = NAME##_NULL, NAME##_enum i22 = NAME##_NULL, NAME##_enum i23 = NAME##_NULL, NAME##_enum i24 = NAME##_NULL, NAME##_enum i25 = NAME##_NULL) const; \ - template \ - NAME##_cus_field_list field_list(cchar *d, Manip m,\ - std::vector *i) const;\ - template \ - NAME##_cus_field_list field_list(cchar *d, Manip m, \ - sql_cmp_type sc) const;\ - /* cus equal */\ - NAME##_cus_equal_list equal_list(bool i1, bool i2 = false, bool i3 = false, bool i4 = false, bool i5 = false, bool i6 = false, bool i7 = false, bool i8 = false, bool i9 = false, bool i10 = false, bool i11 = false, bool i12 = false, bool i13 = false, bool i14 = false, bool i15 = false, bool i16 = false, bool i17 = false, bool i18 = false, bool i19 = false, bool i20 = false, bool i21 = false, bool i22 = false, bool i23 = false, bool i24 = false, bool i25 = false) const {\ - return equal_list(",", " = ", quote, i1, i2, i3, i4, i5, i6, i7, i8, i9, i10, i11, i12, i13, i14, i15, i16, i17, i18, i19, i20, i21, i22, i23, i24, i25);\ - }\ - NAME##_cus_equal_list equal_list(NAME##_enum i1, NAME##_enum i2 = NAME##_NULL, NAME##_enum i3 = NAME##_NULL, NAME##_enum i4 = NAME##_NULL, NAME##_enum i5 = NAME##_NULL, NAME##_enum i6 = NAME##_NULL, NAME##_enum i7 = NAME##_NULL, NAME##_enum i8 = NAME##_NULL, NAME##_enum i9 = NAME##_NULL, NAME##_enum i10 = NAME##_NULL, NAME##_enum i11 = NAME##_NULL, NAME##_enum i12 = NAME##_NULL, NAME##_enum i13 = NAME##_NULL, NAME##_enum i14 = NAME##_NULL, NAME##_enum i15 = NAME##_NULL, NAME##_enum i16 = NAME##_NULL, NAME##_enum i17 = NAME##_NULL, NAME##_enum i18 = NAME##_NULL, NAME##_enum i19 = NAME##_NULL, NAME##_enum i20 = NAME##_NULL, NAME##_enum i21 = NAME##_NULL, NAME##_enum i22 = NAME##_NULL, NAME##_enum i23 = NAME##_NULL, NAME##_enum i24 = NAME##_NULL, NAME##_enum i25 = NAME##_NULL) const {\ - return equal_list(",", " = ", quote, i1, i2, i3, i4, i5, i6, i7, i8, i9, i10, i11, i12, i13, i14, i15, i16, i17, i18, i19, i20, i21, i22, i23, i24, i25);\ - }\ - NAME##_cus_equal_list equal_list(std::vector *i) const {\ - return equal_list(",", " = ", quote, i);\ - }\ - NAME##_cus_equal_list equal_list(sql_cmp_type sc) const {\ - return equal_list(",", " = ", quote, sc);\ - }\ - NAME##_cus_equal_list equal_list(cchar *d, bool i1, bool i2 = false, bool i3 = false, bool i4 = false, bool i5 = false, bool i6 = false, bool i7 = false, bool i8 = false, bool i9 = false, bool i10 = false, bool i11 = false, bool i12 = false, bool i13 = false, bool i14 = false, bool i15 = false, bool i16 = false, bool i17 = false, bool i18 = false, bool i19 = false, bool i20 = false, bool i21 = false, bool i22 = false, bool i23 = false, bool i24 = false, bool i25 = false) const {\ - return equal_list(d, " = ", quote, i1, i2, i3, i4, i5, i6, i7, i8, i9, i10, i11, i12, i13, i14, i15, i16, i17, i18, i19, i20, i21, i22, i23, i24, i25);\ - }\ - NAME##_cus_equal_list equal_list(cchar *d, NAME##_enum i1, NAME##_enum i2 = NAME##_NULL, NAME##_enum i3 = NAME##_NULL, NAME##_enum i4 = NAME##_NULL, NAME##_enum i5 = NAME##_NULL, NAME##_enum i6 = NAME##_NULL, NAME##_enum i7 = NAME##_NULL, NAME##_enum i8 = NAME##_NULL, NAME##_enum i9 = NAME##_NULL, NAME##_enum i10 = NAME##_NULL, NAME##_enum i11 = NAME##_NULL, NAME##_enum i12 = NAME##_NULL, NAME##_enum i13 = NAME##_NULL, NAME##_enum i14 = NAME##_NULL, NAME##_enum i15 = NAME##_NULL, NAME##_enum i16 = NAME##_NULL, NAME##_enum i17 = NAME##_NULL, NAME##_enum i18 = NAME##_NULL, NAME##_enum i19 = NAME##_NULL, NAME##_enum i20 = NAME##_NULL, NAME##_enum i21 = NAME##_NULL, NAME##_enum i22 = NAME##_NULL, NAME##_enum i23 = NAME##_NULL, NAME##_enum i24 = NAME##_NULL, NAME##_enum i25 = NAME##_NULL) const {\ - return equal_list(d, " = ", quote, i1, i2, i3, i4, i5, i6, i7, i8, i9, i10, i11, i12, i13, i14, i15, i16, i17, i18, i19, i20, i21, i22, i23, i24, i25);\ - }\ - NAME##_cus_equal_list equal_list(cchar *d, \ - std::vector *i) const {\ - return equal_list(d, " = ", quote, i);\ - }\ - NAME##_cus_equal_list equal_list(cchar *d, \ - sql_cmp_type sc) const {\ - return equal_list(d, " = ", quote, sc);\ - }\ - NAME##_cus_equal_list equal_list(cchar *d, cchar *c,\ - bool i1, bool i2 = false, bool i3 = false, bool i4 = false, bool i5 = false, bool i6 = false, bool i7 = false, bool i8 = false, bool i9 = false, bool i10 = false, bool i11 = false, bool i12 = false, bool i13 = false, bool i14 = false, bool i15 = false, bool i16 = false, bool i17 = false, bool i18 = false, bool i19 = false, bool i20 = false, bool i21 = false, bool i22 = false, bool i23 = false, bool i24 = false, bool i25 = false) const {\ - return equal_list(d, c, quote, i1, i2, i3, i4, i5, i6, i7, i8, i9, i10, i11, i12, i13, i14, i15, i16, i17, i18, i19, i20, i21, i22, i23, i24, i25);\ - }\ - NAME##_cus_equal_list equal_list(cchar *d, cchar *c,\ - NAME##_enum i1, NAME##_enum i2 = NAME##_NULL, NAME##_enum i3 = NAME##_NULL, NAME##_enum i4 = NAME##_NULL, NAME##_enum i5 = NAME##_NULL, NAME##_enum i6 = NAME##_NULL, NAME##_enum i7 = NAME##_NULL, NAME##_enum i8 = NAME##_NULL, NAME##_enum i9 = NAME##_NULL, NAME##_enum i10 = NAME##_NULL, NAME##_enum i11 = NAME##_NULL, NAME##_enum i12 = NAME##_NULL, NAME##_enum i13 = NAME##_NULL, NAME##_enum i14 = NAME##_NULL, NAME##_enum i15 = NAME##_NULL, NAME##_enum i16 = NAME##_NULL, NAME##_enum i17 = NAME##_NULL, NAME##_enum i18 = NAME##_NULL, NAME##_enum i19 = NAME##_NULL, NAME##_enum i20 = NAME##_NULL, NAME##_enum i21 = NAME##_NULL, NAME##_enum i22 = NAME##_NULL, NAME##_enum i23 = NAME##_NULL, NAME##_enum i24 = NAME##_NULL, NAME##_enum i25 = NAME##_NULL) const {\ - return equal_list(d, c, quote, i1, i2, i3, i4, i5, i6, i7, i8, i9, i10, i11, i12, i13, i14, i15, i16, i17, i18, i19, i20, i21, i22, i23, i24, i25);\ - }\ - NAME##_cus_equal_list equal_list(cchar *d, cchar *c,\ - std::vector *i) const {\ - return equal_list(d, c, quote, i);\ - }\ - NAME##_cus_equal_list equal_list(cchar *d, cchar *c,\ - sql_cmp_type sc) const {\ - return equal_list(d, c, quote, sc);\ - }\ - template \ - NAME##_cus_equal_list equal_list(cchar *d, cchar *c, Manip m, \ - bool i1, bool i2 = false, bool i3 = false, bool i4 = false, bool i5 = false, bool i6 = false, bool i7 = false, bool i8 = false, bool i9 = false, bool i10 = false, bool i11 = false, bool i12 = false, bool i13 = false, bool i14 = false, bool i15 = false, bool i16 = false, bool i17 = false, bool i18 = false, bool i19 = false, bool i20 = false, bool i21 = false, bool i22 = false, bool i23 = false, bool i24 = false, bool i25 = false) const; \ - template \ - NAME##_cus_equal_list equal_list(cchar *d, cchar *c, Manip m, \ - NAME##_enum i1, NAME##_enum i2 = NAME##_NULL, NAME##_enum i3 = NAME##_NULL, NAME##_enum i4 = NAME##_NULL, NAME##_enum i5 = NAME##_NULL, NAME##_enum i6 = NAME##_NULL, NAME##_enum i7 = NAME##_NULL, NAME##_enum i8 = NAME##_NULL, NAME##_enum i9 = NAME##_NULL, NAME##_enum i10 = NAME##_NULL, NAME##_enum i11 = NAME##_NULL, NAME##_enum i12 = NAME##_NULL, NAME##_enum i13 = NAME##_NULL, NAME##_enum i14 = NAME##_NULL, NAME##_enum i15 = NAME##_NULL, NAME##_enum i16 = NAME##_NULL, NAME##_enum i17 = NAME##_NULL, NAME##_enum i18 = NAME##_NULL, NAME##_enum i19 = NAME##_NULL, NAME##_enum i20 = NAME##_NULL, NAME##_enum i21 = NAME##_NULL, NAME##_enum i22 = NAME##_NULL, NAME##_enum i23 = NAME##_NULL, NAME##_enum i24 = NAME##_NULL, NAME##_enum i25 = NAME##_NULL) const; \ - template \ - NAME##_cus_equal_list equal_list(cchar *d, cchar *c, Manip m, \ - std::vector *i) const;\ - template \ - NAME##_cus_equal_list equal_list(cchar *d, cchar *c, Manip m, \ - sql_cmp_type sc) const;\ - }; \ - const char *NAME::names[] = { \ - N1 ,\ - N2 ,\ - N3 ,\ - N4 ,\ - N5 ,\ - N6 ,\ - N7 ,\ - N8 ,\ - N9 ,\ - N10 ,\ - N11 ,\ - N12 ,\ - N13 ,\ - N14 ,\ - N15 ,\ - N16 ,\ - N17 ,\ - N18 ,\ - N19 ,\ - N20 ,\ - N21 ,\ - N22 ,\ - N23 ,\ - N24 ,\ - N25 \ - }; \ - const char *NAME::_table = #NAME ; \ - template \ - NAME##_cus_value_list::NAME##_cus_value_list\ - (const NAME *o, cchar *d, Manip m, bool i1, bool i2, bool i3, bool i4, bool i5, bool i6, bool i7, bool i8, bool i9, bool i10, bool i11, bool i12, bool i13, bool i14, bool i15, bool i16, bool i17, bool i18, bool i19, bool i20, bool i21, bool i22, bool i23, bool i24, bool i25) \ - { \ - delem = d;\ - manip = m;\ - del_vector = true;\ - obj = o; \ - include = new std::vector(25, false);\ - if (i1) (*include)[0]=true;\ - if (i2) (*include)[1]=true;\ - if (i3) (*include)[2]=true;\ - if (i4) (*include)[3]=true;\ - if (i5) (*include)[4]=true;\ - if (i6) (*include)[5]=true;\ - if (i7) (*include)[6]=true;\ - if (i8) (*include)[7]=true;\ - if (i9) (*include)[8]=true;\ - if (i10) (*include)[9]=true;\ - if (i11) (*include)[10]=true;\ - if (i12) (*include)[11]=true;\ - if (i13) (*include)[12]=true;\ - if (i14) (*include)[13]=true;\ - if (i15) (*include)[14]=true;\ - if (i16) (*include)[15]=true;\ - if (i17) (*include)[16]=true;\ - if (i18) (*include)[17]=true;\ - if (i19) (*include)[18]=true;\ - if (i20) (*include)[19]=true;\ - if (i21) (*include)[20]=true;\ - if (i22) (*include)[21]=true;\ - if (i23) (*include)[22]=true;\ - if (i24) (*include)[23]=true;\ - if (i25) (*include)[24]=true;\ - } \ - template \ - NAME##_cus_value_list::NAME##_cus_value_list\ - (const NAME *o, cchar *d, Manip m, NAME##_enum i1, NAME##_enum i2, NAME##_enum i3, NAME##_enum i4, NAME##_enum i5, NAME##_enum i6, NAME##_enum i7, NAME##_enum i8, NAME##_enum i9, NAME##_enum i10, NAME##_enum i11, NAME##_enum i12, NAME##_enum i13, NAME##_enum i14, NAME##_enum i15, NAME##_enum i16, NAME##_enum i17, NAME##_enum i18, NAME##_enum i19, NAME##_enum i20, NAME##_enum i21, NAME##_enum i22, NAME##_enum i23, NAME##_enum i24, NAME##_enum i25) { \ - delem = d;\ - manip = m;\ - del_vector = true; \ - obj = o; \ - include = new std::vector(25, false); \ - if (i1 == NAME##_NULL) return;\ - (*include)[i1]=true;\ - if (i2 == NAME##_NULL) return;\ - (*include)[i2]=true;\ - if (i3 == NAME##_NULL) return;\ - (*include)[i3]=true;\ - if (i4 == NAME##_NULL) return;\ - (*include)[i4]=true;\ - if (i5 == NAME##_NULL) return;\ - (*include)[i5]=true;\ - if (i6 == NAME##_NULL) return;\ - (*include)[i6]=true;\ - if (i7 == NAME##_NULL) return;\ - (*include)[i7]=true;\ - if (i8 == NAME##_NULL) return;\ - (*include)[i8]=true;\ - if (i9 == NAME##_NULL) return;\ - (*include)[i9]=true;\ - if (i10 == NAME##_NULL) return;\ - (*include)[i10]=true;\ - if (i11 == NAME##_NULL) return;\ - (*include)[i11]=true;\ - if (i12 == NAME##_NULL) return;\ - (*include)[i12]=true;\ - if (i13 == NAME##_NULL) return;\ - (*include)[i13]=true;\ - if (i14 == NAME##_NULL) return;\ - (*include)[i14]=true;\ - if (i15 == NAME##_NULL) return;\ - (*include)[i15]=true;\ - if (i16 == NAME##_NULL) return;\ - (*include)[i16]=true;\ - if (i17 == NAME##_NULL) return;\ - (*include)[i17]=true;\ - if (i18 == NAME##_NULL) return;\ - (*include)[i18]=true;\ - if (i19 == NAME##_NULL) return;\ - (*include)[i19]=true;\ - if (i20 == NAME##_NULL) return;\ - (*include)[i20]=true;\ - if (i21 == NAME##_NULL) return;\ - (*include)[i21]=true;\ - if (i22 == NAME##_NULL) return;\ - (*include)[i22]=true;\ - if (i23 == NAME##_NULL) return;\ - (*include)[i23]=true;\ - if (i24 == NAME##_NULL) return;\ - (*include)[i24]=true;\ - if (i25 == NAME##_NULL) return;\ - (*include)[i25]=true;\ - }\ - template \ - NAME##_cus_field_list::NAME##_cus_field_list\ - (const NAME *o, cchar *d, Manip m, bool i1, bool i2, bool i3, bool i4, bool i5, bool i6, bool i7, bool i8, bool i9, bool i10, bool i11, bool i12, bool i13, bool i14, bool i15, bool i16, bool i17, bool i18, bool i19, bool i20, bool i21, bool i22, bool i23, bool i24, bool i25) {\ - delem = d;\ - manip = m;\ - del_vector = true; \ - obj = o; \ - include = new std::vector(25, false); \ - if (i1) (*include)[0]=true;\ - if (i2) (*include)[1]=true;\ - if (i3) (*include)[2]=true;\ - if (i4) (*include)[3]=true;\ - if (i5) (*include)[4]=true;\ - if (i6) (*include)[5]=true;\ - if (i7) (*include)[6]=true;\ - if (i8) (*include)[7]=true;\ - if (i9) (*include)[8]=true;\ - if (i10) (*include)[9]=true;\ - if (i11) (*include)[10]=true;\ - if (i12) (*include)[11]=true;\ - if (i13) (*include)[12]=true;\ - if (i14) (*include)[13]=true;\ - if (i15) (*include)[14]=true;\ - if (i16) (*include)[15]=true;\ - if (i17) (*include)[16]=true;\ - if (i18) (*include)[17]=true;\ - if (i19) (*include)[18]=true;\ - if (i20) (*include)[19]=true;\ - if (i21) (*include)[20]=true;\ - if (i22) (*include)[21]=true;\ - if (i23) (*include)[22]=true;\ - if (i24) (*include)[23]=true;\ - if (i25) (*include)[24]=true;\ - } \ - template \ - NAME##_cus_field_list::NAME##_cus_field_list\ - (const NAME *o, cchar *d, Manip m, NAME##_enum i1, NAME##_enum i2, NAME##_enum i3, NAME##_enum i4, NAME##_enum i5, NAME##_enum i6, NAME##_enum i7, NAME##_enum i8, NAME##_enum i9, NAME##_enum i10, NAME##_enum i11, NAME##_enum i12, NAME##_enum i13, NAME##_enum i14, NAME##_enum i15, NAME##_enum i16, NAME##_enum i17, NAME##_enum i18, NAME##_enum i19, NAME##_enum i20, NAME##_enum i21, NAME##_enum i22, NAME##_enum i23, NAME##_enum i24, NAME##_enum i25) { \ - delem = d;\ - manip = m;\ - del_vector = true; \ - obj = o; \ - include = new std::vector(25, false); \ - if (i1 == NAME##_NULL) return;\ - (*include)[i1]=true;\ - if (i2 == NAME##_NULL) return;\ - (*include)[i2]=true;\ - if (i3 == NAME##_NULL) return;\ - (*include)[i3]=true;\ - if (i4 == NAME##_NULL) return;\ - (*include)[i4]=true;\ - if (i5 == NAME##_NULL) return;\ - (*include)[i5]=true;\ - if (i6 == NAME##_NULL) return;\ - (*include)[i6]=true;\ - if (i7 == NAME##_NULL) return;\ - (*include)[i7]=true;\ - if (i8 == NAME##_NULL) return;\ - (*include)[i8]=true;\ - if (i9 == NAME##_NULL) return;\ - (*include)[i9]=true;\ - if (i10 == NAME##_NULL) return;\ - (*include)[i10]=true;\ - if (i11 == NAME##_NULL) return;\ - (*include)[i11]=true;\ - if (i12 == NAME##_NULL) return;\ - (*include)[i12]=true;\ - if (i13 == NAME##_NULL) return;\ - (*include)[i13]=true;\ - if (i14 == NAME##_NULL) return;\ - (*include)[i14]=true;\ - if (i15 == NAME##_NULL) return;\ - (*include)[i15]=true;\ - if (i16 == NAME##_NULL) return;\ - (*include)[i16]=true;\ - if (i17 == NAME##_NULL) return;\ - (*include)[i17]=true;\ - if (i18 == NAME##_NULL) return;\ - (*include)[i18]=true;\ - if (i19 == NAME##_NULL) return;\ - (*include)[i19]=true;\ - if (i20 == NAME##_NULL) return;\ - (*include)[i20]=true;\ - if (i21 == NAME##_NULL) return;\ - (*include)[i21]=true;\ - if (i22 == NAME##_NULL) return;\ - (*include)[i22]=true;\ - if (i23 == NAME##_NULL) return;\ - (*include)[i23]=true;\ - if (i24 == NAME##_NULL) return;\ - (*include)[i24]=true;\ - if (i25 == NAME##_NULL) return;\ - (*include)[i25]=true;\ - }\ - template \ - NAME##_cus_equal_list::NAME##_cus_equal_list\ - (const NAME *o, cchar *d, cchar *c, Manip m, bool i1, bool i2, bool i3, bool i4, bool i5, bool i6, bool i7, bool i8, bool i9, bool i10, bool i11, bool i12, bool i13, bool i14, bool i15, bool i16, bool i17, bool i18, bool i19, bool i20, bool i21, bool i22, bool i23, bool i24, bool i25) { \ - delem = d;\ - comp = c;\ - manip = m;\ - del_vector = true; \ - obj = o; \ - include = new std::vector(25, false); \ - if (i1) (*include)[0]=true;\ - if (i2) (*include)[1]=true;\ - if (i3) (*include)[2]=true;\ - if (i4) (*include)[3]=true;\ - if (i5) (*include)[4]=true;\ - if (i6) (*include)[5]=true;\ - if (i7) (*include)[6]=true;\ - if (i8) (*include)[7]=true;\ - if (i9) (*include)[8]=true;\ - if (i10) (*include)[9]=true;\ - if (i11) (*include)[10]=true;\ - if (i12) (*include)[11]=true;\ - if (i13) (*include)[12]=true;\ - if (i14) (*include)[13]=true;\ - if (i15) (*include)[14]=true;\ - if (i16) (*include)[15]=true;\ - if (i17) (*include)[16]=true;\ - if (i18) (*include)[17]=true;\ - if (i19) (*include)[18]=true;\ - if (i20) (*include)[19]=true;\ - if (i21) (*include)[20]=true;\ - if (i22) (*include)[21]=true;\ - if (i23) (*include)[22]=true;\ - if (i24) (*include)[23]=true;\ - if (i25) (*include)[24]=true;\ - } \ - template \ - NAME##_cus_equal_list::NAME##_cus_equal_list\ - (const NAME *o, cchar *d, cchar *c, Manip m, NAME##_enum i1, NAME##_enum i2, NAME##_enum i3, NAME##_enum i4, NAME##_enum i5, NAME##_enum i6, NAME##_enum i7, NAME##_enum i8, NAME##_enum i9, NAME##_enum i10, NAME##_enum i11, NAME##_enum i12, NAME##_enum i13, NAME##_enum i14, NAME##_enum i15, NAME##_enum i16, NAME##_enum i17, NAME##_enum i18, NAME##_enum i19, NAME##_enum i20, NAME##_enum i21, NAME##_enum i22, NAME##_enum i23, NAME##_enum i24, NAME##_enum i25) { \ - delem = d;\ - comp = c;\ - manip = m;\ - del_vector = true; \ - obj = o; \ - include = new std::vector(25, false); \ - if (i1 == NAME##_NULL) return;\ - (*include)[i1]=true;\ - if (i2 == NAME##_NULL) return;\ - (*include)[i2]=true;\ - if (i3 == NAME##_NULL) return;\ - (*include)[i3]=true;\ - if (i4 == NAME##_NULL) return;\ - (*include)[i4]=true;\ - if (i5 == NAME##_NULL) return;\ - (*include)[i5]=true;\ - if (i6 == NAME##_NULL) return;\ - (*include)[i6]=true;\ - if (i7 == NAME##_NULL) return;\ - (*include)[i7]=true;\ - if (i8 == NAME##_NULL) return;\ - (*include)[i8]=true;\ - if (i9 == NAME##_NULL) return;\ - (*include)[i9]=true;\ - if (i10 == NAME##_NULL) return;\ - (*include)[i10]=true;\ - if (i11 == NAME##_NULL) return;\ - (*include)[i11]=true;\ - if (i12 == NAME##_NULL) return;\ - (*include)[i12]=true;\ - if (i13 == NAME##_NULL) return;\ - (*include)[i13]=true;\ - if (i14 == NAME##_NULL) return;\ - (*include)[i14]=true;\ - if (i15 == NAME##_NULL) return;\ - (*include)[i15]=true;\ - if (i16 == NAME##_NULL) return;\ - (*include)[i16]=true;\ - if (i17 == NAME##_NULL) return;\ - (*include)[i17]=true;\ - if (i18 == NAME##_NULL) return;\ - (*include)[i18]=true;\ - if (i19 == NAME##_NULL) return;\ - (*include)[i19]=true;\ - if (i20 == NAME##_NULL) return;\ - (*include)[i20]=true;\ - if (i21 == NAME##_NULL) return;\ - (*include)[i21]=true;\ - if (i22 == NAME##_NULL) return;\ - (*include)[i22]=true;\ - if (i23 == NAME##_NULL) return;\ - (*include)[i23]=true;\ - if (i24 == NAME##_NULL) return;\ - (*include)[i24]=true;\ - if (i25 == NAME##_NULL) return;\ - (*include)[i25]=true;\ - }\ - template \ - std::ostream& operator << (std::ostream& s, const NAME##_value_list& obj) { \ - s << obj.manip << obj.obj->I1 << obj.delem;\ - s << obj.manip << obj.obj->I2 << obj.delem;\ - s << obj.manip << obj.obj->I3 << obj.delem;\ - s << obj.manip << obj.obj->I4 << obj.delem;\ - s << obj.manip << obj.obj->I5 << obj.delem;\ - s << obj.manip << obj.obj->I6 << obj.delem;\ - s << obj.manip << obj.obj->I7 << obj.delem;\ - s << obj.manip << obj.obj->I8 << obj.delem;\ - s << obj.manip << obj.obj->I9 << obj.delem;\ - s << obj.manip << obj.obj->I10 << obj.delem;\ - s << obj.manip << obj.obj->I11 << obj.delem;\ - s << obj.manip << obj.obj->I12 << obj.delem;\ - s << obj.manip << obj.obj->I13 << obj.delem;\ - s << obj.manip << obj.obj->I14 << obj.delem;\ - s << obj.manip << obj.obj->I15 << obj.delem;\ - s << obj.manip << obj.obj->I16 << obj.delem;\ - s << obj.manip << obj.obj->I17 << obj.delem;\ - s << obj.manip << obj.obj->I18 << obj.delem;\ - s << obj.manip << obj.obj->I19 << obj.delem;\ - s << obj.manip << obj.obj->I20 << obj.delem;\ - s << obj.manip << obj.obj->I21 << obj.delem;\ - s << obj.manip << obj.obj->I22 << obj.delem;\ - s << obj.manip << obj.obj->I23 << obj.delem;\ - s << obj.manip << obj.obj->I24 << obj.delem;\ - s << obj.manip << obj.obj->I25; \ - return s; \ - } \ - template \ - std::ostream& operator << (std::ostream& s, const NAME##_field_list& obj) { \ - s << obj.manip << obj.obj->names[0] << obj.delem;\ - s << obj.manip << obj.obj->names[1] << obj.delem;\ - s << obj.manip << obj.obj->names[2] << obj.delem;\ - s << obj.manip << obj.obj->names[3] << obj.delem;\ - s << obj.manip << obj.obj->names[4] << obj.delem;\ - s << obj.manip << obj.obj->names[5] << obj.delem;\ - s << obj.manip << obj.obj->names[6] << obj.delem;\ - s << obj.manip << obj.obj->names[7] << obj.delem;\ - s << obj.manip << obj.obj->names[8] << obj.delem;\ - s << obj.manip << obj.obj->names[9] << obj.delem;\ - s << obj.manip << obj.obj->names[10] << obj.delem;\ - s << obj.manip << obj.obj->names[11] << obj.delem;\ - s << obj.manip << obj.obj->names[12] << obj.delem;\ - s << obj.manip << obj.obj->names[13] << obj.delem;\ - s << obj.manip << obj.obj->names[14] << obj.delem;\ - s << obj.manip << obj.obj->names[15] << obj.delem;\ - s << obj.manip << obj.obj->names[16] << obj.delem;\ - s << obj.manip << obj.obj->names[17] << obj.delem;\ - s << obj.manip << obj.obj->names[18] << obj.delem;\ - s << obj.manip << obj.obj->names[19] << obj.delem;\ - s << obj.manip << obj.obj->names[20] << obj.delem;\ - s << obj.manip << obj.obj->names[21] << obj.delem;\ - s << obj.manip << obj.obj->names[22] << obj.delem;\ - s << obj.manip << obj.obj->names[23] << obj.delem;\ - s << obj.manip << obj.obj->names[24]; \ - return s; \ - } \ - template \ - std::ostream& operator << (std::ostream& s, const NAME##_equal_list& obj) { \ - s << obj.obj->names[0] << obj.comp << obj.manip << obj.obj->I1 << obj.delem;\ - s << obj.obj->names[1] << obj.comp << obj.manip << obj.obj->I2 << obj.delem;\ - s << obj.obj->names[2] << obj.comp << obj.manip << obj.obj->I3 << obj.delem;\ - s << obj.obj->names[3] << obj.comp << obj.manip << obj.obj->I4 << obj.delem;\ - s << obj.obj->names[4] << obj.comp << obj.manip << obj.obj->I5 << obj.delem;\ - s << obj.obj->names[5] << obj.comp << obj.manip << obj.obj->I6 << obj.delem;\ - s << obj.obj->names[6] << obj.comp << obj.manip << obj.obj->I7 << obj.delem;\ - s << obj.obj->names[7] << obj.comp << obj.manip << obj.obj->I8 << obj.delem;\ - s << obj.obj->names[8] << obj.comp << obj.manip << obj.obj->I9 << obj.delem;\ - s << obj.obj->names[9] << obj.comp << obj.manip << obj.obj->I10 << obj.delem;\ - s << obj.obj->names[10] << obj.comp << obj.manip << obj.obj->I11 << obj.delem;\ - s << obj.obj->names[11] << obj.comp << obj.manip << obj.obj->I12 << obj.delem;\ - s << obj.obj->names[12] << obj.comp << obj.manip << obj.obj->I13 << obj.delem;\ - s << obj.obj->names[13] << obj.comp << obj.manip << obj.obj->I14 << obj.delem;\ - s << obj.obj->names[14] << obj.comp << obj.manip << obj.obj->I15 << obj.delem;\ - s << obj.obj->names[15] << obj.comp << obj.manip << obj.obj->I16 << obj.delem;\ - s << obj.obj->names[16] << obj.comp << obj.manip << obj.obj->I17 << obj.delem;\ - s << obj.obj->names[17] << obj.comp << obj.manip << obj.obj->I18 << obj.delem;\ - s << obj.obj->names[18] << obj.comp << obj.manip << obj.obj->I19 << obj.delem;\ - s << obj.obj->names[19] << obj.comp << obj.manip << obj.obj->I20 << obj.delem;\ - s << obj.obj->names[20] << obj.comp << obj.manip << obj.obj->I21 << obj.delem;\ - s << obj.obj->names[21] << obj.comp << obj.manip << obj.obj->I22 << obj.delem;\ - s << obj.obj->names[22] << obj.comp << obj.manip << obj.obj->I23 << obj.delem;\ - s << obj.obj->names[23] << obj.comp << obj.manip << obj.obj->I24 << obj.delem;\ - s << obj.obj->names[24] << obj.comp << obj.manip << obj.obj->I25; \ - return s; \ - } \ - template \ - std::ostream& operator << (std::ostream& s, const NAME##_cus_value_list& obj) { \ - bool before = false; \ - if ((*obj.include)[0]) { \ - s << obj.manip << obj.obj->I1;\ - before = true; \ - } \ - if ((*obj.include)[1]) { \ - if (before) s << obj.delem;\ - s << obj.manip << obj.obj->I2;\ - before = true; \ - } \ - if ((*obj.include)[2]) { \ - if (before) s << obj.delem;\ - s << obj.manip << obj.obj->I3;\ - before = true; \ - } \ - if ((*obj.include)[3]) { \ - if (before) s << obj.delem;\ - s << obj.manip << obj.obj->I4;\ - before = true; \ - } \ - if ((*obj.include)[4]) { \ - if (before) s << obj.delem;\ - s << obj.manip << obj.obj->I5;\ - before = true; \ - } \ - if ((*obj.include)[5]) { \ - if (before) s << obj.delem;\ - s << obj.manip << obj.obj->I6;\ - before = true; \ - } \ - if ((*obj.include)[6]) { \ - if (before) s << obj.delem;\ - s << obj.manip << obj.obj->I7;\ - before = true; \ - } \ - if ((*obj.include)[7]) { \ - if (before) s << obj.delem;\ - s << obj.manip << obj.obj->I8;\ - before = true; \ - } \ - if ((*obj.include)[8]) { \ - if (before) s << obj.delem;\ - s << obj.manip << obj.obj->I9;\ - before = true; \ - } \ - if ((*obj.include)[9]) { \ - if (before) s << obj.delem;\ - s << obj.manip << obj.obj->I10;\ - before = true; \ - } \ - if ((*obj.include)[10]) { \ - if (before) s << obj.delem;\ - s << obj.manip << obj.obj->I11;\ - before = true; \ - } \ - if ((*obj.include)[11]) { \ - if (before) s << obj.delem;\ - s << obj.manip << obj.obj->I12;\ - before = true; \ - } \ - if ((*obj.include)[12]) { \ - if (before) s << obj.delem;\ - s << obj.manip << obj.obj->I13;\ - before = true; \ - } \ - if ((*obj.include)[13]) { \ - if (before) s << obj.delem;\ - s << obj.manip << obj.obj->I14;\ - before = true; \ - } \ - if ((*obj.include)[14]) { \ - if (before) s << obj.delem;\ - s << obj.manip << obj.obj->I15;\ - before = true; \ - } \ - if ((*obj.include)[15]) { \ - if (before) s << obj.delem;\ - s << obj.manip << obj.obj->I16;\ - before = true; \ - } \ - if ((*obj.include)[16]) { \ - if (before) s << obj.delem;\ - s << obj.manip << obj.obj->I17;\ - before = true; \ - } \ - if ((*obj.include)[17]) { \ - if (before) s << obj.delem;\ - s << obj.manip << obj.obj->I18;\ - before = true; \ - } \ - if ((*obj.include)[18]) { \ - if (before) s << obj.delem;\ - s << obj.manip << obj.obj->I19;\ - before = true; \ - } \ - if ((*obj.include)[19]) { \ - if (before) s << obj.delem;\ - s << obj.manip << obj.obj->I20;\ - before = true; \ - } \ - if ((*obj.include)[20]) { \ - if (before) s << obj.delem;\ - s << obj.manip << obj.obj->I21;\ - before = true; \ - } \ - if ((*obj.include)[21]) { \ - if (before) s << obj.delem;\ - s << obj.manip << obj.obj->I22;\ - before = true; \ - } \ - if ((*obj.include)[22]) { \ - if (before) s << obj.delem;\ - s << obj.manip << obj.obj->I23;\ - before = true; \ - } \ - if ((*obj.include)[23]) { \ - if (before) s << obj.delem;\ - s << obj.manip << obj.obj->I24;\ - before = true; \ - } \ - if ((*obj.include)[24]) { \ - if (before) s << obj.delem;\ - s << obj.manip << obj.obj->I25;\ - } \ - return s; \ - } \ - template \ - std::ostream& operator << (std::ostream& s, const NAME##_cus_field_list& obj) { \ - bool before = false; \ - if ((*obj.include)[0]) { \ - s << obj.manip << obj.obj->names[0];\ - before = true; \ - } \ - if ((*obj.include)[1]) { \ - if (before) s << obj.delem;\ - s << obj.manip << obj.obj->names[1];\ - before = true; \ - } \ - if ((*obj.include)[2]) { \ - if (before) s << obj.delem;\ - s << obj.manip << obj.obj->names[2];\ - before = true; \ - } \ - if ((*obj.include)[3]) { \ - if (before) s << obj.delem;\ - s << obj.manip << obj.obj->names[3];\ - before = true; \ - } \ - if ((*obj.include)[4]) { \ - if (before) s << obj.delem;\ - s << obj.manip << obj.obj->names[4];\ - before = true; \ - } \ - if ((*obj.include)[5]) { \ - if (before) s << obj.delem;\ - s << obj.manip << obj.obj->names[5];\ - before = true; \ - } \ - if ((*obj.include)[6]) { \ - if (before) s << obj.delem;\ - s << obj.manip << obj.obj->names[6];\ - before = true; \ - } \ - if ((*obj.include)[7]) { \ - if (before) s << obj.delem;\ - s << obj.manip << obj.obj->names[7];\ - before = true; \ - } \ - if ((*obj.include)[8]) { \ - if (before) s << obj.delem;\ - s << obj.manip << obj.obj->names[8];\ - before = true; \ - } \ - if ((*obj.include)[9]) { \ - if (before) s << obj.delem;\ - s << obj.manip << obj.obj->names[9];\ - before = true; \ - } \ - if ((*obj.include)[10]) { \ - if (before) s << obj.delem;\ - s << obj.manip << obj.obj->names[10];\ - before = true; \ - } \ - if ((*obj.include)[11]) { \ - if (before) s << obj.delem;\ - s << obj.manip << obj.obj->names[11];\ - before = true; \ - } \ - if ((*obj.include)[12]) { \ - if (before) s << obj.delem;\ - s << obj.manip << obj.obj->names[12];\ - before = true; \ - } \ - if ((*obj.include)[13]) { \ - if (before) s << obj.delem;\ - s << obj.manip << obj.obj->names[13];\ - before = true; \ - } \ - if ((*obj.include)[14]) { \ - if (before) s << obj.delem;\ - s << obj.manip << obj.obj->names[14];\ - before = true; \ - } \ - if ((*obj.include)[15]) { \ - if (before) s << obj.delem;\ - s << obj.manip << obj.obj->names[15];\ - before = true; \ - } \ - if ((*obj.include)[16]) { \ - if (before) s << obj.delem;\ - s << obj.manip << obj.obj->names[16];\ - before = true; \ - } \ - if ((*obj.include)[17]) { \ - if (before) s << obj.delem;\ - s << obj.manip << obj.obj->names[17];\ - before = true; \ - } \ - if ((*obj.include)[18]) { \ - if (before) s << obj.delem;\ - s << obj.manip << obj.obj->names[18];\ - before = true; \ - } \ - if ((*obj.include)[19]) { \ - if (before) s << obj.delem;\ - s << obj.manip << obj.obj->names[19];\ - before = true; \ - } \ - if ((*obj.include)[20]) { \ - if (before) s << obj.delem;\ - s << obj.manip << obj.obj->names[20];\ - before = true; \ - } \ - if ((*obj.include)[21]) { \ - if (before) s << obj.delem;\ - s << obj.manip << obj.obj->names[21];\ - before = true; \ - } \ - if ((*obj.include)[22]) { \ - if (before) s << obj.delem;\ - s << obj.manip << obj.obj->names[22];\ - before = true; \ - } \ - if ((*obj.include)[23]) { \ - if (before) s << obj.delem;\ - s << obj.manip << obj.obj->names[23];\ - before = true; \ - } \ - if ((*obj.include)[24]) { \ - if (before) s << obj.delem;\ - s << obj.manip << obj.obj->names[24];\ - } \ - return s; \ - } \ - template \ - std::ostream& operator << (std::ostream& s, const NAME##_cus_equal_list& obj) { \ - bool before = false; \ - if ((*obj.include)[0]) { \ - s << obj.obj->names[0] << obj.comp << obj.manip << obj.obj->I1;\ - before = true; \ - } \ - if ((*obj.include)[1]) { \ - if (before) s << obj.delem;\ - s << obj.obj->names[1] << obj.comp << obj.manip << obj.obj->I2;\ - before = true; \ - } \ - if ((*obj.include)[2]) { \ - if (before) s << obj.delem;\ - s << obj.obj->names[2] << obj.comp << obj.manip << obj.obj->I3;\ - before = true; \ - } \ - if ((*obj.include)[3]) { \ - if (before) s << obj.delem;\ - s << obj.obj->names[3] << obj.comp << obj.manip << obj.obj->I4;\ - before = true; \ - } \ - if ((*obj.include)[4]) { \ - if (before) s << obj.delem;\ - s << obj.obj->names[4] << obj.comp << obj.manip << obj.obj->I5;\ - before = true; \ - } \ - if ((*obj.include)[5]) { \ - if (before) s << obj.delem;\ - s << obj.obj->names[5] << obj.comp << obj.manip << obj.obj->I6;\ - before = true; \ - } \ - if ((*obj.include)[6]) { \ - if (before) s << obj.delem;\ - s << obj.obj->names[6] << obj.comp << obj.manip << obj.obj->I7;\ - before = true; \ - } \ - if ((*obj.include)[7]) { \ - if (before) s << obj.delem;\ - s << obj.obj->names[7] << obj.comp << obj.manip << obj.obj->I8;\ - before = true; \ - } \ - if ((*obj.include)[8]) { \ - if (before) s << obj.delem;\ - s << obj.obj->names[8] << obj.comp << obj.manip << obj.obj->I9;\ - before = true; \ - } \ - if ((*obj.include)[9]) { \ - if (before) s << obj.delem;\ - s << obj.obj->names[9] << obj.comp << obj.manip << obj.obj->I10;\ - before = true; \ - } \ - if ((*obj.include)[10]) { \ - if (before) s << obj.delem;\ - s << obj.obj->names[10] << obj.comp << obj.manip << obj.obj->I11;\ - before = true; \ - } \ - if ((*obj.include)[11]) { \ - if (before) s << obj.delem;\ - s << obj.obj->names[11] << obj.comp << obj.manip << obj.obj->I12;\ - before = true; \ - } \ - if ((*obj.include)[12]) { \ - if (before) s << obj.delem;\ - s << obj.obj->names[12] << obj.comp << obj.manip << obj.obj->I13;\ - before = true; \ - } \ - if ((*obj.include)[13]) { \ - if (before) s << obj.delem;\ - s << obj.obj->names[13] << obj.comp << obj.manip << obj.obj->I14;\ - before = true; \ - } \ - if ((*obj.include)[14]) { \ - if (before) s << obj.delem;\ - s << obj.obj->names[14] << obj.comp << obj.manip << obj.obj->I15;\ - before = true; \ - } \ - if ((*obj.include)[15]) { \ - if (before) s << obj.delem;\ - s << obj.obj->names[15] << obj.comp << obj.manip << obj.obj->I16;\ - before = true; \ - } \ - if ((*obj.include)[16]) { \ - if (before) s << obj.delem;\ - s << obj.obj->names[16] << obj.comp << obj.manip << obj.obj->I17;\ - before = true; \ - } \ - if ((*obj.include)[17]) { \ - if (before) s << obj.delem;\ - s << obj.obj->names[17] << obj.comp << obj.manip << obj.obj->I18;\ - before = true; \ - } \ - if ((*obj.include)[18]) { \ - if (before) s << obj.delem;\ - s << obj.obj->names[18] << obj.comp << obj.manip << obj.obj->I19;\ - before = true; \ - } \ - if ((*obj.include)[19]) { \ - if (before) s << obj.delem;\ - s << obj.obj->names[19] << obj.comp << obj.manip << obj.obj->I20;\ - before = true; \ - } \ - if ((*obj.include)[20]) { \ - if (before) s << obj.delem;\ - s << obj.obj->names[20] << obj.comp << obj.manip << obj.obj->I21;\ - before = true; \ - } \ - if ((*obj.include)[21]) { \ - if (before) s << obj.delem;\ - s << obj.obj->names[21] << obj.comp << obj.manip << obj.obj->I22;\ - before = true; \ - } \ - if ((*obj.include)[22]) { \ - if (before) s << obj.delem;\ - s << obj.obj->names[22] << obj.comp << obj.manip << obj.obj->I23;\ - before = true; \ - } \ - if ((*obj.include)[23]) { \ - if (before) s << obj.delem;\ - s << obj.obj->names[23] << obj.comp << obj.manip << obj.obj->I24;\ - before = true; \ - } \ - if ((*obj.include)[24]) { \ - if (before) s << obj.delem;\ - s << obj.obj->names[24] << obj.comp << obj.manip << obj.obj->I25;\ - } \ - return s; \ - } \ - template \ - inline NAME##_value_list NAME::value_list(cchar *d, Manip m) const { \ - return NAME##_value_list (this, d, m); \ - } \ - template \ - inline NAME##_field_list NAME::field_list(cchar *d, Manip m) const { \ - return NAME##_field_list (this, d, m); \ - } \ - template \ - inline NAME##_equal_list NAME::equal_list(cchar *d, cchar *c, Manip m) const { \ - return NAME##_equal_list (this, d, c, m); \ - } \ - template \ - inline NAME##_cus_value_list NAME::value_list(cchar *d, Manip m,\ - bool i1, bool i2, bool i3, bool i4, bool i5, bool i6, bool i7, bool i8, bool i9, bool i10, bool i11, bool i12, bool i13, bool i14, bool i15, bool i16, bool i17, bool i18, bool i19, bool i20, bool i21, bool i22, bool i23, bool i24, bool i25) const {\ - return NAME##_cus_value_list (this, d, m, i1, i2, i3, i4, i5, i6, i7, i8, i9, i10, i11, i12, i13, i14, i15, i16, i17, i18, i19, i20, i21, i22, i23, i24, i25); \ - } \ - template \ - inline NAME##_cus_field_list NAME::field_list(cchar *d, Manip m,\ - bool i1, bool i2, bool i3, bool i4, bool i5, bool i6, bool i7, bool i8, bool i9, bool i10, bool i11, bool i12, bool i13, bool i14, bool i15, bool i16, bool i17, bool i18, bool i19, bool i20, bool i21, bool i22, bool i23, bool i24, bool i25) const { \ - return NAME##_cus_field_list (this, d, m, i1, i2, i3, i4, i5, i6, i7, i8, i9, i10, i11, i12, i13, i14, i15, i16, i17, i18, i19, i20, i21, i22, i23, i24, i25); \ - } \ - template \ - inline NAME##_cus_equal_list NAME::equal_list(cchar *d, cchar *c, Manip m,\ - bool i1, bool i2, bool i3, bool i4, bool i5, bool i6, bool i7, bool i8, bool i9, bool i10, bool i11, bool i12, bool i13, bool i14, bool i15, bool i16, bool i17, bool i18, bool i19, bool i20, bool i21, bool i22, bool i23, bool i24, bool i25) const { \ - return NAME##_cus_equal_list (this, d, c, m, i1, i2, i3, i4, i5, i6, i7, i8, i9, i10, i11, i12, i13, i14, i15, i16, i17, i18, i19, i20, i21, i22, i23, i24, i25); \ - } \ - template \ - inline NAME##_cus_value_list NAME::value_list(cchar *d, Manip m,\ - NAME##_enum i1, NAME##_enum i2, NAME##_enum i3, NAME##_enum i4, NAME##_enum i5, NAME##_enum i6, NAME##_enum i7, NAME##_enum i8, NAME##_enum i9, NAME##_enum i10, NAME##_enum i11, NAME##_enum i12, NAME##_enum i13, NAME##_enum i14, NAME##_enum i15, NAME##_enum i16, NAME##_enum i17, NAME##_enum i18, NAME##_enum i19, NAME##_enum i20, NAME##_enum i21, NAME##_enum i22, NAME##_enum i23, NAME##_enum i24, NAME##_enum i25) const { \ - return NAME##_cus_value_list (this, d, m, i1, i2, i3, i4, i5, i6, i7, i8, i9, i10, i11, i12, i13, i14, i15, i16, i17, i18, i19, i20, i21, i22, i23, i24, i25); \ - } \ - template \ - inline NAME##_cus_field_list NAME::field_list(cchar *d, Manip m,\ - NAME##_enum i1, NAME##_enum i2, NAME##_enum i3, NAME##_enum i4, NAME##_enum i5, NAME##_enum i6, NAME##_enum i7, NAME##_enum i8, NAME##_enum i9, NAME##_enum i10, NAME##_enum i11, NAME##_enum i12, NAME##_enum i13, NAME##_enum i14, NAME##_enum i15, NAME##_enum i16, NAME##_enum i17, NAME##_enum i18, NAME##_enum i19, NAME##_enum i20, NAME##_enum i21, NAME##_enum i22, NAME##_enum i23, NAME##_enum i24, NAME##_enum i25) const {\ - return NAME##_cus_field_list (this, d, m, i1, i2, i3, i4, i5, i6, i7, i8, i9, i10, i11, i12, i13, i14, i15, i16, i17, i18, i19, i20, i21, i22, i23, i24, i25); \ - } \ - template \ - inline NAME##_cus_equal_list NAME::equal_list(cchar *d, cchar *c, Manip m, \ - NAME##_enum i1, NAME##_enum i2, NAME##_enum i3, NAME##_enum i4, NAME##_enum i5, NAME##_enum i6, NAME##_enum i7, NAME##_enum i8, NAME##_enum i9, NAME##_enum i10, NAME##_enum i11, NAME##_enum i12, NAME##_enum i13, NAME##_enum i14, NAME##_enum i15, NAME##_enum i16, NAME##_enum i17, NAME##_enum i18, NAME##_enum i19, NAME##_enum i20, NAME##_enum i21, NAME##_enum i22, NAME##_enum i23, NAME##_enum i24, NAME##_enum i25) const { \ - return NAME##_cus_equal_list (this, d, c, m, i1, i2, i3, i4, i5, i6, i7, i8, i9, i10, i11, i12, i13, i14, i15, i16, i17, i18, i19, i20, i21, i22, i23, i24, i25); \ - } \ - template \ - inline NAME##_cus_value_list NAME::value_list(cchar *d, Manip m,\ - std::vector *i) const {\ - return NAME##_cus_value_list (this, d, m, i);\ - }\ - template \ - inline NAME##_cus_field_list NAME::field_list(cchar *d, Manip m,\ - std::vector *i) const {\ - return NAME##_cus_field_list (this, d, m, i);\ - }\ - template \ - inline NAME##_cus_equal_list NAME::equal_list(cchar *d, cchar *c, Manip m,\ - std::vector *i) const {\ - return NAME##_cus_equal_list (this, d, c, m, i);\ - }\ - template \ - inline NAME##_cus_value_list \ - NAME::value_list(cchar *d, Manip m, sql_cmp_type /*sc*/) const {\ - sql_compare_type_def_##CMP (NAME, value, NUM);\ - }\ - template \ - inline NAME##_cus_field_list \ - NAME::field_list(cchar *d, Manip m, sql_cmp_type /*sc*/) const {\ - sql_compare_type_def_##CMP (NAME, field, NUM);\ - }\ - template \ - inline NAME##_cus_equal_list \ - NAME::equal_list(cchar *d, cchar *c, Manip m, sql_cmp_type /*sc*/) const {\ - sql_compare_type_defe_##CMP (NAME, equal, NUM);\ - }\ - template \ - void populate_##NAME (NAME *s, const Row &row) { \ - s->I1 = static_cast(row.at(O1));\ - s->I2 = static_cast(row.at(O2));\ - s->I3 = static_cast(row.at(O3));\ - s->I4 = static_cast(row.at(O4));\ - s->I5 = static_cast(row.at(O5));\ - s->I6 = static_cast(row.at(O6));\ - s->I7 = static_cast(row.at(O7));\ - s->I8 = static_cast(row.at(O8));\ - s->I9 = static_cast(row.at(O9));\ - s->I10 = static_cast(row.at(O10));\ - s->I11 = static_cast(row.at(O11));\ - s->I12 = static_cast(row.at(O12));\ - s->I13 = static_cast(row.at(O13));\ - s->I14 = static_cast(row.at(O14));\ - s->I15 = static_cast(row.at(O15));\ - s->I16 = static_cast(row.at(O16));\ - s->I17 = static_cast(row.at(O17));\ - s->I18 = static_cast(row.at(O18));\ - s->I19 = static_cast(row.at(O19));\ - s->I20 = static_cast(row.at(O20));\ - s->I21 = static_cast(row.at(O21));\ - s->I22 = static_cast(row.at(O22));\ - s->I23 = static_cast(row.at(O23));\ - s->I24 = static_cast(row.at(O24));\ - s->I25 = static_cast(row.at(O25));\ - } \ - inline NAME::NAME (const Row &row) \ - {populate_##NAME(this, row);}\ - inline void NAME::set (const Row &row)\ - {populate_##NAME(this, row);}\ - sql_COMPARE__##CMP(NAME, I1, I2, I3, I4, I5, I6, I7, I8, I9, I10, I11, I12, I13, I14, I15, I16, I17, I18, I19, I20, I21, I22, I23, I24, I25 ) - -#define sql_create_basic_25(NAME, CMP, CONTR, T1, I1, T2, I2, T3, I3, T4, I4, T5, I5, T6, I6, T7, I7, T8, I8, T9, I9, T10, I10, T11, I11, T12, I12, T13, I13, T14, I14, T15, I15, T16, I16, T17, I17, T18, I18, T19, I19, T20, I20, T21, I21, T22, I22, T23, I23, T24, I24, T25, I25) \ - sql_create_basic_c_order_25(NAME, CMP, CONTR, T1, I1, 0, T2, I2, 1, T3, I3, 2, T4, I4, 3, T5, I5, 4, T6, I6, 5, T7, I7, 6, T8, I8, 7, T9, I9, 8, T10, I10, 9, T11, I11, 10, T12, I12, 11, T13, I13, 12, T14, I14, 13, T15, I15, 14, T16, I16, 15, T17, I17, 16, T18, I18, 17, T19, I19, 18, T20, I20, 19, T21, I21, 20, T22, I22, 21, T23, I23, 22, T24, I24, 23, T25, I25, 24) - -#define sql_create_25(NAME, CMP, CONTR, T1, I1, T2, I2, T3, I3, T4, I4, T5, I5, T6, I6, T7, I7, T8, I8, T9, I9, T10, I10, T11, I11, T12, I12, T13, I13, T14, I14, T15, I15, T16, I16, T17, I17, T18, I18, T19, I19, T20, I20, T21, I21, T22, I22, T23, I23, T24, I24, T25, I25) \ - sql_create_complete_25(NAME, CMP, CONTR, T1, I1, #I1, 0, T2, I2, #I2, 1, T3, I3, #I3, 2, T4, I4, #I4, 3, T5, I5, #I5, 4, T6, I6, #I6, 5, T7, I7, #I7, 6, T8, I8, #I8, 7, T9, I9, #I9, 8, T10, I10, #I10, 9, T11, I11, #I11, 10, T12, I12, #I12, 11, T13, I13, #I13, 12, T14, I14, #I14, 13, T15, I15, #I15, 14, T16, I16, #I16, 15, T17, I17, #I17, 16, T18, I18, #I18, 17, T19, I19, #I19, 18, T20, I20, #I20, 19, T21, I21, #I21, 20, T22, I22, #I22, 21, T23, I23, #I23, 22, T24, I24, #I24, 23, T25, I25, #I25, 24) \ - -#define sql_create_c_order_25(NAME, CMP, CONTR, T1, I1, O1, T2, I2, O2, T3, I3, O3, T4, I4, O4, T5, I5, O5, T6, I6, O6, T7, I7, O7, T8, I8, O8, T9, I9, O9, T10, I10, O10, T11, I11, O11, T12, I12, O12, T13, I13, O13, T14, I14, O14, T15, I15, O15, T16, I16, O16, T17, I17, O17, T18, I18, O18, T19, I19, O19, T20, I20, O20, T21, I21, O21, T22, I22, O22, T23, I23, O23, T24, I24, O24, T25, I25, O25) \ - sql_create_complete_25(NAME, CMP, CONTR, T1, I1, #I1, O1, T2, I2, #I2, O2, T3, I3, #I3, O3, T4, I4, #I4, O4, T5, I5, #I5, O5, T6, I6, #I6, O6, T7, I7, #I7, O7, T8, I8, #I8, O8, T9, I9, #I9, O9, T10, I10, #I10, O10, T11, I11, #I11, O11, T12, I12, #I12, O12, T13, I13, #I13, O13, T14, I14, #I14, O14, T15, I15, #I15, O15, T16, I16, #I16, O16, T17, I17, #I17, O17, T18, I18, #I18, O18, T19, I19, #I19, O19, T20, I20, #I20, O20, T21, I21, #I21, O21, T22, I22, #I22, O22, T23, I23, #I23, O23, T24, I24, #I24, O24, T25, I25, #I25, O25) - -#define sql_create_c_names_25(NAME, CMP, CONTR, T1, I1, N1, T2, I2, N2, T3, I3, N3, T4, I4, N4, T5, I5, N5, T6, I6, N6, T7, I7, N7, T8, I8, N8, T9, I9, N9, T10, I10, N10, T11, I11, N11, T12, I12, N12, T13, I13, N13, T14, I14, N14, T15, I15, N15, T16, I16, N16, T17, I17, N17, T18, I18, N18, T19, I19, N19, T20, I20, N20, T21, I21, N21, T22, I22, N22, T23, I23, N23, T24, I24, N24, T25, I25, N25) \ - sql_create_complete_25(NAME, CMP, CONTR, T1, I1, N1, 0, T2, I2, N2, 1, T3, I3, N3, 2, T4, I4, N4, 3, T5, I5, N5, 4, T6, I6, N6, 5, T7, I7, N7, 6, T8, I8, N8, 7, T9, I9, N9, 8, T10, I10, N10, 9, T11, I11, N11, 10, T12, I12, N12, 11, T13, I13, N13, 12, T14, I14, N14, 13, T15, I15, N15, 14, T16, I16, N16, 15, T17, I17, N17, 16, T18, I18, N18, 17, T19, I19, N19, 18, T20, I20, N20, 19, T21, I21, N21, 20, T22, I22, N22, 21, T23, I23, N23, 22, T24, I24, N24, 23, T25, I25, N25, 24) - -// --------------------------------------------------- -// End Create 25 -// --------------------------------------------------- - DELETED lib/custom.h Index: lib/custom.h ================================================================== --- lib/custom.h +++ /dev/null @@ -1,80 +0,0 @@ - -// !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -// This file is generated by the Perl script custom.pl. Please do -// not modify this file directly. Change the script instead. -// !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! - -#ifndef MYSQLPP_CUSTOM_H -#define MYSQLPP_CUSTOM_H - -#include "defs.h" -#include "tiny_int.h" - -#include - -namespace mysqlpp { - -enum sql_dummy_type {sql_dummy}; - -inline int sql_cmp(const std::string &a, const std::string &b) { - return a.compare(b); -} - -inline int sql_cmp(char a,char b) { - return a-b; -} - -inline int sql_cmp(unsigned char a,unsigned char b) { - return a-b; -} - -inline int sql_cmp(tiny_int a,tiny_int b) { - return a-b; -} - -inline int sql_cmp(int a,int b) { - return a-b; -} - -inline int sql_cmp(unsigned int a,unsigned int b) { - return a-b; -} - -inline int sql_cmp(short int a,short int b) { - return a-b; -} - -inline int sql_cmp(unsigned short int a,unsigned short int b) { - return a-b; -} - -inline int sql_cmp(double a,double b) { - if (a == b) return 0; - if (a < b) return -1; - return 1; -} - -inline int sql_cmp(float a,float b) { - if (a == b) return 0; - if (a < b) return -1; - return 1; -} - -inline int sql_cmp(longlong a,longlong b) { - if (a == b) return 0; - if (a < b) return -1; - return 1; -} - -inline int sql_cmp(ulonglong a,ulonglong b) { - if (a == b) return 0; - if (a < b) return -1; - return 1; -} - -#include "custom-macros.h" - -} // end namespace mysqlpp - -#endif - DELETED lib/custom.pl Index: lib/custom.pl ================================================================== --- lib/custom.pl +++ /dev/null @@ -1,888 +0,0 @@ -#!/usr/bin/perl - -######################################################################## -# custom.pl - Generates custom.h and custom-macros.h, as these files -# contain many near-duplicate classes, varying only in the number of -# SQL table columns they support. -# -# Copyright (c) 1998 by Kevin Atkinson, (c) 1999, 2000 and 2001 by -# MySQL AB, and (c) 2004, 2005 by Educational Technology Resources, Inc. -# Others may also hold copyrights on code in this file. See the CREDITS -# file in the top directory of the distribution for details. -# -# This file is part of MySQL++. -# -# MySQL++ is free software; you can redistribute it and/or modify it -# under the terms of the GNU Lesser General Public License as published -# by the Free Software Foundation; either version 2.1 of the License, or -# (at your option) any later version. -# -# MySQL++ is distributed in the hope that it will be useful, but WITHOUT -# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -# FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public -# License for more details. -# -# You should have received a copy of the GNU Lesser General Public -# License along with MySQL++; if not, write to the Free Software -# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 -# USA -######################################################################## - - -# This is the limit on the number of SSQLS data members. Higher values -# will make custom-macros.h exponentially larger, increase compile -# times, and possibly even expose limits in your compiler. Increase it -# only if you must. -my $max_data_members = 25; - - -# No user-serviceable parts below. - -open (OUT0, ">custom.h"); -open (OUT, ">custom-macros.h"); - -print OUT0 << "---"; - -// !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -// This file is generated by the Perl script custom.pl. Please do -// not modify this file directly. Change the script instead. -// !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! - -#ifndef MYSQLPP_CUSTOM_H -#define MYSQLPP_CUSTOM_H - -#include "defs.h" -#include "tiny_int.h" - -#include - -namespace mysqlpp { - -enum sql_dummy_type {sql_dummy}; - -inline int sql_cmp(const std::string &a, const std::string &b) { - return a.compare(b); -} ---- - -@types = ("char", "unsigned char", "tiny_int", "int", "unsigned int", - "short int", "unsigned short int"); -foreach $type (@types) { - print OUT0 << "---"; - -inline int sql_cmp($type a,$type b) { - return a-b; -} ---- -} - -@types = ("double", "float"); -foreach $type (@types) { - print OUT0 << "---"; - -inline int sql_cmp($type a,$type b) { - if (a == b) return 0; - if (a < b) return -1; - return 1; -} ---- -} - -@types = ("longlong", "ulonglong"); -foreach $type (@types) { - print OUT0 << "---"; - -inline int sql_cmp($type a,$type b) { - if (a == b) return 0; - if (a < b) return -1; - return 1; -} ---- -} - -print OUT0 << "---"; - -#include "custom-macros.h" - -} // end namespace mysqlpp - -#endif - ---- - -print OUT << "---"; - -// !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -// This file is generated by the Perl script custom.pl. Please do -// not modify this file directly. Change the script instead. -// !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! - -// --------------------------------------------------- -// Begin Mandatory Compare -// --------------------------------------------------- - -#define sql_compare_define(NAME) \\ - bool operator == (const NAME &other) const \\ - {return sql_compare_##NAME(*this,other) == 0;} \\ - bool operator != (const NAME &other) const \\ - {return sql_compare_##NAME(*this,other) != 0;} \\ - bool operator > (const NAME &other) const \\ - {return sql_compare_##NAME(*this,other) > 0;} \\ - bool operator < (const NAME &other) const \\ - {return sql_compare_##NAME(*this,other) < 0;} \\ - bool operator >= (const NAME &other) const \\ - {return sql_compare_##NAME(*this,other) >= 0;} \\ - bool operator <= (const NAME &other) const \\ - {return sql_compare_##NAME(*this,other) <= 0;} \\ - int cmp (const NAME &other) const \\ - {return sql_compare_##NAME(*this,other);} \\ - int compare (const NAME &other) const \\ - {return sql_compare_##NAME(*this,other);} ---- - -foreach $j (1..$max_data_members) { - $parm0 .= "T$j, C$j"; - $parm0 .= ", " unless $j == $max_data_members; - $parm1 .= "C$j"; - $parm1 .= ", " unless $j == $max_data_members; -} - -print OUT << "---"; - -#define sql_compare_define_0(NAME, $parm0) - -#define sql_construct_define_0(NAME, $parm0) - -#define sql_COMPARE__0(NAME, $parm1) - -#define sql_compare_type_def_0(NAME, WHAT, NUM) \\ - sql_compare_type_def_##NUM (NAME, WHAT, NUM) - -#define sql_compare_type_defe_0(NAME, WHAT, NUM) \\ - sql_compare_type_defe_##NUM (NAME, WHAT, NUM) - -// --------------------------------------------------- -// End Mandatory Compare -// --------------------------------------------------- ---- - -foreach $i (1..$max_data_members) { - $compr = ""; $parm2 = ""; $define = ""; - $compr = " int cmp; \\\n" unless $i == 1; - $compp = ""; - foreach $j (1..$i) { - $compr .= " if (cmp = sql_cmp(x.C$j , y.C$j )) return cmp; \\\n" - unless $j == $i; - $compr .= " return sql_cmp(x.C$j , y.C$j );" if $j == $i; - $parm2 .= "const T$j &p$j"; - $parm2 .= ", " unless $j == $i; - $define.= "C$j (p$j)"; - $define.= ", " unless $j == $i; - $set .= " C$j = p$j;\\\n"; - $compp .= "true"; - $compp .= ", " unless $j == $i; - } - print OUT << "---"; - -// --------------------------------------------------- -// Begin Compare $i -// --------------------------------------------------- - -#define sql_compare_define_$i(NAME, $parm0) \\ - NAME ($parm2) : $define {} \\ - void set ($parm2) { \\ -$set \\ - } \\ - sql_compare_define(NAME) - -#define sql_construct_define_$i(NAME, $parm0) \\ - void set ($parm2) { \\ -$set \\ - } \\ - NAME ($parm2) : $define {} - -#define sql_compare_type_def_$i(NAME, WHAT, NUM) \\ - return WHAT##_list(d, m, $compp) - -#define sql_compare_type_defe_$i(NAME, WHAT, NUM) \\ - return WHAT##_list(d, c, m, $compp) - -#define sql_COMPARE__$i(NAME, $parm1) \\ - template \\ - int sql_compare_##NAME (const NAME &x, const NAME &y) { \\ -$compr \\ - } \\ - template \\ - int compare (const NAME &x, const NAME &y) { \\ -$compr \\ - } - -// --------------------------------------------------- -// End Compare $i -// --------------------------------------------------- - ---- -} - -print OUT << "---"; ---- - - -foreach $i (1..$max_data_members) { - $parm_complete = ""; - $parm_order = ""; $parm_order2c = ""; - $parm_simple = ""; $parm_simple2c = ""; - $parm_simple_b = ""; $parm_simple2c_b = ""; - $parm_names = ""; $parm_names2c = ""; - $defs = ""; $popul = ""; $parmc = ""; $parmC = ""; - $value_list = ""; $field_list = ""; $equal_list = ""; - $value_list_cus = ""; $cus_field_list = ""; $cus_equal_list = ""; - $create_bool = ""; $create_list = ""; - $cusparms1 = ""; $cusparms2 = ""; $cusparmsv = ""; - $cusparms11 = ""; $cusparms22 = ""; - $names = "";$enums = ""; - foreach $j (1 .. $i) { - $parm_complete .= "T$j, I$j, N$j, O$j"; - $parm_complete .= ", " unless $j == $i; - $parm_order .= "T$j, I$j, O$j"; - $parm_order .= ", " unless $j == $i; - $parm_order2c .= "T$j, I$j, #I$j, O$j"; - $parm_order2c .= ", " unless $j == $i; - $parm_names .= "T$j, I$j, N$j"; - $parm_names .= ", " unless $j == $i; - $parm_names2c .= "T$j, I$j, N$j, ". ($j-1); - $parm_names2c .= ", " unless $j == $i; - $parm_simple .= "T$j, I$j"; - $parm_simple .= ", " unless $j == $i; - $parm_simple2c .= "T$j, I$j, #I$j, ". ($j-1); - $parm_simple2c .= ", " unless $j == $i; - $parm_simple_b .= "T$j, I$j"; - $parm_simple_b .= ", " unless $j == $i; - $parm_simple2c_b .= "T$j, I$j, ". ($j-1); - $parm_simple2c_b .= ", " unless $j == $i; - $defs .= " T$j I$j;"; - $defs .= "\n" unless $j == $i; - $popul .= " s->I$j = static_cast(row.at(O$j));"; - $popul .= "\n" unless $j == $i; - $names .= " N$j "; - $names .= ",\n" unless $j == $i; - $enums .= " NAME##_##I$j"; - $enums .= ",\n" unless $j == $i; - $field_list .= " s << obj.manip << obj.obj->names[".($j-1)."]"; - $field_list .= " << obj.delem;\n" unless $j == $i; - $value_list .= " s << obj.manip << obj.obj->I$j"; - $value_list .= " << obj.delem;\n" unless $j == $i; - $create_bool .= " if (i$j) (*include)[".($j-1)."]=true;\n"; - $create_list .= " if (i$j == NAME##_NULL) return;\n" unless $i == 1; - $create_list .= " (*include)[i$j]=true;\n"; - - $value_list_cus .= " if ((*obj.include)[".($j-1)."]) { \n"; - $value_list_cus .= " if (before) s << obj.delem;\n" unless $j == 1; - $value_list_cus .= " s << obj.manip << obj.obj->I$j;\n"; - $value_list_cus .= " before = true; \n" unless $j == $i; - $value_list_cus .= " } \n"; - - $cus_field_list .= " if ((*obj.include)[".($j-1)."]) { \n"; - $cus_field_list .= " if (before) s << obj.delem;\n" unless $j == 1; - $cus_field_list .= " s << obj.manip << obj.obj->names[".($j-1)."];\n"; - $cus_field_list .= " before = true; \n" unless $j == $i; - $cus_field_list .= " } \n"; - - $cus_equal_list .= " if ((*obj.include)[".($j-1)."]) { \n"; - $cus_equal_list .= " if (before) s << obj.delem;\n" unless $j == 1; - $cus_equal_list .= " s << obj.obj->names[".($j-1)."] << obj.comp"; - $cus_equal_list .= " << obj.manip << obj.obj->I$j;\n"; - $cus_equal_list .= " before = true; \n" unless $j == $i; - $cus_equal_list .= " } \n"; - - $equal_list .= " s << obj.obj->names[".($j-1)."] << obj.comp"; - $equal_list .= " << obj.manip << obj.obj->I$j"; - $equal_list .= " << obj.delem;\n" unless $j == $i; - $cusparms1 .= "bool i$j" if $j == 1; - $cusparms1 .= "bool i$j = false" unless $j == 1; - $cusparms1 .= ", " unless $j == $i; - $cusparms11 .= "bool i$j" ; - $cusparms11 .= ", " unless $j == $i; - $cusparms2 .= "NAME##_enum i$j" if $j == 1; - $cusparms2 .= "NAME##_enum i$j = NAME##_NULL" unless $j == 1; - $cusparms2 .= ", " unless $j == $i; - $cusparms22 .= "NAME##_enum i$j"; - $cusparms22 .= ", " unless $j == $i; - $cusparmsv .= "i$j"; - $cusparmsv .= ", " unless $j == $i; - $parmC .= "T$j, I$j"; - $parmC .= ", " unless $j == $max_data_members; - $parmc .= "I$j"; - $parmc .= ", " unless $j == $max_data_members; - } - foreach $j ($i+1 .. $max_data_members) { - $parmC .= "0, 0"; - $parmC .= ", " unless $j == $max_data_members; - $parmc .= "0"; - $parmc .= ", " unless $j == $max_data_members; - } - - print OUT << "---"; -// --------------------------------------------------- -// Begin Create $i -// --------------------------------------------------- ---- - $out = <<"---"; -#define sql_create_basic_c_order_$i(NAME, CMP, CONTR, $parm_order) - - struct NAME; - - template int sql_compare_##NAME (const NAME &, const NAME &); - - struct NAME { -$defs - NAME () {} - NAME (const Row &row); - sql_compare_define_##CMP(NAME, $parmC) - }; - - template - void populate_##NAME (NAME *s, const Row &row) { -$popul - } - - inline NAME::NAME (const Row &row) - {populate_##NAME(this, row);} - - sql_COMPARE__##CMP(NAME, $parmc ) ---- - print OUT &prepare($out); - - $out = <<"---"; -#define sql_create_complete_$i(NAME, CMP, CONTR, $parm_complete) - struct NAME; - - enum NAME##_enum { -$enums - ,NAME##_NULL - }; - - template - class NAME##_value_list { - /*friend std::ostream& operator << <> (std::ostream&, const NAME##_value_list&); */ - public: - const NAME *obj; - cchar *delem; - Manip manip; - public: - NAME##_value_list (const NAME *o, cchar *d, Manip m) - : obj(o), delem(d), manip(m) {} - }; - - template - class NAME##_##field_list { - /* friend std::ostream& operator << <> (std::ostream&, const NAME##_field_list&); */ - public: - const NAME *obj; - cchar *delem; - Manip manip; - public: - NAME##_field_list (const NAME *o, cchar *d, Manip m) - : obj(o), delem(d), manip(m) {} - }; - - template - class NAME##_equal_list { - /* friend std::ostream& operator << <> (std::ostream&, const NAME##_equal_list&); */ - public: - const NAME *obj; - cchar *delem; - cchar *comp; - Manip manip; - public: - NAME##_equal_list (const NAME *o, cchar *d, cchar *c, Manip m) - : obj(o), delem(d), comp(c), manip(m) {} - }; - - template - class NAME##_cus_value_list { - /* friend std::ostream& operator << <> (std::ostream&, - const NAME##_cus_value_list&); */ - public: - const NAME *obj; - std::vector *include; - bool del_vector; - cchar *delem; - Manip manip; - public: - ~NAME##_cus_value_list () {if (del_vector) delete include;} - NAME##_cus_value_list (const NAME *o, cchar *d, Manip m, $cusparms11); - NAME##_cus_value_list (const NAME *o, cchar *d, Manip m, $cusparms22); - NAME##_cus_value_list (const NAME *o, cchar *d, Manip m ,std::vector* i) - : obj(o), include(i), del_vector(false), delem(d), manip(m) {} - }; - - template - class NAME##_cus_field_list { - /* friend std::ostream& operator << <> (std::ostream&, - const NAME##_cus_field_list&); */ - public: - const NAME *obj; - std::vector *include; - bool del_vector; - cchar *delem; - Manip manip; - public: - ~NAME##_cus_field_list () {if (del_vector) delete include;} - NAME##_cus_field_list (const NAME *o, cchar *d, Manip m, $cusparms11); - NAME##_cus_field_list (const NAME *o, cchar *d, Manip m, $cusparms22); - NAME##_cus_field_list (const NAME *o, cchar *d, Manip m, std::vector *i) - : obj(o), include(i), del_vector(false), delem(d), manip(m) {} - }; - - template - class NAME##_cus_equal_list { - /* friend std::ostream& operator << <> (std::ostream&, - const NAME##_cus_equal_list&); */ - public: - const NAME *obj; - std::vector *include; - bool del_vector; - cchar *delem; - cchar *comp; - Manip manip; - public: - ~NAME##_##cus_equal_list () {if (del_vector) delete include;} - NAME##_##cus_equal_list (const NAME *o, cchar *d, cchar *c, Manip m, $cusparms11); - NAME##_##cus_equal_list (const NAME *o, cchar *d, cchar *c, Manip m, $cusparms22); - NAME##_##cus_equal_list (const NAME *o, cchar *d, cchar *c, Manip m, std::vector *i) - : obj(o), include(i), del_vector(false), delem(d), comp(c), manip(m) {} - }; - - template int sql_compare_##NAME (const NAME &, const NAME &); - - struct NAME { -$defs - NAME () {} - NAME (const Row &row); - void set (const Row &row); - sql_compare_define_##CMP(NAME, $parmC) - sql_construct_define_##CONTR(NAME, $parmC) - static const char *names[]; - static const char *_table; - static const char *& table() {return _table;} - - NAME##_value_list value_list() const { - return value_list(",", quote);} - NAME##_value_list value_list(cchar *d) const { - return value_list(d, quote);} - template - NAME##_value_list value_list(cchar *d, Manip m) const; - - NAME##_field_list field_list() const { - return field_list(",", do_nothing);} - NAME##_field_list field_list(cchar *d) const { - return field_list(d, do_nothing);} - template - NAME##_field_list field_list(cchar *d, Manip m) const; - - NAME##_equal_list equal_list(cchar *d = ",", - cchar *c = " = ") const{ - return equal_list(d, c, quote);} - template - NAME##_equal_list equal_list(cchar *d, cchar *c, Manip m) const; - - /* cus_data */ - - NAME##_cus_value_list value_list($cusparms1) const { - return value_list(",", quote, $cusparmsv); - } - NAME##_cus_value_list value_list($cusparms2) const { - return value_list(",", quote, $cusparmsv); - } - NAME##_cus_value_list value_list(std::vector *i) const { - return value_list(",", quote, i); - } - NAME##_cus_value_list value_list(sql_cmp_type sc) const { - return value_list(",", quote, sc); - } - - NAME##_cus_value_list value_list(cchar *d, $cusparms1) const { - return value_list(d, quote, $cusparmsv); - } - NAME##_cus_value_list value_list(cchar *d, $cusparms2) const { - return value_list(d, quote, $cusparmsv); - } - NAME##_cus_value_list value_list(cchar *d, - std::vector *i) const { - return value_list(d, quote, i); - } - NAME##_cus_value_list value_list(cchar *d, - sql_cmp_type sc) const { - return value_list(d, quote, sc); - } - - template - NAME##_cus_value_list value_list(cchar *d, Manip m, - $cusparms1) const; - template - NAME##_cus_value_list value_list(cchar *d, Manip m, - $cusparms2) const; - template - NAME##_cus_value_list value_list(cchar *d, Manip m, - std::vector *i) const; - template - NAME##_cus_value_list value_list(cchar *d, Manip m, - sql_cmp_type sc) const; - /* cus field */ - - NAME##_cus_field_list field_list($cusparms1) const { - return field_list(",", do_nothing, $cusparmsv); - } - NAME##_cus_field_list field_list($cusparms2) const { - return field_list(",", do_nothing, $cusparmsv); - } - NAME##_cus_field_list field_list(std::vector *i) const { - return field_list(",", do_nothing, i); - } - NAME##_cus_field_list field_list(sql_cmp_type sc) const - { - return field_list(",", do_nothing, sc); - } - - NAME##_cus_field_list field_list(cchar *d, - $cusparms1) const { - return field_list(d, do_nothing, $cusparmsv); - } - NAME##_cus_field_list field_list(cchar *d, - $cusparms2) const { - return field_list(d, do_nothing, $cusparmsv); - } - NAME##_cus_field_list field_list(cchar *d, - std::vector *i) const { - return field_list(d, do_nothing, i); - } - NAME##_cus_field_list field_list(cchar *d, - sql_cmp_type sc) const { - return field_list(d, do_nothing, sc); - } - - template - NAME##_cus_field_list field_list(cchar *d, Manip m, - $cusparms1) const; - template - NAME##_cus_field_list field_list(cchar *d, Manip m, - $cusparms2) const; - template - NAME##_cus_field_list field_list(cchar *d, Manip m, - std::vector *i) const; - template - NAME##_cus_field_list field_list(cchar *d, Manip m, - sql_cmp_type sc) const; - - /* cus equal */ - - NAME##_cus_equal_list equal_list($cusparms1) const { - return equal_list(",", " = ", quote, $cusparmsv); - } - NAME##_cus_equal_list equal_list($cusparms2) const { - return equal_list(",", " = ", quote, $cusparmsv); - } - NAME##_cus_equal_list equal_list(std::vector *i) const { - return equal_list(",", " = ", quote, i); - } - NAME##_cus_equal_list equal_list(sql_cmp_type sc) const { - return equal_list(",", " = ", quote, sc); - } - - NAME##_cus_equal_list equal_list(cchar *d, $cusparms1) const { - return equal_list(d, " = ", quote, $cusparmsv); - } - NAME##_cus_equal_list equal_list(cchar *d, $cusparms2) const { - return equal_list(d, " = ", quote, $cusparmsv); - } - NAME##_cus_equal_list equal_list(cchar *d, - std::vector *i) const { - return equal_list(d, " = ", quote, i); - } - NAME##_cus_equal_list equal_list(cchar *d, - sql_cmp_type sc) const { - return equal_list(d, " = ", quote, sc); - } - - NAME##_cus_equal_list equal_list(cchar *d, cchar *c, - $cusparms1) const { - return equal_list(d, c, quote, $cusparmsv); - } - NAME##_cus_equal_list equal_list(cchar *d, cchar *c, - $cusparms2) const { - return equal_list(d, c, quote, $cusparmsv); - } - NAME##_cus_equal_list equal_list(cchar *d, cchar *c, - std::vector *i) const { - return equal_list(d, c, quote, i); - } - NAME##_cus_equal_list equal_list(cchar *d, cchar *c, - sql_cmp_type sc) const { - return equal_list(d, c, quote, sc); - } - - template - NAME##_cus_equal_list equal_list(cchar *d, cchar *c, Manip m, - $cusparms1) const; - template - NAME##_cus_equal_list equal_list(cchar *d, cchar *c, Manip m, - $cusparms2) const; - template - NAME##_cus_equal_list equal_list(cchar *d, cchar *c, Manip m, - std::vector *i) const; - template - NAME##_cus_equal_list equal_list(cchar *d, cchar *c, Manip m, - sql_cmp_type sc) const; - }; - - const char *NAME::names[] = { -$names - }; - const char *NAME::_table = #NAME ; - - template - NAME##_cus_value_list::NAME##_cus_value_list - (const NAME *o, cchar *d, Manip m, $cusparms11) - { - delem = d; - manip = m; - del_vector = true; - obj = o; - include = new std::vector($i, false); -$create_bool - } - - template - NAME##_cus_value_list::NAME##_cus_value_list - (const NAME *o, cchar *d, Manip m, $cusparms22) { - delem = d; - manip = m; - del_vector = true; - obj = o; - include = new std::vector($i, false); -$create_list - } - - template - NAME##_cus_field_list::NAME##_cus_field_list - (const NAME *o, cchar *d, Manip m, $cusparms11) { - delem = d; - manip = m; - del_vector = true; - obj = o; - include = new std::vector($i, false); -$create_bool - } - - template - NAME##_cus_field_list::NAME##_cus_field_list - (const NAME *o, cchar *d, Manip m, $cusparms22) { - delem = d; - manip = m; - del_vector = true; - obj = o; - include = new std::vector($i, false); -$create_list - } - - template - NAME##_cus_equal_list::NAME##_cus_equal_list - (const NAME *o, cchar *d, cchar *c, Manip m, $cusparms11) { - delem = d; - comp = c; - manip = m; - del_vector = true; - obj = o; - include = new std::vector($i, false); -$create_bool - } - - template - NAME##_cus_equal_list::NAME##_cus_equal_list - (const NAME *o, cchar *d, cchar *c, Manip m, $cusparms22) { - delem = d; - comp = c; - manip = m; - del_vector = true; - obj = o; - include = new std::vector($i, false); -$create_list - } - - template - std::ostream& operator << (std::ostream& s, const NAME##_value_list& obj) { -$value_list; - return s; - } - - template - std::ostream& operator << (std::ostream& s, const NAME##_field_list& obj) { -$field_list; - return s; - } - - template - std::ostream& operator << (std::ostream& s, const NAME##_equal_list& obj) { -$equal_list; - return s; - } - - template - std::ostream& operator << (std::ostream& s, const NAME##_cus_value_list& obj) { - bool before = false; -$value_list_cus - return s; - } - - template - std::ostream& operator << (std::ostream& s, const NAME##_cus_field_list& obj) { - bool before = false; -$cus_field_list - return s; - } - - template - std::ostream& operator << (std::ostream& s, const NAME##_cus_equal_list& obj) { - bool before = false; -$cus_equal_list - return s; - } - - template - inline NAME##_value_list NAME::value_list(cchar *d, Manip m) const { - return NAME##_value_list (this, d, m); - } - - template - inline NAME##_field_list NAME::field_list(cchar *d, Manip m) const { - return NAME##_field_list (this, d, m); - } - - template - inline NAME##_equal_list NAME::equal_list(cchar *d, cchar *c, Manip m) const { - return NAME##_equal_list (this, d, c, m); - } - - template - inline NAME##_cus_value_list NAME::value_list(cchar *d, Manip m, - $cusparms11) const { - return NAME##_cus_value_list (this, d, m, $cusparmsv); - } - - template - inline NAME##_cus_field_list NAME::field_list(cchar *d, Manip m, - $cusparms11) const { - return NAME##_cus_field_list (this, d, m, $cusparmsv); - } - - template - inline NAME##_cus_equal_list NAME::equal_list(cchar *d, cchar *c, Manip m, - $cusparms11) const { - return NAME##_cus_equal_list (this, d, c, m, $cusparmsv); - } - - template - inline NAME##_cus_value_list NAME::value_list(cchar *d, Manip m, - $cusparms22) const { - return NAME##_cus_value_list (this, d, m, $cusparmsv); - } - - template - inline NAME##_cus_field_list NAME::field_list(cchar *d, Manip m, - $cusparms22) const { - return NAME##_cus_field_list (this, d, m, $cusparmsv); - } - - template - inline NAME##_cus_equal_list NAME::equal_list(cchar *d, cchar *c, Manip m, - $cusparms22) const { - return NAME##_cus_equal_list (this, d, c, m, $cusparmsv); - } - - template - inline NAME##_cus_value_list NAME::value_list(cchar *d, Manip m, - std::vector *i) const { - return NAME##_cus_value_list (this, d, m, i); - } - - template - inline NAME##_cus_field_list NAME::field_list(cchar *d, Manip m, - std::vector *i) const { - return NAME##_cus_field_list (this, d, m, i); - } - - template - inline NAME##_cus_equal_list NAME::equal_list(cchar *d, cchar *c, Manip m, - std::vector *i) const { - return NAME##_cus_equal_list (this, d, c, m, i); - } - - template - inline NAME##_cus_value_list - NAME::value_list(cchar *d, Manip m, sql_cmp_type /*sc*/) const { - sql_compare_type_def_##CMP (NAME, value, NUM); - } - - template - inline NAME##_cus_field_list - NAME::field_list(cchar *d, Manip m, sql_cmp_type /*sc*/) const { - sql_compare_type_def_##CMP (NAME, field, NUM); - } - - template - inline NAME##_cus_equal_list - NAME::equal_list(cchar *d, cchar *c, Manip m, sql_cmp_type /*sc*/) const { - sql_compare_type_defe_##CMP (NAME, equal, NUM); - } - - template - void populate_##NAME (NAME *s, const Row &row) { -$popul - } - - inline NAME::NAME (const Row &row) - {populate_##NAME(this, row);} - inline void NAME::set (const Row &row) - {populate_##NAME(this, row);} - - sql_COMPARE__##CMP(NAME, $parmc ) - ---- -print OUT &prepare($out); - -# -# short cut defs -# - -print OUT << "---"; -#define sql_create_basic_$i(NAME, CMP, CONTR, $parm_simple_b) \\ - sql_create_basic_c_order_$i(NAME, CMP, CONTR, $parm_simple2c_b) - -#define sql_create_$i(NAME, CMP, CONTR, $parm_simple) \\ - sql_create_complete_$i(NAME, CMP, CONTR, $parm_simple2c) \\ - -#define sql_create_c_order_$i(NAME, CMP, CONTR, $parm_order) \\ - sql_create_complete_$i(NAME, CMP, CONTR, $parm_order2c) - -#define sql_create_c_names_$i(NAME, CMP, CONTR, $parm_names) \\ - sql_create_complete_$i(NAME, CMP, CONTR, $parm_names2c) - -// --------------------------------------------------- -// End Create $i -// --------------------------------------------------- - ---- - -} - - -sub prepare { - local $_ = @_[0]; - s/\n+$//; - s/\n[\n ]*\n/\n/g; - s/\n+/\\\n/g; - $_ .= "\n\n"; - return $_; -} - Index: lib/datetime.cpp ================================================================== --- lib/datetime.cpp +++ lib/datetime.cpp @@ -1,13 +1,13 @@ /*********************************************************************** datetime.cpp - Implements date and time classes compatible with MySQL's various date and time column types. - Copyright (c) 1998 by Kevin Atkinson, (c) 1999, 2000 and 2001 by - MySQL AB, and (c) 2004, 2005 by Educational Technology Resources, Inc. - Others may also hold copyrights on code in this file. See the CREDITS - file in the top directory of the distribution for details. + Copyright (c) 1998 by Kevin Atkinson, (c) 1999-2001 by MySQL AB, and + (c) 2004-2008 by Educational Technology Resources, Inc. Others may + also hold copyrights on code in this file. See the CREDITS.txt file + in the top directory of the distribution for details. This file is part of MySQL++. MySQL++ is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published @@ -24,27 +24,49 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA ***********************************************************************/ #define MYSQLPP_NOT_HEADER -#include "platform.h" +#include "common.h" #include "datetime.h" +#include "stream2string.h" #include + +#include +#include using namespace std; namespace mysqlpp { + +static void +safe_localtime(struct tm* ptm, const time_t t) +{ +#if defined(MYSQLPP_HAVE_LOCALTIME_S) + // common.h detected localtime_s() from native RTL of VC++ 2005 and up + localtime_s(ptm, &t); +#elif defined(HAVE_LOCALTIME_R) + // autoconf detected POSIX's localtime_r() on this system + localtime_r(&t, ptm); +#else + // No explicitly thread-safe localtime() replacement found. This + // may still be thread-safe, as some C libraries take special steps + // within localtime() to get thread safety, such as TLS. + memcpy(ptm, localtime(&t), sizeof(tm)); +#endif +} + std::ostream& operator <<(std::ostream& os, const Date& d) { char fill = os.fill('0'); ios::fmtflags flags = os.setf(ios::right); - os << setw(4) << d.year << '-' - << setw(2) << d.month << '-' - << setw(2) << d.day; + os << setw(4) << d.year() << '-' + << setw(2) << static_cast(d.month()) << '-' + << setw(2) << static_cast(d.day()); os.flags(flags); os.fill(fill); return os; } @@ -51,126 +73,251 @@ std::ostream& operator <<(std::ostream& os, const Time& t) { char fill = os.fill('0'); ios::fmtflags flags = os.setf(ios::right); - os << setw(2) << t.hour << ':' - << setw(2) << t.minute << ':' - << setw(2) << t.second; + os << setw(2) << static_cast(t.hour()) << ':' + << setw(2) << static_cast(t.minute()) << ':' + << setw(2) << static_cast(t.second()); os.flags(flags); os.fill(fill); return os; } std::ostream& operator <<(std::ostream& os, const DateTime& dt) { - operator <<(os, Date(dt)); - os << ' '; - return operator <<(os, Time(dt)); + if (dt.is_now()) { + return os << "NOW()"; + } + else { + operator <<(os, Date(dt)); + os << ' '; + return operator <<(os, Time(dt)); + } +} + + +Date::Date(time_t t) +{ + struct tm tm; + safe_localtime(&tm, t); + + year_ = tm.tm_year + 1900; + month_ = tm.tm_mon + 1; + day_ = tm.tm_mday; +} + + +DateTime::DateTime(time_t t) +{ + struct tm tm; + safe_localtime(&tm, t); + + year_ = tm.tm_year + 1900; + month_ = tm.tm_mon + 1; + day_ = tm.tm_mday; + hour_ = tm.tm_hour; + minute_ = tm.tm_min; + second_ = tm.tm_sec; + + now_ = false; +} + + +Time::Time(time_t t) +{ + struct tm tm; + safe_localtime(&tm, t); + + hour_ = tm.tm_hour; + minute_ = tm.tm_min; + second_ = tm.tm_sec; } -cchar* Date::convert(cchar* str) +const char* +Date::convert(const char* str) { char num[5]; num[0] = *str++; num[1] = *str++; num[2] = *str++; num[3] = *str++; num[4] = 0; - year = short(strtol(num, 0, 10)); + year_ = static_cast(strtol(num, 0, 10)); if (*str == '-') str++; num[0] = *str++; num[1] = *str++; num[2] = 0; - month = short(strtol(num, 0, 10)); + month_ = static_cast(strtol(num, 0, 10)); if (*str == '-') str++; num[0] = *str++; num[1] = *str++; num[2] = 0; - day = short(strtol(num, 0, 10)); + day_ = static_cast(strtol(num, 0, 10)); return str; } -cchar* Time::convert(cchar* str) +const char* +Time::convert(const char* str) { char num[5]; num[0] = *str++; num[1] = *str++; num[2] = 0; - hour = short(strtol(num,0,10)); - if (*str == ':') str++; - - num[0] = *str++; - num[1] = *str++; - num[2] = 0; - minute = short(strtol(num,0,10)); - if (*str == ':') str++; - - num[0] = *str++; - num[1] = *str++; - num[2] = 0; - second = short(strtol(num,0,10)); - - return str; -} - - -cchar* DateTime::convert(cchar* str) -{ - Date d; - str = d.convert(str); - year = d.year; - month = d.month; - day = d.day; - - if (*str == ' ') ++str; - - Time t; - str = t.convert(str); - hour = t.hour; - minute = t.minute; - second = t.second; - - return str; -} - - -short int Date::compare(const Date& other) const -{ - if (year != other.year) return year - other.year; - if (month != other.month) return month - other.month; - return day - other.day; -} - - -short int Time::compare(const Time& other) const -{ - if (hour != other.hour) return hour - other.hour; - if (minute != other.minute) return minute - other.minute; - return second - other.second; -} - - -short int DateTime::compare(const DateTime& other) const -{ - Date d(*this), od(other); - Time t(*this), ot(other); - - if (int x = d.compare(od)) { - return x; - } - else { - return t.compare(ot); - } -} - -} // end namespace mysqlpp - + hour_ = static_cast(strtol(num,0,10)); + if (*str == ':') str++; + + num[0] = *str++; + num[1] = *str++; + num[2] = 0; + minute_ = static_cast(strtol(num,0,10)); + if (*str == ':') str++; + + num[0] = *str++; + num[1] = *str++; + num[2] = 0; + second_ = static_cast(strtol(num,0,10)); + + return str; +} + + +const char* +DateTime::convert(const char* str) +{ + Date d; + str = d.convert(str); + year_ = d.year(); + month_ = d.month(); + day_ = d.day(); + + if (*str == ' ') ++str; + + Time t; + str = t.convert(str); + hour_ = t.hour(); + minute_ = t.minute(); + second_ = t.second(); + + now_ = false; + + return str; +} + + +int +Date::compare(const Date& other) const +{ + if (year_ != other.year_) return year_ - other.year_; + if (month_ != other.month_) return month_ - other.month_; + return day_ - other.day_; +} + + +int +Time::compare(const Time& other) const +{ + if (hour_ != other.hour_) return hour_ - other.hour_; + if (minute_ != other.minute_) return minute_ - other.minute_; + return second_ - other.second_; +} + + +int +DateTime::compare(const DateTime& other) const +{ + if (now_ && other.now_) { + return 0; + } + else { + Date d(*this), od(other); + Time t(*this), ot(other); + + if (int x = d.compare(od)) { + return x; + } + else { + return t.compare(ot); + } + } +} + + +Date::operator std::string() const +{ + return stream2string(*this); +} + + +DateTime::operator std::string() const +{ + return stream2string(*this); +} + + +Time::operator std::string() const +{ + return stream2string(*this); +} + + +Date::operator time_t() const +{ + struct tm tm; + safe_localtime(&tm, time(0)); + + tm.tm_mday = day_; + tm.tm_mon = month_ - 1; + tm.tm_year = year_ - 1900; + tm.tm_isdst = -1; + + return mktime(&tm); +} + + +DateTime::operator time_t() const +{ + if (now_) { + // Many factors combine to make it almost impossible for this + // case to return the same value as you'd get if you used this + // in a query. But, you gotta better idea than to return the + // current time for an object initialized with the value "now"? + return time(0); + } + else { + struct tm tm; + tm.tm_sec = second_; + tm.tm_min = minute_; + tm.tm_hour = hour_; + tm.tm_mday = day_; + tm.tm_mon = month_ - 1; + tm.tm_year = year_ - 1900; + tm.tm_isdst = -1; + + return mktime(&tm); + } +} + + +Time::operator time_t() const +{ + struct tm tm; + safe_localtime(&tm, time(0)); + + tm.tm_sec = second_; + tm.tm_min = minute_; + tm.tm_hour = hour_; + tm.tm_isdst = -1; + + return mktime(&tm); +} + +} // end namespace mysqlpp Index: lib/datetime.h ================================================================== --- lib/datetime.h +++ lib/datetime.h @@ -1,14 +1,14 @@ /// \file datetime.h -/// \brief Declares classes to add MySQL-compatible date and time +/// \brief Declares classes to add SQL-compatible date and time /// types to C++'s type system. /*********************************************************************** - Copyright (c) 1998 by Kevin Atkinson, (c) 1999, 2000 and 2001 by - MySQL AB, and (c) 2004, 2005 by Educational Technology Resources, Inc. - Others may also hold copyrights on code in this file. See the CREDITS - file in the top directory of the distribution for details. + Copyright (c) 1998 by Kevin Atkinson, (c) 1999-2001 by MySQL AB, and + (c) 2004-2008 by Educational Technology Resources, Inc. Others may + also hold copyrights on code in this file. See the CREDITS.txt file + in the top directory of the distribution for details. This file is part of MySQL++. MySQL++ is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published @@ -24,177 +24,192 @@ License along with MySQL++; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA ***********************************************************************/ -#ifndef MYSQLPP_DATETIME_H +#if !defined(MYSQLPP_DATETIME_H) #define MYSQLPP_DATETIME_H -#include "defs.h" +#include "common.h" -#include "coldata.h" -#include "stream2string.h" -#include "tiny_int.h" +#include "comparable.h" #include -#include #include namespace mysqlpp { -/// \brief Base class template for MySQL++ date and time classes. -/// -/// This template primarily defines the comparison operators, which are -/// all implemented in terms of compare(). Each subclass implements that -/// as a protected method, because these operators are the only -/// supported comparison method. -/// -/// This template also defines interfaces for converting the object to -/// a string form, which a subclass must define. -template struct DTbase -{ - /// \brief Destroy object - virtual ~DTbase() { } - - /// \brief Return a copy of the item in C++ string form - operator std::string() const - { - return stream2string(*this); - } - - /// \brief Compare this object to another of the same type - /// - /// Returns < 0 if this object is "before" the other, 0 of they are - /// equal, and > 0 if this object is "after" the other. - MYSQLPP_EXPORT virtual short compare(const T& other) const = 0; - - /// \brief Returns true if "other" is equal to this object - bool operator ==(const T& other) const - { - return !compare(other); - } - - /// \brief Returns true if "other" is not equal to this object - bool operator !=(const T& other) const - { - return compare(other); - } - - /// \brief Returns true if "other" is less than this object - bool operator <(const T& other) const - { - return compare(other) < 0; - } - - /// \brief Returns true if "other" is less than or equal to this object - bool operator <=(const T& other) const - { - return compare(other) <= 0; - } - - /// \brief Returns true if "other" is greater than this object - bool operator >(const T& other) const - { - return compare(other) > 0; - } - - /// \brief Returns true if "other" is greater than or equal to this object - bool operator >=(const T& other) const - { - return compare(other) >= 0; - } -}; - - -/// \brief C++ form of MySQL's DATETIME type. -/// -/// Objects of this class can be inserted into streams, and -/// initialized from MySQL DATETIME strings. -struct DateTime : public DTbase -{ - /// \brief the year - /// - /// No surprises; the year 2005 is stored as the integer 2005. - short int year; - - /// \brief the month, 1-12 - tiny_int month; - - /// \brief the day, 1-31 - tiny_int day; - - /// \brief hour, 0-23 - tiny_int hour; - - /// \brief minute, 0-59 - tiny_int minute; - - /// \brief second, 0-59 - tiny_int second; - +/// \brief C++ form of SQL's DATETIME type. +/// +/// This object exists primarily for conversion purposes. You can +/// initialize it in several different ways, and then convert the object +/// to SQL string form, extract the individual y/m/d h:m:s values, +/// convert it to C's time_t, etc. + +class MYSQLPP_EXPORT DateTime : public Comparable +{ +public: /// \brief Default constructor DateTime() : - DTbase(), - year(0), - month(0), - day(0), - hour(0), - minute(0), - second(0) + Comparable(), + year_(0), + month_(0), + day_(0), + hour_(0), + minute_(0), + second_(0), + now_(true) + { + } + + /// \brief Initialize object from discrete y/m/d h:m:s values. + /// + /// \param y year, 1000-9999 + /// \param mon month, 1-12 + /// \param d day of month, 1-31 + /// \param h hour, 0-23 + /// \param min minute, 0-59 + /// \param s second, 0-59 + DateTime(unsigned short y, unsigned char mon, unsigned char d, + unsigned char h, unsigned char min, unsigned char s) : + Comparable(), + year_(y), + month_(mon), + day_(d), + hour_(h), + minute_(min), + second_(s), + now_(false) { } /// \brief Initialize object as a copy of another Date DateTime(const DateTime& other) : - DTbase(), - year(other.year), - month(other.month), - day(other.day), - hour(other.hour), - minute(other.minute), - second(other.second) - { - } - - /// \brief Initialize object from a MySQL date-and-time string - /// - /// String must be in the HH:MM:SS format. It doesn't have to be - /// zero-padded. - DateTime(cchar* str) { convert(str); } - - /// \brief Initialize object from a MySQL date-and-time string - /// - /// \sa DateTime(cchar*) - DateTime(const ColData& str) - { - convert(str.c_str()); - } - - /// \brief Initialize object from a MySQL date-and-time string - /// - /// \sa DateTime(cchar*) - DateTime(const std::string& str) - { - convert(str.c_str()); - } - - /// \brief Compare this datetime to another. - /// - /// Returns < 0 if this datetime is before the other, 0 of they are - /// equal, and > 0 if this datetime is after the other. - /// - /// This method is protected because it is merely the engine used - /// by the various operators in DTbase. - MYSQLPP_EXPORT short compare(const DateTime& other) const; - - /// \brief Parse a MySQL date and time string into this object. - MYSQLPP_EXPORT cchar* convert(cchar*); -}; - - -/// \brief Inserts a DateTime object into a C++ stream in a -/// MySQL-compatible format. + Comparable(), + year_(other.year_), + month_(other.month_), + day_(other.day_), + hour_(other.hour_), + minute_(other.minute_), + second_(other.second_), + now_(other.now_) + { + } + + /// \brief Initialize object from a C string containing a SQL + /// date-and-time string + /// + /// String must be in the HH:MM:SS format. It doesn't have to be + /// zero-padded. + explicit DateTime(const char* str) { convert(str); } + + /// \brief Initialize object from a C++ string containing a + /// SQL date-and-time string + /// + /// This works with any stringish class that declares a c_str() + /// member function: std::string, mysqlpp::String... + /// + /// \sa DateTime(const char*) + template + explicit DateTime(const Str& str) + { + convert(str.c_str()); + } + + /// \brief Initialize object from a \c time_t + explicit DateTime(time_t t); + + /// \brief Compare this object to another. + /// + /// Returns < 0 if this object is before the other, 0 of they are + /// equal, and > 0 if this object is after the other. + int compare(const DateTime& other) const; + + /// \brief Parse a SQL date and time string into this object. + const char* convert(const char*); + + /// \brief Get the date/time value's day part, 1-31 + unsigned char day() const { return day_; } + + /// \brief Change the date/time value's day part, 1-31 + void day(unsigned char d) { day_ = d; now_ = false; } + + /// \brief Get the date/time value's hour part, 0-23 + unsigned char hour() const { return hour_; } + + /// \brief Change the date/time value's hour part, 0-23 + void hour(unsigned char h) { hour_ = h; now_ = false; } + + /// \brief Returns true if object will evaluate to SQL "NOW()" on + /// conversion to string. + bool is_now() const { return now_; } + + /// \brief Get the date/time value's minute part, 0-59 + unsigned char minute() const { return minute_; } + + /// \brief Change the date/time value's minute part, 0-59 + void minute(unsigned char m) { minute_ = m; now_ = false; } + + /// \brief Get the date/time value's month part, 1-12 + unsigned char month() const { return month_; } + + /// \brief Change the date/time value's month part, 1-12 + void month(unsigned char m) { month_ = m; now_ = false; } + + /// \brief Factory to create an object instance that will convert + /// to SQL "NOW()" on insertion into a query + /// + /// This is just syntactic sugar around the default ctor + static DateTime now() { return DateTime(); } + + /// \brief Convert to std::string + operator std::string() const; + + /// \brief Convert to time_t + operator time_t() const; + + /// \brief Get the date/time value's second part, 0-59 + unsigned char second() const { return second_; } + + /// \brief Change the date/time value's second part, 0-59 + void second(unsigned char s) { second_ = s; now_ = false; } + + /// \brief Return our value in std::string form + std::string str() const { return *this; } + + /// \brief Get the date/time value's year part + /// + /// There's no trickery here like in some date/time implementations + /// where you have to add 1900 or something like that. It simply + /// returns the year in natural form, in the range 1000-9999. + unsigned short year() const { return year_; } + + /// \brief Change the date/time value's year part + /// + /// Pass the year value normally; we don't optimize the value by + /// subtracting 1900 like some other date/time implementations. + void year(unsigned short y) { year_ = y; now_ = false; } + +private: + unsigned short year_; ///< the year, as a simple integer + unsigned char month_; ///< the month, 1-12 + unsigned char day_; ///< the day, 1-31 + unsigned char hour_; ///< the hour, 0-23 (not 0-255 as in Time!) + unsigned char minute_; ///< the minute, 0-59 + unsigned char second_; ///< the second, 0-59 + + bool now_; ///< true if object not initialized with explicit value +}; + + +/// \brief Returns a DateTime object that, when inserted into query +/// will yield a SQL "NOW()" function call. +inline DateTime NOW() { return DateTime(); } + + +/// \brief Inserts a DateTime object into a C++ stream in a +/// SQL-compatible format. /// /// The date and time are inserted into the stream, in that order, /// with a space between them. /// /// \param os stream to insert date and time into @@ -201,84 +216,120 @@ /// \param dt date/time object to insert into stream MYSQLPP_EXPORT std::ostream& operator <<(std::ostream& os, const DateTime& dt); -/// \brief C++ form of MySQL's DATE type. +/// \brief C++ form of SQL's DATE type. /// /// Objects of this class can be inserted into streams, and -/// initialized from MySQL DATE strings. -struct Date : public DTbase -{ - /// \brief the year - /// - /// No surprises; the year 2005 is stored as the integer 2005. - short int year; - - /// \brief the month, 1-12 - tiny_int month; - - /// \brief the day, 1-31 - tiny_int day; - - /// \brief Default constructor - Date() : year(0), month(0), day(0) { } +/// initialized from SQL DATE strings. +class MYSQLPP_EXPORT Date : public Comparable +{ +public: + /// \brief Default constructor + Date() : year_(0), month_(0), day_(0) { } /// \brief Initialize object - Date(short int y, tiny_int m, tiny_int d) : - DTbase(), - year(y), - month(m), - day(d) + /// + /// \param y year, 1000-9999 + /// \param m month, 1-12 + /// \param d day of month, 1-31 + Date(unsigned short y, unsigned char m, unsigned char d) : + Comparable(), + year_(y), + month_(m), + day_(d) { } /// \brief Initialize object as a copy of another Date Date(const Date& other) : - DTbase(), - year(other.year), - month(other.month), - day(other.day) + Comparable(), + year_(other.year_), + month_(other.month_), + day_(other.day_) { } /// \brief Initialize object from date part of date/time object Date(const DateTime& other) : - DTbase(), - year(other.year), - month(other.month), - day(other.day) + Comparable(), + year_(other.year()), + month_(other.month()), + day_(other.day()) { } - /// \brief Initialize object from a MySQL date string + /// \brief Initialize object from a C string containing a date /// /// String must be in the YYYY-MM-DD format. It doesn't have to be /// zero-padded. - Date(cchar* str) { convert(str); } - - /// \brief Initialize object from a MySQL date string - /// - /// \sa Date(cchar*) - Date(const ColData& str) { convert(str.c_str()); } - - /// \brief Initialize object from a MySQL date string - /// - /// \sa Date(cchar*) - Date(const std::string& str) - { - convert(str.c_str()); - } + explicit Date(const char* str) { convert(str); } + + /// \brief Initialize object from a C++ string containing a date + /// + /// This works with any stringish class that declares a c_str() + /// member function: std::string, mysqlpp::String... + /// + /// \sa Date(const char*) + template + explicit Date(const Str& str) { convert(str.c_str()); } + + /// \brief Initialize object from a \c time_t + /// + /// Naturally, we throw away the "time" part of the \c time_t. If + /// you need to keep it, you want to use DateTime instead. + explicit Date(time_t t); /// \brief Compare this date to another. /// /// Returns < 0 if this date is before the other, 0 of they are /// equal, and > 0 if this date is after the other. - MYSQLPP_EXPORT short int compare(const Date& other) const; + int compare(const Date& other) const; + + /// \brief Parse a SQL date string into this object. + const char* convert(const char*); + + /// \brief Get the date's day part, 1-31 + unsigned char day() const { return day_; } + + /// \brief Change the date's day part, 1-31 + void day(unsigned char d) { day_ = d; } + + /// \brief Get the date's month part, 1-12 + unsigned char month() const { return month_; } + + /// \brief Change the date's month part, 1-12 + void month(unsigned char m) { month_ = m; } + + /// \brief Convert to std::string + operator std::string() const; + + /// \brief Convert to time_t + /// + /// The "time" part of the \c time_t is "now" + operator time_t() const; + + /// \brief Return our value in std::string form + std::string str() const { return *this; } + + /// \brief Get the date's year part + /// + /// There's no trickery here like in some date implementations + /// where you have to add 1900 or something like that. + unsigned short year() const { return year_; } + + /// \brief Change the date's year part + /// + /// Pass the year value normally; we don't optimize the value by + /// subtracting 1900 like some other date implementations. + void year(unsigned short y) { year_ = y; } - /// \brief Parse a MySQL date string into this object. - MYSQLPP_EXPORT cchar* convert(cchar*); +private: + unsigned short year_; ///< the year, as a simple integer, 1000-9999 + unsigned char month_; ///< the month, 1-12 + unsigned char day_; ///< the day, 1-31 }; /// \brief Inserts a Date object into a C++ stream /// /// The format is YYYY-MM-DD, zero-padded. @@ -287,84 +338,117 @@ /// \param d date to insert into stream MYSQLPP_EXPORT std::ostream& operator <<(std::ostream& os, const Date& d); -/// \brief C++ form of MySQL's TIME type. +/// \brief C++ form of SQL's TIME type. /// /// Objects of this class can be inserted into streams, and -/// initialized from MySQL TIME strings. -struct Time : public DTbase