aboutsummaryrefslogtreecommitdiff
path: root/src/shared/Database/QueryResult.h
diff options
context:
space:
mode:
authorclick <none@none>2010-05-08 05:03:32 +0200
committerclick <none@none>2010-05-08 05:03:32 +0200
commitf60d534b73838c2f3c461b0086f6da02576697f3 (patch)
tree7c1ba2b4a55ff7eba018c5c012a81d2730e0cdce /src/shared/Database/QueryResult.h
parentd6df19cd9948ff6d108f88e0d8c77bdbda5922ab (diff)
Cleanup on some database-related files: merge some DB-related files, add some consistency to callhandles in sourcetree (M
+ combine MySQL-specific files into main database-files (click) + fix vcproj-files, adjust handler-function names for consistency (Machiavelli) --HG-- branch : trunk
Diffstat (limited to 'src/shared/Database/QueryResult.h')
-rw-r--r--src/shared/Database/QueryResult.h22
1 files changed, 17 insertions, 5 deletions
diff --git a/src/shared/Database/QueryResult.h b/src/shared/Database/QueryResult.h
index 5c380c0d5d1..4eec9915362 100644
--- a/src/shared/Database/QueryResult.h
+++ b/src/shared/Database/QueryResult.h
@@ -26,15 +26,21 @@
#include "Field.h"
+#ifdef WIN32
+#define FD_SETSIZE 1024
+#include <winsock2.h>
+#include <mysql/mysql.h>
+#else
+#include <mysql.h>
+#endif
+
class QueryResult
{
public:
- QueryResult(uint64 rowCount, uint32 fieldCount)
- : mFieldCount(fieldCount), mRowCount(rowCount) {}
-
- virtual ~QueryResult() {}
+ QueryResult(MYSQL_RES *result, MYSQL_FIELD *fields, uint64 rowCount, uint32 fieldCount);
+ ~QueryResult();
- virtual bool NextRow() = 0;
+ bool NextRow();
Field *Fetch() const { return mCurrentRow; }
@@ -47,6 +53,12 @@ class QueryResult
Field *mCurrentRow;
uint32 mFieldCount;
uint64 mRowCount;
+
+ private:
+ enum Field::DataTypes ConvertNativeType(enum_field_types mysqlType) const;
+ void EndQuery();
+ MYSQL_RES *mResult;
+
};
typedef ACE_Refcounted_Auto_Ptr<QueryResult, ACE_Null_Mutex> QueryResult_AutoPtr;