summaryrefslogtreecommitdiff
path: root/libxsd/libxsd/cxx/tree/error-handler.txx
diff options
context:
space:
mode:
Diffstat (limited to 'libxsd/libxsd/cxx/tree/error-handler.txx')
-rw-r--r--libxsd/libxsd/cxx/tree/error-handler.txx30
1 files changed, 30 insertions, 0 deletions
diff --git a/libxsd/libxsd/cxx/tree/error-handler.txx b/libxsd/libxsd/cxx/tree/error-handler.txx
new file mode 100644
index 0000000..8f712b6
--- /dev/null
+++ b/libxsd/libxsd/cxx/tree/error-handler.txx
@@ -0,0 +1,30 @@
+// file : libxsd/cxx/tree/error-handler.txx
+// license : GNU GPL v2 + exceptions; see accompanying LICENSE file
+
+namespace xsd
+{
+ namespace cxx
+ {
+ namespace tree
+ {
+ template <typename C>
+ bool error_handler<C>::
+ handle (const std::basic_string<C>& id,
+ unsigned long line,
+ unsigned long column,
+ severity s,
+ const std::basic_string<C>& message)
+ {
+ diagnostics_.push_back (
+ error<C> (s == severity::warning
+ ? tree::severity::warning
+ : tree::severity::error, id, line, column, message));
+
+ if (!failed_ && s != severity::warning)
+ failed_ = true;
+
+ return true;
+ }
+ }
+ }
+}