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("userconstructor"))
282 bbtk::GetTextOrClear(BB.getChildNode("userconstructor"),mUserConstructor);
284 // UserCopyConstructor body
285 if (BB.nChildNode("usercopyconstructor"))
287 bbtk::GetTextOrClear(BB.getChildNode("usercopyconstructor"),mUserCopyConstructor);
289 // UserDestructor body
290 if (BB.nChildNode("userdestructor"))
292 bbtk::GetTextOrClear(BB.getChildNode("userdestructor"),mUserDestructor);
295 // Template parameters
296 // mNbTemplateParam = BB.nChildNode("template");
298 if ( BB.nChildNode("template") > 0)
300 mTemplateDeclaration = "<";
301 mTemplateImplementation = "<";
303 for (i=0,j=0; i<BB.nChildNode("template")-1; i++)
305 mTemplateDeclaration += "class ";
307 bbtk::GetTextOrClear(BB.getChildNode("template",&j),val);
308 mTemplateDeclaration += val;
309 mTemplateDeclaration += ",";
310 mTemplateImplementation += val;
311 mTemplateImplementation += ",";
312 mTemplateParam.push_back(val);
314 mTemplateDeclaration += "class ";
316 bbtk::GetTextOrClear(BB.getChildNode("template",&j),val);
317 mTemplateDeclaration += val;
318 mTemplateDeclaration += ">";
319 mTemplateImplementation += val;
320 mTemplateImplementation += ">";
321 mTemplateParam.push_back(val);
325 for (i=0,j=0; i<BB.nChildNode("include"); i++)
328 bbtk::GetTextOrClear(BB.getChildNode("include",&j),val);
329 mInclude.push_back(val);
332 for (i=0,j=0; i<BB.nChildNode("typedef"); i++)
335 bbtk::GetTextOrClear(BB.getChildNode("typedef",&j),val);
336 mTypedef.push_back(val);
340 for (i=0,j=0; i<BB.nChildNode("input"); i++)
343 XMLNode n = BB.getChildNode("input",&j);
344 if (!n.isAttributeSet("name"))
346 throw bbfyException("Error : <input> attribute 'name' not found (mandatory)");
348 io.name = n.getAttribute("name");
349 if (!n.isAttributeSet("type"))
351 throw bbfyException("Error : <input name=\""+io.name+"\"> attribute 'type' not found (mandatory)");
353 io.type = n.getAttribute("type");
354 if (!n.isAttributeSet("description"))
356 throw bbfyException("Error : <input name=\""+io.name+"\"> attribute 'description' not found (mandatory)");
358 io.descr = n.getAttribute("description");
360 if (n.isAttributeSet("special"))
362 io.special = n.getAttribute("special");
365 if (n.isAttributeSet("nature"))
367 io.nature = n.getAttribute("nature");
370 if (n.isAttributeSet("generic_type"))
372 io.generic_type = n.getAttribute("generic_type");
375 mInput.push_back(io);
379 for (i=0,j=0; i<BB.nChildNode("output"); i++)
382 XMLNode n = BB.getChildNode("output",&j);
383 if (!n.isAttributeSet("name"))
385 throw bbfyException("Error : <output> attribute 'name' not found (mandatory)");
387 io.name = n.getAttribute("name");
388 if (!n.isAttributeSet("type"))
390 throw bbfyException("Error : <output name=\""+io.name+"\"> attribute 'type' not found (mandatory)");
392 io.type = n.getAttribute("type");
393 if (!n.isAttributeSet("description"))
395 throw bbfyException("Error : <output name=\""+io.name+"\"> attribute 'description' not found (mandatory)");
397 io.descr = n.getAttribute("description");
399 if (n.isAttributeSet("special"))
401 io.special = n.getAttribute("special");
404 if (n.isAttributeSet("nature"))
406 io.nature = n.getAttribute("nature");
409 if (n.isAttributeSet("generic_type"))
411 io.generic_type = n.getAttribute("generic_type");
414 mOutput.push_back(io);
419 // process tag given ?
420 if (BB.nChildNode("process"))
422 bbtk::GetTextOrClear(BB.getChildNode("process"),mProcess);
425 // createwidget tag given ?
426 if (BB.nChildNode("createwidget"))
428 bbtk::GetTextOrClear(BB.getChildNode("createwidget"),mCreateWidget);
431 //==========================================================================
434 //==========================================================================
435 void bbfy::BeginNamespace()
437 // if (mIsInNamespace)
439 mFile << "namespace "<<mNamespace <<"\n{\n\n";
442 //==========================================================================
444 //==========================================================================
445 void bbfy::EndNamespace()
447 // if (mIsInNamespace)
449 mFile << "}\n// EO namespace "<<mNamespace<<"\n\n";
452 //==========================================================================
455 //==========================================================================
456 void bbfy::CreateHeader()
463 if (mVerbose) std::cout << " - Creating header '"<<mHName<<"'"<<std::endl;
464 std::string fullname = mOutputPath + mHName;
465 mFile.open(fullname.c_str());
468 std::string mess("Error : could not open file \"");
469 mess += fullname + "\"";
470 throw bbfyException(mess);
476 mFile << "#ifdef _USE_WXWIDGETS_\n";
479 // Prevent multiple inclusions
480 std::string included("__bb");
481 included += mPackage + mName + "_h_INCLUDED__";
482 mFile << "#ifndef " << included <<"\n";
483 mFile << "#define " << included <<"\n";
486 // mFile << "#include \"bbtkAtomicBlackBox.h\"\n";
487 std::vector<std::string>::iterator i;
488 for (i=mInclude.begin(); i!=mInclude.end(); ++i)
490 mFile << "#include \"" << *i <<"\"\n";
492 if (mGeneric) mFile << "#include \"bbitkImage.h\"\n";
500 // If it is a template class
501 if (mTemplateParam.size() > 0)
503 mFile << "template " << mTemplateDeclaration <<"\n";
506 // Class declaration and parents
507 mFile << "class /*BBTK_EXPORT*/ "<<mName<<"\n";
509 mFile << " public "<<mParentBlackBox;
512 if (mBB.nChildNode("inherits"))
515 for (i=0,j=0; i<mBB.nChildNode("inherits")-1; i++)
518 << mBB.getChildNode("inherits",&j).getText()
522 << mBB.getChildNode("Inherits",&j).getText()
527 if (mType == itkImageToImageFilter )
529 mFile << ",\n public " << mItkParent <<"\n";
531 else if ( (mType == vtkImageAlgorithm) ||
532 (mType == vtkPolyDataAlgorithm) )
534 mFile << ",\n public " << mVtkParent <<"\n";
544 mFile << " BBTK_USER_BLACK_BOX_INTERFACE("
546 << mParentBlackBox << ");\n";
548 // typedef on itkfilter
549 if (mType == itkImageToImageFilter)
551 mFile << " typedef " <<mItkParent <<" itkParent;"<<std::endl;
552 mFile << " void bbDelete() { itkParent::UnRegister(); }"<<std::endl;
554 // typedef on itkfilter
555 if ( (mType == vtkImageAlgorithm) ||
556 (mType == vtkPolyDataAlgorithm) )
558 mFile << " typedef " <<mVtkParent <<" vtkParent;"<<std::endl;
559 mFile << " void bbDelete() { vtkParent::Delete(); }"<<std::endl;
561 for (i=mTypedef.begin(); i!=mTypedef.end(); ++i)
566 // Declare user constructor / copy cons /destr
567 mFile << "//=================================================================="<<std::endl;
568 mFile << "/// User callback called in the box contructor"<<std::endl;
570 mFile << "virtual void bbUserConstructor();"<<std::endl;
571 mFile << "/// User callback called in the box copy constructor"<<std::endl;
572 mFile << "virtual void bbUserCopyConstructor();"<<std::endl;
573 mFile << "/// User callback called in the box destructor"<<std::endl;
574 mFile << "virtual void bbUserDestructor();"<<std::endl;
575 mFile << "//=================================================================="<<std::endl;
580 std::vector<IO>::iterator ioi;
581 for (ioi=mInput.begin(); ioi!=mInput.end(); ++ioi)
583 if (ioi->special=="")
585 mFile << " BBTK_DECLARE_INPUT("
591 else if (ioi->special=="itk input")
593 mFile << " BBTK_DECLARE_ITK_INPUT("
600 else if (ioi->special=="vtk input")
602 if (mType == vtkImageAlgorithm) {
603 mFile << " BBTK_DECLARE_VTK_IMAGE_ALGORITHM_INPUT("
610 else if (mType == vtkPolyDataAlgorithm) {
611 mFile << " BBTK_DECLARE_POLY_DATA_ALGORITHM_INPUT("
619 else if (ioi->special=="itk parameter")
621 mFile << " BBTK_DECLARE_ITK_PARAM("
628 else if (ioi->special=="vtk parameter")
630 mFile << " BBTK_DECLARE_VTK_PARAM("
639 std::string mess("Error : input '");
641 mess += "', 'special' attribute '";
642 mess += ioi->special;
644 throw bbfyException(mess);
649 for (ioi=mOutput.begin(); ioi!=mOutput.end(); ++ioi)
651 if (ioi->special=="")
653 mFile << " BBTK_DECLARE_OUTPUT("
659 else if (ioi->special=="itk output")
661 mFile << " BBTK_DECLARE_ITK_OUTPUT("
668 else if (ioi->special=="vtk output")
670 mFile << " BBTK_DECLARE_VTK_OUTPUT("
679 std::string mess("Error : output '");
681 mess += "', 'special' attribute '";
682 mess += ioi->special;
684 throw bbfyException(mess);
690 if ((mType == STD)||(mProcess.size()))
692 mFile << " BBTK_PROCESS(Process);\n" ;
693 mFile << " void Process();\n";
695 else if (mType == itkImageToImageFilter)
697 mFile << " BBTK_PROCESS(itkParent::Update);\n" ;
699 else if ((mType == vtkImageAlgorithm) ||
700 (mType == vtkPolyDataAlgorithm) )
703 mFile << " BBTK_PROCESS(vtkParent::Update);\n" ;
709 mFile << " BBTK_CREATE_WIDGET(CreateWidget);\n" ;
710 mFile << " void CreateWidget();\n";
714 // EO black box declaration
719 // BO black box description
720 if (mTemplateParam.size()==0)
722 mFile << "BBTK_BEGIN_DESCRIBE_BLACK_BOX("
724 << mParentBlackBox << ");\n";
725 mFile << "BBTK_NAME(\"" << mName <<"\");\n";
727 else if (mTemplateParam.size()==1)
729 mFile << "BBTK_BEGIN_DESCRIBE_TEMPLATE_BLACK_BOX("
731 //<< mParentBlackBox //<< ","
732 // << mTemplateParam[0]
734 mFile << "BBTK_NAME(\"" << mName
735 << "<\"+bbtk::TypeName<" << mTemplateParam[0]
740 throw bbfyException("template bb with more than 1 templ param not impl");
744 mFile << "BBTK_AUTHOR(\""<<mAuthor<< "\");\n";
747 mFile << "BBTK_DESCRIPTION(\""<<mDescription<< "\");\n";
750 mFile << "BBTK_CATEGORY(\""<<mCategory<< "\");\n";
752 for (i=mTypedef.begin(); i!=mTypedef.end(); ++i)
758 for (ioi=mInput.begin(); ioi!=mInput.end(); ++ioi)
760 if (mTemplateParam.size()>0)
762 mFile << "BBTK_TEMPLATE_INPUT(";
766 mFile << "BBTK_INPUT(";
768 mFile << mName << "," << ioi->name << ",\""
769 << ioi->descr << "\"," << ioi->type << ",\""
770 << ioi->nature<<"\");\n";
774 for (ioi=mOutput.begin(); ioi!=mOutput.end(); ++ioi)
776 if (mTemplateParam.size()>0)
778 mFile << "BBTK_TEMPLATE_OUTPUT(";
782 mFile << "BBTK_OUTPUT(";
784 mFile << mName << "," << ioi->name << ",\""
785 << ioi->descr << "\"," << ioi->type << ",\""
786 << ioi->nature<<"\");\n";
789 // EO black box description
790 if (mTemplateParam.size()==0)
792 mFile << "BBTK_END_DESCRIBE_BLACK_BOX("
795 else if (mTemplateParam.size()==1)
797 mFile << "BBTK_END_DESCRIBE_TEMPLATE_BLACK_BOX("
799 // << mTemplateParam[0]
804 throw bbfyException("template bb with more than 1 templ param not impl");
808 // Untemplatization of itk filters
811 WriteGenericITKFilterHeader();
818 // Prevent multiple inclusions
819 mFile << "#endif // " << included <<"\n";
823 mFile << "#endif // _USE_WXWIDGETS_\n";
831 //==========================================================================
835 //==========================================================================
836 void bbfy::WriteGenericITKFilterHeader()
838 mFile << "\n//===================================================\n";
839 mFile << "// Generic \"untemplatized\" filter\n";
840 mFile << "//===================================================\n";
842 // Class declaration and parents
843 mFile << "class /*BBTK_EXPORT*/ "<<mName<<"Generic\n";
845 mFile << " public bbtk::AtomicBlackBox\n";
849 mFile << " BBTK_USER_BLACK_BOX_INTERFACE("
850 << mName << "Generic,bbtk::AtomicBlackBox);\n";
853 std::vector<IO>::iterator ioi;
854 for (ioi=mInput.begin(); ioi!=mInput.end(); ++ioi)
856 mFile << " BBTK_DECLARE_INPUT("
864 for (ioi=mOutput.begin(); ioi!=mOutput.end(); ++ioi)
866 mFile << " BBTK_DECLARE_OUTPUT("
874 mFile << " BBTK_PROCESS(ProcessSwitch);\n";
875 mFile << " private :\n";
876 mFile << " inline void ProcessSwitch();\n";
877 mFile << " template <class T, unsigned int D> void Process();\n";
878 // EO black box declaration
883 // BO black box description
884 mFile << "BBTK_BEGIN_DESCRIBE_BLACK_BOX("
885 << mName << "Generic,bbtk::AtomicBlackBox);\n";
886 mFile << "BBTK_NAME(\"" << mName <<"\");\n";
889 mFile << "BBTK_AUTHOR(\""<<mAuthor<< "\");\n";
892 mFile << "BBTK_DESCRIPTION(\""<<mDescription<< "\");\n";
895 for (ioi=mInput.begin(); ioi!=mInput.end(); ++ioi)
897 mFile << "BBTK_INPUT(";
898 mFile << mName << "Generic," << ioi->name << ",\""
899 << ioi->descr << "\"," << ioi->generic_type <<");\n";
903 for (ioi=mOutput.begin(); ioi!=mOutput.end(); ++ioi)
905 mFile << "BBTK_OUTPUT(";
906 mFile << mName << "Generic," << ioi->name << ",\""
907 << ioi->descr << "\"," << ioi->generic_type <<");\n";
910 // EO black box description
911 mFile << "BBTK_END_DESCRIBE_BLACK_BOX("
912 << mName << "Generic);\n";
915 //=================================================================
916 // ProcessSwitch implementation
917 mFile << "void "<< mName <<"Generic::ProcessSwitch()\n"
919 << "CALL_FOR_ALL_TYPES_AND_DIM(bbGetInputIn()->GetType(),\n"
920 << " bbGetInputIn()->GetDimension(),\n"
923 //=================================================================
926 //=================================================================
927 // Template process implementation
928 mFile << "template <class T, unsigned int D>\n"
929 << "void "<<mName<<"Generic::Process()\n"
931 << " bbtkDebugMessageInc(\"Kernel\",9,\n"
933 << "Generic::Process<\"<<TypeName<T>()<<\",\"<<D<<\">()\"<<std::endl);\n"
935 << " typedef itk::Image<T,D> ImageType;\n"
936 << " typedef "<<mName<<"<ImageType> FilterType;\n"
938 << " FilterType* f = new FilterType(\"Temp\");\n"
940 << " f->bbSetInputIn( this->bbGetInputIn()->GetImage<T,D>() );\n";
942 for (ioi=mInput.begin(); ioi!=mInput.end(); ++ioi)
944 if (ioi->name == "In") continue;
945 mFile << " f->bbSetInput"<<ioi->name<<" ( this->bbGetInput"
946 << ioi->name << "() );\n";
949 mFile << " f->bbUpdate();\n"
950 << " this->bbSetOutputOut( new itkImage( f->bbGetOutputOut() ) );\n"
951 << " f->UnRegister();\n"
952 << " bbtkDebugDecTab(\"Kernel\",9);\n"
954 //=================================================================
958 //==========================================================================
961 //==========================================================================
962 void bbfy::CreateCode()
965 mCxxName += mPackage;
968 if (mVerbose) std::cout << " - Creating code '"<<mCxxName<<"'"<<std::endl;
969 std::string fullname = mOutputPath + mCxxName;
970 mFile.open(fullname.c_str());
973 std::string mess("Error : could not open file \"");
976 throw bbfyException(mess);
980 // Header of the class
981 mFile << "#include \"" << mHName << "\"\n";
983 // Include Package header
984 mFile << "#include \"bb"<<mPackage << "Package.h\"\n";
991 if (mTemplateParam.size()>0)
994 mFile << "BBTK_USER_BLACK_BOX_TEMPLATE_IMPLEMENTATION("
996 << mParentBlackBox << ");\n";
1001 mFile << "BBTK_USER_BLACK_BOX_IMPLEMENTATION("
1002 << mName << "Generic,bbtk::AtomicBlackBox);\n";
1004 mFile << "BBTK_ADD_BLACK_BOX_TO_PACKAGE("
1006 << mName << "Generic)\n";
1011 // Non template class
1013 mFile << "BBTK_ADD_BLACK_BOX_TO_PACKAGE("
1018 mFile << "BBTK_USER_BLACK_BOX_IMPLEMENTATION("
1020 << mParentBlackBox << ");\n";
1023 if ((mType == STD)||(mProcess.size()))
1025 mFile << "void "<<mName<<"::Process()\n{\n";
1026 mFile << mProcess << "\n";
1032 mFile << "void "<<mName<<"::CreateWidget()\n{\n";
1033 mFile << mCreateWidget << "\n";
1038 // User constr / copy constr / destr implementation
1039 mFile <<"void "<<mName<<"::bbUserConstructor()"<<std::endl;
1040 mFile << "{"<<std::endl;
1041 //mFile<<"bbtkDebugMessage(\"Kernel\",9,\""<<mName<<::bbUserConstructor()"<<std::endl);"<<std::endl;
1042 mFile << mUserConstructor << std::endl;
1043 mFile << "}" << std::endl;
1045 mFile <<"void "<<mName<<"::bbUserCopyConstructor()"<<std::endl;
1046 mFile << "{"<<std::endl;
1047 //mFile<<"bbtkDebugMessage(\"Kernel\",9,\""<<mName<<::bbUserCopyConstructor()"<<std::endl);"<<std::endl;
1048 mFile << mUserCopyConstructor << std::endl;
1049 mFile << "}" << std::endl;
1051 mFile <<"void "<<mName<<"::bbUserDestructor()"<<std::endl;
1052 mFile << "{"<<std::endl;
1053 //mFile<<"bbtkDebugMessage(\"Kernel\",9,\""<<mName<<::bbUserDestructor()"<<std::endl);"<<std::endl;
1054 mFile << mUserDestructor << std::endl;
1055 mFile << "}" << std::endl;
1067 //==========================================================================
1073 //==========================================================================
1074 int main(int argc, char **argv)
1077 if (argc<2 || argc>5)
1079 std::cerr << "usage : "<< argv[0] <<" xml_file [package_name] [output_path] [-q]" << std::endl;
1085 std::string package("PACKAGE_NAME");
1086 std::string output_path("");
1087 bool verbose = true;
1088 if (argc>2) package = argv[2];
1089 if (argc>3) output_path = argv[3];
1090 if (argc>4) verbose = false;
1092 bbfy B(argv[1],package,output_path,verbose);
1094 catch (bbfyException e)
1096 std::cerr << argv[0] << " " << argv[1] << std::endl
1097 << e.mMessage << std::endl;
1102 //==========================================================================