view tango/tango/core/Exception.di @ 270:d9d5d59873d8 trunk

[svn r291] Fixed a bunch of the old Phobos tests to work with Tango. Branch statements now emit a new block after it. Fixed the _adSort runtime function had a bad signature. Added a missing dot prefix on compiler generated string tables for string switch. Fixed, PTRSIZE seems like it was wrong on 64bit, now it definitely gets set properly.
author lindquist
date Mon, 16 Jun 2008 16:01:19 +0200
parents f5ca6bbbf1d7
children
line wrap: on
line source

// D import file generated from 'core/Exception.d'
module tango.core.Exception;
private
{
    alias void function(char[] file, size_t line, char[] msg = null) assertHandlerType;
    alias TracedExceptionInfo function(void* ptr = null) traceHandlerType;
    assertHandlerType assertHandler = null;
    traceHandlerType traceHandler = null;
}
interface TracedExceptionInfo
{
    int opApply(int delegate(ref char[]));
}
class OutOfMemoryException : Exception
{
    this(char[] file, size_t line)
{
super("Memory allocation failed",file,line);
}
    char[] toString()
{
return msg ? super.toString() : "Memory allocation failed";
}
}
class TracedException : Exception
{
    this(char[] msg)
{
super(msg);
m_info = traceContext();
}
    this(char[] msg, Exception e)
{
super(msg,e);
m_info = traceContext();
}
    this(char[] msg, char[] file, size_t line)
{
super(msg,file,line);
m_info = traceContext();
}
    char[] toString();
    int opApply(int delegate(ref char[] buf) dg);
    private
{
    TracedExceptionInfo m_info;
}
}
class PlatformException : TracedException
{
    this(char[] msg)
{
super(msg);
}
}
class AssertException : TracedException
{
    this(char[] file, size_t line)
{
super("Assertion failure",file,line);
}
    this(char[] msg, char[] file, size_t line)
{
super(msg,file,line);
}
}
class ArrayBoundsException : TracedException
{
    this(char[] file, size_t line)
{
super("Array index out of bounds",file,line);
}
}
class FinalizeException : TracedException
{
    ClassInfo info;
    this(ClassInfo c, Exception e = null)
{
super("Finalization error",e);
info = c;
}
    char[] toString()
{
assert(0);
}
}
class SwitchException : TracedException
{
    this(char[] file, size_t line)
{
super("No appropriate switch clause found",file,line);
}
}
class TextException : TracedException
{
    this(char[] msg)
{
super(msg);
}
}
class UnicodeException : TextException
{
    size_t idx;
    this(char[] msg, size_t idx)
{
super(msg);
this.idx = idx;
}
}
class ThreadException : PlatformException
{
    this(char[] msg)
{
super(msg);
}
}
class FiberException : ThreadException
{
    this(char[] msg)
{
super(msg);
}
}
class SyncException : PlatformException
{
    this(char[] msg)
{
super(msg);
}
}
class IOException : PlatformException
{
    this(char[] msg)
{
super(msg);
}
}
private
{
    class VfsException : IOException
{
    this(char[] msg)
{
super(msg);
}
}
}
private
{
    class ClusterException : IOException
{
    this(char[] msg)
{
super(msg);
}
}
}
class SocketException : IOException
{
    this(char[] msg)
{
super(msg);
}
}
class HostException : IOException
{
    this(char[] msg)
{
super(msg);
}
}
class AddressException : IOException
{
    this(char[] msg)
{
super(msg);
}
}
class SocketAcceptException : SocketException
{
    this(char[] msg)
{
super(msg);
}
}
class ProcessException : PlatformException
{
    this(char[] msg)
{
super(msg);
}
}
class RegexException : TextException
{
    this(char[] msg)
{
super(msg);
}
}
class LocaleException : TextException
{
    this(char[] msg)
{
super(msg);
}
}
class RegistryException : TracedException
{
    this(char[] msg)
{
super(msg);
}
}
class IllegalArgumentException : TracedException
{
    this(char[] msg)
{
super(msg);
}
}
class IllegalElementException : IllegalArgumentException
{
    this(char[] msg)
{
super(msg);
}
}
class NoSuchElementException : TracedException
{
    this(char[] msg)
{
super(msg);
}
}
class CorruptedIteratorException : NoSuchElementException
{
    this(char[] msg)
{
super(msg);
}
}
void setAssertHandler(assertHandlerType h)
{
assertHandler = h;
}
void setTraceHandler(traceHandlerType h)
{
traceHandler = h;
}
private
{
    extern (C) 
{
    int printf(char*,...);
}
}
extern (C) 
{
    void onAssertError(char[] file, size_t line);
}
extern (C) 
{
    void onAssertErrorMsg(char[] file, size_t line, char[] msg);
}
TracedExceptionInfo traceContext(void* ptr = null);
extern (C) 
{
    void onArrayBoundsError(char[] file, size_t line);
}
extern (C) 
{
    void onFinalizeError(ClassInfo info, Exception ex);
}
extern (C) 
{
    void onOutOfMemoryError();
}
extern (C) 
{
    void onSwitchError(char[] file, size_t line);
}
extern (C) 
{
    void onUnicodeError(char[] msg, size_t idx);
}