X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=kernel%2Fsrc%2FbbtkInterpreter.h;h=0cd00f3fc237960b3a2628ac6ea39704a1273d99;hb=75cc88fbe565b4ee1a627bab47e6703d8d3399f1;hp=24dbd89f29079743afdb46b14a5f0374f5b14f76;hpb=2d76cd309d74d5f83d701d6bb0a4140d5d122b36;p=bbtk.git diff --git a/kernel/src/bbtkInterpreter.h b/kernel/src/bbtkInterpreter.h index 24dbd89..0cd00f3 100644 --- a/kernel/src/bbtkInterpreter.h +++ b/kernel/src/bbtkInterpreter.h @@ -3,8 +3,8 @@ Program: bbtk Module: $RCSfile: bbtkInterpreter.h,v $ $ Language: C++ - Date: $Date: 2008/01/30 09:28:15 $ - Version: $Revision: 1.6 $ + Date: $Date: 2008/02/12 12:55:16 $ + 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 @@ -36,6 +36,8 @@ namespace bbtk { + + class BBTK_EXPORT Interpreter { @@ -58,7 +60,7 @@ namespace bbtk cConfig, // JPR cReset, // EED cAuthor, - cKeyword, // JPR + cCategory, // JPR cDescription, cHelp, cMessage, @@ -68,13 +70,14 @@ namespace bbtk cUnload, cGraph, cPrint, + cIndex, cWorkspace // LG } CommandCodeType; /// The structure storing the informations on a command typedef struct { - std::string keyword; + std::string category; int argmin, argmax; CommandCodeType code; std::string syntax; @@ -112,7 +115,8 @@ namespace bbtk void SetDialogMode(DialogModeType t) { mExecuter->SetDialogMode(t); } /// Runs the interpretation of a file - void InterpretFile( const std::string& filename, bool use_configuration_file=true, bool verbose=false); + void InterpretFile( const std::string& filename, + bool use_configuration_file=true); /// Interprets a line (either from a file or typed interactively) void InterpretLine( const std::string& line, bool &insideComment ); @@ -129,7 +133,8 @@ namespace bbtk CommandInfoType& info ); /// Switch to the interpretation of a file - void SwitchToFile( const std::string& filename, bool use_configuration_file=true, bool verbose=false ); + void SwitchToFile( const std::string& filename, + bool use_configuration_file=true); /// Closes the currently open file void CloseCurrentFile(); @@ -150,10 +155,12 @@ namespace bbtk void Graph(const std::vector& words); /// - void Config(bool verbose) const; // JPR + void Config() const; /// void Print(const std::string&); + void Index(const std::string& filename, + const std::string& type = "Initials"); /// void FindCommandsWithPrefix( char* buf, int n, @@ -162,9 +169,13 @@ namespace bbtk /// Sets the bool that indicates wether we are in command line context void SetCommandLine(bool v = true) { mCommandLine = v; } + private: - void LoadScript( std::string fullPathScriptName); + /// Opens the file fullPathScriptName + /// includeScriptName is the name as given to the include command + void LoadScript( std::string fullPathScriptName, + std::string includeScriptName); private: @@ -177,12 +188,15 @@ namespace bbtk /// The command executer bbtk::VirtualExec* mExecuter; - /// Vector of opened files + /// Vector of open files std::vector mFile; - /// Vector of names of open files + /// Vector of names of open files with full path (as open) std::vector mFileName; + /// Vector of names of open files as given to the include command + std::vector mIncludeFileName; + /// Stores the current line number in each open file std::vector mLine; @@ -195,7 +209,6 @@ namespace bbtk /// The history of commands std::deque< char* > mHistory; - bool verbose; // true -> displays the search results (for packages) };