Update of /cvsroot/objecthandler/ObjectHandler/oh
In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv29592/oh
Modified Files:
exception.hpp
Log Message:
support for coercion
Index: exception.hpp
===================================================================
RCS file: /cvsroot/objecthandler/ObjectHandler/oh/exception.hpp,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** exception.hpp 19 May 2006 15:12:41 -0000 1.1
--- exception.hpp 19 Nov 2006 13:08:26 -0000 1.2
***************
*** 27,30 ****
--- 27,44 ----
#include <string>
+ #define OH_FAIL(message) \
+ do { \
+ std::ostringstream _oh_msg_stream; \
+ _oh_msg_stream << message; \
+ throw ObjHandler::Exception(_oh_msg_stream.str()); \
+ } while (false)
+
+ #define OH_REQUIRE(condition,message) \
+ if (!(condition)) { \
+ std::ostringstream _oh_msg_stream; \
+ _oh_msg_stream << message; \
+ throw ObjHandler::Exception(_oh_msg_stream.str()); \
+ } else
+
namespace ObjHandler {
|