Revert ABI breakage

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@34410 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Richard Frith-MacDonald 2012-01-04 09:20:32 +00:00
parent cbf50c0e7e
commit 7b7faac752
8 changed files with 75 additions and 78 deletions

View file

@ -43,6 +43,7 @@
RELEASE(_encoding);
RELEASE(_version);
RELEASE(_docType);
RELEASE(_children);
RELEASE(_URI);
RELEASE(_MIMEType);
RELEASE(_elementStack);
@ -89,16 +90,13 @@
if (parser != nil)
{
_standalone = YES;
_children = [[NSMutableArray alloc] initWithCapacity: 10];
_elementStack = [[NSMutableArray alloc] initWithCapacity: 10];
ASSIGN(_xmlData, data);
[parser setDelegate: self];
[parser parse];
RELEASE(parser);
}
else
{
return nil;
}
}
return self;
}
@ -112,13 +110,9 @@
element,
self];
}
self = [self init];
self = [self initWithData: nil options: 0 error: 0];
if (self != nil)
{
_standalone = YES;
_children = [[NSMutableArray alloc] initWithCapacity: 10];
_elementStack = [[NSMutableArray alloc] initWithCapacity: 10];
[self setRootElement: (NSXMLNode*)element];
}
return self;
@ -205,7 +199,7 @@
{
[child setParent: self];
[(NSMutableArray *)_children insertObject: child atIndex: index];
// _childrenHaveMutated = YES;
_childrenHaveMutated = YES;
}
- (void) insertChildren: (NSArray*)children atIndex: (NSUInteger)index
@ -221,8 +215,8 @@
- (void) removeChildAtIndex: (NSUInteger)index
{
[_children removeObjectAtIndex: index];
// _childrenHaveMutated = YES;
[(NSMutableArray *)_children removeObjectAtIndex: index];
_childrenHaveMutated = YES;
}
- (void) setChildren: (NSArray*)children
@ -288,26 +282,6 @@
return NO;
}
- (NSString *) XMLStringWithOptions: (NSUInteger)options
{
NSMutableString *string = [NSMutableString string];
NSEnumerator *en = [_children objectEnumerator];
id obj = nil;
[string appendString: @"<?xml version=\"1.0\""];
if(_standalone == YES)
{
[string appendString: @" standalone=\"yes\""];
}
[string appendString: @"?>\n"];
while((obj = [en nextObject]) != nil)
{
[string appendString: [obj XMLStringWithOptions: options]];
}
return string;
}
@end
@implementation NSXMLDocument (NSXMLParserDelegate)
@ -318,11 +292,9 @@
qualifiedName: (NSString *)qualifiedName
attributes: (NSDictionary *)attributeDict
{
NSXMLElement *lastElement = [_elementStack lastObject];
NSXMLElement *currentElement =
[[NSXMLElement alloc] initWithName: elementName];
[lastElement addChild: currentElement];
[_elementStack addObject: currentElement];
if (_rootElement == nil)
{