Diff for /parser3/src/include/pa_exception.h between versions 1.6 and 1.21

version 1.6, 2001/03/10 16:34:35 version 1.21, 2001/11/15 18:21:31
Line 1 Line 1
 /*  /** @file
         Parser          Parser: exception decls.
   
         Copyright (c) 2001 ArtLebedev Group (http://www.artlebedev.com)          Copyright (c) 2001 ArtLebedev Group (http://www.artlebedev.com)
         Author: Alexander Petrosyan <paf@design.ru>          Author: Alexander Petrosyan <paf@design.ru> (http://paf.design.ru)
   
         $Id$          $Id$
 */  */
Line 9 Line 10
 #ifndef PA_EXCEPTION_H  #ifndef PA_EXCEPTION_H
 #define PA_EXCEPTION_H  #define PA_EXCEPTION_H
   
 #include <setjmp.h>  #include "pa_config_includes.h"
   
 #include "pa_types.h"  #include "pa_types.h"
 #include "pa_string.h"  #include "pa_string.h"
   
   #ifdef XML
   #include <PlatformSupport/XSLException.hpp>
   #include <sax/SAXException.hpp>
   #include <sax/SAXParseException.hpp>
   #include <util/XMLException.hpp>
   #endif
   
   class Pool;
   
   /// Just simple longjump mechanizm dressed in class clothes. use Temp_exception
 class Exception {  class Exception {
 public:  public:
   
         // address for long jump to jump to           Exception();
         // regretfully public:          Exception(
         //   can't make local unless sure of inlining  
         //   for to-die stack frame ruins it all  
         mutable jmp_buf mark;  
   
         void _throw(  
                 const String *atype, const String *acode,                  const String *atype, const String *acode,
                 const String *aproblem_source,                   const String *aproblem_source, 
                 const char *comment_fmt, ...) const;                  const char *comment_fmt, ...);
   
   #ifdef XML
           /// converts XSL exception to parser exception
           static void provide_source(Pool& pool, const String *source, const XSLException& e);
           /// converts SAX exception to parser exception
           static void provide_source(Pool& pool, const String *source, const SAXException& e);
           /// converts SAX parse exception to parser exception
           static void provide_source(Pool& pool, const String *source, const SAXParseException& e);
           /// converts XML exception to parser exception
           static void provide_source(Pool& pool, const String *source, const XMLException& e);
           /// converts Xalan DOM exception to parser exception
           static void provide_source(Pool& pool, const String *source, const XalanDOMException& e);
   #endif
   
           /// extracts exception type
         const String *type() const { return ftype; }          const String *type() const { return ftype; }
           /// extracts exception code
         const String *code() const { return fcode; }          const String *code() const { return fcode; }
           /// extracts exception problem_source
         const String *problem_source() const { return fproblem_source; }          const String *problem_source() const { return fproblem_source; }
         const char *comment() const { return fcomment[0]?fcomment:0; }          /// extracts exception comment
           const char *comment() const { return *fcomment?fcomment:0; }
   
 private:  private:
   
         mutable const String *ftype, *fcode, *fproblem_source;          const String *ftype, *fcode, *fproblem_source;
         mutable char fcomment[MAX_STRING];          char fcomment[MAX_STRING];
 };  
   
 //#define EXCEPTION_TRY(e) (setjmp((e).mark)==0)  };
 // usage:  
 //   if(EXCEPTION_TRY(e)) { ...; if(?) e.raise(?); ...; } else { catch-code }  
   
 #endif  #endif

Removed from v.1.6  
changed lines
  Added in v.1.21


E-mail: