]> Creatis software - bbtk.git/blobdiff - kernel/src/bbtkInterpreter.cxx
First stage of 'Keyword'
[bbtk.git] / kernel / src / bbtkInterpreter.cxx
index 861f063656ab773dd5e5489debab459f678252f1..dac3e047189dcffc96a91b60d1fb2c2f54f2523a 100644 (file)
@@ -3,8 +3,8 @@
   Program:   bbtk
   Module:    $RCSfile: bbtkInterpreter.cxx,v $ $
   Language:  C++
-  Date:      $Date: 2008/01/29 14:34:43 $
-  Version:   $Revision: 1.14 $
+  Date:      $Date: 2008/01/30 09:28:15 $
+  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
@@ -178,6 +178,14 @@ Interpreter* Interpreter::mGlobalInterpreter = NULL;
     info.syntax = "author <string>";
     info.help = "Adds the string <string> to the author information of the black box being defined";
     mCommandDict[info.keyword] = info;
+    
+    info.keyword = "keyword"; //JP
+    info.argmin = 1;
+    info.argmax = 1;
+    info.code = cKeyword;
+    info.syntax = "keyword <list of items, separated by ;>";
+    info.help = "Adds the string <string> to the keyword information of the black box being defined";
+    mCommandDict[info.keyword] = info;
 
     info.keyword = "description";
     info.argmin = 1;
@@ -494,7 +502,11 @@ void Interpreter::InterpretLine( const std::string& line, bool &insideComment )
       case cAuthor :
         mExecuter->Author(words[1]);
         break;
-        
+
+      case cKeyword :
+        mExecuter->Keyword(words[1]);
+        break;
+                
       case cDescription :
         mExecuter->Description(words[1]);
         break;
@@ -796,7 +808,7 @@ void Interpreter::SplitLine ( const std::string& str, std::vector<std::string>&
         int nbFiles = Utilities::Explore(fullDirectoryName, false, Filenames);
 // std::cout << "=================nbFiles " << nbFiles << std::endl;
         int nbBssFiles = 0;
-        for (std::vector<std::string>::iterator i = Filenames.begin(); i!=Filenames.end(); ++i)
+        for (std::vector<std::string>::iterator i = Filenames.begin(); i!= Filenames.end(); ++i)
         {
            if ((*i).substr((*i).size()-4, 4) != ".bbs")
               continue;      // ignore non .bbs files
@@ -818,8 +830,7 @@ void Interpreter::SplitLine ( const std::string& str, std::vector<std::string>&
     // (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 (slash_position != std::string::npos)
+
     if (name[0]=='/' || name[1] == ':' || name[0]=='.')  // absolute path (linux/windows) or relative path
     { 
 
@@ -849,7 +860,6 @@ void Interpreter::SplitLine ( const std::string& str, std::vector<std::string>&
         {
           foundFile = true;
         }
-
       } // endif l != 0
     }
     else