mirror of
https://github.com/gnustep/libs-base.git
synced 2025-05-30 08:21:25 +00:00
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:
parent
47571e082d
commit
3f6bf1fbba
8 changed files with 75 additions and 78 deletions
|
@ -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)
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue