00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011 #ifndef __DB_COMMON_H__
00012 #define __DB_COMMON_H__
00013
00014 class DSL_API_CLASS SC_Row {
00015 public:
00016 map<string, string> Values;
00017 uint32_t NumFields;
00018
00019 SC_Row();
00020 ~SC_Row();
00021 void Reset();
00022
00023 string Get(string fieldname, string sDefault = "");
00024 };
00025
00026 class DSL_API_CLASS SQLConxMulti {
00027 public:
00028 ~SQLConxMulti();
00029
00030 void Query(std::string query);
00031 size_t Count();
00032
00033 std::vector<std::string> queries;
00034 };
00035
00036 class DSL_API_CLASS SQLConx {
00037 public:
00038 typedef int(*sql_printf_type)(const char * fmt, ...);
00039 void SetOutput(sql_printf_type pprintf = NULL);
00040
00041 virtual SQLConxMulti * MultiStart() = 0;
00042 virtual bool MultiSend(SQLConxMulti *) = 0;
00043 virtual bool MultiEnd(SQLConxMulti *) = 0;
00044
00045 virtual void SCM_Query(std::string query, uint32_t len = 0) = 0;
00046
00047 protected:
00048 sql_printf_type sql_printf = NULL;
00049 };
00050
00051 #endif // __DB_COMMON_H__