public Guk ToGuk() { Guk guk = new Guk(); guk.SetType(Type, false); if (isSub) { guk.SetAttr("isSub", null); } Entries.ForEachPairs((index, entry) => { Guk sub = guk.CreateSubNode(StrGen.Start("<").Append(entry.species).Append(':').Append(index).Append(" />").End); sub.SetAttr("name", entry.name, false); sub.SetAttr("type", entry.type, false); entry.Flags.ForEachPairs((k, v) => sub.SetAttr(k, v, false)); }); return(guk); }
public string Serialize() { StrGen.Builder builder = StrGen.GetBuilder(); int lastRow = 0; DoCell((row, col, cellValue) => { if (row != lastRow) { builder.Append("\n"); lastRow = row; } if (col != 0) { builder.Append(","); } AppendString(builder, cellValue); }); return(builder.GetStringAndRelease()); }
public ID Append(string subId) { open_id = StrGen.Start(open_id).Append('.').Append(subId).End; return(this); }
public override string ToString() { return(Reduce(StrGen.Start("GapSeq<{0}>({1}):", typeof(T).Name, Count), (s, t) => s[" "][t]).End); }