|
|
| version 1.12, 2001/05/17 10:22:24 | version 1.31, 2002/02/08 08:30:13 |
|---|---|
| Line 1 | Line 1 |
| /** @file | /** @file |
| Parser: exception decls. | Parser: exception decls. |
| Copyright (c) 2001 ArtLebedev Group (http://www.artlebedev.com) | Copyright (c) 2001, 2002 ArtLebedev Group (http://www.artlebedev.com) |
| Author: Alexandr Petrosian <paf@design.ru> (http://paf.design.ru) | |
| Author: Alexander Petrosyan <paf@design.ru> (http://design.ru/paf) | |
| $Id$ | $Id$ |
| */ | */ |
| Line 11 | Line 10 |
| #ifndef PA_EXCEPTION_H | #ifndef PA_EXCEPTION_H |
| #define PA_EXCEPTION_H | #define PA_EXCEPTION_H |
| #include "pa_config_includes.h" | |
| #include "pa_types.h" | #include "pa_types.h" |
| #include "pa_string.h" | #include "pa_string.h" |
| class Pool; | |
| // defines | |
| /// Just simple longjump mechanizm dressed in class clothes. use Temp_exception | /// Just simple longjump mechanizm dressed in class clothes. use Temp_exception |
| class Exception { | class Exception { |
| public: | public: |
| /** | Exception(); |
| address for long jump to jump to | Exception( |
| regretfully public: | const String *atype, const String *acode, |
| can't make local unless sure of inlining | const String *aproblem_source, |
| for to-die stack frame ruins it all | const char *comment_fmt, ...); |
| */ | Exception(const Exception& src); |
| mutable jmp_buf mark; | Exception& operator =(const Exception& src); |
| ~Exception(); | |
| /// throws an exception[really goes to mark-ed position | #ifdef XML |
| void _throw( | Exception( |
| 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; | GdomeException& exc); |
| #endif | |
| /// extracts exception type | /// extracts exception type |
| const String *type() const { return ftype; } | const String *type() const { return ftype; } |
| Line 40 public: | Line 44 public: |
| /// extracts exception problem_source | /// extracts exception problem_source |
| const String *problem_source() const { return fproblem_source; } | const String *problem_source() const { return fproblem_source; } |
| /// extracts exception comment | /// extracts exception comment |
| const char *comment() const { return fcomment[0]?fcomment:0; } | const char *comment() const { return fcomment; } |
| private: | private: |
| mutable const String *ftype, *fcode, *fproblem_source; | const String *ftype, *fcode, *fproblem_source; |
| mutable char fcomment[MAX_STRING]; | bool owns_comment; |
| char *fcomment; | |
| }; | }; |
| #endif | #endif |