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
+1 -2
View File
@@ -23,7 +23,6 @@
//utility functions
#include "sql_tools.hpp"
#include "utility.hpp"
//std & STL
#include <stdexcept>
@@ -307,7 +306,7 @@ void ServerApplication::HandlePacket(SerialPacket* const argPacket) {
default: {
std::ostringstream msg;
msg << "Unknown SerialPacketType encountered in the server: ";
msg << to_string_custom(static_cast<int>(argPacket->type));
msg << static_cast<int>(argPacket->type);
throw(std::runtime_error(msg.str()));
}
break;
+1 -1
View File
@@ -1,5 +1,5 @@
#config
INCLUDES+=. ../../common/utilities
INCLUDES+=.
LIBS+=
CXXFLAGS+=-std=c++11 $(addprefix -I,$(INCLUDES))
+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;
}