|
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/xml/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_XML_ERROR_HANDLER_HXX |
|---|
| 7 | #define XSD_CXX_XML_ERROR_HANDLER_HXX |
|---|
| 8 | |
|---|
| 9 | #include <string> |
|---|
| 10 | |
|---|
| 11 | namespace xsd |
|---|
| 12 | { |
|---|
| 13 | namespace cxx |
|---|
| 14 | { |
|---|
| 15 | namespace xml |
|---|
| 16 | { |
|---|
| 17 | template <typename C> |
|---|
| 18 | class error_handler |
|---|
| 19 | { |
|---|
| 20 | public: |
|---|
| 21 | virtual |
|---|
| 22 | ~error_handler () |
|---|
| 23 | { |
|---|
| 24 | } |
|---|
| 25 | |
|---|
| 26 | public: |
|---|
| 27 | |
|---|
| 28 | // The fatal severity level results in termination |
|---|
| 29 | // of the parsing process no matter what is returned |
|---|
| 30 | // from handle. |
|---|
| 31 | // |
|---|
| 32 | struct severity |
|---|
| 33 | { |
|---|
| 34 | enum value |
|---|
| 35 | { |
|---|
| 36 | warning, |
|---|
| 37 | error, |
|---|
| 38 | fatal |
|---|
| 39 | }; |
|---|
| 40 | |
|---|
| 41 | severity (value v) : v_ (v) {} |
|---|
| 42 | operator value () const { return v_; } |
|---|
| 43 | |
|---|
| 44 | private: |
|---|
| 45 | value v_; |
|---|
| 46 | }; |
|---|
| 47 | |
|---|
| 48 | virtual bool |
|---|
| 49 | handle (const std::basic_string<C>& id, |
|---|
| 50 | unsigned long line, |
|---|
| 51 | unsigned long column, |
|---|
| 52 | severity, |
|---|
| 53 | const std::basic_string<C>& message) = 0; |
|---|
| 54 | }; |
|---|
| 55 | } |
|---|
| 56 | } |
|---|
| 57 | } |
|---|
| 58 | |
|---|
| 59 | #endif // XSD_CXX_XML_ERROR_HANDLER_HXX |
|---|