summaryrefslogtreecommitdiff
path: root/src/lib/dkdm_recipient_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/dkdm_recipient_list.h
parent9964a038c1a1ed86510439a33b7022807af31d8d (diff)
Move sqlite database open/close to a new SQLiteDatabase.
Diffstat (limited to 'src/lib/dkdm_recipient_list.h')
-rw-r--r--src/lib/dkdm_recipient_list.h9
1 files changed, 3 insertions, 6 deletions
diff --git a/src/lib/dkdm_recipient_list.h b/src/lib/dkdm_recipient_list.h
index fc4d84b60..3847239b5 100644
--- a/src/lib/dkdm_recipient_list.h
+++ b/src/lib/dkdm_recipient_list.h
@@ -24,6 +24,7 @@
#include "id.h"
+#include "sqlite_database.h"
#include "sqlite_table.h"
#include <libcxml/cxml.h>
#include <boost/filesystem.hpp>
@@ -58,14 +59,10 @@ class DKDMRecipientList
public:
DKDMRecipientList();
DKDMRecipientList(boost::filesystem::path db_file);
- ~DKDMRecipientList();
DKDMRecipientList(DKDMRecipientList const&) = delete;
DKDMRecipientList& operator=(DKDMRecipientList const&) = delete;
- DKDMRecipientList(DKDMRecipientList&& other);
- DKDMRecipientList& operator=(DKDMRecipientList&& other);
-
void read_legacy_file(boost::filesystem::path xml_file);
void read_legacy_string(std::string const& xml);
@@ -78,11 +75,11 @@ public:
boost::optional<DKDMRecipient> dkdm_recipient(DKDMRecipientID id) const;
private:
- void setup(boost::filesystem::path db_file);
+ void setup();
void read_legacy_document(cxml::Document const& doc);
- sqlite3* _db = nullptr;
SQLiteTable _dkdm_recipients;
+ mutable SQLiteDatabase _db;
};