Skip to content

DotIni is a library for .Net that allows you to read, convert and save ini files, important for envinronment variables.

License

Notifications You must be signed in to change notification settings

brokenegg-io/Brokenegg.DotIni

Repository files navigation

Brokenegg.io DotIni

GitHub License Version Actions Actions GitHub branch checks state GitHub code size in bytes NuGet Downloads

drawing

DotIni is a library for .Net that allows you to serialize and deserialize INI files. This is not a Json/XML (des)serializer in any way, shape or form, it is intended to work only with ini files as shown bellow:

[section]
attribute=value

We are currently in alpha version and we advise to not use in a production environment in any way whatsoever.

Quick links

Installation

Our profile on the NuGet library brokenegg.io

Use the package manager NuGet to install DotIni.

nuget install brokenegg.dotini

Usage

Serializing

using Brokenegg.DotIni;

//instantiating the inifile object
var iniFile = new IniFile();

//adding section
iniFile.AddSection("section");

//adding key-par
iniFile.AddKeyParLastSection("lang", "enUS");

//parsing to string
var content = IniConvert.SerializeObject(file);

The serialization value in the variable content should be this one:

[section]
lang=enUS

Deserializing

using System.IO;
using Brokenegg.DotIni;

// reading a file
var file = File.ReadAllLines("test.ini");

//parsing file
var iniFile = IniConvert.DeserializeObject(file);

iniFile will be the instance of Brokenegg.DotIni.IniFile, responsible for handling the sections and key-par values of an INI file.

Contributing

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.

Please make sure to update tests as appropriate.

[email protected]

Roadmap

  • Implement basic serialization and deserialization to be used. Planned to v0.0.4;
  • Cover at least 60% of the projects on unity tests. Planned to v0.1.0;
  • Allow to convert any class into an INI file structure. Planned to v0.2.0;
  • Start github wiki page and begin documentation;
  • Convert values from Key-par values to String/Int/Decimal and Date. Planned to v0.3.0.

License

MIT

About

DotIni is a library for .Net that allows you to read, convert and save ini files, important for envinronment variables.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages