sql_query.cc

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

CC
47
字号
#include "mysqlcppapi/query/sql_query.h"namespace mysqlcppapi{/* * Note that since SQLQuery inherits from an IOStream class it has a * std::ios virtual base class. The constructor for this is called by * the constructor for the complete object that inherits from it * (i.e. the constructor of the most-derived class in a hierarchy). * This means that the std::ios constructor will always be the first * object in the hierarchy constructed. We can safely default construct * it because the constructor for the std::stringstream base class will * be run afterwards and call std::ios::init(). */SQLQuery::SQLQuery(): std::ios(), std::stringstream(), Success(false), errmsg(){}  SQLQuery::SQLQuery(const SQLQuery& src): std::ios(), std::stringstream(static_cast<const std::stringstream&>(src).str()), Success(src.Success), errmsg(src.errmsg){}SQLQuery& SQLQuery::operator= (const SQLQuery& src){  const std::string& s = static_cast<const std::stringstream&>(src).str();  static_cast<std::stringstream*>(this)->str(s);    Success = src.Success;  errmsg = src.errmsg;   return *this;}  } //namespace

⌨️ 快捷键说明

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