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 mVtkParent;
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 mUserConstructor;
83 std::string mUserCopyConstructor;
84 std::string mUserDestructor;
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 <vtkparent> tag
200 if (!BB.nChildNode("vtkparent"))
202 throw bbfyException("Error : blackbox type '"
203 +vtkImageAlgorithmString
204 +"' but no <vtkparent> tag found (mandatory)");
206 bbtk::GetTextOrClear(BB.getChildNode("vtkparent"),mVtkParent);
209 else if (bbtype == vtkPolyDataAlgorithmString )
211 mType = vtkPolyDataAlgorithm;
212 // Looks for <vtkparent> tag
213 if (!BB.nChildNode("vtkparent"))
215 throw bbfyException("Error : blackbox type '"
216 +vtkPolyDataAlgorithmString
217 +"' but no <vtkparent> tag found (mandatory)");
219 bbtk::GetTextOrClear(BB.getChildNode("vtkparent"),mVtkParent);
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 // UserConstructor body
280 if (BB.nChildNode("constructor"))
282 bbtk::GetTextOrClear(BB.getChildNode("constructor"),mUserConstructor);
285 // UserCopyConstructor body
286 if (BB.nChildNode("copyconstructor"))
288 bbtk::GetTextOrClear(BB.getChildNode("copyconstructor"),mUserCopyConstructor);
291 // UserDestructor body
292 if (BB.nChildNode("destructor"))
294 bbtk::GetTextOrClear(BB.getChildNode("destructor"),mUserDestructor);
297 // Template parameters
298 // mNbTemplateParam = BB.nChildNode("template");
300 if ( BB.nChildNode("template") > 0)
302 mTemplateDeclaration = "<";
303 mTemplateImplementation = "<";
305 for (i=0,j=0; i<BB.nChildNode("template")-1; i++)
307 mTemplateDeclaration += "class ";
309 bbtk::GetTextOrClear(BB.getChildNode("template",&j),val);
310 mTemplateDeclaration += val;
311 mTemplateDeclaration += ",";
312 mTemplateImplementation += val;
313 mTemplateImplementation += ",";
314 mTemplateParam.push_back(val);
316 mTemplateDeclaration += "class ";
318 bbtk::GetTextOrClear(BB.getChildNode("template",&j),val);
319 mTemplateDeclaration += val;
320 mTemplateDeclaration += ">";
321 mTemplateImplementation += val;
322 mTemplateImplementation += ">";
323 mTemplateParam.push_back(val);
327 for (i=0,j=0; i<BB.nChildNode("include"); i++)
330 bbtk::GetTextOrClear(BB.getChildNode("include",&j),val);
331 mInclude.push_back(val);
334 for (i=0,j=0; i<BB.nChildNode("typedef"); i++)
337 bbtk::GetTextOrClear(BB.getChildNode("typedef",&j),val);
338 mTypedef.push_back(val);
342 for (i=0,j=0; i<BB.nChildNode("input"); i++)
345 XMLNode n = BB.getChildNode("input",&j);
346 if (!n.isAttributeSet("name"))
348 throw bbfyException("Error : <input> attribute 'name' not found (mandatory)");
350 io.name = n.getAttribute("name");
351 if (!n.isAttributeSet("type"))
353 throw bbfyException("Error : <input name=\""+io.name+"\"> attribute 'type' not found (mandatory)");
355 io.type = n.getAttribute("type");
356 if (!n.isAttributeSet("description"))
358 throw bbfyException("Error : <input name=\""+io.name+"\"> attribute 'description' not found (mandatory)");
360 io.descr = n.getAttribute("description");
362 if (n.isAttributeSet("special"))
364 io.special = n.getAttribute("special");
367 if (n.isAttributeSet("nature"))
369 io.nature = n.getAttribute("nature");
372 if (n.isAttributeSet("generic_type"))
374 io.generic_type = n.getAttribute("generic_type");
377 mInput.push_back(io);
381 for (i=0,j=0; i<BB.nChildNode("output"); i++)
384 XMLNode n = BB.getChildNode("output",&j);
385 if (!n.isAttributeSet("name"))
387 throw bbfyException("Error : <output> attribute 'name' not found (mandatory)");
389 io.name = n.getAttribute("name");
390 if (!n.isAttributeSet("type"))
392 throw bbfyException("Error : <output name=\""+io.name+"\"> attribute 'type' not found (mandatory)");
394 io.type = n.getAttribute("type");
395 if (!n.isAttributeSet("description"))
397 throw bbfyException("Error : <output name=\""+io.name+"\"> attribute 'description' not found (mandatory)");
399 io.descr = n.getAttribute("description");
401 if (n.isAttributeSet("special"))
403 io.special = n.getAttribute("special");
406 if (n.isAttributeSet("nature"))
408 io.nature = n.getAttribute("nature");
411 if (n.isAttributeSet("generic_type"))
413 io.generic_type = n.getAttribute("generic_type");
416 mOutput.push_back(io);
421 // process tag given ?
422 if (BB.nChildNode("process"))
424 bbtk::GetTextOrClear(BB.getChildNode("process"),mProcess);
428 // createwidget tag given ?
429 if (BB.nChildNode("createwidget"))
431 bbtk::GetTextOrClear(BB.getChildNode("createwidget"),mCreateWidget);
434 //==========================================================================
437 //==========================================================================
438 void bbfy::BeginNamespace()
440 // if (mIsInNamespace)
442 mFile << "namespace "<<mNamespace <<"\n{\n\n";
445 //==========================================================================
447 //==========================================================================
448 void bbfy::EndNamespace()
450 // if (mIsInNamespace)
452 mFile << "}\n// EO namespace "<<mNamespace<<"\n\n";
455 //==========================================================================
458 //==========================================================================
459 void bbfy::CreateHeader()
466 if (mVerbose) std::cout << " - Creating header '"<<mHName<<"'"<<std::endl;
467 std::string fullname = mOutputPath + mHName;
468 mFile.open(fullname.c_str());
471 std::string mess("Error : could not open file \"");
472 mess += fullname + "\"";
473 throw bbfyException(mess);
479 mFile << "#ifdef _USE_WXWIDGETS_\n";
482 // Prevent multiple inclusions
483 std::string included("__bb");
484 included += mPackage + mName + "_h_INCLUDED__";
485 mFile << "#ifndef " << included <<"\n";
486 mFile << "#define " << included <<"\n";
489 // mFile << "#include \"bbtkAtomicBlackBox.h\"\n";
490 std::vector<std::string>::iterator i;
491 for (i=mInclude.begin(); i!=mInclude.end(); ++i)
493 mFile << "#include \"" << *i <<"\"\n";
495 if (mGeneric) mFile << "#include \"bbitkImage.h\"\n";
498 if (mType == itkImageToImageFilter )
500 mFile << "#include \"bbtkItkBlackBoxMacros.h\"\n";
502 else if ( (mType == vtkImageAlgorithm) ||
503 (mType == vtkPolyDataAlgorithm) )
505 mFile << "#include \"bbtkVtkBlackBoxMacros.h\"\n";
512 // If it is a template class
513 if (mTemplateParam.size() > 0)
515 mFile << "template " << mTemplateDeclaration <<"\n";
518 // Class declaration and parents
519 mFile << "class /*BBTK_EXPORT*/ "<<mName<<"\n";
523 if (mBB.nChildNode("inherits"))
526 for (i=0,j=0; i<mBB.nChildNode("inherits")-1; i++)
529 << mBB.getChildNode("inherits",&j).getText()
533 << mBB.getChildNode("Inherits",&j).getText()
538 if (mType == itkImageToImageFilter )
540 mFile << " public " << mItkParent <<",\n";
542 else if ( (mType == vtkImageAlgorithm) ||
543 (mType == vtkPolyDataAlgorithm) )
545 mFile << " public " << mVtkParent <<",\n";
548 mFile << " public "<<mParentBlackBox << "\n";
555 if (mType == itkImageToImageFilter)
557 mFile << " BBTK_ITK_BLACK_BOX_INTERFACE("
559 << mParentBlackBox << ","
564 else if ( (mType == vtkImageAlgorithm) ||
565 (mType == vtkPolyDataAlgorithm) )
567 mFile << " BBTK_VTK_BLACK_BOX_INTERFACE("
569 << mParentBlackBox << ","
576 mFile << " BBTK_BLACK_BOX_INTERFACE("
578 << mParentBlackBox << ");\n";
581 for (i=mTypedef.begin(); i!=mTypedef.end(); ++i)
586 // Declare user constructor / copy cons /destr
587 mFile << "//=================================================================="<<std::endl;
588 mFile << "/// User callback called in the box contructor"<<std::endl;
590 mFile << "virtual void bbUserConstructor();"<<std::endl;
591 mFile << "/// User callback called in the box copy constructor"<<std::endl;
592 mFile << "virtual void bbUserCopyConstructor();"<<std::endl;
593 mFile << "/// User callback called in the box destructor"<<std::endl;
594 mFile << "virtual void bbUserDestructor();"<<std::endl;
595 mFile << "//=================================================================="<<std::endl;
600 std::vector<IO>::iterator ioi;
601 for (ioi=mInput.begin(); ioi!=mInput.end(); ++ioi)
603 if (ioi->special=="")
605 mFile << " BBTK_DECLARE_INPUT("
611 else if (ioi->special=="itk input")
613 mFile << " BBTK_DECLARE_ITK_INPUT("
619 else if (ioi->special=="vtk input")
621 if (mType == vtkImageAlgorithm) {
622 mFile << " BBTK_DECLARE_VTK_IMAGE_ALGORITHM_INPUT("
628 else if (mType == vtkPolyDataAlgorithm) {
629 mFile << " BBTK_DECLARE_POLY_DATA_ALGORITHM_INPUT("
636 else if (ioi->special=="itk parameter")
638 mFile << " BBTK_DECLARE_ITK_PARAM("
644 else if (ioi->special=="vtk parameter")
646 mFile << " BBTK_DECLARE_VTK_PARAM("
654 std::string mess("Error : input '");
656 mess += "', 'special' attribute '";
657 mess += ioi->special;
659 throw bbfyException(mess);
664 for (ioi=mOutput.begin(); ioi!=mOutput.end(); ++ioi)
666 if (ioi->special=="")
668 mFile << " BBTK_DECLARE_OUTPUT("
674 else if (ioi->special=="itk output")
676 mFile << " BBTK_DECLARE_ITK_OUTPUT("
682 else if (ioi->special=="vtk output")
684 mFile << " BBTK_DECLARE_VTK_OUTPUT("
692 std::string mess("Error : output '");
694 mess += "', 'special' attribute '";
695 mess += ioi->special;
697 throw bbfyException(mess);
702 if ((mType == STD)||(mProcess.size()))
704 mFile << " BBTK_PROCESS(Process);\n" ;
705 mFile << " void Process();\n";
707 else if (mType == itkImageToImageFilter)
709 mFile << " BBTK_ITK_PROCESS();\n" ;
711 else if ((mType == vtkImageAlgorithm) ||
712 (mType == vtkPolyDataAlgorithm) )
715 mFile << " BBTK_VTK_PROCESS();\n" ;
721 mFile << " BBTK_CREATE_WIDGET(CreateWidget);\n" ;
722 mFile << " void CreateWidget();\n";
726 // EO black box declaration
729 // BO black box description
730 if (mTemplateParam.size()==0)
732 mFile << "BBTK_BEGIN_DESCRIBE_BLACK_BOX("
734 << mParentBlackBox << ");\n";
735 mFile << "BBTK_NAME(\"" << mName <<"\");\n";
737 else if (mTemplateParam.size()==1)
739 mFile << "BBTK_BEGIN_DESCRIBE_TEMPLATE_BLACK_BOX("
741 //<< mParentBlackBox //<< ","
742 // << mTemplateParam[0]
744 mFile << "BBTK_NAME(\"" << mName
745 << "<\"+bbtk::TypeName<" << mTemplateParam[0]
750 throw bbfyException("template bb with more than 1 templ param not impl");
754 mFile << "BBTK_AUTHOR(\""<<mAuthor<< "\");\n";
757 mFile << "BBTK_DESCRIPTION(\""<<mDescription<< "\");\n";
760 mFile << "BBTK_CATEGORY(\""<<mCategory<< "\");\n";
762 for (i=mTypedef.begin(); i!=mTypedef.end(); ++i)
768 for (ioi=mInput.begin(); ioi!=mInput.end(); ++ioi)
770 if (mTemplateParam.size()>0)
772 mFile << "BBTK_TEMPLATE_INPUT(";
776 mFile << "BBTK_INPUT(";
778 mFile << mName << "," << ioi->name << ",\""
779 << ioi->descr << "\"," << ioi->type << ",\""
780 << ioi->nature<<"\");\n";
784 for (ioi=mOutput.begin(); ioi!=mOutput.end(); ++ioi)
786 if (mTemplateParam.size()>0)
788 mFile << "BBTK_TEMPLATE_OUTPUT(";
792 mFile << "BBTK_OUTPUT(";
794 mFile << mName << "," << ioi->name << ",\""
795 << ioi->descr << "\"," << ioi->type << ",\""
796 << ioi->nature<<"\");\n";
799 // EO black box description
800 if (mTemplateParam.size()==0)
802 mFile << "BBTK_END_DESCRIBE_BLACK_BOX("
805 else if (mTemplateParam.size()==1)
807 mFile << "BBTK_END_DESCRIBE_TEMPLATE_BLACK_BOX("
809 // << mTemplateParam[0]
814 throw bbfyException("template bb with more than 1 templ param not impl");
818 // Untemplatization of itk filters
821 WriteGenericITKFilterHeader();
828 // Prevent multiple inclusions
829 mFile << "#endif // " << included <<"\n";
833 mFile << "#endif // _USE_WXWIDGETS_\n";
841 //==========================================================================
845 //==========================================================================
846 void bbfy::WriteGenericITKFilterHeader()
848 mFile << "\n//===================================================\n";
849 mFile << "// Generic \"untemplatized\" filter\n";
850 mFile << "//===================================================\n";
852 // Class declaration and parents
853 mFile << "class /*BBTK_EXPORT*/ "<<mName<<"Generic\n";
855 mFile << " public bbtk::AtomicBlackBox\n";
859 mFile << " BBTK_BLACK_BOX_INTERFACE("
860 << mName << "Generic,bbtk::AtomicBlackBox);\n";
863 std::vector<IO>::iterator ioi;
864 for (ioi=mInput.begin(); ioi!=mInput.end(); ++ioi)
866 mFile << " BBTK_DECLARE_INPUT("
874 for (ioi=mOutput.begin(); ioi!=mOutput.end(); ++ioi)
876 mFile << " BBTK_DECLARE_OUTPUT("
884 mFile << " BBTK_PROCESS(ProcessSwitch);\n";
885 mFile << " private :\n";
886 mFile << " inline void ProcessSwitch();\n";
887 mFile << " template <class T, unsigned int D> void Process();\n";
888 // EO black box declaration
893 // BO black box description
894 mFile << "BBTK_BEGIN_DESCRIBE_BLACK_BOX("
895 << mName << "Generic,bbtk::AtomicBlackBox);\n";
896 mFile << "BBTK_NAME(\"" << mName <<"\");\n";
899 mFile << "BBTK_AUTHOR(\""<<mAuthor<< "\");\n";
902 mFile << "BBTK_DESCRIPTION(\""<<mDescription<< "\");\n";
905 for (ioi=mInput.begin(); ioi!=mInput.end(); ++ioi)
907 mFile << "BBTK_INPUT(";
908 mFile << mName << "Generic," << ioi->name << ",\""
909 << ioi->descr << "\"," << ioi->generic_type <<");\n";
913 for (ioi=mOutput.begin(); ioi!=mOutput.end(); ++ioi)
915 mFile << "BBTK_OUTPUT(";
916 mFile << mName << "Generic," << ioi->name << ",\""
917 << ioi->descr << "\"," << ioi->generic_type <<");\n";
920 // EO black box description
921 mFile << "BBTK_END_DESCRIBE_BLACK_BOX("
922 << mName << "Generic);\n";
925 //=================================================================
926 // ProcessSwitch implementation
927 mFile << "void "<< mName <<"Generic::ProcessSwitch()\n"
929 << "CALL_FOR_ALL_TYPES_AND_DIM(bbGetInputIn()->GetType(),\n"
930 << " bbGetInputIn()->GetDimension(),\n"
933 //=================================================================
936 //=================================================================
937 // Template process implementation
938 mFile << "template <class T, unsigned int D>\n"
939 << "void "<<mName<<"Generic::Process()\n"
941 << " bbtkDebugMessageInc(\"Kernel\",9,\n"
943 << "Generic::Process<\"<<TypeName<T>()<<\",\"<<D<<\">()\"<<std::endl);\n"
945 << " typedef itk::Image<T,D> ImageType;\n"
946 << " typedef "<<mName<<"<ImageType> FilterType;\n"
948 << " FilterType* f = new FilterType(\"Temp\");\n"
950 << " f->bbSetInputIn( this->bbGetInputIn()->GetImage<T,D>() );\n";
952 for (ioi=mInput.begin(); ioi!=mInput.end(); ++ioi)
954 if (ioi->name == "In") continue;
955 mFile << " f->bbSetInput"<<ioi->name<<" ( this->bbGetInput"
956 << ioi->name << "() );\n";
959 mFile << " f->bbUpdate();\n"
960 << " this->bbSetOutputOut( new itkImage( f->bbGetOutputOut() ) );\n"
961 << " f->UnRegister();\n"
962 << " bbtkDebugDecTab(\"Kernel\",9);\n"
964 //=================================================================
968 //==========================================================================
971 //==========================================================================
972 void bbfy::CreateCode()
975 mCxxName += mPackage;
978 if (mVerbose) std::cout << " - Creating code '"<<mCxxName<<"'"<<std::endl;
979 std::string fullname = mOutputPath + mCxxName;
980 mFile.open(fullname.c_str());
983 std::string mess("Error : could not open file \"");
986 throw bbfyException(mess);
990 // Header of the class
991 mFile << "#include \"" << mHName << "\"\n";
993 // Include Package header
994 mFile << "#include \"bb"<<mPackage << "Package.h\"\n";
1001 if (mTemplateParam.size()>0)
1004 mFile << "BBTK_BLACK_BOX_TEMPLATE_IMPLEMENTATION("
1006 << mParentBlackBox << ");\n";
1011 mFile << "BBTK_BLACK_BOX_IMPLEMENTATION("
1012 << mName << "Generic,bbtk::AtomicBlackBox);\n";
1014 mFile << "BBTK_ADD_BLACK_BOX_TO_PACKAGE("
1016 << mName << "Generic)\n";
1021 // Non template class
1023 mFile << "BBTK_ADD_BLACK_BOX_TO_PACKAGE("
1028 mFile << "BBTK_BLACK_BOX_IMPLEMENTATION("
1030 << mParentBlackBox << ");\n";
1033 if ((mType == STD)||(mProcess.size()))
1035 mFile << "void "<<mName<<"::Process()\n{\n";
1036 mFile << mProcess << "\n";
1042 mFile << "void "<<mName<<"::CreateWidget()\n{\n";
1043 mFile << mCreateWidget << "\n";
1047 // User constr / copy constr / destr implementation
1048 mFile <<"void "<<mName<<"::bbUserConstructor()"<<std::endl;
1049 mFile << "{"<<std::endl;
1050 //mFile<<"bbtkDebugMessage(\"Kernel\",9,\""<<mName<<::bbUserConstructor()"<<std::endl);"<<std::endl;
1052 mFile << mUserConstructor << std::endl;
1053 mFile << "}" << std::endl;
1055 mFile <<"void "<<mName<<"::bbUserCopyConstructor()"<<std::endl;
1056 mFile << "{"<<std::endl;
1057 //mFile<<"bbtkDebugMessage(\"Kernel\",9,\""<<mName<<::bbUserCopyConstructor()"<<std::endl);"<<std::endl;
1058 mFile << mUserCopyConstructor << std::endl;
1059 mFile << "}" << std::endl;
1061 mFile <<"void "<<mName<<"::bbUserDestructor()"<<std::endl;
1062 mFile << "{"<<std::endl;
1063 //mFile<<"bbtkDebugMessage(\"Kernel\",9,\""<<mName<<::bbUserDestructor()"<<std::endl);"<<std::endl;
1064 mFile << mUserDestructor << std::endl;
1065 mFile << "}" << std::endl;
1077 //==========================================================================
1083 //==========================================================================
1084 int main(int argc, char **argv)
1087 if (argc<2 || argc>5)
1089 std::cerr << "usage : "<< argv[0] <<" xml_file [package_name] [output_path] [-q]" << std::endl;
1095 std::string package("PACKAGE_NAME");
1096 std::string output_path("");
1097 bool verbose = true;
1098 if (argc>2) package = argv[2];
1099 if (argc>3) output_path = argv[3];
1100 if (argc>4) verbose = false;
1102 bbfy B(argv[1],package,output_path,verbose);
1104 catch (bbfyException e)
1106 std::cerr << argv[0] << " " << argv[1] << std::endl
1107 << e.mMessage << std::endl;
1112 //==========================================================================