11# SwiftCSV
22
3- ![ Swift 5.0 ] ( https://img.shields.io/badge/Swift-5.0 -blue.svg?style=flat )
4- [ ![ Platform support] ( https://img.shields.io/badge/platform-ios%20%7C%20osx%20%7C%20tvos%20%7C%20watchos-lightgrey.svg?style=flat-square )] ( https://github.com/swiftcsv/SwiftCSV/blob/master/LICENSE.md )
5- [ ![ Build Status] ( https://img.shields.io/travis/swiftcsv/SwiftCSV/master.svg?style=flat-square )] ( https://travis-ci.org/swiftcsv/SwiftCSV )
3+ ![ Swift 5.3 ] ( https://img.shields.io/badge/Swift-5.3 -blue.svg?style=flat )
4+ [ ![ Platform support] ( https://img.shields.io/badge/platform-ios%20%7C%20osx%20%7C%20tvos%20%7C%20watchos-lightgrey.svg?style=flat-square )] ( https://github.com/swiftcsv/SwiftCSV/blob/master/LICENSE.md )
5+ [ ![ Build Status] ( https://img.shields.io/travis/swiftcsv/SwiftCSV/master.svg?style=flat-square )] ( https://travis-ci.org/swiftcsv/SwiftCSV )
66[ ![ Code coverage status] ( https://codecov.io/gh/swiftcsv/SwiftCSV/branch/master/graph/badge.svg )] ( https://codecov.io/gh/swiftcsv/SwiftCSV )
7- [ ![ CocoaPods Compatible] ( https://img.shields.io/cocoapods/v/SwiftCSV.svg?style=flat-square )] ( https://cocoapods.org/pods/SwiftCSV )
7+ [ ![ CocoaPods Compatible] ( https://img.shields.io/cocoapods/v/SwiftCSV.svg?style=flat-square )] ( https://cocoapods.org/pods/SwiftCSV )
88[ ![ Carthage compatible] ( https://img.shields.io/badge/Carthage-compatible-4BC51D.svg?style=flat )] ( https://github.com/Carthage/Carthage )
9- [ ![ License MIT] ( https://img.shields.io/badge/license-MIT-blue.svg?style=flat-square )] ( https://github.com/swiftcsv/SwiftCSV/blob/master/LICENSE.md )
9+ [ ![ License MIT] ( https://img.shields.io/badge/license-MIT-blue.svg?style=flat-square )] ( https://github.com/swiftcsv/SwiftCSV/blob/master/LICENSE.md )
1010[ ![ Reviewed by Hound] ( https://img.shields.io/badge/Reviewed_by-Hound-8E64B0.svg?style=flat-square )] ( https://houndci.com )
1111
1212
3131
3232 // From a file inside the app bundle, with a custom delimiter, errors, and custom encoding
3333 let resource: CSV? = try CSV (
34- name : " users" ,
35- extension : " tsv" ,
36- bundle : .main ,
37- delimiter : " \t " ,
34+ name : " users" ,
35+ extension : " tsv" ,
36+ bundle : .main ,
37+ delimiter : " \t " ,
3838 encoding : .utf8 )
3939} catch parseError as CSVParseError {
4040 // Catch errors from parsing invalid formed CSV
@@ -55,10 +55,10 @@ class CSV {
5555 /// - parameter delimiter: Character used to separate row and header fields (default is ',')
5656 /// - parameter loadColumns: Whether to populate the `columns` dictionary (default is `true`)
5757 /// - throws: `CSVParseError` when parsing `string` fails.
58- public init (string : String ,
59- delimiter : Character = comma,
58+ public init (string : String ,
59+ delimiter : Character = comma,
6060 loadColumns : Bool = true ) throws
61-
61+
6262 /// Load a CSV file as a named resource from `bundle`.
6363 ///
6464 /// - parameter name: Name of the file resource inside `bundle`.
@@ -70,11 +70,11 @@ class CSV {
7070 /// - throws: `CSVParseError` when parsing the contents of the resource fails, or file loading errors.
7171 /// - returns: `nil` if the resource could not be found
7272 public convenience init? (
73- name : String ,
74- extension ext : String ? = nil ,
75- bundle : Bundle = .main ,
76- delimiter : Character = comma,
77- encoding : String .Encoding = .utf8 ,
73+ name : String ,
74+ extension ext : String ? = nil ,
75+ bundle : Bundle = .main ,
76+ delimiter : Character = comma,
77+ encoding : String .Encoding = .utf8 ,
7878 loadColumns : Bool = true ) throws
7979
8080 /// Load a CSV file from `url`.
@@ -85,9 +85,9 @@ class CSV {
8585 /// - parameter loadColumns: Whether to populate the columns dictionary (default is `true`)
8686 /// - throws: `CSVParseError` when parsing the contents of `url` fails, or file loading errors.
8787 public convenience init (
88- url : URL,
89- delimiter : Character = comma,
90- encoding : String .Encoding = .utf8 ,
88+ url : URL,
89+ delimiter : Character = comma,
90+ encoding : String .Encoding = .utf8 ,
9191 loadColumns : Bool = true )
9292}
9393
0 commit comments