diff options
author | John Wiegley <johnw@newartisans.com> | 2007-04-27 10:08:42 +0000 |
---|---|---|
committer | John Wiegley <johnw@newartisans.com> | 2008-04-13 03:38:31 -0400 |
commit | 0eb597a681115d6d5dd2ea4511fa3b8c7b3d9c9f (patch) | |
tree | 750d64f6817282a6f4744058f73164a2996f6b03 /xml.h | |
parent | d01629148383261d7944e91fd2ac67b334a6834d (diff) | |
download | fork-ledger-0eb597a681115d6d5dd2ea4511fa3b8c7b3d9c9f.tar.gz fork-ledger-0eb597a681115d6d5dd2ea4511fa3b8c7b3d9c9f.tar.bz2 fork-ledger-0eb597a681115d6d5dd2ea4511fa3b8c7b3d9c9f.zip |
Restructured the code to use the new utility code in utils.h.
Diffstat (limited to 'xml.h')
-rw-r--r-- | xml.h | 19 |
1 files changed, 3 insertions, 16 deletions
@@ -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<string, string> attrs_map; typedef std::pair<string, string> 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 |