[cig-commits] r11574 - cs/benchmark/cigma/trunk/src

luis at geodynamics.org luis at geodynamics.org
Wed Mar 26 08:02:30 PDT 2008


Author: luis
Date: 2008-03-26 08:02:30 -0700 (Wed, 26 Mar 2008)
New Revision: 11574

Modified:
   cs/benchmark/cigma/trunk/src/Writer.cpp
Log:
Use PathUtils.h in Writer.cpp


Modified: cs/benchmark/cigma/trunk/src/Writer.cpp
===================================================================
--- cs/benchmark/cigma/trunk/src/Writer.cpp	2008-03-26 15:02:27 UTC (rev 11573)
+++ cs/benchmark/cigma/trunk/src/Writer.cpp	2008-03-26 15:02:30 UTC (rev 11574)
@@ -6,28 +6,31 @@
 #include "HdfWriter.h"
 #include "TextWriter.h"
 #include "VtkWriter.h"
+#include "PathUtils.h"
 
-
 using namespace cigma;
 
-
 // ---------------------------------------------------------------------------
 
 Writer* NewWriter(const char *fileext)
 {
-    std::string ext = fileext;
+    // 
+    // XXX: This factory function also needs to accept a flag indicating
+    // whether we wish to overwrite the file if it exists. Thus, we need
+    // the full filename, not just the extension part.
+    //
 
-    if (ext == ".h5")
+    if (HdfExtension(fileext))
     {
         return new HdfWriter();
     }
 
-    if (ext == ".txt")
+    if (TextExtension(fileext))
     {
         return new TextWriter();
     }
 
-    if (ext == ".vtk")
+    if (VtkExtension(fileext))
     {
         return new VtkWriter();
     }
@@ -37,11 +40,11 @@
 
 // ---------------------------------------------------------------------------
 
-cigma::Writer::Writer()
+Writer::Writer()
 {
 }
 
-cigma::Writer::~Writer()
+Writer::~Writer()
 {
 }
 



More information about the cig-commits mailing list