aboutsummaryrefslogtreecommitdiff
path: root/Sources/NorgKit/Models/NorgTask.swift
blob: 7eb5c534dc912e2bc429219316b825d9e2749fa6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
import Foundation

/// A single norg task / TODO.
public struct NorgTask: Identifiable, Equatable, Hashable, Sendable, Codable {

  public let fileURL: URL
  /// This is zero-indexed
  public let line: Int
  public var status: TaskStatus
  public let text: String

  public init(fileURL: URL, line: Int, status: TaskStatus, text: String) {
    self.fileURL = fileURL
    self.line = line
    self.status = status
    self.text = text
  }

  public var id: String { "\(fileURL.absoluteString):\(line)" }
}