From 707cc94fe52463870a9c6c8e2e66eaaa389e601d Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Tue, 24 Feb 2009 15:16:26 +0200 Subject: Start tracking XSD/e with git after version 3.0.0 --- libxsde/xsde/cxx/parser/context.ixx | 91 +++++++++++++++++++++++++++++++++++++ 1 file changed, 91 insertions(+) create mode 100644 libxsde/xsde/cxx/parser/context.ixx (limited to 'libxsde/xsde/cxx/parser/context.ixx') 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 +// 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 + } + } +} -- cgit v1.1