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)
4 #include "bbstdReadColumnsString.h"
5 #include "bbstdPackage.h"
13 BBTK_ADD_BLACK_BOX_TO_PACKAGE(std,ReadColumnsString)
14 BBTK_BLACK_BOX_IMPLEMENTATION(ReadColumnsString,bbtk::AtomicBlackBox);
16 // 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)
18 void ReadColumnsString::Process()
21 printf("EED ReadColumnsString::Process start \n");
23 std::vector< std::vector<std::string> * > tlst;
26 for( i=0 ; i<bbGetInputDimension() ; i++)
28 tlst.push_back( new std::vector<std::string> );
31 int numberOfLines = 0;
33 std::vector<std::string> *vecData;
34 FILE *ff1 = fopen( bbGetInputFileName().c_str() , "r+" );
39 for( i=0 ; i<bbGetInputDimension() ; i++)
41 //EED Big careful not meesing the space caracter!!!
42 // fscanf(ff1,"%s",tmpValue); // this line is not working in linux!
43 fscanf(ff1,"%s ",tmpValue);
45 vecData->push_back( tmpValue );
46 printf("*******************************************EC ReadColumnsString::Last Value: %s \n",tmpValue);
52 printf("bbcreaMaracasVisuReadAxisTree3D::Process ...Error... reading file InputFileName_Points>%s", bbGetInputFileName().c_str() );
55 i=1; if (i<=bbGetInputDimension()) { bbSetOutputlstData1( *(tlst[i-1]) ); }
56 i=2; if (i<=bbGetInputDimension()) { bbSetOutputlstData2( *(tlst[i-1]) ); }
57 i=3; if (i<=bbGetInputDimension()) { bbSetOutputlstData3( *(tlst[i-1]) ); }
58 i=4; if (i<=bbGetInputDimension()) { bbSetOutputlstData4( *(tlst[i-1]) ); }
59 i=5; if (i<=bbGetInputDimension()) { bbSetOutputlstData5( *(tlst[i-1]) ); }
60 i=6; if (i<=bbGetInputDimension()) { bbSetOutputlstData6( *(tlst[i-1]) ); }
61 i=7; if (i<=bbGetInputDimension()) { bbSetOutputlstData7( *(tlst[i-1]) ); }
62 i=8; if (i<=bbGetInputDimension()) { bbSetOutputlstData8( *(tlst[i-1]) ); }
63 i=9; if (i<=bbGetInputDimension()) { bbSetOutputlstData9( *(tlst[i-1]) ); }
65 printf("EED ReadColumnsString::Process end \n");
69 // 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)
71 void ReadColumnsString::bbUserSetDefaultValues()
74 // SET HERE THE DEFAULT INPUT/OUTPUT VALUES OF YOUR BOX
75 // Here we initialize the input 'In' to 0
76 bbSetInputDimension(1);
77 bbSetInputFileName("");
81 // 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)
83 void ReadColumnsString::bbUserInitializeProcessing()
86 // THE INITIALIZATION METHOD BODY :
88 // but this is where you should allocate the internal/output pointers
94 // 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)
96 void ReadColumnsString::bbUserFinalizeProcessing()
99 // THE FINALIZATION METHOD BODY :
101 // but this is where you should desallocate the internal/output pointers
106 // EO namespace bbstd