PageRenderTime 80ms CodeModel.GetById 68ms app.highlight 10ms RepoModel.GetById 1ms app.codeStats 0ms

/packages/cocoaint/src/foundation/NSException.inc

https://github.com/slibre/freepascal
Pascal | 114 lines | 57 code | 22 blank | 35 comment | 0 complexity | 5000c7651cd99391c36c3f7b0496d54a MD5 | raw file
Possible License(s): LGPL-2.0, LGPL-2.1, LGPL-3.0
  1{ Parsed from Foundation.framework NSException.h }
  2
  3{$ifdef TYPES}
  4{$ifndef NSEXCEPTION_PAS_T}
  5{$define NSEXCEPTION_PAS_T}
  6
  7{ Callbacks }
  8type
  9  NSUncaughtExceptionHandler = procedure (exception: NSException); cdecl;
 10
 11
 12{$endif}
 13{$endif}
 14
 15{$ifdef RECORDS}
 16{$ifndef NSEXCEPTION_PAS_R}
 17{$define NSEXCEPTION_PAS_R}
 18
 19{$endif}
 20{$endif}
 21
 22{$ifdef FUNCTIONS}
 23{$ifndef NSEXCEPTION_PAS_F}
 24{$define NSEXCEPTION_PAS_F}
 25
 26{ Functions }
 27function NSGetUncaughtExceptionHandler: NSUncaughtExceptionHandler; cdecl; external;
 28procedure NSSetUncaughtExceptionHandler(param1: NSUncaughtExceptionHandler); cdecl; external;
 29
 30{$endif}
 31{$endif}
 32
 33{$ifdef EXTERNAL_SYMBOLS}
 34{$ifndef NSEXCEPTION_PAS_S}
 35{$define NSEXCEPTION_PAS_S}
 36
 37{ External string constants }
 38var
 39  NSGenericException: NSString; cvar; external;
 40  NSRangeException: NSString; cvar; external;
 41  NSInvalidArgumentException: NSString; cvar; external;
 42  NSInternalInconsistencyException: NSString; cvar; external;
 43  NSMallocException: NSString; cvar; external;
 44  NSObjectInaccessibleException: NSString; cvar; external;
 45  NSObjectNotAvailableException: NSString; cvar; external;
 46  NSDestinationInvalidException: NSString; cvar; external;
 47  NSPortTimeoutException: NSString; cvar; external;
 48  NSInvalidSendPortException: NSString; cvar; external;
 49  NSInvalidReceivePortException: NSString; cvar; external;
 50  NSPortSendException: NSString; cvar; external;
 51  NSPortReceiveException: NSString; cvar; external;
 52  NSOldStyleException: NSString; cvar; external;
 53  NSAssertionHandlerKey: NSString; cvar; external;
 54
 55{$endif}
 56{$endif}
 57
 58{$ifdef FORWARD}
 59  NSException = objcclass;
 60  NSExceptionPointer = ^NSException;
 61  NSExceptionPtr = NSExceptionPointer;
 62  NSAssertionHandler = objcclass;
 63  NSAssertionHandlerPointer = ^NSAssertionHandler;
 64  NSAssertionHandlerPtr = NSAssertionHandlerPointer;
 65
 66{$endif}
 67
 68{$ifdef CLASSES}
 69{$ifndef NSEXCEPTION_PAS_C}
 70{$define NSEXCEPTION_PAS_C}
 71
 72{ NSException }
 73  NSException = objcclass external (NSObject, NSCopyingProtocol, NSCodingProtocol)
 74  private
 75    _name: NSString;
 76    _reason: NSString;
 77    _userInfo: NSDictionary;
 78    reserved: id;
 79    
 80  public
 81    class function exceptionWithName_reason_userInfo(name_: NSString; reason_: NSString; userInfo_: NSDictionary): NSException; message 'exceptionWithName:reason:userInfo:';
 82    function initWithName_reason_userInfo(aName: NSString; aReason: NSString; aUserInfo: NSDictionary): id; message 'initWithName:reason:userInfo:';
 83    function name: NSString; message 'name';
 84    function reason: NSString; message 'reason';
 85    function userInfo: NSDictionary; message 'userInfo';
 86    function callStackReturnAddresses: NSArray; message 'callStackReturnAddresses';
 87    function callStackSymbols: NSArray; message 'callStackSymbols';
 88    procedure raise_; message 'raise';
 89
 90    { Adopted Protocols }
 91    function copyWithZone(zone_: NSZonePtr): id;
 92    procedure encodeWithCoder(aCoder: NSCoder);
 93    function initWithCoder(aDecoder: NSCoder): id;
 94  end;
 95
 96{ NSAssertionHandler }
 97  NSAssertionHandler = objcclass external (NSObject)
 98  private
 99    _reserved: Pointer;
100    
101  public
102    class function currentHandler: NSAssertionHandler; message 'currentHandler';
103    procedure handleFailureInMethod_object_file_lineNumber_description(selector: SEL; object_: id; fileName: NSString; line: NSInteger; firstKey: id); varargs; message 'handleFailureInMethod:object:file:lineNumber:description:';
104    procedure handleFailureInFunction_file_lineNumber_description(functionName: NSString; fileName: NSString; line: NSInteger; firstKey: id); varargs; message 'handleFailureInFunction:file:lineNumber:description:';
105  end;
106
107{ NSExceptionRaisingConveniencesCategory }
108  NSExceptionRaisingConveniencesCategory = objccategory external (NSException)
109    class procedure raise_format(name_: NSString; firstKey: id); varargs; message 'raise:format:';
110    class procedure raise_format_arguments(name_: NSString; format: NSString; argList: va_list); message 'raise:format:arguments:';
111  end;
112
113{$endif}
114{$endif}