]> Creatis software - bbtk.git/blob - packages/std/src/bbstdStringWriter.cxx
e67c95e0ad0833f02d4f261ba13cdd08b81f8c47
[bbtk.git] / packages / std / src / bbstdStringWriter.cxx
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 "bbstdStringWriter.h"
5 #include "bbstdPackage.h"
6
7 namespace bbstd
8 {
9
10 BBTK_ADD_BLACK_BOX_TO_PACKAGE(std,StringWriter)
11 BBTK_BLACK_BOX_IMPLEMENTATION(StringWriter,bbtk::AtomicBlackBox);
12 //===== 
13 // 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)
14 //===== 
15 void StringWriter::Process()
16 {
17
18         if (bbGetInputFileName()!="")
19         {
20                 FILE *ff = fopen(bbGetInputFileName().c_str(),"w");
21                 if (ff!=NULL)
22                 {
23                         fprintf(ff,"%s \n",bbGetInputIn0().c_str());
24                         fprintf(ff,"%s \n",bbGetInputIn1().c_str());
25                         fprintf(ff,"%s \n",bbGetInputIn2().c_str());
26                         fprintf(ff,"%s \n",bbGetInputIn3().c_str());
27                         fprintf(ff,"%s \n",bbGetInputIn4().c_str());
28                         fprintf(ff,"%s \n",bbGetInputIn5().c_str());
29                         fprintf(ff,"%s \n",bbGetInputIn6().c_str());
30                         fprintf(ff,"%s \n",bbGetInputIn7().c_str());
31                         fprintf(ff,"%s \n",bbGetInputIn8().c_str());
32                         fprintf(ff,"%s \n",bbGetInputIn9().c_str());
33                         fclose(ff);
34                 }
35         }
36   
37 }
38 //===== 
39 // 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)
40 //===== 
41 void StringWriter::bbUserSetDefaultValues()
42 {
43
44 //  SET HERE THE DEFAULT INPUT/OUTPUT VALUES OF YOUR BOX 
45 //    Here we initialize the input 'In' to 0
46         bbSetInputIn0("");
47         bbSetInputIn1("");
48         bbSetInputIn2("");
49         bbSetInputIn3("");
50         bbSetInputIn4("");
51         bbSetInputIn5("");
52         bbSetInputIn6("");
53         bbSetInputIn7("");
54         bbSetInputIn8("");
55         bbSetInputIn9("");
56         bbSetInputFileName("");
57   
58 }
59 //===== 
60 // 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)
61 //===== 
62 void StringWriter::bbUserInitializeProcessing()
63 {
64
65 //  THE INITIALIZATION METHOD BODY :
66 //    Here does nothing 
67 //    but this is where you should allocate the internal/output pointers 
68 //    if any 
69
70   
71 }
72 //===== 
73 // 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)
74 //===== 
75 void StringWriter::bbUserFinalizeProcessing()
76 {
77
78 //  THE FINALIZATION METHOD BODY :
79 //    Here does nothing 
80 //    but this is where you should desallocate the internal/output pointers 
81 //    if any
82   
83 }
84 }
85 // EO namespace bbstd
86
87