Skip to content

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

License

Notifications You must be signed in to change notification settings

swiftyfinch/Frog

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

33 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published