Continue progress on porting OPML code to Swift.
This commit is contained in:
parent
b7462c89e0
commit
213f67d1de
@ -29,6 +29,18 @@
|
||||
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
|
||||
shouldUseLaunchSchemeArgsEnv = "YES"
|
||||
shouldAutocreateTestPlan = "YES">
|
||||
<Testables>
|
||||
<TestableReference
|
||||
skipped = "NO">
|
||||
<BuildableReference
|
||||
BuildableIdentifier = "primary"
|
||||
BlueprintIdentifier = "ParserTests"
|
||||
BuildableName = "ParserTests"
|
||||
BlueprintName = "ParserTests"
|
||||
ReferencedContainer = "container:">
|
||||
</BuildableReference>
|
||||
</TestableReference>
|
||||
</Testables>
|
||||
</TestAction>
|
||||
<LaunchAction
|
||||
buildConfiguration = "Debug"
|
||||
|
@ -7,7 +7,7 @@
|
||||
|
||||
import Foundation
|
||||
|
||||
final class OPMLDocument: OPMLItem, @unchecked Sendable {
|
||||
final class OPMLDocument: OPMLItem {
|
||||
|
||||
var title: String? = nil
|
||||
var url: String? = nil
|
||||
|
@ -1,5 +1,5 @@
|
||||
//
|
||||
// ParsedOPMLFeedSpecifier.swift
|
||||
// OPMLFeedSpecifier.swift
|
||||
//
|
||||
//
|
||||
// Created by Brent Simmons on 8/18/24.
|
||||
@ -7,7 +7,7 @@
|
||||
|
||||
import Foundation
|
||||
|
||||
public struct ParsedOPMLFeedSpecifier: Sendable {
|
||||
public struct OPMLFeedSpecifier: Sendable {
|
||||
|
||||
let title: String?
|
||||
let feedDescription: String?
|
@ -8,7 +8,7 @@
|
||||
import Foundation
|
||||
import os
|
||||
|
||||
class OPMLItem: @unchecked Sendable {
|
||||
class OPMLItem {
|
||||
|
||||
public let feedSpecifier: ParsedOPMLFeedSpecifier
|
||||
|
||||
|
@ -1,25 +0,0 @@
|
||||
//
|
||||
// ParsedOPMLDocument.swift
|
||||
//
|
||||
//
|
||||
// Created by Brent Simmons on 8/18/24.
|
||||
//
|
||||
|
||||
import Foundation
|
||||
|
||||
public final class ParsedOPMLDocument: Sendable {
|
||||
|
||||
public let title: String?
|
||||
public let url: String?
|
||||
public let items: [ParsedOPMLItem]?
|
||||
|
||||
init(opmlDocument: OPMLDocument) {
|
||||
|
||||
self.title = opmlDocument.title
|
||||
self.url = opmlDocument.url
|
||||
|
||||
self.items = opmlDocument.items.map { opmlItem in
|
||||
ParsedOPMLItem(opmlItem: opmlItem)
|
||||
}
|
||||
}
|
||||
}
|
@ -1,31 +0,0 @@
|
||||
//
|
||||
// File.swift
|
||||
//
|
||||
//
|
||||
// Created by Brent Simmons on 8/18/24.
|
||||
//
|
||||
|
||||
import Foundation
|
||||
|
||||
public struct ParsedOPMLItem: Sendable {
|
||||
|
||||
public let feedSpecifier: ParsedOPMLFeedSpecifier?
|
||||
|
||||
public let attributes: [String: String]?
|
||||
public let title: String?
|
||||
|
||||
public var items: [ParsedOPMLItem]?
|
||||
public var isFolder: Bool
|
||||
|
||||
init(opmlItem: OPMLItem) {
|
||||
|
||||
self.feedSpecifier = ParsedOPMLFeedSpecifier(opmlItem.feedSpecifier)
|
||||
self.attributes = opmlItem.attributes
|
||||
self.title = opmlItem.title
|
||||
|
||||
self.items = opmlItem.items.map { opmlItem in
|
||||
ParsedOPMLItem(opmlItem: opmlItem)
|
||||
}
|
||||
self.isFolder = (self.items?.count ?? 0) > 0
|
||||
}
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user