diff --git a/JSONValue.cs b/JSONValue.cs index f725b69..2d01da4 100644 --- a/JSONValue.cs +++ b/JSONValue.cs @@ -9,6 +9,7 @@ // **/ using System; using System.Collections.Generic; +using ln.json.mapping; namespace ln.json { public enum JSONValueType @@ -41,5 +42,10 @@ namespace ln.json } public override string ToString() => throw new NotImplementedException(); + + public static implicit operator JSONValue(String text) => new JSONString(text); + public static implicit operator JSONValue(bool b) => b ? (JSONValue)JSONTrue.Instance : (JSONValue)JSONFalse.Instance; + public static implicit operator JSONValue(int i) => new JSONNumber(i); + public static implicit operator JSONValue(double d) => new JSONNumber(d); } }