From a820665eea71a64b40e74ed24afeaf07a7a99db4 Mon Sep 17 00:00:00 2001 From: Mike Buland Date: Fri, 26 May 2006 14:36:57 +0000 Subject: Added the first of many unit tests. For now the unit tests are just built with everything else in the all target of the makefile, which is fine, but relies on CppTest, which can be found at http://cpptest.sf.net Also fixed some things I've been meaning to get to for a while in the xml system, including a few bugs that will make coping with malformed data not hang other programs, and do the error reporting in a nice way. --- src/xmlexception.h | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 src/xmlexception.h (limited to 'src/xmlexception.h') diff --git a/src/xmlexception.h b/src/xmlexception.h new file mode 100644 index 0000000..9437ba3 --- /dev/null +++ b/src/xmlexception.h @@ -0,0 +1,34 @@ +#ifndef XML_EXCEPTION_H +#define XML_EXCEPTION_H + +#include +#include "exception.h" +#include + +/** + * A generalized Exception base class. This is nice for making general and + * flexible child classes that can create new error code classes. + */ +class XmlException : public Exception +{ +public: + /** + * Construct an exception with an error code of zero, but with a + * description. The use of this is not reccomended most of the time, it's + * generally best to include an error code with the exception so your + * program can handle the exception in a better way. + * @param sFormat The format of the text. See printf for more info. + */ + XmlException( const char *sFormat, ... ) throw(); + + /** + * + * @param nCode + * @param sFormat + */ + XmlException( int nCode, const char *sFormat, ... ) throw(); + + XmlException( int nCode=0 ) throw(); +}; + +#endif -- cgit v1.2.3