source: binary-improvements2/7dtd-server-fixes/src/JSON/JSONNull.cs@ 390

Last change on this file since 390 was 389, checked in by alloc, 2 years ago

Finished up REST API base
Made API handler look for APIs in all loaded mods

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