aboutsummaryrefslogtreecommitdiff
path: root/src/server/shared/Database/QueryResult.cpp
diff options
context:
space:
mode:
authorMachiavelli <none@none>2010-09-12 15:11:08 +0200
committerMachiavelli <none@none>2010-09-12 15:11:08 +0200
commitbb8438c09b0458533e5b34c1917e97838fce2504 (patch)
tree95f8fb04de6120cbaa73adcd46e9829f1501e7d4 /src/server/shared/Database/QueryResult.cpp
parent855ec1cd0196e5b137eab6cb90a3feeb9a67d430 (diff)
Core/DBLayer: Add GetCString method for PreparedResultSet (dynamic copy is responsibility of the high level code)
--HG-- branch : trunk
Diffstat (limited to 'src/server/shared/Database/QueryResult.cpp')
-rw-r--r--src/server/shared/Database/QueryResult.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/server/shared/Database/QueryResult.cpp b/src/server/shared/Database/QueryResult.cpp
index 9a0cf6293c6..18866e49fac 100644
--- a/src/server/shared/Database/QueryResult.cpp
+++ b/src/server/shared/Database/QueryResult.cpp
@@ -260,6 +260,14 @@ std::string PreparedResultSet::GetString(uint32 index)
return std::string(static_cast<char const*>(rbind->m_rBind[index].buffer), *rbind->m_rBind[index].length);
}
+const char* PreparedResultSet::GetCString(uint32 index)
+{
+ if (!CheckFieldIndex(index))
+ return '\0';
+
+ return static_cast<char const*>(rbind->m_rBind[index].buffer);
+}
+
bool PreparedResultSet::NextRow()
{
if (row_position >= num_rows)