// file : xsd/cxx/parser/error-handler.txx // author : Boris Kolpackov // copyright : Copyright (c) 2005-2011 Code Synthesis Tools CC // license : GNU GPL v2 + exceptions; see accompanying LICENSE file namespace xsd { namespace cxx { namespace parser { template bool error_handler:: handle (const std::basic_string& id, unsigned long line, unsigned long column, severity s, const std::basic_string& message) { diagnostics_.push_back ( error (s == severity::warning ? cxx::parser::severity::warning : cxx::parser::severity::error, id, line, column, message)); if (!failed_ && s != severity::warning) failed_ = true; return true; } template void error_handler:: throw_if_failed () const { if (failed_) throw parsing (diagnostics_); } } } }