Annotation of parser3/src/main/pa_xml_exception.C, revision 1.9
1.1 paf 1: /** @file
2: Parser: exception class.
3:
1.7 moko 4: Copyright (c) 2001-2012 Art. Lebedev Studio (http://www.artlebedev.com)
1.1 paf 5: Author: Alexandr Petrosian <paf@design.ru> (http://paf.design.ru)
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.9 ! moko 17: volatile const char * IDENT_PA_XML_EXCEPTION_C="$Id: pa_xml_exception.C,v 1.8 2013/07/16 15:06:40 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";
23: fproblem_source=aproblem_source;
24:
1.9 ! moko 25: fcomment=new(PointerFreeGC) char[MAX_STRING];
! 26: va_list args;
! 27: va_start(args, aproblem_comment);
! 28: vsnprintf((char *)fcomment, MAX_STRING, aproblem_comment, args);
! 29: va_end(args);
! 30: }
! 31:
! 32: XmlException::XmlException(const String* aproblem_source, Request& r){
! 33: ftype="xml";
! 34: fproblem_source=aproblem_source;
! 35:
! 36: if(const char* xml_generic_errors=xmlGenericErrors()){
! 37: fcomment=pa_strdup(xml_generic_errors);
! 38: if(r.charsets.source().isUTF8())
! 39: fcomment=fixUTF8(fcomment);
! 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.5 paf 49: fcomment=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: