00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
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 }
00062 }
00063
00064 extern "C" {
00065 inline int mysql_bindwrap() {
00066 return 1;
00067 }
00068 }
00069 #endif