2 Copyright (C) 2000-2004 SKYRIX Software AG
4 This file is part of OpenGroupware.org.
6 OGo is free software; you can redistribute it and/or modify it under
7 the terms of the GNU Lesser General Public License as published by the
8 Free Software Foundation; either version 2, or (at your option) any
11 OGo is distributed in the hope that it will be useful, but WITHOUT ANY
12 WARRANTY; without even the implied warranty of MERCHANTABILITY or
13 FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
14 License for more details.
16 You should have received a copy of the GNU Lesser General Public
17 License along with OGo; see the file COPYING. If not, write to the
18 Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA
22 #include "NSException+misc.h"
25 @implementation NSException(NGMiscellaneous)
27 - (id)initWithReason:(NSString *)_reason {
28 return [self initWithReason:_reason userInfo:nil];
30 - (id)initWithReason:(NSString *)_reason userInfo:(id)_userInfo {
31 return [self initWithName:NSStringFromClass([self class])
36 - (id)initWithFormat:(NSString *)_format,... {
41 NSLog(@"ERROR(%s): missing format!", __PRETTY_FUNCTION__);
43 va_start(ap, _format);
44 tmp = [[NSString allocWithZone:[self zone]]
45 initWithFormat:_format ? _format : @"Exception"
49 self = [self initWithReason:tmp userInfo:nil];
50 [tmp release]; tmp = nil;
56 - (id)copyWithZone:(NSZone *)_zone {
57 // TODO: should make a real copy?
61 @end /* NSException(NGMiscellaneous) */
63 #if COCOA_Foundation_LIBRARY || NeXT_Foundation_LIBRARY
65 @implementation NSException (NGLibFoundationCompatibility)
66 - (void)setReason:(NSString *)_reason {
68 [self->reason release];
69 self->reason = _reason;
73 #elif GNUSTEP_BASE_LIBRARY
75 @implementation NSException (NGLibFoundationCompatibility)
76 - (void)setReason:(NSString *)_reason {
78 [self->_e_reason release];
79 self->_e_reason = _reason;
85 void __link_NGExtensions_NSExceptionMisc() {
86 __link_NGExtensions_NSExceptionMisc();