aboutsummaryrefslogtreecommitdiff
path: root/libxsde/xsde/cxx/parser/exceptions.cxx
blob: f4c8edab4551474e3ebe3f0a650f84f1587c5cea (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
// file      : xsde/cxx/parser/exceptions.cxx
// copyright : Copyright (c) 2005-2011 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
    }
  }
}