]> Creatis software - clitk.git/blob - tests_dav/clitkMergeRootFiles.cxx
b4b6721fdc7da90b3e0fe2248b21d5ca3aad57d1
[clitk.git] / tests_dav / clitkMergeRootFiles.cxx
1 /**
2    =================================================
3    * @file   clitkMergeRootFiles.cxx
4    * @author David Sarrut <david.sarrut@creatis.insa-lyon.fr>
5    * @date   01 Apr 2009
6    * 
7    * @brief  
8    * 
9    =================================================*/
10
11 #include "clitkMergeRootFiles_ggo.h"
12 #include "clitkCommon.h"
13 #include <string> 
14 #include "TROOT.h"
15 #include "TFile.h"
16 #include "TFileMerger.h"
17
18 //-----------------------------------------------------------------------------
19 int main(int argc, char * argv[]) {
20
21   // init command line
22   GGO(clitkMergeRootFiles, args_info);
23
24   // Check parameters
25   if (args_info.input_given < 2) {
26     FATAL("Error, please provide at least two inputs files");
27   }
28
29   // Merge
30   TFileMerger * merger = new TFileMerger;
31   for (uint i=0; i<args_info.input_given; i++) merger->AddFile(args_info.input_arg[i]);
32   merger->OutputFile(args_info.output_arg);
33   merger->Merge();
34
35   // this is the end my friend  
36   return 0;
37 }
38 //-----------------------------------------------------------------------------