From 51be19a0b4d980ef0bdcbbfc5c8255d811de1883 Mon Sep 17 00:00:00 2001 From: jean-pierre roux Date: Wed, 6 Feb 2008 10:53:02 +0000 Subject: [PATCH 1/1] doc_tmp -> temp_dir --- kernel/src/bbtkComplexBlackBox.cxx | 96 +++++++++++++++------------- kernel/src/bbtkConfigurationFile.cxx | 20 +++--- kernel/src/bbtkConfigurationFile.h | 10 +-- kernel/src/bbtkExecuter.cxx | 18 +++--- kernel/src/bbtkExecuter.h | 6 +- kernel/src/bbtkInterpreter.cxx | 13 ++-- 6 files changed, 84 insertions(+), 79 deletions(-) diff --git a/kernel/src/bbtkComplexBlackBox.cxx b/kernel/src/bbtkComplexBlackBox.cxx index ec6f1c3..a3d2ce3 100644 --- a/kernel/src/bbtkComplexBlackBox.cxx +++ b/kernel/src/bbtkComplexBlackBox.cxx @@ -3,8 +3,8 @@ Program: bbtk Module: $RCSfile: bbtkComplexBlackBox.cxx,v $ Language: C++ -Date: $Date: 2008/02/05 13:23:46 $ -Version: $Revision: 1.2 $ +Date: $Date: 2008/02/06 10:53:02 $ +Version: $Revision: 1.3 $ Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de l'Image). All rights reserved. See Doc/License.txt or @@ -616,20 +616,22 @@ namespace bbtk restname = blackboxname.substr(lastPos+pos - lastPos+1, 999); if (restname==subname) - { - restname=""; - } + { + restname=""; + } BlackBoxMapType::iterator i = mBlackBoxMap.find(subname); if ( i == mBlackBoxMap.end() ) - { - blackbox = NULL; - } else { - blackbox = i->second; - if (restname!="") - { - blackbox = blackbox->bbFindBlackBox(restname); - } + { + blackbox = NULL; + } + else + { + blackbox = i->second; + if (restname!="") + { + blackbox = blackbox->bbFindBlackBox(restname); + } } return blackbox; } @@ -647,11 +649,11 @@ namespace bbtk std::string directory(output_dir); if (output_dir.length() == 0) - { - // Don't pollute the file store with "doc_tmp" directories ... - std::string default_doc_dir = ConfigurationFile::GetInstance().Get_default_doc_tmp(); - directory = default_doc_dir + "/" + "doc_tmp"; - } + { + // Don't pollute the file store with "temp_dir" directories ... + std::string default_temp_dir = ConfigurationFile::GetInstance().Get_default_temp_dir(); + directory = default_temp_dir + "/" + "temp_dir"; + } std::string simplefilename (this->bbGetTypeName()+"_"+this->bbGetName()); std::string simplefilename_png (simplefilename+".png"); @@ -701,13 +703,13 @@ namespace bbtk char c; ff2=fopen(filename_cmap.c_str(),"r"); while (!feof(ff2)) - { - c=fgetc(ff2); - if (c!=-1) - { - (s) << c; - } - } + { + c=fgetc(ff2); + if (c!=-1) + { + (s) << c; + } + } (s) << "\n\n"; // End @@ -728,38 +730,40 @@ namespace bbtk Package *package = this->bbGetDescriptor()->GetPackage(); if (package!=NULL) - { - if (relative_link) - tmp1 = this->bbGetDescriptor()->GetPackage()->GetDocRelativeURL(); - else - tmp1 = this->bbGetDescriptor()->GetPackage()->GetDocURL(); - } + { + if (relative_link) + tmp1 = this->bbGetDescriptor()->GetPackage()->GetDocRelativeURL(); + else + tmp1 = this->bbGetDescriptor()->GetPackage()->GetDocURL(); + } else - { - tmp1 = "Caspitas"; - } + { + tmp1 = "Caspitas"; + } std::string tmp2=bbGetTypeName(); std::string url(tmp1 + "#" + tmp2 ); fprintf( ff , "subgraph cluster_%s_%p {\n",bbGetName().c_str(),this); if (!( (bbGetTypeName()=="workspace") && (bbGetName()=="workspacePrototype")) ) - { - fprintf( ff , " URL = \"%s\" %s",url.c_str(),";"); - } + { + fprintf( ff , " URL = \"%s\" %s",url.c_str(),";"); + } std::string boxname="["+bbGetTypeName()+"]"; if (this!=parentblackbox) - { - if (detail==0) - { - boxname=bbGetName(); - } else { - boxname = bbGetName(); - boxname = boxname + " [" +this->bbGetDescriptor()->GetPackage()->GetName()+"::"+ bbGetTypeName() + "]"; - } + { + if (detail==0) + { + boxname=bbGetName(); + } + else + { + boxname = bbGetName(); + boxname = boxname + " [" +this->bbGetDescriptor()->GetPackage()->GetName()+"::"+ bbGetTypeName() + "]"; + } - } + } fprintf( ff , " label = \"%s\"%s\n", boxname.c_str() ,";"); diff --git a/kernel/src/bbtkConfigurationFile.cxx b/kernel/src/bbtkConfigurationFile.cxx index b15e061..167579f 100644 --- a/kernel/src/bbtkConfigurationFile.cxx +++ b/kernel/src/bbtkConfigurationFile.cxx @@ -3,8 +3,8 @@ Program: bbtk Module: $RCSfile: bbtkConfigurationFile.cxx,v $ Language: C++ - Date: $Date: 2008/01/22 15:02:00 $ - Version: $Revision: 1.1 $ + Date: $Date: 2008/02/06 10:53:02 $ + Version: $Revision: 1.2 $ Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de l'Image). All rights reserved. See doc/license.txt or @@ -133,9 +133,9 @@ void ConfigurationFile::CreateConfigXML( char *rootDirectory ) fprintf(fp, " \n"); fprintf(fp, " %s \n", BBTK_DATA_PATH); /// \todo find a decent default value ! - ///fprintf(fp, " %s \n", " "); - // when $ will be found, default_doc_tmp value will be replaced - fprintf(fp, " $\n"); + ///fprintf(fp, " %s \n", " "); + // when $ will be found, default_temp_dir value will be replaced + fprintf(fp, " $\n"); fprintf(fp, "\n"); fclose(fp); } @@ -399,14 +399,14 @@ void ConfigurationFile::Read(const std::string& filename) mPackage_paths.push_back(val); } - // default_doc_tmp - if( BB.nChildNode((XMLCSTR)"default_doc_tmp") ) - GetTextOrClear(BB.getChildNode((XMLCSTR)"default_doc_tmp"),mDefault_doc_tmp); + // default_temp_dir + if( BB.nChildNode((XMLCSTR)"default_temp_dir") ) + GetTextOrClear(BB.getChildNode((XMLCSTR)"default_temp_dir"),mDefault_temp_dir); - if ( mDefault_doc_tmp == "$") // no value found in config_xml + if ( mDefault_temp_dir == "$") // no value found in config_xml { size_t pos = mConfig_xml_full_path.find("bbtk_config.xml"); - mDefault_doc_tmp = mConfig_xml_full_path.substr (0,pos); + mDefault_temp_dir = mConfig_xml_full_path.substr (0,pos); } // file separator #if defined(_WIN32) diff --git a/kernel/src/bbtkConfigurationFile.h b/kernel/src/bbtkConfigurationFile.h index d264c91..88d8845 100644 --- a/kernel/src/bbtkConfigurationFile.h +++ b/kernel/src/bbtkConfigurationFile.h @@ -3,8 +3,8 @@ Program: bbtk Module: $RCSfile: bbtkConfigurationFile.h,v $ Language: C++ - Date: $Date: 2008/01/22 15:02:00 $ - Version: $Revision: 1.1 $ + Date: $Date: 2008/02/06 10:53:02 $ + Version: $Revision: 1.2 $ Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de l'Image). All rights reserved. See doc/license.txt or @@ -90,8 +90,8 @@ public: { return mPackage_paths;} inline const std::string& Get_config_xml_full_path() const { return mConfig_xml_full_path;} - inline const std::string& Get_default_doc_tmp() const - { return mDefault_doc_tmp;} + inline const std::string& Get_default_temp_dir() const + { return mDefault_temp_dir;} private: void Read(const std::string& fileName); @@ -118,7 +118,7 @@ public: /// If Packages link against extern dlls std::vector mExt_dll_paths; /// Default directory for generating Graph - std::string mDefault_doc_tmp; + std::string mDefault_temp_dir; }; diff --git a/kernel/src/bbtkExecuter.cxx b/kernel/src/bbtkExecuter.cxx index 00a5551..2bb24d8 100644 --- a/kernel/src/bbtkExecuter.cxx +++ b/kernel/src/bbtkExecuter.cxx @@ -3,8 +3,8 @@ Program: bbtk Module: $RCSfile: bbtkExecuter.cxx,v $ $ Language: C++ - Date: $Date: 2008/02/06 09:27:52 $ - Version: $Revision: 1.8 $ + Date: $Date: 2008/02/06 10:53:02 $ + Version: $Revision: 1.9 $ Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de l'Image). All rights reserved. See Doc/License.txt or @@ -437,14 +437,14 @@ namespace bbtk // No output provided : automatic generation if (output_html.length() == 0) { - // Don't pollute the file store with "doc_tmp" directories ... - std::string default_doc_dir = ConfigurationFile::GetInstance().Get_default_doc_tmp(); + // Don't pollute the file store with "temp_dir" directories ... + std::string default_doc_dir = ConfigurationFile::GetInstance().Get_default_temp_dir(); char c = default_doc_dir.c_str()[strlen(default_doc_dir.c_str())-1]; std::string directory = default_doc_dir; if (c != '/' && c !='\\') directory = directory + "/"; - directory = directory + "doc_tmp"; + directory = directory + "temp_dir"; filename_rootHtml = directory + "/" + "User.html"; simplefilename_rootHtml = "User.html" ; @@ -506,16 +506,16 @@ namespace bbtk if (blackbox) { - // Don't pollute the file store with "doc_tmp" directories ... - std::string default_doc_dir = ConfigurationFile::GetInstance().Get_default_doc_tmp(); + // Don't pollute the file store with "temp_dir" directories ... + std::string default_doc_dir = ConfigurationFile::GetInstance().Get_default_temp_dir(); char c = default_doc_dir.c_str()[strlen(default_doc_dir.c_str())-1]; std::string directory = default_doc_dir; if (c != '/' && c !='\\') directory = directory + "/"; - directory = directory + "doc_tmp"; + directory = directory + "temp_dir"; - //std::string directory("doc_tmp"); + //std::string directory("temp_dir"); std::string filename(directory + "/" + "bbtk_graph_pipeline"); std::string filename_html(filename+".html"); std::string command0("mkdir \""+directory + "\""); diff --git a/kernel/src/bbtkExecuter.h b/kernel/src/bbtkExecuter.h index bcd8b24..0090fad 100644 --- a/kernel/src/bbtkExecuter.h +++ b/kernel/src/bbtkExecuter.h @@ -3,8 +3,8 @@ Program: bbtk Module: $RCSfile: bbtkExecuter.h,v $ $ Language: C++ - Date: $Date: 2008/02/06 09:27:52 $ - Version: $Revision: 1.7 $ + Date: $Date: 2008/02/06 10:53:02 $ + Version: $Revision: 1.8 $ Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de l'Image). All rights reserved. See Doc/License.txt or @@ -48,7 +48,7 @@ namespace bbtk /// // void SetFactory(Factory* f); - + /// Destructor ~Executer(); diff --git a/kernel/src/bbtkInterpreter.cxx b/kernel/src/bbtkInterpreter.cxx index f46dfe0..5b0c26e 100644 --- a/kernel/src/bbtkInterpreter.cxx +++ b/kernel/src/bbtkInterpreter.cxx @@ -3,8 +3,8 @@ Program: bbtk Module: $RCSfile: bbtkInterpreter.cxx,v $ $ Language: C++ - Date: $Date: 2008/02/06 09:32:25 $ - Version: $Revision: 1.27 $ + Date: $Date: 2008/02/06 10:53:02 $ + Version: $Revision: 1.28 $ Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de l'Image). All rights reserved. See Doc/License.txt or @@ -54,6 +54,7 @@ Interpreter* Interpreter::mGlobalInterpreter = NULL; // mFactory = new bbtk::Factory(); mExecuter = new bbtk::Executer(); + //mExecuter = new bbtk::Transcriptor("GeneratedProgram.txt"); //mExecuter->SetFactory(mFactory); // Builds the commands dict @@ -297,7 +298,7 @@ Interpreter* Interpreter::mGlobalInterpreter = NULL; * */ void Interpreter::InterpretFile( const std::string& filename, - bool use_configuration_file) + bool use_configuration_file) { bbtkDebugMessageInc("Interpreter",9,"Interpreter::InterpretFile(\""<& // It's a user intended message. // Please don't remove it. bbtkMessage("Interpreter",1, - "look for : [" << name + "look for : [" << name << "] (use_configuration_file == TRUE)" << std::endl); script_paths = ConfigurationFile::GetInstance().Get_bbs_paths(); } @@ -1145,7 +1146,7 @@ void Interpreter::Help(const std::vector& words) const std::string description = cf.Get_description(); const std::string url = cf.Get_url(); const std::string data_path = cf.Get_data_path(); - const std::string default_doc_tmp = cf.Get_default_doc_tmp(); + const std::string default_temp_dir = cf.Get_default_temp_dir(); const std::string file_separator = cf.Get_file_separator(); const std::vectorbbs_paths = cf.Get_bbs_paths(); const std::vectorpackage_paths = cf.Get_package_paths(); @@ -1156,7 +1157,7 @@ void Interpreter::Help(const std::vector& words) bbtkMessage("Help",1, "bbtk_config.xml : [" << config_xml_full_path << "]" << std::endl); bbtkMessage("Help",1, "Documentation Url : [" << url << "]" << std::endl); bbtkMessage("Help",1, "Data Path : [" << data_path << "]" << std::endl); - bbtkMessage("Help",1, "Default Doc_tmp : [" << default_doc_tmp << "]" << std::endl); + bbtkMessage("Help",1, "Default Temp-Dir : [" << default_temp_dir << "]" << std::endl); bbtkMessage("Help",1, "File Separator : [" << file_separator << "]" << std::endl); std::vector::const_iterator i; -- 2.45.2