From: guigues Date: Wed, 26 Mar 2008 08:27:19 +0000 (+0000) Subject: Fixed : X-Git-Tag: r0.6.1~91 X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=commitdiff_plain;h=4a17a289103f77885e288aaae250e57c91ae3424;p=bbtk.git Fixed : - include * - print in define/endefine block - misc... --- diff --git a/kernel/src/bbtkConfigurationFile.h b/kernel/src/bbtkConfigurationFile.h index 3d2f92a..24c9414 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/03/10 06:24:12 $ - Version: $Revision: 1.6 $ + Date: $Date: 2008/03/26 08:27:19 $ + Version: $Revision: 1.7 $ Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de l'Image). All rights reserved. See doc/license.txt or @@ -104,6 +104,8 @@ namespace bbtk inline const std::string& Get_rsc_path() const { return mRsc_path;} + inline const std::string& Get_root_bbs_path() const + { return mBbs_path;} inline const std::vector& Get_bbs_paths() const { return mBbs_paths;} inline const std::vector& Get_package_paths() const diff --git a/kernel/src/bbtkExecuter.cxx b/kernel/src/bbtkExecuter.cxx index 5244a04..9be94bf 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/03/07 11:15:15 $ - Version: $Revision: 1.14 $ + Date: $Date: 2008/03/26 08:27:19 $ + Version: $Revision: 1.15 $ Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de l'Image). All rights reserved. See Doc/License.txt or @@ -36,9 +36,7 @@ namespace bbtk { -/** - * - */ + //======================================================================= Executer::Executer() : mFactory(0), @@ -53,13 +51,11 @@ namespace bbtk Reset(); bbtkDebugDecTab("Kernel",9); } + //======================================================================= -/** - * - */ + //======================================================================= Executer::~Executer() { - //std::cout << "===================================== delete Executer\n"; bbtkDebugMessageInc("Kernel",9,"Executer::~Executer()" <LoadPackage(name); + } + //======================================================================= + + //======================================================================= + /// Unloads a package + void Executer::UnLoadPackage(const std::string &name ) + { + GetFactory()->UnLoadPackage(name); + } + //======================================================================= - -/** - * - */ + //======================================================================= void Executer::Reset() { bbtkDebugMessageInc("Kernel",9,"Executer::Reset()" <ChangeBlackBoxName( mRootCBB->GetTypeName(), n ); } - + //======================================================================= + + //======================================================================= void Executer::BeginPackage (const std::string &name) { bbtkDebugMessageInc("Kernel",9,"Executer::BeginPackage(\""<1) mOpenPackage.pop_back(); } + //======================================================================= + //======================================================================= void Executer::Define (const std::string &name, const std::string &pack, const std::string &scriptfilename) @@ -168,14 +186,18 @@ namespace bbtk bbtkDebugDecTab("Kernel",9); } + //======================================================================= + //======================================================================= /// Sets the file name to use for the current definition /// (Used to set it after the Define command) void Executer::SetCurrentFileName (const std::string &name ) { mOpenDefinition.back().box->SetScriptFileName(name); } + //======================================================================= + //======================================================================= void Executer::EndDefine () { bbtkDebugMessageInc("Kernel",9,"Executer::EndDefine(\"" @@ -208,24 +230,24 @@ namespace bbtk mOpenDefinition.pop_back(); } - + //======================================================================= + //======================================================================= void Executer::Create ( const std::string& nodeType, const std::string& nodeName) { Current()->Add(nodeType,nodeName); } + //======================================================================= - /* - void Executer::Remove (const std::string &nodeName) + //======================================================================= + void Executer::Destroy(const std::string &boxName) { - // Current()->RemoveBlackBox(nodeName); + bbtkError("Executer::Destroy : NOT IMPLEMENTED !"); } - */ + //======================================================================= -/** - * - */ + //======================================================================= void Executer::Connect (const std::string &nodeFrom, const std::string &outputLabel, const std::string &nodeTo, @@ -233,13 +255,12 @@ namespace bbtk { Current()->Connect(nodeFrom, outputLabel, nodeTo, inputLabel); } + //======================================================================= - /** - * - */ - void Executer::Update (const std::string &nodeName) // would 'Execute' be more meaningfull ? + //======================================================================= + void Executer::Execute (const std::string &nodeName) { - // if in root + // if in root if (Current()==mRootCBB) { if (!mNoExecMode) @@ -252,10 +273,9 @@ namespace bbtk Current()->AddToExecutionList(nodeName) ; } } + //======================================================================= -/** - * - */ + //======================================================================= void Executer::DefineInput ( const std::string &name, const std::string &box, const std::string &input, @@ -307,10 +327,9 @@ namespace bbtk Current()->DefineInput(name,box,input,help); } + //======================================================================= - /** - * - */ + //======================================================================= void Executer::DefineOutput ( const std::string &name, const std::string &box, const std::string &output, @@ -318,10 +337,9 @@ namespace bbtk { Current()->DefineOutput(name,box,output,help); } + //======================================================================= - /** - * - */ + //======================================================================= void Executer::Set (const std::string &box, const std::string &input, const std::string &value) @@ -353,10 +371,9 @@ namespace bbtk b->bbSetInput(input,v); } } + //======================================================================= - /** - * - */ + //======================================================================= std::string Executer::Get(const std::string &box, const std::string &output) { @@ -398,24 +415,30 @@ namespace bbtk // b->bbSetInput(input,&v); } } + //======================================================================= - + //======================================================================= void Executer::Author(const std::string &authorName) { Current()->AddToAuthor(authorName,Current()==mRootCBB); } + //======================================================================= + //======================================================================= void Executer::Category(const std::string &category) { Current()->AddToCategory(category,Current()==mRootCBB); } + //======================================================================= + //======================================================================= void Executer::Description(const std::string &d) { Current()->AddToDescription(d,Current()==mRootCBB); } + //======================================================================= - + //======================================================================= /// prints the list of the boxes of the current descriptor void Executer::PrintBoxes() { @@ -424,7 +447,9 @@ namespace bbtk Current()->PrintBlackBoxes(); bbtkDecTab("Help",1); } + //======================================================================= + //======================================================================= std::string Executer::ShowGraph(const std::string &nameblackbox, const std::string &detailStr, const std::string &levelStr, @@ -492,7 +517,9 @@ namespace bbtk */ return page; } + //======================================================================= + //======================================================================= /// Generate a png file with the actual pipeline (Graphviz-dot needed) std::string Executer::ShowGraphInstances(const std::string &nameblackbox, int detail, int level, bool system_display) @@ -562,43 +589,126 @@ namespace bbtk } return page; } + //======================================================================= -void Executer::ShowRelations(const std::string &nameblackbox, const std::string &detailStr, const std::string &levelStr) + //======================================================================= + void Executer::ShowRelations(const std::string &nameblackbox, + const std::string &detailStr, + const std::string &levelStr) { - bool found=false; + bool found=false; + + int detail = atoi(detailStr.c_str()); + int level = atoi(levelStr.c_str()); + BlackBox* blackbox=NULL; + if (nameblackbox.compare(".")==0) + { + blackbox=Current()->GetPrototype(); + } + else + { + blackbox = Current()->GetPrototype()->bbFindBlackBox(nameblackbox); + } + + if (blackbox) + { + found=true; + blackbox->bbShowRelations(blackbox,detail,level); //,mFactory); + } + + if (!found) + { + bbtkError("Blackbox Name not found.. <" <"); + } + } + //======================================================================= - int detail = atoi(detailStr.c_str()); - int level = atoi(levelStr.c_str()); - BlackBox* blackbox=NULL; - if (nameblackbox.compare(".")==0) - { - blackbox=Current()->GetPrototype(); - } else { - blackbox = Current()->GetPrototype()->bbFindBlackBox(nameblackbox); - } + //======================================================================= + /// sets the level of message + void Executer::SetMessageLevel(const std::string &kind, + int level) + { + bbtk::MessageManager::SetMessageLevel(kind,level); + } + //======================================================================= + + //======================================================================= + /// Prints help on the messages + void Executer::HelpMessages() + { + bbtk::MessageManager::PrintInfo(); + } + //======================================================================= + + //======================================================================= + /// + void Executer::Print(const std::string &str) + { + if (GetNoExecMode() && (Current()==mRootCBB) ) return; + if (Current()!=mRootCBB) return; + + bbtkDebugMessageInc("Interpreter",9,"Interpreter::Print(\""< trouver un nom unique : # commande + // InterpretLine("new Print _P_") + // InterpretLine("connect _C_.Out _P_.In") + // int num = 1 + + + std::vector chains; + std::string delimiters("$"); - if (blackbox) + // Skip delimiters at beginning. + std::string::size_type lastPos = str.find_first_not_of(delimiters, 0); + bool is_text = true; + if (lastPos>0) is_text = false; + + // Find first delimiter. + std::string::size_type pos = str.find_first_of(delimiters, lastPos); + + while (std::string::npos != pos || std::string::npos != lastPos) + { + if (is_text) { - found=true; - blackbox->bbShowRelations(blackbox,detail,level); //,mFactory); + // Found a text token, add it to the vector. + chains.push_back(str.substr(lastPos, pos - lastPos)); + // std::string token = str.substr(lastPos, pos - lastPos) + // InterpretLine("set _C_.In%num% %token%") + } - - if (!found) + else { - bbtkError("Blackbox Name not found.. <" <"); + + // is an output (between $$) : decode + std::string tok,box,output; + tok = str.substr(lastPos, pos - lastPos); + Utilities::SplitAroundFirstDot(tok,box,output); + chains.push_back( Get(box,output) ); + +// InterpretLine("connect %tok% _C_.In%num%") + } - } + // Skip delimiters. Note the "not_of" + lastPos = str.find_first_not_of(delimiters, pos); + // Find next delimiter + pos = str.find_first_of(delimiters, lastPos); + // + is_text = !is_text; +// num ++; + } +// InterpretLine("exec _P_") +// if (IS_IN_WORKSPACE) InterpretLine("delete _C_; delete _P_"); - /* - /// sets the level of message - void Executer::Message(const std::string &kind, - const std::string& level) - { - int l; - sscanf(level.c_str(),"%d",&l); - bbtk::MessageManager::SetMessageLevel(kind,l); + std::vector::iterator i; + for (i= chains.begin(); i!=chains.end(); ++i) + { + // bbtkMessage("Echo",1,*i); + Utilities::SubsBackslashN(*i); + bbtkMessage("Output",1,*i); + } + bbtkMessage("Output",1,std::endl); } - */ - }//namespace diff --git a/kernel/src/bbtkExecuter.h b/kernel/src/bbtkExecuter.h index b77a3c9..69647a6 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/03/07 08:40:14 $ - Version: $Revision: 1.10 $ + Date: $Date: 2008/03/26 08:27:19 $ + Version: $Revision: 1.11 $ Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de l'Image). All rights reserved. See Doc/License.txt or @@ -70,6 +70,15 @@ namespace bbtk /// Sets the mode of dialog of the executer for Root inputs void SetDialogMode(DialogModeType t) { mDialogMode = t; } + + + //================================================================= + /// Loads a package + void LoadPackage(const std::string &name ); + + /// Unloads a package + void UnLoadPackage(const std::string &name ); + /// Starts a package block void BeginPackage (const std::string &name ); @@ -101,9 +110,8 @@ namespace bbtk const std::string &boxto, const std::string &input); - /// Updates the box - /// would 'Execute' be more meaningfull ? - void Update (const std::string &box); + /// Executes the box + void Execute (const std::string &box); /// Defines an input of the current complex box void DefineInput (const std::string &name, @@ -150,13 +158,24 @@ namespace bbtk const std::string &custom_title, bool system_display = true); - /// Generate a HTML with a gif file with the current pipeline (Graphviz-dot needed). Returns the file path + /// Generate a HTML with a gif file with the current pipeline (Graphviz-dot needed). Returns the file path std::string ShowGraphInstances(const std::string &nameblackbox, int detail, int level, bool system_display=true); + + /// Description of the actual pipeline + void ShowRelations(const std::string &nameblackbox, const std::string &detailStr, const std::string &levelStr); + + /// Resets the workspace : destroys all boxes / unloads all packages + void Reset(); - /// Description of the actual pipeline - void ShowRelations(const std::string &nameblackbox, const std::string &detailStr, const std::string &levelStr); + /// Sets the level of message for kind + void SetMessageLevel(const std::string &kind, + int level); + + /// Prints help on the messages + void HelpMessages(); + - void Reset(); + void Print(const std::string & message); // static const std::string& GetObjectDescription(); // { static std::string s("Executer"); return s; } diff --git a/kernel/src/bbtkInterpreter.cxx b/kernel/src/bbtkInterpreter.cxx index 2840b12..e4d872b 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/03/25 15:47:54 $ - Version: $Revision: 1.54 $ + Date: $Date: 2008/03/26 08:27:19 $ + Version: $Revision: 1.55 $ Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de l'Image). All rights reserved. See Doc/License.txt or @@ -655,8 +655,7 @@ void Interpreter::InterpretLine( const std::string& line, bool &insideComment ) break; case cDelete : - // TO DO !! - // mExecuter->Remove(words[1]); + mExecuter->Destroy(words[1]); break; case cConnect : @@ -693,7 +692,7 @@ void Interpreter::InterpretLine( const std::string& line, bool &insideComment ) break; case cPrint : - Print(words[1]); /// \todo use generate command + mExecuter->Print(words[1]); break; case cExec : @@ -702,7 +701,7 @@ void Interpreter::InterpretLine( const std::string& line, bool &insideComment ) else if (words[1]=="unfreeze") mExecuter->SetNoExecMode(false); else - mExecuter->Update(words[1]); + mExecuter->Execute(words[1]); break; case cInput : @@ -748,12 +747,12 @@ void Interpreter::InterpretLine( const std::string& line, bool &insideComment ) case cMessage : if (words.size()<3) { - bbtk::MessageManager::PrintInfo(); + mExecuter->HelpMessages(); } else { - sscanf(words[2].c_str(),"%d",&level); - bbtk::MessageManager::SetMessageLevel(words[1],level); + sscanf(words[2].c_str(),"%d",&level); + mExecuter->SetMessageLevel(words[1],level); } break; @@ -786,18 +785,18 @@ void Interpreter::InterpretLine( const std::string& line, bool &insideComment ) break; case cLoad: - GetExecuter()->GetFactory()->LoadPackage(words[1]); + GetExecuter()->LoadPackage(words[1]); break; case cUnload: - GetExecuter()->GetFactory()->UnLoadPackage(words[1]); + GetExecuter()->UnLoadPackage(words[1]); break; case cQuit : delete mExecuter; throw QuitException(); break; - + /* obsolete case cWorkspace : if (words.size() == 2) { @@ -809,7 +808,7 @@ void Interpreter::InterpretLine( const std::string& line, bool &insideComment ) mExecuter->SetWorkspaceName(words[2]); } break; - + */ default: bbtkInternalError("should not reach here !!!"); } @@ -859,27 +858,13 @@ void Interpreter::SplitLine ( const std::string& str, std::vector& //======================================================================= - //======================================================================= - // Replaces substrings "\\n" by a real carriage return "\n" - void SubsBackslashN ( std::string& s ) - { - std::string ss("\\n"); - std::string::size_type pos = 0; - pos = s.find(ss,0); - char* cr = "\n"; - while ( pos != std::string::npos ) - { - s.replace(pos,2,cr,1); - pos = s.find(ss, pos-1); - } - } - //======================================================================= - + //======================================================================= /** * */ + /* void Interpreter::Print( const std::string& str) { if (mExecuter->GetNoExecMode()) return; @@ -942,12 +927,13 @@ void Interpreter::SplitLine ( const std::string& str, std::vector& for (i= chains.begin(); i!=chains.end(); ++i) { // bbtkMessage("Echo",1,*i); - SubsBackslashN(*i); + Utilities::SubsBackslashN(*i); std::cout << *i; } std::cout << std::endl; bbtkDebugDecTab("Interpreter",9); } +*/ //======================================================================= /** @@ -982,7 +968,7 @@ void Interpreter::SplitLine ( const std::string& str, std::vector& bbtkMessage("Interpreter",1, "look for : [" << name << "]" << std::endl); - script_paths = ConfigurationFile::GetInstance().Get_bbs_paths(); + std::string upath; pkgname = Utilities::ExtractScriptName(name,upath); @@ -993,102 +979,142 @@ void Interpreter::SplitLine ( const std::string& str, std::vector& bool fullnameGiven = false; bool foundFile = false; - if(pkgname == "*") // =========================================== load all boxes (e.g. std/boxes/*) - { - int nbBssFiles; - - std::stringstream* stream = new std::stringstream; - //if (upath.size()!=0) // avoid troubles for "*" - - if (upath[0]=='/' || upath[1] == ':' ) // ==== absolute name, load all .bbs files + // ==== "*" provided : load all scripts in given path + // relative (e.g. std/boxes/*) or absolute + if (pkgname == "*") { - int nbFiles = Utilities::Explore(upath, false, Filenames); - nbBssFiles = 0; - for (std::vector::iterator i = Filenames.begin(); i!= Filenames.end(); ++i) - { - int lgr = (*i).size(); - if (lgr < 5) - continue; // ignore non .bbs file - if ((*i).substr(lgr-4, 4) != ".bbs") - continue; - -printf("EED Interpreter::SwitchToFile flag01 %s \n", (*i).c_str() ); - (*stream) << "include \"" << *i << "\"\n"; - - 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::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," [" <::const_iterator i; + for (i=ConfigurationFile::GetInstance().Get_bbs_paths().begin(); + i!=ConfigurationFile::GetInstance().Get_bbs_paths().end(); + i++) + { + std::string full_path(*i); + full_path += ConfigurationFile::GetInstance().Get_file_separator(); + full_path += upath; + script_paths.push_back(full_path); + } + } + // === search paths list complete : now explore it + bbtkMessage("Interpreter",1, + "'*' provided. search paths : " << std::endl); + /* + int nbFiles = Utilities::Explore(upath, false, Filenames); + nbBssFiles = 0; + for (std::vector::iterator i = Filenames.begin(); + i!= Filenames.end(); ++i) + { + int lgr = (*i).size(); + if (lgr < 5) + continue; // ignore non .bbs file + if ((*i).substr(lgr-4, 4) != ".bbs") + continue; + //printf("EED Interpreter::SwitchToFile flag01 %s \n", (*i).c_str() ); + (*stream) << "include \"" << *i << "\"\n"; + + 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::iterator i; + std::string fullDirectoryName; + for (i=script_paths.begin();i!=script_paths.end();i++)// ==== relative name, iterate + load all .bbs files + { + path = *i; + + bbtkMessage("Interpreter",1, + "----> '" << path << "'" << std::endl); + // 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 directory 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," [" <::iterator i = Filenames.begin(); i!= Filenames.end(); ++i) + { + int lgr = (*i).size(); + if (lgr < 5) + continue; // ignore non .bbs file + if ((*i).substr(lgr-4, 4) != ".bbs") + continue; + + // printf("EED Interpreter::SwitchToFile flag02 %s \n", (*i).c_str() ); + (*stream) << "include \"" << *i << "\"\n"; + + 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; + } + //=============== end pkgname=="*" =========== - nbBssFiles = 0; - for (std::vector::iterator i = Filenames.begin(); i!= Filenames.end(); ++i) - { - int lgr = (*i).size(); - if (lgr < 5) - continue; // ignore non .bbs file - if ((*i).substr(lgr-4, 4) != ".bbs") - continue; - -printf("EED Interpreter::SwitchToFile flag02 %s \n", (*i).c_str() ); - (*stream) << "include \"" << *i << "\"\n"; - - 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 * // 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) @@ -1127,61 +1153,64 @@ printf("EED Interpreter::SwitchToFile flag02 %s \n", (*i).c_str() ); } // endif l != 0 } else - // =============================================================== iterate on the paths - { + // =============================== iterate on the paths + { + script_paths = ConfigurationFile::GetInstance().Get_bbs_paths(); std::string path; std::vector::iterator i; for (i=script_paths.begin();i!=script_paths.end();++i) - { - 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; - } - - fullPathScriptName = Utilities::MakePkgnameFromPath(path, name, true); - - // Check if library exists - if ( ! Utilities::FileExists(fullPathScriptName) ) - { - // The following is *NOT* a debug time message : - // It's a user intended message. - // Please don't remove it. - bbtkMessage("Interpreter",2, - " [" <Reset( );" << std::endl; - - /* - bbtkDebugMessageInc("Kernel",9,"Transcriptor::Reset()" <UnRegisterBlackBox(mRoot->GetTypeName()); - delete mRoot; - } - if (mPackage) - { - GetGlobalFactory()->UnLoadPackage("user"); - } - GetGlobalFactory()->Reset(); - // Create user package - mPackage = new Package("user","internal to bbi", - "User defined black boxes", - "", - BBTK_STRINGIFY_SYMBOL(BBTK_VERSION)); - // Create user workspace - mRoot = new ComplexBlackBoxDescriptor("workspace"); //,f); - mRoot->AddToAuthor("bbi (internal)"); - mRoot->AddToDescription("User's workspace"); - mOpenDefinition.push_back(CBBDefinition(mRoot,"user")); - // Register it into the user package - mPackage->RegisterBlackBox(mRoot); - // Insert the user package in the factory - InsertPackage(mPackage); - mOpenPackage.push_back(mPackage); - bbtkDebugDecTab("Kernel",9); - */ } - /// changes the workspace name void Transcriptor::SetWorkspaceName( const std::string& name ) { - m_Fp << " e->SetWorkspaceName( \"" << name << "\" );" << std::endl; - - // mPackage->ChangeBlackBoxName( mRoot->GetTypeName(), name ); + m_Fp << " e->SetWorkspaceName( \"" << name << "\" );" << std::endl; } void Transcriptor::BeginPackage (const std::string &name) { m_Fp << " e->BeginPackage( \"" << name << "\" );" << std::endl; - /* - bbtkDebugMessageInc("Kernel",9,"Executer::BeginPackage(\""<GetPackage(name); - } - catch (Exception e) - { - p = new Package(name, - "", - "", - "", - BBTK_STRINGIFY_SYMBOL(BBTK_VERSION)); - InsertPackage(p); - } - mOpenPackage.push_back(p); - */ } void Transcriptor::EndPackage() { m_Fp << " e->EndPackage( );" << std::endl; - // if (mOpenPackage.size()>1) mOpenPackage.pop_back(); } void Transcriptor::Define (const std::string &name, @@ -179,124 +114,48 @@ std::cout << "====================================================== delete Tran { m_Fp << " e->Define(\"" << name << "\", \"" << pack << "\", \"" << scriptfilename << "\" );" << std::endl; - /* - bbtkDebugMessageInc("Kernel",9,"Executer::Define(\""<SetScriptFileName(scriptfilename); - mOpenDefinition.push_back( CBBDefinition( b, pack ) ); - - bbtkDebugDecTab("Kernel",9); - */ } - /// Sets the file name to use for the current definition - /// (Used to set it after the Define command) void Transcriptor::SetCurrentFileName (const std::string &name ) { m_Fp << " e->SetCurrentFileName( \"" << name << "\" );" << std::endl; - // mOpenDefinition.back().box->SetScriptFileName(name); } void Transcriptor::EndDefine () { m_Fp << " e->EndDefine( );" << std::endl; - - /* - bbtkDebugMessageInc("Kernel",9,"Executer::EndDefine(\"" - <GetTypeName()<<"\")" - <0) - { - try - { - p = GetGlobalFactory()->GetPackage(pname); - } - catch (Exception e) - { - p = new Package(pname, - "", - "", - "", - BBTK_STRINGIFY_SYMBOL(BBTK_VERSION)); - InsertPackage(p); - } - } - else - { - p = mOpenPackage.back(); - } - p->RegisterBlackBox(Current()); - - mOpenDefinition.pop_back(); - */ - } void Transcriptor::Create ( const std::string& nodeType, const std::string& nodeName) { - // Current()->Add(nodeType,nodeName);\" - m_Fp << " e->Add(\"" << nodeType << "\", \"" << nodeName << "\");" << std::endl; + m_Fp << " e->Add(\"" << nodeType << "\", \"" + << nodeName << "\");" << std::endl; } - /* - void Transcriptor::Remove (const std::string &nodeName) + void Transcriptor::Destroy (const std::string &nodeName) { - /// \todo Remove - // Current()->RemoveBlackBox(nodeName); - // m_Fp << " e->Remove(" << nodeName << ");" << std::endl; + m_Fp << " e->Destroy(" << nodeName << ");" << std::endl; } - */ -/** - * - */ void Transcriptor::Connect (const std::string &nodeFrom, const std::string &outputLabel, const std::string &nodeTo, const std::string &inputLabel) { - //Current()->Connect(nodeFrom, outputLabel, nodeTo, inputLabel); - m_Fp << " e->Connect(\""<< nodeFrom << "\", \"" << outputLabel << "\", \"" - << nodeTo << "\", \"" << inputLabel<< "\");" << std::endl; + m_Fp << " e->Connect(\""<< nodeFrom << "\", \"" + << outputLabel << "\", \"" + << nodeTo << "\", \"" << inputLabel<< "\");" << std::endl; } - /** - * - */ - void Transcriptor::Update (const std::string &nodeName) // would 'Execute' be more meaningfull ? + + void Transcriptor::Execute (const std::string &nodeName) { - - m_Fp << " e->Update(\"" << nodeName << "\");" << std::endl; -/* - // if in root - if (Current()==mRoot) - { - if (!mNoExecMode) - { - //Current()->GetPrototype()->bbGetBlackBox(nodeName)->bbExecute(true); - m_Fp << " e->GetPrototype()->bbGetBlackBox(\"" << nodeName << "\", true );" << std::endl; - } - } - else - { - //Current()->AddToExecutionList(nodeName) ; - m_Fp << " e->AddToExecutionList(\"" << nodeName << "\");" << std::endl; - } -*/ + m_Fp << " e->Execute(\"" << nodeName << "\");" << std::endl; } -/** - * - */ void Transcriptor::DefineInput ( const std::string &name, const std::string &box, const std::string &input, @@ -305,193 +164,58 @@ std::cout << "====================================================== delete Tran m_Fp << " e->DefineInput(\""<< name << "\", " << box << ", " << input << ", \"" << help << "\");" << std::endl; - - /* - // If the input is defined in the Root box - if (Current()==mRoot) - { - // If the dialog mode is set to NoDialog - // and the user passed the name in the Inputs map - // then the associated value is set to the box.input - // This is the way command line parameters are passed to the Root box - if (mDialogMode == NoDialog) - { - // find if name is in mInputs - std::map::iterator i; - i = mInputs.find(name); - if (i!=mInputs.end()) { - Set(box,input,(*i).second); - } - } - // If the dialog mode is set to TextDialog - // The user is prompted for the value - else if (mDialogMode == TextDialog) - { - std::cout << name << "="; - std::string ans; - std::cin >> ans; - Set(box,input,ans); - } -#ifdef _USE_WXWIDGETS_ - // If the dialog mode is set to GraphicalDialog - // A dialog box is pop up - else if (mDialogMode == GraphicalDialog) - { - std::string mess("Enter the value of '"); - mess += name; - mess += "' ("; - mess += help; - mess += ")"; - std::string title(name); - title += " ?"; - std::string ans = wx2std ( wxGetTextFromUser( std2wx (mess), std2wx(title))); - Set(box,input,ans); - } -#endif - } - - Current()->DefineInput(name,box,input,help); -*/ - } - /** - * - */ - void Transcriptor::DefineOutput ( const std::string &name, - const std::string &box, - const std::string &output, - const std::string& help) + + void Transcriptor::DefineOutput ( const std::string &name, + const std::string &box, + const std::string &output, + const std::string& help) { - // Current()->DefineOutput(name,box,output,help); - m_Fp << " e->DefineOutput(\""<< name << "\", \"" << box << "\", \"" - << output << "\", \"" << help << "\");" << std::endl; + m_Fp << " e->DefineOutput(\""<< name << "\", \"" << box << "\", \"" + << output << "\", \"" << help << "\");" << std::endl; } - /** - * - */ + void Transcriptor::Set (const std::string &box, const std::string &input, const std::string &value) { - m_Fp << " e->Set(\""<< box << "\", \"" << input<< "\", \"" << value << "\");" + m_Fp << " e->Set(\""<< box << "\", \"" << input + << "\", \"" << value << "\");" << std::endl; - -/* - BlackBox* b = Current()->GetPrototype()->bbGetBlackBox(box); - // Looks for the adaptor - - if ( b->bbGetInputType(input) != typeid(std::string) ) - { - BlackBox* a = - NewAdaptor(typeid(std::string), - b->bbGetInputType(input), - "tmp"); - if (!a) - { - bbtkError("No <"<< - TypeName(b->bbGetInputType(input)) - <<"> to found"); - } - std::string v(value); - a->bbSetInput("In",v); - a->bbExecute(); - b->bbSetInput(input,a->bbGetOutput("Out")); - a->bbDelete(); - } - else - { - std::string v(value); - b->bbSetInput(input,v); - } -*/ } - /** - * - */ std::string Transcriptor::Get(const std::string &box, const std::string &output) { m_Fp << " e->Get(\""<< box << "\", \"" << output << "\");" << std::endl; -/* - BlackBox* b = Current()->GetPrototype()->bbGetBlackBox(box); - // Looks for the adaptor - if (b->bbGetOutputType(output) != typeid(std::string)) - { - BlackBox* a = - NewAdaptor( - b->bbGetOutputType(output), - typeid(std::string), - "tmp"); - if (!a) - { - bbtkError("No <"<< - TypeName(b->bbGetOutputType(output)) - <<"> to found"); - } - b->bbExecute(); - - a->bbSetInput("In",b->bbGetOutput(output)); - a->bbExecute(); - std::string r = a->bbGetOutput("Out").unsafe_get(); - //std::string v = *((std::string*)a->bbGetOutput("Out")) ; - // std::cout << a->bbGetOutput("Out").unsafe_get() - // << std::endl; - //std::string v(value); - //b->bbSetInput(input,a->bbGetOutput("Out")); - a->bbDelete(); - return r; - } - else - { - b->bbExecute(); - return b->bbGetOutput(output).unsafe_get(); - // std::string v = *((std::string*)b->bbGetOutput(output)) ; - // std::cout << b->bbGetOutput("Out").unsafe_get() - // << std::endl; - // b->bbSetInput(input,&v); - } -*/ -// EED Windows -return ""; + return ""; } void Transcriptor::Author(const std::string &authorName) { - - m_Fp << " e->AddToAuthor(\"" << authorName << "\")" << std::endl; - return; // just to see - - //Current()->AddToAuthor(authorName,Current()==mRoot); + + m_Fp << " e->AddToAuthor(\"" << authorName << "\")" << std::endl; } void Transcriptor::Category(const std::string &category) { - m_Fp << " e->AddToCategory(\"" << category << "\")" << std::endl; - //Current()->AddToCategory(category,Current()==mRoot); + m_Fp << " e->AddToCategory(\"" << category << "\")" << std::endl; } void Transcriptor::Description(const std::string &d) { - m_Fp << " e->AddToDescription(\"" << d << "\")" << std::endl; - // Current()->AddToDescription(d,Current()==mRoot); + m_Fp << " e->AddToDescription(\"" << d << "\")" << std::endl; } /// prints the list of the boxes of the current descriptor void Transcriptor::PrintBoxes() { m_Fp << " e->PrintBoxes( )" << std::endl; - /* - bbtkMessageInc("Help",1,"The black box descriptor \"" - <GetTypeName()<<"\" contains : "<PrintBlackBoxes(); - bbtkDecTab("Help",1); - */ } // =========================End of Battlefield ======================================================================== @@ -505,181 +229,59 @@ return ""; bool system_display ) { - m_Fp << " e->DefineOutput(\"" << nameblackbox << "\", \"" + m_Fp << " e->ShowGraph(\"" << nameblackbox << "\", \"" << detailStr << "\", \"" << levelStr << "\", \"" << output_html << "\", \"" << custom_header << "\", \"" << custom_title << "\");" << std::endl; - /* - int detail = atoi(detailStr.c_str()); - int level = atoi(levelStr.c_str()); - - std::string filename_rootHtml (output_html) ; - std::string simplefilename_rootHtml ( Utilities::get_file_name(output_html)); - - bool relative_link = true; - - // No output provided : automatic generation - if (output_html.length() == 0) - { - // 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 + "temp_dir"; - - filename_rootHtml = directory + "/" + "User.html"; - simplefilename_rootHtml = "User.html" ; - - // Creating directory - std::string command0("mkdir \"" +directory + "\""); - system( command0.c_str() ); - - relative_link = false; - } - - Package* p; - try - { - p = GetGlobalFactory()->GetPackage(nameblackbox); - } - catch (Exception e) - { - p = mPackage; - } - // Generating documentation-help of workspace - p->SetDocURL(filename_rootHtml); - p->SetDocRelativeURL(simplefilename_rootHtml); - - p->CreateHtmlPage(filename_rootHtml,"bbi","user package",custom_header,custom_title,detail,level,relative_link); - - std::string page = filename_rootHtml; - /* - try - { - ShowGraphTypes(nameblackbox); - } - catch (bbtk::Exception a) - { - std::cout <<"EXC"<GetPrototype(); - } - else - { - blackbox = Current()->GetPrototype()->bbFindBlackBox(nameblackbox); - } - - std::string page; - - if (blackbox) - { - // 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 + "temp_dir"; - //std::string directory("temp_dir"); - std::string filename(directory + "/" + "bbtk_graph_pipeline"); - std::string filename_html(filename+".html"); - std::string command0("mkdir \""+directory + "\""); - -#if defined(_WIN32) - std::string command2("start "); -#else - std::string command2("gnome-open "); -#endif - - command2=command2+filename_html; - page = filename_html; - // 1. Generate Html Diagram - std::ofstream s; - s.open(filename_html.c_str()); - if (s.good()) - { - s << "BBtk graph diagram\n"; - s << " \n\n"; - if ( blackbox->bbGetName()=="workspacePrototype" ) - { - s << "
Current workspace
"; - } else { - s << "
" << blackbox->bbGetName()<< "
"; - } - - blackbox->bbInsertHTMLGraph( s, detail, level, true, directory, false ); - s << "\n"; - } - s.close(); - - // 2. Starting Browser - if (system_display) system( command2.c_str() ); - } - else - { - bbtkMessageInc("Help",1,"No black box: \"" - <GetPrototype(); - } else { - blackbox = Current()->GetPrototype()->bbFindBlackBox(nameblackbox); - } - - if (blackbox) - { - found=true; - blackbox->bbShowRelations(blackbox,detail,level); //,mFactory); - } - - if (!found) - { - bbtkError("Blackbox Name not found.. <" <"); - } + + } + + void Transcriptor::Print(const std::string & message) + { + m_Fp << " e->Print(\"" <SetMessageLevel(\"" <HelpMessages()"<LoadPackage(\"" <UnLoadPackage(\"" <.so - + + // GCC mechanism + // shared lib name = libbb.so + // remove {libbb} if any - if (memcmp ( pkgname.c_str(), "libbb", 5) == 0) { - pkgname = pkgname.substr(5, pkgname.length()); - } + if (memcmp ( pkgname.c_str(), "libbb", 5) == 0) { + pkgname = pkgname.substr(5, pkgname.length()); + } /* - /// \ \todo what would happen if (stupid) user names his package 'libbb' ?!? + /// \ \todo what would happen if (stupid) user names his package 'libbb' ?!? /// \ --> Should be forbidden! */ #elif defined(_WIN32) - - // WIN 32 mechanism - // shared lib name = .dll - -// EED Problem loading package call bbtkTools -// // remove {bb} if any - if (memcmp (pkgname.c_str(), "bb", 2) == 0) { - pkgname = pkgname.substr(2, pkgname.length()); - } - - /* + + // WIN 32 mechanism + // shared lib name = .dll + + // EED Problem loading package call bbtkTools + // // remove {bb} if any + if (memcmp (pkgname.c_str(), "bb", 2) == 0) { + pkgname = pkgname.substr(2, pkgname.length()); + } + + /* /// \ \todo what would happen if (stupid) user names his package 'bb' ?!? /// \ --> Should be forbidden! */ #else - bbtkError("neither __GNUC__ nor _WIN32 ?!? How did you compile ?"); + bbtkError("neither __GNUC__ nor _WIN32 ?!? How did you compile ?"); #endif - return pkgname; - } - -// =================================================================================== - - static std::string ExtractScriptName(const std::string &name, - std::string& path) - { - std::string pkgname; - - std::string::size_type slash_position = name.find_last_of("/\\"); - if (slash_position != std::string::npos) { - pkgname =name.substr(slash_position+1,std::string::npos); - path = name.substr(0,slash_position); - } else { - pkgname = name; - } - // remove {.bbs } if any - std::string::size_type dot_position = pkgname.find_last_of('.'); - if (dot_position != std::string::npos){ - pkgname = pkgname.substr(0,dot_position); + return pkgname; } - return pkgname; - } - -// =================================================================================== - - static std::string ExpandLibName(const std::string &name, bool verbose) - { - // ----- Think of expanding path name ( ./ ../ ../../ ) - - char buf[2048]; // for getcwd - char * currentDir = getcwd(buf, 2048); - std::string cwd(currentDir); - std::string libname(name); - std::string fileSeparator; - fileSeparator = ConfigurationFile::GetInstance().Get_file_separator(); - // tooHigh : true is user supplies a library pathname with too many "../" - bool tooHigh = false; -//std::cout << "------------------cwd [" << cwd << "] name [" << name << "]" << std::endl; - - if ( name[0] == '/' || name[1] == ':' ) // Linux or Windows absolute name - { - return(libname); - } - else if ( name =="." ) + //===================================================================== + static std::string ExtractScriptName(const std::string &name, + std::string& path) { - libname = cwd + fileSeparator; - return(libname); - } - else if (name[0] == '.' && (name[1] == '/' || name[1] == '\\') ) - { - libname = cwd + fileSeparator + name.substr(2, name.length()); - return(libname); + std::string pkgname; + + std::string::size_type slash_position = name.find_last_of("/\\"); + if (slash_position != std::string::npos) { + pkgname =name.substr(slash_position+1,std::string::npos); + path = name.substr(0,slash_position); + } else { + pkgname = name; + } + // remove {.bbs } if any + std::string::size_type dot_position = pkgname.find_last_of('.'); + if (dot_position != std::string::npos){ + pkgname = pkgname.substr(0,dot_position); + } + return pkgname; } - else if ( name[0] == '.' && name[1] == '.' /* && (name[2] == '/' || name[2] == '\\') */ ) + + // ======================================================================== + + static std::string ExpandLibName(const std::string &name, bool verbose) { - if ( IsAtRoot(cwd) ) // hope it gets / (for Linux), C: D: (for Windows) + // ----- Think of expanding path name ( ./ ../ ../../ ) + + char buf[2048]; // for getcwd + char * currentDir = getcwd(buf, 2048); + std::string cwd(currentDir); + std::string libname(name); + std::string fileSeparator; + fileSeparator = ConfigurationFile::GetInstance().Get_file_separator(); + // tooHigh : true is user supplies a library pathname with too many "../" + bool tooHigh = false; + + //std::cout << "------------------cwd [" << cwd << "] name [" << name << "]" << std::endl; + + if ( name[0] == '/' || name[1] == ':' ) // Linux or Windows absolute name + { + return(libname); + } + else if ( name =="." ) + { + libname = cwd + fileSeparator; + return(libname); + } + else if (name[0] == '.' && (name[1] == '/' || name[1] == '\\') ) + { + libname = cwd + fileSeparator + name.substr(2, name.length()); + return(libname); + } + else if ( name[0] == '.' && name[1] == '.' /* && (name[2] == '/' || name[2] == '\\') */ ) + { + if ( IsAtRoot(cwd) ) // hope it gets / (for Linux), C: D: (for Windows) { // if we are already at / or c: --> hopeless if (verbose) @@ -313,113 +314,113 @@ namespace bbtk return libname; } -// =================================================================================== - - static inline bool IsAtRoot(std::string cwd) - { - if ( cwd == "/" // hope it gets / (for Linux) - || (cwd.size() <= 3 && cwd[1] == ':') ) // hope it gets C: D: (for Windows) - return (true); - else - return(false); - } - -// =================================================================================== - -static bool IsDirectory(std::string const &dirName) -{ - struct stat fs; - - if ( stat(dirName.c_str(), &fs) == 0 ) - { + //======================================================================== + + static inline bool IsAtRoot(std::string cwd) + { + if ( cwd == "/" // hope it gets / (for Linux) + || (cwd.size() <= 3 && cwd[1] == ':') ) // hope it gets C: D: (for Windows) + return (true); + else + return(false); + } + + // ====================================================================== + + static bool IsDirectory(std::string const &dirName) + { + struct stat fs; + + if ( stat(dirName.c_str(), &fs) == 0 ) + { #if _WIN32 - return ((fs.st_mode & _S_IFDIR) != 0); + return ((fs.st_mode & _S_IFDIR) != 0); #else - return S_ISDIR(fs.st_mode); + return S_ISDIR(fs.st_mode); #endif - } - else - { - return false; - } -} - -// =================================================================================== - + } + else + { + return false; + } + } + + // =================================================================================== + static inline void SplitAroundFirstDot( const std::string& in, std::string& left, std::string& right) - { + { std::string delimiter = "."; std::string::size_type pos = in.find_first_of(delimiter); if (std::string::npos != pos) - { - left = in.substr(0,pos); - right = in.substr(pos+1,in.size()); - - } + { + left = in.substr(0,pos); + right = in.substr(pos+1,in.size()); + + } else - { - // bbtkError(in<<" : expected 'a.b' format but no dot found"); - left =""; - right = ""; - } + { + // bbtkError(in<<" : expected 'a.b' format but no dot found"); + left =""; + right = ""; + } } - //======================================================================= - static inline void SplitString ( const std::string& str, - const std::string& delimiters, - std::vector& tokens) - { - // Skip delimiters at beginning. - std::string::size_type lastPos = str.find_first_not_of(delimiters, 0); - // Find first delimiter. - std::string::size_type pos = str.find_first_of(delimiters, lastPos); + //======================================================================= + static inline void SplitString ( const std::string& str, + const std::string& delimiters, + std::vector& tokens) + { + // Skip delimiters at beginning. + std::string::size_type lastPos = str.find_first_not_of(delimiters, 0); + // Find first delimiter. + std::string::size_type pos = str.find_first_of(delimiters, lastPos); + + while (std::string::npos != pos || std::string::npos != lastPos) + { + // Found a token, add it to the vector. + tokens.push_back(str.substr(lastPos, pos - lastPos)); + // Skip delimiters. Note the "not_of" + lastPos = str.find_first_not_of(delimiters, pos); + // Find next delimiter + pos = str.find_first_of(delimiters, lastPos); + } + + } + //======================================================================= - while (std::string::npos != pos || std::string::npos != lastPos) - { - // Found a token, add it to the vector. - tokens.push_back(str.substr(lastPos, pos - lastPos)); - // Skip delimiters. Note the "not_of" - lastPos = str.find_first_not_of(delimiters, pos); - // Find next delimiter - pos = str.find_first_of(delimiters, lastPos); - } - } - //======================================================================= - - -// =================================================================================== - + // =================================================================================== + static inline std::string get_file_name(const std::string& s) { std::string::size_type slash_position = s.find_last_of("/\\"); if (slash_position != std::string::npos) - { - return s.substr(slash_position+1,std::string::npos); - } + { + return s.substr(slash_position+1,std::string::npos); + } else - { - return s; - } + { + return s; + } } -// =================================================================================== -/** - * \brief Explore a directory with possibility of recursion - * return number of files read - * @param dirpath directory to explore - * @param recursive whether we want recursion or not - */ -static int Explore(std::string const &dirpath, bool recursive, std::vector &Filenames) -{ - int numberOfFiles = 0; - std::string fileName; - - std::string dirName = dirpath; - + // =================================================================================== + /** + * \brief Explore a directory with possibility of recursion + * return number of files read + * @param dirpath directory to explore + * @param recursive whether we want recursion or not + */ + static int Explore(std::string const &dirpath, bool recursive, std::vector &Filenames) + { + int numberOfFiles = 0; + std::string fileName; + + std::string dirName = dirpath; + #ifdef _MSC_VER - WIN32_FIND_DATA fileData; + WIN32_FIND_DATA fileData; HANDLE hFile = FindFirstFile((dirName+"*").c_str(), &fileData); for(BOOL b = (hFile != INVALID_HANDLE_VALUE); b; @@ -512,6 +513,24 @@ static int Explore(std::string const &dirpath, bool recursive, std::vector