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