#include <MysqlResults.h>
Inheritance diagram for rdbModel::MysqlResults:
Public Member Functions | |
virtual unsigned int | getNRows () const |
Return number of rows in results. | |
virtual unsigned int | getNRows () const |
Return number of rows in results. | |
virtual bool | getRow (std::vector< std::string > &fields, unsigned int i=0, bool clear=true) |
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 bool | getRowCon (char *par, unsigned long *treesize, unsigned int *runFrm, unsigned int *runTo, unsigned int i=0, bool clear=true) |
virtual bool | getRowPtrs (std::vector< std::string * > &fieldPtrs, unsigned int i=0, bool clear=true) |
virtual bool | getRowPtrs (std::vector< std::string * > &fieldPtrs, unsigned int i=0, bool clear=true) |
virtual | ~MysqlResults () |
virtual | ~MysqlResults () |
Static Public Member Functions | |
void | cleanFieldPtrs (std::vector< std::string * > &fields) |
void | cleanFieldPtrs (std::vector< std::string * > &fields) |
Private Member Functions | |
MysqlResults (MYSQL_RES *results=0) | |
MysqlResults (MYSQL_RES *results=0) | |
Private Attributes | |
MYSQL_RES * | m_myres |
MYSQL_RES * | m_myres |
Friends | |
class | MysqlConnection |
|
00015 { 00016 mysql_free_result(m_myres); 00017 }
|
|
00012 : m_myres(results) { 00013 }
|
|
|
|
|
|
|
|
00007 { 00008 for (unsigned i = 0; i < fields.size(); i++) { 00009 if (fields[i] != 0) delete fields[i]; 00010 } 00011 fields.resize(0); 00012 }
|
|
Return number of rows in results.
Implements rdbModel::ResultHandle. |
|
Return number of rows in results.
Implements rdbModel::ResultHandle. 00019 {
00020 return mysql_num_rows(m_myres);
00021 }
|
|
Get array of field values for ith row of result set Implements rdbModel::ResultHandle. |
|
Get array of field values for ith row of result set Implements rdbModel::ResultHandle. 00024 { 00025 mysql_data_seek(m_myres, i); 00026 MYSQL_ROW myRow = mysql_fetch_row(m_myres); 00027 00028 unsigned nFields = mysql_num_fields(m_myres); 00029 00030 00031 if (clear) fields.clear(); 00032 00033 for (unsigned int iField = 0; iField < nFields; iField++) { 00034 if (myRow[iField]) fields.push_back(std::string(myRow[iField])); 00035 else fields.push_back(""); 00036 } 00037 00038 return true; 00039 }
|
|
Implements rdbModel::ResultHandle. |
|
Implements rdbModel::ResultHandle. 00063 { 00064 mysql_data_seek(m_myres, i); 00065 MYSQL_ROW myRow = mysql_fetch_row(m_myres); 00066 unsigned nFields = mysql_num_fields(m_myres); 00067 unsigned long* lengths; 00068 lengths = mysql_fetch_lengths(m_myres); 00069 00070 for (unsigned int iField = 0; iField <nFields; iField++) { 00071 if (myRow[iField]&&iField<(nFields-4)){ 00072 memcpy(par+1024000*iField,myRow[iField],lengths[iField]); 00073 treesize[iField] = lengths[iField]; 00074 } 00075 } 00076 00077 *runFrm =facilities::Util::stringToInt(myRow[nFields-4]); 00078 *runTo =facilities::Util::stringToInt(myRow[nFields-3]); 00079 std::cout<<" CalVerSft is "<<myRow[nFields-2]<<" File name is "<<myRow[nFields-1]<<std::endl; 00080 00081 return true; 00082 00083 }
|
|
Get array of field values for ith row of result set. If a field value is NULL, return a zero ptr for that element of the array. --> It is the responsibility of the caller to delete the strings containing the field values. See service cleanFieldPtrs in base class ResultHandle. Implements rdbModel::ResultHandle. |
|
Get array of field values for ith row of result set. If a field value is NULL, return a zero ptr for that element of the array. --> It is the responsibility of the caller to delete the strings containing the field values. See service cleanFieldPtrs in base class ResultHandle. Implements rdbModel::ResultHandle. 00042 { 00043 00044 mysql_data_seek(m_myres, i); 00045 MYSQL_ROW myRow = mysql_fetch_row(m_myres); 00046 00047 unsigned nFields = mysql_num_fields(m_myres); 00048 00049 00050 if (clear) fields.clear(); 00051 00052 for (unsigned int iField = 0; iField < nFields; iField++) { 00053 if (myRow[iField]) fields.push_back(new std::string(myRow[iField])); 00054 else fields.push_back(0); 00055 } 00056 00057 return true; 00058 00059 }
|
|
|
|
|
|
|