]> Creatis software - bbtk.git/blob
Merge branch 'master' of ssh://git.creatis.insa-lyon.fr/bbtk
[bbtk.git] /
1 //===== 
2 // Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost)
3 //===== 
4 #include "bbstdWriteColumnsString.h"
5 #include "bbstdPackage.h"
6 namespace bbstd
7 {
8
9 BBTK_ADD_BLACK_BOX_TO_PACKAGE(std,WriteColumnsString)
10 BBTK_BLACK_BOX_IMPLEMENTATION(WriteColumnsString,bbtk::AtomicBlackBox);
11 //===== 
12 // Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost)
13 //===== 
14 void WriteColumnsString::Process()
15 {
16
17         std::cout << "MLER WriteColumnsString::Process Start " << std::endl;
18         
19         std::ofstream write_fi;
20         write_fi.open(bbGetInputFileName().c_str());
21         //std::cout<<"write_fi "<<bbGetInputFileName().c_str()<<std::endl;
22         std::vector<std::string> headers = bbGetInputHeaders();
23
24         int i,j,k;
25
26         if(write_fi.is_open())
27         {
28                 for(i=0 ;i< headers.size(); i++ )
29                 {
30                         write_fi << headers[i] << "\t";
31                 }//for headersSize
32
33                 for(j=0; j< bbGetInputlstData1().size();j++)
34                 {
35                         write_fi << bbGetInputlstData1()[j] << "\n";
36                 }
37
38                 std::cout<<"size Header"<<headers.size()<<std::endl;
39                 
40
41         }// if write_fi.is_open()
42         else
43         {
44                 std::cout<<"No es posible abrir"<<std::endl;
45         }//else
46
47         write_fi.close();
48
49         bbSetOutputOutFileName("Prueba.txt");
50
51         std::cout << "MLER WriteColumnsString::End Process " << std::endl;
52   
53 }
54 //===== 
55 // Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost)
56 //===== 
57 void WriteColumnsString::bbUserSetDefaultValues()
58 {
59
60 //  SET HERE THE DEFAULT INPUT/OUTPUT VALUES OF YOUR BOX 
61 //    Here we initialize the input 'In' to 0
62    bbSetInputFileName("");      
63   
64 }
65 //===== 
66 // Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost)
67 //===== 
68 void WriteColumnsString::bbUserInitializeProcessing()
69 {
70
71 //  THE INITIALIZATION METHOD BODY :
72 //    Here does nothing 
73 //    but this is where you should allocate the internal/output pointers 
74 //    if any 
75
76   
77 }
78 //===== 
79 // Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost)
80 //===== 
81 void WriteColumnsString::bbUserFinalizeProcessing()
82 {
83
84 //  THE FINALIZATION METHOD BODY :
85 //    Here does nothing 
86 //    but this is where you should desallocate the internal/output pointers 
87 //    if any
88   
89 }
90 }
91 // EO namespace bbstd
92
93