From f6166bcb944b3e3295319f03326f0858967ccd9c Mon Sep 17 00:00:00 2001 From: Arthur Ice Date: Thu, 8 Jan 2015 20:34:38 -0800 Subject: [PATCH] modified mysql results/row to be ready for range based for --- common/mysql_request_result.h | 2 +- common/mysql_request_row.cpp | 6 ++++++ common/mysql_request_row.h | 2 +- 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/common/mysql_request_result.h b/common/mysql_request_result.h index b2d6fe3d1..2944f528b 100644 --- a/common/mysql_request_result.h +++ b/common/mysql_request_result.h @@ -48,7 +48,7 @@ public: const std::string FieldName(int columnIndex); MySQLRequestRow& begin() { return m_CurrentRow; } - MySQLRequestRow& end() { return m_OneBeyondRow;} + MySQLRequestRow& end() { return m_OneBeyondRow; } private: void FreeInternals(); diff --git a/common/mysql_request_row.cpp b/common/mysql_request_row.cpp index 9491fd1b2..6f5300964 100644 --- a/common/mysql_request_row.cpp +++ b/common/mysql_request_row.cpp @@ -30,6 +30,12 @@ MySQLRequestRow& MySQLRequestRow::operator=(MySQLRequestRow& moveItem) return *this; } + +MySQLRequestRow MySQLRequestRow::operator*() +{ + return *this; +} + MySQLRequestRow::MySQLRequestRow(MYSQL_RES *result) : m_Result(result) { diff --git a/common/mysql_request_row.h b/common/mysql_request_row.h index 85fe7cb4f..06788025d 100644 --- a/common/mysql_request_row.h +++ b/common/mysql_request_row.h @@ -28,7 +28,7 @@ public: MySQLRequestRow operator++(int); bool operator==(const MySQLRequestRow& rhs); bool operator!=(const MySQLRequestRow& rhs); - + MySQLRequestRow operator*(); char* operator[](int index); };