Program: bbtk
Module: $RCSfile: bbtkInterpreter.cxx,v $ $
Language: C++
- Date: $Date: 2008/02/04 13:02:58 $
- Version: $Revision: 1.18 $
+ Date: $Date: 2008/02/04 13:51:30 $
+ Version: $Revision: 1.19 $
Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
l'Image). All rights reserved. See Doc/License.txt or
fullDirectoryName = Utilities::MakePkgnameFromPath(path, upath, false);
//std::cout <<"fullpath [" << fullDirectoryName << "]" <<std::endl;
+// std::cout << "== "<<fullDirectoryName<<" =="<<std::endl;
+
+
// Check if library exists
if ( ! Utilities::IsDirectory(fullDirectoryName) )
{
nbBssFiles = 0;
for (std::vector<std::string>::iterator i = Filenames.begin(); i!= Filenames.end(); ++i)
{
+ // std::cout << "=== "<<*i<<" =="<<std::endl;
if ((*i).substr((*i).size()-4, 4) != ".bbs")
continue; // ignore non .bbs files
LoadScript(*i);
if (verbose)
std::cout << "WARNING : No '.bbs' file found in [" << fullDirectoryName << "]" << std::endl;
- break; // a directory was found; we stop iterating
+ //break; // a directory was found; we stop iterating
+ // LG : No! We want all files included !
}
return;
}
void Interpreter::LoadScript( std::string fullPathScriptName)
{
+ if (find(mFileName.begin(),mFileName.end(),fullPathScriptName)
+ !=mFileName.end())
+ {
+ bbtkMessage("Interpreter",1,"file '"<<fullPathScriptName<<"' already open : do not open it once more to prevent recursive inclusion"<<std::endl);
+ return;
+ }
+
bbtkMessage("Interpreter",1,fullPathScriptName<<" found"<<std::endl);
std::ifstream* s;
return;
}
- if (verbose)
+ //if (verbose)
std::cout << " -->[" << fullPathScriptName << "] found" << std::endl;
mFile.push_back(s);