Tries to convert itself to a Sofu.Map.
| C# |
public virtual Map AsMap()
Returns itself. But you can be sure it is a Map
Sofu.Sofu.Map file = SofuReader.LoadFile("file.sofu"); try { foreach (KeyValuePair<string,Sofu.SofuObject> entry in file) { Sofu.Sofu.Map mymap = entry.Value.AsMap(); mymap.Write(entry.Key+".sofu"); //Splits one .sofu into Sub Trees. } } catch (SofuNotMapException e) { Console.Out.WriteLine("text was not a map"); }
| Exception | Condition |
|---|---|
| SofuNotMapException | Gets thrown if the Object is not a Map |