Tidyups etc

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@17380 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
CaS 2003-07-28 10:53:18 +00:00
parent 4a92c831b2
commit 02aace51b0
8 changed files with 79 additions and 5 deletions

View file

@ -3776,6 +3776,26 @@ static NSCharacterSet *tokenSet = nil;
return hdr;
}
/**
* Convenience method to create a new header and add it to the receiver
* replacing any existing header of the same name.<br />
* Returns the newly created header.<br />
* See [GSMimeHeader-initWithName:value:parameters:] and -setHeader: methods.
*/
- (GSMimeHeader*) makeHeader: (NSString*)name
value: (NSString*)value
parameters: (NSDictionary*)parameters
{
GSMimeHeader *hdr;
hdr = [[GSMimeHeader alloc] initWithName: name
value: value
parameters: parameters];
[self setHeader: hdr];
RELEASE(hdr);
return hdr;
}
/**
* Create new message ID header, set it as the message ID of the document
* and return it.<br />

View file

@ -1124,6 +1124,20 @@ static NSMapTable *nodeNames = 0;
return nil;
}
/**
* Convenience method, equivalent to calling -type and comparing it
* with the result of passing "XML_ELEMENT_NODE" to
* +typeFromDescription: (but faster).
*/
- (BOOL) isElement
{
if ((int)((xmlNodePtr)(lib))->type == XML_ELEMENT_NODE)
{
return YES;
}
return NO;
}
- (BOOL) isEqual: (id)other
{
if ([other isKindOfClass: [self class]] == YES
@ -1137,6 +1151,20 @@ static NSMapTable *nodeNames = 0;
}
}
/**
* Convenience method, equivalent to calling -type and comparing it
* with the result of passing "XML_TEXT_NODE" to
* +typeFromDescription: (but faster).
*/
- (BOOL) isText
{
if ((int)((xmlNodePtr)(lib))->type == XML_TEXT_NODE)
{
return YES;
}
return NO;
}
/**
* Returns a pointer to the raw libxml data used by this document.<br />
* Only for use by libxml experts!

View file

@ -860,8 +860,14 @@ GSInvocationCallback (void *callback_data, va_alist args)
sig = [NSMethodSignature signatureWithObjCTypes: sel_get_type(selector)];
}
NSCAssert1(sig, @"No signature for selector %@",
NSStringFromSelector(selector));
if (sig == nil)
{
[NSException raise: NSInvalidArgumentException
format: @"%s(%s) does not recognize %s",
object_get_class_name(obj),
GSObjCIsInstance(obj) ? "instance" : "class",
selector ? sel_get_name(selector) : "(null)"];
}
invocation = [[GSFFCallInvocation alloc] initWithMethodSignature: sig];
AUTORELEASE(invocation);

View file

@ -475,8 +475,14 @@ GSFFIInvocationCallback(ffi_cif *cif, void *retp, void **args, void *user)
sig = [NSMethodSignature signatureWithObjCTypes: sel_get_type(selector)];
}
NSCAssert1(sig, @"No signature for selector %@",
NSStringFromSelector(selector));
if (sig == nil)
{
[NSException raise: NSInvalidArgumentException
format: @"%s(%s) does not recognize %s",
object_get_class_name(obj),
GSObjCIsInstance(obj) ? "instance" : "class",
selector ? sel_get_name(selector) : "(null)"];
}
invocation = [[GSFFIInvocation alloc] initWithCallback: cif
returnp: retp