mirror of
https://github.com/gnustep/libs-base.git
synced 2025-05-11 00:30:49 +00:00
Minor intiialisation tweaks to match OSX
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@34423 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
545bc0f99c
commit
1a85fb0780
3 changed files with 55 additions and 30 deletions
|
@ -77,6 +77,11 @@ GS_PRIVATE_INTERNAL(NSXMLDTD)
|
||||||
return nil;
|
return nil;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
- (id) init
|
||||||
|
{
|
||||||
|
return [self initWithKind: NSXMLDTDKind options: 0];
|
||||||
|
}
|
||||||
|
|
||||||
- (id) initWithContentsOfURL: (NSURL*)url
|
- (id) initWithContentsOfURL: (NSURL*)url
|
||||||
options: (NSUInteger)mask
|
options: (NSUInteger)mask
|
||||||
error: (NSError**)error
|
error: (NSError**)error
|
||||||
|
|
|
@ -72,6 +72,11 @@ GS_PRIVATE_INTERNAL(NSXMLDocument)
|
||||||
return internal->docType;
|
return internal->docType;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
- (id) init
|
||||||
|
{
|
||||||
|
return [self initWithKind: NSXMLDocumentKind options: 0];
|
||||||
|
}
|
||||||
|
|
||||||
- (id) initWithContentsOfURL: (NSURL*)url
|
- (id) initWithContentsOfURL: (NSURL*)url
|
||||||
options: (NSUInteger)mask
|
options: (NSUInteger)mask
|
||||||
error: (NSError**)error
|
error: (NSError**)error
|
||||||
|
@ -90,10 +95,21 @@ GS_PRIVATE_INTERNAL(NSXMLDocument)
|
||||||
options: (NSUInteger)mask
|
options: (NSUInteger)mask
|
||||||
error: (NSError**)error
|
error: (NSError**)error
|
||||||
{
|
{
|
||||||
|
if (NO == [data isKindOfClass: [NSData class]])
|
||||||
|
{
|
||||||
|
DESTROY(self);
|
||||||
|
if (nil == data)
|
||||||
|
{
|
||||||
|
[NSException raise: NSInternalInconsistencyException
|
||||||
|
format: @"[NSXMLDocument-%@] nil argument",
|
||||||
|
NSStringFromSelector(_cmd)];
|
||||||
|
}
|
||||||
|
[NSException raise: NSInternalInconsistencyException
|
||||||
|
format: @"[NSXMLDocument-%@] invalid argument",
|
||||||
|
NSStringFromSelector(_cmd)];
|
||||||
|
}
|
||||||
GS_CREATE_INTERNAL(NSXMLDocument)
|
GS_CREATE_INTERNAL(NSXMLDocument)
|
||||||
if ((self = [super initWithKind: NSXMLDocumentKind options: 0]) != nil)
|
if ((self = [super initWithKind: NSXMLDocumentKind options: 0]) != nil)
|
||||||
{
|
|
||||||
if (nil != data)
|
|
||||||
{
|
{
|
||||||
NSXMLParser *parser = [[NSXMLParser alloc] initWithData: data];
|
NSXMLParser *parser = [[NSXMLParser alloc] initWithData: data];
|
||||||
|
|
||||||
|
@ -112,7 +128,6 @@ GS_PRIVATE_INTERNAL(NSXMLDocument)
|
||||||
RELEASE(parser);
|
RELEASE(parser);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
return self;
|
return self;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -137,7 +152,7 @@ GS_PRIVATE_INTERNAL(NSXMLDocument)
|
||||||
element,
|
element,
|
||||||
self];
|
self];
|
||||||
}
|
}
|
||||||
self = [self initWithData: nil options: 0 error: 0];
|
self = [self initWithKind: NSXMLDocumentKind options: 0];
|
||||||
if (self != nil)
|
if (self != nil)
|
||||||
{
|
{
|
||||||
[self setRootElement: (NSXMLNode*)element];
|
[self setRootElement: (NSXMLNode*)element];
|
||||||
|
|
|
@ -42,11 +42,28 @@ GS_PRIVATE_INTERNAL(NSXMLElement)
|
||||||
[super dealloc];
|
[super dealloc];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
- (id) init
|
||||||
|
{
|
||||||
|
return [self initWithKind: NSXMLElementKind options: 0];
|
||||||
|
}
|
||||||
|
|
||||||
- (id) initWithName: (NSString*)name
|
- (id) initWithName: (NSString*)name
|
||||||
{
|
{
|
||||||
return [self initWithName: name URI: nil];
|
return [self initWithName: name URI: nil];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
- (id) initWithKind: (NSXMLNodeKind)kind options: (NSUInteger)theOptions
|
||||||
|
{
|
||||||
|
if (NSXMLElementKind == kind)
|
||||||
|
{
|
||||||
|
/* Create holder for internal instance variables so that we'll have
|
||||||
|
* all our ivars available rather than just those of the superclass.
|
||||||
|
*/
|
||||||
|
GS_CREATE_INTERNAL(NSXMLElement)
|
||||||
|
}
|
||||||
|
return [super initWithKind: kind options: theOptions];
|
||||||
|
}
|
||||||
|
|
||||||
- (id) initWithName: (NSString*)name URI: (NSString*)URI
|
- (id) initWithName: (NSString*)name URI: (NSString*)URI
|
||||||
{
|
{
|
||||||
/* Create holder for internal instance variables so that we'll have
|
/* Create holder for internal instance variables so that we'll have
|
||||||
|
@ -71,18 +88,6 @@ GS_PRIVATE_INTERNAL(NSXMLElement)
|
||||||
return nil;
|
return nil;
|
||||||
}
|
}
|
||||||
|
|
||||||
- (id) initWithKind: (NSXMLNodeKind)kind options: (NSUInteger)theOptions
|
|
||||||
{
|
|
||||||
if (NSXMLElementKind == kind)
|
|
||||||
{
|
|
||||||
/* Create holder for internal instance variables so that we'll have
|
|
||||||
* all our ivars available rather than just those of the superclass.
|
|
||||||
*/
|
|
||||||
GS_CREATE_INTERNAL(NSXMLElement)
|
|
||||||
}
|
|
||||||
return [super initWithKind: kind options: theOptions];
|
|
||||||
}
|
|
||||||
|
|
||||||
- (id) initWithXMLString: (NSString*)string error: (NSError**)error
|
- (id) initWithXMLString: (NSString*)string error: (NSError**)error
|
||||||
{
|
{
|
||||||
[self notImplemented: _cmd];
|
[self notImplemented: _cmd];
|
||||||
|
|
Loading…
Reference in a new issue