📄 sql_query.cc
字号:
#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 + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -