A pure-Swift implementation of the INI config parser
.package(url: "https://github.com/Ponyboy47/ConfigParser.git", from: "0.4.0")
import ConfigParser
let confString = """
[section1]
key1 = value1
key2 = 1, 2, 3, 4
[section2]
key1 = test
key2 = 1234
"""
let config = try ConfigParser.parse(confString)
// Use subscripts to get the value you want in the type you want
let key1s1: String? = config[section: "section1", key: "key1"] // Optional<String>(value1)
let key2s1 = config[section: "section2", key: "key1", default: [4, 3, 2, 1]] // [1, 2, 3, 4]
Supported Types:
MIT
link |
Stars: 5 |
Last commit: 4 years ago |
Swiftpack is being maintained by Petr Pavlik | @ptrpavlik | @swiftpackco | API | Analytics