source: binary-improvements/7dtd-server-fixes/src/JSON/JSONNull.cs@ 193

Last change on this file since 193 was 188, checked in by alloc, 10 years ago

fixes

File size: 568 bytes
Line 
1using System;
2
3namespace AllocsFixes.JSON
4{
5 public class JSONNull : JSONNode
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.