25 bool MysqlResults::getRow(std::vector<std::string>& fields,
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(
"");
43 bool MysqlResults::getRowPtrs(std::vector<std::string*>& fields,
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);
64 bool MysqlResults::getRowCon(
char* par,
unsigned long* treesize,
unsigned int* runFrm,
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;