Annotation of parser3/src/include/pa_exception.h, revision 1.14
1.10 paf 1: /** @file
1.11 paf 2: Parser: exception decls.
3:
1.6 paf 4: Copyright (c) 2001 ArtLebedev Group (http://www.artlebedev.com)
1.7 paf 5: Author: Alexander Petrosyan <paf@design.ru> (http://design.ru/paf)
1.6 paf 6:
1.14 ! parser 7: $Id: pa_exception.h,v 1.13 2001/09/26 10:32:25 parser Exp $
1.1 paf 8: */
9:
10: #ifndef PA_EXCEPTION_H
11: #define PA_EXCEPTION_H
12:
1.12 parser 13: #include "pa_config_includes.h"
1.1 paf 14: #include "pa_types.h"
15: #include "pa_string.h"
16:
1.14 ! parser 17: #ifdef XML
! 18: #include <PlatformSupport/XSLException.hpp>
! 19: #include <sax/SAXException.hpp>
! 20: #include <sax/SAXParseException.hpp>
! 21: #include <util/XMLException.hpp>
! 22: #endif
! 23:
! 24: class Pool;
! 25:
1.10 paf 26: /// Just simple longjump mechanizm dressed in class clothes. use Temp_exception
1.1 paf 27: class Exception {
28: public:
29:
1.10 paf 30: /**
31: address for long jump to jump to
32: regretfully public:
33: can't make local unless sure of inlining
34: for to-die stack frame ruins it all
35: */
1.5 paf 36: mutable jmp_buf mark;
1.1 paf 37:
1.10 paf 38: /// throws an exception[really goes to mark-ed position
1.5 paf 39: void _throw(
1.1 paf 40: const String *atype, const String *acode,
41: const String *aproblem_source,
1.5 paf 42: const char *comment_fmt, ...) const;
1.14 ! parser 43:
! 44: #ifdef XML
! 45: /// converts XSL exception to parser exception
! 46: void _throw(Pool& pool, const String *source, const XSLException& e);
! 47: /// converts SAX exception to parser exception
! 48: void _throw(Pool& pool, const String *source, const SAXException& e);
! 49: /// converts SAX parse exception to parser exception
! 50: void _throw(Pool& pool, const String *source, const SAXParseException& e);
! 51: /// converts XML exception to parser exception
! 52: void _throw(Pool& pool, const String *source, const XMLException& e);
! 53: /// converts Xalan DOM exception to parser exception
! 54: void _throw(Pool& pool, const String *source, const XalanDOMException& e);
! 55: #endif
1.1 paf 56:
1.10 paf 57: /// extracts exception type
1.5 paf 58: const String *type() const { return ftype; }
1.10 paf 59: /// extracts exception code
1.5 paf 60: const String *code() const { return fcode; }
1.10 paf 61: /// extracts exception problem_source
1.5 paf 62: const String *problem_source() const { return fproblem_source; }
1.10 paf 63: /// extracts exception comment
1.5 paf 64: const char *comment() const { return fcomment[0]?fcomment:0; }
1.1 paf 65:
66: private:
67:
1.5 paf 68: mutable const String *ftype, *fcode, *fproblem_source;
69: mutable char fcomment[MAX_STRING];
1.1 paf 70: };
71:
72: #endif
E-mail: