mirror of
https://github.com/XRPLF/rippled.git
synced 2025-11-29 23:45:51 +00:00
.
This commit is contained in:
@@ -70,7 +70,13 @@ int SqliteDatabase::getLastInsertID()
|
||||
// returns false if there are no results
|
||||
bool SqliteDatabase::startIterRows()
|
||||
{
|
||||
needs to fill out the column table
|
||||
mColNameTable.clear();
|
||||
mColNameTable.resize(sqlite3_column_count(mCurrentStmt));
|
||||
for(unsigned n=0; n<mColNameTable.size(); n++)
|
||||
{
|
||||
mColNameTable[n]=sqlite3_column_name(mCurrentStmt,n);
|
||||
}
|
||||
|
||||
return(mMoreRows);
|
||||
}
|
||||
|
||||
|
||||
@@ -7,14 +7,10 @@ Database::Database(const char* host,const char* user,const char* pass) : mNumCol
|
||||
mDBPass=pass;
|
||||
mHost=host;
|
||||
mUser=user;
|
||||
|
||||
mColNameTable=NULL;
|
||||
}
|
||||
|
||||
Database::~Database()
|
||||
{
|
||||
delete[] mColNameTable;
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -83,7 +79,7 @@ uint64 Database::getBigInt(const char* colName)
|
||||
// returns false if can't find col
|
||||
bool Database::getColNumber(const char* colName,int* retIndex)
|
||||
{
|
||||
for(int n=0; n<mNumCol; n++)
|
||||
for(unsigned int n=0; n<mColNameTable.size(); n++)
|
||||
{
|
||||
if(stricmp(colName,mColNameTable[n].c_str())==0)
|
||||
{
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
#define __DATABASE__
|
||||
|
||||
#include <string>
|
||||
#include <vector>
|
||||
#include "../types.h"
|
||||
|
||||
/*
|
||||
@@ -14,7 +15,7 @@ protected:
|
||||
std::string mUser;
|
||||
std::string mHost;
|
||||
std::string mDBPass;
|
||||
std::string* mColNameTable;
|
||||
std::vector<std::string> mColNameTable;
|
||||
|
||||
bool getColNumber(const char* colName, int* retIndex);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user