lex.mysql_bind.hh

00001 /*
00002 This file is part of ResourcePool.
00003 
00004 ResourcePool is free software; you can redistribute it
00005 and/or modify it under the terms of the GNU General Public License
00006 as published by the Free Software Foundation; either version 2 of
00007 the License, or (at your option) any later version.
00008 
00009 ResourcePool is distributed in the hope that it will be
00010 useful, but WITHOUT ANY WARRANTY; without even the implied warranty
00011 of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00012 GNU General Public License for more details.
00013 
00014 You should have received a copy of the GNU General Public License
00015 along with ResourcePool; if not, write to the Free Software
00016 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
00017 02111-1307  USA */
00018 
00019 
00020 #ifndef RESOURCEPOOL_MYSQL_MYSQLBIND_HH
00021 #define RESOURCEPOOL_MYSQL_MYSQLBIND_HH
00022 
00023 #ifndef RESOURCEPOOL_MYSQL_SQLTYPE_HH
00024 #include "SQLType.hh"
00025 #endif
00026 
00027 #ifndef INCLUDED_GC_PTR_HH
00028 #include "mm/gc_ptr.hh"
00029 #endif
00030 
00031 #include <vector>
00032 #include <string>
00033 #include <sstream>
00034 
00035 
00036 #ifndef MYSQL_INCLUDE_FLEXLEXER
00037 #undef yyFlexLexer
00038 #define yyFlexLexer mysql_bindFlexLexer
00039 #include <FlexLexer.h>
00040 #endif
00041 
00042 namespace fatalmind {
00043 namespace mysql {
00044 
00045 class mysql_bind: public mysql_bindFlexLexer {
00046     public:
00047         mysql_bind(MYSQL& dbh, const std::string& _sql, const std::vector<gc_ptr<SQLType> >& args);
00048         const std::string& getSQL();
00049 
00050     private:
00051         const SQLType& get_mysql_arg();
00052         int yylex ();
00053     
00054         unsigned int _arg_no;
00055         std::ostringstream _os;
00056         std::istringstream _is;
00057         const std::vector<gc_ptr<SQLType> >& _args;
00058         std::string _sqlout;
00059         MYSQL& _dbh;
00060 };
00061 } // namespace mysql
00062 } // namespace fatalmind
00063 
00064 extern "C" {
00065 inline int mysql_bindwrap() {
00066     return 1;
00067 }
00068 }
00069 #endif

Generated on Sun Mar 15 17:15:04 2009 for ResourcePool by  doxygen 1.5.3