]> Creatis software - bbtk.git/blobdiff - kernel/src/bbtkInterpreter.h
*** empty log message ***
[bbtk.git] / kernel / src / bbtkInterpreter.h
index 93fad6de074a72a0df994e9f2281ba1415f0afba..c53e76b4acba1d5fc297bb976a67398c554040b3 100644 (file)
@@ -3,8 +3,8 @@
   Program:   bbtk
   Module:    $RCSfile: bbtkInterpreter.h,v $ $
   Language:  C++
-  Date:      $Date: 2008/03/21 11:44:37 $
-  Version:   $Revision: 1.19 $
+  Date:      $Date: 2008/03/21 14:59:39 $
+  Version:   $Revision: 1.20 $
 
   Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
   l'Image). All rights reserved. See Doc/License.txt or
@@ -53,6 +53,33 @@ namespace bbtk
 
   };
 
+  ///
+  class BBTK_EXPORT InterpreterError : public Exception
+  {
+  public:
+    InterpreterError( const std::string& message,
+                     bool in_script_file,
+                     const std::string& script_file,
+                     int script_line 
+                     );
+    InterpreterError( const Exception& excep,
+                     bool in_script_file,
+                     const std::string& script_file,
+                     int script_line 
+                     );
+    ~InterpreterError() throw() {}
+
+    bool IsInScriptFile() const { return mInScriptFile; }
+    const std::string& GetScriptFile() const { return mScriptFile; }
+    int GetScriptLine() const { return mScriptLine; }
+  private:
+    bool mInScriptFile;
+    std::string mScriptFile;
+    int mScriptLine;
+  };
+
+
+  /// 
   class BBTK_EXPORT Interpreter
   {
 
@@ -231,6 +258,11 @@ namespace bbtk
     void LoadScript( std::string fullPathScriptName,
                     std::string includeScriptName);
 
+    /// 
+    void CatchBbtkException( const bbtk::Exception& e );
+    void CatchStdException( const std::exception& e );
+    void CatchUnknownException();
+
   private:
 
     //==================================================================