+// 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";
+//EED InterpretFile(*i);
+
+ nbBssFiles++;
+ } // for vector
+ if (nbBssFiles==0){
+ bbtkMessage("Interpreter",2,
+ "WARNING : No '.bbs' file found in ["
+ << upath << "]" << std::endl);
+ } else {
+ SwitchToStream(stream);
+ }
+ return;
+ } // if upath
+
+ 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;
+ } // if path
+
+ fullDirectoryName = Utilities::MakePkgnameFromPath(path, upath, false);
+
+ // 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
+ } // if IsDirectory
+ 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)
+ {
+// 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";
+//EED InterpretFile(*i);
+
+ nbBssFiles++;
+ } // for vector
+ 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 !
+ } // for vector
+ return;
+ } // if *
+
+ //std::string::size_type slash_position = name.find_last_of("/\\");
+
+ // if name starts with a / or a . or contains : user is assumed to have passed a relative/absolute name
+ // (not only a plain script name)
+ // we trust him, and try to expland the directory name
+ // WARNING : starting from current local directory : ./whatYouWant (./ mandatory!)
+
+ if (name[0]=='/' || name[1] == ':' || name[0]=='.') // absolute path (linux/windows) or relative path
+ {
+
+ // ===========================================================check user supplied location
+ fullnameGiven = true;
+
+ fullPathScriptName = Utilities::ExpandLibName(name, false);
+
+ // allow user to always forget ".bbs"
+ int l = fullPathScriptName.size();
+
+ if (l!=0) {
+
+ if (l>4)
+ {
+ if (fullPathScriptName.substr(l-4, 4) != ".bbs")
+ {
+ fullPathScriptName = fullPathScriptName + ".bbs";
+ }