X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=kernel%2Fsrc%2FbbtkPackage.cxx;h=7d70c2511faefa7bdbd63ba5935f5932b440996b;hb=efd5498c468f0151a9f8e67ff28c4e54ba57af50;hp=21dfbe3c63aa0980105fd82183b900b04c339b33;hpb=998354bb81a4f450cae3a2263838d7d3b6024bac;p=bbtk.git diff --git a/kernel/src/bbtkPackage.cxx b/kernel/src/bbtkPackage.cxx index 21dfbe3..7d70c25 100644 --- a/kernel/src/bbtkPackage.cxx +++ b/kernel/src/bbtkPackage.cxx @@ -3,8 +3,8 @@ Program: bbtk Module: $RCSfile: bbtkPackage.cxx,v $ Language: C++ - Date: $Date: 2008/02/05 12:16:55 $ - Version: $Revision: 1.4 $ + Date: $Date: 2008/02/18 10:41:02 $ + Version: $Revision: 1.9 $ Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de l'Image). All rights reserved. See doc/license.txt or @@ -41,11 +41,11 @@ namespace bbtk mVersion(version), mBBTKVersion(BBTKVersion) { - std::string default_doc_dir = ConfigurationFile::GetInstance().Get_default_doc_tmp(); + std::string default_doc_dir = ConfigurationFile::GetInstance().Get_default_temp_dir(); char c = default_doc_dir.c_str()[strlen(default_doc_dir.c_str())-1]; std::string url = default_doc_dir; if (c != '/' && c !='\\') url = url + "/"; - url = url + "doc_tmp/" + name + "/index.html"; + url = url + "temp_dir/" + name + "/index.html"; SetDocURL(url); SetDocRelativeURL("Relative url not set"); @@ -61,7 +61,7 @@ namespace bbtk // std::cout << " url=["<second; } */ - bbtkDebugDecTab("Core",7); + bbtkDebugDecTab("Kernel",7); } //========================================================================== @@ -100,16 +100,16 @@ namespace bbtk BlackBox* Package::NewBlackBox(const std::string& type, const std::string& name) const { - bbtkDebugMessageInc("Core",8,"Package<"<::NewBlackBox(\""<::NewBlackBox(\""<second->CreateInstance(name); - bbtkDebugDecTab("Core",8); + bbtkDebugDecTab("Kernel",8); return bb; } @@ -124,7 +124,7 @@ namespace bbtk TypeInfo typeout, const std::string& name) const { - bbtkDebugMessageInc("Core",8,"Package<"<::NewAdaptor(<" <,<" <,\"" @@ -134,11 +134,11 @@ namespace bbtk AdaptorMapType::const_iterator i = mAdaptorMap.find(key); if (i == mAdaptorMap.end()) { - bbtkDebugDecTab("Core",8); + bbtkDebugDecTab("Kernel",8); return 0; } BlackBox* bb =i->second->CreateInstance(name); - bbtkDebugDecTab("Core",8); + bbtkDebugDecTab("Kernel",8); return bb; } @@ -151,7 +151,7 @@ namespace bbtk /// Registers a black box descriptor in the package bool Package::RegisterBlackBox(BlackBoxDescriptor* d) { - bbtkDebugMessageInc("Core",8,"Package<"<::RegisterBlackBox(\""<GetTypeName()<<"\")"<::RegisterBlackBox(\""<GetTypeName()<<"\")"<GetTypeName()] = d; d->SetPackage(this); @@ -165,7 +165,7 @@ namespace bbtk AdaptorMapType::const_iterator i = mAdaptorMap.find(key); if (i == mAdaptorMap.end()) { - bbtkDebugMessage("Core",8,"The box is an adaptor, inserting it in adaptors map ..."<::UnRegisterBlackBox(\""<::UnRegisterBlackBox(\""< does not contains the black box <"<"); } mBlackBoxMap.erase(i); @@ -207,7 +207,7 @@ namespace bbtk mAdaptorMap.erase(j); } */ - bbtkDebugDecTab("Core",8); + bbtkDebugDecTab("Kernel",8); } //========================================================================== @@ -215,12 +215,12 @@ namespace bbtk /// Changes the name of a black box type void Package::ChangeBlackBoxName( const std::string& oldname, const std::string& newname ) { - bbtkDebugMessageInc("Core",8,"Package<"<::ChangeBlackBoxName(\""<::ChangeBlackBoxName(\""< does not contains the black box <"<"); } @@ -228,7 +228,7 @@ namespace bbtk mBlackBoxMap[newname] = i->second; mBlackBoxMap.erase(i); - bbtkDebugDecTab("Core",8); + bbtkDebugDecTab("Kernel",8); } //========================================================================== @@ -238,7 +238,7 @@ namespace bbtk /// Registers an adaptor descriptor in the package bool Package::RegisterAdaptor(BlackBoxDescriptor* d) { - bbtkDebugMessage("Core",8,"Package<"<::RegisterAdaptor(\""<GetTypeName()<<"\")"<::RegisterAdaptor(\""<GetTypeName()<<"\")"<GetInputDescriptor("In")->GetTypeInfo(); TypeInfo typeout = d->GetOutputDescriptor("Out")->GetTypeInfo(); @@ -374,18 +374,18 @@ namespace bbtk /// Prints help on a black box void Package::HelpBlackBox(const std::string& name, bool full) const { - bbtkDebugMessageInc("Core",8,"Package<"<::HelpBlackBox(\"" + bbtkDebugMessageInc("Kernel",8,"Package<"<::HelpBlackBox(\"" < does not contains the black box <"<"); } // bbtkMessage("Help",1,"["<second->GetHelp(full); - bbtkDebugDecTab("Core",8); + bbtkDebugDecTab("Kernel",8); } //========================================================================== @@ -395,16 +395,16 @@ namespace bbtk /// Returns true iff the package contains the box of name boxname bool Package::ContainsBlackBox(const std::string& name) const { - bbtkDebugMessageInc("Core",8,"Package<"<::HelpBlackBox(\"" + bbtkDebugMessageInc("Kernel",8,"Package<"<::HelpBlackBox(\"" <::CreateHtmlPage(\"" + bbtkDebugMessageInc("Kernel",9,"Package<"<::CreateHtmlPage(\"" <second->GetTypeName(); Utilities::html_format(name); std::string descr = i->second->GetDescription(); + Utilities::html_format(descr); s << ""; s << ""; - s << "
  • " <"; s << " "; @@ -546,7 +547,7 @@ namespace bbtk s << "\n"; - s << "
  • \n"; + s << "\n"; s << "\n"; //------------------- @@ -570,7 +571,7 @@ namespace bbtk s << ""; s << ""; - s << "
  • " <"; s << " "; @@ -579,7 +580,7 @@ namespace bbtk } s << "\n"; - s << "
  • \n"; + s << "\n"; s << "\n"; } @@ -601,9 +602,11 @@ namespace bbtk // Computes output directory from filename to pass it to // BlackBoxDescriptor::InsertHtmlHelp std::string dir; - std::string::size_type slash_position = - filename.find_last_of(ConfigurationFile::GetInstance().Get_file_separator ()); - if (slash_position != std::string::npos) { + + std::string::size_type slash_position = filename.find_last_of("/\\"); + + + if (slash_position != std::string::npos) { if (slash_position == 0) slash_position = 1; dir = filename.substr(0,slash_position); @@ -624,8 +627,9 @@ namespace bbtk ptm = gmtime ( &rawtime ); s << "


    \n"; - s << "Automatically generated by "< from " - < on " + s << "Automatically generated by "< "//from " + // < + <<"on " << ptm->tm_mday << "/" << ptm->tm_mon << "/" << ptm->tm_year+1900 << " - " << ptm->tm_hour << ":" << ptm->tm_min << " GMT\n"; s << "\n"; @@ -633,7 +637,7 @@ namespace bbtk //---------------------- // End - bbtkDebugDecTab("Core",9); + bbtkDebugDecTab("Kernel",9); } //========================================================================== }