]> Creatis software - bbtk.git/blob - kernel/src/bbtkConfigurationFile.cxx
408c7f765391bf0a99aee4717faca3b1399787ee
[bbtk.git] / kernel / src / bbtkConfigurationFile.cxx
1 /*=========================================================================
2   Program:   bbtk
3   Module:    $RCSfile: bbtkConfigurationFile.cxx,v $
4   Language:  C++
5   Date:      $Date: 2011/03/08 11:32:02 $
6   Version:   $Revision: 1.36 $
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");
161     mPackage_paths.push_back(mInstall_path + "/lib64");
162     mPackage_paths.push_back(mInstall_path + "/lib/creatools");
163     mPackage_paths.push_back(mInstall_path + "/lib64/creatools");
164 #ifdef WIN32
165     // add bin/Debug bin/Release paths (for build/install tree)
166     //EED    mPackage_paths.push_back(mBin_path + mFile_separator + "Debug");
167     mPackage_paths.push_back(mBin_path + "/Debug");
168     //EED    mPackage_paths.push_back(mBin_path + mFile_separator + "Release");
169     mPackage_paths.push_back(mBin_path + "/Release");
170 #endif
171
172     sizeStrVec = mPackage_paths.size();
173     for (iStrVec=0;iStrVec<sizeStrVec;iStrVec++){
174       Utilities::replace( mPackage_paths[iStrVec] , INVALID_FILE_SEPARATOR , VALID_FILE_SEPARATOR);
175     }
176
177
178
179     GetHelp(2);
180
181     // ==> First we look for bbtk_config.xml in "."
182     char buf[2048];
183     const char *currentDir = getcwd(buf, 2048);
184
185     if( !currentDir )
186       {
187         std::cerr << "Path was too long to fit on 2048 bytes ?!?" << std::endl;
188         // \todo : what else?
189         // How abort a constructor and warn the caller function?
190         // LG : throw an exception
191       }
192
193     //    std::string configXmlFullPathName = currentDir + mFile_separator + "bbtk_config.xml";
194     std::string configXmlFullPathName = currentDir ;
195     configXmlFullPathName += "/bbtk_config.xml";
196     Utilities::replace( configXmlFullPathName , INVALID_FILE_SEPARATOR , VALID_FILE_SEPARATOR);
197
198     if ( Utilities::FileExists( configXmlFullPathName ))
199       {
200         bbtkMessage("config",1, "ConfigurationFile : [" << configXmlFullPathName <<
201                     "] found in current directory" << std::endl);
202         //Read(configXmlFullPathName.c_str());
203         // traiter le fichier local
204       }
205
206     // ==> Then we look for bbtk_config.xml in ".bbtk"
207     else
208       {
209         configXmlFullPathName = Utilities::MakeUserSettingsFullFileName("bbtk_config.xml");
210         if (!Utilities::FileExists( configXmlFullPathName ))
211           {
212             // ==> Nothing found, we create bbtk_config.xml in ".bbtk"
213             InstallPath ();
214           }
215       }
216
217     // In any case, deal with bbtk_config.xml!
218     Read(configXmlFullPathName.c_str());
219   }
220   //=========================================================================
221
222   //=========================================================================
223   /// Destructor
224   ConfigurationFile::~ConfigurationFile()
225   {
226   }
227   //=========================================================================
228
229   //=========================================================================
230   void ConfigurationFile::InitializeDotBbtkStructure()
231   {
232     mDot_bbtk_path = Utilities::GetUserSettingsDir();
233     mDot_bbtk_is_new = false;
234     if (!Utilities::FileExists(mDot_bbtk_path)) mDot_bbtk_is_new = true;
235     Utilities::CreateDirectoryIfNeeded(mDot_bbtk_path);
236
237     mDoc_path = Utilities::MakeUserSettingsFullFileName("doc");
238     Utilities::CreateDirectoryIfNeeded(mDoc_path);
239
240     std::string bbdoc_path =
241       Utilities::MakeUserSettingsFullFileName("doc/bbdoc");
242     Utilities::CreateDirectoryIfNeeded(bbdoc_path);
243
244     // Create help_contents.html if does not exist
245     std::string filename = Utilities::MakeUserSettingsFullFileName("doc/help_contents.html");
246     if (!Utilities::FileExists(filename))
247       {
248                         bbtkDebugMessage("config",1,
249                          "* Creating [" << filename << "]" << std::endl);
250                         // The path to the doc folder (=mInstall_path+"/"+mDoc_rel_path)
251                         std::string doc_path = mInstall_path + "/"
252                           + BBTK_STRINGIFY_SYMBOL(BBTK_DOC_REL_PATH) + "/";
253                         Utilities::MakeValidFileName(doc_path);
254
255
256                         std::ofstream f;
257                         f.open(filename.c_str(), std::ios::out );
258                         f << "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD "
259                           << "HTML 4.01 Transitional//EN\">"
260                           << "<html><head><title>Help Contents - bbtk "
261                           << GetVersion() << "</title>"
262                           << "<meta http-equiv=\"Content-Type\" content=\"text/html; "
263                           << "charset=iso-8859-1\"></head><H1>Help Contents</H1>"
264                           << "<a href=\"bbdoc/index-category.html#demo\" "
265                           << "target=\"information\">Demos</a><br>"
266                           << "<a href=\"bbdoc/index-category.html#example\" "
267                           << "target=\"information\">Examples</a>"
268                           << "<H2>Guides</H2>"
269                           << "<a href=\""
270                           << doc_path
271                           << "bbtkUsersGuide/bbtkUsersGuide.pdf"
272                           << "\" target=\"information\">User's Guide</a><br>"
273                           << "<a href=\""
274                           << doc_path
275                           << "bbtkDevelopersGuide/bbtkDevelopersGuide.pdf"
276                           << "\" target=\"information\">Developer's Guide</a><br>"
277                           << "<a href=\""
278                           << doc_path
279                           << "bbtkPackageDevelopersGuide/bbtkPackageDevelopersGuide.pdf"
280                           << "\" target=\"information\">Package Developer's Guide</a><br>"
281                           << "<a href=\""
282                           << doc_path
283                           << "doxygen/bbtk/main.html"
284                           << "\" target=\"information\">bbtk library doxygen doc</a><br>"
285                           << "<H2>Boxes</H2>"
286                           << "<a target=\"information\" href=\"bbdoc/index-alpha.html\">"
287                           << "Alphabetical list</a><br>"
288                           << "<a target=\"information\" href=\"bbdoc/index-package.html\">"
289                           << "List by package</a><br>"
290                           << "<a target=\"information\" href=\"bbdoc/index-category.html\">"
291                           << "List by category</a><br>"
292                           << "<a target=\"information\" href=\"bbdoc/index-adaptors.html\">"
293                           << "List of adaptors</a><br>"
294                           << "</body>"
295                   << "</html>";
296       } // if
297
298     mTemp_path = Utilities::MakeUserSettingsFullFileName("tmp");
299     Utilities::CreateDirectoryIfNeeded(mTemp_path);
300
301   }
302   //=========================================================================
303
304   //=========================================================================
305   void ConfigurationFile::CreateConfigXML( char *rootDirectory )
306   {
307     FILE *fp;
308     char configXml[250];
309     sprintf (configXml , "%s/bbtk_config.xml", rootDirectory);
310     bbtkDebugMessage("config",1, "in CreateConfigXML[" << configXml << "]" << std::endl);
311     fp = fopen (configXml, "w");
312     fprintf(fp, "<?xml version=\"1.0\" encoding=\"iso-8859-1\"?>\n");
313     fprintf(fp, "<config>\n");
314     fprintf(fp, "   <bbs_path>     </bbs_path>\n");
315     fprintf(fp, "   <package_path> </package_path>\n");
316     fprintf(fp, "</config>\n");
317     fclose(fp);
318   }
319   //=========================================================================
320
321
322
323
324   //=========================================================================
325   void ConfigurationFile::InstallPath ()
326   {
327
328     /*--------------------------------------------------
329       New policy for bbtk_config.xml :
330
331       if bbtk_config.xml found in current directory (user is an aware user!)
332       use it!
333
334       else if bbtk_config.xml found in HOME/.bbtk (user already worked with it)
335       use it!
336
337       else if bbtk_config.xml.tmp found in /usr/local/bin or c:\\Program Files\\BBTK\\bin
338       copy it as .bbtk/bbtk_config.xml
339
340       else (nothing installed)
341       create a minimum version in HOME/.bbtk
342       ----------------------------------------------------*/
343
344
345     // -----------------------------------------------------------------
346 #if defined(__GNUC__)
347
348     // ------------------ create some usefull strings ----------------
349     // installed bbtk_path
350     char bbtk_path[1000];
351     strcpy(bbtk_path, Utilities::GetExecutablePath().c_str());  // JPR
352     //strcpy(bbtk_path, "/usr/local/bin");
353
354     // rootDirectory
355     char rootDirectory[200];
356     sprintf( rootDirectory,  "%s/.bbtk", getenv("HOME"));
357
358     // configPath
359     char configPath[200];
360     sprintf(configPath, "%s/bbtk_config.xml",rootDirectory);
361
362     // configXmlTmp
363     char configXmlTmp[250];
364     sprintf(configXmlTmp, "%s/bbtk_config.xml.tmp", bbtk_path);
365
366     // copyFile
367     char copyFile[250];
368
369     if (!Utilities::FileExists(configXmlTmp)) // bbtk_config.xml.tmp not found (not installed)
370       {
371         // if "bbtk_path/bbtk_config.xml.tmp" doesn't exist, hard-create a minimum version in .bbtk
372         CreateConfigXML( rootDirectory );// create .bbtk
373       }
374     else
375       {
376         sprintf(copyFile,"cp %s  %s/bbtk_config.xml ",configXmlTmp,rootDirectory );
377         if (!Utilities::FileExists(configPath))
378           {
379             system(copyFile);
380           }
381       }
382     return;
383
384     // ------------------------------------------------------------------
385 #elif defined(WIN32)
386
387
388     // installed bbtk_path
389     char bbtk_path[100];
390     strcpy(bbtk_path, "\"c:\\Program Files\\BBTK\\bin\"");
391     char bbtk_path2[100];
392     strcpy(bbtk_path2, "c:\\Program Files\\BBTK\\bin");
393
394     // rootDirectory
395     char rootDirectory[200];
396     sprintf(rootDirectory, "%s\\.bbtk",getenv("USERPROFILE"));
397     //  std::cout << "[" << rootDirectory << "]" << std::endl;
398
399     // configPath
400     char configPath[200];
401     sprintf(configPath, "%s\\bbtk_config.xml",rootDirectory);
402
403     // makeDir
404     char makeDir[250];
405     sprintf( makeDir, "mkdir \"%s\" ", rootDirectory);
406
407     // configXmlTmp
408     char configXmlTmp[250];
409     sprintf(configXmlTmp, "%s\\bbtk_config.xml.tmp", bbtk_path2);
410
411     // copyFile
412     char copyFile[250];
413
414     if (!Utilities::FileExists(configXmlTmp)) // bbtk_config.xml.tmp not found
415       {
416         // if "bbtk_path/bbtk_config.xml.tmp" doesn't exist, hard-create a minimum version in .bbtk
417         CreateConfigXML( rootDirectory );// create .bbtk
418         return;
419       }
420
421     sprintf(copyFile,"copy %s\\bbtk_config.xml.tmp \"%s\"\\bbtk_config.xml ",bbtk_path,rootDirectory );
422
423     int attribs = GetFileAttributes (rootDirectory);
424     bbtkMessage("config",1,std::hex << attribs << " " << FILE_ATTRIBUTE_DIRECTORY << std::endl);
425     if ( attribs != 0xFFFFFFFF)
426       {
427         if ((attribs & FILE_ATTRIBUTE_DIRECTORY) == FILE_ATTRIBUTE_DIRECTORY ) /// \TODO : check !
428           {
429             if ( GetFileAttributes( configPath ) == 0xFFFFFFFF)
430               {
431                 system(copyFile);
432               }
433           }
434       }
435     else
436       {
437         system(makeDir);
438         system(copyFile);
439       }
440     return;
441     // ------------------------------------------------------------------
442 #else
443 /// \todo  ConfigurationFile::InstallPath() : exit when for not WIN32 and not__GNUC__
444
445   return;
446 #endif
447
448 }
449   //=========================================================================
450
451
452
453   //=========================================================================
454   // Gets the list of directories holding bb scripts, packages, dll, ... from the xml file
455   //      bbtk_config.xml
456
457   void ConfigurationFile::Read(const std::string& filename)
458   {
459
460     bbtkDebugMessage("config",1,"ConfigurationFile::Read(" <<filename << ")" << std::endl);
461
462     mConfig_xml_full_path = filename;
463     XMLResults* res = new XMLResults;
464     XMLNode BB = XMLNode::parseFile((XMLCSTR)filename.c_str(),(XMLCSTR)"config",res);
465
466     if ( res->error != eXMLErrorNone )
467       {
468         std::string mess = GetErrorMessage(res,filename);
469         delete res;
470         bbtkDebugMessage("config",1,mess<< std::endl);
471         bbtkError(mess);
472       }
473     delete res;
474
475     bbtkDebugMessage("config",1,"OK" << std::endl);
476
477     int i,j;
478
479     // Description
480     for (i=0,j=0; i<BB.nChildNode((XMLCSTR)"description"); i++)
481       {
482         std::string val;
483         GetTextOrClear(BB.getChildNode((XMLCSTR)"description",&j),val);
484         mDescription += val;
485       }
486
487     // Url
488     if( BB.nChildNode((XMLCSTR)"url") )
489       GetTextOrClear(BB.getChildNode((XMLCSTR)"url"),mUrl);
490
491     // Data_Path
492     if( BB.nChildNode((XMLCSTR)"data_path") )
493       GetTextOrClear(BB.getChildNode((XMLCSTR)"data_path"),mData_path);
494
495     // install_path
496     //  if( BB.nChildNode((XMLCSTR)"install_path") )
497     //   GetTextOrClear(BB.getChildNode((XMLCSTR)"install_path"),mInstall_path);
498
499     // add user bbs paths
500     for (i=0,j=0; i<BB.nChildNode((XMLCSTR)"bbs_path"); i++)
501       {
502         std::string val;
503         GetTextOrClear(BB.getChildNode((XMLCSTR)"bbs_path",&j),val);
504         mBbs_paths.push_back(val);
505       }
506
507     // package_paths
508
509     // add user package path
510     for (i=0,j=0; i<BB.nChildNode((XMLCSTR)"package_path"); i++)
511       {
512         std::string val;
513         GetTextOrClear(BB.getChildNode((XMLCSTR)"package_path",&j),val);
514         mPackage_paths.push_back(val);
515       }
516
517     // default_temp_dir
518     /*
519     if( BB.nChildNode((XMLCSTR)"default_temp_dir") )
520       GetTextOrClear(BB.getChildNode((XMLCSTR)"default_temp_dir"),mDefault_temp_dir);
521
522     if ( mDefault_temp_dir == "$") // no value found in config_xml
523       {
524         size_t pos = mConfig_xml_full_path.find("bbtk_config.xml");
525         mDefault_temp_dir = mConfig_xml_full_path.substr (0,pos);
526       }
527     */
528
529     GetHelp(2);
530   }
531   //=========================================================================
532
533   //=========================================================================
534   bool ConfigurationFile::AddPackagePathsAndWrite( const std::string& path )
535   {
536     bbtkDebugMessageInc("config",9,
537                         "ConfigurationFile::AddPackagePathsAndWrite("
538                         <<path<<")"<<std::endl);
539
540      XMLResults* res = new XMLResults;
541     XMLNode BB =
542       XMLNode::parseFile((XMLCSTR)Get_config_xml_full_path().c_str(),
543                          (XMLCSTR)"config",res);
544
545     if ( res->error != eXMLErrorNone )
546       {
547         std::string mess = GetErrorMessage(res,Get_config_xml_full_path());
548         delete res;
549         bbtkDebugMessage("config",1,mess<< std::endl);
550         bbtkError(mess);
551       }
552    delete res;
553
554 #ifdef _WIN32
555     std::string bbs_path = path + "/bbs";
556 #else
557     std::string bbs_path = path + "/share/bbtk/bbs" ;
558 #endif
559     XMLNode BBSPATH = BB.addChild((XMLCSTR)"bbs_path");
560     BBSPATH.addText((XMLCSTR)bbs_path.c_str());
561     Utilities::replace(bbs_path, INVALID_FILE_SEPARATOR, VALID_FILE_SEPARATOR);
562     mBbs_paths.push_back(bbs_path);
563
564 #ifdef _WIN32
565     std::string pack_path = path + "/bin";
566 #else
567     std::string pack_path = path ;
568 #endif
569     XMLNode PACKPATH = BB.addChild((XMLCSTR)"package_path");
570     PACKPATH.addText((XMLCSTR)pack_path.c_str());
571     Utilities::replace(pack_path,INVALID_FILE_SEPARATOR,VALID_FILE_SEPARATOR);
572     mPackage_paths.push_back(pack_path);
573
574 #ifdef _WIN32
575     pack_path = path + "/RelWithDebInfo";
576     PACKPATH = BB.addChild((XMLCSTR)"package_path");
577     PACKPATH.addText((XMLCSTR)pack_path.c_str());
578     Utilities::replace(pack_path,INVALID_FILE_SEPARATOR,VALID_FILE_SEPARATOR);
579     mPackage_paths.push_back(pack_path);
580     pack_path = path + "/Debug";
581     PACKPATH = BB.addChild((XMLCSTR)"package_path");
582     PACKPATH.addText((XMLCSTR)pack_path.c_str());
583     Utilities::replace(pack_path,INVALID_FILE_SEPARATOR,VALID_FILE_SEPARATOR);
584     mPackage_paths.push_back(pack_path);
585     pack_path = path + "/Release";
586     PACKPATH = BB.addChild((XMLCSTR)"package_path");
587     PACKPATH.addText((XMLCSTR)pack_path.c_str());
588     Utilities::replace(pack_path,INVALID_FILE_SEPARATOR,VALID_FILE_SEPARATOR);
589     mPackage_paths.push_back(pack_path);
590 #endif
591
592
593     XMLError err = BB.writeToFile((XMLCSTR)Get_config_xml_full_path().c_str());
594     if ( err != eXMLErrorNone )
595       {
596         std::string mess = GetErrorMessage(res,Get_config_xml_full_path());
597         bbtkDebugMessage("config",1,mess<< std::endl);
598         bbtkError(mess);
599       }
600
601     return true;
602   }
603   //=========================================================================
604
605   //=========================================================================
606   void ConfigurationFile::GetHelp(int level) const
607   {
608     bbtkDebugMessageInc("config",9,"ConfigurationFile::GetHelp("<<level
609                         <<")"<<std::endl);
610
611     const std::string config_xml_full_path      = Get_config_xml_full_path();
612     const std::string description               = Get_description();
613     const std::string url                       = Get_doc_path();
614     const std::string data_path                 = Get_data_path();
615     const std::string default_temp_dir          = Get_default_temp_dir();
616     const std::string file_separator            = Get_file_separator();
617     const std::vector<std::string>bbs_paths     = Get_bbs_paths();
618     const std::vector<std::string>package_paths = Get_package_paths();
619
620     bbtkMessage("help",level, "============="   << std::endl);
621     bbtkMessage("help",level, "Configuration"   << std::endl);
622     bbtkMessage("help",level, "============="   << std::endl);
623     bbtkMessage("help",level, "bbtk_config.xml    : [" << config_xml_full_path  << "]" << std::endl);
624     bbtkMessage("help",level, "Documentation Path : [" << url             << "]" << std::endl);
625     bbtkMessage("help",level, "Data Path          : [" << data_path       << "]" << std::endl);
626     bbtkMessage("help",level, "Temp Directory     : [" << default_temp_dir << "]" << std::endl);
627     bbtkMessage("help",level, "File Separator     : [" << file_separator  << "]" << std::endl);
628
629     std::vector<std::string>::const_iterator i;
630
631     bbtkMessage("help",level, "BBS Paths   " << std::endl);
632     for (i = bbs_paths.begin(); i!=bbs_paths.end(); ++i )
633     {
634       bbtkMessage("help",level,"--- ["<<*i<<"]"<<std::endl);
635     }
636
637     bbtkMessage("help",level, "PACKAGE Paths : " << std::endl);
638     for (i = package_paths.begin(); i!=package_paths.end(); ++i )
639     {
640       bbtkMessage("help",level,"--- ["<<*i<<"]"<<std::endl);
641     }
642
643     bbtkDebugDecTab("config",9);
644   }
645   //=========================================================================
646
647
648 } // namespace bbtk