mirror of
https://github.com/Ranchero-Software/NetNewsWire
synced 2025-08-12 06:26:36 +00:00
Import RSOPMLDocument to Swift.
This commit is contained in:
15
Modules/Parser/Sources/Parser/OPML/OPMLDocument.swift
Normal file
15
Modules/Parser/Sources/Parser/OPML/OPMLDocument.swift
Normal file
@@ -0,0 +1,15 @@
|
||||
//
|
||||
// OPMLDocument.swift
|
||||
//
|
||||
//
|
||||
// Created by Brent Simmons on 8/18/24.
|
||||
//
|
||||
|
||||
import Foundation
|
||||
|
||||
public struct OPMLDocument: Sendable {
|
||||
|
||||
public let title: String
|
||||
public let url: String
|
||||
public let items: [OPMLItem]?
|
||||
}
|
||||
@@ -8,7 +8,7 @@
|
||||
import Foundation
|
||||
import os
|
||||
|
||||
public final class OPMLItem: Sendable {
|
||||
public struct OPMLItem: Sendable {
|
||||
|
||||
public let feedSpecifier: OPMLFeedSpecifier
|
||||
|
||||
@@ -16,9 +16,9 @@ public final class OPMLItem: Sendable {
|
||||
public let titleFromAttributes: String?
|
||||
|
||||
public let isFolder: Bool
|
||||
public let children: [OPMLItem]?
|
||||
public let items: [OPMLItem]?
|
||||
|
||||
init?(attributes: [String : String], children: [OPMLItem]?) {
|
||||
init?(attributes: [String : String], items: [OPMLItem]?) {
|
||||
|
||||
guard let feedURL = attributes.opml_xmlUrl, !feedURL.isEmpty else {
|
||||
return nil
|
||||
@@ -36,7 +36,7 @@ public final class OPMLItem: Sendable {
|
||||
|
||||
self.attributes = attributes
|
||||
|
||||
self.children = children
|
||||
self.isFolder = (children?.count ?? 0) > 0
|
||||
self.items = items
|
||||
self.isFolder = (items?.count ?? 0) > 0
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,21 +0,0 @@
|
||||
//
|
||||
// RSOPMLDocument.h
|
||||
// RSParser
|
||||
//
|
||||
// Created by Brent Simmons on 2/28/16.
|
||||
// Copyright © 2016 Ranchero Software, LLC. All rights reserved.
|
||||
//
|
||||
|
||||
@import Foundation;
|
||||
|
||||
#import "RSOPMLItem.h"
|
||||
|
||||
|
||||
|
||||
|
||||
@interface RSOPMLDocument : RSOPMLItem
|
||||
|
||||
@property (nonatomic) NSString *title;
|
||||
@property (nonatomic) NSString *url;
|
||||
|
||||
@end
|
||||
@@ -1,14 +0,0 @@
|
||||
//
|
||||
// RSOPMLDocument.m
|
||||
// RSParser
|
||||
//
|
||||
// Created by Brent Simmons on 2/28/16.
|
||||
// Copyright © 2016 Ranchero Software, LLC. All rights reserved.
|
||||
//
|
||||
|
||||
|
||||
#import "RSOPMLDocument.h"
|
||||
|
||||
@implementation RSOPMLDocument
|
||||
|
||||
@end
|
||||
Reference in New Issue
Block a user