Main Page | Modules | Class Hierarchy | Class List | Directories | File List | Class Members | Related Pages

xmog_exception.h

00001 /*
00002  * Copyright 1999-2006 by Codemesh, Inc.  ALL RIGHTS RESERVED.
00003  */
00004 
00005 #ifndef xmog_exception_inc
00006 #define xmog_exception_inc
00007 
00008 
00009 class xmog_localenv;
00010 
00011 
00012 #include "xmog_java_ref.h"
00013 
00014 
00045 class XMOG_DECLSPEC xmog_exception : public virtual xmog_java_ref
00046 {
00047 public:
00048 
00052     xmog_exception();
00053 
00060     xmog_exception( jobject inst, xmog_flags flags );
00061 
00071     void                get_message( xmog_base * msg, xmog_localenv * env = NULL );
00072 
00083     virtual char *      get_message_chars( xmog_localenv * env = NULL, xmog_base * enc = NULL );
00084 
00085 #   if (XMOG_SUPPORTS_WCHAR_T==1)
00095     virtual XMOG_WCHAR *    get_message_wchars( xmog_localenv * env = NULL );
00096 #   endif
00097 
00098 
00108     virtual unsigned short *    get_message_u16( xmog_localenv * env = NULL );
00109 
00121     static void                 throw_java_exception( xmog_exception * pe = NULL, const char * msg = NULL, xmog_localenv * env = NULL );
00122 };
00123 
00124 
00136 class XMOG_DECLSPEC xmog_exception_impl : public xmog_exception
00137 {
00138 private:
00139 
00140     int         error_code_;
00141 
00142     char *      msg_;
00143 
00144     XMOG_WCHAR *    wmsg_;
00145 
00146 public:
00147 
00158     xmog_exception_impl( int error_code, const char * msg = NULL );
00159 
00170     xmog_exception_impl( int error_code, const XMOG_WCHAR * msg );
00171 
00172 
00185     xmog_exception_impl( int error_code, jthrowable t, xmog_flags flags = xmog_base::GLOBAL );
00186 
00190     ~xmog_exception_impl();
00191 
00195     int                 get_error_code();
00196 
00207     virtual char *      get_message_chars( xmog_localenv * env = NULL, xmog_base * enc = NULL );
00208 
00209 #   if (XMOG_SUPPORTS_WCHAR_T==1)
00219     virtual XMOG_WCHAR *    get_message_wchars( xmog_localenv * env = NULL );
00220 #   endif
00221 
00222 
00232     virtual unsigned short *    get_message_u16( xmog_localenv * env = NULL );
00233 };
00234 
00235 
00236 #endif /* xmog_exception_inc */

Generated on Wed May 31 14:01:19 2006 for Shared Codemesh Runtime Library API Reference by  doxygen 1.4.1