📄 row.cc
字号:
#include "mysqlcppapi/row/Row.h"#include "mysqlcppapi/query_results/Result_Store.h"namespace mysqlcppapi{Row::Row(){}Row::Row(MYSQL_ROW d, const Result_Use& result, type_length* jj){ m_sharedptr_result = type_sharedptr_result(new Result_Use(result)); //Deleted after last unreference. if(d) { const size_type size = this->size(); data.reserve(size); is_nulls.reserve(size); for(size_type i = 0; i < size; ++i) { data.push_back( d[i] ? std::string(d[i], jj[i]) : std::string() ); is_nulls.push_back(d[i] == NULL); } }}Row::~Row(){} const Result_Use& Row::parent() const{ return *m_sharedptr_result.obj(); //Shared.}Row::size_type Row::size() const{ return m_sharedptr_result->num_fields();} const ColData Row::operator [] (size_type i) const{ return ColData( data[i], is_nulls[i] );}const ColData Row::operator[] (const std::string& strFieldName) const{ const Fields& fields = m_sharedptr_result->get_fields(); return (*this)[ fields.get_index(strFieldName) ];}Row::type_vecStrings Row::get_vector() const{ type_vecStrings vecResult(size()); for(size_type i = 0; i < size(); i++) vecResult[i] = (*this)[i].get_string(); return vecResult;}} //namespace
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -