diff options
Diffstat (limited to 'include/SQL.h')
-rw-r--r-- | include/SQL.h | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/include/SQL.h b/include/SQL.h index ee28eb0..846afe2 100644 --- a/include/SQL.h +++ b/include/SQL.h @@ -1,20 +1,33 @@ #ifndef __SQL_H__ #define __SQL_H__ -#include <set> +#include <map> #include <mysql.h> #include <Exceptions.h> -//typedef AssocArray std::set<String, compare>; +namespace BMySQL { + struct ltstr { + bool operator()(String s1, String s2) const { + return s1 < s2; + } + }; +}; + +typedef std::map<String, String, BMySQL::ltstr> AssocArray; class SQLConnection : public Base { public: SQLConnection(String host, String user, String passwd, String db, int port = 3306, String socket = "", unsigned long clags = 0) throw (GeneralException); ~SQLConnection(); void query(String) throw (GeneralException); + int numrows(); + int numfields(); + AssocArray fetchrow(); private: MYSQL con; MYSQL_RES * res; + int nr, nf; + MYSQL_FIELD * fields; }; #endif |