X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;ds=sidebyside;f=kernel%2Fsrc%2FbbtkFactory.cxx;h=aa3ee5c2fbc3073d45e7c036de6f89594ca99e43;hb=6ea571ab3b7a539aaaca066db3941f5017920209;hp=fc029ffe30cd4b5148eca6364bcd196255bc4fd0;hpb=71376d8384d5d21b5c56d36ecc8cbf31315c039a;p=bbtk.git diff --git a/kernel/src/bbtkFactory.cxx b/kernel/src/bbtkFactory.cxx index fc029ff..aa3ee5c 100644 --- a/kernel/src/bbtkFactory.cxx +++ b/kernel/src/bbtkFactory.cxx @@ -4,8 +4,8 @@ Program: bbtk Module: $RCSfile: bbtkFactory.cxx,v $ Language: C++ -Date: $Date: 2008/02/05 13:23:46 $ -Version: $Revision: 1.14 $ +Date: $Date: 2008/02/21 09:37:23 $ +Version: $Revision: 1.23 $ Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de @@ -100,154 +100,151 @@ namespace bbtk //=================================================================== -// =================================================================================== - + // =================================================================== bool Factory::DoLoadPackage(std::string libname, std::string pkgname, - std::string path, - bool verbose) + std::string path) { - + #if defined(__GNUC__) - - void *handler; - handler = dlopen(libname.c_str(), - BBTK_RTLD_TIME | BBTK_RTLD_SCOPE ); - if (!handler) - { - // The following is *NOT* a debug time message : - // It's a user intended message. - // Please don't remove it. - if (verbose) { - std::cout <<"[" <[" <[" <[" <[" <GetBBTKVersion() != bbtk::GetVersion() ) - { - std::string v(pack.mPackage->GetBBTKVersion()); - UnLoadPackage(pkgname); - bbtkError(" package build with bbtk version " - << v - << " whereas application build with version " - << bbtk::GetVersion()); - } - - std::string separator = - ConfigurationFile::GetInstance().Get_file_separator (); - //BBTK_STRINGIFY_SYMBOL(BBTK_DOC_REL_PATH) - std::string docreldoc = separator + "packages" + separator + pkgname - + separator + "bbdoc" + separator + "index.html"; - std::string reldoc = ".." + separator + ".." + separator - + ".." + docreldoc; - std::string doc = path + separator + ".." + separator - + BBTK_STRINGIFY_SYMBOL(BBTK_DOC_REL_PATH) - + docreldoc; - - pack.mPackage->SetDocURL(doc); - pack.mPackage->SetDocRelativeURL(reldoc); - + if ( pack.mPackage->GetBBTKVersion() != bbtk::GetVersion() ) + { + std::string v(pack.mPackage->GetBBTKVersion()); + UnLoadPackage(pkgname); + bbtkError("Cannot load package ["<SetDocURL(doc); + pack.mPackage->SetDocRelativeURL(reldoc); + //=================================================================== - bbtkMessage("Output",2,pack.mPackage->GetName()<<" " - <GetVersion() - <<" (bbtk " - <GetBBTKVersion()<<") " - <GetAuthor() << " Category(s) :" - <GetCategory() - <GetDescription()<GetName()<<" " + <GetVersion() + <<" (bbtk " + <GetBBTKVersion()<<") " + <GetAuthor() << " Category(s) :" + <GetCategory() + <GetDescription()<GetPackage" and "DeletePackage". /// "GetPackage" is called to get the pointer on the bbtk::Package of the library /// ("DeletePackage" is not used, its presence is just checked before loading the package). - + /// now, filename is only the last name (no longer the full name!) /// it will be searched within *all* the paths given in bbtk_config.xml + - /// verbose = true (set by "config v") displays the loading process - + void Factory::LoadPackage( const std::string& name, - bool use_configuration_file, bool verbose) + bool use_configuration_file) { // Note : in the following : // name : the user supplied name @@ -322,8 +319,8 @@ namespace bbtk return; } - // std::string path = Utilities::ExpandLibName(upath, verbose); - std::string path = Utilities::ExpandLibName(name, verbose); // keep last item, here. + // std::string path = Utilities::ExpandLibName(upath, false); + std::string path = Utilities::ExpandLibName(name,false); // keep last item, here. if (path != "") { @@ -337,12 +334,12 @@ namespace bbtk // The following is *NOT* a debug time message : // It's a user intended message. // Please don't remove it. - if (verbose) - std::cout <<" [" < - void Factory::HelpBlackBox(const std::string& name, bool full) const + /// Returns the package to which it belongs + void Factory::HelpBlackBox(const std::string& name, + std::string& package, + bool full) const { bbtkDebugMessageInc("Kernel",9,"Factory::HelpBlackBox(\""<second.mPackage->ContainsBlackBox(name)) { i->second.mPackage->HelpBlackBox(name,full); + package = i->second.mPackage->GetName(); found = true; } } @@ -822,6 +823,7 @@ namespace bbtk //=================================================================== void Factory::WriteDotFilePackagesList(FILE *ff) { + bbtkDebugMessageInc("Kernel",9,"Factory::WriteDotFilePackagesList()" <GetName(); keys.push_back(k); - title = "List by package"; + title = "Boxes by package"; } else if (type==Initials) { @@ -931,24 +934,13 @@ namespace bbtk } else if (type==Categories) { - // Split the category string - //std::vector categories; - std::string delimiters = ";,"; Utilities::SplitString(j->second->GetCategory(), delimiters,keys); - - //std::vector::iterator si; - //for (si=categories.begin();si!=categories.end;++si) - // { - // keys.push_back(*si); - // } - title = "Index by category"; - if (keys.size()==0) keys.push_back(" NONE"); - title = "List by category"; + title = "Boxes by category"; } std::vector::const_iterator k; @@ -1021,8 +1013,22 @@ namespace bbtk { s << "


\n"; s << "

Top"; - s << "first<<"\">\n"; - s << "

"<first<<"\n"; + if (type==Packages) + { + s << "first<<"\">\n"; + s << "

first<<"/index.html\">" + << ii->first<<"\n"; + + s << "  -  \n"; + + s << "\n"; + s << "first << "/main.html>(Doxygen documentation of the source)\n"; + } + else + { + s << "first<<"\">\n"; + s << "

"<first<<"\n"; + } s << "

    \n"; s << "

    \n"; @@ -1032,10 +1038,12 @@ namespace bbtk { std::string pack = (*di)->GetPackage()->GetName(); std::string name = (*di)->GetTypeName(); + Utilities::html_format(name); std::string descr = (*di)->GetDescription(); + Utilities::html_format(descr); s << ""; s << " "; @@ -1043,7 +1051,7 @@ namespace bbtk s << "\n"; } s << "
    "; - s << "
  • " <"; s << "
  • \n"; - s << "

\n"; + s << "\n"; s << "\n"; } //----------------------