Exception.cpp

Go to the documentation of this file.
00001 #include <stdarg.h>
00002 #include <stdio.h>
00003 #include "Exception.h"
00004 
00005 //------------------------------------------------------------------------------------------------
00006 // Exception container
00007 //------------------------------------------------------------------------------------------------
00008 
00009 Exception::Exception(const char *format, ... )
00010 {
00011   va_list arglist;
00012   
00013   char mex[1000];
00014   va_start(arglist,format);
00015   vsprintf(mex,format,arglist);
00016   message = mex;
00017 }
00018 
00019 void Exception::Throw(const char *format,...)
00020 {
00021   va_list arglist;
00022   char mex[1000];
00023   va_start(arglist,format);
00024   vsprintf(mex,format,arglist);
00025   throw new Exception(mex);
00026 }
00027 
00028 
00029 void Exception::Assert(bool condition, const char *format,...)
00030 {
00031   va_list arglist;
00032   if( !condition ) {
00033     char mex[1000];
00034     va_start(arglist,format);
00035     vsprintf(mex,format,arglist);
00036     throw new Exception(mex);
00037   }
00038 }

Generated on Fri Sep 7 16:29:17 2007 for SVM-Dlight by  doxygen 1.5.1