Merge pull request #16 from yaslab/hotfix/circular-reference
Fix circular reference
This commit is contained in:
commit
24a63ffc49
|
@ -14,7 +14,7 @@ internal let defaultDelimiter = UnicodeScalar(UInt8(0x2c)) // ","
|
||||||
internal let defaultWhitespaces = CharacterSet.whitespaces
|
internal let defaultWhitespaces = CharacterSet.whitespaces
|
||||||
|
|
||||||
/// No overview available.
|
/// No overview available.
|
||||||
public struct CSVConfiguration {
|
public class CSVConfiguration {
|
||||||
|
|
||||||
public var errorHandler: ((Error, Int, Int) -> Void)? = nil
|
public var errorHandler: ((Error, Int, Int) -> Void)? = nil
|
||||||
|
|
||||||
|
|
|
@ -21,7 +21,7 @@ extension CSV: IteratorProtocol, Sequence {
|
||||||
extension CSV {
|
extension CSV {
|
||||||
|
|
||||||
/// No overview available.
|
/// No overview available.
|
||||||
public struct Row: RandomAccessCollection {
|
public class Row: RandomAccessCollection {
|
||||||
|
|
||||||
private let data: [String]
|
private let data: [String]
|
||||||
private let headerRow: [String]?
|
private let headerRow: [String]?
|
||||||
|
|
|
@ -60,8 +60,8 @@ public class CSV {
|
||||||
let input = reader.makeUInt8Iterator()
|
let input = reader.makeUInt8Iterator()
|
||||||
let iterator = UnicodeIterator(input: input, inputEncodingType: codecType)
|
let iterator = UnicodeIterator(input: input, inputEncodingType: codecType)
|
||||||
try self.init(iterator: iterator, config: config)
|
try self.init(iterator: iterator, config: config)
|
||||||
input.errorHandler = self.errorHandler
|
input.errorHandler = { [unowned self] in self.errorHandler(error: $0) }
|
||||||
iterator.errorHandler = self.errorHandler
|
iterator.errorHandler = { [unowned self] in self.errorHandler(error: $0) }
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Create an instance with `InputStream`.
|
/// Create an instance with `InputStream`.
|
||||||
|
@ -82,8 +82,8 @@ public class CSV {
|
||||||
let input = reader.makeUInt16Iterator()
|
let input = reader.makeUInt16Iterator()
|
||||||
let iterator = UnicodeIterator(input: input, inputEncodingType: codecType)
|
let iterator = UnicodeIterator(input: input, inputEncodingType: codecType)
|
||||||
try self.init(iterator: iterator, config: config)
|
try self.init(iterator: iterator, config: config)
|
||||||
input.errorHandler = self.errorHandler
|
input.errorHandler = { [unowned self] in self.errorHandler(error: $0) }
|
||||||
iterator.errorHandler = self.errorHandler
|
iterator.errorHandler = { [unowned self] in self.errorHandler(error: $0) }
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Create an instance with `InputStream`.
|
/// Create an instance with `InputStream`.
|
||||||
|
@ -104,8 +104,8 @@ public class CSV {
|
||||||
let input = reader.makeUInt32Iterator()
|
let input = reader.makeUInt32Iterator()
|
||||||
let iterator = UnicodeIterator(input: input, inputEncodingType: codecType)
|
let iterator = UnicodeIterator(input: input, inputEncodingType: codecType)
|
||||||
try self.init(iterator: iterator, config: config)
|
try self.init(iterator: iterator, config: config)
|
||||||
input.errorHandler = self.errorHandler
|
input.errorHandler = { [unowned self] in self.errorHandler(error: $0) }
|
||||||
iterator.errorHandler = self.errorHandler
|
iterator.errorHandler = { [unowned self] in self.errorHandler(error: $0) }
|
||||||
}
|
}
|
||||||
|
|
||||||
// MARK: - Parse CSV
|
// MARK: - Parse CSV
|
||||||
|
|
Loading…
Reference in New Issue