Switch to new Parser.

This commit is contained in:
Brent Simmons
2024-11-15 22:59:51 -08:00
parent c3f063ae4a
commit 85d1a8fe7a
79 changed files with 187 additions and 219 deletions

View File

@@ -1,6 +1,6 @@
//
// FeedParser.swift
// RSParser
// Parser
//
// Created by Brent Simmons on 6/20/17.
// Copyright © 2017 Ranchero Software, LLC. All rights reserved.
@@ -50,6 +50,22 @@ public struct FeedParser {
}
}
public static func parse(_ parserData: ParserData, _ completion: @Sendable @escaping (ParsedFeed?, Error?) -> Void) {
Task {
do {
let parsedFeed = try await parseAsync(urlString: parserData.url, data: parserData.data)
Task { @MainActor in
completion(parsedFeed, nil)
}
} catch {
Task { @MainActor in
completion(nil, error)
}
}
}
}
public static func parseAsync(urlString: String, data: Data) async throws -> ParsedFeed? {
try parse(urlString: urlString, data: data)

View File

@@ -1,6 +1,6 @@
//
// FeedParserError.swift
// RSParser
// Parser
//
// Created by Brent Simmons on 6/24/17.
// Copyright © 2017 Ranchero Software, LLC. All rights reserved.

View File

@@ -1,6 +1,6 @@
//
// FeedType.swift
// RSParser
// Parser
//
// Created by Brent Simmons on 6/20/17.
// Copyright © 2017 Ranchero Software, LLC. All rights reserved.

View File

@@ -1,6 +1,6 @@
//
// JSONFeedParser.swift
// RSParser
// Parser
//
// Created by Brent Simmons on 6/25/17.
// Copyright © 2017 Ranchero Software, LLC. All rights reserved.

View File

@@ -1,6 +1,6 @@
//
// RSSInJSONParser.swift
// RSParser
// Parser
//
// Created by Brent Simmons on 6/24/17.
// Copyright © 2017 Ranchero Software, LLC. All rights reserved.

View File

@@ -1,6 +1,6 @@
//
// ParsedAttachment.swift
// RSParser
// Parser
//
// Created by Brent Simmons on 6/20/17.
// Copyright © 2017 Ranchero Software, LLC. All rights reserved.

View File

@@ -1,6 +1,6 @@
//
// ParsedAuthor.swift
// RSParser
// Parser
//
// Created by Brent Simmons on 6/20/17.
// Copyright © 2017 Ranchero Software, LLC. All rights reserved.

View File

@@ -1,6 +1,6 @@
//
// ParsedFeed.swift
// RSParser
// Parser
//
// Created by Brent Simmons on 6/20/17.
// Copyright © 2017 Ranchero Software, LLC. All rights reserved.

View File

@@ -1,6 +1,6 @@
//
// ParsedHub.swift
// RSParser
// Parser
//
// Created by Brent Simmons on 6/20/17.
// Copyright © 2017 Ranchero Software, LLC. All rights reserved.

View File

@@ -1,6 +1,6 @@
//
// ParsedItem.swift
// RSParser
// Parser
//
// Created by Brent Simmons on 6/20/17.
// Copyright © 2017 Ranchero Software, LLC. All rights reserved.

View File

@@ -1,6 +1,6 @@
//
// AtomParser.swift
// RSParser
// Parser
//
// Created by Brent Simmons on 6/25/17.
// Copyright © 2017 Ranchero Software, LLC. All rights reserved.

View File

@@ -1,6 +1,6 @@
//
// RSSFeedTransformer.swift
// RSParser
// Parser
//
// Created by Brent Simmons on 6/25/17.
// Copyright © 2017 Ranchero Software, LLC. All rights reserved.

View File

@@ -1,6 +1,6 @@
//
// RSSParser.swift
// RSParser
// Parser
//
// Created by Brent Simmons on 6/25/17.
// Copyright © 2017 Ranchero Software, LLC. All rights reserved.

View File

@@ -1,6 +1,6 @@
//
// JSONDictionary.swift
// RSParser
// Parser
//
// Created by Brent Simmons on 6/24/17.
// Copyright © 2017 Ranchero Software, LLC. All rights reserved.

View File

@@ -1,6 +1,6 @@
//
// JSONUtilities.swift
// RSParser
// Parser
//
// Created by Brent Simmons on 12/10/17.
// Copyright © 2017 Ranchero Software, LLC. All rights reserved.

View File

@@ -1,6 +1,6 @@
//
// String+RSParser.swift
// RSParser
// String+Parser.swift
// Parser
//
// Created by Nate Weaver on 2020-01-19.
// Copyright © 2020 Ranchero Software, LLC. All rights reserved.