about summary refs log tree commit diff stats
path: root/src
diff options
context:
space:
mode:
authorComradeCrow <comradecrow@vivaldi.net>2023-05-08 18:54:03 -0700
committerComradeCrow <comradecrow@vivaldi.net>2023-05-08 18:54:03 -0700
commit0638f3cc60d5e76b3f562aa54258bbc8641af141 (patch)
treedc4f24acaec72fb434d13b4129d20ef62057051e /src
parentc327cba245ed3cae7b73f172c3c6ba6e6778c848 (diff)
downloadytcpp-0638f3cc60d5e76b3f562aa54258bbc8641af141.tar.gz
start work on sqlite
Diffstat (limited to 'src')
-rw-r--r--src/sqliteinterface.cpp9
-rw-r--r--src/sqliteinterface.hpp1
2 files changed, 10 insertions, 0 deletions
diff --git a/src/sqliteinterface.cpp b/src/sqliteinterface.cpp
index 87cb854..ec1a978 100644
--- a/src/sqliteinterface.cpp
+++ b/src/sqliteinterface.cpp
@@ -3,7 +3,9 @@
 #include <cstring>
 #include <filesystem>
 #include <stdexcept>
+
 #include "sqliteinterface.hpp"
+#include "video.hpp"
 
 namespace fs = std::filesystem;
 using namespace std;
@@ -27,6 +29,7 @@ void SqliteInterface::openDB()
     }
 
     fs::path filename = appdata / "ytcpp.db";
+    cout << filename.c_str() << endl;
     int rc = sqlite3_open(filename.c_str(), &db);
 
     if (rc)
@@ -42,6 +45,7 @@ void SqliteInterface::closeDB()
 {
 
     sqlite3_close(db);
+    db = nullptr;
 }
 
 static int callback(void *NotUsed, int argc, char **argv, char **azColName) {
@@ -67,6 +71,11 @@ void SqliteInterface::createTables()
 
 }
 
+void SqliteInterface::saveVideo() {
+
+
+}
+
 SqliteInterface::SqliteInterface()
 {
 
diff --git a/src/sqliteinterface.hpp b/src/sqliteinterface.hpp
index 5be355e..617ebd3 100644
--- a/src/sqliteinterface.hpp
+++ b/src/sqliteinterface.hpp
@@ -10,6 +10,7 @@ class SqliteInterface {
         void openDB();
         void closeDB();
         void createTables();
+        void saveVideo();
     private:
         sqlite3* db;
 };