[Kst] extragear/graphics/kst/src/libkst

Eli Fidler eli at staikos.net
Wed Jan 17 00:15:47 CET 2007


SVN commit 624295 by fidler:

added writeField() to KstDataSource


 M  +12 -0     kstdatasource.cpp  
 M  +13 -0     kstdatasource.h  


--- trunk/extragear/graphics/kst/src/libkst/kstdatasource.cpp #624294:624295
@@ -413,6 +413,7 @@
   Q_UNUSED(type)
   _valid = false;
   _reusable = true;
+  _writable = false;
 
   QString shortFilename = filename;
   while (shortFilename.at(shortFilename.length() - 1) == '/') {
@@ -494,7 +495,18 @@
   return -1;
 }
 
+bool KstDataSource::isWritable() const {
+  return _writable;
+}
 
+int KstDataSource::writeField(const double *v, const QString& field, int s, int n) {
+  Q_UNUSED(v)
+  Q_UNUSED(field)
+  Q_UNUSED(s)
+  Q_UNUSED(n)
+  return -1;
+}
+
 int KstDataSource::readMatrix(KstMatrixData* data, const QString& matrix, int xStart, int yStart, int xNumSteps, int yNumSteps, int skip) {
   Q_UNUSED(data)
   Q_UNUSED(matrix)
--- trunk/extragear/graphics/kst/src/libkst/kstdatasource.h #624294:624295
@@ -104,6 +104,17 @@
       double Array v[].  Will skip according to the parameter, but it may not
       be implemented.  If it returns -9999, use the non-skip version instead. */
     virtual int readField(double *v, const QString& field, int s, int n, int skip, int *lastFrameRead = 0L);
+
+    virtual bool isWritable() const;
+
+    /** Write a field to the file.
+     * Data is in the double Array v[]
+     * s is the starting frame
+     * n is the number of frames to write
+     *
+     * return the number of -samples- written or -1 if writing fails or is not supported.
+     */
+    virtual int writeField(const double *v, const QString& field, int s, int n);
     
     /** Read the specified sub-range of the matrix, flat-packed in z in row-major order
         xStart - starting x *frame*
@@ -207,6 +218,8 @@
 
     bool _reusable;
 
+    bool _writable;
+
     /** Place to store the list of fields.  Base implementation returns this. */
     QStringList _fieldList;
     


More information about the Kst mailing list