aboutsummaryrefslogtreecommitdiff
path: root/libxsde/xsde/cxx/parser/context.ixx
diff options
context:
space:
mode:
Diffstat (limited to 'libxsde/xsde/cxx/parser/context.ixx')
-rw-r--r--libxsde/xsde/cxx/parser/context.ixx91
1 files changed, 91 insertions, 0 deletions
diff --git a/libxsde/xsde/cxx/parser/context.ixx b/libxsde/xsde/cxx/parser/context.ixx
new file mode 100644
index 0000000..00093d6
--- /dev/null
+++ b/libxsde/xsde/cxx/parser/context.ixx
@@ -0,0 +1,91 @@
+// file : xsde/cxx/parser/context.ixx
+// author : Boris Kolpackov <boris@codesynthesis.com>
+// copyright : Copyright (c) 2005-2009 Code Synthesis Tools CC
+// license : GNU GPL v2 + exceptions; see accompanying LICENSE file
+
+namespace xsde
+{
+ namespace cxx
+ {
+ namespace parser
+ {
+ // parser_state
+ //
+ inline parser_state::
+ parser_state ()
+ : parser_ (0), depth_ (0), any_ (false)
+ {
+ }
+
+ // context
+ //
+ inline context::
+ context (XML_Parser xml_parser)
+ : xml_parser_ (xml_parser)
+ {
+#if defined(XSDE_PARSER_VALIDATION) || !defined(XSDE_EXCEPTIONS)
+ error_type_ = error_none;
+#endif
+ }
+
+ inline XML_Parser context::
+ xml_parser ()
+ {
+ return xml_parser_;
+ }
+
+ //
+ //
+#ifndef XSDE_EXCEPTIONS
+ inline int context::
+ app_error () const
+ {
+ return error_code_.app;
+ }
+
+ inline void context::
+ app_error (int e)
+ {
+ error_type_ = error_app;
+ error_code_.app = e;
+ }
+
+ inline void context::
+ sys_error (sys_error_t e)
+ {
+ error_type_ = error_sys;
+ error_code_.sys = e;
+ }
+
+ inline context::sys_error_t context::
+ sys_error () const
+ {
+ return error_code_.sys;
+ }
+#endif
+
+#ifdef XSDE_PARSER_VALIDATION
+ inline context::schema_error_t context::
+ schema_error () const
+ {
+ return error_code_.schema;
+ }
+
+ inline void context::
+ schema_error (schema_error_t e)
+ {
+ error_type_ = error_schema;
+ error_code_.schema = e;
+ }
+#endif
+
+#if defined(XSDE_PARSER_VALIDATION) || !defined(XSDE_EXCEPTIONS)
+ inline context::error_type_t context::
+ error_type () const
+ {
+ return error_type_;
+ }
+#endif
+ }
+ }
+}