]> Creatis software - bbtk.git/blobdiff - kernel/src/bbtkFactory.cxx
Factory debuging
[bbtk.git] / kernel / src / bbtkFactory.cxx
index fc029ffe30cd4b5148eca6364bcd196255bc4fd0..138006cc7a1b01ebe7e05d6c0b309b1e6c902ac1 100644 (file)
@@ -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/14 12:15:59 $
+Version:   $Revision: 1.20 $
                                                                                 
 
 Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
@@ -109,6 +109,7 @@ namespace bbtk
   {
 
 #if defined(__GNUC__)
+       verbose = true;
 
         void *handler;
         handler = dlopen(libname.c_str(),
@@ -222,10 +223,10 @@ namespace bbtk
         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 docreldoc = 
+         separator + "bbdoc" + separator + pkgname + separator + "index.html";
+        std::string reldoc = 
+         ".." + separator + ".." + docreldoc;
         std::string doc = path + separator + ".." + separator
          + BBTK_STRINGIFY_SYMBOL(BBTK_DOC_REL_PATH)
          + docreldoc;
@@ -583,7 +584,10 @@ namespace bbtk
 
   //===================================================================
   /// Prints help on the black box of type <name>
-  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(\""<<name<<"\")"
                         <<std::endl);
@@ -595,6 +599,7 @@ namespace bbtk
       if (i->second.mPackage->ContainsBlackBox(name)) 
         {
           i->second.mPackage->HelpBlackBox(name,full);
+             package = i->second.mPackage->GetName();
           found = true;
         }
       }
@@ -855,10 +860,10 @@ namespace bbtk
       {
          std::string separator = ConfigurationFile::GetInstance().Get_file_separator ();
 
-            // Don't pollute the file store with  "doc_tmp" directories ...    
-         std::string default_doc_dir = ConfigurationFile::GetInstance().Get_default_doc_tmp();
-         std::string directory = "\"" + default_doc_dir + separator + "doc_tmp"  +separator + "\"";
-         std::string filename2 =  default_doc_dir + separator + "doc_tmp" + separator + "tmp.html"; 
+            // Don't pollute the file store with  "temp_dir" directories ...    
+         std::string default_doc_dir = ConfigurationFile::GetInstance().Get_default_temp_dir();
+         std::string directory = "\"" + default_doc_dir + separator + "temp_dir"  +separator + "\"";
+         std::string filename2 =  default_doc_dir + separator + "temp_dir" + separator + "tmp.html"; 
 
 #if defined(_WIN32)  
         std::string command("start \"Titre\" /D ");
@@ -920,7 +925,7 @@ namespace bbtk
                std::string k("");
                k += pack->GetName();
                keys.push_back(k);
-               title = "List by package";
+               title = "Boxes by package";
              }
            else if (type==Initials)
              {
@@ -931,24 +936,13 @@ namespace bbtk
              }
            else if (type==Categories)
              {
-
                // Split the category string 
-               //std::vector<std::string> categories;
-
                std::string delimiters = ";,";
                Utilities::SplitString(j->second->GetCategory(),
                                       delimiters,keys);
-
-               //std::vector<std::string>::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<std::string>::const_iterator k;
@@ -1021,8 +1015,17 @@ namespace bbtk
       {
        s << "<p><hr>\n";
        s << "<p><a href=\"#Top\">Top</a>";
-       s << "<a name=\""<<ii->first<<"\"></a>\n"; 
-       s << "<p><b>"<<ii->first<<"</b>\n";
+       if (type==Packages)
+         {
+           s << "<a name=\""<<ii->first<<"\"></a>\n"; 
+           s << "<p><a href=\""<<ii->first<<"/index.html\">"
+             << ii->first<<"</a>\n"; 
+         }
+       else 
+         {
+           s << "<a name=\""<<ii->first<<"\"></a>\n"; 
+           s << "<p><b>"<<ii->first<<"</b>\n";
+         }
        s << "<ul>\n";
 
        s << "<p><TABLE cellspacing=0  cellpadding=3>\n";
@@ -1032,10 +1035,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 << "<TR>";
            s << "<TD style='vertical-align: top;'>";
-           s << "<li><a href=\""<<pack
+           s << "&nbsp;&nbsp;&nbsp;<a href=\""<<pack
              <<"/index.html#"<<name<<"\">"
              <<pack<<"::"<<name<<"</a>";
            s << "</TD> ";
@@ -1043,7 +1048,7 @@ namespace bbtk
            s << "</TR>\n";
          }    
        s << "</TABLE>\n";
-       s << "</li></ul>\n";
+       s << "</ul>\n";
        s << "</div>\n";
       }
     //----------------------