17 #ifndef REMWHAREAD_SQLITE_HPP 18 #define REMWHAREAD_SQLITE_HPP 20 #include <Poco/Data/Session.h> 22 #include <experimental/filesystem> 30 namespace fs = std::experimental::filesystem;
33 using std::chrono::system_clock;
34 using time_point = system_clock::time_point;
36 using Poco::Data::Session;
94 explicit operator bool()
const;
109 list<entry>
retrieve(
const time_point &start = time_point(),
110 const time_point &end = system_clock::now())
const;
119 size_t remove(
const string &uri);
131 std::unique_ptr<Session> _session;
135 fs::path get_data_home()
const;
139 #endif // REMWHAREAD_SQLITE_HPP list< entry > retrieve(const time_point &start=time_point(), const time_point &end=system_clock::now()) const
Retrieve a list of Database::entry from the database.
Definition: sqlite.cpp:104
string fulltext_oneline() const
The full text in one line.
Definition: sqlite.cpp:71
Store and retrieve files from/to SQLite.
Definition: sqlite.hpp:45
void store(const entry &data) const
Store a Database::entry in the database.
Definition: sqlite.cpp:82
Describes a database entry.
Definition: sqlite.hpp:55
friend bool operator==(const Database::entry &a, const Database::entry &b)
Returns true if date and time are equal.
Definition: sqlite.cpp:66
Database()
Connects to the database and creates it if necessary.
Definition: sqlite.cpp:35
static string tags_to_string(const vector< string > &tags)
Returns tags as comma separated string.
Definition: sqlite.cpp:169
size_t remove(const string &uri)
Remove all entries with this URI from database.
Definition: sqlite.cpp:160