47 lines
969 B
Mathematica
47 lines
969 B
Mathematica
|
//
|
||
|
// BooruXMLParserDelegate.m
|
||
|
// cunnyfinder
|
||
|
//
|
||
|
// Created by James Shiffer on 12/20/22.
|
||
|
// Copyright © 2022 FemboyFinancial. All rights reserved.
|
||
|
//
|
||
|
|
||
|
#import "BooruXMLParserDelegate.h"
|
||
|
|
||
|
@implementation BooruXMLParserDelegate
|
||
|
|
||
|
NSMutableString* value;
|
||
|
|
||
|
-(id)init
|
||
|
{
|
||
|
self.data = [[NSMutableDictionary alloc] init];
|
||
|
return self;
|
||
|
}
|
||
|
|
||
|
-(void)parser:(NSXMLParser *)parser
|
||
|
didStartElement:(NSString *)elementName
|
||
|
namespaceURI:(NSString *)namespaceURI
|
||
|
qualifiedName:(NSString *)qName
|
||
|
attributes:(NSDictionary<NSString *,NSString *> *)attributeDict
|
||
|
{
|
||
|
value = [NSMutableString string];
|
||
|
}
|
||
|
|
||
|
-(void)parser:(NSXMLParser *)parser foundCharacters:(NSString *)string
|
||
|
{
|
||
|
[value appendString:string];
|
||
|
}
|
||
|
|
||
|
-(void)parser:(NSXMLParser *)parser
|
||
|
didEndElement:(NSString *)elementName
|
||
|
namespaceURI:(NSString *)namespaceURI
|
||
|
qualifiedName:(NSString *)qName
|
||
|
{
|
||
|
if (value)
|
||
|
{
|
||
|
[self.data setObject:value forKey:elementName];
|
||
|
}
|
||
|
}
|
||
|
|
||
|
@end
|