Skip to content
Piotr Szkudlarski edited this page Dec 13, 2018 · 15 revisions

IniWrapper

IniWrapper uses reflection to bind value read from ini file to provided model. The purpose of this library is NOT parsing ini file, but to wrap it to provide easier use of existing parsing libraries. In configuration there is possibility to pass IniParser interface, which is used as file access layer. This library provides class that wraps Windows C++ methods to retrieve values from ini file.

It's really easy to use. No more magic strings and operating on Dictionaries.

Code example:

var iniWrapperFactory = new IniWrapperFactory();
var iniWrapper = iniWrapperFactory.CreateWithDefaultIniParser(x =>
{
    x.IniFilePath = "test.ini";
});

iniWrapper.LoadConfiguration<TestConfiguration>();
iniWrapper.SaveConfiguration(new TestConfiguration());

If you find any bug or come up with an idea how to make this library better, feel free to raise an issue.

Clone this wiki locally