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

Last change on this file since 340 was 326, checked in by alloc, 6 years ago

More cleanup, allocation improvements

File size: 566 bytes
Line 
1using System.Text;
2
3namespace AllocsFixes.JSON {
4 public class JSONNull : JSONValue {
5 public override void ToString (StringBuilder stringBuilder, bool prettyPrint = false, int currentLevel = 0) {
6 stringBuilder.Append ("null");
7 }
8
9 public static JSONNull Parse (string json, ref int offset) {
10 //Log.Out ("ParseNull enter (" + offset + ")");
11
12 if (!json.Substring (offset, 4).Equals ("null")) {
13 throw new MalformedJSONException ("No valid null value found");
14 }
15
16 //Log.Out ("JSON:Parsed Null");
17 offset += 4;
18 return new JSONNull ();
19 }
20 }
21}
Note: See TracBrowser for help on using the repository browser.