From f0510d2f90467de8e8f260b47d79a9baaf9bef17 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Thu, 17 Sep 2009 07:15:29 +0200 Subject: Start tracking XSD with git --- libxsd/xsd/cxx/parser/validating/exceptions.hxx | 153 ++++++++++++++++++++++++ 1 file changed, 153 insertions(+) create mode 100644 libxsd/xsd/cxx/parser/validating/exceptions.hxx (limited to 'libxsd/xsd/cxx/parser/validating/exceptions.hxx') diff --git a/libxsd/xsd/cxx/parser/validating/exceptions.hxx b/libxsd/xsd/cxx/parser/validating/exceptions.hxx new file mode 100644 index 0000000..1112c60 --- /dev/null +++ b/libxsd/xsd/cxx/parser/validating/exceptions.hxx @@ -0,0 +1,153 @@ +// file : xsd/cxx/parser/validating/exceptions.hxx +// author : Boris Kolpackov +// copyright : Copyright (c) 2005-2009 Code Synthesis Tools CC +// license : GNU GPL v2 + exceptions; see accompanying LICENSE file + +#ifndef XSD_CXX_PARSER_VALIDATING_EXCEPTIONS_HXX +#define XSD_CXX_PARSER_VALIDATING_EXCEPTIONS_HXX + +#include + +#include +#include + +namespace xsd +{ + namespace cxx + { + namespace parser + { + namespace validating + { + // + // + template + struct expected_attribute: schema_exception + { + virtual + ~expected_attribute (); + + expected_attribute (const std::basic_string& expected_namespace, + const std::basic_string& expected_name); + + const std::basic_string& + expected_namespace () const + { + return expected_namespace_; + } + + const std::basic_string& + expected_name () const + { + return expected_name_; + } + + virtual std::basic_string + message () const; + + private: + std::basic_string expected_namespace_; + std::basic_string expected_name_; + }; + + // + // + template + struct unexpected_attribute: schema_exception + { + virtual + ~unexpected_attribute (); + + unexpected_attribute ( + const std::basic_string& encountered_namespace, + const std::basic_string& encountered_name); + + + const std::basic_string& + encountered_namespace () const + { + return encountered_namespace_; + } + + const std::basic_string& + encountered_name () const + { + return encountered_name_; + } + + virtual std::basic_string + message () const; + + private: + std::basic_string encountered_namespace_; + std::basic_string encountered_name_; + }; + + + // + // + template + struct unexpected_characters: schema_exception + { + virtual + ~unexpected_characters (); + + unexpected_characters (const std::basic_string& s); + + const std::basic_string& + characters () const + { + return characters_; + } + + virtual std::basic_string + message () const; + + private: + std::basic_string characters_; + }; + + // + // + template + struct invalid_value: schema_exception + { + virtual + ~invalid_value (); + + invalid_value (const C* type, const std::basic_string& value); + + invalid_value (const C* type, const ro_string& value); + + invalid_value (const std::basic_string& type, + const std::basic_string& value); + + const std::basic_string& + type () const + { + return type_; + } + + const std::basic_string& + value () const + { + return value_; + } + + virtual std::basic_string + message () const; + + private: + std::basic_string type_; + std::basic_string value_; + }; + } + } + } +} + +#include + +#endif // XSD_CXX_PARSER_VALIDATING_EXCEPTIONS_HXX + +#include -- cgit v1.1