Annotation of parser3/src/main/pa_xml_exception.C, revision 1.17

1.1       paf         1: /** @file
                      2:        Parser: exception class.
                      3: 
1.15      moko        4:        Copyright (c) 2001-2026 Art. Lebedev Studio (https://www.artlebedev.com)
1.13      moko        5:        Authors: Konstantin Morshnev <moko@design.ru>, Alexandr Petrosian <paf@design.ru>
1.1       paf         6: */
                      7: 
                      8: #include "pa_config_includes.h"
                      9: 
                     10: #ifdef XML
                     11: 
                     12: #include "pa_xml_exception.h"
                     13: #include "pa_globals.h"
                     14: #include "pa_common.h"
1.9       moko       15: #include "pa_charset.h"
1.1       paf        16: 
1.17    ! moko       17: volatile const char * IDENT_PA_XML_EXCEPTION_C="$Id: pa_xml_exception.C,v 1.16 2026/10/18 21:05:35 moko Exp $" IDENT_PA_XML_EXCEPTION_H;
1.7       moko       18: 
1.1       paf        19: // methods
                     20: 
1.6       misha      21: XmlException::XmlException(const String* aproblem_source, const char* aproblem_comment, ...) {
1.1       paf        22:        ftype="xml";
1.17    ! moko       23:        fproblem_source=pa_gc_reference(aproblem_source);
1.1       paf        24: 
1.17    ! moko       25:        fcomment=pa_gc_reference(new(PointerFreeGC) char[MAX_STRING]);
1.9       moko       26:        va_list args;
                     27:        va_start(args, aproblem_comment);
1.16      moko       28:        pa_vsnprintf((char *)fcomment, MAX_STRING, aproblem_comment, args);
1.9       moko       29:        va_end(args);
                     30: }
                     31: 
                     32: XmlException::XmlException(const String* aproblem_source, Request& r){
                     33:        ftype="xml";
1.17    ! moko       34:        fproblem_source=pa_gc_reference(aproblem_source);
1.9       moko       35: 
                     36:        if(const char* xml_generic_errors=xmlGenericErrors()){
1.17    ! moko       37:                fcomment=pa_gc_reference(pa_strdup(xml_generic_errors));
1.9       moko       38:                if(r.charsets.source().isUTF8())
1.17    ! moko       39:                        fcomment=pa_gc_reference(fixUTF8(fcomment));
1.9       moko       40:        } else
                     41:                fcomment="-UNKNOWN ERROR-";
                     42: }
                     43: 
                     44: XmlException::XmlException(){
                     45:        ftype="xml";
                     46:        fproblem_source=0;
                     47: 
                     48:        if(const char* xml_generic_errors=xmlGenericErrors())
1.17    ! moko       49:                fcomment=pa_gc_reference(pa_strdup(xml_generic_errors));
1.6       misha      50:        else
1.5       paf        51:                fcomment="-UNKNOWN ERROR-";
1.1       paf        52: }
1.9       moko       53: 
1.1       paf        54: #endif

E-mail: