Annotation of parser3/src/include/pa_exception.h, revision 1.23
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.20 paf 5: Author: Alexander Petrosyan <paf@design.ru> (http://paf.design.ru)
1.6 paf 6:
1.23 ! paf 7: $Id: pa_exception.h,v 1.22 2001/11/15 20:26:34 paf Exp $
1.1 paf 8: */
9:
10: #ifndef PA_EXCEPTION_H
11: #define PA_EXCEPTION_H
12:
13: #include "pa_types.h"
14: #include "pa_string.h"
15:
1.14 parser 16: #ifdef XML
17: #include <PlatformSupport/XSLException.hpp>
18: #include <sax/SAXException.hpp>
19: #include <sax/SAXParseException.hpp>
20: #include <util/XMLException.hpp>
21: #endif
22:
23: class Pool;
24:
1.22 paf 25: // defines
26:
1.10 paf 27: /// Just simple longjump mechanizm dressed in class clothes. use Temp_exception
1.1 paf 28: class Exception {
29: public:
30:
1.19 paf 31: Exception();
1.15 parser 32: Exception(
1.1 paf 33: const String *atype, const String *acode,
34: const String *aproblem_source,
1.15 parser 35: const char *comment_fmt, ...);
1.22 paf 36: Exception(const Exception& src);
37: Exception& operator =(const Exception& src);
38: ~Exception();
1.14 parser 39:
40: #ifdef XML
41: /// converts XSL exception to parser exception
1.18 parser 42: static void provide_source(Pool& pool, const String *source, const XSLException& e);
1.14 parser 43: /// converts SAX exception to parser exception
1.18 parser 44: static void provide_source(Pool& pool, const String *source, const SAXException& e);
1.14 parser 45: /// converts SAX parse exception to parser exception
1.18 parser 46: static void provide_source(Pool& pool, const String *source, const SAXParseException& e);
1.14 parser 47: /// converts XML exception to parser exception
1.18 parser 48: static void provide_source(Pool& pool, const String *source, const XMLException& e);
1.14 parser 49: /// converts Xalan DOM exception to parser exception
1.18 parser 50: static void provide_source(Pool& pool, const String *source, const XalanDOMException& e);
1.14 parser 51: #endif
1.1 paf 52:
1.10 paf 53: /// extracts exception type
1.5 paf 54: const String *type() const { return ftype; }
1.10 paf 55: /// extracts exception code
1.5 paf 56: const String *code() const { return fcode; }
1.10 paf 57: /// extracts exception problem_source
1.5 paf 58: const String *problem_source() const { return fproblem_source; }
1.10 paf 59: /// extracts exception comment
1.22 paf 60: const char *comment() const { return fcomment; }
1.1 paf 61:
62: private:
63:
1.15 parser 64: const String *ftype, *fcode, *fproblem_source;
1.22 paf 65: bool owns_comment;
66: char *fcomment;
1.15 parser 67:
1.1 paf 68: };
69:
70: #endif
E-mail: