]> git.cworth.org Git - notmuch/blobdiff - lib/lastmod-fp.cc
lib: add field processor for lastmod: prefix
[notmuch] / lib / lastmod-fp.cc
index 5fdaf281ece558aa7c5f381df2cc59c973f2998b..f85efd283e5c25b4a2dd62065115005606273f95 100644 (file)
@@ -21,6 +21,7 @@
  */
 
 #include "database-private.h"
+#include "lastmod-fp.h"
 
 notmuch_status_t
 _notmuch_lastmod_strings_to_query (notmuch_database_t *notmuch,
@@ -66,3 +67,17 @@ _notmuch_lastmod_strings_to_query (notmuch_database_t *notmuch,
                            Xapian::sortable_serialise (to_idx));
     return NOTMUCH_STATUS_SUCCESS;
 }
+
+Xapian::Query
+LastModRangeProcessor::operator() (const std::string &begin, const std::string &end)
+{
+
+    Xapian::Query output;
+    std::string msg;
+
+    if (_notmuch_lastmod_strings_to_query (notmuch, begin, end, output, msg))
+       throw Xapian::QueryParserError (msg);
+
+    return output;
+}
+