#ifndef INBOX_H #define INBOX_H /** * (C) 2018 Jordan Sherer - All Rights Reserved **/ #include #include #include #include #include "vendor/sqlite3/sqlite3.h" #include "Message.h" class Inbox { public: explicit Inbox(QString path); ~Inbox(); // Low-Level Interface bool isOpen(); bool open(); void close(); QString error(); int count(QString type, QString query, QString match); QList> values(QString type, QString query, QString match, int offset, int limit); Message value(int key); int append(Message value); bool set(int key, Message value); bool del(int key); // High-Level Interface int countUnreadFrom(QString from); QPair firstUnreadFrom(QString from); signals: public slots: private: QString path_; sqlite3 * db_; }; #endif // INBOX_H