pax_global_header00006660000000000000000000000064121024227330014506gustar00rootroot0000000000000052 comment=3fa8d32c315da7260fb8be2812db74c2e9e98f7b vsqlite---0.3.12/000077500000000000000000000000001210242273300134125ustar00rootroot00000000000000vsqlite---0.3.12/AUTHORS000066400000000000000000000000501210242273300144550ustar00rootroot00000000000000Vinzenz Feenstra vsqlite---0.3.12/COPYING000066400000000000000000000034511210242273300144500ustar00rootroot00000000000000/*############################################################################## VSQLite++ - virtuosic bytes SQLite3 C++ wrapper Copyright (c) 2006-2012 Vinzenz Feenstra vinzenz.feenstra@gmail.com All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. * Neither the name of virtuosic bytes nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ##############################################################################*/ vsqlite---0.3.12/ChangeLog000066400000000000000000000301461210242273300151700ustar00rootroot00000000000000commit d16d225aa06c2600be7f8a0403099e5f0b779c76 Author: Vinzenz Feenstra Date: Thu Jan 31 09:03:55 2013 +0100 * Building - Compilation warning for variant.hpp removed - Attempt to obey FHS in configure.ac started - Building now also the example (but not installing it) Signed-off-by: Vinzenz Feenstra commit ad327d8b84bc05699ba4ca4dfe704d4f8b6927c1 Author: Vinzenz Feenstra Date: Thu Jan 31 07:58:58 2013 +0100 * Version bump 0.3.12 Signed-off-by: Vinzenz Feenstra commit 6adfd45108e6f6d2a80a6abe4753bcc1568aa7d0 Author: Vinzenz Feenstra Date: Thu Jan 31 07:57:54 2013 +0100 * Improvement of the build system make install now installs the headers Signed-off-by: Vinzenz Feenstra commit b1d582de4734fd3d73819d3413892bffd0327872 Author: Vinzenz Feenstra Date: Fri Dec 21 16:15:18 2012 +0100 0.3.11 Signed-off-by: Vinzenz Feenstra commit 0d6ff8125d0f0015a6961b188ee413609f42a89f Author: Vinzenz Feenstra Date: Fri Dec 21 16:14:39 2012 +0100 Build error fix Signed-off-by: Vinzenz Feenstra commit 14673c537603318de7ef2eb8a730405c64bf64d8 Author: Vinzenz Feenstra Date: Fri Dec 21 12:45:38 2012 +0100 v0.3.10 Signed-off-by: Vinzenz Feenstra commit bce01dcbbeb530bfa33a1779bfce0c043ab1ceb6 Author: Vinzenz Feenstra Date: Fri Dec 21 12:42:19 2012 +0100 Exposing step bool result to operator() and emit() Signed-off-by: Vinzenz Feenstra commit 36c6404a5cf56f33cfafa715bcb8a83633a6deb1 Author: Vinzenz Feenstra Date: Fri Dec 21 12:38:18 2012 +0100 Adding variant support to result set mysql-workbench currently uses the library patched. This commit is bringing the features used by mysql-workbench to vsqlite++. Signed-off-by: Vinzenz Feenstra commit 62c5b54d704b9b65a25848f6c25ecad4500d8852 Author: Vinzenz Feenstra Date: Fri Dec 21 10:53:54 2012 +0100 Version 0.3.10 from now Signed-off-by: Vinzenz Feenstra commit 3bab77350ad217217eb1e667e70d511d4dfe7165 Author: Vinzenz Feenstra Date: Tue Sep 25 16:43:11 2012 +0200 Examples should be shipped too commit 0685494f222cf54c58e8b8e9ba0b52c34c5bd16c Author: Vinzenz Feenstra Date: Tue Sep 25 16:30:06 2012 +0200 LICENSE -> COPYING, Changelog -> ChangeLog commit 14fb85580d346ca67b73bfd2adc5f8f215192ad5 Author: Vinzenz Feenstra Date: Tue Sep 25 16:05:20 2012 +0200 0.3.9 prep commit bab391eac649736d302e03b1c6ce3a0ceeb555f2 Author: Vinzenz Feenstra Date: Tue Sep 25 16:03:49 2012 +0200 0.3.8 ChangeLog commit b9a22937fdd47e65cd2bbcb71c270b499f4429ed Author: Vinzenz Feenstra Date: Tue Sep 25 13:00:57 2012 +0200 tag/0.3.8 commit dab93f24523708f882c496967af3fa7d6461a878 Author: Vinzenz Feenstra Date: Tue Sep 25 12:58:39 2012 +0200 Updated distribute commit 0b2abd5b1d6ca864cf5dc138dcc3f0f1024a4a8f Author: Vinzenz Feenstra Date: Mon Sep 24 21:54:51 2012 +0200 Prepare configure.ac for 0.3.8 commit 3df606b68f2d522ca10a56752a4d68ddc17332f8 Author: Vinzenz Feenstra Date: Mon Sep 24 21:46:55 2012 +0200 0.3.7 commit 157aa94198b2a2ebbb64df9309cb4d926d4d0528 Author: Vinzenz Feenstra Date: Mon Sep 24 21:46:18 2012 +0200 License fix => BSD 3Clause not MIT commit 88e2042ec6b16ad95a0ae6ae0c856dd3b5e6abc0 Author: Vinzenz Feenstra Date: Mon Sep 24 21:17:33 2012 +0200 0.3.6 ChangeLog update commit 069f9d1ca282fa7f96bbae26d9d9abec6e389151 Author: Vinzenz Feenstra Date: Mon Sep 24 21:15:21 2012 +0200 More make file fixes commit 86b22baab0f2e26345237614dc7af5736fd59d23 Author: Vinzenz Feenstra Date: Mon Sep 24 18:58:19 2012 +0200 libsqlitemm -> libsqlitepp commit 6644d58460ec41d3ba333966122f3e6e16799cfa Author: Vinzenz Feenstra Date: Mon Sep 24 16:01:09 2012 +0200 sed -i 's/\r//' examples/sqlite_wrapper.cpp commit f62b788ec8d948c05c948ddfb090f18f9914b6e4 Author: Vinzenz Feenstra Date: Mon Sep 24 15:53:17 2012 +0200 Updated distribute commit f47e88497d7cc83ebf6848c3d9a3d12f397c3e7a Author: Vinzenz Feenstra Date: Mon Sep 24 15:40:23 2012 +0200 Changing distribute commit a542858adb9d56bb521623164b304cfb611f27de Author: Vinzenz Feenstra Date: Mon Sep 24 15:39:05 2012 +0200 Autogen commit 1c903166ec9535cc712f13d8277d35159b7f5f68 Author: Vinzenz Feenstra Date: Mon Sep 24 15:27:37 2012 +0200 Zip file mask fixed commit ec7f160b3b001b863ab46f7323de370d97474bbd Author: Vinzenz Feenstra Date: Mon Sep 24 15:26:35 2012 +0200 Moving also zip files and being more specific commit 857c14e2151f9d11b616bc1ad336a7d13b3da702 Author: Vinzenz Feenstra Date: Mon Sep 24 15:25:10 2012 +0200 Adding distribute script commit 92f8d98c303027e5248496461b59d37bfd29af26 Author: Vinzenz Feenstra Date: Mon Sep 24 15:16:57 2012 +0200 Bump version 0.3.4 commit ac7565922fe054cfee269700f41024161d36bf25 Author: Vinzenz Feenstra Date: Mon Sep 24 15:12:55 2012 +0200 Adding m4 dir commit 02d5a717a6965e38eb92f15bdb29056df26a31aa Author: Vinzenz Feenstra Date: Mon Sep 24 15:05:43 2012 +0200 Library naming correction commit 925bf001a1b1db6803a9ecf23f52452cab71ad4b Author: Vinzenz Feenstra Date: Mon Sep 24 13:48:07 2012 +0200 Automake... commit a314607b8895ce282242672e9377d3f22da82c02 Author: Vinzenz Feenstra Date: Sat Sep 22 18:01:58 2012 +0200 Line encoding commit 4c8e8b3faa6e494d78493231c390cb4ff6f2164c Author: Vinzenz Feenstra Date: Sat Sep 22 15:55:58 2012 +0200 Fixing build - linking sqlite3 against library commit e4bb2502d8df36688f8596ba0db5bb35ad5ce923 Author: Vinzenz Feenstra Date: Sat Sep 22 14:18:14 2012 +0200 Bump v0.3.2 - updated docs commit 5d1d24cf6e04992128da11cacdbad773d25a6a57 Author: Vinzenz Feenstra Date: Sat Sep 22 14:12:23 2012 +0200 Bump version because of restructuring commit dba1619d3a9919cef36533a7f4511553ee8b9825 Author: Vinzenz Feenstra Date: Fri Sep 21 17:22:37 2012 +0200 * Packaging improvements commit ea4facb73bc4764a9f30743744a7a286f9784a51 Author: Vinzenz Feenstra Date: Tue Aug 21 00:46:57 2012 +0200 Updated doxyfile commit 6921b325dd9a1342f4a81331bb399e5a395ac6b9 Author: Vinzenz Feenstra Date: Tue Aug 21 00:41:15 2012 +0200 New build script commit 28e191387b9f3850e20f1883473d79626c166845 Author: Vinzenz Feenstra Date: Tue Aug 21 00:24:07 2012 +0200 First step of restructuring commit f6767fb7bd622271aa245793785661dab576a34c Author: Vinzenz Feenstra Date: Tue Aug 21 00:18:11 2012 +0200 Removed old build system, libsqlite3 code commit 3efe6eee0d91a7a51f1a91f146a67b2f666dddc7 Author: Vinzenz Feenstra Date: Wed Aug 15 16:10:41 2012 +0200 Updated missing copyright commit 31c8d4e4248a6a26e92f3aff82aa44d6ec0116df Author: Vinzenz Feenstra Date: Wed Aug 15 16:08:55 2012 +0200 Updated author information commit 6da79f41d3d83adb7a9b1228f09fc12add527791 Author: Vinzenz Feenstra Date: Wed Aug 15 16:00:31 2012 +0200 Moving INSTALL and LICENSE too commit 0c9c4bf93c6cf1ddb0aa328d5bc86058150daa4b Author: Vinzenz Feenstra Date: Wed Aug 15 15:59:56 2012 +0200 Moved readme to basefolder commit 9a364238a2b957609e148957792c9c0fb194a952 Author: evilissimo Date: Mon Oct 16 00:12:47 2006 +0000 * Removed docs from svn git-svn-id: https://sqlitepp.svn.sourceforge.net/svnroot/sqlitepp@12 062d0e6d-a41f-0410-a212-cd34bd342b03 commit b4e8fca747fef5f6c0f208e916eb5c4dcf44ca6e Author: evilissimo Date: Mon Oct 16 00:10:49 2006 +0000 * Fixed vsqlite++.vcproj git-svn-id: https://sqlitepp.svn.sourceforge.net/svnroot/sqlitepp@11 062d0e6d-a41f-0410-a212-cd34bd342b03 commit 47cfc0a55afc946dcd5a5a655fe0b2c76aacb781 Author: evilissimo Date: Sun Oct 15 23:40:13 2006 +0000 * Added documentation git-svn-id: https://sqlitepp.svn.sourceforge.net/svnroot/sqlitepp@10 062d0e6d-a41f-0410-a212-cd34bd342b03 commit 0250a07e934dad8d273b4985787e50e7109fac0a Author: evilissimo Date: Sun Oct 15 23:09:04 2006 +0000 * Improved cleanup.sh git-svn-id: https://sqlitepp.svn.sourceforge.net/svnroot/sqlitepp@9 062d0e6d-a41f-0410-a212-cd34bd342b03 commit 53ad3d1164cc16d51945655f9e1eafba52ceab86 Author: evilissimo Date: Sun Oct 15 23:01:30 2006 +0000 * Added build.sh * Added cleanup.sh * Added buildconf files * Fixed options.py git-svn-id: https://sqlitepp.svn.sourceforge.net/svnroot/sqlitepp@8 062d0e6d-a41f-0410-a212-cd34bd342b03 commit 7b09a5dc414884e311181fb891346bc1062464e0 Author: evilissimo Date: Sun Oct 15 22:49:05 2006 +0000 * Added some comments to options.py * Edited Changelog * Wrote a bit in README * Wrote a bit in INSTALL * Changed SConstruct git-svn-id: https://sqlitepp.svn.sourceforge.net/svnroot/sqlitepp@7 062d0e6d-a41f-0410-a212-cd34bd342b03 commit 4c04517150f7e65916e64554b1e1ba06b5b15524 Author: evilissimo Date: Sun Oct 15 22:19:26 2006 +0000 * Added options.py * Added SConscript * Added SConstruct * Started modifying MSVC++ Projectfiles git-svn-id: https://sqlitepp.svn.sourceforge.net/svnroot/sqlitepp@6 062d0e6d-a41f-0410-a212-cd34bd342b03 commit 8eb683590444191ad13f824bb8db43a981452294 Author: evilissimo Date: Sun Oct 15 21:54:22 2006 +0000 * Renamed lib dir to libs git-svn-id: https://sqlitepp.svn.sourceforge.net/svnroot/sqlitepp@5 062d0e6d-a41f-0410-a212-cd34bd342b03 commit f55d379bcdcec37dba94898de0835445448161ca Author: evilissimo Date: Sun Oct 15 21:53:49 2006 +0000 * Added lib dir git-svn-id: https://sqlitepp.svn.sourceforge.net/svnroot/sqlitepp@4 062d0e6d-a41f-0410-a212-cd34bd342b03 commit afdcee16c09077327c61e91673e439e284ead35a Author: evilissimo Date: Sun Oct 15 21:53:06 2006 +0000 removed binary git-svn-id: https://sqlitepp.svn.sourceforge.net/svnroot/sqlitepp@3 062d0e6d-a41f-0410-a212-cd34bd342b03 commit 6b1f8eaeb0fdecdcbc053934d40ff298b95c0273 Author: evilissimo Date: Sun Oct 15 21:48:52 2006 +0000 * Added scons * Renamed sqlite_wrapper directory git-svn-id: https://sqlitepp.svn.sourceforge.net/svnroot/sqlitepp@2 062d0e6d-a41f-0410-a212-cd34bd342b03 commit 30b102050f8053cc49f8db61a9cd89f25ef58e9e Author: evilissimo Date: Thu Oct 12 22:58:30 2006 +0000 Initial import git-svn-id: https://sqlitepp.svn.sourceforge.net/svnroot/sqlitepp@1 062d0e6d-a41f-0410-a212-cd34bd342b03 vsqlite---0.3.12/Doxyfile000066400000000000000000000211111210242273300151140ustar00rootroot00000000000000# Doxyfile 1.4.6 #--------------------------------------------------------------------------- # Project related configuration options #--------------------------------------------------------------------------- PROJECT_NAME = "VSQLite++" PROJECT_NUMBER = 0.3 OUTPUT_DIRECTORY = ./ CREATE_SUBDIRS = NO OUTPUT_LANGUAGE = English USE_WINDOWS_ENCODING = NO BRIEF_MEMBER_DESC = YES REPEAT_BRIEF = YES ABBREVIATE_BRIEF = "The $name class" \ "The $name widget" \ "The $name file" \ is \ provides \ specifies \ contains \ represents \ a \ an \ the ALWAYS_DETAILED_SEC = NO INLINE_INHERITED_MEMB = NO FULL_PATH_NAMES = YES STRIP_FROM_PATH = ./ STRIP_FROM_INC_PATH = SHORT_NAMES = NO JAVADOC_AUTOBRIEF = NO MULTILINE_CPP_IS_BRIEF = NO DETAILS_AT_TOP = NO INHERIT_DOCS = YES SEPARATE_MEMBER_PAGES = NO TAB_SIZE = 8 ALIASES = OPTIMIZE_OUTPUT_FOR_C = NO OPTIMIZE_OUTPUT_JAVA = NO BUILTIN_STL_SUPPORT = NO DISTRIBUTE_GROUP_DOC = NO SUBGROUPING = YES #--------------------------------------------------------------------------- # Build related configuration options #--------------------------------------------------------------------------- EXTRACT_ALL = YES EXTRACT_PRIVATE = YES EXTRACT_STATIC = YES EXTRACT_LOCAL_CLASSES = YES EXTRACT_LOCAL_METHODS = NO HIDE_UNDOC_MEMBERS = NO HIDE_UNDOC_CLASSES = NO HIDE_FRIEND_COMPOUNDS = NO HIDE_IN_BODY_DOCS = NO INTERNAL_DOCS = NO CASE_SENSE_NAMES = NO HIDE_SCOPE_NAMES = NO SHOW_INCLUDE_FILES = YES INLINE_INFO = YES SORT_MEMBER_DOCS = YES SORT_BRIEF_DOCS = NO SORT_BY_SCOPE_NAME = NO GENERATE_TODOLIST = YES GENERATE_TESTLIST = YES GENERATE_BUGLIST = YES GENERATE_DEPRECATEDLIST= YES ENABLED_SECTIONS = MAX_INITIALIZER_LINES = 30 SHOW_USED_FILES = YES SHOW_DIRECTORIES = NO FILE_VERSION_FILTER = #--------------------------------------------------------------------------- # configuration options related to warning and progress messages #--------------------------------------------------------------------------- QUIET = NO WARNINGS = YES WARN_IF_UNDOCUMENTED = YES WARN_IF_DOC_ERROR = YES WARN_NO_PARAMDOC = NO WARN_FORMAT = "$file:$line: $text" WARN_LOGFILE = #--------------------------------------------------------------------------- # configuration options related to the input files #--------------------------------------------------------------------------- INPUT = ./include FILE_PATTERNS = *.hpp RECURSIVE = YES EXCLUDE = EXCLUDE_SYMLINKS = NO EXCLUDE_PATTERNS = EXAMPLE_PATH = EXAMPLE_PATTERNS = * EXAMPLE_RECURSIVE = NO IMAGE_PATH = INPUT_FILTER = FILTER_PATTERNS = FILTER_SOURCE_FILES = NO #--------------------------------------------------------------------------- # configuration options related to source browsing #--------------------------------------------------------------------------- SOURCE_BROWSER = YES INLINE_SOURCES = NO STRIP_CODE_COMMENTS = YES REFERENCED_BY_RELATION = YES REFERENCES_RELATION = YES USE_HTAGS = NO VERBATIM_HEADERS = YES #--------------------------------------------------------------------------- # configuration options related to the alphabetical class index #--------------------------------------------------------------------------- ALPHABETICAL_INDEX = YES COLS_IN_ALPHA_INDEX = 5 IGNORE_PREFIX = #--------------------------------------------------------------------------- # configuration options related to the HTML output #--------------------------------------------------------------------------- GENERATE_HTML = YES HTML_OUTPUT = html HTML_FILE_EXTENSION = .html HTML_HEADER = HTML_FOOTER = HTML_STYLESHEET = HTML_ALIGN_MEMBERS = YES GENERATE_HTMLHELP = NO CHM_FILE = HHC_LOCATION = GENERATE_CHI = NO BINARY_TOC = NO TOC_EXPAND = NO DISABLE_INDEX = NO ENUM_VALUES_PER_LINE = 4 GENERATE_TREEVIEW = NO TREEVIEW_WIDTH = 250 #--------------------------------------------------------------------------- # configuration options related to the LaTeX output #--------------------------------------------------------------------------- GENERATE_LATEX = NO LATEX_OUTPUT = latex LATEX_CMD_NAME = latex MAKEINDEX_CMD_NAME = makeindex COMPACT_LATEX = NO PAPER_TYPE = a4wide EXTRA_PACKAGES = LATEX_HEADER = PDF_HYPERLINKS = NO USE_PDFLATEX = YES LATEX_BATCHMODE = NO LATEX_HIDE_INDICES = NO #--------------------------------------------------------------------------- # configuration options related to the RTF output #--------------------------------------------------------------------------- GENERATE_RTF = NO RTF_OUTPUT = rtf COMPACT_RTF = NO RTF_HYPERLINKS = NO RTF_STYLESHEET_FILE = RTF_EXTENSIONS_FILE = #--------------------------------------------------------------------------- # configuration options related to the man page output #--------------------------------------------------------------------------- GENERATE_MAN = NO MAN_OUTPUT = man MAN_EXTENSION = .3 MAN_LINKS = NO #--------------------------------------------------------------------------- # configuration options related to the XML output #--------------------------------------------------------------------------- GENERATE_XML = NO XML_OUTPUT = xml XML_SCHEMA = XML_DTD = XML_PROGRAMLISTING = YES #--------------------------------------------------------------------------- # configuration options for the AutoGen Definitions output #--------------------------------------------------------------------------- GENERATE_AUTOGEN_DEF = NO #--------------------------------------------------------------------------- # configuration options related to the Perl module output #--------------------------------------------------------------------------- GENERATE_PERLMOD = NO PERLMOD_LATEX = NO PERLMOD_PRETTY = YES PERLMOD_MAKEVAR_PREFIX = #--------------------------------------------------------------------------- # Configuration options related to the preprocessor #--------------------------------------------------------------------------- ENABLE_PREPROCESSING = YES MACRO_EXPANSION = NO EXPAND_ONLY_PREDEF = NO SEARCH_INCLUDES = YES INCLUDE_PATH = INCLUDE_FILE_PATTERNS = PREDEFINED = DOXYGEN_SHOULD_SKIP_THIS EXPAND_AS_DEFINED = SKIP_FUNCTION_MACROS = YES #--------------------------------------------------------------------------- # Configuration::additions related to external references #--------------------------------------------------------------------------- TAGFILES = GENERATE_TAGFILE = ALLEXTERNALS = NO EXTERNAL_GROUPS = YES PERL_PATH = /usr/bin/perl #--------------------------------------------------------------------------- # Configuration options related to the dot tool #--------------------------------------------------------------------------- CLASS_DIAGRAMS = YES HIDE_UNDOC_RELATIONS = YES HAVE_DOT = YES CLASS_GRAPH = YES COLLABORATION_GRAPH = YES GROUP_GRAPHS = YES UML_LOOK = YES TEMPLATE_RELATIONS = YES INCLUDE_GRAPH = YES INCLUDED_BY_GRAPH = YES CALL_GRAPH = YES GRAPHICAL_HIERARCHY = YES DIRECTORY_GRAPH = YES DOT_IMAGE_FORMAT = png DOT_PATH = DOTFILE_DIRS = MAX_DOT_GRAPH_WIDTH = 1024 MAX_DOT_GRAPH_HEIGHT = 1024 MAX_DOT_GRAPH_DEPTH = 1000 DOT_TRANSPARENT = YES DOT_MULTI_TARGETS = YES GENERATE_LEGEND = YES DOT_CLEANUP = YES #--------------------------------------------------------------------------- # Configuration::additions related to the search engine #--------------------------------------------------------------------------- SEARCHENGINE = YES vsqlite---0.3.12/INSTALL000066400000000000000000000366051210242273300144550ustar00rootroot00000000000000Installation Instructions ************************* Copyright (C) 1994-1996, 1999-2002, 2004-2012 Free Software Foundation, Inc. Copying and distribution of this file, with or without modification, are permitted in any medium without royalty provided the copyright notice and this notice are preserved. This file is offered as-is, without warranty of any kind. Basic Installation ================== Briefly, the shell commands `./configure; make; make install' should configure, build, and install this package. The following more-detailed instructions are generic; see the `README' file for instructions specific to this package. Some packages provide this `INSTALL' file but do not implement all of the features documented below. The lack of an optional feature in a given package is not necessarily a bug. More recommendations for GNU packages can be found in *note Makefile Conventions: (standards)Makefile Conventions. The `configure' shell script attempts to guess correct values for various system-dependent variables used during compilation. It uses those values to create a `Makefile' in each directory of the package. It may also create one or more `.h' files containing system-dependent definitions. Finally, it creates a shell script `config.status' that you can run in the future to recreate the current configuration, and a file `config.log' containing compiler output (useful mainly for debugging `configure'). It can also use an optional file (typically called `config.cache' and enabled with `--cache-file=config.cache' or simply `-C') that saves the results of its tests to speed up reconfiguring. Caching is disabled by default to prevent problems with accidental use of stale cache files. If you need to do unusual things to compile the package, please try to figure out how `configure' could check whether to do them, and mail diffs or instructions to the address given in the `README' so they can be considered for the next release. If you are using the cache, and at some point `config.cache' contains results you don't want to keep, you may remove or edit it. The file `configure.ac' (or `configure.in') is used to create `configure' by a program called `autoconf'. You need `configure.ac' if you want to change it or regenerate `configure' using a newer version of `autoconf'. The simplest way to compile this package is: 1. `cd' to the directory containing the package's source code and type `./configure' to configure the package for your system. Running `configure' might take a while. While running, it prints some messages telling which features it is checking for. 2. Type `make' to compile the package. 3. Optionally, type `make check' to run any self-tests that come with the package, generally using the just-built uninstalled binaries. 4. Type `make install' to install the programs and any data files and documentation. When installing into a prefix owned by root, it is recommended that the package be configured and built as a regular user, and only the `make install' phase executed with root privileges. 5. Optionally, type `make installcheck' to repeat any self-tests, but this time using the binaries in their final installed location. This target does not install anything. Running this target as a regular user, particularly if the prior `make install' required root privileges, verifies that the installation completed correctly. 6. You can remove the program binaries and object files from the source code directory by typing `make clean'. To also remove the files that `configure' created (so you can compile the package for a different kind of computer), type `make distclean'. There is also a `make maintainer-clean' target, but that is intended mainly for the package's developers. If you use it, you may have to get all sorts of other programs in order to regenerate files that came with the distribution. 7. Often, you can also type `make uninstall' to remove the installed files again. In practice, not all packages have tested that uninstallation works correctly, even though it is required by the GNU Coding Standards. 8. Some packages, particularly those that use Automake, provide `make distcheck', which can by used by developers to test that all other targets like `make install' and `make uninstall' work correctly. This target is generally not run by end users. Compilers and Options ===================== Some systems require unusual options for compilation or linking that the `configure' script does not know about. Run `./configure --help' for details on some of the pertinent environment variables. You can give `configure' initial values for configuration parameters by setting variables in the command line or in the environment. Here is an example: ./configure CC=c99 CFLAGS=-g LIBS=-lposix *Note Defining Variables::, for more details. Compiling For Multiple Architectures ==================================== You can compile the package for more than one kind of computer at the same time, by placing the object files for each architecture in their own directory. To do this, you can use GNU `make'. `cd' to the directory where you want the object files and executables to go and run the `configure' script. `configure' automatically checks for the source code in the directory that `configure' is in and in `..'. This is known as a "VPATH" build. With a non-GNU `make', it is safer to compile the package for one architecture at a time in the source code directory. After you have installed the package for one architecture, use `make distclean' before reconfiguring for another architecture. On MacOS X 10.5 and later systems, you can create libraries and executables that work on multiple system types--known as "fat" or "universal" binaries--by specifying multiple `-arch' options to the compiler but only a single `-arch' option to the preprocessor. Like this: ./configure CC="gcc -arch i386 -arch x86_64 -arch ppc -arch ppc64" \ CXX="g++ -arch i386 -arch x86_64 -arch ppc -arch ppc64" \ CPP="gcc -E" CXXCPP="g++ -E" This is not guaranteed to produce working output in all cases, you may have to build one architecture at a time and combine the results using the `lipo' tool if you have problems. Installation Names ================== By default, `make install' installs the package's commands under `/usr/local/bin', include files under `/usr/local/include', etc. You can specify an installation prefix other than `/usr/local' by giving `configure' the option `--prefix=PREFIX', where PREFIX must be an absolute file name. You can specify separate installation prefixes for architecture-specific files and architecture-independent files. If you pass the option `--exec-prefix=PREFIX' to `configure', the package uses PREFIX as the prefix for installing programs and libraries. Documentation and other data files still use the regular prefix. In addition, if you use an unusual directory layout you can give options like `--bindir=DIR' to specify different values for particular kinds of files. Run `configure --help' for a list of the directories you can set and what kinds of files go in them. In general, the default for these options is expressed in terms of `${prefix}', so that specifying just `--prefix' will affect all of the other directory specifications that were not explicitly provided. The most portable way to affect installation locations is to pass the correct locations to `configure'; however, many packages provide one or both of the following shortcuts of passing variable assignments to the `make install' command line to change installation locations without having to reconfigure or recompile. The first method involves providing an override variable for each affected directory. For example, `make install prefix=/alternate/directory' will choose an alternate location for all directory configuration variables that were expressed in terms of `${prefix}'. Any directories that were specified during `configure', but not in terms of `${prefix}', must each be overridden at install time for the entire installation to be relocated. The approach of makefile variable overrides for each directory variable is required by the GNU Coding Standards, and ideally causes no recompilation. However, some platforms have known limitations with the semantics of shared libraries that end up requiring recompilation when using this method, particularly noticeable in packages that use GNU Libtool. The second method involves providing the `DESTDIR' variable. For example, `make install DESTDIR=/alternate/directory' will prepend `/alternate/directory' before all installation names. The approach of `DESTDIR' overrides is not required by the GNU Coding Standards, and does not work on platforms that have drive letters. On the other hand, it does better at avoiding recompilation issues, and works well even when some directory options were not specified in terms of `${prefix}' at `configure' time. Optional Features ================= If the package supports it, you can cause programs to be installed with an extra prefix or suffix on their names by giving `configure' the option `--program-prefix=PREFIX' or `--program-suffix=SUFFIX'. Some packages pay attention to `--enable-FEATURE' options to `configure', where FEATURE indicates an optional part of the package. They may also pay attention to `--with-PACKAGE' options, where PACKAGE is something like `gnu-as' or `x' (for the X Window System). The `README' should mention any `--enable-' and `--with-' options that the package recognizes. For packages that use the X Window System, `configure' can usually find the X include and library files automatically, but if it doesn't, you can use the `configure' options `--x-includes=DIR' and `--x-libraries=DIR' to specify their locations. Some packages offer the ability to configure how verbose the execution of `make' will be. For these packages, running `./configure --enable-silent-rules' sets the default to minimal output, which can be overridden with `make V=1'; while running `./configure --disable-silent-rules' sets the default to verbose, which can be overridden with `make V=0'. Particular systems ================== On HP-UX, the default C compiler is not ANSI C compatible. If GNU CC is not installed, it is recommended to use the following options in order to use an ANSI C compiler: ./configure CC="cc -Ae -D_XOPEN_SOURCE=500" and if that doesn't work, install pre-built binaries of GCC for HP-UX. HP-UX `make' updates targets which have the same time stamps as their prerequisites, which makes it generally unusable when shipped generated files such as `configure' are involved. Use GNU `make' instead. On OSF/1 a.k.a. Tru64, some versions of the default C compiler cannot parse its `' header file. The option `-nodtk' can be used as a workaround. If GNU CC is not installed, it is therefore recommended to try ./configure CC="cc" and if that doesn't work, try ./configure CC="cc -nodtk" On Solaris, don't put `/usr/ucb' early in your `PATH'. This directory contains several dysfunctional programs; working variants of these programs are available in `/usr/bin'. So, if you need `/usr/ucb' in your `PATH', put it _after_ `/usr/bin'. On Haiku, software installed for all users goes in `/boot/common', not `/usr/local'. It is recommended to use the following options: ./configure --prefix=/boot/common Specifying the System Type ========================== There may be some features `configure' cannot figure out automatically, but needs to determine by the type of machine the package will run on. Usually, assuming the package is built to be run on the _same_ architectures, `configure' can figure that out, but if it prints a message saying it cannot guess the machine type, give it the `--build=TYPE' option. TYPE can either be a short name for the system type, such as `sun4', or a canonical name which has the form: CPU-COMPANY-SYSTEM where SYSTEM can have one of these forms: OS KERNEL-OS See the file `config.sub' for the possible values of each field. If `config.sub' isn't included in this package, then this package doesn't need to know the machine type. If you are _building_ compiler tools for cross-compiling, you should use the option `--target=TYPE' to select the type of system they will produce code for. If you want to _use_ a cross compiler, that generates code for a platform different from the build platform, you should specify the "host" platform (i.e., that on which the generated programs will eventually be run) with `--host=TYPE'. Sharing Defaults ================ If you want to set default values for `configure' scripts to share, you can create a site shell script called `config.site' that gives default values for variables like `CC', `cache_file', and `prefix'. `configure' looks for `PREFIX/share/config.site' if it exists, then `PREFIX/etc/config.site' if it exists. Or, you can set the `CONFIG_SITE' environment variable to the location of the site script. A warning: not all `configure' scripts look for a site script. Defining Variables ================== Variables not defined in a site shell script can be set in the environment passed to `configure'. However, some packages may run configure again during the build, and the customized values of these variables may be lost. In order to avoid this problem, you should set them in the `configure' command line, using `VAR=value'. For example: ./configure CC=/usr/local2/bin/gcc causes the specified `gcc' to be used as the C compiler (unless it is overridden in the site shell script). Unfortunately, this technique does not work for `CONFIG_SHELL' due to an Autoconf limitation. Until the limitation is lifted, you can use this workaround: CONFIG_SHELL=/bin/bash ./configure CONFIG_SHELL=/bin/bash `configure' Invocation ====================== `configure' recognizes the following options to control how it operates. `--help' `-h' Print a summary of all of the options to `configure', and exit. `--help=short' `--help=recursive' Print a summary of the options unique to this package's `configure', and exit. The `short' variant lists options used only in the top level, while the `recursive' variant lists options also present in any nested packages. `--version' `-V' Print the version of Autoconf used to generate the `configure' script, and exit. `--cache-file=FILE' Enable the cache: use and save the results of the tests in FILE, traditionally `config.cache'. FILE defaults to `/dev/null' to disable caching. `--config-cache' `-C' Alias for `--cache-file=config.cache'. `--quiet' `--silent' `-q' Do not print messages saying which checks are being made. To suppress all normal output, redirect it to `/dev/null' (any error messages will still be shown). `--srcdir=DIR' Look for the package's source code in directory DIR. Usually `configure' can determine that directory automatically. `--prefix=DIR' Use DIR as the installation prefix. *note Installation Names:: for more details, including other options available for fine-tuning the installation locations. `--no-create' `-n' Run the configure checks, but stop before creating any output files. `configure' also accepts some other, not widely useful, options. Run `configure --help' for more details. vsqlite---0.3.12/Makefile.am000066400000000000000000000015031210242273300154450ustar00rootroot00000000000000LIBVSQLITE_VERSION=`cat VERSION` AUTOMAKE_OPTIONS = subdir-objects foreign ACLOCAL_AMFLAGS = ${ACLOCAL_FLAGS} -I m4 AM_CXXFLAGS = -W -Wall -pedantic -O3 -W -std=c++03 lib_LTLIBRARIES = libvsqlitepp.la libvsqlitepp_la_CXXFLAGS = -I include $(AM_CXXFLAGS) libvsqlitepp_la_LDFLAGS = -lsqlite3 -Wl,--as-needed -Wl,-soname -Wl,libvsqlitepp.so.3 -version-info 3:0:0 libvsqlitepp_la_SOURCES = \ src/sqlite/command.cpp \ src/sqlite/connection.cpp \ src/sqlite/execute.cpp \ src/sqlite/query.cpp \ src/sqlite/result.cpp \ src/sqlite/transaction.cpp \ src/sqlite/view.cpp \ $(NULL) noinst_PROGRAMS=vsqlitepp_example vsqlitepp_example_CXXFLAGS=-I include $(AM_CXXFLAGS) vsqlitepp_example_LDADD = libvsqlitepp.la vsqlitepp_example_SOURCES = \ examples/sqlite_wrapper.cpp \ $(NULL) SUBDIRS=include EXTRA_DIST=Doxyfile build examples vsqlite---0.3.12/NEWS000066400000000000000000000000001210242273300140770ustar00rootroot00000000000000vsqlite---0.3.12/README000066400000000000000000000013151210242273300142720ustar00rootroot00000000000000VSQLite++ - A welldesigned and portable SQLite3 Wrapper for C++ (C) 2006-2012 by virtuosic bytes - vinzenz.feenstra@gmail.com Author: Vinzenz Feenstra For license details please see LICENSE # Supported Compilers - GCC and G++ 4.x (maybe 3.4.x too, but it wasn't tested until now) - Visual C++ 8/2005 (Visual C++ 7.1/2003 wasn't tested, maybe will be added later) # Tested Operating Systems - Ubuntu Dapper Drake 32-Bit - Fedora 17 - Windows XP SP2 # Dependencies - Boost Libraries [ http://www.boost.org ] (Tested with 1.33.1 but should work with 1.33.0 too) Additional notices: - Please let me know if you want to suggest features - Contributions are welcome - Proposals for Design Improvement are welcome vsqlite---0.3.12/TODO000066400000000000000000000000351210242273300141000ustar00rootroot00000000000000* Writing build instructions vsqlite---0.3.12/VERSION000066400000000000000000000000071210242273300144570ustar00rootroot000000000000000.3.12 vsqlite---0.3.12/autogen.sh000077500000000000000000000001401210242273300154060ustar00rootroot00000000000000#!/bin/sh echo "Generating autobuild environment..." autoreconf --install --force > /dev/null vsqlite---0.3.12/build/000077500000000000000000000000001210242273300145115ustar00rootroot00000000000000vsqlite---0.3.12/build/packaging.sh000077500000000000000000000012021210242273300167670ustar00rootroot00000000000000#!/bin/sh VSQLITE_CURRENT=0 VSQLITE_REVISION=3 VSQLITE_AGE=0 VSQLITE_LIBRARY=libvsqlite++.so VSQLITE_CURRENT_LIBRARY=$VSQLITE_LIBRARY.$VSQLITE_CURRENT VSQLITE_FULL_LIBRARY=$VSQLITE_CURRENT_LIBRARY.$VSQLITE_REVISION.$VSQLITE_AGE SOURCE="${BASH_SOURCE[0]}" DIR="$( dirname "$SOURCE" )" while [ -h "$SOURCE" ] do SOURCE="$(readlink "$SOURCE")" [[ $SOURCE != /* ]] && SOURCE="$DIR/$SOURCE" DIR="$( cd -P "$( dirname "$SOURCE" )" && pwd )" done DIR="$( cd -P "$( dirname "$SOURCE" )" && pwd )" mv $VSQLITE_LIBRARY $VSQLITE_FULL_LIBRARY ln -s $VSQLITE_FULL_LIBRARY $VSQLITE_CURRENT_LIBRARY ln -s $VSQLITE_FULL_LIBRARY $VSQLITE_LIBRARY vsqlite---0.3.12/build/premake4.lua000066400000000000000000000027121210242273300167260ustar00rootroot00000000000000 --- Solution solution "vsqlite++" configurations { "Debug", "Release" } --- The library evipp definition project "vsqlite++-static" kind "StaticLib" language "C++" targetname "vsqlite++" files { "../include/**.hpp", "../src/sqlite/**.cpp" } includedirs { "../include" } configuration "Debug" defines { "DEBUG" } flags { "Symbols" } configuration "Release" defines { "NDEBUG" } flags { "Optimize" } project "vsqlite++-shared" kind "SharedLib" language "C++" targetname "vsqlite++" files { "../include/**.hpp", "../src/sqlite/**.cpp" } includedirs { "../include" } links { "sqlite3" } configuration "Debug" defines { "DEBUG" } flags { "Symbols" } configuration "Release" defines { "NDEBUG" } flags { "Optimize" } configuration {"linux", "gmake"} linkoptions { "-Wl,--as-needed", "-Wl,-soname,libvsqlite++.so.0" } --- The unit test definition project "vsqlite_example" kind "ConsoleApp" language "C++" files { "../examples/**.cpp" } includedirs { "../include" } links { "vsqlite++-shared" } --- Configuration settings configuration "Debug" defines { "DEBUG" } flags { "Symbols" } configuration "Release" defines { "NDEBUG" } flags { "Optimize" } vsqlite---0.3.12/configure.ac000066400000000000000000000027351210242273300157070ustar00rootroot00000000000000AC_INIT([libvsqlite++],[0.3.12], [evilissimo@gmail.com], [vsqlite++], [http://github.com/vinzenz/vsqlite--]) AM_INIT_AUTOMAKE AC_CONFIG_MACRO_DIR([m4]) AC_PROG_CXX LT_INIT dnl ------------------------------------------- dnl test "$prefix" = "NONE" && prefix=/usr/local dnl test "$exec_prefix" = "NONE" && exec_prefix=/usr/local dnl test "$sharedstatedir" = '${prefix}/com' && sharedstatedir=/var dnl test "$localstatedir" = '${prefix}/var' && localstatedir=/var dnl dnl if test "$prefix" = /usr; then dnl if test "${sysconfdir}" = "\${prefix}/etc"; then dnl sysconfdir=/etc dnl fi dnl if test "$sharedstatedir" = '\${prefix}/com'; then dnl sharedstatedir=/var dnl fi dnl if test "$localstatedir" = '\${prefix}/var'; then dnl localstatedir=/var dnl fi dnl fi dnl dnl if test "$libdir" = "\${exec_prefix}/lib"; then dnl if test -e ${exec_prefix}/lib64; then dnl libdir='${exec_prefix}/lib64' dnl fi dnl fi dnl ------------------------------------------- AC_CONFIG_FILES([Makefile include/Makefile]) AC_OUTPUT dnl ------------------------------------------- dnl echo "prefix..........."${prefix} dnl echo "exec_prefix......"${exec_prefix} dnl echo "bindir..........."${bindir} dnl echo "libdir..........."${libdir} dnl echo "sharedstatedir..."${sharedstatedir} dnl echo "localstatedir...."${localstatedir} dnl echo "sysconfdir......."${sysconfdir} dnl echo "oldsysconfdir...."${old_sys_conf_dir} dnl ------------------------------------------- vsqlite---0.3.12/examples/000077500000000000000000000000001210242273300152305ustar00rootroot00000000000000vsqlite---0.3.12/examples/sqlite_wrapper.cpp000066400000000000000000000053651210242273300210060ustar00rootroot00000000000000/*############################################################################## VSQLite++ - virtuosic bytes SQLite3 C++ wrapper Copyright (c) 2006-2012 Vinzenz Feenstra vinzenz.feenstra@gmail.com All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. * Neither the name of virtuosic bytes nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ##############################################################################*/ #include #include #include #include int main() { try { sqlite::connection con("test.db"); sqlite::execute(con,"Create Table test(id INTEGER PRIMARY KEY, name TEXT);",true); sqlite::execute ins(con,"INSERT INTO TEST VALUES(?,?);"); ins % sqlite::nil % "Hallo"; ins(); ins.clear(); ins % sqlite::nil % "Test"; ins.emit(); sqlite::query q(con,"SELECT * from test;"); boost::shared_ptr res = q.emit_result(); do{ std::cout << res->get_int(0) << "|" << res->get_string(1) << std::endl; } while(res->next_row()); sqlite::execute(con,"DROP TABLE test;",true); sqlite::execute(con,"VACUUM;",true); } catch (std::exception const & e) { std::cout << "EXCEPTION: " << e.what() << std::endl; } return 0; } vsqlite---0.3.12/include/000077500000000000000000000000001210242273300150355ustar00rootroot00000000000000vsqlite---0.3.12/include/Makefile.am000066400000000000000000000006131210242273300170710ustar00rootroot00000000000000nobase_include_HEADERS = \ sqlite/command.hpp \ sqlite/database_exception.hpp \ sqlite/query.hpp \ sqlite/transaction.hpp \ sqlite/connection.hpp \ sqlite/execute.hpp \ sqlite/result.hpp \ sqlite/view.hpp \ sqlite/ext/variant.hpp \ $(NULL) noinst_HEADERS=\ sqlite/private/private_accessor.hpp \ sqlite/private/result_construct_params_private.hpp \ $(NULL) vsqlite---0.3.12/include/sqlite/000077500000000000000000000000001210242273300163365ustar00rootroot00000000000000vsqlite---0.3.12/include/sqlite/command.hpp000066400000000000000000000176001210242273300204710ustar00rootroot00000000000000/*############################################################################## VSQLite++ - virtuosic bytes SQLite3 C++ wrapper Copyright (c) 2006-2012 Vinzenz Feenstra vinzenz.feenstra@gmail.com All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. * Neither the name of virtuosic bytes nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ##############################################################################*/ #ifndef GUARD_SQLITE_COMMAND_HPP_INCLUDED #define GUARD_SQLITE_COMMAND_HPP_INCLUDED #include #include #include #include struct sqlite3_stmt; namespace sqlite{ /** \brief \a null_type is an empty type used to represent NULL * values */ struct null_type{}; /** \brief \a nil is used instead of NULL within the operator % * syntax in this wrapper */ extern null_type nil; /** \brief \a command is the base class of all sql command classes * An object of this class is not copyable */ struct command : boost::noncopyable{ /** \brief \a command constructor * \param con takes a reference to the database connection type * \a connection * \param sql is the SQL string. The sql string can contain placeholder * the question mark '?' is used as placeholder the * \a command::bind methods or command::operator% syntax must be * used to replace the placeholders */ command(connection & con, std::string const & sql); /** \brief \a command destructor */ virtual ~command(); /** \brief clear is used if you'd like to reuse a command object */ void clear(); /** \brief emit executes the sql command * If you have used placeholders you must have replaced all * placeholders */ bool emit(); /** \brief works exactly like the method \a command::emit * */ bool operator()(); /** \brief binds NULL to the given 1 based index * */ void bind(int idx); /** \brief binds the 32-Bit integer v to the given 1 based index * \param idx 1 based index of the placeholder within the sql statement * \param v 32-Bit integer value which should replace the placeholder */ void bind(int idx, int v); /** \brief binds the 64-Bit integer v to the given 1 based index * \param idx 1 based index of the placeholder within the sql statement * \param v 64-Bit integer value which should replace the placeholder */ void bind(int idx, boost::int64_t v); /** \brief binds the double v to the given 1 based index * \param idx 1 based index of the placeholder within the sql statement * \param v double value which should replace the placeholder */ void bind(int idx, double v); /** \brief binds the text/string v to the given 1 based index * \param idx 1 based index of the placeholder within the sql statement * \param v text/string value which should replace the placeholder */ void bind(int idx, std::string const & v); /** \brief binds the binary/blob buf to the given 1 based index * \param idx 1 based index of the placeholder within the sql statement * \param buf binary/blob buf which should replace the placeholder * \param buf_size size in bytes of the binary buffer */ void bind(int idx, void const * buf, size_t buf_size); /** \brief binds the binary/blob v to the given 1 based index * \param idx 1 based index of the placeholder within the sql statement * \param v binary/blob buffer which should replace the placeholder * v is a std::vector const & */ void bind(int idx, std::vector const & v); /** \brief replacement for void command::bind(int idx); * To use this operator% you have to use the global object * \a nil * Indexes are given automatically first call uses 1 as index, second 2 * and so on * \param p should be \a nil */ command & operator % (null_type const & p); /** \brief replacement for void command::bind(int idx,int); * Indexes are given automatically first call uses 1 as index, second 2 * and so on * \param p should be a 32-Bit integer */ command & operator % (int p); /** \brief replacement for void command::bind(int idx,boost::int64_t); * Indexes are given automatically first call uses 1 as index, second 2 * and so on * \param p should be a 64-Bit integer */ command & operator % (boost::int64_t p); /** \brief replacement for void command::bind(int idx,double); * Indexes are given automatically first call uses 1 as index, second 2 * and so on * \param p a double variable */ command & operator % (double p); /** \brief replacement for void command::bind(int idx,std::string const&); * Indexes are given automatically first call uses 1 as index, second 2 * and so on * \param p should be a Zero Terminated C-style string (char * or * char const*), or a std::string object, */ command & operator % (std::string const & p); /** \brief replacement for void command::bind(int idx,std::vector const&); * Indexes are given automatically first call uses 1 as index, second 2 * and so on * \param p a constant reference to a std::vector object * (For blob/binary data) */ command & operator % (std::vector const & p); protected: void access_check(); bool step(); struct sqlite3 * get_handle(); private: void prepare(); void finalize(); private: connection & m_con; std::string m_sql; protected: sqlite3_stmt * stmt; private: int last_arg_idx; }; } #endif //GUARD_SQLITE_COMMAND_HPP_INCLUDED vsqlite---0.3.12/include/sqlite/connection.hpp000066400000000000000000000076501210242273300212160ustar00rootroot00000000000000/*############################################################################## VSQLite++ - virtuosic bytes SQLite3 C++ wrapper Copyright (c) 2006-2012 Vinzenz Feenstra vinzenz.feenstra@gmail.com All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. * Neither the name of virtuosic bytes nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ##############################################################################*/ #ifndef GUARD_SQLITE_CONNECTION_HPP_INCLUDED #define GUARD_SQLITE_CONNECTION_HPP_INCLUDED #include #include struct sqlite3; namespace sqlite{ /** \brief connection is used to open, close, attach and detach a database. * Further it has to be passed to all classes since it represents the * connection to the database and contains the internal needed handle, so * you can see a connection object as handle to the database * An object of this class is not copyable */ struct connection : boost::noncopyable{ /** \brief constructor opens the database * \param db filename of the database file * if the given file already exists the file will be opened * as database. * If the file does not exist a new database will be created */ connection(std::string const & db); /** \brief destructor closes the database automatically * */ ~connection(); /** \brief attaches another database file to the database represented by * the object of this class. It is possible to attach up to 10 times * the same database file with different aliases * \param db database filename of the database should be attached * \param database_alias alias which should be used */ void attach(std::string const & db, std::string const & database_alias); /** \brief detaches a database via alias, if the same database was * attached with several names they will be still present * \param database_alias of the database (must be the same alias which * was passed in the attach() call) */ void detach(std::string const & database_alias); private: friend struct private_accessor; private: void open(std::string const & db); void close(); void access_check(); private: sqlite3 * handle; }; } #endif //GUARD_SQLITE_CONNECTION_HPP_INCLUDED vsqlite---0.3.12/include/sqlite/database_exception.hpp000066400000000000000000000051331210242273300226730ustar00rootroot00000000000000/*############################################################################## VSQLite++ - virtuosic bytes SQLite3 C++ wrapper Copyright (c) 2006-2012 Vinzenz Feenstra vinzenz.feenstra@gmail.com All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. * Neither the name of virtuosic bytes nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ##############################################################################*/ #ifndef GUARD_SQLITE_DATABASE_EXCEPTION_HPP_INCLUDED #define GUARD_SQLITE_DATABASE_EXCEPTION_HPP_INCLUDED #include #include namespace sqlite{ struct database_exception : public std::runtime_error { database_exception(std::string const & msg) : std::runtime_error(msg.c_str()){} }; struct buffer_too_small_exception : public std::runtime_error{ buffer_too_small_exception(std::string const & msg) : std::runtime_error(msg.c_str()){} }; struct database_misuse_exception : public std::logic_error{ database_misuse_exception(std::string const & msg) : std::logic_error(msg){} }; } #endif //GUARD_SQLITE_DATABASE_EXCEPTION_HPP_INCLUDED vsqlite---0.3.12/include/sqlite/execute.hpp000066400000000000000000000055121210242273300205140ustar00rootroot00000000000000/*############################################################################## VSQLite++ - virtuosic bytes SQLite3 C++ wrapper Copyright (c) 2006-2012 Vinzenz Feenstra vinzenz.feenstra@gmail.com All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. * Neither the name of virtuosic bytes nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ##############################################################################*/ #ifndef GUARD_SQLITE_EXECUTE_HPP_INCLUDED #define GUARD_SQLITE_EXECUTE_HPP_INCLUDED #include namespace sqlite{ /** \brief execute can be used for SQL commands which should executed * the constructor is defined in a way that it can be used like a function * An object of this class is not copyable */ struct execute : command{ /** \brief constructor * \param con reference to the connection object which should be used * \param sql the SQL statement which should be executed * \param immediately if it is true the sql command will be immediately * executed if it is false the command will be executed after an * emit or operator() call */ execute(connection & con, std::string const & sql, bool immediately = false); /** \brief destructor * */ virtual ~execute(); }; } #endif //GUARD_SQLITE_EXECUTE_HPP_INCLUDED vsqlite---0.3.12/include/sqlite/ext/000077500000000000000000000000001210242273300171365ustar00rootroot00000000000000vsqlite---0.3.12/include/sqlite/ext/variant.hpp000066400000000000000000000050031210242273300213110ustar00rootroot00000000000000/*############################################################################## VSQLite++ - virtuosic bytes SQLite3 C++ wrapper Copyright (c) 2012 Vinzenz Feenstra vinzenz.feenstra@gmail.com All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. * Neither the name of virtuosic bytes nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ##############################################################################*/ #ifndef GUARD_SQLITE_EXT_VARIANT_HPP_INCLUDED #define GUARD_SQLITE_EXT_VARIANT_HPP_INCLUDED #include #include #include #include #include namespace sqlite{ enum type { unknown, null, integer, real, text, blob }; struct unknown_t{}; struct null_t{}; typedef std::vector blob_t; typedef boost::shared_ptr blob_ref_t; typedef boost::variant< unknown_t, int, boost::int64_t, long double, std::string, null_t, blob_ref_t > variant_t; } #endif //GUARD_SQLITE_EXT_VARIANT_HPP_INCLUDED vsqlite---0.3.12/include/sqlite/private/000077500000000000000000000000001210242273300200105ustar00rootroot00000000000000vsqlite---0.3.12/include/sqlite/private/private_accessor.hpp000066400000000000000000000046221210242273300240610ustar00rootroot00000000000000/*############################################################################## VSQLite++ - virtuosic bytes SQLite3 C++ wrapper Copyright (c) 2006-2012 Vinzenz Feenstra vinzenz.feenstra@gmail.com All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. * Neither the name of virtuosic bytes nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ##############################################################################*/ #ifndef GUARD_SQLITE_PRIVATE_PRIVATE_ACCESSOR_HPP_INCLUDED #define GUARD_SQLITE_PRIVATE_PRIVATE_ACCESSOR_HPP_INCLUDED #include namespace sqlite{ /** \brief A internal used class, shall not be used from users * */ struct private_accessor{ static struct sqlite3 * get_handle(connection & m_con){ return m_con.handle; } static void acccess_check(connection & m_con){ m_con.access_check(); } }; } #endif// GUARD_SQLITE_PRIVATE_PRIVATE_ACCESSOR_HPP_INCLUDED vsqlite---0.3.12/include/sqlite/private/result_construct_params_private.hpp000066400000000000000000000044621210242273300272460ustar00rootroot00000000000000/*############################################################################## VSQLite++ - virtuosic bytes SQLite3 C++ wrapper Copyright (c) 2006-2012 Vinzenz Feenstra vinzenz.feenstra@gmail.com All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. * Neither the name of virtuosic bytes nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ##############################################################################*/ #ifndef GUARD_SQLITE_RESULT_CONSTRUCT_PARAMS_PRIVATE_HPP_INCLUDED #define GUARD_SQLITE_RESULT_CONSTRUCT_PARAMS_PRIVATE_HPP_INCLUDED #include struct sqlite3; struct sqlite3_stmt; namespace sqlite{ struct query; struct result_construct_params_private{ sqlite3 * db; sqlite3_stmt * statement; int row_count; boost::function0 access_check; boost::function0 step; }; } #endif //GUARD_SQLITE_RESULT_CONSTRUCT_PARAMS_PRIVATE_HPP_INCLUDED vsqlite---0.3.12/include/sqlite/query.hpp000066400000000000000000000060111210242273300202120ustar00rootroot00000000000000/*############################################################################## VSQLite++ - virtuosic bytes SQLite3 C++ wrapper Copyright (c) 2006-2012 Vinzenz Feenstra vinzenz.feenstra@gmail.com All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. * Neither the name of virtuosic bytes nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ##############################################################################*/ #ifndef GUARD_SQLITE_QUERY_HPP_INCLUDED #define GUARD_SQLITE_QUERY_HPP_INCLUDED #include #include #include namespace sqlite{ /** \brief query should be used to execute SQL queries * An object of this class is not copyable */ struct query : command { /** \brief constructor * \param con reference to the connection which should be used * \param sql is the SQL query statement */ query(connection & con, std::string const & sql); /** \brief destructor * */ virtual ~query(); /** \brief executes the sql command * \return result_type which is boost::shared_ptr */ result_type emit_result(); /** \brief returns the results (needs a previous emit() call) * \return result_type which is boost::shared_ptr */ result_type get_result(); private: int last_arg_idx; friend struct result; void access_check(); bool step(); }; } #endif //GUARD_SQLITE_QUERY_HPP_INCLUDED vsqlite---0.3.12/include/sqlite/result.hpp000066400000000000000000000135521210242273300203730ustar00rootroot00000000000000/*############################################################################## VSQLite++ - virtuosic bytes SQLite3 C++ wrapper Copyright (c) 2006-2012 Vinzenz Feenstra vinzenz.feenstra@gmail.com All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. * Neither the name of virtuosic bytes nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ##############################################################################*/ #ifndef GUARD_SQLITE_RESULT_HPP_INCLUDED #define GUARD_SQLITE_RESULT_HPP_INCLUDED #include #include namespace sqlite{ struct query; struct result_construct_params_private; /** \brief result can only be created by a query object. * An object of this class is not copyable. * */ struct result : boost::noncopyable{ private: typedef boost::shared_ptr construct_params; friend struct query; result(construct_params); public: /** \brief destructor * */ ~result(); /** \brief Increases the row index * \return returns false if there is no more row, otherwise it returns * true */ bool next_row(); /** \brief Returns the number of rows in the result * \return an integer */ int get_row_count(); /** \brief Returns the number of columns * \return an integer */ int get_column_count(); /** \brief Returns the type of the column * \param idx column index of the current row in the results * \return the column type */ type get_column_type(int idx); /** \brief Returns the type of the column * \param idx column index of the current row in the results * \return a string */ std::string get_column_decltype(int idx); /** \brief Retrieves a the current typ into variant_t * \param idx column index of the current row in the results * \return a value of variant_t */ variant_t get_variant(int index); /** \brief Returns the data at the given index as 32-Bit Integer * \return a 32-Bit Integer */ int get_int(int idx); /** \brief Returns the data at the given index as 64-Bit Integer * \param idx column index of the current row in the results * \return a 64-Bit Integer */ boost::int64_t get_int64(int idx); /** \brief Returns the data at the given index as String * \param idx column index of the current row in the results * \return a std::string object */ std::string get_string(int idx); /** \brief Returns the data at the given index as double * \param idx column index of the current row in the results * \return a double */ double get_double(int idx); /** \brief Returns the size of the data at the given index in bytes * \param idx column index of the current row in the results * \return a size_t value which represents the number of bytes needed * for the binary data at idx */ size_t get_binary_size(int idx); /** \brief Used to retrieve a binary value * \param idx column index of the current row in the results * \param buf pointer to the buffer which should be filled * \param buf_size size in bytes of the buffer */ void get_binary(int idx, void * buf, size_t buf_size); /** \brief Used to retrieve a binary value * \param idx column index of the current row in the results * \param vec a std::vector which will be filled * the method will increase the allocated buffer if needed */ void get_binary(int idx, std::vector & vec); /** \brief Returns the column name at the given index * \param idx column index of the current row in the results * \return a std::string object containing the name of the column */ std::string get_column_name(int idx); private: void access_check(int); private: construct_params m_params; int m_columns; int m_row_count; }; typedef boost::shared_ptr result_type; } #endif //GUARD_SQLITE_RESULT_HPP_INCLUDED vsqlite---0.3.12/include/sqlite/transaction.hpp000066400000000000000000000056631210242273300214060ustar00rootroot00000000000000/*############################################################################## VSQLite++ - virtuosic bytes SQLite3 C++ wrapper Copyright (c) 2006-2012 Vinzenz Feenstra vinzenz.feenstra@gmail.com All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. * Neither the name of virtuosic bytes nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ##############################################################################*/ #ifndef GUARD_SQLITE_TRANSACTION_HPP_INCLUDED #define GUARD_SQLITE_TRANSACTION_HPP_INCLUDED namespace sqlite{ struct connection; /** \brief transaction is a helper class to start transactions within SQLite * */ struct transaction{ public: /** \brief constructor * \param con a reference to the connection object where the * transaction should be started/ended/committed or rolled back in */ transaction(connection & con); /** \brief destructor * */ ~transaction(); /** \brief Starts a transaction * */ void begin(); /** \brief Ends an transaction * */ void end(); /** \brief Commits a transaction * */ void commit(); /** \brief Rolls back a transaction * */ void rollback(); private: void exec(std::string const &); connection & m_con; }; } #endif //GUARD_SQLITE_TRANSACTION_HPP_INCLUDED vsqlite---0.3.12/include/sqlite/view.hpp000066400000000000000000000100011210242273300200110ustar00rootroot00000000000000/*############################################################################## VSQLite++ - virtuosic bytes SQLite3 C++ wrapper Copyright (c) 2006-2012 Vinzenz Feenstra vinzenz.feenstra@gmail.com All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. * Neither the name of virtuosic bytes nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ##############################################################################*/ #ifndef GUARD_SQLITE_VIEW_HPP_INCLUDED #define GUARD_SQLITE_VIEW_HPP_INCLUDED namespace sqlite{ struct connection; /** \brief view is used to create views. In SQLite a view can only be * queried. INSERT, DELETE and UPDATE will fail on a view */ struct view { public: /** \brief constructor * \param con a reference to the connection object which should be used */ view(connection & con); /** \brief destructor * */ ~view(); /** \brief creates a view * \param temporary if this parameter is true the view will be present * until drop will be called or the database was closed * \param alias the name of this view which should be used * \param sql_query the SQL statement which represents the view */ void create(bool temporary, std::string const & alias, std::string const & sql_query); /** \brief creates a view * \param temporary if this parameter is true the view will be present * until drop will be called or the database was closed * \param database name of the database where the view should be * created in * \param alias the name of this view which should be used * \param sql_query the SQL statement which represents the view */ void create(bool temporary, std::string const & database, std::string const & alias, std::string const & sql_query); /** \brief drops a view * \param alias name of the view which should be dropped */ void drop(std::string const & alias); /** \brief drops a view * \param database name of the database where the view was created in * \param alias name of the view which should be dropped */ void drop(std::string const & database, std::string const & alias); private: connection & m_con; }; } #endif //GUARD_SQLITE_VIEW_HPP_INCLUDED vsqlite---0.3.12/m4/000077500000000000000000000000001210242273300137325ustar00rootroot00000000000000vsqlite---0.3.12/m4/.gitkeep000066400000000000000000000000001210242273300153510ustar00rootroot00000000000000vsqlite---0.3.12/scripts/000077500000000000000000000000001210242273300151015ustar00rootroot00000000000000vsqlite---0.3.12/scripts/distribute.sh000077500000000000000000000011471210242273300176210ustar00rootroot00000000000000#!/bin/sh DIST_VERSION=`cat VERSION` DIST_NAME='vsqlite++' DIST_FULL=$DIST_NAME-$DIST_VERSION echo "Generating $DIST_FULL..." git clean -d -f #git archive tags/$DIST_VERSION --format=tar --prefix="$DIST_FULL/" | bzip2 > $DIST_FULL.tar.bz2 #git archive tags/$DIST_VERSION --format=tar --prefix="$DIST_FULL/" | gzip > $DIST_FULL.tar.gz #git archive tags/$DIST_VERSION --format=tar --prefix="$DIST_FULL/" | xz -c > $DIST_FULL.tar.xz #git archive tags/$DIST_VERSION --format=zip --prefix="$DIST_FULL/" > $DIST_FULL.zip ./autogen.sh ./configure --prefix=/usr make dist-gzip make dist-bzip2 make dist-xz make dist-zip vsqlite---0.3.12/src/000077500000000000000000000000001210242273300142015ustar00rootroot00000000000000vsqlite---0.3.12/src/sqlite/000077500000000000000000000000001210242273300155025ustar00rootroot00000000000000vsqlite---0.3.12/src/sqlite/command.cpp000066400000000000000000000135121210242273300176260ustar00rootroot00000000000000/*############################################################################## VSQLite++ - virtuosic bytes SQLite3 C++ wrapper Copyright (c) 2006-2012 Vinzenz Feenstra vinzenz.feenstra@gmail.com All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. * Neither the name of virtuosic bytes nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ##############################################################################*/ #include #include #include #include namespace sqlite{ null_type nil = null_type(); command::command(connection & con, std::string const & sql) : m_con(con),m_sql(sql),stmt(0),last_arg_idx(0){ private_accessor::acccess_check(con); prepare(); } command::~command(){ try{ finalize(); } catch(...){ } } void command::finalize(){ access_check(); if(sqlite3_finalize(stmt) != SQLITE_OK) throw database_exception(sqlite3_errmsg(get_handle())); stmt = 0; } void command::clear(){ sqlite3_reset(stmt); last_arg_idx = 0; sqlite3_reset(stmt); } void command::prepare(){ private_accessor::acccess_check(m_con); if(stmt) finalize(); const char * tail = 0; if(sqlite3_prepare(get_handle(),m_sql.c_str(),-1,&stmt,&tail) != SQLITE_OK) throw database_exception(sqlite3_errmsg(get_handle())); } bool command::emit(){ return step(); } bool command::step(){ access_check(); switch(sqlite3_step(stmt)){ case SQLITE_ROW: return true; case SQLITE_DONE: return false; case SQLITE_MISUSE: throw database_misuse_exception(sqlite3_errmsg(get_handle())); default: throw database_exception(sqlite3_errmsg(get_handle())); } return false; } bool command::operator()(){ return step(); } void command::bind(int idx){ access_check(); if(sqlite3_bind_null(stmt,idx) != SQLITE_OK) throw database_exception(sqlite3_errmsg(get_handle())); } void command::bind(int idx, int v){ access_check(); if(sqlite3_bind_int(stmt,idx,v) != SQLITE_OK) throw database_exception(sqlite3_errmsg(get_handle())); } void command::bind(int idx, boost::int64_t v){ access_check(); if(sqlite3_bind_int64(stmt,idx,v) != SQLITE_OK) throw database_exception(sqlite3_errmsg(get_handle())); } void command::bind(int idx, double v){ access_check(); if(sqlite3_bind_double(stmt,idx,v) != SQLITE_OK) throw database_exception(sqlite3_errmsg(get_handle())); } void command::bind(int idx, std::string const & v){ access_check(); if(sqlite3_bind_text(stmt,idx,v.c_str(),int(v.size()),SQLITE_TRANSIENT) != SQLITE_OK) throw database_exception(sqlite3_errmsg(get_handle())); } void command::bind(int idx, void const * v , size_t vn){ access_check(); if(sqlite3_bind_blob(stmt,idx,v,int(vn),SQLITE_TRANSIENT) != SQLITE_OK) throw database_exception(sqlite3_errmsg(get_handle())); } void command::bind(int idx, std::vector const & v) { bind(idx,&v.at(0),v.size()); } void command::access_check(){ private_accessor::acccess_check(m_con); if(!stmt) throw database_exception("command was not prepared or is invalid"); } command & command::operator % (null_type const &){ bind(++last_arg_idx); return *this; } command & command::operator % (int v){ bind(++last_arg_idx,v); return *this; } command & command::operator % (boost::int64_t v){ bind(++last_arg_idx,v); return *this; } command & command::operator % (double v){ bind(++last_arg_idx,v); return *this; } command & command::operator % (std::string const & v){ bind(++last_arg_idx,v); return *this; } command & command::operator % (std::vector const & v) { bind(++last_arg_idx,v); return *this; } struct sqlite3 * command::get_handle(){ return private_accessor::get_handle(m_con); } } vsqlite---0.3.12/src/sqlite/connection.cpp000066400000000000000000000061721210242273300203530ustar00rootroot00000000000000/*############################################################################## VSQLite++ - virtuosic bytes SQLite3 C++ wrapper Copyright (c) 2006-2012 Vinzenz Feenstra vinzenz.feenstra@gmail.com All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. * Neither the name of virtuosic bytes nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ##############################################################################*/ #include #include #include #include #include namespace sqlite{ connection::connection(std::string const & db) : handle(0){ open(db); } connection::~connection(){ try{ close(); } catch(...){ } } void connection::open(const std::string &db){ if(sqlite3_open(db.c_str(),&handle) != SQLITE_OK) throw database_exception("Could not open database"); } void connection::close(){ access_check(); if(sqlite3_close(handle) != SQLITE_OK) throw database_exception(sqlite3_errmsg(handle)); handle = 0; } void connection::access_check(){ if(!handle) throw database_exception("Database is not open."); } void connection::attach(std::string const & db, std::string const & alias){ boost::format fmt("ATTACH DATABASE %1% AS %2%;"); fmt % db % alias; execute(*this,fmt.str(),true); } void connection::detach(std::string const & alias){ boost::format fmt("DETACH DATABASE %1%;"); fmt % alias; execute(*this,fmt.str(),true); } } vsqlite---0.3.12/src/sqlite/execute.cpp000066400000000000000000000041051210242273300176500ustar00rootroot00000000000000/*############################################################################## VSQLite++ - virtuosic bytes SQLite3 C++ wrapper Copyright (c) 2006-2012 Vinzenz Feenstra vinzenz.feenstra@gmail.com All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. * Neither the name of virtuosic bytes nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ##############################################################################*/ #include namespace sqlite{ execute::execute(connection & con, std::string const & sql, bool immediately) : command(con,sql){ if(immediately) emit(); } execute::~execute(){ } } vsqlite---0.3.12/src/sqlite/query.cpp000066400000000000000000000054331210242273300173600ustar00rootroot00000000000000/*############################################################################## VSQLite++ - virtuosic bytes SQLite3 C++ wrapper Copyright (c) 2006-2012 Vinzenz Feenstra vinzenz.feenstra@gmail.com All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. * Neither the name of virtuosic bytes nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ##############################################################################*/ #include #include #include #include namespace sqlite{ query::query(connection & con, std::string const & sql) : command(con,sql){ } query::~query(){ } boost::shared_ptr query::emit_result(){ step(); return get_result(); } boost::shared_ptr query::get_result(){ access_check(); result_construct_params_private * p = new result_construct_params_private(); p->access_check = boost::bind(&query::access_check,this); p->step = boost::bind(&query::step,this); p->db = sqlite3_db_handle(stmt); p->row_count = sqlite3_changes(p->db); p->statement = stmt; return boost::shared_ptr(new result(result::construct_params(p))); } void query::access_check(){ command::access_check(); } bool query::step(){ return command::step(); } } vsqlite---0.3.12/src/sqlite/result.cpp000066400000000000000000000153501210242273300175300ustar00rootroot00000000000000/*############################################################################## VSQLite++ - virtuosic bytes SQLite3 C++ wrapper Copyright (c) 2006-2012 Vinzenz Feenstra vinzenz.feenstra@gmail.com All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. * Neither the name of virtuosic bytes nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ##############################################################################*/ #include #include #include #include #include #include namespace sqlite{ result::result(construct_params p) : m_params(p){ m_params->access_check(); m_columns = sqlite3_column_count(m_params->statement); m_row_count = m_params->row_count; } result::~result(){ } bool result::next_row(){ return m_params->step(); } std::string result::get_column_decltype(int idx) { access_check(idx); return sqlite3_column_decltype(m_params->statement,idx); } type result::get_column_type(int idx) { access_check(idx); switch(sqlite3_column_type(m_params->statement,idx)) { case SQLITE_BLOB: return sqlite::blob; case SQLITE_NULL: return sqlite::null; case SQLITE_FLOAT: return sqlite::real; case SQLITE_INTEGER: return sqlite::integer; case SQLITE_TEXT: return sqlite::text; default: break; } return sqlite::unknown; } variant_t result::get_variant(int idx) { variant_t v; switch( get_column_type(idx) ) { case sqlite::integer: { boost::int64_t i = get_int64(idx); if( i > std::numeric_limits::max() || i < std::numeric_limits::min() ) { v = i; } else { v = int(i); } } break; case sqlite::blob: v = boost::make_shared(); get_binary(idx, *boost::get(v)); break; case sqlite::real: { long double x = get_double(idx); v = x; } break; case sqlite::null: v = null_t(); break; default: case sqlite::text: v = get_string(idx); break; } return v; } int result::get_int(int idx){ access_check(idx); if(sqlite3_column_type(m_params->statement,idx) == SQLITE_NULL) return 0; return sqlite3_column_int(m_params->statement,idx); } boost::int64_t result::get_int64(int idx){ access_check(idx); if(sqlite3_column_type(m_params->statement,idx) == SQLITE_NULL) return 0; return sqlite3_column_int64(m_params->statement,idx); } std::string result::get_string(int idx){ access_check(idx); if(sqlite3_column_type(m_params->statement,idx) == SQLITE_NULL) return std::string("NULL"); char const * v = reinterpret_cast (sqlite3_column_text(m_params->statement,idx)); size_t length = get_binary_size(idx); return std::string(v, v+length); } double result::get_double(int idx){ access_check(idx); if(sqlite3_column_type(m_params->statement,idx) == SQLITE_NULL) return 0.0; return sqlite3_column_double(m_params->statement,idx); } size_t result::get_binary_size(int idx){ access_check(idx); if(sqlite3_column_type(m_params->statement,idx) == SQLITE_NULL) return 0; return sqlite3_column_bytes(m_params->statement,idx); } void result::get_binary(int idx, void * buf, size_t buf_size){ access_check(idx); if(sqlite3_column_type(m_params->statement,idx) == SQLITE_NULL) return; size_t size = sqlite3_column_bytes(m_params->statement,idx); if(size > buf_size) throw buffer_too_small_exception("buffer too small"); memcpy(buf,sqlite3_column_blob(m_params->statement,idx),size); } void result::get_binary(int idx, std::vector & v){ access_check(idx); if(sqlite3_column_type(m_params->statement,idx) == SQLITE_NULL) return; size_t size = sqlite3_column_bytes(m_params->statement,idx); v.resize(size,0); memcpy(&v[0],sqlite3_column_blob(m_params->statement,idx),size); } std::string result::get_column_name(int idx){ access_check(idx); return sqlite3_column_name(m_params->statement,idx); } void result::access_check(int idx){ m_params->access_check(); if(idx < 0 || idx >= m_columns) throw std::out_of_range("no such column index"); } int result::get_row_count(){ return m_params->row_count; } int result::get_column_count(){ return m_columns; } } vsqlite---0.3.12/src/sqlite/transaction.cpp000066400000000000000000000050231210242273300205330ustar00rootroot00000000000000/*############################################################################## VSQLite++ - virtuosic bytes SQLite3 C++ wrapper Copyright (c) 2006-2012 Vinzenz Feenstra vinzenz.feenstra@gmail.com All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. * Neither the name of virtuosic bytes nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ##############################################################################*/ #include #include #include namespace sqlite{ transaction::transaction(connection & con) : m_con(con){ begin(); } transaction::~transaction(){ commit(); end(); } void transaction::begin(){ exec("BEGIN TRANSACTION"); } void transaction::end(){ exec("END TRANSACTION"); } void transaction::commit(){ exec("COMMIT TRANSACTION"); } void transaction::rollback(){ exec("ROLLBACK TRANSACTION"); } void transaction::exec(std::string const & cmd){ execute(m_con,cmd,true); } } vsqlite---0.3.12/src/sqlite/view.cpp000066400000000000000000000061771210242273300171730ustar00rootroot00000000000000/*############################################################################## VSQLite++ - virtuosic bytes SQLite3 C++ wrapper Copyright (c) 2006-2012 Vinzenz Feenstra vinzenz.feenstra@gmail.com All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. * Neither the name of virtuosic bytes nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ##############################################################################*/ #include #include #include #include namespace sqlite{ view::view(connection & con) :m_con(con){ } view::~view(){ } void view::create(bool temporary, std::string const & database, std::string const & alias, std::string const & sql_query){ boost::format fmt("CREATE %1% VIEW %2%.%3% AS %4%;"); fmt % (temporary ? "TEMPORARY" : "") % database % alias % sql_query; execute(m_con,fmt.str(),true); } void view::create(bool temporary, std::string const & alias, std::string const & sql_query){ boost::format fmt("CREATE %1% VIEW %2% AS %3%;"); fmt % (temporary ? "TEMPORARY" : "") % alias % sql_query; execute(m_con,fmt.str(),true); } void view::drop(std::string const & alias){ boost::format fmt("DROP VIEW %1%;"); fmt % alias; execute(m_con,fmt.str(),true); } void view::drop(std::string const & database, std::string const & alias){ boost::format fmt("DROP VIEW %1%.%2%;"); fmt % database % alias; execute(m_con,fmt.str(),true); } }