source: binary-improvements/7dtd-server-fixes/src/JSON/JSONArray.cs@ 168

Last change on this file since 168 was 154, checked in by alloc, 10 years ago

fixes

File size: 548 bytes
Line 
1using System;
2using System.Collections.Generic;
3using System.Text;
4
5namespace AllocsFixes.JSON
6{
7 public class JSONArray : JSONNode
8 {
9 private List<JSONNode> nodes = new List<JSONNode> ();
10
11 public void Add (JSONNode node)
12 {
13 nodes.Add(node);
14 }
15
16 public override string ToString ()
17 {
18 StringBuilder sb = new StringBuilder ("[");
19 foreach (JSONNode n in nodes) {
20 sb.Append (n.ToString ());
21 sb.Append (",");
22 }
23 if (sb.Length > 1)
24 sb.Remove (sb.Length - 1, 1);
25 sb.Append ("]");
26 return sb.ToString ();
27 }
28
29 }
30}
31
Note: See TracBrowser for help on using the repository browser.