Codemesh Runtime v3 C++ API Reference  3.9.205
xmog_exception.h
1 //
2 // Copyright (c) 1999-2020 by Codemesh, Inc.. ALL RIGHTS RESERVED.
3 //
4 
5 
6 #ifndef xmog_exception_inc
7 #define xmog_exception_inc
8 
9 
10 class xmog_localenv;
11 
12 
13 #include "xmog_java_ref.h"
14 
15 
46 class XMOG_DECLSPEC xmog_exception : public virtual xmog_java_ref
47 {
48 public:
49 
54 
61  xmog_exception( const xmog_exception & rhs, xmog_localenv * pEnv = NULL );
62 
69  xmog_exception( jobject inst, xmog_flags flags );
70 
80  void get_message( xmog_base * msg, xmog_localenv * env = NULL );
81 
92  virtual char * get_message_chars( xmog_localenv * env = NULL, xmog_base * enc = NULL );
93 
94 # if (XMOG_SUPPORTS_WCHAR_T==1)
95  virtual XMOG_WCHAR * get_message_wchars( xmog_localenv * env = NULL );
105 # endif
106 
107 
117  virtual unsigned short * get_message_u16( xmog_localenv * env = NULL );
118 
130  static void throw_java_exception( xmog_exception * pe = NULL, const char * msg = NULL, xmog_localenv * env = NULL );
131 };
132 
144 class XMOG_DECLSPEC xmog_exception_impl : public xmog_exception
145 {
146 private:
147 
148  int error_code_;
149 
150  char * msg_;
151 
152  XMOG_WCHAR * wmsg_;
153 
154 public:
155 
166  xmog_exception_impl( int error_code, const char * msg = NULL );
167 
178  xmog_exception_impl( int error_code, const XMOG_WCHAR * msg );
179 
180 
193  xmog_exception_impl( int error_code, jthrowable t, xmog_flags flags = xmog_base::GLOBAL );
194 
199 
203  int get_error_code();
204 
215  virtual char * get_message_chars( xmog_localenv * env = NULL, xmog_base * enc = NULL );
216 
217 # if (XMOG_SUPPORTS_WCHAR_T==1)
218  virtual XMOG_WCHAR * get_message_wchars( xmog_localenv * env = NULL );
228 # endif
229 
230 
240  virtual unsigned short * get_message_u16( xmog_localenv * env = NULL );
241 };
242 
243 
244 #endif /* xmog_exception_inc */
xmog_base::flags
flags
The possible flag values.
Definition: xmog_base.h:383
xmog_exception::get_message_chars
virtual char * get_message_chars(xmog_localenv *env=NULL, xmog_base *enc=NULL)
Returns the error message for this instance.
xmog_exception::get_message_u16
virtual unsigned short * get_message_u16(xmog_localenv *env=NULL)
Returns the error message for this instance.
xmog_exception_impl
The type that is used when the GenericException policy is in effect or for exceptions epresenting fra...
Definition: xmog_exception.h:144
xmog_base
The baseclass for all proxy types in the framework.
Definition: xmog_base.h:29
xmog_localenv
A class representing per-thread information for the integration runtime.
Definition: xmog_localenv.h:32
xmog_java_ref
The wrapper base type representing C++ proxy instances for Java objects.
Definition: xmog_java_ref.h:19
xmog_exception
The wrapper for exceptions that occur on the Java side.
Definition: xmog_exception.h:46

Copyright (c) 1999-2020 by Codemesh, Inc., ALL RIGHTS RESERVED.