From bb8438c09b0458533e5b34c1917e97838fce2504 Mon Sep 17 00:00:00 2001 From: Machiavelli Date: Sun, 12 Sep 2010 15:11:08 +0200 Subject: Core/DBLayer: Add GetCString method for PreparedResultSet (dynamic copy is responsibility of the high level code) --HG-- branch : trunk --- src/server/shared/Database/QueryResult.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'src/server/shared/Database/QueryResult.cpp') 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(rbind->m_rBind[index].buffer), *rbind->m_rBind[index].length); } +const char* PreparedResultSet::GetCString(uint32 index) +{ + if (!CheckFieldIndex(index)) + return '\0'; + + return static_cast(rbind->m_rBind[index].buffer); +} + bool PreparedResultSet::NextRow() { if (row_position >= num_rows) -- cgit v1.2.3