]> Creatis software - clitk.git/commitdiff
merger works when files are ordered
authorPierre Gueth <pierre.gueth@creatis.insa-lyon.fr>
Thu, 7 Feb 2013 14:35:00 +0000 (15:35 +0100)
committerDavid Sarrut <david.sarrut@creatis.insa-lyon.fr>
Fri, 26 Jul 2013 06:44:00 +0000 (08:44 +0200)
tests_dav/GateMergeManager.cc
tests_dav/GateMergeManager.hh

index dc190fc367143fe5a42e2e9d4cdeb55b34243f62..5c5a12c9f417b1969de33f4f1ef5e093d5d231dc 100644 (file)
@@ -29,6 +29,7 @@ See GATE/LICENSE.txt for further details
 #include <vector>
 #include <cstdlib>
 #include <cmath>
+#include <list>
 
 #include "GateMergeManager.hh"
 
@@ -50,6 +51,22 @@ void GateMergeManager::StartMerging(string splitfileName){
   //if(res) cout<<"Strange?? Can't mark "<<dir<<" as done!"<<endl;
 };
 
+void GateMergeManager::StartMergingFromFilenames(Strings filenames, string outputfile)
+{
+       for (Strings::const_iterator iter=filenames.begin(); iter!=filenames.end(); iter++)
+       {
+               m_vRootFileNames.push_back(*iter);
+               if(m_verboseLevel>2) cout<<"Root input file name: "<<m_vRootFileNames.back()<<endl;
+       }
+
+       m_Nfiles = m_vRootFileNames.size();
+       m_RootTargetName=m_outDir+outputfile;
+       if(m_verboseLevel>2) cout<<"Root output file name: "<<m_RootTargetName<<endl;
+
+       if (m_fastMerge==true) FastMergeRoot();
+       else MergeRoot();
+};
+
 // to process the splitfile
 void GateMergeManager::ReadSplitFile(string splitfileName){
 
index 737be32bebcd0620ebf5410f4900a0a66e06671e..126dea3983d4c3f6bdd00aaccb84132a5e7c79cd 100644 (file)
@@ -17,8 +17,10 @@ See GATE/LICENSE.txt for further details
 #include <TFile.h>
 #include <TChain.h>
 #include <cstdlib>
+#include <list>
 
 using namespace std;
+typedef list<string> Strings;
 
 class GateMergeManager
 {
@@ -43,6 +45,7 @@ public:
 
 
   void StartMerging(string splitfileName);
+  void StartMergingFromFilenames(Strings filenames, string outputfile);
   void ReadSplitFile(string splitfileName);
   bool MergeTree(string name);
   bool MergeGate(TChain* chain);