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