changeset 591:7065e921f122

* add reviewFileForAppend callback
author Chris Cannam
date Thu, 14 May 2009 15:48:07 +0000
parents 063da8955f65
children 18488253a3f4
files transform/FileFeatureWriter.cpp transform/FileFeatureWriter.h
diffstat 2 files changed, 8 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/transform/FileFeatureWriter.cpp	Thu May 14 15:47:16 2009 +0000
+++ b/transform/FileFeatureWriter.cpp	Thu May 14 15:48:07 2009 +0000
@@ -231,6 +231,11 @@
         cerr << "FileFeatureWriter: NOTE: Using output filename \""
              << filename.toStdString() << "\"" << endl;
 
+        if (m_append) {
+            cerr << "FileFeatureWriter: NOTE: Calling reviewFileForAppending" << endl;
+            reviewFileForAppending(filename);
+        }
+        
         QFile *file = new QFile(filename);
         QIODevice::OpenMode mode = (QIODevice::WriteOnly);
         if (m_append) mode |= QIODevice::Append;
--- a/transform/FileFeatureWriter.h	Thu May 14 15:47:16 2009 +0000
+++ b/transform/FileFeatureWriter.h	Thu May 14 15:48:07 2009 +0000
@@ -64,6 +64,9 @@
 
     QString getOutputFilename(QString, TransformId);
     QFile *getOutputFile(QString, TransformId);
+    
+    // subclass can implement this to be called before file is opened for append
+    virtual void reviewFileForAppending(QString filename) { }
 
     int m_support;
     QString m_extension;