about summary refs log tree commit diff stats
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
parentc327cba245ed3cae7b73f172c3c6ba6e6778c848 (diff)
downloadytcpp-0638f3cc60d5e76b3f562aa54258bbc8641af141.tar.gz
start work on sqlite
-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;
 };
82974bf046a94b4a52df6e8b3b3649a5bb85d6'>^
9d53072 ^













63bfecd ^

44803a8 ^
63bfecd ^

9d53072 ^







87d0da3 ^
9d53072 ^

87d0da3 ^
63bfecd ^
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74