- Timestamp:
- Aug 9, 2017, 7:43:07 PM (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
binary-improvements/7dtd-server-fixes/src/JSON/JSONArray.cs
r187 r309 23 23 } 24 24 25 public override string ToString (bool prettyPrint = false, int currentLevel = 0)25 public override void ToString (StringBuilder stringBuilder, bool prettyPrint = false, int currentLevel = 0) 26 26 { 27 StringBuilder sb = new StringBuilder("[");27 stringBuilder.Append ("["); 28 28 if (prettyPrint) 29 s b.Append ('\n');29 stringBuilder.Append ('\n'); 30 30 foreach (JSONNode n in nodes) { 31 31 if (prettyPrint) 32 s b.Append (new String ('\t', currentLevel + 1));33 sb.Append (n.ToString (prettyPrint, currentLevel + 1));34 s b.Append (",");32 stringBuilder.Append (new String ('\t', currentLevel + 1)); 33 n.ToString (stringBuilder, prettyPrint, currentLevel + 1); 34 stringBuilder.Append (","); 35 35 if (prettyPrint) 36 s b.Append ('\n');36 stringBuilder.Append ('\n'); 37 37 } 38 if (s b.Length > 1)39 s b.Remove (sb.Length - (prettyPrint ? 2 : 1), 1);38 if (stringBuilder.Length > 1) 39 stringBuilder.Remove (stringBuilder.Length - (prettyPrint ? 2 : 1), 1); 40 40 if (prettyPrint) 41 sb.Append (new String ('\t', currentLevel)); 42 sb.Append ("]"); 43 return sb.ToString (); 41 stringBuilder.Append (new String ('\t', currentLevel)); 42 stringBuilder.Append ("]"); 44 43 } 45 44
Note:
See TracChangeset
for help on using the changeset viewer.