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/sax/bits/error-handler-proxy.hxx |
---|
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 | #ifndef XSD_CXX_XML_SAX_ERROR_HANDLER_PROXY_HXX |
---|
7 | #define XSD_CXX_XML_SAX_ERROR_HANDLER_PROXY_HXX |
---|
8 | |
---|
9 | #include <xercesc/sax/ErrorHandler.hpp> |
---|
10 | #include <xercesc/sax/SAXParseException.hpp> |
---|
11 | |
---|
12 | #include <xsd/cxx/xml/error-handler.hxx> |
---|
13 | |
---|
14 | namespace xsd |
---|
15 | { |
---|
16 | namespace cxx |
---|
17 | { |
---|
18 | namespace xml |
---|
19 | { |
---|
20 | namespace sax |
---|
21 | { |
---|
22 | namespace bits |
---|
23 | { |
---|
24 | template <typename C> |
---|
25 | class error_handler_proxy: public xercesc::ErrorHandler |
---|
26 | { |
---|
27 | public: |
---|
28 | error_handler_proxy (error_handler<C>& eh) |
---|
29 | : failed_ (false), eh_ (&eh), native_eh_ (0) |
---|
30 | { |
---|
31 | } |
---|
32 | |
---|
33 | error_handler_proxy (xercesc::ErrorHandler& eh) |
---|
34 | : failed_ (false), eh_ (0), native_eh_ (&eh) |
---|
35 | { |
---|
36 | } |
---|
37 | |
---|
38 | public: |
---|
39 | virtual void |
---|
40 | warning (const xercesc::SAXParseException& e); |
---|
41 | |
---|
42 | virtual void |
---|
43 | error (const xercesc::SAXParseException& e); |
---|
44 | |
---|
45 | virtual void |
---|
46 | fatalError (const xercesc::SAXParseException& e); |
---|
47 | |
---|
48 | public: |
---|
49 | bool |
---|
50 | failed () const |
---|
51 | { |
---|
52 | return failed_; |
---|
53 | } |
---|
54 | |
---|
55 | virtual void |
---|
56 | resetErrors() |
---|
57 | { |
---|
58 | failed_ = false; |
---|
59 | } |
---|
60 | |
---|
61 | private: |
---|
62 | typedef typename error_handler<C>::severity severity; |
---|
63 | |
---|
64 | void |
---|
65 | handle (const xercesc::SAXParseException&, severity); |
---|
66 | |
---|
67 | private: |
---|
68 | bool failed_; |
---|
69 | error_handler<C>* eh_; |
---|
70 | xercesc::ErrorHandler* native_eh_; |
---|
71 | }; |
---|
72 | } |
---|
73 | } |
---|
74 | } |
---|
75 | } |
---|
76 | } |
---|
77 | |
---|
78 | #include <xsd/cxx/xml/sax/bits/error-handler-proxy.txx> |
---|
79 | |
---|
80 | #endif // XSD_CXX_XML_SAX_ERROR_HANDLER_PROXY_HXX |
---|