- Timestamp:
- Aug 7, 2022, 3:02:24 PM (2 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
binary-improvements2/7dtd-server-fixes/src/JSON/JSONString.cs
r389 r391 2 2 3 3 namespace AllocsFixes.JSON { 4 public class J SONString : JSONValue {4 public class JsonString : JsonValue { 5 5 private readonly string value; 6 6 7 public J SONString (string _value) {7 public JsonString (string _value) { 8 8 value = _value; 9 9 } … … 14 14 15 15 public override void ToString (StringBuilder _stringBuilder, bool _prettyPrint = false, int _currentLevel = 0) { 16 if ( value == null || value.Length == 0) {16 if (string.IsNullOrEmpty (value)) { 17 17 _stringBuilder.Append ("\"\""); 18 18 return; … … 64 64 } 65 65 66 public static J SONString Parse (string _json, ref int _offset) {66 public static JsonString Parse (string _json, ref int _offset) { 67 67 //Log.Out ("ParseString enter (" + offset + ")"); 68 68 StringBuilder sb = new StringBuilder (); … … 104 104 105 105 //Log.Out ("JSON:Parsed String: " + sb.ToString ()); 106 return new J SONString (sb.ToString ());106 return new JsonString (sb.ToString ()); 107 107 default: 108 108 sb.Append (_json [_offset]); … … 112 112 } 113 113 114 throw new MalformedJ SONException ("End of JSON reached before parsing string finished");114 throw new MalformedJsonException ("End of JSON reached before parsing string finished"); 115 115 } 116 116
Note:
See TracChangeset
for help on using the changeset viewer.