perfectlysoft/perfect-iniparser
This project provides an express parser for [INI](https://en.wikipedia.org/wiki/INI_file) files.
Quick Start
Configure Package.swift:
.package(url: "https://github.com/PerfectlySoft/Perfect-INIParser.git", from: "3.0.0")
...
.target( name: "YourProjectName",
dependencies: ["INIParser"]),
Import library into your code:
import INIParserLoad the objective INI file by initializing a INIParser object:
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 = myValueThen let v = ini.sections["GroupA"]?["myVariable"] will get the value as "myValue".
Variables without Section
However, some ini files may not have any available sections but directly put all variables together:
freeVar1 = 1In this case, call anonymousSection to load the corresponding value:
let v = ini.anonymousSection["freeVar1"]Further Information
For more information on the Perfect project, please visit perfect.org.
Now WeChat Subscription is Available π¨π³
<p align=center><img src="https://raw.githubusercontent.com/PerfectExamples/Perfect-Cloudinary-ImageUploader-Demo/master/qr.png"></p>
Package Metadata
Repository: perfectlysoft/perfect-iniparser
Default branch: master
README: README.md