Revision 111, 1.1 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
|
Rev | Line | |
---|
[111] | 1 | // file : xsd/cxx/parser/error-handler.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 | namespace xsd |
---|
| 7 | { |
---|
| 8 | namespace cxx |
---|
| 9 | { |
---|
| 10 | namespace parser |
---|
| 11 | { |
---|
| 12 | template <typename C> |
---|
| 13 | bool error_handler<C>:: |
---|
| 14 | handle (const std::basic_string<C>& id, |
---|
| 15 | unsigned long line, |
---|
| 16 | unsigned long column, |
---|
| 17 | severity s, |
---|
| 18 | const std::basic_string<C>& message) |
---|
| 19 | { |
---|
| 20 | diagnostics_.push_back ( |
---|
| 21 | error<C> (s == severity::warning |
---|
| 22 | ? cxx::parser::severity::warning |
---|
| 23 | : cxx::parser::severity::error, |
---|
| 24 | id, line, column, message)); |
---|
| 25 | |
---|
| 26 | if (!failed_ && s != severity::warning) |
---|
| 27 | failed_ = true; |
---|
| 28 | |
---|
| 29 | return true; |
---|
| 30 | } |
---|
| 31 | |
---|
| 32 | template <typename C> |
---|
| 33 | void error_handler<C>:: |
---|
| 34 | throw_if_failed () const |
---|
| 35 | { |
---|
| 36 | if (failed_) |
---|
| 37 | throw parsing<C> (diagnostics_); |
---|
| 38 | } |
---|
| 39 | } |
---|
| 40 | } |
---|
| 41 | } |
---|