EventParser
final class EventParserParser for a sched.com .ics file, based on https://jococruise2019.sched.com export.
- 
                  
                  Creates an Eventfrom an array of the raw lines appearing betweenBEGIN:VEVENTandEND:VEVENTlines in a sched.com.icsfile. Escape characters that may appear in “SUMMARY”, “DESCRIPTION” and “LOCATION” values are stripped.DeclarationSwift func makeEvent(from properties: [String]) throws -> Event?Parameterscomponents[String]containing the lines to be processed.Return ValueEventif the date strings could be parsed, elsenil.
- 
                  
                  DeclarationSwift func unescapedTextValue(_ value: any StringProtocol) -> String
- 
                  
                  DeclarationSwift let gmtDateFormatter: DateFormatter
- 
                  
                  DeclarationSwift let tzDateFormatter: DateFormatter
- 
                  
                  DeclarationSwift func parseDateFromProperty(property keyAndParams: [Substring], value: String) throws -> Date
- 
                  validateEventsInICS(_:Asynchronouson: ) Takes an .ics Schedule file and compares it against the db. Returns a summary of what would change if the schedule is applied. Shows deleted events, added events, events with modified times, events with changes to their title or description text). DeclarationSwift func validateEventsInICS(_ scheduleFileStr: String, on db: Database) async throws -> EventUpdateDifferenceDataParametersscheduleFileStrThe contents of an ICS file; usually a sched.com .icsexport. Conforms to RFC 5545.dbThe connection to a database. Return ValueEventUpdateDifferenceDatawith info on the events that were modified/added/removed .
- 
                  
                  Takes an .ics Schedule file, updates the db with new info from the schedule. Returns a summary of what changed and how (deleted events, added events, events with modified times, events with changes to their title or description text). DeclarationSwift func updateDatabaseFromICS(_ scheduleFileStr: String, on db: Database, forumAuthor: UserHeader, processDeletes: Bool = true, makeForumPosts: Bool = true) async throwsParametersscheduleFileStrThe contents of an ICS file; usually a sched.com .icsexport. Conforms to RFC 5545.dbThe connection to a database. forumAuthorIf there are changes and makeForumPostsis TRUE, the user to use as the author of the relevant forum posts.processDeletesIf TRUE (the default) events in the db but not in scheduleFileStrwill be deleted from the db. Set to FALSE if you are applying a schedule patch (e.g. a schedule file with a single new event).makeForumPostsAdds forum posts to each Event forum’s thread announcing the changes that were made to the event. 
 View on GitHub
            View on GitHub
           EventParser Class Reference
      EventParser Class Reference