summaryrefslogtreecommitdiff
path: root/src/lib/cinema_list.h
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2025-01-19 00:21:11 +0100
committerCarl Hetherington <cth@carlh.net>2025-01-22 14:34:25 +0100
commit16b3f6c6245acf9689349dbd2af7d4411f861767 (patch)
tree14bedff2389bf48c643e1a7d34c82d8265251801 /src/lib/cinema_list.h
parent9964a038c1a1ed86510439a33b7022807af31d8d (diff)
Move sqlite database open/close to a new SQLiteDatabase.
Diffstat (limited to 'src/lib/cinema_list.h')
-rw-r--r--src/lib/cinema_list.h9
1 files changed, 3 insertions, 6 deletions
diff --git a/src/lib/cinema_list.h b/src/lib/cinema_list.h
index 1e0144f73..40e32410f 100644
--- a/src/lib/cinema_list.h
+++ b/src/lib/cinema_list.h
@@ -24,6 +24,7 @@
#include "id.h"
+#include "sqlite_database.h"
#include "sqlite_table.h"
#include <libcxml/cxml.h>
#include <dcp/utc_offset.h>
@@ -77,14 +78,10 @@ class CinemaList
public:
CinemaList();
CinemaList(boost::filesystem::path db_file);
- ~CinemaList();
CinemaList(CinemaList const&) = delete;
CinemaList& operator=(CinemaList const&) = delete;
- CinemaList(CinemaList&& other);
- CinemaList& operator=(CinemaList&& other);
-
void read_legacy_file(boost::filesystem::path xml_file);
void read_legacy_string(std::string const& xml);
@@ -117,13 +114,13 @@ private:
dcpomatic::Screen screen_from_result(SQLiteStatement& statement, ScreenID screen_id, bool with_trusted_devices) const;
std::vector<std::pair<ScreenID, dcpomatic::Screen>> screens_from_result(SQLiteStatement& statement) const;
void setup_tables();
- void setup(boost::filesystem::path db_file);
+ void setup();
void read_legacy_document(cxml::Document const& doc);
- sqlite3* _db = nullptr;
SQLiteTable _cinemas;
SQLiteTable _screens;
SQLiteTable _trusted_devices;
+ mutable SQLiteDatabase _db;
};