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

1.10      paf         1: /** @file
1.11      paf         2:        Parser: exception decls.
                      3: 
1.38.2.13  paf         4:        Copyright (c) 2001-2003 ArtLebedev Group (http://www.artlebedev.com)
1.31      paf         5:        Author: Alexandr Petrosian <paf@design.ru> (http://paf.design.ru)
1.1       paf         6: */
                      7: 
                      8: #ifndef PA_EXCEPTION_H
                      9: #define PA_EXCEPTION_H
1.36      paf        10: 
1.38.2.15.2.3! (paf       11:: static const char* IDENT_EXCEPTION_H="$Date: 2003/03/19 12:22:35 $";
1.38.2.10  paf        12: 
                     13: // includes
                     14: 
1.38.2.15  paf        15: #include "pa_memory.h"
1.1       paf        16: 
1.38.2.9  paf        17: // forwards
                     18: 
1.38.2.15.2.2  (paf       19:: class String;
1.14      parser     20: 
1.22      paf        21: // defines
                     22: 
1.1       paf        23: class Exception {
                     24: public:
                     25: 
1.19      paf        26:        Exception();
1.15      parser     27:        Exception(
1.38.2.13  paf        28:                const char* atype,
1.38.2.15.2.1  (paf       29::               const String* aproblem_source, 
1.38.2.13  paf        30:                const char* comment_fmt, ...);
1.38.2.14  paf        31:        Exception(const Exception& src);
                     32:        Exception& operator =(const Exception& src);
1.14      parser     33: 
                     34: #ifdef XML
1.28      paf        35:        Exception(
1.38.2.15.2.1  (paf       36::               const String* aproblem_source, 
1.28      paf        37:                GdomeException& exc);
1.14      parser     38: #endif
1.1       paf        39: 
1.10      paf        40:        /// extracts exception type
1.38.2.13  paf        41:        const char* type(bool can_be_empty=false) const { 
1.35      paf        42:                if(can_be_empty)
                     43:                        return ftype; 
                     44:                else
                     45:                        return ftype?ftype:"<no type>";
                     46:        }
1.10      paf        47:        /// extracts exception problem_source
1.38.2.15.2.2  (paf       48::       const String* problem_source() const;
                     49::       /// extracts exception comment
1.38.2.13  paf        50:        const char* comment(bool can_be_empty=false) const { 
1.38.2.15.2.1  (paf       51::               const char* result=fcomment && *fcomment?fcomment:0;
1.35      paf        52:                if(can_be_empty)
                     53:                        return result; 
                     54:                else
                     55:                        return result?result:"<no comment>";
                     56:        }
1.1       paf        57: 
                     58: private:
                     59: 
1.38.2.13  paf        60:        const char* ftype;
1.38.2.15.2.1  (paf       61::       const String* fproblem_source;
1.38.2.15.2.3! (paf       62::       char* fcomment;
1.15      parser     63: 
1.1       paf        64: };
                     65: 
                     66: #endif

E-mail: