diff Core/SQLite/Statement.cpp @ 1221:2255e66da726

getting rid of the dependency against Boost in the SQLite C++ wrapper
author Sebastien Jodogne <s.jodogne@gmail.com>
date Mon, 10 Nov 2014 17:05:50 +0100
parents 9b9026560a5f
children 410c27e04a23
line wrap: on
line diff
--- a/Core/SQLite/Statement.cpp	Mon Nov 10 16:33:51 2014 +0100
+++ b/Core/SQLite/Statement.cpp	Mon Nov 10 17:05:50 2014 +0100
@@ -43,9 +43,10 @@
 #include "Statement.h"
 #include "Connection.h"
 
-#include <boost/lexical_cast.hpp>
 #include <sqlite3.h>
 #include <string.h>
+#include <stdio.h>
+#include <algorithm>
 
 namespace Orthanc
 {
@@ -56,7 +57,9 @@
       bool succeeded = (err == SQLITE_OK || err == SQLITE_ROW || err == SQLITE_DONE);
       if (!succeeded)
       {
-        throw OrthancSQLiteException("SQLite error code " + boost::lexical_cast<std::string>(err));
+        char buffer[128];
+        snprintf(buffer, sizeof(buffer) - 1, "SQLite error code %d", err);
+        throw OrthancSQLiteException(buffer);
       }
 
       return err;
@@ -71,7 +74,9 @@
       }
       else if (err != SQLITE_OK)
       {
-        throw OrthancSQLiteException("SQLite error code " + boost::lexical_cast<std::string>(err));
+        char buffer[128];
+        snprintf(buffer, sizeof(buffer) - 1, "SQLite error code %d", err);
+        throw OrthancSQLiteException(buffer);
       }
     }