File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -14,13 +14,13 @@ let package = Package(
1414 ] ,
1515
1616 dependencies: [
17- . package ( url : " https://github.com/orchetect/OTCore " , from : " 1.1.10 " )
17+ // none
1818 ] ,
1919
2020 targets: [
2121 . target(
2222 name: " TextFileKit " ,
23- dependencies: [ " OTCore " ] ) ,
23+ dependencies: [ ] ) ,
2424 . testTarget(
2525 name: " TextFileKitTests " ,
2626 dependencies: [ " TextFileKit " ] )
Original file line number Diff line number Diff line change @@ -42,7 +42,11 @@ extension StringTable {
4242 public subscript( safe row: Int , col: Int ) -> Element . Element ? {
4343
4444 get {
45- self [ safe: row] ? [ safe: col]
45+ guard self . indices. contains ( row) ,
46+ self [ row] . indices. contains ( col)
47+ else { return nil }
48+
49+ return self [ row] [ col]
4650 }
4751 set {
4852 guard row < self . rowCount,
Original file line number Diff line number Diff line change 33// TextFileKit • https://github.com/orchetect/TextFileKit
44//
55
6- @ _implementationOnly import OTCore
6+ import Foundation
77
88extension TextFile {
99
@@ -17,7 +17,7 @@ extension TextFile {
1717 // MARK: - Constants
1818
1919 internal static let sepChar : Character = " , "
20- internal static let newLineChar : Character = Character . newLine
20+ internal static let newLineChar : Character = " \n "
2121
2222 public static let fileExtension = " csv "
2323
@@ -57,10 +57,10 @@ extension TextFile {
5757 return outString
5858
5959 }
60- . joined ( separator: Self . sepChar. string )
60+ . joined ( separator: String ( Self . sepChar) )
6161
6262 }
63- . joined ( separator: Self . newLineChar. string )
63+ . joined ( separator: String ( Self . newLineChar) )
6464
6565 }
6666
Original file line number Diff line number Diff line change 33// TextFileKit • https://github.com/orchetect/TextFileKit
44//
55
6- @ _implementationOnly import OTCore
6+ import Foundation
77
88extension TextFile {
99
@@ -15,7 +15,7 @@ extension TextFile {
1515 // MARK: - Constants
1616
1717 internal static let sepChar : Character = " \t "
18- internal static let newLineChar : Character = Character . newLine
18+ internal static let newLineChar : Character = " \n "
1919
2020 public static let fileExtension = " tsv "
2121
@@ -64,10 +64,10 @@ extension TextFile {
6464 return outString
6565
6666 }
67- . joined ( separator: Self . sepChar. string )
67+ . joined ( separator: String ( Self . sepChar) )
6868
6969 }
70- . joined ( separator: Self . newLineChar. string )
70+ . joined ( separator: String ( Self . newLineChar) )
7171
7272 }
7373
Original file line number Diff line number Diff line change 1+ //
2+ // Utilities.swift
3+ // TextFileKit • https://github.com/orchetect/TextFileKit
4+ //
5+
6+ import Foundation
7+
8+ extension String {
9+
10+ /// Wrap a string with double-quotes.
11+ @inlinable internal var quoted : Self {
12+ " \" \( self ) \" "
13+ }
14+
15+ }
You can’t perform that action at this time.
0 commit comments