Annotation of parser3/src/include/pa_exception.h, revision 1.27

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.27    ! paf         7:        $Id: pa_exception.h,v 1.26 2001/12/29 08:39:04 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"
1.14      parser     15: 
                     16: class Pool;
                     17: 
1.22      paf        18: // defines
                     19: 
1.10      paf        20: /// Just simple longjump mechanizm dressed in class clothes. use Temp_exception
1.1       paf        21: class Exception {
                     22: public:
                     23: 
1.19      paf        24:        Exception();
1.15      parser     25:        Exception(
1.1       paf        26:                const String *atype, const String *acode,
                     27:                const String *aproblem_source, 
1.15      parser     28:                const char *comment_fmt, ...);
1.25      paf        29:        Exception(
                     30:                const String *atype, const String *acode,
                     31:                const String *aproblem_source, 
1.26      paf        32:                const char *comment_fmt, va_list args); 
                     33:        Exception(
                     34:                const String *atype, const String *acode,
                     35:                const String *aproblem_source, 
1.25      paf        36:                GdomeException& exc);
1.22      paf        37:        Exception(const Exception& src);
                     38:        Exception& operator =(const Exception& src);
                     39:        ~Exception();
1.14      parser     40: 
                     41: #ifdef XML
1.24      paf        42:        /*
1.14      parser     43:        /// converts XSL exception to parser exception
1.18      parser     44:        static void provide_source(Pool& pool, const String *source, const XSLException& e);
1.14      parser     45:        /// converts SAX exception to parser exception
1.18      parser     46:        static void provide_source(Pool& pool, const String *source, const SAXException& e);
1.14      parser     47:        /// converts SAX parse exception to parser exception
1.18      parser     48:        static void provide_source(Pool& pool, const String *source, const SAXParseException& e);
1.14      parser     49:        /// converts XML exception to parser exception
1.18      parser     50:        static void provide_source(Pool& pool, const String *source, const XMLException& e);
1.14      parser     51:        /// converts Xalan DOM exception to parser exception
1.18      parser     52:        static void provide_source(Pool& pool, const String *source, const XalanDOMException& e);
1.24      paf        53:        */
1.14      parser     54: #endif
1.1       paf        55: 
1.10      paf        56:        /// extracts exception type
1.5       paf        57:        const String *type() const { return ftype; }
1.10      paf        58:        /// extracts exception code
1.5       paf        59:        const String *code() const { return fcode; }
1.10      paf        60:        /// extracts exception problem_source
1.5       paf        61:        const String *problem_source() const { return fproblem_source; }
1.10      paf        62:        /// extracts exception comment
1.22      paf        63:        const char *comment() const { return fcomment; }
1.26      paf        64: 
                     65: private:
                     66: 
                     67:        void initialize(const String *atype, const String *acode,
                     68:                const String *aproblem_source, 
                     69:                const char *comment_fmt, va_list args);
1.1       paf        70: 
                     71: private:
                     72: 
1.15      parser     73:        const String *ftype, *fcode, *fproblem_source;
1.22      paf        74:        bool owns_comment;
                     75:        char *fcomment;
1.15      parser     76: 
1.1       paf        77: };
                     78: 
                     79: #endif

E-mail: