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