|
Revision 111, 1.2 kB
(checked in by mido, 17 years ago)
|
|
pridana knihovna XSD (a jeji chlebodarkyne XERCES), v ramci Win32 zprovoznen priklad tests/test_xsd_hello.cxx
|
| Line | |
|---|
| 1 | // file : xsd/cxx/parser/error-handler.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_PARSER_ERROR_HANDLER_HXX |
|---|
| 7 | #define XSD_CXX_PARSER_ERROR_HANDLER_HXX |
|---|
| 8 | |
|---|
| 9 | #include <xsd/cxx/xml/error-handler.hxx> |
|---|
| 10 | |
|---|
| 11 | #include <xsd/cxx/parser/exceptions.hxx> |
|---|
| 12 | |
|---|
| 13 | namespace xsd |
|---|
| 14 | { |
|---|
| 15 | namespace cxx |
|---|
| 16 | { |
|---|
| 17 | namespace parser |
|---|
| 18 | { |
|---|
| 19 | template <typename C> |
|---|
| 20 | class error_handler: public xml::error_handler<C> |
|---|
| 21 | { |
|---|
| 22 | typedef typename xml::error_handler<C>::severity severity; |
|---|
| 23 | |
|---|
| 24 | public: |
|---|
| 25 | error_handler () |
|---|
| 26 | : failed_ (false) |
|---|
| 27 | { |
|---|
| 28 | } |
|---|
| 29 | |
|---|
| 30 | virtual bool |
|---|
| 31 | handle (const std::basic_string<C>& id, |
|---|
| 32 | unsigned long line, |
|---|
| 33 | unsigned long column, |
|---|
| 34 | severity s, |
|---|
| 35 | const std::basic_string<C>& message); |
|---|
| 36 | |
|---|
| 37 | void |
|---|
| 38 | throw_if_failed () const; |
|---|
| 39 | |
|---|
| 40 | private: |
|---|
| 41 | bool failed_; |
|---|
| 42 | diagnostics<C> diagnostics_; |
|---|
| 43 | }; |
|---|
| 44 | } |
|---|
| 45 | } |
|---|
| 46 | } |
|---|
| 47 | |
|---|
| 48 | #include <xsd/cxx/parser/error-handler.txx> |
|---|
| 49 | |
|---|
| 50 | #endif // XSD_CXX_PARSER_ERROR_HANDLER_HXX |
|---|