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

Last change on this file since 357 was 351, checked in by alloc, 6 years ago

Fixed game version compatibility of GamePrefs
Code style cleanup (mostly argument names)

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