Loading src/database.h +10 −8 Original line number Diff line number Diff line Loading @@ -25,8 +25,10 @@ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. *******************************************************************************/ #include <algorithm> #include <cstring> #include <string> #include <vector> #pragma once Loading Loading @@ -65,9 +67,9 @@ namespace blogi { Data(int crow,int ccol,const char *value, int len){ row=crow; col=ccol; Column=new char[len+1]; memcpy(Column,value,len); Column[len]='\0'; std::copy(value,value+len, std::inserter<std::vector<char>>(Column,Column.begin())); Column.push_back('\0'); nextData=nullptr; } Loading @@ -76,7 +78,7 @@ namespace blogi { int row; int col; char *Column; std::vector<char> Column; Data *nextData; friend class DBResult; }; Loading @@ -95,7 +97,7 @@ namespace blogi { const char *operator[](int value2){ for(DBResult::Data *pos=result->firstRow; pos; pos=pos->nextData){ if( row==pos->row && pos->col==value2){ return pos->Column; return pos->Column.data(); } } return nullptr; Loading src/database/pgsql.cpp +1 −1 Original line number Diff line number Diff line Loading @@ -100,7 +100,7 @@ namespace blogi { } void reset() override{ PQreset(_dbconn); // PQresetStart(_dbconn); } private: Loading Loading
src/database.h +10 −8 Original line number Diff line number Diff line Loading @@ -25,8 +25,10 @@ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. *******************************************************************************/ #include <algorithm> #include <cstring> #include <string> #include <vector> #pragma once Loading Loading @@ -65,9 +67,9 @@ namespace blogi { Data(int crow,int ccol,const char *value, int len){ row=crow; col=ccol; Column=new char[len+1]; memcpy(Column,value,len); Column[len]='\0'; std::copy(value,value+len, std::inserter<std::vector<char>>(Column,Column.begin())); Column.push_back('\0'); nextData=nullptr; } Loading @@ -76,7 +78,7 @@ namespace blogi { int row; int col; char *Column; std::vector<char> Column; Data *nextData; friend class DBResult; }; Loading @@ -95,7 +97,7 @@ namespace blogi { const char *operator[](int value2){ for(DBResult::Data *pos=result->firstRow; pos; pos=pos->nextData){ if( row==pos->row && pos->col==value2){ return pos->Column; return pos->Column.data(); } } return nullptr; Loading
src/database/pgsql.cpp +1 −1 Original line number Diff line number Diff line Loading @@ -100,7 +100,7 @@ namespace blogi { } void reset() override{ PQreset(_dbconn); // PQresetStart(_dbconn); } private: Loading