X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=kernel%2Fsrc%2FbbtkInterpreter.h;h=bdf3da926af354a865cba6be74955ae784853a0d;hb=cf155931d4fded21cd2aaaeb0f3ead82067d2bef;hp=2e7ba4df6f2c0462179108c1bcf6e910f3e2d277;hpb=d8041d1ef54a73acc2306557435f6b04edf60daf;p=bbtk.git diff --git a/kernel/src/bbtkInterpreter.h b/kernel/src/bbtkInterpreter.h index 2e7ba4d..bdf3da9 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/05/06 13:45:12 $ - Version: $Revision: 1.30 $ + Date: $Date: 2008/10/08 13:39:33 $ + Version: $Revision: 1.34 $ Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de l'Image). All rights reserved. See Doc/License.txt or @@ -45,7 +45,7 @@ namespace bbtk { public: InterpreterUser() {} - ~InterpreterUser() {} + virtual ~InterpreterUser() {} virtual bool InterpreterUserHasOwnHtmlPageViewer() { return false; } virtual void InterpreterUserViewHtmlPage(const std::string&) {} @@ -90,6 +90,7 @@ namespace bbtk typedef Object Superclass; public: static Pointer New(const std::string& cpp_file = ""); + static Pointer New(VirtualExec::Pointer); typedef enum { @@ -100,7 +101,7 @@ namespace bbtk ExitStatus; /// Runs the interpretation of a file - ExitStatus InterpretFile( const std::string& filename); + ExitStatus InterpretFile( const std::string& filename, bool source = false); /// Runs the interpretation of a buffer and deletes it ! ExitStatus InterpretBuffer( std::stringstream* buffer ); @@ -121,14 +122,16 @@ namespace bbtk /// Puts the executer in "no exec" mode, /// which creates but does not execute pipelines. - void SetNoExecMode(bool b) { mVirtualExecuter->SetNoExecMode(b); } + void SetNoExecMode(bool m) { mVirtualExecuter->SetNoExecMode(m); } + /// Puts the executer in "no error" mode, + /// Errors do not stop execution (but warnings are produced) + void SetNoErrorMode(bool m) { mVirtualExecuter->SetNoErrorMode(m);} /// //typedef Executer::DialogModeType DialogModeType; typedef VirtualExec::DialogModeType DialogModeType; - void SetDialogMode(DialogModeType t) - { mVirtualExecuter->SetDialogMode(t); } + void SetDialogMode(DialogModeType t) { mVirtualExecuter->SetDialogMode(t);} /// Sets the bool that indicates wether we are in command line context void SetCommandLine(bool v = true) { mCommandLine = v; } @@ -214,7 +217,7 @@ namespace bbtk CommandInfoType& info ); /// Switch to the interpretation of a file - void SwitchToFile( const std::string& filename ); + void SwitchToFile( const std::string& filename, bool source = false ); /// Switch to the interpretation of a stringstream void SwitchToStream( std::stringstream* stream ); @@ -267,6 +270,10 @@ namespace bbtk /// Constructor Interpreter(const std::string& cpp_file = ""); + Interpreter(VirtualExec::Pointer); + + void Init(VirtualExec::Pointer, const std::string& cpp_file); + /// Opens the file fullPathScriptName /// includeScriptName is the name as given to the include command void LoadScript( std::string fullPathScriptName,