 |
Changeset 3368
- Timestamp:
- 03/16/08 08:18:53
(9 months ago)
- Author:
- larsivi
- Message:
Merged in latest trunk.
-
Files:
-
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
| r3019 |
r3368 |
|
| 33 | 33 | |
|---|
| 34 | 34 | [tango/sys] |
|---|
| 35 | | exclude = tango/sys/linux/* tango/sys/darwin/* tango/sys/win32/* |
|---|
| | 35 | exclude = tango/sys/linux/* tango/sys/darwin/* tango/sys/win32/* tango/sys/freebsd/* |
|---|
| 36 | 36 | exclude += tango/sys/TimeConverter.d |
|---|
| 37 | 37 | |
|---|
| … | … | |
| 42 | 42 | version (darwin) { |
|---|
| 43 | 43 | [tango/sys/darwin] |
|---|
| | 44 | } |
|---|
| | 45 | |
|---|
| | 46 | version (freebsd) { |
|---|
| | 47 | [tango/sys/freebsd] |
|---|
| 44 | 48 | } |
|---|
| 45 | 49 | |
|---|
| … | … | |
| 55 | 59 | |
|---|
| 56 | 60 | [tango/text/locale] |
|---|
| 57 | | version (!linux) { |
|---|
| 58 | | exclude += tango/text/locale/Linux.d |
|---|
| | 61 | version (!Posix) { |
|---|
| | 62 | exclude += tango/text/locale/Posix.d |
|---|
| 59 | 63 | } |
|---|
| 60 | 64 | version (!Windows) { |
|---|
| r3128 |
r3368 |
|
| 1 | 1 | [concurrency/fiber_test.d] |
|---|
| | 2 | buildflags += -unittest |
|---|
| 2 | 3 | [conduits/composite.d] |
|---|
| 3 | 4 | [conduits/createzip.d] |
|---|
| 4 | | buildflags += -L-lz |
|---|
| | 5 | version (Windows) { |
|---|
| | 6 | buildflags += -L"zlib;libbz2" |
|---|
| | 7 | } |
|---|
| | 8 | version (Posix) { |
|---|
| | 9 | buildflags += -L-lz |
|---|
| | 10 | } |
|---|
| 5 | 11 | [conduits/filebubbler.d] |
|---|
| 6 | 12 | [conduits/filecat.d] |
|---|
| … | … | |
| 14 | 20 | [conduits/paths.d] |
|---|
| 15 | 21 | [conduits/randomio.d] |
|---|
| | 22 | [conduits/shuffle.d] |
|---|
| 16 | 23 | [conduits/unifile.d] |
|---|
| 17 | 24 | [console/hello.d] |
|---|
| … | … | |
| 36 | 43 | [text/properties.d] |
|---|
| 37 | 44 | [text/token.d] |
|---|
| | 45 | [text/xmldom.d] |
|---|
| | 46 | buildflags += -Jtext |
|---|
| | 47 | [text/xmlpull.d] |
|---|
| | 48 | buildflags += -Jtext |
|---|
| | 49 | [text/xmlsax.d] |
|---|
| | 50 | buildflags += -Jtext |
|---|
| | 51 | [text/xmlpath.d] |
|---|
| 38 | 52 | [vfs/vfszip.d] |
|---|
| 39 | | buildflags += -L-lz |
|---|
| | 53 | version (Windows) { |
|---|
| | 54 | buildflags += -L"zlib;libbz2" |
|---|
| | 55 | } |
|---|
| | 56 | version (Posix) { |
|---|
| | 57 | buildflags += -L-lz |
|---|
| | 58 | } |
|---|
| r2465 |
r3368 |
|
| 70 | 70 | @jake text\localetime.d -I.. -op |
|---|
| 71 | 71 | @jake text\token.d -I.. -op |
|---|
| | 72 | @jake text\xmlpull.d -I.. -op |
|---|
| | 73 | @jake text\xmldom.d -I.. -op |
|---|
| | 74 | @jake text\xmlsax.d -I.. -op |
|---|
| 72 | 75 | |
|---|
| 73 | 76 | @rem FINI |
|---|
| r3127 |
r3368 |
|
| 1 | 1 | module vfszip; |
|---|
| 2 | 2 | |
|---|
| 3 | | import tango.io.vfs.ZipArchive; |
|---|
| | 3 | import tango.io.vfs.ZipFolder; |
|---|
| 4 | 4 | import tango.io.Stdout; |
|---|
| 5 | 5 | |
|---|
| … | … | |
| 23 | 23 | zipname = "tmp.zip"; |
|---|
| 24 | 24 | |
|---|
| 25 | | auto archive = new ZipArchive(zipname); |
|---|
| | 25 | auto archive = new ZipFolder(zipname); |
|---|
| 26 | 26 | auto info = archive.self; |
|---|
| 27 | 27 | |
|---|
| r2866 |
r3368 |
|
| 72 | 72 | export PATH="$DMDDIR/bin:$PATH" |
|---|
| 73 | 73 | mkdir -p $DMDDIR/bin || die 1 "Failed to create the DMD install directory" |
|---|
| 74 | | cd $DMDDIR || die 1 "Failed to cd to the DMD install directory" |
|---|
| | 74 | cd $DMDDIR/bin || die 1 "Failed to cd to the DMD install directory" |
|---|
| 75 | 75 | tail -n+$LINES $FULLNAME | tar Oxf - dmd.tar.gz | gunzip -c | tar xf - || die 1 "Failed to extract DMD" |
|---|
| 76 | 76 | else |
|---|
| r3056 |
r3368 |
|
| 68 | 68 | mkdir -p lib |
|---|
| 69 | 69 | cp ../lib/libtango-user-dmd.a lib || die 1 "Failed to copy in the tango .a file" |
|---|
| | 70 | cp ../lib/dmdinclude lib || die 1 "Failed to copy in the dmdinclude file" |
|---|
| 70 | 71 | |
|---|
| 71 | 72 | find include/d -name .svn | xargs rm -rf |
|---|
| r3032 |
r3368 |
|
| | 1 | module build_tango; |
|---|
| | 2 | |
|---|
| 1 | 3 | import tango.io.FileConduit; |
|---|
| 2 | 4 | import tango.io.FileScan; |
|---|
| … | … | |
| 41 | 43 | bool filter( FilePath file ) |
|---|
| 42 | 44 | { |
|---|
| 43 | | return containsPattern( file.folder, "posix" ) || |
|---|
| 44 | | containsPattern( file.folder, "linux" ) || |
|---|
| 45 | | containsPattern( file.folder, "darwin" ) || |
|---|
| 46 | | containsPattern( file.name, "Posix" ); |
|---|
| | 45 | return containsPattern( file.folder, "posix" ) || |
|---|
| | 46 | containsPattern( file.folder, "linux" ) || |
|---|
| | 47 | containsPattern( file.folder, "darwin" ) || |
|---|
| | 48 | containsPattern( file.name, "Posix" ) || |
|---|
| | 49 | containsPattern( file.folder, "freebsd" ); |
|---|
| 47 | 50 | } |
|---|
| 48 | 51 | |
|---|
| … | … | |
| 51 | 54 | { |
|---|
| 52 | 55 | size_t pos = 0; |
|---|
| 53 | | char[] name = file.folder; |
|---|
| | 56 | char[] folder = file.dup.native.folder; |
|---|
| | 57 | char[] name = folder; |
|---|
| 54 | 58 | foreach( elem; name ) |
|---|
| 55 | 59 | { |
|---|
| … | … | |
| 60 | 64 | break; |
|---|
| 61 | 65 | } |
|---|
| 62 | | return file.folder[pos .. $].dup.replace( '\\', '-' ) ~ file.name ~ ".obj"; |
|---|
| | 66 | return folder[pos .. $].dup.replace( '\\', '-' ) ~ file.name ~ ".obj"; |
|---|
| 63 | 67 | } |
|---|
| 64 | 68 | |
|---|
| r3082 |
r3368 |
|
| 33 | 33 | # build Universal Binary versions of the Tango libraries |
|---|
| 34 | 34 | |
|---|
| | 35 | export MAKETOOL=make |
|---|
| | 36 | |
|---|
| 35 | 37 | HOME=`pwd` make -s clean -fgdc-posix.mak |
|---|
| 36 | 38 | |
|---|
| r2827 |
r3368 |
|
| 1 | | #!/bin/bash |
|---|
| | 1 | #!/usr/bin/env bash |
|---|
| 2 | 2 | |
|---|
| 3 | 3 | die() { |
|---|
| r3129 |
r3368 |
|
| 1 | | #!/bin/bash |
|---|
| | 1 | #!/usr/bin/env bash |
|---|
| 2 | 2 | cd "`dirname $0`" |
|---|
| 3 | 3 | |
|---|
| 4 | | GDC_VER="`gdc --version | grep 'gdc' | sed 's/^.*gdc \([0-9]*\.[0-9]*\).*$/\1/'`" |
|---|
| | 4 | # Allow gdc and gdmd to be overriden |
|---|
| | 5 | if [ "$GDC" = "" ] |
|---|
| | 6 | then |
|---|
| | 7 | export GDC=${GDC_PREFIX}gdc${GDC_POSTFIX} |
|---|
| | 8 | fi |
|---|
| | 9 | if [ "$GDMD" = "" ] |
|---|
| | 10 | then |
|---|
| | 11 | export GDMD=${GDC_PREFIX}gdmd${GDC_POSTFIX} |
|---|
| | 12 | fi |
|---|
| | 13 | |
|---|
| | 14 | GDC_VER="`$GDC --version | grep 'gdc' | sed 's/^.*gdc \([0-9]*\.[0-9]*\).*$/\1/'`" |
|---|
| 5 | 15 | GDC_MAJOR="`echo $GDC_VER | sed 's/\..*//'`" |
|---|
| 6 | 16 | GDC_MINOR="`echo $GDC_VER | sed 's/.*\.//'`" |
|---|
| … | … | |
| 29 | 39 | rm compiler/gdc/object.di |
|---|
| 30 | 40 | |
|---|
| | 41 | # Check make we have |
|---|
| | 42 | MAKE=`which gmake` |
|---|
| | 43 | if [ ! -e "$MAKE" ] |
|---|
| | 44 | then |
|---|
| | 45 | MAKE=`which make` |
|---|
| | 46 | if [ ! `$MAKE --version | grep 'GNU Make'` ] |
|---|
| | 47 | then |
|---|
| | 48 | echo 'No supported build tool found.' |
|---|
| | 49 | exit 1 |
|---|
| | 50 | fi |
|---|
| | 51 | fi |
|---|
| | 52 | |
|---|
| | 53 | export MAKETOOL=$MAKE |
|---|
| | 54 | |
|---|
| 31 | 55 | OLDHOME=$HOME |
|---|
| 32 | 56 | export HOME=`pwd` |
|---|
| 33 | | make clean -fgdc-posix.mak || exit 1 |
|---|
| 34 | | make lib doc install -fgdc-posix.mak ADD_CFLAGS="$ADD_CFLAGS" || exit 1 |
|---|
| 35 | | make clean -fgdc-posix.mak || exit 1 |
|---|
| | 57 | $MAKE clean -fgdc-posix.mak DC="$GDMD" || exit 1 |
|---|
| | 58 | $MAKE lib doc install -fgdc-posix.mak DC="$GDMD" ADD_CFLAGS="$ADD_CFLAGS" || exit 1 |
|---|
| | 59 | $MAKE clean -fgdc-posix.mak DC="$GDMD" || exit 1 |
|---|
| 36 | 60 | chmod 644 ../tango/core/*.di || exit 1 |
|---|
| 37 | 61 | |
|---|
| r3126 |
r3368 |
|
| 1 | | #!/bin/bash +x |
|---|
| | 1 | #!/usr/bin/env bash |
|---|
| 2 | 2 | |
|---|
| 3 | 3 | # A simple script to build libtango.a/libgtango |
|---|
| … | … | |
| 19 | 19 | Options: |
|---|
| 20 | 20 | --help: Will print this help text |
|---|
| | 21 | --warn: Will enable warnings |
|---|
| 21 | 22 | <identifier> is one of {dmd, gdc, mac} and will build libtango.a, |
|---|
| 22 | 23 | libgtango.a or universal Mac binaries respectively |
|---|
| … | … | |
| 30 | 31 | UNAME=`uname` |
|---|
| 31 | 32 | INLINE="-inline" |
|---|
| | 33 | WARN="" |
|---|
| 32 | 34 | |
|---|
| 33 | 35 | # Compiler specific includes |
|---|
| … | … | |
| 62 | 64 | fi |
|---|
| 63 | 65 | |
|---|
| | 66 | if [ "`echo $FILE | grep freebsd`" ] |
|---|
| | 67 | then |
|---|
| | 68 | if [ ! "$UNAME" == "FreeBSD" ] |
|---|
| | 69 | then |
|---|
| | 70 | return 1 |
|---|
| | 71 | else |
|---|
| | 72 | return 0 |
|---|
| | 73 | fi |
|---|
| | 74 | fi |
|---|
| | 75 | |
|---|
| 64 | 76 | if [ "`echo $FILE | grep linux`" ] |
|---|
| 65 | 77 | then |
|---|
| … | … | |
| 81 | 93 | if filter $OBJNAME |
|---|
| 82 | 94 | then |
|---|
| 83 | | $DC -c $INLINE -release -O -version=Posix -version=Tango -of$OBJNAME $FILENAME |
|---|
| | 95 | $DC $WARN -c $INLINE -release -O -version=Posix -version=Tango -of$OBJNAME $FILENAME |
|---|
| 84 | 96 | ar -r lib/$LIB $OBJNAME 2>&1 | grep -v "ranlib: .* has no symbols" |
|---|
| 85 | 97 | rm $OBJNAME |
|---|
| … | … | |
| 125 | 137 | fi |
|---|
| 126 | 138 | |
|---|
| 127 | | if [ "$1" = "--help" ] |
|---|
| 128 | | then |
|---|
| 129 | | usage |
|---|
| 130 | | elif [ "$1" = "dmd" ] |
|---|
| 131 | | then |
|---|
| 132 | | build dmd libtango-user-dmd.a libtango-base-dmd.a |
|---|
| 133 | | elif [ "$1" = "gdc" ] |
|---|
| 134 | | then |
|---|
| 135 | | build gdmd libgtango.a libgphobos.a |
|---|
| 136 | | elif [ "$1" = "mac" ] |
|---|
| 137 | | then |
|---|
| 138 | | # build Universal Binary version of the Tango library |
|---|
| 139 | | build powerpc-apple-darwin8-gdmd libgtango.a.ppc libgphobos.a.ppc |
|---|
| 140 | | build i686-apple-darwin8-gdmd libgtango.a.i386 libgphobos.a.i386 |
|---|
| 141 | | lipo -create -output libgtango.a libgtango.a.ppc libgtango.a.i386 |
|---|
| 142 | | else |
|---|
| 143 | | usage |
|---|
| 144 | | fi |
|---|
| | 139 | while [ "$#" != "0" ] |
|---|
| | 140 | do |
|---|
| | 141 | case "$1" in |
|---|
| | 142 | --help) |
|---|
| | 143 | usage |
|---|
| | 144 | ;; |
|---|
| | 145 | --warn) |
|---|
| | 146 | WARN="-w" |
|---|
| | 147 | ;; |
|---|
| | 148 | dmd) |
|---|
| | 149 | build dmd libtango-user-dmd.a libtango-base-dmd.a |
|---|
| | 150 | ;; |
|---|
| | 151 | gdc) |
|---|
| | 152 | build gdmd libgtango.a libgphobos.a |
|---|
| | 153 | ;; |
|---|
| | 154 | mac) |
|---|
| | 155 | # build Universal Binary version of the Tango library |
|---|
| | 156 | build powerpc-apple-darwin8-gdmd libgtango.a.ppc libgphobos.a.ppc |
|---|
| | 157 | build i686-apple-darwin8-gdmd libgtango.a.i386 libgphobos.a.i386 |
|---|
| | 158 | lipo -create -output libgtango.a libgtango.a.ppc libgtango.a.i386 |
|---|
| | 159 | ;; |
|---|
| | 160 | *) |
|---|
| | 161 | usage |
|---|
| | 162 | ;; |
|---|
| | 163 | esac |
|---|
| | 164 | shift |
|---|
| | 165 | done |
|---|
| r2913 |
r3368 |
|
| 13 | 13 | { |
|---|
| 14 | 14 | alias void function( char[] file, size_t line, char[] msg = null ) assertHandlerType; |
|---|
| 15 | | alias TracedExceptionInfo function( void* ptr = null ) traceHandlerType; |
|---|
| 16 | 15 | |
|---|
| 17 | 16 | assertHandlerType assertHandler = null; |
|---|
| 18 | | traceHandlerType traceHandler = null; |
|---|
| 19 | | } |
|---|
| 20 | | |
|---|
| 21 | | |
|---|
| 22 | | interface TracedExceptionInfo |
|---|
| 23 | | { |
|---|
| 24 | | int opApply( int delegate( inout char[] ) ); |
|---|
| 25 | 17 | } |
|---|
| 26 | 18 | |
|---|
| … | … | |
| 30 | 22 | - Exception |
|---|
| 31 | 23 | - OutOfMemoryException |
|---|
| 32 | | |
|---|
| 33 | | - TracedException |
|---|
| 34 | | - SwitchException |
|---|
| 35 | | - AssertException |
|---|
| 36 | | - ArrayBoundsException |
|---|
| 37 | | - FinalizeException |
|---|
| 38 | | |
|---|
| 39 | | - PlatformException |
|---|
| 40 | | - ProcessException |
|---|
| 41 | | - ThreadException |
|---|
| 42 | | - FiberException |
|---|
| 43 | | - SyncException |
|---|
| 44 | | - IOException |
|---|
| 45 | | - SocketException |
|---|
| 46 | | - SocketAcceptException |
|---|
| 47 | | - AddressException |
|---|
| 48 | | - HostException |
|---|
| 49 | | - VfsException |
|---|
| 50 | | - ClusterException |
|---|
| 51 | | |
|---|
| 52 | | - NoSuchElementException |
|---|
| 53 | | - CorruptedIteratorException |
|---|
| 54 | | |
|---|
| 55 | | - IllegalArgumentException |
|---|
| 56 | | - IllegalElementException |
|---|
| 57 | | |
|---|
| 58 | | - TextException |
|---|
| 59 | | - RegexException |
|---|
| 60 | | - LocaleException |
|---|
| 61 | | - UnicodeException |
|---|
| 62 | | |
|---|
| 63 | | - PayloadException |
|---|
| | 24 | - SwitchException |
|---|
| | 25 | - AssertException |
|---|
| | 26 | - ArrayBoundsException |
|---|
| | 27 | - FinalizeException |
|---|
| | 28 | |
|---|
| | 29 | - PlatformException |
|---|
| | 30 | - ProcessException |
|---|
| | 31 | - ThreadException |
|---|
| | 32 | - FiberException |
|---|
| | 33 | - SyncException |
|---|
| | 34 | - IOException |
|---|
| | 35 | - SocketException |
|---|
| | 36 | - SocketAcceptException |
|---|
| | 37 | - AddressException |
|---|
| | 38 | - HostException |
|---|
| | 39 | - VfsException |
|---|
| | 40 | - ClusterException |
|---|
| | 41 | |
|---|
| | 42 | - NoSuchElementException |
|---|
| | 43 | - CorruptedIteratorException |
|---|
| | 44 | |
|---|
| | 45 | - IllegalArgumentException |
|---|
| | 46 | - IllegalElementException |
|---|
| | 47 | |
|---|
| | 48 | - TextException |
|---|
| | 49 | - RegexException |
|---|
| | 50 | - LocaleException |
|---|
| | 51 | - UnicodeException |
|---|
| | 52 | |
|---|
| | 53 | - PayloadException |
|---|
| 64 | 54 | */ |
|---|
| 65 | 55 | //////////////////////////////////////////////////////////////////////////////// |
|---|
| … | … | |
| 84 | 74 | |
|---|
| 85 | 75 | /** |
|---|
| 86 | | * Stores a stack trace when thrown. |
|---|
| 87 | | */ |
|---|
| 88 | | class TracedException : Exception |
|---|
| 89 | | { |
|---|
| 90 | | this( char[] msg ) |
|---|
| 91 | | { |
|---|
| 92 | | super( msg ); |
|---|
| 93 | | m_info = traceContext(); |
|---|
| 94 | | } |
|---|
| 95 | | |
|---|
| 96 | | this( char[] msg, Exception e ) |
|---|
| 97 | | { |
|---|
| 98 | | super( msg, e ); |
|---|
| 99 | | m_info = traceContext(); |
|---|
| | 76 | * Base class for operating system or library exceptions. |
|---|
| | 77 | */ |
|---|
| | 78 | class PlatformException : Exception |
|---|
| | 79 | { |
|---|
| | 80 | this( char[] msg ) |
|---|
| | 81 | { |
|---|
| | 82 | super( msg ); |
|---|
| | 83 | } |
|---|
| | 84 | } |
|---|
| | 85 | |
|---|
| | 86 | /** |
|---|
| | 87 | * Thrown on an assert error. |
|---|
| | 88 | */ |
|---|
| | 89 | class AssertException : Exception |
|---|
| | 90 | { |
|---|
| | 91 | this( char[] file, size_t line ) |
|---|
| | 92 | { |
|---|
| | 93 | super( "Assertion failure", file, line ); |
|---|
| 100 | 94 | } |
|---|
| 101 | 95 | |
|---|
| … | … | |
| 103 | 97 | { |
|---|
| 104 | 98 | super( msg, file, line ); |
|---|
| 105 | | m_info = traceContext(); |
|---|
| 106 | | } |
|---|
| 107 | | |
|---|
| 108 | | char[] toString() |
|---|
| 109 | | { |
|---|
| 110 | | if( m_info is null ) |
|---|
| 111 | | return super.toString(); |
|---|
| 112 | | char[] buf = super.toString(); |
|---|
| 113 | | buf ~= "\n----------------"; |
|---|
| 114 | | foreach( line; m_info ) |
|---|
| 115 | | buf ~= "\n" ~ line; |
|---|
| 116 | | return buf; |
|---|
| 117 | | } |
|---|
| 118 | | |
|---|
| 119 | | int opApply( int delegate( inout char[] buf ) dg ) |
|---|
| 120 | | { |
|---|
| 121 | | if( m_info is null ) |
|---|
| 122 | | return 0; |
|---|
| 123 | | return m_info.opApply( dg ); |
|---|
| 124 | | } |
|---|
| 125 | | |
|---|
| 126 | | private: |
|---|
| 127 | | TracedExceptionInfo m_info; |
|---|
| 128 | | } |
|---|
| 129 | | |
|---|
| 130 | | |
|---|
| 131 | | /** |
|---|
| 132 | | * Base class for operating system or library exceptions. |
|---|
| 133 | | */ |
|---|
| 134 | | class PlatformException : TracedException |
|---|
| 135 | | { |
|---|
| 136 | | this( char[] msg ) |
|---|
| 137 | | { |
|---|
| 138 | | super( msg ); |
|---|
| 139 | | } |
|---|
| 140 | | } |
|---|
| 141 | | |
|---|
| 142 | | /** |
|---|
| 143 | | * Thrown on an assert error. |
|---|
| 144 | | */ |
|---|
| 145 | | class AssertException : TracedException |
|---|
| | 99 | } |
|---|
| | 100 | } |
|---|
| | 101 | |
|---|
| | 102 | |
|---|
| | 103 | /** |
|---|
| | 104 | * Thrown on an array bounds error. |
|---|
| | 105 | */ |
|---|
| | 106 | class ArrayBoundsException : Exception |
|---|
| 146 | 107 | { |
|---|
| 147 | 108 | this( char[] file, size_t line ) |
|---|
| 148 | 109 | { |
|---|
| 149 | | super( "Assertion failure", file, line ); |
|---|
| 150 | | } |
|---|
| 151 | | |
|---|
| 152 | | this( char[] msg, char[] file, size_t line ) |
|---|
| 153 | | { |
|---|
| 154 | | super( msg, file, line ); |
|---|
| 155 | | } |
|---|
| 156 | | } |
|---|
| 157 | | |
|---|
| 158 | | |
|---|
| 159 | | /** |
|---|
| 160 | | * Thrown on an array bounds error. |
|---|
| 161 | | */ |
|---|
| 162 | | class ArrayBoundsException : TracedException |
|---|
| 163 | | { |
|---|
| 164 | | this( char[] file, size_t line ) |
|---|
| 165 | | { |
|---|
| 166 | 110 | super( "Array index out of bounds", file, line ); |
|---|
| 167 | 111 | } |
|---|
| … | … | |
| 172 | 116 | * Thrown on finalize error. |
|---|
| 173 | 117 | */ |
|---|
| 174 | | class FinalizeException : TracedException |
|---|
| | 118 | class FinalizeException : Exception |
|---|
| 175 | 119 | { |
|---|
| 176 | 120 | ClassInfo info; |
|---|
| … | … | |
| 192 | 136 | * Thrown on a switch error. |
|---|
| 193 | 137 | */ |
|---|
| 194 | | class SwitchException : TracedException |
|---|
| | 138 | class SwitchException : Exception |
|---|
| 195 | 139 | { |
|---|
| 196 | 140 | this( char[] file, size_t line ) |
|---|
| … | … | |
| 204 | 148 | * Represents a text processing error. |
|---|
| 205 | 149 | */ |
|---|
| 206 | | class TextException : TracedException |
|---|
| | 150 | class TextException : Exception |
|---|
| 207 | 151 | { |
|---|
| 208 | 152 | this( char[] msg ) |
|---|
| … | … | |
| 277 | 221 | |
|---|
| 278 | 222 | /** |
|---|
| 279 | | * The basic exception thrown by the tango.io.vfs package. |
|---|
| | 223 | * The basic exception thrown by the tango.io.vfs package. |
|---|
| 280 | 224 | */ |
|---|
| 281 | 225 | private class VfsException : IOException |
|---|
| … | … | |
| 288 | 232 | |
|---|
| 289 | 233 | /** |
|---|
| 290 | | * The basic exception thrown by the tango.io.cluster package. |
|---|
| | 234 | * The basic exception thrown by the tango.io.cluster package. |
|---|
| 291 | 235 | */ |
|---|
| 292 | 236 | private class ClusterException : IOException |
|---|
| … | … | |
| 387 | 331 | * guid. |
|---|
| 388 | 332 | */ |
|---|
| 389 | | class RegistryException : TracedException |
|---|
| | 333 | class RegistryException : Exception |
|---|
| 390 | 334 | { |
|---|
| 391 | 335 | this( char[] msg ) |
|---|
| … | … | |
| 399 | 343 | * Thrown when an illegal argument is encountered. |
|---|
| 400 | 344 | */ |
|---|
| 401 | | class IllegalArgumentException : TracedException |
|---|
| | 345 | class IllegalArgumentException : Exception |
|---|
| 402 | 346 | { |
|---|
| 403 | 347 | this( char[] msg ) |
|---|
| … | … | |
| 427 | 371 | * Thrown on past-the-end errors by iterators and containers. |
|---|
| 428 | 372 | */ |
|---|
| 429 | | class NoSuchElementException : TracedException |
|---|
| | 373 | class NoSuchElementException : Exception |
|---|
| 430 | 374 | { |
|---|
| 431 | 375 | this( char[] msg ) |
|---|
| … | … | |
| 462 | 406 | { |
|---|
| 463 | 407 | assertHandler = h; |
|---|
| 464 | | } |
|---|
| 465 | | |
|---|
| 466 | | |
|---|
| 467 | | /** |
|---|
| 468 | | * Overrides the default trace hander with a user-supplied version. |
|---|
| 469 | | * |
|---|
| 470 | | * Params: |
|---|
| 471 | | * h = The new trace handler. Set to null to use the default handler. |
|---|
| 472 | | */ |
|---|
| 473 | | void setTraceHandler( traceHandlerType h ) |
|---|
| 474 | | { |
|---|
| 475 | | traceHandler = h; |
|---|
| 476 | 408 | } |
|---|
| 477 | 409 | |
|---|
| … | … | |
| 517 | 449 | |
|---|
| 518 | 450 | |
|---|
| 519 | | /** |
|---|
| 520 | | * This function will be called when a TracedException is constructed. The |
|---|
| 521 | | * user-supplied trace handler will be called if one has been supplied, |
|---|
| 522 | | * otherwise no trace will be generated. |
|---|
| 523 | | * |
|---|
| 524 | | * Params: |
|---|
| 525 | | * ptr = A pointer to the location from which to generate the trace, or null |
|---|
| 526 | | * if the trace should be generated from within the trace handler |
|---|
| 527 | | * itself. |
|---|
| 528 | | * |
|---|
| 529 | | * Returns: |
|---|
| 530 | | * An object describing the current calling context or null if no handler is |
|---|
| 531 | | * supplied. |
|---|
| 532 | | */ |
|---|
| 533 | | TracedExceptionInfo traceContext( void* ptr = null ) |
|---|
| 534 | | { |
|---|
| 535 | | if( traceHandler is null ) |
|---|
| 536 | | return null; |
|---|
| 537 | | return traceHandler( ptr ); |
|---|
| 538 | | } |
|---|
| 539 | | |
|---|
| 540 | 451 | //////////////////////////////////////////////////////////////////////////////// |
|---|
| 541 | 452 | / |
|---|
|