Sofu for .Net
This library requires at least .Net Framework 2.0 (unless you compile it yourself).
The interface is excatly like the one from SofuD, except two things:
- The call to read a file is called: SofuReader.LoadFile(filename), because you can't have namespace static funktions..
- All methodname start with a Capital letter, (so IsMap() instead of isMap()). Only exceptions map(), list() and value() would clash with their constructors..., so they still start with a small letter
How to get Sofu.Net
Download the latest Sofu.dll with documentation from Sourceforge
Get the latest sources
How to use it
There is quick and easy method for distributing .Net Libraries that I know of, so:
Simply copy the Sofu.dll somewhere, right click on References in your Project Explorer, and add the Sofu.dll in the dialog (under Brows) that comes up when you click "Add References"
Alternatively you can add the sources to your project and select those in the same dialog somewhere
Sofu.Net Examples
Reading a .sofu file and printing the top-level keys and objects to the console
using Sofu.Sofu; using System.Collections.Generic; Sofu.Map file = SofuReader.LoadFile("test.sofu"); foreach (KeyValuePair<string,Sofu.SofuObject> entry in file) { Console.Out.Write("Key : "); Console.Out.Write(entry.Key); Console.Out.Write(", Object : "); Console.Out.WriteLine(entry.Value.TypeString()); }
Sofu.Net News
0.2.1 is out now supports binary and SofuML; Documentation updated as well.
Sofu.Net does not support binary sofu as of now, but the next version will
The SofuBrowser is written using the Sofu.Net library and might serve as a reference for using it