[Gcblue-commits] gcb_wx/src/sqlite sqlite3x_reader.cpp,1.2,1.3
Status: Alpha
Brought to you by:
ddcforge
From: Dewitt C. <ddc...@us...> - 2006-08-17 01:28:08
|
Update of /cvsroot/gcblue/gcb_wx/src/sqlite In directory sc8-pr-cvs2.sourceforge.net:/tmp/cvs-serv21820/src/sqlite Modified Files: sqlite3x_reader.cpp Log Message: Update for server name change Index: sqlite3x_reader.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/sqlite/sqlite3x_reader.cpp,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** sqlite3x_reader.cpp 23 Mar 2006 01:11:02 -0000 1.2 --- sqlite3x_reader.cpp 17 Aug 2006 01:28:05 -0000 1.3 *************** *** 55,58 **** --- 55,60 ---- if(!this->cmd) throw database_error("reader is closed"); + isStringError = false; // modified code DDC, reset string error after each call read() + switch(sqlite3_step(this->cmd->stmt)) { case SQLITE_ROW: *************** *** 109,113 **** if(!this->cmd) throw database_error("reader is closed"); if((index)>(this->cmd->argc-1)) throw std::out_of_range("index out of range"); ! const char* s = (const char*)sqlite3_column_text(this->cmd->stmt, index); //, sqlite3_column_bytes(this->cmd->stmt, index)); if (s != 0) --- 111,115 ---- if(!this->cmd) throw database_error("reader is closed"); if((index)>(this->cmd->argc-1)) throw std::out_of_range("index out of range"); ! const char* s = (const char*)sqlite3_column_text(this->cmd->stmt, index); //, sqlite3_column_bytes(this->cmd->stmt, index)); if (s != 0) *************** *** 115,125 **** return std::string(s); } ! else { ! fprintf(stderr, "(Known bug)sqlite3_reader::getstring -- Bad column index (%d)\n", index); return std::string(""); } } std::wstring sqlite3_reader::getstring16(int index) { if(!this->cmd) throw database_error("reader is closed"); --- 117,138 ---- return std::string(s); } ! else // modified code DDC { ! #ifdef _DEBUG ! isStringError = true; ! fprintf(stderr, "sqlite3_reader::getstring -- Null string for column index (%d). Should be benign\n", index); ! #endif return std::string(""); } } + /** + * New code DDC + */ + bool sqlite3_reader::getStringError() const + { + return isStringError; + } + std::wstring sqlite3_reader::getstring16(int index) { if(!this->cmd) throw database_error("reader is closed"); |