Removed the dependencies on utility.*pp

This commit is contained in:
Kayne Ruse
2015-01-17 21:46:12 +11:00
parent de6eb38516
commit 7356e8ae77
7 changed files with 18 additions and 95 deletions
+4 -4
View File
@@ -21,10 +21,9 @@
*/
#include "sql_tools.hpp"
#include "utility.hpp"
#include <stdexcept>
#include <fstream>
#include <sstream>
#include <cstdlib>
int runSQLScript(sqlite3* db, std::string fname, int (*callback)(void*,int,char**,char**), void* argPtr) {
@@ -42,9 +41,10 @@ int runSQLScript(sqlite3* db, std::string fname, int (*callback)(void*,int,char*
int ret = sqlite3_exec(db, script.c_str(), callback, argPtr, &errmsg);
if (ret != SQLITE_OK) {
//handle any errors received from the SQL
std::runtime_error e(std::string() + "SQL Script Error " + to_string_custom(ret) + ": " + errmsg);
std::ostringstream msg;
msg << "SQL Script Error " << ret << ": " << errmsg;
free(errmsg);
throw(e);
throw(std::runtime_error( msg.str() ));
}
return ret;
}