Line
struct Line: Identifiable, Equatable, Codable
A line in the Section
This is a line in the source document, parsed into components
-
The unique ID of the line
Note
This is the line number in the sourceDeclaration
Swift
var id: Int
-
The line number in the ChordPro document
Declaration
Swift
var sourceLineNumber: Int = 0
-
The
Environment
of the lineDeclaration
Swift
var environment: ChordPro.Environment = .none
-
The
Directive
of the sectionDeclaration
Swift
var directive: ChordPro.Directive = .unknown
-
The optional arguments of the directive
Declaration
Swift
var arguments: ChordProParser.Arguments?
-
The source of the line
Declaration
Swift
var source: String = ""
-
Optional warnings about the content of the line
Declaration
Swift
private(set) var warnings: Set<String>?
-
The optional parts in the line
A part mostly consist of some text with a chord
Declaration
Swift
var parts: [Part]?
-
The optional grid in the line
Declaration
Swift
private(set) var grid: [Grid]?
-
The optional strum pattern in the line
Declaration
Swift
var strum: [String]?
-
The calculated label of the directive
Declaration
Swift
var label: String
-
Add a single of warning to the set of warnings
Note
warnings are optionals so we can not just ‘insert’ itDeclaration
Swift
mutating func addWarning(_ warning: String)
-
Add a set of warnings
Declaration
Swift
mutating func addWarning(_ warning: Set<String>)
-
Note
grids are optionals so we can not just ‘insert’ itDeclaration
Swift
mutating func addGrid(_ grid: Grid)
-
Declaration
Swift
struct Grid: Identifiable, Equatable, Codable
-
Declaration
Swift
struct Part: Identifiable, Equatable, Codable
-
Convert strum characters in the source to fancy symbols
Declaration
Swift
static var strumCharacterDict: [String: String]