mirror of
https://github.com/Ranchero-Software/NetNewsWire.git
synced 2025-02-09 00:28:53 +01:00
Get RSParser.framework building again.
This commit is contained in:
parent
e9c19e427a
commit
b939d91da0
@ -38,7 +38,7 @@
|
|||||||
|
|
||||||
#pragma mark - Class Methods
|
#pragma mark - Class Methods
|
||||||
|
|
||||||
+ (NSArray *)HTMLMetadataWithParserData:(ParserData *)parserData {
|
+ (NSArray *)htmlLinksWithParserData:(ParserData *)parserData {
|
||||||
|
|
||||||
RSHTMLLinkParser *parser = [[self alloc] initWithParserData:parserData];
|
RSHTMLLinkParser *parser = [[self alloc] initWithParserData:parserData];
|
||||||
return parser.links;
|
return parser.links;
|
||||||
|
@ -16,29 +16,6 @@
|
|||||||
#import "RSOPMLError.h"
|
#import "RSOPMLError.h"
|
||||||
|
|
||||||
|
|
||||||
void RSParseOPML(ParserData *parserData, RSParsedOPMLBlock callback) {
|
|
||||||
|
|
||||||
NSCParameterAssert(parserData);
|
|
||||||
NSCParameterAssert(callback);
|
|
||||||
|
|
||||||
dispatch_async(dispatch_get_global_queue(QOS_CLASS_DEFAULT, 0), ^{
|
|
||||||
|
|
||||||
@autoreleasepool {
|
|
||||||
|
|
||||||
RSOPMLParser *parser = [[RSOPMLParser alloc] initWithParserData:parserData];
|
|
||||||
|
|
||||||
RSOPMLDocument *document = parser.OPMLDocument;
|
|
||||||
NSError *error = parser.error;
|
|
||||||
|
|
||||||
dispatch_async(dispatch_get_main_queue(), ^{
|
|
||||||
|
|
||||||
callback(document, error);
|
|
||||||
});
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
@interface RSOPMLParser () <RSSAXParserDelegate>
|
@interface RSOPMLParser () <RSSAXParserDelegate>
|
||||||
|
|
||||||
@property (nonatomic, readwrite) RSOPMLDocument *OPMLDocument;
|
@property (nonatomic, readwrite) RSOPMLDocument *OPMLDocument;
|
||||||
|
@ -1,19 +0,0 @@
|
|||||||
//
|
|
||||||
// RSXMLError.h
|
|
||||||
// RSXML
|
|
||||||
//
|
|
||||||
// Created by Brent Simmons on 2/28/16.
|
|
||||||
// Copyright © 2016 Ranchero Software, LLC. All rights reserved.
|
|
||||||
//
|
|
||||||
|
|
||||||
@import Foundation;
|
|
||||||
|
|
||||||
extern NSString *RSXMLErrorDomain;
|
|
||||||
|
|
||||||
|
|
||||||
typedef NS_ENUM(NSInteger, RSXMLErrorCode) {
|
|
||||||
RSXMLErrorCodeDataIsWrongFormat = 1024
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
NSError *RSOPMLWrongFormatError(NSString *fileName);
|
|
@ -1,22 +0,0 @@
|
|||||||
//
|
|
||||||
// RSXMLError.m
|
|
||||||
// RSXML
|
|
||||||
//
|
|
||||||
// Created by Brent Simmons on 2/28/16.
|
|
||||||
// Copyright © 2016 Ranchero Software, LLC. All rights reserved.
|
|
||||||
//
|
|
||||||
|
|
||||||
#import "RSXMLError.h"
|
|
||||||
|
|
||||||
NSString *RSXMLErrorDomain = @"com.ranchero.RSXML";
|
|
||||||
|
|
||||||
NSError *RSOPMLWrongFormatError(NSString *fileName) {
|
|
||||||
|
|
||||||
NSString *localizedDescriptionFormatString = NSLocalizedString(@"The file ‘%@’ can’t be parsed because it’s not an OPML file.", @"OPML wrong format");
|
|
||||||
NSString *localizedDescription = [NSString stringWithFormat:localizedDescriptionFormatString, fileName];
|
|
||||||
|
|
||||||
NSString *localizedFailureString = NSLocalizedString(@"The file is not an OPML file.", @"OPML wrong format");
|
|
||||||
NSDictionary *userInfo = @{NSLocalizedDescriptionKey: localizedDescription, NSLocalizedFailureReasonErrorKey: localizedFailureString};
|
|
||||||
|
|
||||||
return [[NSError alloc] initWithDomain:RSXMLErrorDomain code:RSXMLErrorCodeDataIsWrongFormat userInfo:userInfo];
|
|
||||||
}
|
|
Loading…
x
Reference in New Issue
Block a user