X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=kernel%2Fsrc%2FbbtkInterpreter.cxx;h=ea9adc9ba8f1ef9bae578080dc75dcf682a015a9;hb=63d56e2f28b834d9e13f3757aaa23ab63b2b3dd6;hp=a9b480f86ae3c3a178c5af19d0a2b107704732d4;hpb=8c690fedb5ea897b6a69584e1e237cb5dbad97a5;p=bbtk.git diff --git a/kernel/src/bbtkInterpreter.cxx b/kernel/src/bbtkInterpreter.cxx index a9b480f..ea9adc9 100644 --- a/kernel/src/bbtkInterpreter.cxx +++ b/kernel/src/bbtkInterpreter.cxx @@ -2,8 +2,8 @@ Program: bbtk Module: $RCSfile: bbtkInterpreter.cxx,v $ Language: C++ - Date: $Date: 2009/05/28 08:12:06 $ - Version: $Revision: 1.85 $ + Date: $Date: 2009/10/05 22:44:48 $ + Version: $Revision: 1.87 $ =========================================================================*/ /* --------------------------------------------------------------------- @@ -687,17 +687,20 @@ namespace bbtk char buf[500]; mFile.back()->getline(buf,500); std::string str(buf); - + //size 0 JCP 21-09-2009 int size=str.length(); - if ( str[ size-1 ]==13 ) + if(size != 0){ + if ( str[ size-1 ]==13 ) { str.erase(size-1,1); } - try - { - DoInterpretLine(str); - } - CATCH_MACRO; + try + { + DoInterpretLine(str); + } + CATCH_MACRO; + } + } CloseCurrentFile(); } @@ -718,6 +721,7 @@ namespace bbtk { mStatus = Interpreter_OK; mInsideComment = false; +//std::cout<<"JCP bbtkInterpreter.cxx Interpreter::InterpretLine("< Interpreter::DoInterpretLine(\"" < words; SplitLine(line,words); @@ -786,7 +789,7 @@ namespace bbtk // Command CommandInfoType command; InterpretCommand(words,command); - +//std::cout<<"JCP bbtkInterpreter command.keyword ="<(mFile.back()); @@ -844,7 +848,7 @@ namespace bbtk } return; } - +//std::cout<<" mVirtualExecuter->Create(words[1],words[2]); "<=4 + if(tfullPathScriptName.size()>=4){ + if (tfullPathScriptName.substr(tfullPathScriptName.size()-4, 3)==".bb") { - // The following is *NOT* a debug time message : - // It's a user intended message. - // Please don't remove it. - bbtkMessage("interpreter",2, - " [" <& words,"<second; bbtkDebugMessage("interpreter",9,"<== Interpreter::InterpretCommand(...)"<& words) { if (words[1]=="packages") { - GetExecuter()->GetFactory()->PrintPackages(true); + GetExecuter()->GetFactory()->PrintHelpListPackages(true); return; } try @@ -1604,7 +1611,7 @@ void Interpreter::Help(const std::vector& words) { try { - GetExecuter()->GetFactory()->HelpPackage(words[1]); + GetExecuter()->GetFactory()->PrintHelpPackage(words[1]); if ( mUser != 0 ) { std::string url = @@ -1621,7 +1628,8 @@ void Interpreter::Help(const std::vector& words) try { std::string package; - GetExecuter()->GetFactory()->HelpBlackBox(words[1],package); + GetExecuter()->GetFactory()->PrintHelpDescriptor(words[1], + package); if ( mUser != 0 ) { std::string url = @@ -1638,7 +1646,7 @@ void Interpreter::Help(const std::vector& words) { try { - GetExecuter()->ShowRelations(words[1],"0","9999"); + GetExecuter()->PrintHelpBlackBox(words[1],"0","9999"); } catch (bbtk::Exception h){ bbtkError("\""<& words) { if ( words[1]=="packages" ) { - GetExecuter()->GetFactory()->PrintPackages(true,true); + GetExecuter()->GetFactory()->PrintHelpListPackages(true,true); return; } try { - GetExecuter()->GetFactory()->HelpPackage(words[1],true); + GetExecuter()->GetFactory()->PrintHelpPackage(words[1],true); } catch (bbtk::Exception f) { @@ -2274,7 +2282,7 @@ void Interpreter::NewGUI(const std::string& boxname, { // int o = MessageManager::GetMessageLevel("debug"); // if (o<2) MessageManager::SetMessageLevel("debug",2); - mVirtualExecuter->GetFactory()->CheckPackages(); + mVirtualExecuter->GetFactory()->Check(); // MessageManager::SetMessageLevel("debug",o); } }