Swiftpack.co - griffin-stewie/LTSV.swift as Swift Package

Swiftpack.co is a collection of thousands of indexed Swift packages. Search packages.
See all packages published by griffin-stewie.
griffin-stewie/LTSV.swift v0.2.0
LTSV Decoder / Encoder written in Swift
⭐️ 0
🕓 1 week ago
.package(url: "https://github.com/griffin-stewie/LTSV.swift.git", from: "v0.2.0")

LTSV.swift

LTSV Decoder / Encoder written in Swift

Installation

LTSV.swift requires Xcode 12.4 or a Swift 5.3+ toolchain with the Swift Package Manager

Swift Package Manager

// dependencies
.package(url: "https://github.com/griffin-stewie/LTSV.swift", .upToNextMinor(from: "0.1.0")),
// target.dependencies
.product(name: "LTSV", package: "LTSV.swift")

CococaPods

I won't support it.

Carthage

I won't support it.

Usage

LTSV.swift supports Codable types.

import Foundation
import LTSV

struct Model: Codable {
    let label1: String
    let label2: String
}

let string = "label1:value1\tlabel2:value2"

let decoder = LTSVDecoder()
let model = try decoder.decode(Model.self, from: string)

let encoder = LTSVEncoder()
let result = try encoder.encode(model)

print(result)
// label1:value1\tlabel2:value2

It supports lines of LTSV strings into Array of Codable type as well.

License

MIT licensed.

GitHub

link
Stars: 0
Last commit: 1 week ago
jonrohan Something's broken? Yell at me @ptrpavlik. Praise and feedback (and money) is also welcome.

Release Notes

v0.1.0
37 weeks ago

First release

Swiftpack is being maintained by Petr Pavlik | @ptrpavlik | @swiftpackco | API | Analytics