Annotation of parser3/src/main/pa_exception.C, revision 1.45

1.13      parser      1: /** @file
                      2:        Parser: exception class.
                      3: 
1.44      paf         4:        Copyright (c) 2001-2003 ArtLebedev Group (http://www.artlebedev.com)
1.38      paf         5:        Author: Alexandr Petrosian <paf@design.ru> (http://paf.design.ru)
1.41      paf         6: */
1.13      parser      7: 
1.45    ! paf         8: static const char* IDENT_EXCEPTION_C="$Date: 2003/07/24 11:31:23 $";
1.13      parser      9: 
                     10: #include "pa_common.h"
                     11: #include "pa_exception.h"
1.44      paf        12: #include "pa_sapi.h"
1.31      paf        13: #include "pa_globals.h"
1.13      parser     14: 
1.44      paf        15: 
                     16: // methods
                     17: 
                     18: Exception::Exception(): ftype(0), fproblem_source(0), fcomment(0) {}
                     19: Exception::Exception(const Exception& src):
                     20:        ftype(src.ftype),
                     21:        fproblem_source(src.fproblem_source),
                     22:        fcomment(src.fcomment) {
1.23      paf        23: }
1.44      paf        24: Exception& Exception::operator =(const Exception& src) {
                     25:        ftype=src.ftype;
                     26:        fproblem_source=src.fproblem_source;
                     27:        fcomment=src.fcomment;
                     28:        return *this;
                     29: }
                     30: 
                     31: Exception::Exception(const char* atype, 
                     32:                     const String* aproblem_source, 
                     33:                     const char* comment_fmt, ...) {
1.30      paf        34:        ftype=atype;
                     35:        fproblem_source=aproblem_source;
1.27      paf        36: 
1.13      parser     37:        if(comment_fmt) {
1.44      paf        38:                fcomment=new(PointerFreeGC) char[MAX_STRING];
1.34      paf        39:                va_list args;
                     40:                va_start(args, comment_fmt);
1.13      parser     41:                vsnprintf(fcomment, MAX_STRING, comment_fmt, args);
1.44      paf        42: //             _asm int 3;
1.34      paf        43:                va_end(args);
1.26      paf        44:        } else
                     45:                fcomment=0;
                     46: }
1.44      paf        47: 
                     48: const String* Exception::problem_source() const { 
                     49:        return fproblem_source && fproblem_source->length()?fproblem_source:0; 
                     50: }

E-mail: