summaryrefslogtreecommitdiff
path: root/src/database/database.hpp
diff options
context:
space:
mode:
authorJonas Smedegaard <dr@jones.dk>2016-12-21 21:25:09 +0100
committerJonas Smedegaard <dr@jones.dk>2016-12-21 21:25:09 +0100
commitf820d86aadb7a5473bcc0a0a3669732ab0182555 (patch)
treea6a673c444ea3df75fe0a5d53e905030c2f617ce /src/database/database.hpp
parenteda4b75b1cff83336e87da90efca9fd6b4ced2c7 (diff)
parent9634cdaba2e5d2343fcbc1f07264d55609640273 (diff)
downloadbiboumi-9ecc1a5683ed74151dbfb6f3aa2b1a2787148d8a.tar.gz
biboumi-9ecc1a5683ed74151dbfb6f3aa2b1a2787148d8a.tar.bz2
biboumi-9ecc1a5683ed74151dbfb6f3aa2b1a2787148d8a.tar.xz
biboumi-9ecc1a5683ed74151dbfb6f3aa2b1a2787148d8a.zip
New upstream version 4.0upstream/4.0
Diffstat (limited to 'src/database/database.hpp')
-rw-r--r--src/database/database.hpp13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/database/database.hpp b/src/database/database.hpp
index 7173bcd..6823574 100644
--- a/src/database/database.hpp
+++ b/src/database/database.hpp
@@ -9,10 +9,14 @@
#include <memory>
#include <litesql.hpp>
+#include <chrono>
+
+class Iid;
class Database
{
public:
+ using time_point = std::chrono::system_clock::time_point;
Database() = default;
~Database() = default;
@@ -32,6 +36,7 @@ public:
* Return the object from the db. Create it beforehand (with all default
* values) if it is not already present.
*/
+ static db::GlobalOptions get_global_options(const std::string& owner);
static db::IrcServerOptions get_irc_server_options(const std::string& owner,
const std::string& server);
static db::IrcChannelOptions get_irc_channel_options(const std::string& owner,
@@ -40,12 +45,20 @@ public:
static db::IrcChannelOptions get_irc_channel_options_with_server_default(const std::string& owner,
const std::string& server,
const std::string& channel);
+ static db::IrcChannelOptions get_irc_channel_options_with_server_and_global_default(const std::string& owner,
+ const std::string& server,
+ const std::string& channel);
+ static std::vector<db::MucLogLine> get_muc_logs(const std::string& owner, const std::string& chan_name, const std::string& server,
+ int limit=-1, const std::string& before="", const std::string& after="");
+ static void store_muc_message(const std::string& owner, const Iid& iid,
+ time_point date, const std::string& body, const std::string& nick);
static void close();
static void open(const std::string& filename, const std::string& db_type="sqlite3");
private:
+ static std::string gen_uuid();
static std::unique_ptr<db::BibouDB> db;
};
#endif /* USE_DATABASE */