File tree 5 files changed +30
-11
lines changed
5 files changed +30
-11
lines changed Original file line number Diff line number Diff line change @@ -14,13 +14,13 @@ let package = Package(
14
14
] ,
15
15
16
16
dependencies: [
17
- . package ( url : " https://github.com/orchetect/OTCore " , from : " 1.1.10 " )
17
+ // none
18
18
] ,
19
19
20
20
targets: [
21
21
. target(
22
22
name: " TextFileKit " ,
23
- dependencies: [ " OTCore " ] ) ,
23
+ dependencies: [ ] ) ,
24
24
. testTarget(
25
25
name: " TextFileKitTests " ,
26
26
dependencies: [ " TextFileKit " ] )
Original file line number Diff line number Diff line change @@ -42,7 +42,11 @@ extension StringTable {
42
42
public subscript( safe row: Int , col: Int ) -> Element . Element ? {
43
43
44
44
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]
46
50
}
47
51
set {
48
52
guard row < self . rowCount,
Original file line number Diff line number Diff line change 3
3
// TextFileKit • https://github.com/orchetect/TextFileKit
4
4
//
5
5
6
- @ _implementationOnly import OTCore
6
+ import Foundation
7
7
8
8
extension TextFile {
9
9
@@ -17,7 +17,7 @@ extension TextFile {
17
17
// MARK: - Constants
18
18
19
19
internal static let sepChar : Character = " , "
20
- internal static let newLineChar : Character = Character . newLine
20
+ internal static let newLineChar : Character = " \n "
21
21
22
22
public static let fileExtension = " csv "
23
23
@@ -57,10 +57,10 @@ extension TextFile {
57
57
return outString
58
58
59
59
}
60
- . joined ( separator: Self . sepChar. string )
60
+ . joined ( separator: String ( Self . sepChar) )
61
61
62
62
}
63
- . joined ( separator: Self . newLineChar. string )
63
+ . joined ( separator: String ( Self . newLineChar) )
64
64
65
65
}
66
66
Original file line number Diff line number Diff line change 3
3
// TextFileKit • https://github.com/orchetect/TextFileKit
4
4
//
5
5
6
- @ _implementationOnly import OTCore
6
+ import Foundation
7
7
8
8
extension TextFile {
9
9
@@ -15,7 +15,7 @@ extension TextFile {
15
15
// MARK: - Constants
16
16
17
17
internal static let sepChar : Character = " \t "
18
- internal static let newLineChar : Character = Character . newLine
18
+ internal static let newLineChar : Character = " \n "
19
19
20
20
public static let fileExtension = " tsv "
21
21
@@ -64,10 +64,10 @@ extension TextFile {
64
64
return outString
65
65
66
66
}
67
- . joined ( separator: Self . sepChar. string )
67
+ . joined ( separator: String ( Self . sepChar) )
68
68
69
69
}
70
- . joined ( separator: Self . newLineChar. string )
70
+ . joined ( separator: String ( Self . newLineChar) )
71
71
72
72
}
73
73
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