Changeset 206:cca980503056
- Timestamp:
- 04/16/08 14:36:50
(6 months ago)
- Author:
- Frank Benoit <benoit@tionex.de>
- branch:
- default
- Message:
sync with dwt-linux, removed the simple.d
-
Files:
-
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
| r59 |
r206 |
|
| 45 | 45 | |
|---|
| 46 | 46 | public class DWTError : PlatformException { |
|---|
| 47 | | |
|---|
| 48 | 47 | /** |
|---|
| 49 | 48 | * The DWT error code, one of DWT.ERROR_*. |
|---|
| … | … | |
| 55 | 54 | * or null if this information is not available. |
|---|
| 56 | 55 | */ |
|---|
| 57 | | public Exception throwable; |
|---|
| | 56 | public Exception throwable( Exception e ){ |
|---|
| | 57 | this.next = e; |
|---|
| | 58 | return this.next; |
|---|
| | 59 | } |
|---|
| | 60 | public Exception throwable(){ |
|---|
| | 61 | return this.next; |
|---|
| | 62 | } |
|---|
| 58 | 63 | |
|---|
| 59 | 64 | //static final long serialVersionUID = 3833467327105808433L; |
|---|
| … | … | |
| 130 | 135 | public char[] getMessage () { |
|---|
| 131 | 136 | if (throwable is null) |
|---|
| 132 | | return super.toString (); |
|---|
| | 137 | return super.toString(); |
|---|
| 133 | 138 | return super.toString () ~ " (" ~ throwable.toString () ~ ")"; //$NON-NLS-1$ //$NON-NLS-2$ |
|---|
| 134 | 139 | } |
|---|
| … | … | |
| 153 | 158 | } |
|---|
| 154 | 159 | } |
|---|
| | 160 | } |
|---|
| 155 | 161 | |
|---|
| 156 | 162 | } |
|---|
| 157 | | } |
|---|
| 158 | | |
|---|
| 159 | | |
|---|
| 160 | | |
|---|
| r59 |
r206 |
|
| 36 | 36 | |
|---|
| 37 | 37 | public class DWTException : Exception { |
|---|
| 38 | | |
|---|
| 39 | 38 | /** |
|---|
| 40 | 39 | * The DWT error code, one of DWT.ERROR_*. |
|---|
| … | … | |
| 46 | 45 | * or null if this information is not available. |
|---|
| 47 | 46 | */ |
|---|
| 48 | | public Exception throwable; |
|---|
| | 47 | public Exception throwable( Exception e ){ |
|---|
| | 48 | this.next = e; |
|---|
| | 49 | return this.next; |
|---|
| | 50 | } |
|---|
| | 51 | public Exception throwable(){ |
|---|
| | 52 | return this.next; |
|---|
| | 53 | } |
|---|
| | 54 | |
|---|
| 49 | 55 | |
|---|
| 50 | 56 | //static final long serialVersionUID = 3257282552304842547L; |
|---|
| … | … | |
| 120 | 126 | */ |
|---|
| 121 | 127 | public char[] getMessage () { |
|---|
| 122 | | if (throwable is null) |
|---|
| 123 | | return super.toString (); |
|---|
| | 128 | if (throwable is null) return super.toString (); |
|---|
| 124 | 129 | return super.toString () ~ " (" ~ throwable.toString () ~ ")"; //$NON-NLS-1$ //$NON-NLS-2$ |
|---|
| 125 | 130 | } |
|---|
| … | … | |
| 148 | 153 | } |
|---|
| 149 | 154 | |
|---|
| | 155 | |
|---|
| r0 |
r206 |
|
| 3 | 3 | */ |
|---|
| 4 | 4 | module dwt.dwthelper.Runnable; |
|---|
| | 5 | |
|---|
| | 6 | |
|---|
| | 7 | import tango.core.Tuple; |
|---|
| | 8 | import tango.core.Traits; |
|---|
| 5 | 9 | |
|---|
| 6 | 10 | public interface Runnable { |
|---|
| … | … | |
| 10 | 14 | } |
|---|
| 11 | 15 | |
|---|
| | 16 | class _DgRunnableT(Dg,T...) : Runnable { |
|---|
| 12 | 17 | |
|---|
| | 18 | alias ParameterTupleOf!(Dg) DgArgs; |
|---|
| | 19 | static assert( is(DgArgs == Tuple!(T)), |
|---|
| | 20 | "Delegate args not correct" ); |
|---|
| | 21 | |
|---|
| | 22 | Dg dg; |
|---|
| | 23 | T t; |
|---|
| | 24 | |
|---|
| | 25 | private this( Dg dg, T t ){ |
|---|
| | 26 | this.dg = dg; |
|---|
| | 27 | static if( T.length > 0 ){ |
|---|
| | 28 | this.t = t; |
|---|
| | 29 | } |
|---|
| | 30 | } |
|---|
| | 31 | |
|---|
| | 32 | void run( ){ |
|---|
| | 33 | dg(t); |
|---|
| | 34 | } |
|---|
| | 35 | } |
|---|
| | 36 | |
|---|
| | 37 | _DgRunnableT!(Dg,T) dgRunnable(Dg,T...)( Dg dg, T args ){ |
|---|
| | 38 | return new _DgRunnableT!(Dg,T)(dg,args); |
|---|
| | 39 | } |
|---|
| r202 |
r206 |
|
| 778 | 778 | } |
|---|
| 779 | 779 | void ExceptionPrintStackTrace( Exception e, Print!(char) print ){ |
|---|
| 780 | | print.formatln( "Exception in {}({}): {}", e.file, e.line, e.msg ); |
|---|
| | 780 | Exception exception = e; |
|---|
| | 781 | while( exception !is null ){ |
|---|
| | 782 | print.formatln( "Exception in {}({}): {}", exception.file, exception.line, exception.msg ); |
|---|
| | 783 | foreach( msg; exception.info ){ |
|---|
| | 784 | print.formatln( "trc {}", msg ); |
|---|
| | 785 | } |
|---|
| | 786 | exception = exception.next; |
|---|
| | 787 | } |
|---|
| 781 | 788 | } |
|---|
| 782 | 789 | |
|---|