Tries to convert itself to a Sofu.Map.
Declaration Syntax
C# |
public virtual Map AsMap()
Return Value
Returns itself. But you can be sure it is a Map
Examples
CopyC#
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"); }
Exceptions
Exception | Condition |
---|---|
SofuNotMapException | Gets thrown if the Object is not a Map |