aboutsummaryrefslogtreecommitdiff
path: root/libxsde/xsde/cxx/parser/exceptions.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'libxsde/xsde/cxx/parser/exceptions.cxx')
-rw-r--r--libxsde/xsde/cxx/parser/exceptions.cxx64
1 files changed, 64 insertions, 0 deletions
diff --git a/libxsde/xsde/cxx/parser/exceptions.cxx b/libxsde/xsde/cxx/parser/exceptions.cxx
new file mode 100644
index 0000000..0046266
--- /dev/null
+++ b/libxsde/xsde/cxx/parser/exceptions.cxx
@@ -0,0 +1,64 @@
+// file : xsde/cxx/parser/exceptions.cxx
+// author : Boris Kolpackov <boris@codesynthesis.com>
+// copyright : Copyright (c) 2005-2009 Code Synthesis Tools CC
+// license : GNU GPL v2 + exceptions; see accompanying LICENSE file
+
+#include <xsde/cxx/config.hxx>
+
+#ifdef XSDE_IOSTREAM
+# include <iostream>
+#endif
+
+#include <xsde/cxx/parser/exceptions.hxx>
+
+namespace xsde
+{
+ namespace cxx
+ {
+ namespace parser
+ {
+ // exception
+ //
+
+#ifdef XSDE_IOSTREAM
+ std::ostream&
+ operator<< (std::ostream& os, const exception& e)
+ {
+ return os << e.text ();
+ }
+#endif
+
+
+ // xml
+ //
+ const char* xml::
+ text () const
+ {
+ return expat::xml_error_text (code_);
+ }
+
+ const char* xml::
+ what () const throw ()
+ {
+ return "xml error";
+ }
+
+
+ // schema
+ //
+#ifdef XSDE_PARSER_VALIDATION
+ const char* schema::
+ text () const
+ {
+ return schema_error::text (code_);
+ }
+
+ const char* schema::
+ what () const throw ()
+ {
+ return "schema error";
+ }
+#endif
+ }
+ }
+}