X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=kernel%2Fsrc%2FbbtkPackage.cxx;h=cdc19203d9e2408d0b46f81e0b7785a10e0741ec;hb=6d2f79e0ff9b1c0b2db0d7f3d164f4f62434f08d;hp=21dfbe3c63aa0980105fd82183b900b04c339b33;hpb=998354bb81a4f450cae3a2263838d7d3b6024bac;p=bbtk.git diff --git a/kernel/src/bbtkPackage.cxx b/kernel/src/bbtkPackage.cxx index 21dfbe3..cdc1920 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/03/07 08:40:14 $ + Version: $Revision: 1.10 $ Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de l'Image). All rights reserved. See doc/license.txt or @@ -35,17 +35,18 @@ namespace bbtk const std::string& description, const std::string& version, const std::string& BBTKVersion) - : mName(name), - mAuthor(author), - mDescription(description), - mVersion(version), - mBBTKVersion(BBTKVersion) + : + mName(name), + mAuthor(author), + mDescription(description), + 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 +62,7 @@ namespace bbtk // std::cout << " url=["<second; } */ - bbtkDebugDecTab("Core",7); + bbtkDebugDecTab("Kernel",7); } //========================================================================== @@ -100,16 +101,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 +125,7 @@ namespace bbtk TypeInfo typeout, const std::string& name) const { - bbtkDebugMessageInc("Core",8,"Package<"<::NewAdaptor(<" <,<" <,\"" @@ -134,11 +135,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 +152,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 +166,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 +208,7 @@ namespace bbtk mAdaptorMap.erase(j); } */ - bbtkDebugDecTab("Core",8); + bbtkDebugDecTab("Kernel",8); } //========================================================================== @@ -215,12 +216,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 +229,7 @@ namespace bbtk mBlackBoxMap[newname] = i->second; mBlackBoxMap.erase(i); - bbtkDebugDecTab("Core",8); + bbtkDebugDecTab("Kernel",8); } //========================================================================== @@ -238,7 +239,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 +375,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 +396,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 +548,7 @@ namespace bbtk s << "\n"; - s << "
  • \n"; + s << "\n"; s << "\n"; //------------------- @@ -570,7 +572,7 @@ namespace bbtk s << ""; s << ""; - s << "
  • " <"; s << " "; @@ -579,7 +581,7 @@ namespace bbtk } s << "\n"; - s << "
  • \n"; + s << "\n"; s << "\n"; } @@ -601,9 +603,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 +628,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 +638,7 @@ namespace bbtk //---------------------- // End - bbtkDebugDecTab("Core",9); + bbtkDebugDecTab("Kernel",9); } //========================================================================== }