+
+ std::string path;
+ std::vector<std::string>::iterator i;
+ std::string fullDirectoryName;
+ for (i=script_paths.begin();i!=script_paths.end();i++)// ==== relative name, iterate + load all .bbs files
+ {
+ path = *i;
+
+ // we *really* want '.' to be the current working directory
+ if (path == ".") {
+ char buf[2048]; // for getcwd
+ char * currentDir = getcwd(buf, 2048);
+ std::string cwd(currentDir);
+ path = currentDir;
+ }
+
+ fullDirectoryName = Utilities::MakePkgnameFromPath(path, upath, false);
+
+ //EED 18 Fev 2008
+ // without last slash "\"
+ std::string fullDirectoryNameClean = fullDirectoryName.substr(0,fullDirectoryName.size()-1);
+
+ // Check if library exists
+ if ( ! Utilities::IsDirectory( fullDirectoryNameClean ) )
+ {
+ // The following is *NOT* a debug time message :
+ // It's a user intended message.
+ // Please don't remove it.
+ bbtkMessage("Interpreter",1," [" <<fullDirectoryName
+ <<"] : doesn't exist" <<std::endl);
+ continue; // try next path
+ }
+ foundFile = true;
+
+ Filenames.clear();
+ int nbFiles = Utilities::Explore(fullDirectoryName, false, Filenames);
+
+ nbBssFiles = 0;
+ for (std::vector<std::string>::iterator i = Filenames.begin(); i!= Filenames.end(); ++i)
+ {
+//EEDprintf("EED Interpreter::SwitchToFile %s\n",(*i).c_str() );
+// std::cout << "JPR================== iterate [" << *i << "]" << std::endl;
+ int lgr = (*i).size();
+ if (lgr < 5)
+ continue; // ignore non .bbs file
+ if ((*i).substr(lgr-4, 4) != ".bbs")
+ continue;
+ /*
+ if (lgr > 10) // 10 -> '-appli.bbs'
+ {
+ if ((*i).substr(lgr-10, 10) == "-appli.bbs")
+ continue; // ignore '-appli.bbs' files
+ }
+ */
+ (*stream) << "include " << *i << "\n";
+ nbBssFiles++;
+ }
+ if (nbBssFiles==0)
+ bbtkMessage("Interpreter",1,
+ "WARNING : No '.bbs' file found in ["
+ << fullDirectoryName << "]" << std::endl);
+ else
+ SwitchToStream(stream);
+
+ //break; // a directory was found; we stop iterating
+ // LG : No! We want all files included !
+ }
+ return;