Perfect INI File Parser 简体中文
This project provides an express parser for INI files.
This package builds with Swift Package Manager of Swift 4 Tool Chain and is part of the Perfect project but can be used as an independent module.
.package(url: "https://github.com/PerfectlySoft/Perfect-INIParser.git", from: "3.0.0") ... .target( name: "YourProjectName", dependencies: ["INIParser"]),
Import library into your code:
Load the objective INI file by initializing a
let ini = try INIParser("/path/to/somefile.ini")
Then it should be possible to access variables inside the file.
Variables with Specific Section
For most regular lines under a certain section, use
sections attribute of
INIParser. Take example:
[GroupA] myVariable = myValue
let v = ini.sections["GroupA"]?["myVariable"] will get the value as
Variables without Section
However, some ini files may not have any available sections but directly put all variables together:
freeVar1 = 1
In this case, call
anonymousSection to load the corresponding value:
let v = ini.anonymousSection["freeVar1"]
We are transitioning to using JIRA for all bugs and support related issues, therefore the GitHub issues has been disabled.
If you find a mistake, bug, or any other helpful suggestion you'd like to make on the docs please head over to http://jira.perfect.org:8080/servicedesk/customer/portal/1 and raise it.
A comprehensive list of open issues can be found at http://jira.perfect.org:8080/projects/ISS/issues
For more information on the Perfect project, please visit perfect.org.
Now WeChat Subscription is Available 🇨🇳