root/win32/xsd-3.1.0-i686/libxsd/xsd/cxx/parser/error-handler.txx @ 111

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

Line 
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
6namespace 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}
Note: See TracBrowser for help on using the browser.