X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=kernel%2Fsrc%2FbbtkConfigurationFile.cxx;h=8e2d78ce31d6b5b30c145a4e3cd497b9813d5b39;hb=6ad7245d4cf6a38427aceed7e5cd1a6664bceec1;hp=4fab8d8ec74d841fe00f47ab0a283afb827b69a9;hpb=22be581f80eb1c47223d75b010ad42d3a386efba;p=bbtk.git diff --git a/kernel/src/bbtkConfigurationFile.cxx b/kernel/src/bbtkConfigurationFile.cxx index 4fab8d8..8e2d78c 100644 --- a/kernel/src/bbtkConfigurationFile.cxx +++ b/kernel/src/bbtkConfigurationFile.cxx @@ -2,8 +2,8 @@ Program: bbtk Module: $RCSfile: bbtkConfigurationFile.cxx,v $ Language: C++ - Date: $Date: 2009/01/28 13:20:32 $ - Version: $Revision: 1.28 $ + Date: $Date: 2009/12/08 14:10:36 $ + Version: $Revision: 1.32 $ =========================================================================*/ /* --------------------------------------------------------------------- @@ -54,18 +54,37 @@ namespace bbtk ConfigurationFile::ConfigurationFile() { - mFile_separator = VALID_FILE_SEPARATOR; + mFile_separator = VALID_FILE_SEPARATOR; // ==> Set system paths mBin_path = Utilities::GetExecutablePath(); - + + + + +/* EED 23 Mars 2009 #ifdef MACOSX mInstall_path = mBin_path + "/../../../.."; #else mInstall_path = mBin_path + "/.."; #endif - - +*/ +#ifdef MACOSX + + std::string macPath("Contents/MacOS"); + int sbp = mBin_path.length(); + int smp = macPath.length(); + if (mBin_path.compare( sbp-smp, smp, macPath )==0 ) + { + mBin_path = mBin_path + "/../../.."; + } + + +#endif + mInstall_path = mBin_path + "/.."; + + + // The relative path to the doc folder (=BBTK_DOC_REL_PATH) // mDoc_rel_path = BBTK_STRINGIFY_SYMBOL(BBTK_DOC_REL_PATH); // The path to the doc folder (=mInstall_path+"/"+mDoc_rel_path) @@ -97,11 +116,11 @@ namespace bbtk INVALID_FILE_SEPARATOR, VALID_FILE_SEPARATOR); - bbtkMessage("Config",1," ==> bin : '"< prefix : '"< doc : '"< bbs : '"< data : '"< bin : '"< prefix : '"< doc : '"< bbs : '"< data : '"<" - << "Help Contents - bbtk " - << GetVersion() << "" - << "

Help Contents

" - << "Demos
" - << "Examples" - << "

Guides

" - << "User's Guide
" - << "Package Developer's Guide
" - << "bbtk library doxygen doc
" - << "

Boxes

" - << "" - << "Alphabetical list
" - << "" - << "List by package
" - << "" - << "List by category
" - << "" - << "List of adaptors
" - << "" - << ""; - } + // The path to the doc folder (=mInstall_path+"/"+mDoc_rel_path) + std::string doc_path = mInstall_path + "/" + + BBTK_STRINGIFY_SYMBOL(BBTK_DOC_REL_PATH) + "/"; + Utilities::MakeValidFileName(doc_path); + + std::ofstream f; + f.open(filename.c_str(), std::ios::out ); + f << "" + << "Help Contents - bbtk " + << GetVersion() << "" + << "

Help Contents

" + << "Demos
" + << "Examples" + << "

Guides

" + << "User's Guide
" + << "Developer's Guide
" + << "Package Developer's Guide
" + << "bbtk library doxygen doc
" + << "

Boxes

" + << "" + << "Alphabetical list
" + << "" + << "List by package
" + << "" + << "List by category
" + << "" + << "List of adaptors
" + << "" + << ""; + } // if mTemp_path = Utilities::MakeUserSettingsFullFileName("tmp"); Utilities::CreateDirectoryIfNeeded(mTemp_path); @@ -278,7 +302,7 @@ namespace bbtk FILE *fp; char configXml[250]; sprintf (configXml , "%s/bbtk_config.xml", rootDirectory); - bbtkDebugMessage("Config",1, "in CreateConfigXML[" << configXml << "]" << std::endl); + bbtkDebugMessage("config",1, "in CreateConfigXML[" << configXml << "]" << std::endl); fp = fopen (configXml, "w"); fprintf(fp, "\n"); fprintf(fp, "\n"); @@ -391,7 +415,7 @@ namespace bbtk sprintf(copyFile,"copy %s\\bbtk_config.xml.tmp \"%s\"\\bbtk_config.xml ",bbtk_path,rootDirectory ); int attribs = GetFileAttributes (rootDirectory); - bbtkMessage("Config",1,std::hex << attribs << " " << FILE_ATTRIBUTE_DIRECTORY << std::endl); + bbtkMessage("config",1,std::hex << attribs << " " << FILE_ATTRIBUTE_DIRECTORY << std::endl); if ( attribs != 0xFFFFFFFF) { if ((attribs & FILE_ATTRIBUTE_DIRECTORY) == FILE_ATTRIBUTE_DIRECTORY ) /// \TODO : check ! @@ -427,7 +451,7 @@ namespace bbtk void ConfigurationFile::Read(const std::string& filename) { - bbtkDebugMessage("Config",1,"ConfigurationFile::Read(" <bbs_paths = Get_bbs_paths(); const std::vectorpackage_paths = Get_package_paths(); - bbtkMessage("Help",level, "=============" << std::endl); - bbtkMessage("Help",level, "Configuration" << std::endl); - bbtkMessage("Help",level, "=============" << std::endl); - bbtkMessage("Help",level, "bbtk_config.xml : [" << config_xml_full_path << "]" << std::endl); - bbtkMessage("Help",level, "Documentation Path : [" << url << "]" << std::endl); - bbtkMessage("Help",level, "Data Path : [" << data_path << "]" << std::endl); - bbtkMessage("Help",level, "Temp Directory : [" << default_temp_dir << "]" << std::endl); - bbtkMessage("Help",level, "File Separator : [" << file_separator << "]" << std::endl); + bbtkMessage("help",level, "=============" << std::endl); + bbtkMessage("help",level, "Configuration" << std::endl); + bbtkMessage("help",level, "=============" << std::endl); + bbtkMessage("help",level, "bbtk_config.xml : [" << config_xml_full_path << "]" << std::endl); + bbtkMessage("help",level, "Documentation Path : [" << url << "]" << std::endl); + bbtkMessage("help",level, "Data Path : [" << data_path << "]" << std::endl); + bbtkMessage("help",level, "Temp Directory : [" << default_temp_dir << "]" << std::endl); + bbtkMessage("help",level, "File Separator : [" << file_separator << "]" << std::endl); std::vector::const_iterator i; - bbtkMessage("Help",level, "BBS Paths " << std::endl); + bbtkMessage("help",level, "BBS Paths " << std::endl); for (i = bbs_paths.begin(); i!=bbs_paths.end(); ++i ) { - bbtkMessage("Help",level,"--- ["<<*i<<"]"<