Rev | Line | |
---|
[188] | 1 | using System;
|
---|
[309] | 2 | using System.Text;
|
---|
[188] | 3 |
|
---|
| 4 | namespace AllocsFixes.JSON
|
---|
| 5 | {
|
---|
[279] | 6 | public class JSONNull : JSONValue
|
---|
[188] | 7 | {
|
---|
| 8 | public JSONNull ()
|
---|
| 9 | {
|
---|
| 10 | }
|
---|
| 11 |
|
---|
[309] | 12 | public override void ToString (StringBuilder stringBuilder, bool prettyPrint = false, int currentLevel = 0)
|
---|
[188] | 13 | {
|
---|
[309] | 14 | stringBuilder.Append ("null");
|
---|
[188] | 15 | }
|
---|
| 16 |
|
---|
| 17 | public static JSONNull Parse (string json, ref int offset)
|
---|
| 18 | {
|
---|
| 19 | //Log.Out ("ParseNull enter (" + offset + ")");
|
---|
| 20 |
|
---|
| 21 | if (json.Substring (offset, 4).Equals ("null")) {
|
---|
| 22 | //Log.Out ("JSON:Parsed Null");
|
---|
| 23 | offset += 4;
|
---|
| 24 | return new JSONNull ();
|
---|
| 25 | } else {
|
---|
| 26 | throw new MalformedJSONException ("No valid null value found");
|
---|
| 27 | }
|
---|
| 28 | }
|
---|
| 29 |
|
---|
| 30 | }
|
---|
| 31 | }
|
---|
| 32 |
|
---|
Note:
See
TracBrowser
for help on using the repository browser.