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

1.13      parser      1: /** @file
                      2:        Parser: exception class.
                      3: 
1.50    ! moko        4:        Copyright (c) 2001-2012 Art. Lebedev Studio (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: 
                      8: #include "pa_common.h"
                      9: #include "pa_exception.h"
1.44      paf        10: #include "pa_sapi.h"
1.31      paf        11: #include "pa_globals.h"
1.13      parser     12: 
1.50    ! moko       13: volatile const char * IDENT_PA_EXCEPTION_C="$Id: 2009-05-05 10:07:11 $" IDENT_PA_EXCEPTION_H;
1.44      paf        14: 
                     15: // methods
                     16: 
                     17: Exception::Exception(): ftype(0), fproblem_source(0), fcomment(0) {}
                     18: Exception::Exception(const Exception& src):
                     19:        ftype(src.ftype),
                     20:        fproblem_source(src.fproblem_source),
                     21:        fcomment(src.fcomment) {
1.23      paf        22: }
1.44      paf        23: Exception& Exception::operator =(const Exception& src) {
                     24:        ftype=src.ftype;
                     25:        fproblem_source=src.fproblem_source;
                     26:        fcomment=src.fcomment;
                     27:        return *this;
                     28: }
                     29: 
                     30: Exception::Exception(const char* atype, 
1.49      misha      31:                        const String* aproblem_source, 
                     32:                        const char* comment_fmt, ...) {
1.30      paf        33:        ftype=atype;
                     34:        fproblem_source=aproblem_source;
1.27      paf        35: 
1.13      parser     36:        if(comment_fmt) {
1.44      paf        37:                fcomment=new(PointerFreeGC) char[MAX_STRING];
1.34      paf        38:                va_list args;
                     39:                va_start(args, comment_fmt);
1.13      parser     40:                vsnprintf(fcomment, MAX_STRING, comment_fmt, args);
1.44      paf        41: //             _asm int 3;
1.34      paf        42:                va_end(args);
1.26      paf        43:        } else
                     44:                fcomment=0;
                     45: }
1.44      paf        46: 
                     47: const String* Exception::problem_source() const { 
1.49      misha      48:        return fproblem_source && !fproblem_source->is_empty()?fproblem_source:0; 
1.44      paf        49: }

E-mail: