Line | |
---|
1 | using System;
|
---|
2 | using System.Collections.Generic;
|
---|
3 | using System.Text;
|
---|
4 |
|
---|
5 | namespace 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.