From 0eb597a681115d6d5dd2ea4511fa3b8c7b3d9c9f Mon Sep 17 00:00:00 2001 From: John Wiegley Date: Fri, 27 Apr 2007 10:08:42 +0000 Subject: Restructured the code to use the new utility code in utils.h. --- xml.h | 19 +++---------------- 1 file changed, 3 insertions(+), 16 deletions(-) (limited to 'xml.h') diff --git a/xml.h b/xml.h index eeed15c3..023388d8 100644 --- a/xml.h +++ b/xml.h @@ -14,13 +14,7 @@ namespace xml { #define XML_NODE_IS_PARENT 0x1 -class conversion_error : public error { - public: - conversion_error(const string& _reason, - error_context * _ctxt = NULL) throw() - : error(_reason, _ctxt) {} - virtual ~conversion_error() throw() {} -}; +DECLARE_EXCEPTION(conversion_exception); class parent_node_t; class document_t; @@ -38,7 +32,6 @@ public: node_t * next; node_t * prev; unsigned int flags; - void * info; typedef std::map attrs_map; typedef std::pair attrs_pair; @@ -91,7 +84,7 @@ public: } virtual value_t to_value() const { - throw new conversion_error("Cannot convert node to a value"); + throw_(conversion_exception, "Cannot convert node to a value"); } virtual void write(std::ostream& out, int depth = 0) const = 0; @@ -248,13 +241,7 @@ class parser_t virtual document_t * parse(std::istream& in); }; -class parse_error : public error { - public: - parse_error(const string& _reason, - error_context * _ctxt = NULL) throw() - : error(_reason, _ctxt) {} - virtual ~parse_error() throw() {} -}; +DECLARE_EXCEPTION(parse_exception); #endif -- cgit v1.2.3