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

Last change on this file since 293 was 279, checked in by alloc, 8 years ago

Mod stuff

File size: 569 bytes
RevLine 
[188]1using System;
2
3namespace AllocsFixes.JSON
4{
[279]5 public class JSONNull : JSONValue
[188]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.