14 MysqlResults::MysqlResults(
MYSQL_RES* results) : m_myres(results) {
18 mysql_free_result(m_myres);
22 return mysql_num_rows(m_myres);
26 unsigned int i,
bool clear) {
27 mysql_data_seek(m_myres, i);
28 MYSQL_ROW myRow = mysql_fetch_row(m_myres);
30 unsigned nFields = mysql_num_fields(m_myres);
33 if (clear) fields.clear();
35 for (
unsigned int iField = 0; iField < nFields; iField++) {
36 if (myRow[iField]) fields.push_back(std::string(myRow[iField]));
37 else fields.push_back(
"");
44 unsigned int i,
bool clear) {
46 mysql_data_seek(m_myres, i);
47 MYSQL_ROW myRow = mysql_fetch_row(m_myres);
49 unsigned nFields = mysql_num_fields(m_myres);
52 if (clear) fields.clear();
54 for (
unsigned int iField = 0; iField < nFields; iField++) {
55 if (myRow[iField]) fields.push_back(
new std::string(myRow[iField]));
56 else fields.push_back(0);
65 unsigned int* runTo,
unsigned int i,
bool clear){
66 mysql_data_seek(m_myres, i);
67 MYSQL_ROW myRow = mysql_fetch_row(m_myres);
68 unsigned nFields = mysql_num_fields(m_myres);
69 unsigned long* lengths;
70 lengths = mysql_fetch_lengths(m_myres);
72 for (
unsigned int iField = 0; iField <nFields; iField++) {
73 if (myRow[iField]&&iField<(nFields-4)){
74 memcpy(par+1024000*iField,myRow[iField],lengths[iField]);
75 treesize[iField] = lengths[iField];
81 std::cout<<
" CalVerSft is "<<myRow[nFields-2]<<
" File name is "<<myRow[nFields-1]<<std::endl;
struct st_mysql_res MYSQL_RES
static int stringToInt(const std::string &InStr)
virtual bool getRow(std::vector< std::string > &fields, unsigned int i=0, bool clear=true)
virtual bool getRowCon(char *par, unsigned long *treesize, unsigned int *runFrm, unsigned int *runTo, unsigned int i=0, bool clear=true)
virtual unsigned int getNRows() const
Return number of rows in results.
virtual bool getRowPtrs(std::vector< std::string * > &fieldPtrs, unsigned int i=0, bool clear=true)