summaryrefslogtreecommitdiffabout
path: root/src/iiidb.h
authorMichael Krelin <hacker@klever.net>2013-01-29 18:28:58 (UTC)
committer Michael Krelin <hacker@klever.net>2013-02-02 12:42:52 (UTC)
commit8cef826610f171b25a7a4aa3a764b1fb04c24d2f (patch) (unidiff)
tree0f4cd74156e998931955c9117fb263a37ba1f98c /src/iiidb.h
parent7e4f9ebf4a76de3adafba6b32620d4610341897b (diff)
downloadiii-8cef826610f171b25a7a4aa3a764b1fb04c24d2f.zip
iii-8cef826610f171b25a7a4aa3a764b1fb04c24d2f.tar.gz
iii-8cef826610f171b25a7a4aa3a764b1fb04c24d2f.tar.bz2
added persistent store for photo status
Signed-off-by: Michael Krelin <hacker@klever.net>
Diffstat (limited to 'src/iiidb.h') (more/less context) (ignore whitespace changes)
-rw-r--r--src/iiidb.h28
1 files changed, 28 insertions, 0 deletions
diff --git a/src/iiidb.h b/src/iiidb.h
new file mode 100644
index 0000000..e77fa09
--- a/dev/null
+++ b/src/iiidb.h
@@ -0,0 +1,28 @@
1#ifndef __IIIDB_H
2#define __IIIDB_H
3
4#include <autosprintf.h>
5#include "seclude.h"
6#include "eyekinfig.h"
7
8struct iiidb_t : public seclude::db_t {
9 iiidb_t(eyekinfig_t& k) : seclude::db_t(gnu::autosprintf("%s/.iii.db",k.get_targetdir().c_str())) {
10 try {
11 exec("SELECT 1 FROM photo LIMIT 0");
12 }catch(const seclude::sqlite3_error& e) {
13 exec( "CREATE TABLE photo ("
14 " id integer PRIMARY KEY AUTOINCREMENT,"
15 " ctime integer NOT NULL,"
16 " mac text NOT NULL,"
17 " fileid integer NOT NULL,"
18 " filename text NOT NULL,"
19 " filesize integer NOT NULL,"
20 " filesignature text NOT NULL UNIQUE,"
21 " encryption text NOT NULL,"
22 " flags integer NOT NULL"
23 ")" );
24 }
25 }
26};
27
28#endif /* __IIIDB_H */