2 #define _CRT_SECURE_NO_DEPRECATE
12 //==========================================================================
16 bbfyException(const std::string& message) : mMessage(message) {}
20 //==========================================================================
22 const std::string itkImageToImageFilterString = "ITK_ImageToImageFilter";
23 const std::string vtkImageAlgorithmString = "VTK_ImageAlgorithm";
24 const std::string vtkPolyDataAlgorithmString = "VTK_PolyDataAlgorithm";
26 //==========================================================================
30 bbfy(const std::string& filename,
31 const std::string& package = "PACKAGE_NAME",
32 const std::string& output_path = "",
33 bool verbose = false);
35 void CreateBlackBox();
40 void WriteGenericITKFilterHeader();
42 void BeginNamespace();
47 std::string mFilename;
48 std::string mOutputPath;
56 itkImageToImageFilter,
64 std::string mParentBlackBox;
65 std::string mItkParent;
66 std::string mVtkObject;
69 std::string mDescription;
70 std::string mCategory;
72 // bool mIsInNamespace;
73 std::string mNamespace;
74 // int mNbTemplateParam;
75 std::vector<std::string> mTemplateParam;
76 std::string mTemplateDeclaration;
77 std::string mTemplateImplementation;
79 std::vector<std::string> mInclude;
80 std::vector<std::string> mTypedef;
82 std::string mUserSetDefaultValues;
83 std::string mUserInitializeProcessing;
84 std::string mUserFinalizeProcessing;
93 std::string generic_type;
97 std::vector<IO> mInput;
98 std::vector<IO> mOutput;
100 std::string mProcess;
101 std::string mCreateWidget;
106 std::string mCxxName;
109 //==========================================================================
113 //==========================================================================
114 bbfy::bbfy(const std::string& filename,
115 const std::string& package,
116 const std::string& output_path,
121 mFilename = filename;
123 mNamespace = "bb" + mPackage;
125 mOutputPath = output_path;
130 //==========================================================================
132 //==========================================================================
133 void bbfy::CreateBlackBox()
135 // Parse XML input file
137 // Create output files
141 //==========================================================================
145 //==========================================================================
146 void bbfy::ParseXML()
148 XMLResults* res = new XMLResults;
149 XMLNode BB = XMLNode::parseFile(mFilename.c_str(),"blackbox",res);
151 if ( res->error != eXMLErrorNone )
153 std::ostringstream str;
154 str << XMLNode::getError(res->error);
155 str << " [line " << res->nLine << ", col "<<res->nColumn<<"]";
157 throw bbfyException(str.str());
162 if (!BB.isAttributeSet("name"))
164 throw bbfyException("Error : <blackbox> tag : no 'name' attribute found (mandatory)");
166 mName = BB.getAttribute("name");
168 if (mVerbose) std::cout << "* Creating BlackBox '"<<mName<<"'"<<std::endl;
175 if (BB.isAttributeSet("type"))
177 std::string bbtype = BB.getAttribute("type");
178 if (bbtype=="standard")
183 else if (bbtype==itkImageToImageFilterString)
185 mType = itkImageToImageFilter;
186 // Looks for <itkparent> tag
187 if (!BB.nChildNode("itkparent"))
189 throw bbfyException("Error : blackbox type '"+itkImageToImageFilterString+"' but no <itkparent> tag found (mandatory)");
191 bbtk::GetTextOrClear(BB.getChildNode("itkparent"),mItkParent);
194 if (BB.isAttributeSet("generic")) mGeneric=true;
196 else if (bbtype == vtkImageAlgorithmString)
198 mType = vtkImageAlgorithm;
199 // Looks for <vtkobject> tag
200 if (!BB.nChildNode("vtkobject"))
202 throw bbfyException("Error : blackbox type '"
203 +vtkImageAlgorithmString
204 +"' but no <vtkobject> tag found (mandatory)");
206 bbtk::GetTextOrClear(BB.getChildNode("vtkobject"),mVtkObject);
209 else if (bbtype == vtkPolyDataAlgorithmString )
211 mType = vtkPolyDataAlgorithm;
212 // Looks for <vtkobject> tag
213 if (!BB.nChildNode("vtkobject"))
215 throw bbfyException("Error : blackbox type '"
216 +vtkPolyDataAlgorithmString
217 +"' but no <vtkobject> tag found (mandatory)");
219 bbtk::GetTextOrClear(BB.getChildNode("vtkobject"),mVtkObject);
224 std::string mess("Error : blackbox type '");
226 mess += "' unknown. Known types :";
227 mess += "'" + itkImageToImageFilterString + "' ";
228 mess += "'" + vtkImageAlgorithmString + "' ";
229 mess += "'" + vtkPolyDataAlgorithmString + "' ";
230 throw bbfyException(mess);
235 if (BB.isAttributeSet("widget"))
238 mParentBlackBox = "bbtk::WxBlackBox";
239 mInclude.push_back("bbtkWxBlackBox.h");
244 mParentBlackBox = "bbtk::AtomicBlackBox";
245 mInclude.push_back("bbtkAtomicBlackBox.h");
250 for (i=0,j=0; i<BB.nChildNode("author"); i++)
253 bbtk::GetTextOrClear(BB.getChildNode("author",&j),val);
258 for (i=0,j=0; i<BB.nChildNode("description"); i++)
261 bbtk::GetTextOrClear(BB.getChildNode("description",&j),val);
266 for (i=0,j=0; i<BB.nChildNode("category"); i++)
269 bbtk::GetTextOrClear(BB.getChildNode("category",&j),val);
274 if (BB.nChildNode("namespace"))
276 bbtk::GetTextOrClear(BB.getChildNode("namespace"),mNamespace);
279 // UserSetDefaultValues body
280 if (BB.nChildNode("defaultValues"))
282 bbtk::GetTextOrClear(BB.getChildNode("defaultValues"),
283 mUserSetDefaultValues);
286 // UserInitializeProcessing body
287 if (BB.nChildNode("initializeProcessing"))
289 bbtk::GetTextOrClear(BB.getChildNode("initializeProcessing"),
290 mUserInitializeProcessing);
293 // UserFinalizeProcessing body
294 if (BB.nChildNode("finalizeProcessing"))
296 bbtk::GetTextOrClear(BB.getChildNode("finalizeProcessing"),
297 mUserFinalizeProcessing);
302 // Template parameters
303 // mNbTemplateParam = BB.nChildNode("template");
305 if ( BB.nChildNode("template") > 0)
307 mTemplateDeclaration = "<";
308 mTemplateImplementation = "<";
310 for (i=0,j=0; i<BB.nChildNode("template")-1; i++)
312 mTemplateDeclaration += "class ";
314 bbtk::GetTextOrClear(BB.getChildNode("template",&j),val);
315 mTemplateDeclaration += val;
316 mTemplateDeclaration += ",";
317 mTemplateImplementation += val;
318 mTemplateImplementation += ",";
319 mTemplateParam.push_back(val);
321 mTemplateDeclaration += "class ";
323 bbtk::GetTextOrClear(BB.getChildNode("template",&j),val);
324 mTemplateDeclaration += val;
325 mTemplateDeclaration += ">";
326 mTemplateImplementation += val;
327 mTemplateImplementation += ">";
328 mTemplateParam.push_back(val);
332 for (i=0,j=0; i<BB.nChildNode("include"); i++)
335 bbtk::GetTextOrClear(BB.getChildNode("include",&j),val);
336 mInclude.push_back(val);
339 for (i=0,j=0; i<BB.nChildNode("typedef"); i++)
342 bbtk::GetTextOrClear(BB.getChildNode("typedef",&j),val);
343 mTypedef.push_back(val);
347 for (i=0,j=0; i<BB.nChildNode("input"); i++)
350 XMLNode n = BB.getChildNode("input",&j);
351 if (!n.isAttributeSet("name"))
353 throw bbfyException("Error : <input> attribute 'name' not found (mandatory)");
355 io.name = n.getAttribute("name");
356 if (!n.isAttributeSet("type"))
358 throw bbfyException("Error : <input name=\""+io.name+"\"> attribute 'type' not found (mandatory)");
360 io.type = n.getAttribute("type");
361 if (!n.isAttributeSet("description"))
363 throw bbfyException("Error : <input name=\""+io.name+"\"> attribute 'description' not found (mandatory)");
365 io.descr = n.getAttribute("description");
367 if (n.isAttributeSet("special"))
369 io.special = n.getAttribute("special");
372 if (n.isAttributeSet("nature"))
374 io.nature = n.getAttribute("nature");
377 if (n.isAttributeSet("generic_type"))
379 io.generic_type = n.getAttribute("generic_type");
382 mInput.push_back(io);
386 for (i=0,j=0; i<BB.nChildNode("output"); i++)
389 XMLNode n = BB.getChildNode("output",&j);
390 if (!n.isAttributeSet("name"))
392 throw bbfyException("Error : <output> attribute 'name' not found (mandatory)");
394 io.name = n.getAttribute("name");
395 if (!n.isAttributeSet("type"))
397 throw bbfyException("Error : <output name=\""+io.name+"\"> attribute 'type' not found (mandatory)");
399 io.type = n.getAttribute("type");
400 if (!n.isAttributeSet("description"))
402 throw bbfyException("Error : <output name=\""+io.name+"\"> attribute 'description' not found (mandatory)");
404 io.descr = n.getAttribute("description");
406 if (n.isAttributeSet("special"))
408 io.special = n.getAttribute("special");
411 if (n.isAttributeSet("nature"))
413 io.nature = n.getAttribute("nature");
416 if (n.isAttributeSet("generic_type"))
418 io.generic_type = n.getAttribute("generic_type");
421 mOutput.push_back(io);
426 // process tag given ?
427 if (BB.nChildNode("process"))
429 bbtk::GetTextOrClear(BB.getChildNode("process"),mProcess);
433 // createwidget tag given ?
434 if (BB.nChildNode("createwidget"))
436 bbtk::GetTextOrClear(BB.getChildNode("createwidget"),mCreateWidget);
445 // OBSOLETE/UNSUPPORTED TAGS
446 // WARN IF OBSOLETE TAGS PROVIDED
447 if (BB.nChildNode("constructor"))
449 std::cout << "WARNING !!! The tag <constructor> is obsolete !!"<<std::endl;
451 if (BB.nChildNode("destructor"))
453 std::cout << "WARNING !!! The tag <destructor> is obsolete !!"<<std::endl;
455 if (BB.nChildNode("copy_constructor"))
457 std::cout << "WARNING !!! The tag <copy_constructor> is obsolete !!"<<std::endl;
463 //==========================================================================
466 //==========================================================================
467 void bbfy::BeginNamespace()
469 // if (mIsInNamespace)
471 mFile << "namespace "<<mNamespace <<"\n{\n\n";
474 //==========================================================================
476 //==========================================================================
477 void bbfy::EndNamespace()
479 // if (mIsInNamespace)
481 mFile << "}\n// EO namespace "<<mNamespace<<"\n\n";
484 //==========================================================================
487 //==========================================================================
488 void bbfy::CreateHeader()
495 if (mVerbose) std::cout << " - Creating header '"<<mHName<<"'"<<std::endl;
496 std::string fullname = mOutputPath + mHName;
497 mFile.open(fullname.c_str());
500 std::string mess("Error : could not open file \"");
501 mess += fullname + "\"";
502 throw bbfyException(mess);
508 mFile << "#ifdef _USE_WXWIDGETS_\n";
511 // Prevent multiple inclusions
512 std::string included("__bb");
513 included += mPackage + mName + "_h_INCLUDED__";
514 mFile << "#ifndef " << included <<"\n";
515 mFile << "#define " << included <<"\n";
518 mFile << "#include \"bb" << mPackage << "_EXPORT.h\"\n";
519 std::vector<std::string>::iterator i;
520 for (i=mInclude.begin(); i!=mInclude.end(); ++i)
522 mFile << "#include \"" << *i <<"\"\n";
524 if (mGeneric) mFile << "#include \"bbitkImage.h\"\n";
527 if (mType == itkImageToImageFilter )
529 mFile << "#include \"bbtkItkBlackBoxMacros.h\"\n";
531 else if ( (mType == vtkImageAlgorithm) ||
532 (mType == vtkPolyDataAlgorithm) )
534 mFile << "#include \"bbtkVtkBlackBoxMacros.h\"\n";
541 // If it is a template class
542 if (mTemplateParam.size() > 0)
544 mFile << "template " << mTemplateDeclaration <<"\n";
547 // Class declaration and parents
548 mFile << "class bb"<<mPackage<<"_EXPORT "<<mName<<"\n";
552 if (mBB.nChildNode("inherits"))
555 for (i=0,j=0; i<mBB.nChildNode("inherits")-1; i++)
558 << mBB.getChildNode("inherits",&j).getText()
562 << mBB.getChildNode("Inherits",&j).getText()
567 if (mType == itkImageToImageFilter )
569 mFile << " public " << mItkParent <<",\n";
572 mFile << " public "<<mParentBlackBox << "\n";
579 if (mType == itkImageToImageFilter)
581 mFile << " BBTK_ITK_BLACK_BOX_INTERFACE("
583 << mParentBlackBox << ","
588 else if ( (mType == vtkImageAlgorithm) ||
589 (mType == vtkPolyDataAlgorithm) )
591 mFile << " BBTK_VTK_BLACK_BOX_INTERFACE("
593 << mParentBlackBox << ","
601 mFile << " BBTK_BLACK_BOX_INTERFACE("
603 << mParentBlackBox << ");\n";
606 for (i=mTypedef.begin(); i!=mTypedef.end(); ++i)
614 std::vector<IO>::iterator ioi;
615 for (ioi=mInput.begin(); ioi!=mInput.end(); ++ioi)
617 if (ioi->special=="")
619 mFile << " BBTK_DECLARE_INPUT("
625 else if (ioi->special=="itk input")
627 mFile << " BBTK_DECLARE_ITK_INPUT("
633 else if (ioi->special=="vtk input")
635 if (mType == vtkImageAlgorithm) {
636 mFile << " BBTK_DECLARE_VTK_IMAGE_ALGORITHM_INPUT("
642 else if (mType == vtkPolyDataAlgorithm) {
643 mFile << " BBTK_DECLARE_POLY_DATA_ALGORITHM_INPUT("
650 else if (ioi->special=="itk parameter")
652 mFile << " BBTK_DECLARE_ITK_PARAM("
658 else if (ioi->special=="vtk parameter")
660 mFile << " BBTK_DECLARE_VTK_PARAM("
668 std::string mess("Error : input '");
670 mess += "', 'special' attribute '";
671 mess += ioi->special;
673 throw bbfyException(mess);
678 for (ioi=mOutput.begin(); ioi!=mOutput.end(); ++ioi)
680 if (ioi->special=="")
682 mFile << " BBTK_DECLARE_OUTPUT("
688 else if (ioi->special=="itk output")
690 mFile << " BBTK_DECLARE_ITK_OUTPUT("
696 else if (ioi->special=="vtk output")
698 mFile << " BBTK_DECLARE_VTK_OUTPUT("
706 std::string mess("Error : output '");
708 mess += "', 'special' attribute '";
709 mess += ioi->special;
711 throw bbfyException(mess);
716 if ((mType == STD)||(mProcess.size()))
718 mFile << " BBTK_PROCESS(Process);\n" ;
719 mFile << " void Process();\n";
721 else if (mType == itkImageToImageFilter)
723 mFile << " BBTK_ITK_PROCESS();\n" ;
725 else if ((mType == vtkImageAlgorithm) ||
726 (mType == vtkPolyDataAlgorithm) )
729 mFile << " BBTK_VTK_PROCESS();\n" ;
735 mFile << " BBTK_CREATE_WIDGET(CreateWidget);\n" ;
736 mFile << " void CreateWidget(wxWindow*);\n";
740 // EO black box declaration
743 // BO black box description
744 if (mTemplateParam.size()==0)
746 mFile << "BBTK_BEGIN_DESCRIBE_BLACK_BOX("
748 << mParentBlackBox << ");\n";
749 mFile << "BBTK_NAME(\"" << mName <<"\");\n";
751 else if (mTemplateParam.size()==1)
753 mFile << "BBTK_BEGIN_DESCRIBE_TEMPLATE_BLACK_BOX("
755 //<< mParentBlackBox //<< ","
756 // << mTemplateParam[0]
758 mFile << "BBTK_NAME(\"" << mName
759 << "<\"+bbtk::TypeName<" << mTemplateParam[0]
764 throw bbfyException("template bb with more than 1 templ param not impl");
768 mFile << "BBTK_AUTHOR(\""<<mAuthor<< "\");\n";
771 mFile << "BBTK_DESCRIPTION(\""<<mDescription<< "\");\n";
774 mFile << "BBTK_CATEGORY(\""<<mCategory<< "\");\n";
776 for (i=mTypedef.begin(); i!=mTypedef.end(); ++i)
782 for (ioi=mInput.begin(); ioi!=mInput.end(); ++ioi)
784 if (mTemplateParam.size()>0)
786 mFile << "BBTK_TEMPLATE_INPUT(";
790 mFile << "BBTK_INPUT(";
792 mFile << mName << "," << ioi->name << ",\""
793 << ioi->descr << "\"," << ioi->type << ",\""
794 << ioi->nature<<"\");\n";
798 for (ioi=mOutput.begin(); ioi!=mOutput.end(); ++ioi)
800 if (mTemplateParam.size()>0)
802 mFile << "BBTK_TEMPLATE_OUTPUT(";
806 mFile << "BBTK_OUTPUT(";
808 mFile << mName << "," << ioi->name << ",\""
809 << ioi->descr << "\"," << ioi->type << ",\""
810 << ioi->nature<<"\");\n";
813 // EO black box description
814 if (mTemplateParam.size()==0)
816 mFile << "BBTK_END_DESCRIBE_BLACK_BOX("
819 else if (mTemplateParam.size()==1)
821 mFile << "BBTK_END_DESCRIBE_TEMPLATE_BLACK_BOX("
823 // << mTemplateParam[0]
828 throw bbfyException("template bb with more than 1 templ param not impl");
832 // Untemplatization of itk filters
835 WriteGenericITKFilterHeader();
842 // Prevent multiple inclusions
843 mFile << "#endif // " << included <<"\n";
847 mFile << "#endif // _USE_WXWIDGETS_\n";
855 //==========================================================================
859 //==========================================================================
860 void bbfy::WriteGenericITKFilterHeader()
862 mFile << "\n//===================================================\n";
863 mFile << "// Generic \"untemplatized\" filter\n";
864 mFile << "//===================================================\n";
866 // Class declaration and parents
867 mFile << "class /*BBTK_EXPORT*/ "<<mName<<"Generic\n";
869 mFile << " public bbtk::AtomicBlackBox\n";
873 mFile << " BBTK_BLACK_BOX_INTERFACE("
874 << mName << "Generic,bbtk::AtomicBlackBox);\n";
877 std::vector<IO>::iterator ioi;
878 for (ioi=mInput.begin(); ioi!=mInput.end(); ++ioi)
880 mFile << " BBTK_DECLARE_INPUT("
888 for (ioi=mOutput.begin(); ioi!=mOutput.end(); ++ioi)
890 mFile << " BBTK_DECLARE_OUTPUT("
898 mFile << " BBTK_PROCESS(ProcessSwitch);\n";
899 mFile << " private :\n";
900 mFile << " inline void ProcessSwitch();\n";
901 mFile << " template <class T, unsigned int D> void Process();\n";
902 // EO black box declaration
907 // BO black box description
908 mFile << "BBTK_BEGIN_DESCRIBE_BLACK_BOX("
909 << mName << "Generic,bbtk::AtomicBlackBox);\n";
910 mFile << "BBTK_NAME(\"" << mName <<"\");\n";
913 mFile << "BBTK_AUTHOR(\""<<mAuthor<< "\");\n";
916 mFile << "BBTK_DESCRIPTION(\""<<mDescription<< "\");\n";
919 for (ioi=mInput.begin(); ioi!=mInput.end(); ++ioi)
921 mFile << "BBTK_INPUT(";
922 mFile << mName << "Generic," << ioi->name << ",\""
923 << ioi->descr << "\"," << ioi->generic_type <<");\n";
927 for (ioi=mOutput.begin(); ioi!=mOutput.end(); ++ioi)
929 mFile << "BBTK_OUTPUT(";
930 mFile << mName << "Generic," << ioi->name << ",\""
931 << ioi->descr << "\"," << ioi->generic_type <<");\n";
934 // EO black box description
935 mFile << "BBTK_END_DESCRIBE_BLACK_BOX("
936 << mName << "Generic);\n";
939 //=================================================================
940 // ProcessSwitch implementation
941 mFile << "void "<< mName <<"Generic::ProcessSwitch()\n"
943 << "CALL_FOR_ALL_TYPES_AND_DIM(bbGetInputIn()->GetType(),\n"
944 << " bbGetInputIn()->GetDimension(),\n"
947 //=================================================================
950 //=================================================================
951 // Template process implementation
952 mFile << "template <class T, unsigned int D>\n"
953 << "void "<<mName<<"Generic::Process()\n"
955 << " bbtkDebugMessageInc(\"Kernel\",9,\n"
957 << "Generic::Process<\"<<TypeName<T>()<<\",\"<<D<<\">()\"<<std::endl);\n"
959 << " typedef itk::Image<T,D> ImageType;\n"
960 << " typedef "<<mName<<"<ImageType> FilterType;\n"
962 << " FilterType* f = new FilterType(\"Temp\");\n"
964 << " f->bbSetInputIn( this->bbGetInputIn()->GetImage<T,D>() );\n";
966 for (ioi=mInput.begin(); ioi!=mInput.end(); ++ioi)
968 if (ioi->name == "In") continue;
969 mFile << " f->bbSetInput"<<ioi->name<<" ( this->bbGetInput"
970 << ioi->name << "() );\n";
973 mFile << " f->bbUpdate();\n"
974 << " this->bbSetOutputOut( new itkImage( f->bbGetOutputOut() ) );\n"
975 << " f->UnRegister();\n"
976 << " bbtkDebugDecTab(\"Kernel\",9);\n"
978 //=================================================================
982 //==========================================================================
985 //==========================================================================
986 void bbfy::CreateCode()
989 mCxxName += mPackage;
992 if (mVerbose) std::cout << " - Creating code '"<<mCxxName<<"'"<<std::endl;
993 std::string fullname = mOutputPath + mCxxName;
994 mFile.open(fullname.c_str());
997 std::string mess("Error : could not open file \"");
1000 throw bbfyException(mess);
1004 // Header of the class
1005 mFile << "#include \"" << mHName << "\"\n";
1007 // Include Package header
1008 mFile << "#include \"bb"<<mPackage << "Package.h\"\n";
1015 if (mTemplateParam.size()>0)
1018 mFile << "BBTK_BLACK_BOX_TEMPLATE_IMPLEMENTATION("
1020 << mParentBlackBox << ");\n";
1025 mFile << "BBTK_BLACK_BOX_IMPLEMENTATION("
1026 << mName << "Generic,bbtk::AtomicBlackBox);\n";
1028 mFile << "BBTK_ADD_BLACK_BOX_TO_PACKAGE("
1030 << mName << "Generic)\n";
1035 // Non template class
1037 mFile << "BBTK_ADD_BLACK_BOX_TO_PACKAGE("
1042 mFile << "BBTK_BLACK_BOX_IMPLEMENTATION("
1044 << mParentBlackBox << ");\n";
1047 if ((mType == STD)||(mProcess.size()))
1049 mFile << "void "<<mName<<"::Process()\n{\n";
1050 mFile << mProcess << "\n";
1056 mFile << "void "<<mName<<"::CreateWidget(wxWindow* parent)\n{\n";
1057 mFile << mCreateWidget << "\n";
1062 // User Set Default Values
1063 mFile <<"void "<<mName<<"::bbUserSetDefaultValues()"<<std::endl;
1064 mFile << "{"<<std::endl;
1065 if ( (mType == vtkImageAlgorithm) || (mType == vtkPolyDataAlgorithm) )
1067 mFile << " BBTK_VTK_SET_DEFAULT_VALUES();\n";
1069 mFile << mUserSetDefaultValues << std::endl;
1070 mFile << "}" << std::endl;
1072 // User Initialize Processing
1073 mFile <<"void "<<mName<<"::bbUserInitializeProcessing()"
1075 mFile << "{"<<std::endl;
1076 if ( (mType == vtkImageAlgorithm) || (mType == vtkPolyDataAlgorithm) )
1078 mFile << " BBTK_VTK_INITIALIZE_PROCESSING();\n";
1080 mFile << mUserInitializeProcessing << std::endl;
1081 mFile << "}" << std::endl;
1083 // User Finalize Processing
1084 mFile <<"void "<<mName<<"::bbUserFinalizeProcessing()"<<std::endl;
1085 mFile << "{"<<std::endl;
1086 if ( (mType == vtkImageAlgorithm) || (mType == vtkPolyDataAlgorithm) )
1088 mFile << " BBTK_VTK_FINALIZE_PROCESSING();\n";
1090 mFile << mUserFinalizeProcessing << std::endl;
1091 mFile << "}" << std::endl;
1103 //==========================================================================
1109 //==========================================================================
1110 int main(int argc, char **argv)
1113 if (argc<2 || argc>5)
1115 std::cerr << "usage : "<< argv[0] <<" xml_file [package_name] [output_path] [-q]" << std::endl;
1121 std::string package("PACKAGE_NAME");
1122 std::string output_path("");
1123 bool verbose = true;
1124 if (argc>2) package = argv[2];
1125 if (argc>3) output_path = argv[3];
1126 if (argc>4) verbose = false;
1128 bbfy B(argv[1],package,output_path,verbose);
1130 catch (bbfyException e)
1132 std::cerr << argv[0] << " " << argv[1] << std::endl
1133 << e.mMessage << std::endl;
1138 //==========================================================================