Revision 111, 1.9 kB
(checked in by mido, 16 years ago)
|
pridana knihovna XSD (a jeji chlebodarkyne XERCES), v ramci Win32 zprovoznen priklad tests/test_xsd_hello.cxx
|
Line | |
---|
1 | // file : xsd/cxx/xml/dom/bits/error-handler-proxy.txx |
---|
2 | // author : Boris Kolpackov <boris@codesynthesis.com> |
---|
3 | // copyright : Copyright (c) 2005-2008 Code Synthesis Tools CC |
---|
4 | // license : GNU GPL v2 + exceptions; see accompanying LICENSE file |
---|
5 | |
---|
6 | #include <xsd/cxx/xml/string.hxx> |
---|
7 | |
---|
8 | namespace xsd |
---|
9 | { |
---|
10 | namespace cxx |
---|
11 | { |
---|
12 | namespace xml |
---|
13 | { |
---|
14 | namespace dom |
---|
15 | { |
---|
16 | namespace bits |
---|
17 | { |
---|
18 | template <typename C> |
---|
19 | bool error_handler_proxy<C>:: |
---|
20 | handleError (const xercesc::DOMError& e) |
---|
21 | { |
---|
22 | using xercesc::DOMError; |
---|
23 | |
---|
24 | if (e.getSeverity() != DOMError::DOM_SEVERITY_WARNING) |
---|
25 | failed_ = true; |
---|
26 | |
---|
27 | if (native_eh_) |
---|
28 | return native_eh_->handleError (e); |
---|
29 | else |
---|
30 | { |
---|
31 | typedef typename error_handler<C>::severity severity; |
---|
32 | |
---|
33 | severity s (severity::error); |
---|
34 | |
---|
35 | switch (e.getSeverity()) |
---|
36 | { |
---|
37 | case DOMError::DOM_SEVERITY_WARNING: |
---|
38 | { |
---|
39 | s = severity::warning; |
---|
40 | break; |
---|
41 | } |
---|
42 | case DOMError::DOM_SEVERITY_ERROR: |
---|
43 | { |
---|
44 | s = severity::error; |
---|
45 | break; |
---|
46 | } |
---|
47 | case DOMError::DOM_SEVERITY_FATAL_ERROR: |
---|
48 | { |
---|
49 | s = severity::fatal; |
---|
50 | break; |
---|
51 | } |
---|
52 | } |
---|
53 | |
---|
54 | XMLSSize_t l (e.getLocation ()->getLineNumber ()); |
---|
55 | XMLSSize_t c (e.getLocation ()->getColumnNumber ()); |
---|
56 | |
---|
57 | return eh_->handle ( |
---|
58 | transcode<C> (e.getLocation()->getURI ()), |
---|
59 | (l == -1 ? 0 : static_cast<unsigned long> (l)), |
---|
60 | (c == -1 ? 0 : static_cast<unsigned long> (c)), |
---|
61 | s, |
---|
62 | transcode<C> (e.getMessage ())); |
---|
63 | } |
---|
64 | } |
---|
65 | } |
---|
66 | } |
---|
67 | } |
---|
68 | } |
---|
69 | } |
---|