result_store.cc

来自「有关MYSQL的开源码」· CC 代码 · 共 69 行

CC
69
字号
#include "mysqlcppapi/query_results/Result_Store.h"#include "mysqlcppapi/row/Row.h"namespace mysqlcppapi{Result_Store::Result_Store(){}Result_Store::Result_Store(MYSQL_RES *Result_Store, bool bFullFieldInfo /* = false */) : type_base(Result_Store, bFullFieldInfo){}Result_Store::Result_Store(const Result_Store& src): type_base(src), type_container(){}Result_Store::~Result_Store(){}Result_Store& Result_Store::operator=(const Result_Store& src){  type_base::operator=(src);  return *this;}    Row Result_Store::fetch_row() const{  if(!m_pMySQL_Res)    throw ex_BadQuery("Result_Stores not fetched");     MYSQL_ROW row = mysql_fetch_row(m_pMySQL_Res.obj());  Row::type_length* length =  ::mysql_fetch_lengths(m_pMySQL_Res.obj());  if(!row || !length)    throw ex_BadQuery("Bad row");     return Row(row, *this, length);}void Result_Store::data_seek(size_type offset) const {  mysql_data_seek(m_pMySQL_Res.obj(), offset);}Result_Store::size_type Result_Store::size() const{  if(!m_pMySQL_Res)    throw ex_BadQuery("Result_Stores not fetched");  return mysql_num_rows(m_pMySQL_Res.obj());}const Row Result_Store::operator[](size_type i) const{  data_seek(i);  return fetch_row();}} //namespace

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?