--- parser3/src/main/pa_exception.C 2003/01/21 15:51:14 1.43 +++ parser3/src/main/pa_exception.C 2003/01/23 16:08:01 1.43.2.2 @@ -5,12 +5,15 @@ Author: Alexandr Petrosian (http://paf.design.ru) */ -static const char* IDENT_EXCEPTION_C="$Date: 2003/01/21 15:51:14 $"; +static const char* IDENT_EXCEPTION_C="$Date: 2003/01/23 16:08:01 $"; -#include "pa_common.h" +//#include "pa_common.h" #include "pa_exception.h" -#include "pa_globals.h" +//#include "pa_globals.h" #include "pa_sapi.h" +#include "pa_string.h" + +Exception::problem_source_type Exception::undefined_source=object_ptr(0); Exception::Exception() { ftype=0; @@ -18,7 +21,7 @@ Exception::Exception() { owns_comment=false; fcomment=0; } Exception::Exception(const char *atype, - const String *aproblem_source, + problem_source_type aproblem_source, const char *comment_fmt, ...) { //_asm int 3; //__asm__("int3"); @@ -37,30 +40,6 @@ Exception::Exception(const char *atype, } else fcomment=0; } -Exception::Exception(const Exception& src) : - ftype(src.ftype), - fproblem_source(src.fproblem_source), - fcomment(src.fcomment), - owns_comment(src.owns_comment) { - // that ugly string got from STL, along with principal ideal - const_cast(&src)->owns_comment=false; -} -Exception& Exception::operator =(const Exception& src) { - ftype=src.ftype; - fproblem_source=src.fproblem_source; - - if(owns_comment) - free(fcomment); - fcomment=src.fcomment; - // that ugly string got from STL, along with principal ideal - owns_comment=src.owns_comment; ((Exception*)&src)->owns_comment=false; - - return *this; -} -Exception::~Exception() { - if(owns_comment) - free(fcomment); -} #ifdef XML Exception::Exception( @@ -123,3 +102,7 @@ Exception::Exception( fcomment=0; } #endif + +object_ptr Exception::problem_source() const { + return fproblem_source && fproblem_source->size()?fproblem_source:0; +}