From d38f2ad213e875d40556116cba3230064eacb861 Mon Sep 17 00:00:00 2001 From: Daniel Vassdal Date: Mon, 2 Mar 2015 03:06:55 +0100 Subject: SQL: Add HasColumn() to check if a result contains a named column. --- include/modules/sql.h | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'include/modules') diff --git a/include/modules/sql.h b/include/modules/sql.h index 14cd60a56..59955107d 100644 --- a/include/modules/sql.h +++ b/include/modules/sql.h @@ -122,6 +122,15 @@ class SQL::Result : public classbase * @param result A reference to the vector to store column names in. */ virtual void GetCols(std::vector& result) = 0; + + /** + * Check if there's a column with the specified name in the result + * + * @param the column name + * @param on success, this is the column index + * @returns true, or false if the column is not found + */ + virtual bool HasColumn(const std::string& column, size_t& index) = 0; }; /** SQL::Error holds the error state of a request. -- cgit v1.2.3