swiftyfinch / Frog

Tiny utility for read and write file line by line in Swift.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Frog

Version CI Status
Swift Version Platform License
Twitter

Tiny utility for read and write file line by line in Swift. I wrote this for easier work with files in some algorithms implementations. In some cases read and write line by line in Swift take a lot of part of an implementation.

  • Automatically closing a file after deinit a frog;
  • You don't need to work with pointers explicitly;
  • Read and write line by line in one line.
Read:
let path = "path/to/your/file"
let input = Frog(path)

if let newLine = input.readLine() {
  print(newLine)
}
Write:
let path = "path/to/your/file"
let output = Frog(path, mode: .w)
output.write(line: "Croak-croak")

Example

To run the example project, clone the repo, and run pod install from the Example directory first.

Installation

Frog is available through CocoaPods. To install it, simply add the following line to your Podfile:

pod 'Frog'

Author

Vyacheslav Khorkov, artfintch@ya.ru

License

Frog is available under the MIT license. See the LICENSE file for more info.

About

Tiny utility for read and write file line by line in Swift.

License:MIT License


Languages

Language:Swift 85.8%Language:Ruby 14.2%