diff FileDBLink.hpp @ 92:f49023c61dac

Support for bulk insertion.
author Tom Fredrik Blenning Klaussen <bfg@bfgconsult.no>
date Mon, 21 Oct 2013 20:03:39 +0200
parents af7962f3274b
children 308a718812ba
line wrap: on
line diff
--- a/FileDBLink.hpp	Mon Oct 21 16:21:54 2013 +0200
+++ b/FileDBLink.hpp	Mon Oct 21 20:03:39 2013 +0200
@@ -111,12 +111,13 @@
 public:
   enum DBStatus { NONE = 0, MTIME_DIFFERENT, SAME};
 
-  virtual ~FileDBLink() {}
+  virtual ~FileDBLink();
 
   void updateIfModified(const QString& path, bool lazy = false);
 
   virtual void addFile(const QString& path, quint64 size,
-		       const QDateTime& dtime, const QByteArray& hash) = 0;
+		       const QDateTime& dtime, const QByteArray& hash,
+		       bool lazy) = 0;
   virtual void keepOnlyFromPrefix(const QString& prefix,
 				  const QStringList& files) = 0;
   virtual void deleteFileFromDB(const QString& path) = 0;
@@ -131,7 +132,8 @@
   void addFile(const QFileInfo& fileinfo, bool lazy = false);
 
   virtual void updateFile(const QString& path, quint64 size,
-			  const QDateTime& dtime, const QByteArray& hash) = 0;
+			  const QDateTime& dtime, const QByteArray& hash,
+			  bool lazy = false) = 0;
   void updateFile(const QString& path, quint64 size, const QDateTime& dtime, bool lazy = false);
   void updateFile(const QFileInfo& fileinfo, bool lazy = false);
 
@@ -139,6 +141,7 @@
   virtual DBStatus existsWithMtime(const QString& path,
 				   const QDateTime& mtime) = 0;
 
+  virtual bool commit();
   virtual const QList<dbinf_ptr_t>
   values(const QString& prefix = QString() ) const = 0;