Skip to content

A proof of concept to an implementation of an INI deserializer.

Notifications You must be signed in to change notification settings

Eyal-Archive/IniSerialization

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

IniSerialization

This library is responsible to read and manipulate INI files.

Currently, it contains a parser and a pretty basic deserializer.

Build Requirements

  • .NET Framework 4.6.1

Examples

Deserializing an INI string into a data structure.

private static void Main(string[] args)
{
	IniSerializer serializer = new IniSerializer();

	const string data = @"	Name = Just an example
					
							[Application]
							Path = X:\Application\app.exe
							Options = /x /y";

	Settings settings = serializer.Deserilize<Settings>(data);

	Console.WriteLine("\r\n {0}\r\n\r\n {1} {2}", settings.Name, settings.Application.Path, settings.Application.Options);

	Console.ReadKey(true);
}

Parsing the data into array from a collection.

private static void Main(string[] args)
{
	const string data = @"	Name = Just an example
					
							[Application]
							Path = X:\Application\app.exe
							Options = /x /y";

	IniSectionCollection sections = IniSectionCollection.Parse(data);

	string[] array = sections.ToStringArray();

	foreach (var item in array)
	{
		Console.WriteLine(item);
	}

	Console.ReadKey(true);
}

About

A proof of concept to an implementation of an INI deserializer.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published