]> Creatis software - bbtk.git/blob - kernel/src/bbtkConfigurationFile.cxx
3721d79d259d9e4c0b6349ef868eeb2ea2473653
[bbtk.git] / kernel / src / bbtkConfigurationFile.cxx
1 /*=========================================================================
2   Program:   bbtk
3   Module:    $RCSfile: bbtkConfigurationFile.cxx,v $
4   Language:  C++
5   Date:      $Date: 2011/02/28 19:06:55 $
6   Version:   $Revision: 1.35 $
7 =========================================================================*/
8
9 /* ---------------------------------------------------------------------
10
11 * Copyright (c) CREATIS-LRMN (Centre de Recherche en Imagerie Medicale)
12 * Authors : Eduardo Davila, Laurent Guigues, Jean-Pierre Roux
13 *
14 *  This software is governed by the CeCILL-B license under French law and
15 *  abiding by the rules of distribution of free software. You can  use,
16 *  modify and/ or redistribute the software under the terms of the CeCILL-B
17 *  license as circulated by CEA, CNRS and INRIA at the following URL
18 *  http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.html
19 *  or in the file LICENSE.txt.
20 *
21 *  As a counterpart to the access to the source code and  rights to copy,
22 *  modify and redistribute granted by the license, users are provided only
23 *  with a limited warranty  and the software's author,  the holder of the
24 *  economic rights,  and the successive licensors  have only  limited
25 *  liability.
26 *
27 *  The fact that you are presently reading this means that you have had
28 *  knowledge of the CeCILL-B license and that you accept its terms.
29 * ------------------------------------------------------------------------ */
30
31 /**
32  *\file
33  *\brief Class bbtk::ConfigurationFile
34  */
35
36 #include "bbtkConfigurationFile.h"
37 #include "bbtkMessageManager.h"
38 #include "bbtkXML.h"
39 #include "bbtkUtilities.h"
40
41 #include "creaSystem.h"
42
43 #if defined(WIN32)
44 # include <direct.h> // for getcwd
45 # include <windows.h>
46 #endif
47
48
49
50
51 namespace bbtk
52 {
53
54   //====================================================================
55   /// Constructor
56   ConfigurationFile::ConfigurationFile()
57   {
58
59         mFile_separator = VALID_FILE_SEPARATOR;
60
61     // ==> Set system paths
62     mBin_path = Utilities::GetExecutablePath();
63
64
65
66
67 /*      EED 23 Mars 2009
68 #ifdef MACOSX
69     mInstall_path = mBin_path + "/../../../..";
70 #else
71     mInstall_path = mBin_path + "/..";
72 #endif
73 */
74 #ifdef MACOSX
75
76           std::string macPath("Contents/MacOS");
77           int sbp = mBin_path.length();
78           int smp = macPath.length();
79           if (mBin_path.compare( sbp-smp, smp, macPath )==0 )
80           {
81                   mBin_path = mBin_path + "/../../..";
82           }
83
84
85 #endif
86           mInstall_path = mBin_path + "/..";
87
88
89
90     // The relative path to the doc folder (=BBTK_DOC_REL_PATH)
91     //    mDoc_rel_path = BBTK_STRINGIFY_SYMBOL(BBTK_DOC_REL_PATH);
92     // The path to the doc folder (=mInstall_path+"/"+mDoc_rel_path)
93     //    mDoc_path = mInstall_path + "/" + mDoc_rel_path;
94     // Have to create bbtk user's dirs if needed
95
96     // LG 27/01/09 : doc is now user dependent
97     //               and located in user's .bbtk dir /doc
98     // All dirs under .bbtk user's dir are set and created by:
99     InitializeDotBbtkStructure();
100
101     // The relative path to the doc folder (=BBTK_BBS_REL_PATH)
102     mBbs_rel_path = BBTK_STRINGIFY_SYMBOL(BBTK_BBS_REL_PATH);
103     // The path to the bbs folder (=mInstall_path+"/"+mBbs_rel_path)
104     mBbs_path = mInstall_path + "/" + mBbs_rel_path;
105
106     mData_path = mInstall_path + "/" + BBTK_STRINGIFY_SYMBOL(BBTK_DATA_REL_PATH);
107
108     Utilities::replace( mBin_path,
109                         INVALID_FILE_SEPARATOR,
110                         VALID_FILE_SEPARATOR);
111     Utilities::replace( mInstall_path,
112                         INVALID_FILE_SEPARATOR,
113                         VALID_FILE_SEPARATOR);
114     Utilities::replace( mBbs_path,
115                         INVALID_FILE_SEPARATOR,
116                         VALID_FILE_SEPARATOR);
117     Utilities::replace( mData_path,
118                         INVALID_FILE_SEPARATOR,
119                         VALID_FILE_SEPARATOR);
120
121     bbtkMessage("config",1," ==> bin    : '"<<mBin_path<<"'"<<std::endl);
122     bbtkMessage("config",1," ==> prefix : '"<<mInstall_path<<"'"<<std::endl);
123     bbtkMessage("config",1," ==> doc    : '"<<mDoc_path<<"'"<<std::endl);
124     bbtkMessage("config",1," ==> bbs    : '"<<mBbs_path<<"'"<<std::endl);
125     bbtkMessage("config",1," ==> data   : '"<<mData_path<<"'"<<std::endl);
126
127
128
129
130     // bbs_paths
131     // always add "." (current working directory) at the begining
132     mBbs_paths.push_back( "." );
133     // add system bbs path
134     mBbs_paths.push_back(mBbs_path);
135     // add toolsbbtk/appli
136 //EED    std::string toolsappli_rel_path(mFile_separator);
137     std::string toolsappli_rel_path("/");
138 //EED    toolsappli_rel_path +=  "toolsbbtk" + mFile_separator + "appli";
139     toolsappli_rel_path +=  "toolsbbtk/appli";
140     //
141     //-----------------------------------------------------------
142     // LG : REMOVE BUGGY PATH WITH include *:
143     //
144     //    mBbs_paths.push_back(mBbs_path + toolsappli_rel_path);
145     //-----------------------------------------------------------
146     int iStrVec,sizeStrVec;
147
148     sizeStrVec = mBbs_paths.size();
149     for (iStrVec=0;iStrVec<sizeStrVec;iStrVec++){
150       Utilities::replace( mBbs_paths[iStrVec] , INVALID_FILE_SEPARATOR , VALID_FILE_SEPARATOR);
151     }
152
153
154     // always add "." (current working directory) at the begining
155     mPackage_paths.push_back(".");
156     // add system bin path (for build tree / standalone folder install)
157     mPackage_paths.push_back(mBin_path);
158     // add system lib path (for install tree)
159     //EED    mPackage_paths.push_back(mInstall_path + mFile_separator + "lib");
160     mPackage_paths.push_back(mInstall_path + "/lib/creatools");
161     mPackage_paths.push_back(mInstall_path + "/lib64/creatools");
162 #ifdef WIN32
163     // add bin/Debug bin/Release paths (for build/install tree)
164     //EED    mPackage_paths.push_back(mBin_path + mFile_separator + "Debug");
165     mPackage_paths.push_back(mBin_path + "/Debug");
166     //EED    mPackage_paths.push_back(mBin_path + mFile_separator + "Release");
167     mPackage_paths.push_back(mBin_path + "/Release");
168 #endif
169
170     sizeStrVec = mPackage_paths.size();
171     for (iStrVec=0;iStrVec<sizeStrVec;iStrVec++){
172       Utilities::replace( mPackage_paths[iStrVec] , INVALID_FILE_SEPARATOR , VALID_FILE_SEPARATOR);
173     }
174
175
176
177     GetHelp(2);
178
179     // ==> First we look for bbtk_config.xml in "."
180     char buf[2048];
181     const char *currentDir = getcwd(buf, 2048);
182
183     if( !currentDir )
184       {
185         std::cerr << "Path was too long to fit on 2048 bytes ?!?" << std::endl;
186         // \todo : what else?
187         // How abort a constructor and warn the caller function?
188         // LG : throw an exception
189       }
190
191     //    std::string configXmlFullPathName = currentDir + mFile_separator + "bbtk_config.xml";
192     std::string configXmlFullPathName = currentDir ;
193     configXmlFullPathName += "/bbtk_config.xml";
194     Utilities::replace( configXmlFullPathName , INVALID_FILE_SEPARATOR , VALID_FILE_SEPARATOR);
195
196     if ( Utilities::FileExists( configXmlFullPathName ))
197       {
198         bbtkMessage("config",1, "ConfigurationFile : [" << configXmlFullPathName <<
199                     "] found in current directory" << std::endl);
200         //Read(configXmlFullPathName.c_str());
201         // traiter le fichier local
202       }
203
204     // ==> Then we look for bbtk_config.xml in ".bbtk"
205     else
206       {
207         configXmlFullPathName = Utilities::MakeUserSettingsFullFileName("bbtk_config.xml");
208         if (!Utilities::FileExists( configXmlFullPathName ))
209           {
210             // ==> Nothing found, we create bbtk_config.xml in ".bbtk"
211             InstallPath ();
212           }
213       }
214
215     // In any case, deal with bbtk_config.xml!
216     Read(configXmlFullPathName.c_str());
217   }
218   //=========================================================================
219
220   //=========================================================================
221   /// Destructor
222   ConfigurationFile::~ConfigurationFile()
223   {
224   }
225   //=========================================================================
226
227   //=========================================================================
228   void ConfigurationFile::InitializeDotBbtkStructure()
229   {
230     mDot_bbtk_path = Utilities::GetUserSettingsDir();
231     mDot_bbtk_is_new = false;
232     if (!Utilities::FileExists(mDot_bbtk_path)) mDot_bbtk_is_new = true;
233     Utilities::CreateDirectoryIfNeeded(mDot_bbtk_path);
234
235     mDoc_path = Utilities::MakeUserSettingsFullFileName("doc");
236     Utilities::CreateDirectoryIfNeeded(mDoc_path);
237
238     std::string bbdoc_path =
239       Utilities::MakeUserSettingsFullFileName("doc/bbdoc");
240     Utilities::CreateDirectoryIfNeeded(bbdoc_path);
241
242     // Create help_contents.html if does not exist
243     std::string filename = Utilities::MakeUserSettingsFullFileName("doc/help_contents.html");
244     if (!Utilities::FileExists(filename))
245       {
246                         bbtkDebugMessage("config",1,
247                          "* Creating [" << filename << "]" << std::endl);
248                         // The path to the doc folder (=mInstall_path+"/"+mDoc_rel_path)
249                         std::string doc_path = mInstall_path + "/"
250                           + BBTK_STRINGIFY_SYMBOL(BBTK_DOC_REL_PATH) + "/";
251                         Utilities::MakeValidFileName(doc_path);
252
253
254                         std::ofstream f;
255                         f.open(filename.c_str(), std::ios::out );
256                         f << "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD "
257                           << "HTML 4.01 Transitional//EN\">"
258                           << "<html><head><title>Help Contents - bbtk "
259                           << GetVersion() << "</title>"
260                           << "<meta http-equiv=\"Content-Type\" content=\"text/html; "
261                           << "charset=iso-8859-1\"></head><H1>Help Contents</H1>"
262                           << "<a href=\"bbdoc/index-category.html#demo\" "
263                           << "target=\"information\">Demos</a><br>"
264                           << "<a href=\"bbdoc/index-category.html#example\" "
265                           << "target=\"information\">Examples</a>"
266                           << "<H2>Guides</H2>"
267                           << "<a href=\""
268                           << doc_path
269                           << "bbtkUsersGuide/bbtkUsersGuide.pdf"
270                           << "\" target=\"information\">User's Guide</a><br>"
271                           << "<a href=\""
272                           << doc_path
273                           << "bbtkDevelopersGuide/bbtkDevelopersGuide.pdf"
274                           << "\" target=\"information\">Developer's Guide</a><br>"
275                           << "<a href=\""
276                           << doc_path
277                           << "bbtkPackageDevelopersGuide/bbtkPackageDevelopersGuide.pdf"
278                           << "\" target=\"information\">Package Developer's Guide</a><br>"
279                           << "<a href=\""
280                           << doc_path
281                           << "doxygen/bbtk/main.html"
282                           << "\" target=\"information\">bbtk library doxygen doc</a><br>"
283                           << "<H2>Boxes</H2>"
284                           << "<a target=\"information\" href=\"bbdoc/index-alpha.html\">"
285                           << "Alphabetical list</a><br>"
286                           << "<a target=\"information\" href=\"bbdoc/index-package.html\">"
287                           << "List by package</a><br>"
288                           << "<a target=\"information\" href=\"bbdoc/index-category.html\">"
289                           << "List by category</a><br>"
290                           << "<a target=\"information\" href=\"bbdoc/index-adaptors.html\">"
291                           << "List of adaptors</a><br>"
292                           << "</body>"
293                   << "</html>";
294       } // if
295
296     mTemp_path = Utilities::MakeUserSettingsFullFileName("tmp");
297     Utilities::CreateDirectoryIfNeeded(mTemp_path);
298
299   }
300   //=========================================================================
301
302   //=========================================================================
303   void ConfigurationFile::CreateConfigXML( char *rootDirectory )
304   {
305     FILE *fp;
306     char configXml[250];
307     sprintf (configXml , "%s/bbtk_config.xml", rootDirectory);
308     bbtkDebugMessage("config",1, "in CreateConfigXML[" << configXml << "]" << std::endl);
309     fp = fopen (configXml, "w");
310     fprintf(fp, "<?xml version=\"1.0\" encoding=\"iso-8859-1\"?>\n");
311     fprintf(fp, "<config>\n");
312     fprintf(fp, "   <bbs_path>     </bbs_path>\n");
313     fprintf(fp, "   <package_path> </package_path>\n");
314     fprintf(fp, "</config>\n");
315     fclose(fp);
316   }
317   //=========================================================================
318
319
320
321
322   //=========================================================================
323   void ConfigurationFile::InstallPath ()
324   {
325
326     /*--------------------------------------------------
327       New policy for bbtk_config.xml :
328
329       if bbtk_config.xml found in current directory (user is an aware user!)
330       use it!
331
332       else if bbtk_config.xml found in HOME/.bbtk (user already worked with it)
333       use it!
334
335       else if bbtk_config.xml.tmp found in /usr/local/bin or c:\\Program Files\\BBTK\\bin
336       copy it as .bbtk/bbtk_config.xml
337
338       else (nothing installed)
339       create a minimum version in HOME/.bbtk
340       ----------------------------------------------------*/
341
342
343     // -----------------------------------------------------------------
344 #if defined(__GNUC__)
345
346     // ------------------ create some usefull strings ----------------
347     // installed bbtk_path
348     char bbtk_path[1000];
349     strcpy(bbtk_path, Utilities::GetExecutablePath().c_str());  // JPR
350     //strcpy(bbtk_path, "/usr/local/bin");
351
352     // rootDirectory
353     char rootDirectory[200];
354     sprintf( rootDirectory,  "%s/.bbtk", getenv("HOME"));
355
356     // configPath
357     char configPath[200];
358     sprintf(configPath, "%s/bbtk_config.xml",rootDirectory);
359
360     // configXmlTmp
361     char configXmlTmp[250];
362     sprintf(configXmlTmp, "%s/bbtk_config.xml.tmp", bbtk_path);
363
364     // copyFile
365     char copyFile[250];
366
367     if (!Utilities::FileExists(configXmlTmp)) // bbtk_config.xml.tmp not found (not installed)
368       {
369         // if "bbtk_path/bbtk_config.xml.tmp" doesn't exist, hard-create a minimum version in .bbtk
370         CreateConfigXML( rootDirectory );// create .bbtk
371       }
372     else
373       {
374         sprintf(copyFile,"cp %s  %s/bbtk_config.xml ",configXmlTmp,rootDirectory );
375         if (!Utilities::FileExists(configPath))
376           {
377             system(copyFile);
378           }
379       }
380     return;
381
382     // ------------------------------------------------------------------
383 #elif defined(WIN32)
384
385
386     // installed bbtk_path
387     char bbtk_path[100];
388     strcpy(bbtk_path, "\"c:\\Program Files\\BBTK\\bin\"");
389     char bbtk_path2[100];
390     strcpy(bbtk_path2, "c:\\Program Files\\BBTK\\bin");
391
392     // rootDirectory
393     char rootDirectory[200];
394     sprintf(rootDirectory, "%s\\.bbtk",getenv("USERPROFILE"));
395     //  std::cout << "[" << rootDirectory << "]" << std::endl;
396
397     // configPath
398     char configPath[200];
399     sprintf(configPath, "%s\\bbtk_config.xml",rootDirectory);
400
401     // makeDir
402     char makeDir[250];
403     sprintf( makeDir, "mkdir \"%s\" ", rootDirectory);
404
405     // configXmlTmp
406     char configXmlTmp[250];
407     sprintf(configXmlTmp, "%s\\bbtk_config.xml.tmp", bbtk_path2);
408
409     // copyFile
410     char copyFile[250];
411
412     if (!Utilities::FileExists(configXmlTmp)) // bbtk_config.xml.tmp not found
413       {
414         // if "bbtk_path/bbtk_config.xml.tmp" doesn't exist, hard-create a minimum version in .bbtk
415         CreateConfigXML( rootDirectory );// create .bbtk
416         return;
417       }
418
419     sprintf(copyFile,"copy %s\\bbtk_config.xml.tmp \"%s\"\\bbtk_config.xml ",bbtk_path,rootDirectory );
420
421     int attribs = GetFileAttributes (rootDirectory);
422     bbtkMessage("config",1,std::hex << attribs << " " << FILE_ATTRIBUTE_DIRECTORY << std::endl);
423     if ( attribs != 0xFFFFFFFF)
424       {
425         if ((attribs & FILE_ATTRIBUTE_DIRECTORY) == FILE_ATTRIBUTE_DIRECTORY ) /// \TODO : check !
426           {
427             if ( GetFileAttributes( configPath ) == 0xFFFFFFFF)
428               {
429                 system(copyFile);
430               }
431           }
432       }
433     else
434       {
435         system(makeDir);
436         system(copyFile);
437       }
438     return;
439     // ------------------------------------------------------------------
440 #else
441 /// \todo  ConfigurationFile::InstallPath() : exit when for not WIN32 and not__GNUC__
442
443   return;
444 #endif
445
446 }
447   //=========================================================================
448
449
450
451   //=========================================================================
452   // Gets the list of directories holding bb scripts, packages, dll, ... from the xml file
453   //      bbtk_config.xml
454
455   void ConfigurationFile::Read(const std::string& filename)
456   {
457
458     bbtkDebugMessage("config",1,"ConfigurationFile::Read(" <<filename << ")" << std::endl);
459
460     mConfig_xml_full_path = filename;
461     XMLResults* res = new XMLResults;
462     XMLNode BB = XMLNode::parseFile((XMLCSTR)filename.c_str(),(XMLCSTR)"config",res);
463
464     if ( res->error != eXMLErrorNone )
465       {
466         std::string mess = GetErrorMessage(res,filename);
467         delete res;
468         bbtkDebugMessage("config",1,mess<< std::endl);
469         bbtkError(mess);
470       }
471     delete res;
472
473     bbtkDebugMessage("config",1,"OK" << std::endl);
474
475     int i,j;
476
477     // Description
478     for (i=0,j=0; i<BB.nChildNode((XMLCSTR)"description"); i++)
479       {
480         std::string val;
481         GetTextOrClear(BB.getChildNode((XMLCSTR)"description",&j),val);
482         mDescription += val;
483       }
484
485     // Url
486     if( BB.nChildNode((XMLCSTR)"url") )
487       GetTextOrClear(BB.getChildNode((XMLCSTR)"url"),mUrl);
488
489     // Data_Path
490     if( BB.nChildNode((XMLCSTR)"data_path") )
491       GetTextOrClear(BB.getChildNode((XMLCSTR)"data_path"),mData_path);
492
493     // install_path
494     //  if( BB.nChildNode((XMLCSTR)"install_path") )
495     //   GetTextOrClear(BB.getChildNode((XMLCSTR)"install_path"),mInstall_path);
496
497     // add user bbs paths
498     for (i=0,j=0; i<BB.nChildNode((XMLCSTR)"bbs_path"); i++)
499       {
500         std::string val;
501         GetTextOrClear(BB.getChildNode((XMLCSTR)"bbs_path",&j),val);
502         mBbs_paths.push_back(val);
503       }
504
505     // package_paths
506
507     // add user package path
508     for (i=0,j=0; i<BB.nChildNode((XMLCSTR)"package_path"); i++)
509       {
510         std::string val;
511         GetTextOrClear(BB.getChildNode((XMLCSTR)"package_path",&j),val);
512         mPackage_paths.push_back(val);
513       }
514
515     // default_temp_dir
516     /*
517     if( BB.nChildNode((XMLCSTR)"default_temp_dir") )
518       GetTextOrClear(BB.getChildNode((XMLCSTR)"default_temp_dir"),mDefault_temp_dir);
519
520     if ( mDefault_temp_dir == "$") // no value found in config_xml
521       {
522         size_t pos = mConfig_xml_full_path.find("bbtk_config.xml");
523         mDefault_temp_dir = mConfig_xml_full_path.substr (0,pos);
524       }
525     */
526
527     GetHelp(2);
528   }
529   //=========================================================================
530
531   //=========================================================================
532   bool ConfigurationFile::AddPackagePathsAndWrite( const std::string& path )
533   {
534     bbtkDebugMessageInc("config",9,
535                         "ConfigurationFile::AddPackagePathsAndWrite("
536                         <<path<<")"<<std::endl);
537
538      XMLResults* res = new XMLResults;
539     XMLNode BB =
540       XMLNode::parseFile((XMLCSTR)Get_config_xml_full_path().c_str(),
541                          (XMLCSTR)"config",res);
542
543     if ( res->error != eXMLErrorNone )
544       {
545         std::string mess = GetErrorMessage(res,Get_config_xml_full_path());
546         delete res;
547         bbtkDebugMessage("config",1,mess<< std::endl);
548         bbtkError(mess);
549       }
550    delete res;
551
552 #ifdef _WIN32
553     std::string bbs_path = path + "/bbs";
554 #else
555     std::string bbs_path = path + "/share/bbtk/bbs" ;
556 #endif
557     XMLNode BBSPATH = BB.addChild((XMLCSTR)"bbs_path");
558     BBSPATH.addText((XMLCSTR)bbs_path.c_str());
559     Utilities::replace(bbs_path, INVALID_FILE_SEPARATOR, VALID_FILE_SEPARATOR);
560     mBbs_paths.push_back(bbs_path);
561
562 #ifdef _WIN32
563     std::string pack_path = path + "/bin";
564 #else
565     std::string pack_path = path ;
566 #endif
567     XMLNode PACKPATH = BB.addChild((XMLCSTR)"package_path");
568     PACKPATH.addText((XMLCSTR)pack_path.c_str());
569     Utilities::replace(pack_path,INVALID_FILE_SEPARATOR,VALID_FILE_SEPARATOR);
570     mPackage_paths.push_back(pack_path);
571
572 #ifdef _WIN32
573     pack_path = path + "/RelWithDebInfo";
574     PACKPATH = BB.addChild((XMLCSTR)"package_path");
575     PACKPATH.addText((XMLCSTR)pack_path.c_str());
576     Utilities::replace(pack_path,INVALID_FILE_SEPARATOR,VALID_FILE_SEPARATOR);
577     mPackage_paths.push_back(pack_path);
578     pack_path = path + "/Debug";
579     PACKPATH = BB.addChild((XMLCSTR)"package_path");
580     PACKPATH.addText((XMLCSTR)pack_path.c_str());
581     Utilities::replace(pack_path,INVALID_FILE_SEPARATOR,VALID_FILE_SEPARATOR);
582     mPackage_paths.push_back(pack_path);
583     pack_path = path + "/Release";
584     PACKPATH = BB.addChild((XMLCSTR)"package_path");
585     PACKPATH.addText((XMLCSTR)pack_path.c_str());
586     Utilities::replace(pack_path,INVALID_FILE_SEPARATOR,VALID_FILE_SEPARATOR);
587     mPackage_paths.push_back(pack_path);
588 #endif
589
590
591     XMLError err = BB.writeToFile((XMLCSTR)Get_config_xml_full_path().c_str());
592     if ( err != eXMLErrorNone )
593       {
594         std::string mess = GetErrorMessage(res,Get_config_xml_full_path());
595         bbtkDebugMessage("config",1,mess<< std::endl);
596         bbtkError(mess);
597       }
598
599     return true;
600   }
601   //=========================================================================
602
603   //=========================================================================
604   void ConfigurationFile::GetHelp(int level) const
605   {
606     bbtkDebugMessageInc("config",9,"ConfigurationFile::GetHelp("<<level
607                         <<")"<<std::endl);
608
609     const std::string config_xml_full_path      = Get_config_xml_full_path();
610     const std::string description               = Get_description();
611     const std::string url                       = Get_doc_path();
612     const std::string data_path                 = Get_data_path();
613     const std::string default_temp_dir          = Get_default_temp_dir();
614     const std::string file_separator            = Get_file_separator();
615     const std::vector<std::string>bbs_paths     = Get_bbs_paths();
616     const std::vector<std::string>package_paths = Get_package_paths();
617
618     bbtkMessage("help",level, "============="   << std::endl);
619     bbtkMessage("help",level, "Configuration"   << std::endl);
620     bbtkMessage("help",level, "============="   << std::endl);
621     bbtkMessage("help",level, "bbtk_config.xml    : [" << config_xml_full_path  << "]" << std::endl);
622     bbtkMessage("help",level, "Documentation Path : [" << url             << "]" << std::endl);
623     bbtkMessage("help",level, "Data Path          : [" << data_path       << "]" << std::endl);
624     bbtkMessage("help",level, "Temp Directory     : [" << default_temp_dir << "]" << std::endl);
625     bbtkMessage("help",level, "File Separator     : [" << file_separator  << "]" << std::endl);
626
627     std::vector<std::string>::const_iterator i;
628
629     bbtkMessage("help",level, "BBS Paths   " << std::endl);
630     for (i = bbs_paths.begin(); i!=bbs_paths.end(); ++i )
631     {
632       bbtkMessage("help",level,"--- ["<<*i<<"]"<<std::endl);
633     }
634
635     bbtkMessage("help",level, "PACKAGE Paths : " << std::endl);
636     for (i = package_paths.begin(); i!=package_paths.end(); ++i )
637     {
638       bbtkMessage("help",level,"--- ["<<*i<<"]"<<std::endl);
639     }
640
641     bbtkDebugDecTab("config",9);
642   }
643   //=========================================================================
644
645
646 } // namespace bbtk