commit 258a530e943c0caa92ce6e536f62f44b7e46a07d
Author: David Sorber <david.sorber@gmail.com>
Date:   Tue Jan 24 11:11:16 2017 -0500

    Adding a boolean helper function to my proof-of-concept.

diff --git a/software/sqlite_poc/DBManager.cc b/software/sqlite_poc/DBManager.cc
index 86da533..a24c8e8 100644
--- a/software/sqlite_poc/DBManager.cc
+++ b/software/sqlite_poc/DBManager.cc
@@ -9,7 +9,7 @@ void get_value(int64_t& val, int idx, sqlite3_stmt* stmt)
     {
         assert(false);
     }
-
+    
     val = sqlite3_column_int64(stmt, idx);
 }
 
@@ -18,10 +18,10 @@ void get_value(double& val, int idx, sqlite3_stmt* stmt)
 {
     if (sqlite3_column_type(stmt, idx) != SQLITE_FLOAT)
     {
-        assert(false);
+        assert(false);        
     }
-
-    val = sqlite3_column_double(stmt, idx);
+    
+    val = sqlite3_column_double(stmt, idx); 
 }
 
 // Helper function for string type
@@ -41,9 +41,26 @@ void get_value(std::string& val, int idx, sqlite3_stmt* stmt)
     }
 }
 
-DBManager::DBManager(const std::string& db_path)
+// Helper function for bool type
+void get_value(bool& val, int idx, sqlite3_stmt* stmt)
 {
+    if (sqlite3_column_type(stmt, idx) == SQLITE_INTEGER)
+    {
+        val = (sqlite3_column_int(stmt, idx) == 1 ? true : false);
+    }
+    else if (sqlite3_column_type(stmt, idx) == SQLITE_NULL)
+    {
+        val = false;
+    }
+    else
+    {
+        assert(false);
+    }
+}
 
+DBManager::DBManager(const std::string& db_path)
+{
+    
     int rc = sqlite3_open(db_path.c_str(), &this->db);
     if (rc)
     {
diff --git a/software/sqlite_poc/DBManager.h b/software/sqlite_poc/DBManager.h
index 1649bb9..e9be1a2 100644
--- a/software/sqlite_poc/DBManager.h
+++ b/software/sqlite_poc/DBManager.h
@@ -10,6 +10,7 @@
 void get_value(int64_t& val, int idx, sqlite3_stmt* stmt);
 void get_value(double& val, int idx, sqlite3_stmt* stmt);
 void get_value(std::string& val, int idx, sqlite3_stmt* stmt);
+void get_value(bool& val, int idx, sqlite3_stmt* stmt);
 
 template<size_t I>
 struct builder_impl
